react-input-emoji 5.8.1 → 5.9.0
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/index.es.js +23 -3
- package/dist/index.es.js.map +1 -1
- package/dist/index.js +23 -3
- package/dist/index.js.map +1 -1
- package/dist/src/utils/input-event-utils.d.ts +9 -2
- package/package.json +1 -1
package/dist/index.js.map
CHANGED
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"index.js","sources":["../node_modules/style-inject/dist/style-inject.es.js","../src/utils/emoji-utils.js","../src/utils/input-event-utils.js","../node_modules/string-replace-to-array/string-replace-to-array.js","../node_modules/react-easy-emoji/lib/replaceEmoji.js","../node_modules/react-easy-emoji/lib/makeTwemojiRenderer.js","../node_modules/react-easy-emoji/index.js","../src/hooks/use-sanitize.js","../src/hooks/use-expose.js","../src/hooks/use-emit.js","../src/text-input.js","../src/components/emoji-picker-button.js","../node_modules/@emoji-mart/react/dist/module.js","../src/components/emoji-picker.js","../src/components/emoji-picker-container.js","../src/components/emoji-picker-wrapper.js","../src/utils/mention-utils.js","../src/hooks/use-mention.js","../src/components/mention-user-list.js","../src/components/mention-wrapper.js","../src/utils/observer.js","../src/hooks/use-event-listeners.js","../src/hooks/user-pollute.js","../src/index.js"],"sourcesContent":["function styleInject(css, ref) {\n if ( ref === void 0 ) ref = {};\n var insertAt = ref.insertAt;\n\n if (!css || typeof document === 'undefined') { return; }\n\n var head = document.head || document.getElementsByTagName('head')[0];\n var style = document.createElement('style');\n style.type = 'text/css';\n\n if (insertAt === 'top') {\n if (head.firstChild) {\n head.insertBefore(style, head.firstChild);\n } else {\n head.appendChild(style);\n }\n } else {\n head.appendChild(style);\n }\n\n if (style.styleSheet) {\n style.styleSheet.cssText = css;\n } else {\n style.appendChild(document.createTextNode(css));\n }\n}\n\nexport default styleInject;\n","/* eslint-disable valid-jsdoc */\n// @ts-check\n\nexport const TRANSPARENT_GIF =\n \"data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7\";\n\nexport const EMOJI_STYLE = \"\";\n\n/**\n * Replace all text with emoji with an image html tag\n * @param {string} text\n * @return {string}\n */\nexport function replaceAllTextEmojis(text) {\n let allEmojis = getAllEmojisFromText(text);\n\n if (allEmojis) {\n allEmojis = [...new Set(allEmojis)]; // remove duplicates\n\n allEmojis.forEach(emoji => {\n text = replaceAll(text, emoji, getInputEmojiHTML('', emoji));\n });\n }\n\n return text;\n}\n\n/**\n * Replace all occurrencies in a string\n * @param {string} str\n * @param {string} find\n * @param {string} replace\n * @return {string}\n */\nfunction replaceAll(str, find, replace) {\n return str.replace(new RegExp(find, \"g\"), replace);\n}\n\n/**\n * Get all emojis from the text\n * @param {string} text\n * @return {string[]}\n */\nfunction getAllEmojisFromText(text) {\n return text.match(\n /(?:[\\u2700-\\u27bf]|(?:\\ud83c[\\udde6-\\uddff]){2}|[\\ud800-\\udbff][\\udc00-\\udfff])[\\ufe0e\\ufe0f]?(?:[\\u0300-\\u036f\\ufe20-\\ufe23\\u20d0-\\u20f0]|\\ud83c[\\udffb-\\udfff])?(?:\\u200d(?:[^\\ud800-\\udfff]|(?:\\ud83c[\\udde6-\\uddff]){2}|[\\ud800-\\udbff][\\udc00-\\udfff])[\\ufe0e\\ufe0f]?(?:[\\u0300-\\u036f\\ufe20-\\ufe23\\u20d0-\\u20f0]|\\ud83c[\\udffb-\\udfff])?)*/g\n );\n}\n\n// eslint-disable-next-line valid-jsdoc\n/**\n *\n * @param { import(\"../types/types\").EmojiMartItem } emoji\n * @return {string}\n */\nexport function getImageEmoji(emoji) {\n /** @type {HTMLElement | null} */\n const emojiPickerEl = document.querySelector('em-emoji-picker')\n\n if (!emojiPickerEl) {\n return getInputEmojiNativeHTML(emoji.native)\n }\n\n /** @type {HTMLSpanElement | null=} */\n const emojiSpanEl = emojiPickerEl?.shadowRoot?.querySelector(`[title=\"${emoji.name}\"] > span > span`)\n\n if (!emojiSpanEl) {\n return getInputEmojiNativeHTML(emoji.native)\n }\n\n const style = replaceAll(emojiSpanEl.style.cssText, '\"', \"'\");\n\n return getInputEmojiHTML(style, emoji.native);\n}\n\n// eslint-disable-next-line valid-jsdoc\n/**\n *\n * @param {string} style\n * @param {string} emoji\n * @returns\n */\nfunction getInputEmojiHTML(style, emoji) {\n return `<img style=\"${style}; display: inline-block\" data-emoji=\"${emoji}\" src=\"${TRANSPARENT_GIF}\" />`;\n}\n\n/**\n * \n * @param {string} emoji \n * @returns \n */\nfunction getInputEmojiNativeHTML(emoji) {\n return `<span class=\"width: 18px; height: 18px; display: inline-block; margin: 0 1px;\">${emoji}</span>`;\n}\n\n/**\n *\n * @param {string} html\n * @return {string}\n */\nexport function replaceAllTextEmojiToString(html) {\n const container = document.createElement(\"div\");\n container.innerHTML = html;\n\n const images = Array.prototype.slice.call(container.querySelectorAll(\"img\"));\n\n images.forEach(image => {\n container.innerHTML = container.innerHTML.replace(\n image.outerHTML,\n image.dataset.emoji\n );\n });\n\n return container.innerHTML;\n}\n","// @ts-check\n\nimport {\n getImageEmoji,\n replaceAllTextEmojis,\n replaceAllTextEmojiToString,\n} from \"./emoji-utils\";\n\n/**\n * Handle copy of current selected text\n * @param {React.ClipboardEvent} event\n */\nexport function handleCopy(event) {\n const selectedText = window.getSelection();\n\n if (selectedText === null) {\n return;\n }\n\n let container = document.createElement(\"div\");\n\n for (let i = 0, len = selectedText.rangeCount; i < len; ++i) {\n container.appendChild(selectedText.getRangeAt(i).cloneContents());\n }\n\n container = replaceEmojiToString(container);\n\n event.clipboardData.setData(\"text\", container.innerText);\n event.preventDefault();\n}\n\n/**\n *\n * @param {string} html\n */\nexport function handlePasteHtmlAtCaret(html) {\n let sel;\n let range;\n if (window.getSelection) {\n // IE9 and non-IE\n sel = window.getSelection();\n\n if (sel === null) return;\n\n if (sel.getRangeAt && sel.rangeCount) {\n range = sel.getRangeAt(0);\n range.deleteContents();\n\n // Range.createContextualFragment() would be useful here but is\n // non-standard and not supported in all browsers (IE9, for one)\n const el = document.createElement(\"div\");\n el.innerHTML = html;\n const frag = document.createDocumentFragment();\n let node;\n let lastNode;\n while ((node = el.firstChild)) {\n lastNode = frag.appendChild(node);\n }\n range.insertNode(frag);\n\n // Preserve the selection\n if (lastNode) {\n range = range.cloneRange();\n range.setStartAfter(lastNode);\n range.collapse(true);\n sel.removeAllRanges();\n sel.addRange(range);\n }\n }\n }\n}\n\n/**\n * Replace emoji img to its string value\n * @param {HTMLDivElement} container\n * @return {HTMLDivElement}\n */\nfunction replaceEmojiToString(container) {\n const images = Array.prototype.slice.call(container.querySelectorAll(\"img\"));\n\n images.forEach((image) => {\n image.outerHTML = image.dataset.emoji;\n });\n\n return container;\n}\n\n/**\n * Handle past on input\n * @param {React.ClipboardEvent} event\n */\nexport function handlePaste(event) {\n event.preventDefault();\n let content;\n if (event.clipboardData) {\n content = event.clipboardData.getData(\"text/plain\");\n content = replaceAllTextEmojis(content);\n document.execCommand(\"insertHTML\", false, content);\n }\n}\n\n/**\n * @typedef {object} HandleKeyDownOptions\n * @property {HTMLDivElement} placeholderEl\n * @property {number} maxLength\n * @property {HTMLDivElement} inputEl\n * @property {React.MutableRefObject<string>} cleanedTextRef\n * @property {React.MutableRefObject<HTMLDivElement>} textInputRef\n * @property {boolean} cleanOnEnter\n * @property {function(): void} emitChange\n * @property {(function(string): void)=} onEnter\n * @property {(function(KeyboardEvent): void)=} onKeyDown\n * @property {(function(string): void)} updateHTML\n */\n\n// eslint-disable-next-line valid-jsdoc\n/**\n * @typedef {Object} HandleSelectEmojiProps\n * @property {import(\"../types/types\").EmojiMartItem} emoji\n * @property {React.MutableRefObject<import('../text-input').Ref>} textInputRef\n * @property {boolean} keepOpened\n * @property {() => void} toggleShowPicker\n * @property {number=} maxLength\n */\n\n/**\n *\n * @param {HandleSelectEmojiProps} props\n */\nexport function handleSelectEmoji({\n emoji,\n textInputRef,\n keepOpened,\n toggleShowPicker,\n maxLength,\n}) {\n if (\n typeof maxLength !== \"undefined\" &&\n totalCharacters(textInputRef.current) >= maxLength\n ) {\n return;\n }\n\n textInputRef.current.appendContent(getImageEmoji(emoji));\n\n if (!keepOpened) {\n toggleShowPicker();\n }\n}\n\n/**\n *\n * @param {{text: string, html: string}} props\n * @return {number}\n */\nexport function totalCharacters({ text, html }) {\n const textCount = text.length;\n const emojisCount = (html.match(/<img/g) || []).length;\n\n return textCount + emojisCount;\n}\n\n// eslint-disable-next-line valid-jsdoc\n/**\n * Handle keyup event\n * @param {() => void} emitChange\n * @param {(event: KeyboardEvent) => void} onKeyDownMention\n * @param {React.MutableRefObject<string>} cleanedTextRef\n * @param {React.MutableRefObject<HTMLDivElement>} textInputRef\n * @return {(event: KeyboardEvent) => void}\n */\nexport function handleKeyup(\n emitChange,\n onKeyDownMention,\n cleanedTextRef,\n textInputRef,\n) {\n return (event) => {\n const text = replaceAllTextEmojiToString(textInputRef.current.innerHTML);\n cleanedTextRef.current = text;\n emitChange();\n onKeyDownMention(event);\n };\n}\n\n/**\n * Handle focus event\n * @param {function(FocusEvent): void} onFocus\n * @return {function(FocusEvent): void}\n */\nexport function handleFocus(onFocus) {\n return (event) => {\n onFocus(event);\n };\n}\n\n/**\n * Set caret to the end of text value\n * @param {React.MutableRefObject<HTMLDivElement| null>} input\n */\nexport function moveCaretToEnd(input) {\n let range;\n let selection;\n if (document.createRange && input.current) {\n range = document.createRange();\n range.selectNodeContents(input.current);\n range.collapse(false);\n selection = window.getSelection();\n if (selection) {\n selection.removeAllRanges();\n selection.addRange(range);\n }\n }\n}\n/**\n *\n * @param {HTMLDivElement} inputDiv\n * @return {string}\n */\nexport function removeHtmlExceptBr(inputDiv) {\n const temp = inputDiv.innerHTML.replaceAll(/<br\\s*\\/?>/gi, \"[BR]\"); // temporarily replace <br> with placeholder\n const tempContainer = document.createElement(\"div\");\n tempContainer.innerHTML = temp;\n const stripped = tempContainer.innerText; // strip all html tags\n const final = stripped.replaceAll(/\\[BR\\]/gi, \"</br>\"); // replace placeholders with <br>\n return final;\n}\n\n/**\n * \n * @param {*} range \n * @returns \n */\nexport function getSelectionStart(range) {\n let node = range.startContainer;\n let offset = range.startOffset;\n\n // Handle cases where the selection start node is not a text node\n if (node.nodeType !== Node.TEXT_NODE) {\n while (node.nodeType !== Node.TEXT_NODE) {\n node = node.nextSibling;\n if (!node) break;\n }\n if (!node) {\n node = range.commonAncestorContainer;\n while (node.nodeType !== Node.TEXT_NODE) {\n node = node.firstChild;\n }\n }\n offset = 0;\n }\n\n return { node, offset };\n}\n\n/**\n * \n * @return {Object} cursor\n */\nexport function getCursor() {\n const selection = window.getSelection();\n const range = selection.getRangeAt(0);\n const selectionStart = getSelectionStart(range);\n\n return {selection, range, selectionStart}\n}\n\n/**\n *\n */\nexport function addLineBreak() {\n const { selection, range, selectionStart } = getCursor()\n\n // If cursor is at the end of the text content, add one more line break\n if (\n selection.isCollapsed &&\n selectionStart.offset === selectionStart.node.textContent.length\n ) {\n const br = document.createElement(\"br\");\n range.insertNode(br);\n range.setStartAfter(br);\n range.setEndAfter(br);\n selection.removeAllRanges();\n selection.addRange(range);\n\n const br2 = document.createElement(\"br\");\n range.insertNode(br2);\n range.setStartAfter(br2);\n range.setEndAfter(br2);\n selection.removeAllRanges();\n selection.addRange(range);\n } else {\n const br = document.createElement(\"br\");\n range.insertNode(br);\n range.setStartAfter(br);\n range.setEndAfter(br);\n selection.removeAllRanges();\n selection.addRange(range);\n // Set cursor position right before the first letter after the line break\n if (\n selectionStart.node.nextSibling &&\n selectionStart.node.nextSibling.nodeType === Node.TEXT_NODE\n ) {\n range.setStart(selectionStart.node.nextSibling, 1);\n range.setEnd(selectionStart.node.nextSibling, 1);\n }\n selection.removeAllRanges();\n selection.addRange(range);\n }\n}\n","// Inspiration: https://github.com/facebook/react/issues/3386\n\nfunction replace (string, regexpOrSubstr, newValueOrFn, globalOffset) {\n\tif (typeof string !== 'string') throw new Error('First param must be a string')\n\tif (typeof regexpOrSubstr !== 'string' && !(regexpOrSubstr instanceof RegExp)) throw new Error('Second param must be a string pattern or a regular expression')\n\n\tvar fn = (typeof regexpOrSubstr === 'string') ? replaceUsingString : replaceUsingRegexp\n\n\treturn fn(string, regexpOrSubstr, newValueOrFn, globalOffset)\n}\n\nfunction replaceUsingString (string, patternString, newValueOrFn, globalOffset) {\n\tvar index = string.indexOf(patternString)\n\n\tif (index >= 0) {\n\t\tvar arr = []\n\t\tvar endIndex = index + patternString.length\n\n\t\tif (index > 0) {\n\t\t\tarr.push(string.substring(0, index))\n\t\t}\n\n\t\tarr.push(\n\t\t\t(typeof newValueOrFn === 'function') ?\n\t\t\t\tnewValueOrFn(\n\t\t\t\t\tstring.substring(index, endIndex),\n\t\t\t\t\tindex + globalOffset,\n\t\t\t\t\tstring\n\t\t\t\t) :\n\t\t\t\tnewValueOrFn\n\t\t)\n\n\t\tif (endIndex < string.length) {\n\t\t\tarr.push(string.substring(endIndex))\n\t\t}\n\n\t\treturn arr\n\t} else {\n\t\treturn [string]\n\t}\n}\n\nfunction replaceUsingRegexp (string, regexp, newValueOrFn, globalOffset) {\n\tvar output = []\n\n\tvar replacerIsFn = (typeof newValueOrFn === 'function')\n\n\tvar storedLastIndex = regexp.lastIndex\n\tregexp.lastIndex = 0\n\n\tvar result\n\tvar lastIndex = 0\n\twhile (result = regexp.exec(string)) {\n\t\tvar index = result.index\n\n\t\tif (result[0] === '') {\n\t\t\t// When the regexp is an empty string\n\t\t\t// we still want to advance our cursor to the next item.\n\t\t\t// This is the behavior of String.replace.\n\t\t\tregexp.lastIndex++\n\t\t}\n\n\t\tif (index !== lastIndex) {\n\t\t\toutput.push(string.substring(lastIndex, index))\n\t\t}\n\n\t\tvar match = result[0]\n\t\tlastIndex = index + match.length\n\t\t\n\t\tvar out = replacerIsFn ?\n\t\t\tnewValueOrFn.apply(this, result.concat(index + globalOffset, result.input)) :\n\t\t\tnewValueOrFn\n\t\toutput.push(out)\n\n\t\tif (!regexp.global) {\n\t\t\tbreak\n\t\t}\n\t}\n\n\tif (lastIndex < string.length) {\n\t\toutput.push(string.substring(lastIndex))\n\t}\n\n\tregexp.lastIndex = storedLastIndex\n\treturn output\n}\n\nmodule.exports = function stringReplaceToArray (stringOrArray, regexpOrSubstr, newSubStrOrFn) {\n\tif (typeof stringOrArray === 'string') {\n\t\treturn replace(stringOrArray, regexpOrSubstr, newSubStrOrFn, 0)\n\t} else if (!Array.isArray(stringOrArray) || !stringOrArray[0]) {\n\t\tthrow new TypeError('First argument must be an array or non-empty string')\n\t} else {\n\t\tvar len = stringOrArray.length\n\t\tvar output = []\n\t\tvar globalOffset = 0\n\t\tfor (var i = 0; i < len; ++i) {\n\t\t\tvar arrayItem = stringOrArray[i]\n\t\t\tif (typeof arrayItem === 'string') {\n\t\t\t\toutput.push.apply(output, replace(arrayItem, regexpOrSubstr, newSubStrOrFn, globalOffset))\n\t\t\t\tglobalOffset += arrayItem.length\n\t\t\t} else {\n\t\t\t\toutput.push(arrayItem)\n\t\t\t}\n\t\t}\n\t\treturn output\n\t}\n}","var replaceStringToArray = require('string-replace-to-array')\n\n// This is based off of https://github.com/twitter/twemoji/blob/gh-pages/2/twemoji.js\n//\n// Ideally we'd use twemoji instead of replicating its logic.\n// The reason we can't is that we need to run our own replace.\n//\n// We could use it for most things (by essentially running twemoji.parse for each\n// regex match, and reading the code from the callback), but the one thing we'd always need\n// to copy and paste into this file is the regex since we need it to run the replace.\n//\n// Another option is to fork twemoji and expose a method in it that could help us, then\n// ask them to pull it in.\n//\n\n// RegExp based on emoji's official Unicode standards\n// http://www.unicode.org/Public/UNIDATA/EmojiSources.txt\nvar re = /(?:\\ud83d\\udc68\\ud83c\\udffb\\u200d\\u2764\\ufe0f\\u200d\\ud83d\\udc8b\\u200d\\ud83d\\udc68\\ud83c[\\udffb-\\udfff]|\\ud83d\\udc68\\ud83c\\udffc\\u200d\\u2764\\ufe0f\\u200d\\ud83d\\udc8b\\u200d\\ud83d\\udc68\\ud83c[\\udffb-\\udfff]|\\ud83d\\udc68\\ud83c\\udffd\\u200d\\u2764\\ufe0f\\u200d\\ud83d\\udc8b\\u200d\\ud83d\\udc68\\ud83c[\\udffb-\\udfff]|\\ud83d\\udc68\\ud83c\\udffe\\u200d\\u2764\\ufe0f\\u200d\\ud83d\\udc8b\\u200d\\ud83d\\udc68\\ud83c[\\udffb-\\udfff]|\\ud83d\\udc68\\ud83c\\udfff\\u200d\\u2764\\ufe0f\\u200d\\ud83d\\udc8b\\u200d\\ud83d\\udc68\\ud83c[\\udffb-\\udfff]|\\ud83d\\udc69\\ud83c\\udffb\\u200d\\u2764\\ufe0f\\u200d\\ud83d\\udc8b\\u200d\\ud83d\\udc68\\ud83c[\\udffb-\\udfff]|\\ud83d\\udc69\\ud83c\\udffb\\u200d\\u2764\\ufe0f\\u200d\\ud83d\\udc8b\\u200d\\ud83d\\udc69\\ud83c[\\udffb-\\udfff]|\\ud83d\\udc69\\ud83c\\udffc\\u200d\\u2764\\ufe0f\\u200d\\ud83d\\udc8b\\u200d\\ud83d\\udc68\\ud83c[\\udffb-\\udfff]|\\ud83d\\udc69\\ud83c\\udffc\\u200d\\u2764\\ufe0f\\u200d\\ud83d\\udc8b\\u200d\\ud83d\\udc69\\ud83c[\\udffb-\\udfff]|\\ud83d\\udc69\\ud83c\\udffd\\u200d\\u2764\\ufe0f\\u200d\\ud83d\\udc8b\\u200d\\ud83d\\udc68\\ud83c[\\udffb-\\udfff]|\\ud83d\\udc69\\ud83c\\udffd\\u200d\\u2764\\ufe0f\\u200d\\ud83d\\udc8b\\u200d\\ud83d\\udc69\\ud83c[\\udffb-\\udfff]|\\ud83d\\udc69\\ud83c\\udffe\\u200d\\u2764\\ufe0f\\u200d\\ud83d\\udc8b\\u200d\\ud83d\\udc68\\ud83c[\\udffb-\\udfff]|\\ud83d\\udc69\\ud83c\\udffe\\u200d\\u2764\\ufe0f\\u200d\\ud83d\\udc8b\\u200d\\ud83d\\udc69\\ud83c[\\udffb-\\udfff]|\\ud83d\\udc69\\ud83c\\udfff\\u200d\\u2764\\ufe0f\\u200d\\ud83d\\udc8b\\u200d\\ud83d\\udc68\\ud83c[\\udffb-\\udfff]|\\ud83d\\udc69\\ud83c\\udfff\\u200d\\u2764\\ufe0f\\u200d\\ud83d\\udc8b\\u200d\\ud83d\\udc69\\ud83c[\\udffb-\\udfff]|\\ud83e\\uddd1\\ud83c\\udffb\\u200d\\u2764\\ufe0f\\u200d\\ud83d\\udc8b\\u200d\\ud83e\\uddd1\\ud83c[\\udffc-\\udfff]|\\ud83e\\uddd1\\ud83c\\udffc\\u200d\\u2764\\ufe0f\\u200d\\ud83d\\udc8b\\u200d\\ud83e\\uddd1\\ud83c[\\udffb\\udffd-\\udfff]|\\ud83e\\uddd1\\ud83c\\udffd\\u200d\\u2764\\ufe0f\\u200d\\ud83d\\udc8b\\u200d\\ud83e\\uddd1\\ud83c[\\udffb\\udffc\\udffe\\udfff]|\\ud83e\\uddd1\\ud83c\\udffe\\u200d\\u2764\\ufe0f\\u200d\\ud83d\\udc8b\\u200d\\ud83e\\uddd1\\ud83c[\\udffb-\\udffd\\udfff]|\\ud83e\\uddd1\\ud83c\\udfff\\u200d\\u2764\\ufe0f\\u200d\\ud83d\\udc8b\\u200d\\ud83e\\uddd1\\ud83c[\\udffb-\\udffe]|\\ud83d\\udc68\\ud83c\\udffb\\u200d\\u2764\\ufe0f\\u200d\\ud83d\\udc68\\ud83c[\\udffb-\\udfff]|\\ud83d\\udc68\\ud83c\\udffb\\u200d\\ud83e\\udd1d\\u200d\\ud83d\\udc68\\ud83c[\\udffc-\\udfff]|\\ud83d\\udc68\\ud83c\\udffc\\u200d\\u2764\\ufe0f\\u200d\\ud83d\\udc68\\ud83c[\\udffb-\\udfff]|\\ud83d\\udc68\\ud83c\\udffc\\u200d\\ud83e\\udd1d\\u200d\\ud83d\\udc68\\ud83c[\\udffb\\udffd-\\udfff]|\\ud83d\\udc68\\ud83c\\udffd\\u200d\\u2764\\ufe0f\\u200d\\ud83d\\udc68\\ud83c[\\udffb-\\udfff]|\\ud83d\\udc68\\ud83c\\udffd\\u200d\\ud83e\\udd1d\\u200d\\ud83d\\udc68\\ud83c[\\udffb\\udffc\\udffe\\udfff]|\\ud83d\\udc68\\ud83c\\udffe\\u200d\\u2764\\ufe0f\\u200d\\ud83d\\udc68\\ud83c[\\udffb-\\udfff]|\\ud83d\\udc68\\ud83c\\udffe\\u200d\\ud83e\\udd1d\\u200d\\ud83d\\udc68\\ud83c[\\udffb-\\udffd\\udfff]|\\ud83d\\udc68\\ud83c\\udfff\\u200d\\u2764\\ufe0f\\u200d\\ud83d\\udc68\\ud83c[\\udffb-\\udfff]|\\ud83d\\udc68\\ud83c\\udfff\\u200d\\ud83e\\udd1d\\u200d\\ud83d\\udc68\\ud83c[\\udffb-\\udffe]|\\ud83d\\udc69\\ud83c\\udffb\\u200d\\u2764\\ufe0f\\u200d\\ud83d\\udc68\\ud83c[\\udffb-\\udfff]|\\ud83d\\udc69\\ud83c\\udffb\\u200d\\u2764\\ufe0f\\u200d\\ud83d\\udc69\\ud83c[\\udffb-\\udfff]|\\ud83d\\udc69\\ud83c\\udffb\\u200d\\ud83e\\udd1d\\u200d\\ud83d\\udc68\\ud83c[\\udffc-\\udfff]|\\ud83d\\udc69\\ud83c\\udffb\\u200d\\ud83e\\udd1d\\u200d\\ud83d\\udc69\\ud83c[\\udffc-\\udfff]|\\ud83d\\udc69\\ud83c\\udffc\\u200d\\u2764\\ufe0f\\u200d\\ud83d\\udc68\\ud83c[\\udffb-\\udfff]|\\ud83d\\udc69\\ud83c\\udffc\\u200d\\u2764\\ufe0f\\u200d\\ud83d\\udc69\\ud83c[\\udffb-\\udfff]|\\ud83d\\udc69\\ud83c\\udffc\\u200d\\ud83e\\udd1d\\u200d\\ud83d\\udc68\\ud83c[\\udffb\\udffd-\\udfff]|\\ud83d\\udc69\\ud83c\\udffc\\u200d\\ud83e\\udd1d\\u200d\\ud83d\\udc69\\ud83c[\\udffb\\udffd-\\udfff]|\\ud83d\\udc69\\ud83c\\udffd\\u200d\\u2764\\ufe0f\\u200d\\ud83d\\udc68\\ud83c[\\udffb-\\udfff]|\\ud83d\\udc69\\ud83c\\udffd\\u200d\\u2764\\ufe0f\\u200d\\ud83d\\udc69\\ud83c[\\udffb-\\udfff]|\\ud83d\\udc69\\ud83c\\udffd\\u200d\\ud83e\\udd1d\\u200d\\ud83d\\udc68\\ud83c[\\udffb\\udffc\\udffe\\udfff]|\\ud83d\\udc69\\ud83c\\udffd\\u200d\\ud83e\\udd1d\\u200d\\ud83d\\udc69\\ud83c[\\udffb\\udffc\\udffe\\udfff]|\\ud83d\\udc69\\ud83c\\udffe\\u200d\\u2764\\ufe0f\\u200d\\ud83d\\udc68\\ud83c[\\udffb-\\udfff]|\\ud83d\\udc69\\ud83c\\udffe\\u200d\\u2764\\ufe0f\\u200d\\ud83d\\udc69\\ud83c[\\udffb-\\udfff]|\\ud83d\\udc69\\ud83c\\udffe\\u200d\\ud83e\\udd1d\\u200d\\ud83d\\udc68\\ud83c[\\udffb-\\udffd\\udfff]|\\ud83d\\udc69\\ud83c\\udffe\\u200d\\ud83e\\udd1d\\u200d\\ud83d\\udc69\\ud83c[\\udffb-\\udffd\\udfff]|\\ud83d\\udc69\\ud83c\\udfff\\u200d\\u2764\\ufe0f\\u200d\\ud83d\\udc68\\ud83c[\\udffb-\\udfff]|\\ud83d\\udc69\\ud83c\\udfff\\u200d\\u2764\\ufe0f\\u200d\\ud83d\\udc69\\ud83c[\\udffb-\\udfff]|\\ud83d\\udc69\\ud83c\\udfff\\u200d\\ud83e\\udd1d\\u200d\\ud83d\\udc68\\ud83c[\\udffb-\\udffe]|\\ud83d\\udc69\\ud83c\\udfff\\u200d\\ud83e\\udd1d\\u200d\\ud83d\\udc69\\ud83c[\\udffb-\\udffe]|\\ud83e\\uddd1\\ud83c\\udffb\\u200d\\u2764\\ufe0f\\u200d\\ud83e\\uddd1\\ud83c[\\udffc-\\udfff]|\\ud83e\\uddd1\\ud83c\\udffb\\u200d\\ud83e\\udd1d\\u200d\\ud83e\\uddd1\\ud83c[\\udffb-\\udfff]|\\ud83e\\uddd1\\ud83c\\udffc\\u200d\\u2764\\ufe0f\\u200d\\ud83e\\uddd1\\ud83c[\\udffb\\udffd-\\udfff]|\\ud83e\\uddd1\\ud83c\\udffc\\u200d\\ud83e\\udd1d\\u200d\\ud83e\\uddd1\\ud83c[\\udffb-\\udfff]|\\ud83e\\uddd1\\ud83c\\udffd\\u200d\\u2764\\ufe0f\\u200d\\ud83e\\uddd1\\ud83c[\\udffb\\udffc\\udffe\\udfff]|\\ud83e\\uddd1\\ud83c\\udffd\\u200d\\ud83e\\udd1d\\u200d\\ud83e\\uddd1\\ud83c[\\udffb-\\udfff]|\\ud83e\\uddd1\\ud83c\\udffe\\u200d\\u2764\\ufe0f\\u200d\\ud83e\\uddd1\\ud83c[\\udffb-\\udffd\\udfff]|\\ud83e\\uddd1\\ud83c\\udffe\\u200d\\ud83e\\udd1d\\u200d\\ud83e\\uddd1\\ud83c[\\udffb-\\udfff]|\\ud83e\\uddd1\\ud83c\\udfff\\u200d\\u2764\\ufe0f\\u200d\\ud83e\\uddd1\\ud83c[\\udffb-\\udffe]|\\ud83e\\uddd1\\ud83c\\udfff\\u200d\\ud83e\\udd1d\\u200d\\ud83e\\uddd1\\ud83c[\\udffb-\\udfff]|\\ud83d\\udc68\\u200d\\u2764\\ufe0f\\u200d\\ud83d\\udc8b\\u200d\\ud83d\\udc68|\\ud83d\\udc69\\u200d\\u2764\\ufe0f\\u200d\\ud83d\\udc8b\\u200d\\ud83d[\\udc68\\udc69]|\\ud83e\\udef1\\ud83c\\udffb\\u200d\\ud83e\\udef2\\ud83c[\\udffc-\\udfff]|\\ud83e\\udef1\\ud83c\\udffc\\u200d\\ud83e\\udef2\\ud83c[\\udffb\\udffd-\\udfff]|\\ud83e\\udef1\\ud83c\\udffd\\u200d\\ud83e\\udef2\\ud83c[\\udffb\\udffc\\udffe\\udfff]|\\ud83e\\udef1\\ud83c\\udffe\\u200d\\ud83e\\udef2\\ud83c[\\udffb-\\udffd\\udfff]|\\ud83e\\udef1\\ud83c\\udfff\\u200d\\ud83e\\udef2\\ud83c[\\udffb-\\udffe]|\\ud83d\\udc68\\u200d\\u2764\\ufe0f\\u200d\\ud83d\\udc68|\\ud83d\\udc69\\u200d\\u2764\\ufe0f\\u200d\\ud83d[\\udc68\\udc69]|\\ud83e\\uddd1\\u200d\\ud83e\\udd1d\\u200d\\ud83e\\uddd1|\\ud83d\\udc6b\\ud83c[\\udffb-\\udfff]|\\ud83d\\udc6c\\ud83c[\\udffb-\\udfff]|\\ud83d\\udc6d\\ud83c[\\udffb-\\udfff]|\\ud83d\\udc8f\\ud83c[\\udffb-\\udfff]|\\ud83d\\udc91\\ud83c[\\udffb-\\udfff]|\\ud83e\\udd1d\\ud83c[\\udffb-\\udfff]|\\ud83d[\\udc6b-\\udc6d\\udc8f\\udc91]|\\ud83e\\udd1d)|(?:\\ud83d[\\udc68\\udc69]|\\ud83e\\uddd1)(?:\\ud83c[\\udffb-\\udfff])?\\u200d(?:\\u2695\\ufe0f|\\u2696\\ufe0f|\\u2708\\ufe0f|\\ud83c[\\udf3e\\udf73\\udf7c\\udf84\\udf93\\udfa4\\udfa8\\udfeb\\udfed]|\\ud83d[\\udcbb\\udcbc\\udd27\\udd2c\\ude80\\ude92]|\\ud83e[\\uddaf-\\uddb3\\uddbc\\uddbd])|(?:\\ud83c[\\udfcb\\udfcc]|\\ud83d[\\udd74\\udd75]|\\u26f9)((?:\\ud83c[\\udffb-\\udfff]|\\ufe0f)\\u200d[\\u2640\\u2642]\\ufe0f)|(?:\\ud83c[\\udfc3\\udfc4\\udfca]|\\ud83d[\\udc6e\\udc70\\udc71\\udc73\\udc77\\udc81\\udc82\\udc86\\udc87\\ude45-\\ude47\\ude4b\\ude4d\\ude4e\\udea3\\udeb4-\\udeb6]|\\ud83e[\\udd26\\udd35\\udd37-\\udd39\\udd3d\\udd3e\\uddb8\\uddb9\\uddcd-\\uddcf\\uddd4\\uddd6-\\udddd])(?:\\ud83c[\\udffb-\\udfff])?\\u200d[\\u2640\\u2642]\\ufe0f|(?:\\ud83d\\udc68\\u200d\\ud83d\\udc68\\u200d\\ud83d\\udc66\\u200d\\ud83d\\udc66|\\ud83d\\udc68\\u200d\\ud83d\\udc68\\u200d\\ud83d\\udc67\\u200d\\ud83d[\\udc66\\udc67]|\\ud83d\\udc68\\u200d\\ud83d\\udc69\\u200d\\ud83d\\udc66\\u200d\\ud83d\\udc66|\\ud83d\\udc68\\u200d\\ud83d\\udc69\\u200d\\ud83d\\udc67\\u200d\\ud83d[\\udc66\\udc67]|\\ud83d\\udc69\\u200d\\ud83d\\udc69\\u200d\\ud83d\\udc66\\u200d\\ud83d\\udc66|\\ud83d\\udc69\\u200d\\ud83d\\udc69\\u200d\\ud83d\\udc67\\u200d\\ud83d[\\udc66\\udc67]|\\ud83d\\udc68\\u200d\\ud83d\\udc66\\u200d\\ud83d\\udc66|\\ud83d\\udc68\\u200d\\ud83d\\udc67\\u200d\\ud83d[\\udc66\\udc67]|\\ud83d\\udc68\\u200d\\ud83d\\udc68\\u200d\\ud83d[\\udc66\\udc67]|\\ud83d\\udc68\\u200d\\ud83d\\udc69\\u200d\\ud83d[\\udc66\\udc67]|\\ud83d\\udc69\\u200d\\ud83d\\udc66\\u200d\\ud83d\\udc66|\\ud83d\\udc69\\u200d\\ud83d\\udc67\\u200d\\ud83d[\\udc66\\udc67]|\\ud83d\\udc69\\u200d\\ud83d\\udc69\\u200d\\ud83d[\\udc66\\udc67]|\\ud83c\\udff3\\ufe0f\\u200d\\u26a7\\ufe0f|\\ud83c\\udff3\\ufe0f\\u200d\\ud83c\\udf08|\\ud83d\\ude36\\u200d\\ud83c\\udf2b\\ufe0f|\\u2764\\ufe0f\\u200d\\ud83d\\udd25|\\u2764\\ufe0f\\u200d\\ud83e\\ude79|\\ud83c\\udff4\\u200d\\u2620\\ufe0f|\\ud83d\\udc15\\u200d\\ud83e\\uddba|\\ud83d\\udc3b\\u200d\\u2744\\ufe0f|\\ud83d\\udc41\\u200d\\ud83d\\udde8|\\ud83d\\udc68\\u200d\\ud83d[\\udc66\\udc67]|\\ud83d\\udc69\\u200d\\ud83d[\\udc66\\udc67]|\\ud83d\\udc6f\\u200d\\u2640\\ufe0f|\\ud83d\\udc6f\\u200d\\u2642\\ufe0f|\\ud83d\\ude2e\\u200d\\ud83d\\udca8|\\ud83d\\ude35\\u200d\\ud83d\\udcab|\\ud83e\\udd3c\\u200d\\u2640\\ufe0f|\\ud83e\\udd3c\\u200d\\u2642\\ufe0f|\\ud83e\\uddde\\u200d\\u2640\\ufe0f|\\ud83e\\uddde\\u200d\\u2642\\ufe0f|\\ud83e\\udddf\\u200d\\u2640\\ufe0f|\\ud83e\\udddf\\u200d\\u2642\\ufe0f|\\ud83d\\udc08\\u200d\\u2b1b)|[#*0-9]\\ufe0f?\\u20e3|(?:[©®\\u2122\\u265f]\\ufe0f)|(?:\\ud83c[\\udc04\\udd70\\udd71\\udd7e\\udd7f\\ude02\\ude1a\\ude2f\\ude37\\udf21\\udf24-\\udf2c\\udf36\\udf7d\\udf96\\udf97\\udf99-\\udf9b\\udf9e\\udf9f\\udfcd\\udfce\\udfd4-\\udfdf\\udff3\\udff5\\udff7]|\\ud83d[\\udc3f\\udc41\\udcfd\\udd49\\udd4a\\udd6f\\udd70\\udd73\\udd76-\\udd79\\udd87\\udd8a-\\udd8d\\udda5\\udda8\\uddb1\\uddb2\\uddbc\\uddc2-\\uddc4\\uddd1-\\uddd3\\udddc-\\uddde\\udde1\\udde3\\udde8\\uddef\\uddf3\\uddfa\\udecb\\udecd-\\udecf\\udee0-\\udee5\\udee9\\udef0\\udef3]|[\\u203c\\u2049\\u2139\\u2194-\\u2199\\u21a9\\u21aa\\u231a\\u231b\\u2328\\u23cf\\u23ed-\\u23ef\\u23f1\\u23f2\\u23f8-\\u23fa\\u24c2\\u25aa\\u25ab\\u25b6\\u25c0\\u25fb-\\u25fe\\u2600-\\u2604\\u260e\\u2611\\u2614\\u2615\\u2618\\u2620\\u2622\\u2623\\u2626\\u262a\\u262e\\u262f\\u2638-\\u263a\\u2640\\u2642\\u2648-\\u2653\\u2660\\u2663\\u2665\\u2666\\u2668\\u267b\\u267f\\u2692-\\u2697\\u2699\\u269b\\u269c\\u26a0\\u26a1\\u26a7\\u26aa\\u26ab\\u26b0\\u26b1\\u26bd\\u26be\\u26c4\\u26c5\\u26c8\\u26cf\\u26d1\\u26d3\\u26d4\\u26e9\\u26ea\\u26f0-\\u26f5\\u26f8\\u26fa\\u26fd\\u2702\\u2708\\u2709\\u270f\\u2712\\u2714\\u2716\\u271d\\u2721\\u2733\\u2734\\u2744\\u2747\\u2757\\u2763\\u2764\\u27a1\\u2934\\u2935\\u2b05-\\u2b07\\u2b1b\\u2b1c\\u2b50\\u2b55\\u3030\\u303d\\u3297\\u3299])(?:\\ufe0f|(?!\\ufe0e))|(?:(?:\\ud83c[\\udfcb\\udfcc]|\\ud83d[\\udd74\\udd75\\udd90]|[\\u261d\\u26f7\\u26f9\\u270c\\u270d])(?:\\ufe0f|(?!\\ufe0e))|(?:\\ud83c[\\udf85\\udfc2-\\udfc4\\udfc7\\udfca]|\\ud83d[\\udc42\\udc43\\udc46-\\udc50\\udc66-\\udc69\\udc6e\\udc70-\\udc78\\udc7c\\udc81-\\udc83\\udc85-\\udc87\\udcaa\\udd7a\\udd95\\udd96\\ude45-\\ude47\\ude4b-\\ude4f\\udea3\\udeb4-\\udeb6\\udec0\\udecc]|\\ud83e[\\udd0c\\udd0f\\udd18-\\udd1c\\udd1e\\udd1f\\udd26\\udd30-\\udd39\\udd3d\\udd3e\\udd77\\uddb5\\uddb6\\uddb8\\uddb9\\uddbb\\uddcd-\\uddcf\\uddd1-\\udddd\\udec3-\\udec5\\udef0-\\udef6]|[\\u270a\\u270b]))(?:\\ud83c[\\udffb-\\udfff])?|(?:\\ud83c\\udff4\\udb40\\udc67\\udb40\\udc62\\udb40\\udc65\\udb40\\udc6e\\udb40\\udc67\\udb40\\udc7f|\\ud83c\\udff4\\udb40\\udc67\\udb40\\udc62\\udb40\\udc73\\udb40\\udc63\\udb40\\udc74\\udb40\\udc7f|\\ud83c\\udff4\\udb40\\udc67\\udb40\\udc62\\udb40\\udc77\\udb40\\udc6c\\udb40\\udc73\\udb40\\udc7f|\\ud83c\\udde6\\ud83c[\\udde8-\\uddec\\uddee\\uddf1\\uddf2\\uddf4\\uddf6-\\uddfa\\uddfc\\uddfd\\uddff]|\\ud83c\\udde7\\ud83c[\\udde6\\udde7\\udde9-\\uddef\\uddf1-\\uddf4\\uddf6-\\uddf9\\uddfb\\uddfc\\uddfe\\uddff]|\\ud83c\\udde8\\ud83c[\\udde6\\udde8\\udde9\\uddeb-\\uddee\\uddf0-\\uddf5\\uddf7\\uddfa-\\uddff]|\\ud83c\\udde9\\ud83c[\\uddea\\uddec\\uddef\\uddf0\\uddf2\\uddf4\\uddff]|\\ud83c\\uddea\\ud83c[\\udde6\\udde8\\uddea\\uddec\\udded\\uddf7-\\uddfa]|\\ud83c\\uddeb\\ud83c[\\uddee-\\uddf0\\uddf2\\uddf4\\uddf7]|\\ud83c\\uddec\\ud83c[\\udde6\\udde7\\udde9-\\uddee\\uddf1-\\uddf3\\uddf5-\\uddfa\\uddfc\\uddfe]|\\ud83c\\udded\\ud83c[\\uddf0\\uddf2\\uddf3\\uddf7\\uddf9\\uddfa]|\\ud83c\\uddee\\ud83c[\\udde8-\\uddea\\uddf1-\\uddf4\\uddf6-\\uddf9]|\\ud83c\\uddef\\ud83c[\\uddea\\uddf2\\uddf4\\uddf5]|\\ud83c\\uddf0\\ud83c[\\uddea\\uddec-\\uddee\\uddf2\\uddf3\\uddf5\\uddf7\\uddfc\\uddfe\\uddff]|\\ud83c\\uddf1\\ud83c[\\udde6-\\udde8\\uddee\\uddf0\\uddf7-\\uddfb\\uddfe]|\\ud83c\\uddf2\\ud83c[\\udde6\\udde8-\\udded\\uddf0-\\uddff]|\\ud83c\\uddf3\\ud83c[\\udde6\\udde8\\uddea-\\uddec\\uddee\\uddf1\\uddf4\\uddf5\\uddf7\\uddfa\\uddff]|\\ud83c\\uddf4\\ud83c\\uddf2|\\ud83c\\uddf5\\ud83c[\\udde6\\uddea-\\udded\\uddf0-\\uddf3\\uddf7-\\uddf9\\uddfc\\uddfe]|\\ud83c\\uddf6\\ud83c\\udde6|\\ud83c\\uddf7\\ud83c[\\uddea\\uddf4\\uddf8\\uddfa\\uddfc]|\\ud83c\\uddf8\\ud83c[\\udde6-\\uddea\\uddec-\\uddf4\\uddf7-\\uddf9\\uddfb\\uddfd-\\uddff]|\\ud83c\\uddf9\\ud83c[\\udde6\\udde8\\udde9\\uddeb-\\udded\\uddef-\\uddf4\\uddf7\\uddf9\\uddfb\\uddfc\\uddff]|\\ud83c\\uddfa\\ud83c[\\udde6\\uddec\\uddf2\\uddf3\\uddf8\\uddfe\\uddff]|\\ud83c\\uddfb\\ud83c[\\udde6\\udde8\\uddea\\uddec\\uddee\\uddf3\\uddfa]|\\ud83c\\uddfc\\ud83c[\\uddeb\\uddf8]|\\ud83c\\uddfd\\ud83c\\uddf0|\\ud83c\\uddfe\\ud83c[\\uddea\\uddf9]|\\ud83c\\uddff\\ud83c[\\udde6\\uddf2\\uddfc]|\\ud83c[\\udccf\\udd8e\\udd91-\\udd9a\\udde6-\\uddff\\ude01\\ude32-\\ude36\\ude38-\\ude3a\\ude50\\ude51\\udf00-\\udf20\\udf2d-\\udf35\\udf37-\\udf7c\\udf7e-\\udf84\\udf86-\\udf93\\udfa0-\\udfc1\\udfc5\\udfc6\\udfc8\\udfc9\\udfcf-\\udfd3\\udfe0-\\udff0\\udff4\\udff8-\\udfff]|\\ud83d[\\udc00-\\udc3e\\udc40\\udc44\\udc45\\udc51-\\udc65\\udc6a\\udc6f\\udc79-\\udc7b\\udc7d-\\udc80\\udc84\\udc88-\\udc8e\\udc90\\udc92-\\udca9\\udcab-\\udcfc\\udcff-\\udd3d\\udd4b-\\udd4e\\udd50-\\udd67\\udda4\\uddfb-\\ude44\\ude48-\\ude4a\\ude80-\\udea2\\udea4-\\udeb3\\udeb7-\\udebf\\udec1-\\udec5\\uded0-\\uded2\\uded5-\\uded7\\udedd-\\udedf\\udeeb\\udeec\\udef4-\\udefc\\udfe0-\\udfeb\\udff0]|\\ud83e[\\udd0d\\udd0e\\udd10-\\udd17\\udd20-\\udd25\\udd27-\\udd2f\\udd3a\\udd3c\\udd3f-\\udd45\\udd47-\\udd76\\udd78-\\uddb4\\uddb7\\uddba\\uddbc-\\uddcc\\uddd0\\uddde-\\uddff\\ude70-\\ude74\\ude78-\\ude7c\\ude80-\\ude86\\ude90-\\udeac\\udeb0-\\udeba\\udec0-\\udec2\\uded0-\\uded9\\udee0-\\udee7]|[\\u23e9-\\u23ec\\u23f0\\u23f3\\u267e\\u26ce\\u2705\\u2728\\u274c\\u274e\\u2753-\\u2755\\u2795-\\u2797\\u27b0\\u27bf\\ue50a])|\\ufe0f/g\n\nfunction toCodePoint(unicodeSurrogates, sep) {\n var\n\t\tr = [],\n\t\tc = 0,\n\t\tp = 0,\n\t\ti = 0\n\t\t\n\twhile (i < unicodeSurrogates.length) {\n\t\tc = unicodeSurrogates.charCodeAt(i++)\n\t\tif (p) {\n\t\t\tr.push((0x10000 + ((p - 0xD800) << 10) + (c - 0xDC00)).toString(16))\n\t\t\tp = 0\n\t\t} else if (0xD800 <= c && c <= 0xDBFF) {\n\t\t\tp = c\n\t\t} else {\n\t\t\tr.push(c.toString(16))\n\t\t}\n\t}\n\treturn r.join(sep || '-')\n}\n\n// avoid runtime RegExp creation for not so smart,\n// not JIT based, and old browsers / engines\nvar UFE0Fg = /\\uFE0F/g\n\n// avoid using a string literal like '\\u200D' here because minifiers expand it inline\nvar U200D = String.fromCharCode(0x200D)\n\n/**\n* Used to both remove the possible variant\n* and to convert utf16 into code points.\n* If there is a zero-width-joiner (U+200D), leave the variants in.\n* @param string the raw text of the emoji match\n*/\nfunction grabTheRightIcon(rawText) {\n\t// if variant is present as \\uFE0F\n\treturn toCodePoint(rawText.indexOf(U200D) < 0 ?\n\t\trawText.replace(UFE0Fg, '') :\n\t\trawText\n\t);\n}\n\nmodule.exports = function replaceEmoji (string, render) {\n\t// Note: the latest regex added an empty matching group, so we ignore it.\n\treturn replaceStringToArray(string, re, function emojiReplacer (match, _, offset) {\n\t\tvar icon = grabTheRightIcon(match)\n\t\treturn render(icon, match, offset)\n\t})\n}\n","var createElement = require('react').createElement\n\nvar pageProtocol = (typeof location === 'undefined') ? '' : ((location.protocol === 'https:') ? 'https:' : 'http:')\n\nvar emojiStyle = {\n\theight: '1em',\n\twidth: '1em',\n\tmargin: '0 .05em 0 .1em',\n\tverticalAlign: '-0.1em'\n}\n\n// Accept protocol with or without a colon\nfunction normalizeProtocol(protocol) {\n\tif (protocol && protocol.length > 0 && protocol.charAt(protocol.length - 1) !== ':') {\n\t\treturn protocol + ':'\n\t}\n\treturn protocol\n}\n\nmodule.exports = function makeTwemojiRenderer(options) {\n\toptions = merge({\n\t\tprotocol: pageProtocol,\n\t\tbaseUrl: '//cdnjs.cloudflare.com/ajax/libs/twemoji/14.0.2/',\n\t\tsize: '72x72',\n\t\text: '.png',\n\t\tprops: null\n\t}, options)\n\n\treturn function renderTwemoji (icon, match, offset) {\n\t\tvar src = ''\n\t\tif (options.baseUrl.indexOf('http') !== 0) {\n\t\t\tsrc += normalizeProtocol(options.protocol)\n\t\t}\n\n\t\tsrc += options.baseUrl + options.size + '/' + icon + options.ext\n\n\t\treturn createElement(\n\t\t\t'img',\n\t\t\tmerge({\n\t\t\t\tkey: offset,\n\t\t\t\talt: match,\n\t\t\t\tdraggable: false,\n\t\t\t\tsrc: src,\n\t\t\t\tstyle: emojiStyle\n\t\t\t}, options.props)\n\t\t)\n\t}\n}\n\nfunction merge() {\n\tvar out = {}, len = arguments.length\n\tfor(var i = 0; i < len; ++i) {\n\t\tvar source = arguments[i]\n\t\tif (source) {\n\t\t\tfor (var key in source) {\n\t\t\t\tif (Object.prototype.hasOwnProperty.call(source, key)) {\n\t\t\t\t\tout[key] = source[key]\n\t\t\t\t}\n\t\t\t}\n\t\t}\n }\n return out\n}","var replaceEmoji = require('./lib/replaceEmoji'),\n\tmakeTwemojiRenderer = require('./lib/makeTwemojiRenderer')\n\nmodule.exports = function reactEasyEmoji (element, optionsOrFn) {\n\tvar render = (typeof optionsOrFn === 'function') ? optionsOrFn : makeTwemojiRenderer(optionsOrFn)\n\treturn replaceEmoji(element, render)\n}","// @ts-check\n\nimport { useCallback, useRef } from \"react\";\nimport { renderToString } from 'react-dom/server'\nimport emoji from 'react-easy-emoji'\nimport { removeHtmlExceptBr } from \"../utils/input-event-utils\";\n\nconst EMOJI_REGEX = new RegExp(\n /(?:[\\u2700-\\u27bf]|(?:\\ud83c[\\udde6-\\uddff]){2}|[\\ud800-\\udbff][\\udc00-\\udfff])[\\ufe0e\\ufe0f]?(?:[\\u0300-\\u036f\\ufe20-\\ufe23\\u20d0-\\u20f0]|\\ud83c[\\udffb-\\udfff])?(?:\\u200d(?:[^\\ud800-\\udfff]|(?:\\ud83c[\\udde6-\\uddff]){2}|[\\ud800-\\udbff][\\udc00-\\udfff])[\\ufe0e\\ufe0f]?(?:[\\u0300-\\u036f\\ufe20-\\ufe23\\u20d0-\\u20f0]|\\ud83c[\\udffb-\\udfff])?)*/g\n)\n\n/**\n * @typedef {import('../types/types').SanitizeFn} SanitizeFn\n */\n\n// eslint-disable-next-line valid-jsdoc\n/**\n * @param {boolean} shouldReturn\n * @param {boolean} shouldConvertEmojiToImage\n */\nexport function useSanitize(shouldReturn, shouldConvertEmojiToImage) {\n /** @type {React.MutableRefObject<SanitizeFn[]>} */\n const sanitizeFnsRef = useRef([]);\n\n const sanitizedTextRef = useRef(\"\");\n\n /** @type {(fn: SanitizeFn) => void} */\n const addSanitizeFn = useCallback(fn => {\n sanitizeFnsRef.current.push(fn);\n }, []);\n\n /** @type {(html: string) => string} */\n const sanitize = useCallback(html => {\n let result = sanitizeFnsRef.current.reduce((acc, fn) => {\n return fn(acc);\n }, html);\n\n result = replaceAllHtmlToString(result, shouldReturn);\n\n if (shouldConvertEmojiToImage) {\n result = convertEmojiToImage(result);\n }\n\n sanitizedTextRef.current = result;\n\n return result;\n }, [shouldReturn, shouldConvertEmojiToImage]);\n\n return { addSanitizeFn, sanitize, sanitizedTextRef };\n}\n\n/**\n *\n * @param {string} html\n * @param {boolean} shouldReturn\n * @return {string}\n */\nexport function replaceAllHtmlToString(html, shouldReturn) {\n const container = document.createElement(\"div\");\n container.innerHTML = html;\n let text\n if(shouldReturn) {\n text = removeHtmlExceptBr(container)\n } else {\n text = container.innerText || \"\";\n }\n\n // remove all ↵ for safari\n text = text.replace(/\\n/gi, \"\");\n\n return text;\n}\n\n/**\n * \n * @param {string} text \n * @return {string}\n */\nfunction convertEmojiToImage(text) {\n text = handleEmoji(text)\n text = renderToString(emoji(text))\n text = text.replace(\n new RegExp('<span class="message-emoji">', 'g'),\n '<span class=\"message-emoji\">'\n )\n text = text.replace(new RegExp('</span>', 'g'), '</span>')\n \n return text \n}\n\n/**\n * \n * @param {string} text \n * @return {string}\n */\nfunction handleEmoji (text) {\n return text.replace(EMOJI_REGEX, '<span class=\"message-emoji\">$&</span>')\n}\n","// @ts-check\n\nimport { useImperativeHandle } from \"react\";\nimport { useSanitize } from \"./use-sanitize\";\n\n/**\n * @typedef {Object} Props\n * @property {React.Ref<any>} ref\n * @property {React.MutableRefObject<import('../text-input').Ref | null>} textInputRef\n * @property {(value: string) => void} setValue\n * @property {() => void} emitChange\n * @property {boolean=} shouldConvertEmojiToImage\n */\n\n/**\n *\n * @param {Props} props\n */\nexport function useExpose({ ref, textInputRef, setValue, emitChange, shouldConvertEmojiToImage }) {\n const { sanitize, sanitizedTextRef } = useSanitize(false, shouldConvertEmojiToImage);\n\n useImperativeHandle(ref, () => ({\n get value() {\n return sanitizedTextRef.current;\n },\n set value(value) {\n setValue(value);\n },\n focus: () => {\n if (textInputRef.current === null) return\n textInputRef.current.focus();\n },\n blur: () => {\n if (textInputRef.current !== null) {\n sanitize(textInputRef.current.html);\n\n }\n\n emitChange();\n }\n }));\n}\n","// @ts-check\n\nimport { useCallback, useEffect, useRef } from \"react\";\n\n// eslint-disable-next-line valid-jsdoc\n/**\n * useEmit\n * @param {React.MutableRefObject<import('../text-input').Ref | null>} textInputRef\n * @param {(size: {width: number, height: number}) => void} onResize\n * @param {(text: string) => void} onChange\n */\nexport function useEmit(textInputRef, onResize, onChange) {\n /** @type {React.MutableRefObject<{width: number; height: number} | null>} */\n const currentSizeRef = useRef(null);\n const onChangeFn = useRef(onChange);\n\n const checkAndEmitResize = useCallback(() => {\n if (textInputRef.current !== null) {\n const currentSize = currentSizeRef.current;\n\n const nextSize = textInputRef.current.size;\n\n if (\n (!currentSize ||\n currentSize.width !== nextSize.width ||\n currentSize.height !== nextSize.height) &&\n typeof onResize === \"function\"\n ) {\n onResize(nextSize);\n }\n\n currentSizeRef.current = nextSize;\n }\n }, [onResize, textInputRef]);\n\n const emitChange = useCallback((sanitizedText) => {\n if (typeof onChangeFn.current === \"function\") {\n onChangeFn.current(sanitizedText);\n }\n\n if (typeof onResize === \"function\") {\n checkAndEmitResize();\n }\n }, [checkAndEmitResize, onResize]);\n\n useEffect(() => {\n if (textInputRef.current) {\n checkAndEmitResize();\n }\n }, [checkAndEmitResize, textInputRef]);\n\n return emitChange;\n}\n","// @ts-check\n// vendors\nimport React, { useImperativeHandle, forwardRef, useRef, useMemo } from \"react\";\nimport { addLineBreak, handlePasteHtmlAtCaret } from \"./utils/input-event-utils\";\nimport { replaceAllTextEmojiToString } from \"./utils/emoji-utils\";\n\n/**\n * @typedef {Object} Props\n * @property {(event: React.KeyboardEvent) => void} onKeyDown\n * @property {(event: React.KeyboardEvent) => void} onKeyUp\n * @property {() => void} onFocus\n * @property {() => void} onBlur\n * @property {(sanitizedText: string) => void=} onChange\n * @property {(event: React.KeyboardEvent) => void} onArrowUp\n * @property {(event: React.KeyboardEvent) => void} onArrowDown\n * @property {(event: React.KeyboardEvent) => void} onEnter\n * @property {boolean} shouldReturn\n * @property {(event: React.ClipboardEvent) => void} onCopy\n * @property {(event: React.ClipboardEvent) => void} onPaste\n * @property {string} placeholder\n * @property {{borderRadius?: number; color?: string; borderColor?: string; fontSize?: number; fontFamily?: string; background: string; placeholderColor?: string;}} style\n * @property {number} tabIndex\n * @property {string} className\n * @property {(html: string) => void} onChange\n */\n\n/**\n * @typedef {{\n * appendContent: (html: string) => void;\n * html: string;\n * text: string;\n * size: { width: number; height: number;};\n * focus: () => void;\n * }} Ref\n */\n\n// eslint-disable-next-line valid-jsdoc\n/** @type {React.ForwardRefRenderFunction<Ref, Props>} */\nconst TextInput = (\n { placeholder, style, tabIndex, className, onChange, ...props },\n ref\n) => {\n useImperativeHandle(ref, () => ({\n appendContent: html => {\n if (textInputRef.current) {\n textInputRef.current.focus();\n }\n\n handlePasteHtmlAtCaret(html);\n\n if (textInputRef.current) {\n textInputRef.current.focus();\n }\n\n if (textInputRef.current && placeholderRef.current && replaceAllTextEmojiToString(textInputRef.current.innerHTML) === \"\") {\n placeholderRef.current.style.visibility = \"visible\";\n } else if (placeholderRef.current) {\n placeholderRef.current.style.visibility = \"hidden\";\n }\n\n if (textInputRef.current && typeof onChange === 'function') {\n onChange(textInputRef.current.innerHTML);\n }\n },\n set html(value) {\n if (textInputRef.current) {\n textInputRef.current.innerHTML = value;\n }\n \n if (placeholderRef.current) {\n const text = replaceAllTextEmojiToString(value)\n if (text === \"\") {\n placeholderRef.current.style.visibility = \"visible\";\n } else {\n placeholderRef.current.style.visibility = \"hidden\";\n }\n }\n\n if (typeof onChange === 'function' && textInputRef.current) {\n onChange(textInputRef.current.innerHTML);\n }\n },\n get html() {\n if (!textInputRef.current) return ''\n\n return textInputRef.current.innerHTML;\n },\n get text() {\n if (!textInputRef.current) return ''\n\n return textInputRef.current.innerText;\n },\n get size() {\n if (!textInputRef.current) {\n return {\n width: 0,\n height: 0\n }\n }\n\n return {\n width: textInputRef.current.offsetWidth,\n height: textInputRef.current.offsetHeight\n };\n },\n focus() {\n if (!textInputRef.current) return\n\n textInputRef.current.focus();\n }\n }));\n\n /** @type {React.CSSProperties} */\n const placeholderStyle = useMemo(() => {\n const placeholderStyle = {}\n\n if (style.placeholderColor) {\n placeholderStyle.color = style.placeholderColor\n }\n\n return placeholderStyle\n }, [style?.placeholderColor])\n\n /** @type {React.CSSProperties} */\n const inputStyle = useMemo(() => {\n const inputStyle = {}\n\n if (style.color) {\n inputStyle.color = style.color\n }\n\n return inputStyle\n }, [style?.color])\n\n /** @type {React.MutableRefObject<HTMLDivElement | null>} */\n const placeholderRef = useRef(null);\n /** @type {React.MutableRefObject<HTMLDivElement | null>} */\n const textInputRef = useRef(null);\n\n /**\n *\n * @param {React.KeyboardEvent} event\n */\n function handleKeyDown(event) { \n if (event.key === \"Enter\" && (event.shiftKey === true || event.ctrlKey === true) && props.shouldReturn) {\n event.preventDefault();\n if(textInputRef.current) {\n addLineBreak()\n return;\n }\n } \n if (event.key === \"Enter\") {\n props.onEnter(event);\n } else if (event.key === \"ArrowUp\") {\n props.onArrowUp(event);\n } else if (event.key === \"ArrowDown\") {\n props.onArrowDown(event);\n } else {\n if (event.key.length === 1 && placeholderRef.current) {\n placeholderRef.current.style.visibility = \"hidden\";\n }\n }\n\n props.onKeyDown(event);\n }\n\n /** */\n function handleClick() {\n props.onFocus();\n }\n\n /**\n *\n * @param {React.KeyboardEvent} event\n */\n function handleKeyUp(event) {\n props.onKeyUp(event);\n\n const input = textInputRef.current;\n\n if (placeholderRef.current && input) {\n const text = replaceAllTextEmojiToString(input.innerHTML)\n if (text === \"\") {\n placeholderRef.current.style.visibility = \"visible\";\n } else {\n placeholderRef.current.style.visibility = \"hidden\";\n }\n }\n\n if (typeof onChange === 'function' && textInputRef.current) {\n onChange(textInputRef.current.innerHTML);\n }\n }\n\n return (\n <div className=\"react-input-emoji--container\" style={style}>\n <div className=\"react-input-emoji--wrapper\" onClick={handleClick}>\n <div ref={placeholderRef} className=\"react-input-emoji--placeholder\" style={placeholderStyle}>\n {placeholder}\n </div>\n <div\n ref={textInputRef}\n onKeyDown={handleKeyDown}\n onKeyUp={handleKeyUp}\n tabIndex={tabIndex}\n contentEditable\n className={`react-input-emoji--input${className ? ` ${className}` : \"\"\n }`}\n onBlur={props.onBlur}\n onCopy={props.onCopy}\n onPaste={props.onPaste}\n data-testid=\"react-input-emoji--input\"\n style={inputStyle}\n />\n </div>\n </div>\n );\n};\n\nconst TextInputWithRef = forwardRef(TextInput);\n\nexport default TextInputWithRef;\n","// vendors\nimport React, { useEffect, useRef, useState } from \"react\";\n\n/**\n * @typedef {object} Props\n * @property {boolean} showPicker\n * @property {(event: React.MouseEvent) => void} toggleShowPicker\n * @property {HTMLDivElement=} buttonElement\n * @property {React.MutableRefObject=} buttonRef\n */\n\n/**\n * Emoji Picker Button Component\n * @param {Props} props\n * @return {JSX.Element}\n */\nfunction EmojiPickerButton({ showPicker, toggleShowPicker, buttonElement, buttonRef }) {\n \n const localButtonRef = useRef(null);\n const [showCustomButtonContent, setShowCustomButtonContent] = useState(false);\n\n useEffect(() => {\n if ((buttonRef?.current?.childNodes?.length ?? 0) > 2) {\n localButtonRef.current.appendChild(buttonRef.current.childNodes[0]);\n setShowCustomButtonContent(true);\n } else if ((buttonElement?.childNodes?.length ?? 0) > 2) {\n localButtonRef.current.appendChild(buttonElement?.childNodes[0]);\n setShowCustomButtonContent(true);\n }\n }, [buttonElement?.childNodes]);\n\n return (\n <button\n ref={localButtonRef}\n type=\"button\"\n className={`react-input-emoji--button${\n showPicker ? \" react-input-emoji--button__show\" : \"\"\n }`}\n onClick={toggleShowPicker}\n >\n {!showCustomButtonContent && (\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n viewBox=\"0 0 24 24\"\n width=\"24\"\n height=\"24\"\n className=\"react-input-emoji--button--icon\"\n >\n {/* eslint-disable-next-line max-len */}\n <path d=\"M12 0C5.373 0 0 5.373 0 12s5.373 12 12 12 12-5.373 12-12S18.627 0 12 0m0 22C6.486 22 2 17.514 2 12S6.486 2 12 2s10 4.486 10 10-4.486 10-10 10\" />\n {/* eslint-disable-next-line max-len */}\n <path d=\"M8 7a2 2 0 1 0-.001 3.999A2 2 0 0 0 8 7M16 7a2 2 0 1 0-.001 3.999A2 2 0 0 0 16 7M15.232 15c-.693 1.195-1.87 2-3.349 2-1.477 0-2.655-.805-3.347-2H15m3-2H6a6 6 0 1 0 12 0\" />\n </svg>\n )}\n </button>\n );\n}\n\nexport default EmojiPickerButton;\n","import $dvPge$react, {useRef as $dvPge$useRef, useEffect as $dvPge$useEffect} from \"react\";\nimport {Picker as $dvPge$Picker} from \"emoji-mart\";\n\n\n\nfunction $e5534fc185f7111e$export$2e2bcd8739ae039(props) {\n const ref = (0, $dvPge$useRef)(null);\n const instance = (0, $dvPge$useRef)(null);\n if (instance.current) instance.current.update(props);\n (0, $dvPge$useEffect)(()=>{\n instance.current = new (0, $dvPge$Picker)({\n ...props,\n ref: ref\n });\n return ()=>{\n instance.current = null;\n };\n }, []);\n return /*#__PURE__*/ (0, $dvPge$react).createElement(\"div\", {\n ref: ref\n });\n}\n\n\nexport {$e5534fc185f7111e$export$2e2bcd8739ae039 as default};\n//# sourceMappingURL=module.js.map\n","// vendors\nimport React, { memo, useEffect, useMemo, useState } from \"react\";\nimport Picker from \"@emoji-mart/react\";\n\nconst EMOJI_MART_DATA_URL = \"https://cdn.jsdelivr.net/npm/@emoji-mart/data\";\nconst cacheI18n = {};\n\n/**\n * @typedef {object} Props\n * @property {'light' | 'dark' | 'auto'} theme\n * @property {function(import(\"../types/types\").EmojiMartItem): void} onSelectEmoji\n * @property {boolean} disableRecent\n * @property {any[]=} customEmojis\n * @property {import('../types/types').Languages=} language\n */\n\n/**\n * Emoji Picker Component\n * @param {Props} props\n */\nfunction EmojiPicker(props) {\n const { theme, onSelectEmoji, disableRecent, customEmojis, language } = props;\n\n /** @type {string[]} */\n const categories = useMemo(() => {\n /** @type {string[]} */\n let categoryies = [];\n\n if (!disableRecent) {\n categoryies.push(\"frequent\");\n }\n\n categoryies = [\n ...categoryies,\n \"people\",\n \"nature\",\n \"foods\",\n \"activity\",\n \"places\",\n \"objects\",\n \"symbols\",\n \"flags\"\n ];\n\n return categoryies;\n }, [disableRecent]);\n\n const [i18n, setI18n] = useState(undefined);\n\n useEffect(() => {\n if (!language) {\n if (cacheI18n.en) {\n setI18n(cacheI18n.en);\n return;\n }\n\n // @ts-ignore\n fetch(`${EMOJI_MART_DATA_URL}/i18n/en.json`)\n .then(async data => {\n const translations = await data.json();\n setI18n(translations);\n cacheI18n.en = translations;\n })\n .catch(error => {\n console.error(\"Failed to load translations:\", error);\n });\n return;\n }\n\n if (cacheI18n[language]) {\n setI18n(cacheI18n[language]);\n return;\n }\n\n // @ts-ignore\n fetch(`${EMOJI_MART_DATA_URL}/i18n/${language}.json`)\n .then(async data => {\n const translations = await data.json();\n setI18n(translations);\n cacheI18n[language] = translations;\n })\n .catch(error => {\n console.error(\"Failed to load translations:\", error);\n });\n }, [language]);\n\n if (!i18n) {\n return null;\n }\n\n return (\n <Picker\n data={undefined}\n theme={theme}\n previewPosition=\"none\"\n onEmojiSelect={onSelectEmoji}\n custom={customEmojis}\n categories={categories}\n set=\"apple\"\n i18n={i18n}\n />\n );\n}\n\n\nexport default memo(EmojiPicker);\n","import React from \"react\";\nimport EmojiPicker from \"./emoji-picker\";\n\n/**\n * @typedef {object} Props\n * @property {boolean} showPicker\n * @property {'light' | 'dark' | 'auto'} theme\n * @property {(emoji: import(\"../types/types\").EmojiMartItem) => void} handleSelectEmoji\n * @property {boolean} disableRecent\n * @property {any[]=} customEmojis\n * @property {('above' | 'below')=} position\n * @property {import('../types/types').Languages=} language\n */\n\n/**\n * Emoji Picker Button Component\n * @param {Props} props\n * @return {JSX.Element}\n */\nfunction EmojiPickerContainer({\n showPicker,\n theme,\n handleSelectEmoji,\n disableRecent,\n customEmojis,\n position,\n language\n}) {\n return (\n <div className=\"react-emoji-picker--container\">\n {showPicker && (\n <div\n className=\"react-emoji-picker--wrapper\"\n onClick={evt => evt.stopPropagation()}\n style={position === 'below' ? {top: '40px'} : {}}\n >\n <div className=\"react-emoji-picker\">\n <EmojiPicker\n theme={theme}\n onSelectEmoji={handleSelectEmoji}\n disableRecent={disableRecent}\n customEmojis={customEmojis}\n language={language}\n />\n </div>\n </div>\n )}\n </div>\n );\n}\n\nexport default EmojiPickerContainer;\n","// @ts-check\n// vendors\nimport React, { useEffect, useState } from \"react\";\nimport ReactDOM from \"react-dom\";\nimport {\n getImageEmoji,\n replaceAllTextEmojis,\n replaceAllTextEmojiToString\n} from \"../utils/emoji-utils\";\n\nimport EmojiPickerButton from \"./emoji-picker-button\";\nimport EmojiPickerContainer from \"./emoji-picker-container\";\n\nconst EMOJI_PICKER_CONTAINER_HEIGHT = 435;\n\n/**\n * @typedef {import('../types/types').SanitizeFn} SanitizeFn\n */\n\n/**\n * @typedef {import('../types/types').PolluteFn} PolluteFn\n */\n\n/**\n * @typedef {Object} Props\n * @property {'light' | 'dark' | 'auto'} theme\n * @property {boolean} keepOpened\n * @property {boolean} disableRecent\n * @property {any[]=} customEmojis\n * @property {(fn: SanitizeFn) => void} addSanitizeFn\n * @property {(fn: PolluteFn) => void} addPolluteFn\n * @property {(html: string) => void} appendContent\n * @property {HTMLDivElement=} buttonElement\n * @property {React.MutableRefObject=} buttonRef\n * @property {import('../types/types').Languages=} language\n */\n\n// eslint-disable-next-line valid-jsdoc\n/** @type {React.FC<Props>} */\nconst EmojiPickerWrapper = props => {\n const {\n theme,\n keepOpened,\n disableRecent,\n customEmojis,\n addSanitizeFn,\n addPolluteFn,\n appendContent,\n buttonElement,\n buttonRef,\n language\n } = props;\n\n const [showPicker, setShowPicker] = useState(false);\n /** @type {[HTMLDivElement | undefined, React.Dispatch<React.SetStateAction<HTMLDivElement | undefined>>]} */\n const [customButton, setCustomButton] = useState();\n /** @type {['above' | 'below' | undefined, React.Dispatch<React.SetStateAction<'above' | 'below' | undefined>>]} */\n const [emojiPickerPosition, setEmojiPickerPosition] = useState()\n\n useEffect(() => {\n addSanitizeFn(replaceAllTextEmojiToString);\n }, [addSanitizeFn]);\n\n useEffect(() => {\n addPolluteFn(replaceAllTextEmojis);\n }, [addPolluteFn]);\n\n useEffect(() => {\n /**\n *\n * @param {MouseEvent} event\n */\n function checkClickOutside(event) {\n /** @type {HTMLElement} */\n // @ts-ignore\n const element = event.target;\n\n if (\n element.classList.contains(\"react-input-emoji--button\") ||\n element.classList.contains(\"react-input-emoji--button--icon\")\n ) {\n return;\n }\n\n setShowPicker(false);\n }\n\n document.addEventListener(\"click\", checkClickOutside);\n\n return () => {\n document.removeEventListener(\"click\", checkClickOutside);\n };\n }, []);\n\n /**\n *\n * @param {React.MouseEvent} event\n */\n function toggleShowPicker(event) {\n event.stopPropagation();\n event.preventDefault();\n\n setEmojiPickerPosition(calcTopPosition(event))\n\n setShowPicker(currentShowPicker => !currentShowPicker);\n }\n\n /**\n * \n * @param {React.MouseEvent} event\n * @return {'above' | 'below'}\n */\n function calcTopPosition(event) {\n const btn = event.currentTarget\n const btnRect = btn.getBoundingClientRect();\n\n const popoverHeight = EMOJI_PICKER_CONTAINER_HEIGHT;\n\n // Decide to display above or below based on available space\n if (btnRect.top >= popoverHeight) {\n // Display above\n return 'above'\n } else {\n // Display below\n return 'below'\n }\n }\n\n // eslint-disable-next-line valid-jsdoc\n /**\n *\n * @param {import(\"../types/types\").EmojiMartItem} emoji\n */\n function handleSelectEmoji(emoji) {\n appendContent(getImageEmoji(emoji));\n\n if (!keepOpened) {\n setShowPicker(currentShowPicker => !currentShowPicker);\n }\n }\n\n useEffect(() => {\n if (buttonRef?.current?.style) {\n buttonRef.current.style.position = \"relative\";\n setCustomButton(buttonRef.current);\n } else if (buttonElement?.style) {\n buttonElement.style.position = \"relative\";\n setCustomButton(buttonElement);\n }\n }, [buttonRef, buttonElement]);\n\n return customButton ? (\n (ReactDOM.createPortal(\n <>\n <EmojiPickerContainer\n showPicker={showPicker}\n theme={theme}\n handleSelectEmoji={handleSelectEmoji}\n disableRecent={disableRecent}\n customEmojis={customEmojis}\n position={emojiPickerPosition}\n language={language}\n />\n <EmojiPickerButton\n showPicker={showPicker}\n toggleShowPicker={toggleShowPicker}\n buttonElement={customButton}\n buttonRef={buttonRef}\n />\n </>,\n customButton\n ))\n ) : (\n (<>\n <EmojiPickerContainer\n showPicker={showPicker}\n theme={theme}\n handleSelectEmoji={handleSelectEmoji}\n disableRecent={disableRecent}\n customEmojis={customEmojis}\n position={emojiPickerPosition}\n language={language}\n />\n <EmojiPickerButton\n showPicker={showPicker}\n toggleShowPicker={toggleShowPicker}\n />\n </>)\n );\n};\n\nexport default EmojiPickerWrapper;\n","// @ts-check\n\n/**\n *\n * @return {string | null}\n */\nexport function getTextFromAtToCaret() {\n const range = getRangeFromAtToCaret();\n\n if (!range) return null;\n\n const text = range.text.substring(range.begin, range.end);\n\n return text || null;\n}\n\n// eslint-disable-next-line valid-jsdoc\n/** */\nexport function deleteTextFromAtToCaret() {\n const range = getRangeFromAtToCaret();\n\n if (!range) return;\n\n // @ts-ignore\n range.element.deleteData(range.begin, range.end - range.begin);\n}\n\n/**\n *\n * @return {{begin: number, end: number, text: string, element: Node} | null}\n */\nfunction getRangeFromAtToCaret() {\n const elementWithFocus = getElementWithFocus();\n\n if (!elementWithFocus) {\n return null;\n }\n\n const { element, caretOffset } = elementWithFocus;\n const text = element.textContent;\n const lastAt = text.lastIndexOf(\"@\");\n\n if (\n lastAt === -1 ||\n lastAt >= caretOffset ||\n (lastAt !== 0 && text[lastAt - 1] !== \" \")\n ) {\n return null;\n }\n\n return { begin: lastAt, end: caretOffset, text, element };\n}\n\n/**\n *\n * @return {{element: Node, caretOffset: number}}\n */\nexport function getElementWithFocus() {\n const element = getSelectionStart();\n\n if (element === null) {\n return null;\n }\n\n let caretOffset = 0;\n if (typeof window.getSelection != \"undefined\") {\n const range = window.getSelection().getRangeAt(0);\n const preCaretRange = range.cloneRange();\n preCaretRange.selectNodeContents(element);\n preCaretRange.setEnd(range.endContainer, range.endOffset);\n caretOffset = preCaretRange.toString().length;\n } else if (\n // @ts-ignore\n typeof document.selection != \"undefined\" &&\n // @ts-ignore\n document.selection.type != \"Control\"\n ) {\n // @ts-ignore\n const textRange = document.selection.createRange();\n // @ts-ignore\n const preCaretTextRange = document.body.createTextRange();\n preCaretTextRange.moveToElementText(element);\n preCaretTextRange.setEndPoint(\"EndToEnd\", textRange);\n caretOffset = preCaretTextRange.text.length;\n }\n\n return { element, caretOffset };\n}\n\n/**\n *\n * @return {Node | null}\n */\nfunction getSelectionStart() {\n const node = document.getSelection().anchorNode;\n return node?.nodeType == 3 ? node : null;\n}\n","// @ts-check\nimport { useCallback, useState } from \"react\";\nimport {\n deleteTextFromAtToCaret,\n getElementWithFocus,\n getTextFromAtToCaret\n} from \"../utils/mention-utils\";\n\n/**\n * @typedef {import('../types/types').MentionUser} MentionUser\n */\n\n// eslint-disable-next-line valid-jsdoc\n/**\n *\n * @param {(text: string) => Promise<MentionUser[]>=} searchMention\n * @returns {{mentionSearchText: string | null, mentionUsers: MentionUser[], onKeyUp: (event: React.KeyboardEvent) => void, onFocus: () => void, onSelectUser: () => void, loading: boolean}}\n */\nexport function useMention(searchMention) {\n const [loading, setLoading] = useState(false);\n\n /** @type {[MentionUser[], React.Dispatch<React.SetStateAction<MentionUser[]>>]} */\n const [mentionUsers, setMentionUsers] = useState([]);\n\n /** @type {[string | null, React.Dispatch<React.SetStateAction<string | null>>]} */\n const [mentionSearchText, setMentionSearchText] = useState(null);\n\n const onSelectUser = useCallback(() => {\n deleteTextFromAtToCaret();\n setMentionUsers([]);\n }, []);\n\n /** */\n const checkMentionText = useCallback(async () => {\n const metionText = getTextFromAtToCaret();\n\n setMentionSearchText(metionText);\n\n if (metionText === null) {\n setMentionUsers([]);\n } else {\n setLoading(true);\n const users = await searchMention(metionText);\n setLoading(false);\n setMentionUsers(users);\n }\n }, [searchMention]);\n\n /** @type {(event: React.KeyboardEvent) => void} */\n const onKeyUp = useCallback(\n async event => {\n if (typeof searchMention !== \"function\") return;\n\n if (\n event.key === \"Backspace\" &&\n getElementWithFocus()?.element.parentElement.hasAttribute(\n \"data-mention-id\"\n )\n ) {\n const elementWithFocus = getElementWithFocus();\n elementWithFocus.element.parentElement.remove();\n } else if (\n ![\"ArrowUp\", \"ArrowDown\", \"Esc\", \"Escape\"].includes(event.key)\n ) {\n checkMentionText();\n }\n },\n [checkMentionText, searchMention]\n );\n\n const onFocus = useCallback(() => {\n checkMentionText();\n }, [checkMentionText]);\n\n return {\n mentionSearchText,\n mentionUsers,\n onKeyUp,\n onFocus,\n onSelectUser,\n loading\n };\n}\n","// @ts-check\n// vendors\nimport React, {\n useImperativeHandle,\n useState,\n forwardRef,\n useMemo,\n useEffect\n} from \"react\";\n\n/**\n * @typedef {import('../types/types').MentionUser} MentionUser\n */\n\n/**\n * @typedef {import('../types/types').TextInputListeners} TextInputListeners\n */\n\n/**\n * @typedef {Object} Props\n * @property {MentionUser[]} users\n * @property {string | null} mentionSearchText\n * @property {(user: MentionUser) => void} onSelect\n * @property {(event: keyof TextInputListeners, fn: import('../types/types').Listerner<any>) => () => void} addEventListener\n */\n\n/**\n * @typedef {{prevUser: () => void; nextUser: () => void;}} Ref\n */\n\n// eslint-disable-next-line valid-jsdoc\n/** @type {React.ForwardRefRenderFunction<Ref, Props>} */\nconst MentionUserList = (\n { users, mentionSearchText, onSelect, addEventListener },\n ref\n) => {\n const [selectedUser, setSelectedUser] = useState(0);\n\n useImperativeHandle(ref, () => ({\n prevUser: () => {\n setSelectedUser(currentSelectedUser => {\n if (currentSelectedUser === 0) {\n return 0;\n }\n\n return currentSelectedUser - 1;\n });\n },\n nextUser: () => {\n setSelectedUser(currentSelectedUser => {\n if (currentSelectedUser === users.length - 1) {\n return users.length - 1;\n }\n\n return currentSelectedUser + 1;\n });\n }\n }));\n\n useEffect(() => {\n setSelectedUser(0);\n }, [users]);\n\n /**\n *\n * @param {string} selectedText\n * @param {string} rest\n * @return {string}\n */\n function getMentionSelectedNameEl(selectedText, rest) {\n return `<span class=\"react-input-emoji--mention--item--name__selected\" data-testid=\"metion-selected-word\">${selectedText}</span>${rest}`;\n }\n\n /** @type {(MentionUser & {nameHtml: string})[]} */\n const usersFiltered = useMemo(() => {\n const searchText = mentionSearchText\n ? mentionSearchText.substring(1).toLocaleLowerCase()\n : \"\";\n return users.map(user => {\n let nameHtml = user.name;\n\n if (mentionSearchText && mentionSearchText.length > 1) {\n if (user.name.toLowerCase().startsWith(searchText)) {\n nameHtml = getMentionSelectedNameEl(\n user.name.substring(0, searchText.length),\n user.name.substring(searchText.length)\n );\n } else {\n const names = user.name.split(\" \");\n\n nameHtml = names\n .map(name => {\n if (name.toLocaleLowerCase().startsWith(searchText)) {\n return getMentionSelectedNameEl(\n name.substring(0, searchText.length),\n name.substring(searchText.length)\n );\n }\n return name;\n })\n .join(\" \");\n }\n }\n\n return {\n ...user,\n nameHtml\n };\n });\n }, [mentionSearchText, users]);\n\n // eslint-disable-next-line valid-jsdoc\n /**\n *\n * @param {MentionUser} user\n * @returns {(event: React.MouseEvent) => void} event\n */\n function handleClick(user) {\n return event => {\n event.stopPropagation();\n event.preventDefault();\n\n onSelect(user);\n };\n }\n\n useEffect(() => {\n const unsubscribe = addEventListener(\"enter\", event => {\n event.stopPropagation();\n event.preventDefault();\n onSelect(usersFiltered[selectedUser]);\n });\n\n return () => {\n unsubscribe();\n };\n }, [addEventListener, onSelect, selectedUser, usersFiltered]);\n\n return (\n <ul\n className=\"react-input-emoji--mention--list\"\n data-testid=\"mention-user-list\"\n >\n {usersFiltered.map((user, index) => (\n <li key={user.id}>\n <button\n type=\"button\"\n onClick={handleClick(user)}\n className={`react-input-emoji--mention--item${\n selectedUser === index\n ? \" react-input-emoji--mention--item__selected\"\n : \"\"\n }`}\n onMouseOver={() => setSelectedUser(index)}\n >\n <img\n className=\"react-input-emoji--mention--item--img\"\n src={user.image}\n />\n <div\n className=\"react-input-emoji--mention--item--name\"\n dangerouslySetInnerHTML={{ __html: user.nameHtml }}\n />\n </button>\n </li>\n ))}\n </ul>\n );\n};\n\nconst MentionUserListWithRef = forwardRef(MentionUserList);\n\nexport default MentionUserListWithRef;\n","// @ts-check\n// vendors\nimport React, { useEffect, useRef, useState } from \"react\";\n\n// hooks\nimport { useMention } from \"../hooks/use-mention\";\n\n// components\nimport MentionUserList from \"./mention-user-list\";\n\n/**\n * @typedef {import('../types/types').MentionUser} MetionUser\n */\n\n/**\n * @typedef {import('../types/types').TextInputListeners} TextInputListeners\n */\n\n/**\n * @typedef {import('../types/types').SanitizeFn} SanitizeFn\n */\n\n/**\n * @typedef {Object} Props\n * @property {(text: string) => Promise<MetionUser[]>=} searchMention\n * @property {(event: keyof TextInputListeners, fn: import('../types/types').Listerner<any>) => () => void} addEventListener\n * @property {(html: string) => void} appendContent\n * @property {(fn: SanitizeFn) => void} addSanitizeFn\n */\n\n// eslint-disable-next-line valid-jsdoc\n/** @type {React.FC<Props>} */\nconst MentionWrapper = ({\n searchMention,\n addEventListener,\n appendContent,\n addSanitizeFn\n}) => {\n /** @type {React.MutableRefObject<import('./mention-user-list').Ref | null>} */\n const metionUserListRef = useRef(null);\n const [showUserList, setShowUserList] = useState(false);\n\n const {\n mentionSearchText,\n mentionUsers,\n loading,\n onKeyUp,\n onFocus,\n onSelectUser\n } = useMention(searchMention);\n\n useEffect(() => {\n addSanitizeFn(html => {\n const container = document.createElement(\"div\");\n container.innerHTML = html;\n\n const mentionsEl = Array.prototype.slice.call(\n container.querySelectorAll(\".react-input-emoji--mention--text\")\n );\n\n mentionsEl.forEach(mentionEl => {\n container.innerHTML = container.innerHTML.replace(\n mentionEl.outerHTML,\n `@[${mentionEl.dataset.mentionName}](userId:${mentionEl.dataset.mentionId})`\n );\n });\n\n return container.innerHTML;\n });\n }, [addSanitizeFn]);\n\n useEffect(() => {\n setShowUserList(mentionUsers.length > 0);\n }, [mentionUsers]);\n\n useEffect(() => {\n /** */\n function checkClickOutside() {\n setShowUserList(false);\n }\n\n document.addEventListener(\"click\", checkClickOutside);\n\n return () => {\n document.removeEventListener(\"click\", checkClickOutside);\n };\n }, []);\n\n useEffect(() => {\n const unsubscribe = addEventListener(\"keyUp\", onKeyUp);\n\n return () => {\n unsubscribe();\n };\n }, [addEventListener, onKeyUp]);\n\n useEffect(() => {\n /**\n *\n * @param {React.KeyboardEvent} event\n */\n function handleKeyDown(event) {\n switch (event.key) {\n case \"Esc\": // IE/Edge specific value\n case \"Escape\":\n setShowUserList(false);\n break;\n default:\n break;\n }\n }\n\n const unsubscribe = addEventListener(\"keyDown\", handleKeyDown);\n\n return () => {\n unsubscribe();\n };\n }, [addEventListener]);\n\n useEffect(() => {\n const unsubscribe = addEventListener(\"focus\", onFocus);\n\n return () => {\n unsubscribe();\n };\n }, [addEventListener, onFocus]);\n\n useEffect(() => {\n if (showUserList) {\n const unsubscribeArrowUp = addEventListener(\"arrowUp\", event => {\n event.stopPropagation();\n event.preventDefault();\n metionUserListRef.current.prevUser();\n });\n\n const unsubscribeArrowDown = addEventListener(\"arrowDown\", event => {\n event.stopPropagation();\n event.preventDefault();\n metionUserListRef.current.nextUser();\n });\n\n return () => {\n unsubscribeArrowUp();\n unsubscribeArrowDown();\n };\n }\n }, [addEventListener, showUserList]);\n\n /**\n *\n * @param {MetionUser} user\n */\n function handleSelect(user) {\n onSelectUser();\n appendContent(\n `<span class=\"react-input-emoji--mention--text\" data-mention-id=\"${user.id}\" data-mention-name=\"${user.name}\">@${user.name}</span> `\n );\n }\n\n return (\n <>\n {loading ? (\n <div className=\"react-input-emoji--mention--container\">\n <div className=\"react-input-emoji--mention--loading\">\n <div className=\"react-input-emoji--mention--loading--spinner\">\n Loading...\n </div>\n </div>\n </div>\n ) : (\n showUserList && (\n <div\n className=\"react-input-emoji--mention--container\"\n onClick={evt => evt.stopPropagation()}\n >\n <MentionUserList\n ref={metionUserListRef}\n mentionSearchText={mentionSearchText}\n users={mentionUsers}\n onSelect={handleSelect}\n addEventListener={addEventListener}\n />\n </div>\n )\n )}\n </>\n );\n};\n\nexport default MentionWrapper;\n","// @ts-check\n\n// eslint-disable-next-line valid-jsdoc\n/**\n * @template T\n * @returns {import('../types/types').ListenerObj<T>}\n */\nexport function createObserver() {\n /** @type {import('../types/types').Listerner<T>[]} */\n let listeners = [];\n\n return {\n subscribe: listener => {\n listeners.push(listener);\n return () => {\n listeners = listeners.filter(l => l !== listener);\n };\n },\n publish: event => {\n listeners.forEach(listener => listener(event));\n },\n get currentListerners() {\n return listeners;\n }\n };\n}\n","// @ts-check\n\nimport { useCallback, useMemo } from \"react\";\nimport { createObserver } from \"../utils/observer\";\n\n/**\n * @typedef {import('../types/types').TextInputListeners} TextInputListeners\n */\n\n// eslint-disable-next-line valid-jsdoc\n/** */\nexport function useEventListeners() {\n /** @type {TextInputListeners} */\n const listeners = useMemo(\n () => ({\n keyDown: createObserver(),\n keyUp: createObserver(),\n arrowUp: createObserver(),\n arrowDown: createObserver(),\n enter: createObserver(),\n focus: createObserver(),\n blur: createObserver()\n }),\n []\n );\n\n /**\n * @template {keyof TextInputListeners} T, K\n * @type {(event: keyof TextInputListeners, fn: import('../types/types').Listerner<any>) => () => void}\n */\n const addEventListener = useCallback(\n (event, fn) => {\n return listeners[event].subscribe(fn);\n },\n [listeners]\n );\n\n return { addEventListener, listeners };\n}\n","// @ts-check\n\nimport { useCallback, useRef } from \"react\";\n\n/**\n * @typedef {import('../types/types').PolluteFn} PolluteFn\n */\n\n// eslint-disable-next-line valid-jsdoc\n/** */\nexport function usePollute() {\n /** @type {React.MutableRefObject<PolluteFn[]>} */\n const polluteFnsRef = useRef([]);\n\n /** @type {(fn: PolluteFn) => void} */\n const addPolluteFn = useCallback(fn => {\n polluteFnsRef.current.push(fn);\n }, []);\n\n /** @type {(html: string) => string} */\n const pollute = useCallback(text => {\n const result = polluteFnsRef.current.reduce((acc, fn) => {\n return fn(acc);\n }, text);\n\n return result;\n }, []);\n\n return { addPolluteFn, pollute };\n}\n","// @ts-check\n// vendors\nimport React, { useEffect, useRef, forwardRef, useCallback } from \"react\";\n\n// css\nimport \"./styles.css\";\n\n// utils\nimport { replaceAllTextEmojis } from \"./utils/emoji-utils\";\nimport { handleCopy, totalCharacters } from \"./utils/input-event-utils\";\n\n// hooks\nimport { useExpose } from \"./hooks/use-expose\";\nimport { useEmit } from \"./hooks/use-emit\";\n\n// components\nimport TextInput from \"./text-input\";\nimport EmojiPickerWrapper from \"./components/emoji-picker-wrapper\";\nimport MentionWrapper from \"./components/mention-wrapper\";\nimport { useEventListeners } from \"./hooks/use-event-listeners\";\nimport { useSanitize } from \"./hooks/use-sanitize\";\nimport { usePollute } from \"./hooks/user-pollute\";\n\n/**\n * @typedef {import('./types/types').MentionUser} MetionUser\n */\n\n/**\n * @typedef {import('./types/types').ListenerObj<any>} ListenerObj\n */\n\n/**\n * @typedef {object} Props\n * @property {string} value\n * @property {(value: string) => void} onChange\n * @property {\"light\" | \"dark\" | \"auto\"=} theme\n * @property {boolean=} cleanOnEnter\n * @property {(text: string) => void=} onEnter\n * @property {string=} placeholder\n * @property {string=} placeholderColor\n * @property {string=} color\n * @property {(size: {width: number, height: number}) => void=} onResize\n * @property {() => void=} onClick\n * @property {() => void=} onFocus\n * @property {() => void=} onBlur\n * @property {boolean} shouldReturn\n * @property {number=} maxLength\n * @property {boolean=} keepOpened\n * @property {(event: KeyboardEvent) => void=} onKeyDown\n * @property {string=} inputClass\n * @property {boolean=} disableRecent\n * @property {number=} tabIndex\n * @property {number=} height\n * @property {number=} borderRadius\n * @property {string=} borderColor\n * @property {number=} fontSize\n * @property {string=} fontFamily\n * @property {string=} background\n * @property {{id: string; name: string; emojis: {id: string; name: string; keywords: string[], skins: {src: string}[]}}[]=} customEmojis\n * @property {import('./types/types').Languages=} language\n * @property {(text: string) => Promise<MetionUser[]>=} searchMention\n * @property {HTMLDivElement=} buttonElement\n * @property {React.MutableRefObject=} buttonRef\n * @property {boolean} shouldConvertEmojiToImage\n */\n\n/**\n * Input Emoji Component\n * @param {Props} props\n * @param {React.Ref<any>} ref\n * @return {JSX.Element}\n */\nfunction InputEmoji(props, ref) {\n const {\n onChange,\n onEnter,\n onResize,\n onClick,\n onFocus,\n onBlur,\n onKeyDown,\n theme,\n cleanOnEnter,\n placeholder,\n maxLength,\n keepOpened,\n inputClass,\n disableRecent,\n tabIndex,\n value,\n customEmojis,\n language,\n searchMention,\n buttonElement,\n buttonRef,\n shouldReturn,\n shouldConvertEmojiToImage,\n // style\n borderRadius,\n borderColor,\n fontSize,\n fontFamily,\n background,\n placeholderColor,\n color,\n } = props;\n\n /** @type {React.MutableRefObject<import('./text-input').Ref | null>} */\n const textInputRef = useRef(null);\n\n const { addEventListener, listeners } = useEventListeners();\n\n const { addSanitizeFn, sanitize, sanitizedTextRef } = useSanitize(shouldReturn, shouldConvertEmojiToImage);\n\n const { addPolluteFn, pollute } = usePollute();\n\n const updateHTML = useCallback(\n (nextValue = \"\") => {\n if (textInputRef.current === null) return;\n\n textInputRef.current.html = replaceAllTextEmojis(nextValue);\n sanitizedTextRef.current = nextValue;\n },\n [sanitizedTextRef]\n );\n\n const setValue = useCallback(\n /**\n * \n * @param {string} value\n */\n (value) => {\n updateHTML(value);\n },\n [updateHTML]\n );\n\n const emitChange = useEmit(textInputRef, onResize, onChange);\n\n useExpose({\n ref,\n setValue,\n textInputRef,\n emitChange,\n shouldConvertEmojiToImage\n });\n\n useEffect(() => {\n if (sanitizedTextRef.current !== value) {\n setValue(value);\n }\n }, [sanitizedTextRef, setValue, value]);\n\n // useEffect(() => {\n // updateHTML();\n // }, [updateHTML]);\n\n useEffect(() => {\n /**\n * Handle keydown event\n * @param {React.KeyboardEvent} event\n * @return {boolean}\n */\n function handleKeydown(event) {\n if (\n typeof maxLength !== \"undefined\" &&\n event.key !== \"Backspace\" &&\n textInputRef.current !== null &&\n totalCharacters(textInputRef.current) >= maxLength\n ) {\n event.preventDefault();\n }\n\n if (event.key === \"Enter\" && textInputRef.current) {\n event.preventDefault();\n\n const text = sanitize(textInputRef.current.html);\n\n emitChange(sanitizedTextRef.current);\n\n if (\n typeof onEnter === \"function\" &&\n listeners.enter.currentListerners.length === 0\n ) {\n onEnter(text);\n }\n\n if (cleanOnEnter && listeners.enter.currentListerners.length === 0) {\n updateHTML(\"\");\n }\n\n if (typeof onKeyDown === \"function\") {\n onKeyDown(event.nativeEvent);\n }\n\n return false;\n }\n\n if (typeof onKeyDown === \"function\") {\n onKeyDown(event.nativeEvent);\n }\n\n return true;\n }\n\n const unsubscribe = addEventListener(\"keyDown\", handleKeydown);\n\n return () => {\n unsubscribe();\n };\n }, [\n addEventListener,\n cleanOnEnter,\n emitChange,\n listeners.enter.currentListerners.length,\n maxLength,\n onEnter,\n onKeyDown,\n sanitize,\n sanitizedTextRef,\n updateHTML\n ]);\n\n useEffect(() => {\n /** */\n function handleFocus() {\n if (typeof onClick === \"function\") {\n onClick();\n }\n\n if (typeof onFocus === \"function\") {\n onFocus();\n }\n }\n\n const unsubscribe = addEventListener(\"focus\", handleFocus);\n\n return () => {\n unsubscribe();\n };\n }, [addEventListener, onClick, onFocus]);\n\n useEffect(() => {\n /** */\n function handleBlur() {\n if (typeof onBlur === \"function\") {\n onBlur();\n }\n }\n\n const unsubscribe = addEventListener(\"blur\", handleBlur);\n\n return () => {\n unsubscribe();\n };\n }, [addEventListener, onBlur]);\n\n /**\n *\n * @param {string} html\n */\n function handleTextInputChange(html) {\n sanitize(html);\n\n if (value !== sanitizedTextRef.current) {\n emitChange(sanitizedTextRef.current);\n }\n }\n\n /**\n *\n * @param {string} html\n */\n function appendContent(html) {\n if (\n typeof maxLength !== \"undefined\" &&\n textInputRef.current !== null &&\n totalCharacters(textInputRef.current) >= maxLength\n ) {\n return;\n }\n\n if (textInputRef.current !== null) {\n textInputRef.current.appendContent(html);\n }\n }\n\n /**\n * Handle past on input\n * @param {React.ClipboardEvent} event\n */\n function handlePaste(event) {\n event.preventDefault();\n let content;\n if (event.clipboardData) {\n content = event.clipboardData.getData(\"text/plain\");\n content = pollute(content);\n document.execCommand(\"insertHTML\", false, content);\n }\n }\n\n return (\n <div className=\"react-emoji\">\n <MentionWrapper\n searchMention={searchMention}\n addEventListener={addEventListener}\n appendContent={appendContent}\n addSanitizeFn={addSanitizeFn}\n />\n <TextInput\n ref={textInputRef}\n onCopy={handleCopy}\n onPaste={handlePaste}\n shouldReturn={shouldReturn}\n onBlur={listeners.blur.publish}\n onFocus={listeners.focus.publish}\n onArrowUp={listeners.arrowUp.publish}\n onArrowDown={listeners.arrowDown.publish}\n onKeyUp={listeners.keyUp.publish}\n onKeyDown={listeners.keyDown.publish}\n onEnter={listeners.enter.publish}\n placeholder={placeholder}\n style={{\n borderRadius,\n borderColor,\n fontSize,\n fontFamily,\n background,\n placeholderColor,\n color\n }}\n tabIndex={tabIndex}\n className={inputClass}\n onChange={handleTextInputChange}\n />\n <EmojiPickerWrapper\n theme={theme}\n keepOpened={keepOpened}\n disableRecent={disableRecent}\n customEmojis={customEmojis}\n addSanitizeFn={addSanitizeFn}\n addPolluteFn={addPolluteFn}\n appendContent={appendContent}\n buttonElement={buttonElement}\n buttonRef={buttonRef}\n language={language}\n />\n </div>\n );\n}\n\nconst InputEmojiWithRef = forwardRef(InputEmoji);\n\nInputEmojiWithRef.defaultProps = {\n theme: /** @type {const} */ (\"auto\"),\n height: 30,\n placeholder: \"Type a message\",\n borderRadius: 21,\n borderColor: \"#EAEAEA\",\n color: \"black\",\n fontSize: 15,\n fontFamily: \"sans-serif\",\n background: \"white\",\n tabIndex: 0,\n shouldReturn: false,\n shouldConvertEmojiToImage: false,\n customEmojis: [],\n language: undefined,\n};\n\nexport default InputEmojiWithRef;\n"],"names":["styleInject","css","ref","insertAt","document","head","getElementsByTagName","style","createElement","type","firstChild","insertBefore","appendChild","styleSheet","cssText","createTextNode","TRANSPARENT_GIF","replaceAllTextEmojis","text","allEmojis","getAllEmojisFromText","_toConsumableArray","Set","forEach","emoji","replaceAll","getInputEmojiHTML","str","find","replace","RegExp","match","getImageEmoji","_emojiPickerEl$shadow","emojiPickerEl","querySelector","getInputEmojiNativeHTML","emojiSpanEl","shadowRoot","concat","name","replaceAllTextEmojiToString","html","container","innerHTML","images","Array","prototype","slice","call","querySelectorAll","image","outerHTML","dataset","handleCopy","event","selectedText","window","getSelection","i","len","rangeCount","getRangeAt","cloneContents","replaceEmojiToString","clipboardData","setData","innerText","preventDefault","handlePasteHtmlAtCaret","sel","range","deleteContents","el","frag","createDocumentFragment","node","lastNode","insertNode","cloneRange","setStartAfter","collapse","removeAllRanges","addRange","totalCharacters","_ref2","textCount","length","emojisCount","removeHtmlExceptBr","inputDiv","temp","tempContainer","stripped","final","getSelectionStart","startContainer","offset","startOffset","nodeType","Node","TEXT_NODE","nextSibling","commonAncestorContainer","getCursor","selection","selectionStart","addLineBreak","_getCursor","isCollapsed","textContent","br","setEndAfter","br2","setStart","setEnd","string","regexpOrSubstr","newValueOrFn","globalOffset","Error","fn","replaceUsingString","replaceUsingRegexp","patternString","index","indexOf","arr","endIndex","push","substring","regexp","output","replacerIsFn","storedLastIndex","lastIndex","result","exec","out","apply","input","global","module","stringReplaceToArray","stringOrArray","newSubStrOrFn","isArray","TypeError","arrayItem","re","toCodePoint","unicodeSurrogates","sep","r","c","p","charCodeAt","toString","join","UFE0Fg","U200D","String","fromCharCode","grabTheRightIcon","rawText","replaceEmoji","render","replaceStringToArray","emojiReplacer","_","icon","require","pageProtocol","location","protocol","emojiStyle","height","width","margin","verticalAlign","normalizeProtocol","charAt","makeTwemojiRenderer","options","merge","baseUrl","size","ext","props","renderTwemoji","src","key","alt","draggable","arguments","source","Object","hasOwnProperty","reactEasyEmoji","element","optionsOrFn","EMOJI_REGEX","useSanitize","shouldReturn","shouldConvertEmojiToImage","sanitizeFnsRef","useRef","sanitizedTextRef","addSanitizeFn","useCallback","current","sanitize","reduce","acc","replaceAllHtmlToString","convertEmojiToImage","handleEmoji","renderToString","useExpose","_ref","textInputRef","setValue","emitChange","_useSanitize","useImperativeHandle","value","focus","blur","useEmit","onResize","onChange","currentSizeRef","onChangeFn","checkAndEmitResize","currentSize","nextSize","sanitizedText","useEffect","TextInput","placeholder","tabIndex","className","_objectWithoutProperties","_excluded","appendContent","placeholderRef","visibility","offsetWidth","offsetHeight","placeholderStyle","useMemo","placeholderColor","color","inputStyle","handleKeyDown","shiftKey","ctrlKey","onEnter","onArrowUp","onArrowDown","onKeyDown","handleClick","onFocus","handleKeyUp","onKeyUp","React","onClick","contentEditable","onBlur","onCopy","onPaste","TextInputWithRef","forwardRef","EmojiPickerButton","showPicker","toggleShowPicker","buttonElement","buttonRef","localButtonRef","_useState","useState","_useState2","_slicedToArray","showCustomButtonContent","setShowCustomButtonContent","_buttonRef$current$ch","_buttonRef$current","_buttonElement$childN","_buttonElement$childN2","childNodes","xmlns","viewBox","d","$e5534fc185f7111e$export$2e2bcd8739ae039","$dvPge$useRef","instance","update","$dvPge$useEffect","$dvPge$Picker","$dvPge$react","EMOJI_MART_DATA_URL","cacheI18n","EmojiPicker","theme","onSelectEmoji","disableRecent","customEmojis","language","categories","categoryies","undefined","i18n","setI18n","en","fetch","then","_x","_asyncToGenerator","_regeneratorRuntime","mark","_callee","data","translations","wrap","_callee$","_context","prev","next","json","sent","stop","error","console","_x2","_callee2","_callee2$","_context2","Picker","previewPosition","onEmojiSelect","custom","set","memo","EmojiPickerContainer","handleSelectEmoji","position","evt","stopPropagation","top","EMOJI_PICKER_CONTAINER_HEIGHT","EmojiPickerWrapper","keepOpened","addPolluteFn","setShowPicker","_useState3","_useState4","customButton","setCustomButton","_useState5","_useState6","emojiPickerPosition","setEmojiPickerPosition","checkClickOutside","target","classList","contains","addEventListener","removeEventListener","calcTopPosition","currentShowPicker","btn","currentTarget","btnRect","getBoundingClientRect","popoverHeight","ReactDOM","createPortal","Fragment","getTextFromAtToCaret","getRangeFromAtToCaret","begin","end","deleteTextFromAtToCaret","deleteData","elementWithFocus","getElementWithFocus","caretOffset","lastAt","lastIndexOf","preCaretRange","selectNodeContents","endContainer","endOffset","textRange","createRange","preCaretTextRange","body","createTextRange","moveToElementText","setEndPoint","anchorNode","useMention","searchMention","loading","setLoading","mentionUsers","setMentionUsers","mentionSearchText","setMentionSearchText","onSelectUser","checkMentionText","metionText","users","_getElementWithFocus","abrupt","parentElement","hasAttribute","remove","includes","MentionUserList","onSelect","selectedUser","setSelectedUser","prevUser","currentSelectedUser","nextUser","getMentionSelectedNameEl","rest","usersFiltered","searchText","toLocaleLowerCase","map","user","nameHtml","toLowerCase","startsWith","names","split","_objectSpread","unsubscribe","id","onMouseOver","dangerouslySetInnerHTML","__html","MentionUserListWithRef","MentionWrapper","metionUserListRef","showUserList","setShowUserList","_useMention","mentionsEl","mentionEl","mentionName","mentionId","unsubscribeArrowUp","unsubscribeArrowDown","handleSelect","createObserver","listeners","subscribe","listener","filter","l","publish","currentListerners","useEventListeners","keyDown","keyUp","arrowUp","arrowDown","enter","usePollute","polluteFnsRef","pollute","InputEmoji","cleanOnEnter","maxLength","inputClass","borderRadius","borderColor","fontSize","fontFamily","background","_useEventListeners","_usePollute","updateHTML","nextValue","handleKeydown","nativeEvent","handleFocus","handleBlur","handleTextInputChange","handlePaste","content","getData","execCommand","InputEmojiWithRef","defaultProps"],"mappings":";;;;;;;;;;;AAAA,SAASA,WAAWA,CAACC,GAAG,EAAEC,GAAG,EAAE;EAC7B,IAAKA,GAAG,KAAK,KAAK,CAAC,EAAGA,GAAG,GAAG,EAAE,CAAA;AAC9B,EAAA,IAAIC,QAAQ,GAAGD,GAAG,CAACC,QAAQ,CAAA;AAE3B,EAAA,IAAI,CAACF,GAAG,IAAI,OAAOG,QAAQ,KAAK,WAAW,EAAE;AAAE,IAAA,OAAA;AAAQ,GAAA;AAEvD,EAAA,IAAIC,IAAI,GAAGD,QAAQ,CAACC,IAAI,IAAID,QAAQ,CAACE,oBAAoB,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,CAAA;AACpE,EAAA,IAAIC,KAAK,GAAGH,QAAQ,CAACI,aAAa,CAAC,OAAO,CAAC,CAAA;EAC3CD,KAAK,CAACE,IAAI,GAAG,UAAU,CAAA;EAEvB,IAAIN,QAAQ,KAAK,KAAK,EAAE;IACtB,IAAIE,IAAI,CAAC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Aa,EAAEA,aAAc;AAC7BgJ,IAAAA,YAAY,EAAEA,YAAa;AAC3B5G,IAAAA,aAAa,EAAEA,aAAc;AAC7BgC,IAAAA,aAAa,EAAEA,aAAc;AAC7BC,IAAAA,SAAS,EAAEA,SAAU;AACrB8B,IAAAA,QAAQ,EAAEA,QAAAA;AAAS,GACpB,CACE,CAAC,CAAA;AAEV,CAAA;AAEA,IAAM6L,iBAAiB,gBAAGhO,gBAAU,CAAC0M,UAAU,EAAC;AAEhDsB,iBAAiB,CAACC,YAAY,GAAG;EAC/BlM,KAAK,sBAAwB,MAAO;AACpC/H,EAAAA,MAAM,EAAE,EAAE;AACV+D,EAAAA,WAAW,EAAE,gBAAgB;AAC7B+O,EAAAA,YAAY,EAAE,EAAE;AAChBC,EAAAA,WAAW,EAAE,SAAS;AACtBnO,EAAAA,KAAK,EAAE,OAAO;AACdoO,EAAAA,QAAQ,EAAE,EAAE;AACZC,EAAAA,UAAU,EAAE,YAAY;AACxBC,EAAAA,UAAU,EAAE,OAAO;AACnBlP,EAAAA,QAAQ,EAAE,CAAC;AACXrC,EAAAA,YAAY,EAAE,KAAK;AACnBC,EAAAA,yBAAyB,EAAE,KAAK;AAChCsG,EAAAA,YAAY,EAAE,EAAE;AAChBC,EAAAA,QAAQ,EAAEG,SAAAA;AACZ,CAAC;;;;"}
|
1
|
+
{"version":3,"file":"index.js","sources":["../node_modules/style-inject/dist/style-inject.es.js","../src/utils/emoji-utils.js","../src/utils/input-event-utils.js","../node_modules/string-replace-to-array/string-replace-to-array.js","../node_modules/react-easy-emoji/lib/replaceEmoji.js","../node_modules/react-easy-emoji/lib/makeTwemojiRenderer.js","../node_modules/react-easy-emoji/index.js","../src/hooks/use-sanitize.js","../src/hooks/use-expose.js","../src/hooks/use-emit.js","../src/text-input.js","../src/components/emoji-picker-button.js","../node_modules/@emoji-mart/react/dist/module.js","../src/components/emoji-picker.js","../src/components/emoji-picker-container.js","../src/components/emoji-picker-wrapper.js","../src/utils/mention-utils.js","../src/hooks/use-mention.js","../src/components/mention-user-list.js","../src/components/mention-wrapper.js","../src/utils/observer.js","../src/hooks/use-event-listeners.js","../src/hooks/user-pollute.js","../src/index.js"],"sourcesContent":["function styleInject(css, ref) {\n if ( ref === void 0 ) ref = {};\n var insertAt = ref.insertAt;\n\n if (!css || typeof document === 'undefined') { return; }\n\n var head = document.head || document.getElementsByTagName('head')[0];\n var style = document.createElement('style');\n style.type = 'text/css';\n\n if (insertAt === 'top') {\n if (head.firstChild) {\n head.insertBefore(style, head.firstChild);\n } else {\n head.appendChild(style);\n }\n } else {\n head.appendChild(style);\n }\n\n if (style.styleSheet) {\n style.styleSheet.cssText = css;\n } else {\n style.appendChild(document.createTextNode(css));\n }\n}\n\nexport default styleInject;\n","/* eslint-disable valid-jsdoc */\n// @ts-check\n\nexport const TRANSPARENT_GIF =\n \"data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7\";\n\nexport const EMOJI_STYLE = \"\";\n\n/**\n * Replace all text with emoji with an image html tag\n * @param {string} text\n * @return {string}\n */\nexport function replaceAllTextEmojis(text) {\n let allEmojis = getAllEmojisFromText(text);\n\n if (allEmojis) {\n allEmojis = [...new Set(allEmojis)]; // remove duplicates\n\n allEmojis.forEach(emoji => {\n text = replaceAll(text, emoji, getInputEmojiHTML('', emoji));\n });\n }\n\n return text;\n}\n\n/**\n * Replace all occurrencies in a string\n * @param {string} str\n * @param {string} find\n * @param {string} replace\n * @return {string}\n */\nfunction replaceAll(str, find, replace) {\n return str.replace(new RegExp(find, \"g\"), replace);\n}\n\n/**\n * Get all emojis from the text\n * @param {string} text\n * @return {string[]}\n */\nfunction getAllEmojisFromText(text) {\n return text.match(\n /(?:[\\u2700-\\u27bf]|(?:\\ud83c[\\udde6-\\uddff]){2}|[\\ud800-\\udbff][\\udc00-\\udfff])[\\ufe0e\\ufe0f]?(?:[\\u0300-\\u036f\\ufe20-\\ufe23\\u20d0-\\u20f0]|\\ud83c[\\udffb-\\udfff])?(?:\\u200d(?:[^\\ud800-\\udfff]|(?:\\ud83c[\\udde6-\\uddff]){2}|[\\ud800-\\udbff][\\udc00-\\udfff])[\\ufe0e\\ufe0f]?(?:[\\u0300-\\u036f\\ufe20-\\ufe23\\u20d0-\\u20f0]|\\ud83c[\\udffb-\\udfff])?)*/g\n );\n}\n\n// eslint-disable-next-line valid-jsdoc\n/**\n *\n * @param { import(\"../types/types\").EmojiMartItem } emoji\n * @return {string}\n */\nexport function getImageEmoji(emoji) {\n /** @type {HTMLElement | null} */\n const emojiPickerEl = document.querySelector('em-emoji-picker')\n\n if (!emojiPickerEl) {\n return getInputEmojiNativeHTML(emoji.native)\n }\n\n /** @type {HTMLSpanElement | null=} */\n const emojiSpanEl = emojiPickerEl?.shadowRoot?.querySelector(`[title=\"${emoji.name}\"] > span > span`)\n\n if (!emojiSpanEl) {\n return getInputEmojiNativeHTML(emoji.native)\n }\n\n const style = replaceAll(emojiSpanEl.style.cssText, '\"', \"'\");\n\n return getInputEmojiHTML(style, emoji.native);\n}\n\n// eslint-disable-next-line valid-jsdoc\n/**\n *\n * @param {string} style\n * @param {string} emoji\n * @returns\n */\nfunction getInputEmojiHTML(style, emoji) {\n return `<img style=\"${style}; display: inline-block\" data-emoji=\"${emoji}\" src=\"${TRANSPARENT_GIF}\" />`;\n}\n\n/**\n * \n * @param {string} emoji \n * @returns \n */\nfunction getInputEmojiNativeHTML(emoji) {\n return `<span class=\"width: 18px; height: 18px; display: inline-block; margin: 0 1px;\">${emoji}</span>`;\n}\n\n/**\n *\n * @param {string} html\n * @return {string}\n */\nexport function replaceAllTextEmojiToString(html) {\n const container = document.createElement(\"div\");\n container.innerHTML = html;\n\n const images = Array.prototype.slice.call(container.querySelectorAll(\"img\"));\n\n images.forEach(image => {\n container.innerHTML = container.innerHTML.replace(\n image.outerHTML,\n image.dataset.emoji\n );\n });\n\n return container.innerHTML;\n}\n","// @ts-check\n\nimport {\n getImageEmoji,\n replaceAllTextEmojis,\n replaceAllTextEmojiToString,\n} from \"./emoji-utils\";\n\n/**\n * Handle copy of current selected text\n * @param {React.ClipboardEvent} event\n */\nexport function handleCopy(event) {\n const selectedText = window.getSelection();\n\n if (selectedText === null) {\n return;\n }\n\n let container = document.createElement(\"div\");\n\n for (let i = 0, len = selectedText.rangeCount; i < len; ++i) {\n container.appendChild(selectedText.getRangeAt(i).cloneContents());\n }\n\n container = replaceEmojiToString(container);\n\n event.clipboardData.setData(\"text\", container.innerText);\n event.preventDefault();\n}\n\n/** @type {Range|undefined} */\n/** @type {Range|undefined} */\nlet currentRangeCached;\n\n/**\n * Caches the current text selection range\n */\nexport function cacheCurrentRange() {\n const selection = window.getSelection();\n if (!selection.rangeCount || (selection?.anchorNode['className'] !== 'react-input-emoji--input' && selection.anchorNode.parentNode['className'] !== 'react-input-emoji--input')) return;\n const range = selection.getRangeAt(0);\n\n currentRangeCached = range.cloneRange();\n}\n\n/**\n * Clears the cached text selection range\n */\nexport function cleanCurrentRange() {\n currentRangeCached = undefined;\n}\n\n/**\n * @param {string} html - HTML string to be pasted at the caret position\n */\nexport function handlePasteHtmlAtCaret(html) {\n let sel;\n let range;\n if (window.getSelection) {\n // IE9 and non-IE\n sel = window.getSelection();\n\n if (sel === null) return;\n\n if (sel.getRangeAt && sel.rangeCount) {\n range = currentRangeCached ?? sel.getRangeAt(0);\n range.deleteContents();\n\n // Range.createContextualFragment() would be useful here but is\n // non-standard and not supported in all browsers (IE9, for one)\n const el = document.createElement(\"div\");\n el.innerHTML = html;\n const frag = document.createDocumentFragment();\n let node;\n let lastNode;\n while ((node = el.firstChild)) {\n lastNode = frag.appendChild(node);\n }\n range.insertNode(frag);\n\n // Preserve the selection\n if (lastNode) {\n range = range.cloneRange();\n currentRangeCached = range\n range.setStartAfter(lastNode);\n range.collapse(true);\n sel.removeAllRanges();\n sel.addRange(range);\n }\n }\n }\n}\n\n/**\n * Replace emoji img to its string value\n * @param {HTMLDivElement} container\n * @return {HTMLDivElement}\n */\nfunction replaceEmojiToString(container) {\n const images = Array.prototype.slice.call(container.querySelectorAll(\"img\"));\n\n images.forEach((image) => {\n image.outerHTML = image.dataset.emoji;\n });\n\n return container;\n}\n\n/**\n * Handle past on input\n * @param {React.ClipboardEvent} event\n */\nexport function handlePaste(event) {\n event.preventDefault();\n let content;\n if (event.clipboardData) {\n content = event.clipboardData.getData(\"text/plain\");\n content = replaceAllTextEmojis(content);\n document.execCommand(\"insertHTML\", false, content);\n }\n}\n\n/**\n * @typedef {object} HandleKeyDownOptions\n * @property {HTMLDivElement} placeholderEl\n * @property {number} maxLength\n * @property {HTMLDivElement} inputEl\n * @property {React.MutableRefObject<string>} cleanedTextRef\n * @property {React.MutableRefObject<HTMLDivElement>} textInputRef\n * @property {boolean} cleanOnEnter\n * @property {function(): void} emitChange\n * @property {(function(string): void)=} onEnter\n * @property {(function(KeyboardEvent): void)=} onKeyDown\n * @property {(function(string): void)} updateHTML\n */\n\n// eslint-disable-next-line valid-jsdoc\n/**\n * @typedef {Object} HandleSelectEmojiProps\n * @property {import(\"../types/types\").EmojiMartItem} emoji\n * @property {React.MutableRefObject<import('../text-input').Ref>} textInputRef\n * @property {boolean} keepOpened\n * @property {() => void} toggleShowPicker\n * @property {number=} maxLength\n */\n\n/**\n *\n * @param {HandleSelectEmojiProps} props\n */\nexport function handleSelectEmoji({\n emoji,\n textInputRef,\n keepOpened,\n toggleShowPicker,\n maxLength,\n}) {\n if (\n typeof maxLength !== \"undefined\" &&\n totalCharacters(textInputRef.current) >= maxLength\n ) {\n return;\n }\n\n textInputRef.current.appendContent(getImageEmoji(emoji));\n\n if (!keepOpened) {\n toggleShowPicker();\n }\n}\n\n/**\n *\n * @param {{text: string, html: string}} props\n * @return {number}\n */\nexport function totalCharacters({ text, html }) {\n const textCount = text.length;\n const emojisCount = (html.match(/<img/g) || []).length;\n\n return textCount + emojisCount;\n}\n\n// eslint-disable-next-line valid-jsdoc\n/**\n * Handle keyup event\n * @param {() => void} emitChange\n * @param {(event: KeyboardEvent) => void} onKeyDownMention\n * @param {React.MutableRefObject<string>} cleanedTextRef\n * @param {React.MutableRefObject<HTMLDivElement>} textInputRef\n * @return {(event: KeyboardEvent) => void}\n */\nexport function handleKeyup(\n emitChange,\n onKeyDownMention,\n cleanedTextRef,\n textInputRef,\n) {\n return (event) => {\n const text = replaceAllTextEmojiToString(textInputRef.current.innerHTML);\n cleanedTextRef.current = text;\n emitChange();\n onKeyDownMention(event);\n };\n}\n\n/**\n * Handle focus event\n * @param {function(FocusEvent): void} onFocus\n * @return {function(FocusEvent): void}\n */\nexport function handleFocus(onFocus) {\n return (event) => {\n onFocus(event);\n };\n}\n\n/**\n * Set caret to the end of text value\n * @param {React.MutableRefObject<HTMLDivElement| null>} input\n */\nexport function moveCaretToEnd(input) {\n let range;\n let selection;\n if (document.createRange && input.current) {\n range = document.createRange();\n range.selectNodeContents(input.current);\n range.collapse(false);\n selection = window.getSelection();\n if (selection) {\n selection.removeAllRanges();\n selection.addRange(range);\n }\n }\n}\n/**\n *\n * @param {HTMLDivElement} inputDiv\n * @return {string}\n */\nexport function removeHtmlExceptBr(inputDiv) {\n const temp = inputDiv.innerHTML.replaceAll(/<br\\s*\\/?>/gi, \"[BR]\"); // temporarily replace <br> with placeholder\n const tempContainer = document.createElement(\"div\");\n tempContainer.innerHTML = temp;\n const stripped = tempContainer.innerText; // strip all html tags\n const final = stripped.replaceAll(/\\[BR\\]/gi, \"</br>\"); // replace placeholders with <br>\n return final;\n}\n\n/**\n * \n * @param {*} range \n * @returns \n */\nexport function getSelectionStart(range) {\n let node = range.startContainer;\n let offset = range.startOffset;\n\n // Handle cases where the selection start node is not a text node\n if (node.nodeType !== Node.TEXT_NODE) {\n while (node.nodeType !== Node.TEXT_NODE) {\n node = node.nextSibling;\n if (!node) break;\n }\n if (!node) {\n node = range.commonAncestorContainer;\n while (node.nodeType !== Node.TEXT_NODE) {\n node = node.firstChild;\n }\n }\n offset = 0;\n }\n\n return { node, offset };\n}\n\n/**\n * \n * @return {Object} cursor\n */\nexport function getCursor() {\n const selection = window.getSelection();\n const range = selection.getRangeAt(0);\n const selectionStart = getSelectionStart(range);\n\n return {selection, range, selectionStart}\n}\n\n/**\n *\n */\nexport function addLineBreak() {\n const { selection, range, selectionStart } = getCursor()\n\n // If cursor is at the end of the text content, add one more line break\n if (\n selection.isCollapsed &&\n selectionStart.offset === selectionStart.node.textContent.length\n ) {\n const br = document.createElement(\"br\");\n range.insertNode(br);\n range.setStartAfter(br);\n range.setEndAfter(br);\n selection.removeAllRanges();\n selection.addRange(range);\n\n const br2 = document.createElement(\"br\");\n range.insertNode(br2);\n range.setStartAfter(br2);\n range.setEndAfter(br2);\n selection.removeAllRanges();\n selection.addRange(range);\n } else {\n const br = document.createElement(\"br\");\n range.insertNode(br);\n range.setStartAfter(br);\n range.setEndAfter(br);\n selection.removeAllRanges();\n selection.addRange(range);\n // Set cursor position right before the first letter after the line break\n if (\n selectionStart.node.nextSibling &&\n selectionStart.node.nextSibling.nodeType === Node.TEXT_NODE\n ) {\n range.setStart(selectionStart.node.nextSibling, 1);\n range.setEnd(selectionStart.node.nextSibling, 1);\n }\n selection.removeAllRanges();\n selection.addRange(range);\n }\n}\n","// Inspiration: https://github.com/facebook/react/issues/3386\n\nfunction replace (string, regexpOrSubstr, newValueOrFn, globalOffset) {\n\tif (typeof string !== 'string') throw new Error('First param must be a string')\n\tif (typeof regexpOrSubstr !== 'string' && !(regexpOrSubstr instanceof RegExp)) throw new Error('Second param must be a string pattern or a regular expression')\n\n\tvar fn = (typeof regexpOrSubstr === 'string') ? replaceUsingString : replaceUsingRegexp\n\n\treturn fn(string, regexpOrSubstr, newValueOrFn, globalOffset)\n}\n\nfunction replaceUsingString (string, patternString, newValueOrFn, globalOffset) {\n\tvar index = string.indexOf(patternString)\n\n\tif (index >= 0) {\n\t\tvar arr = []\n\t\tvar endIndex = index + patternString.length\n\n\t\tif (index > 0) {\n\t\t\tarr.push(string.substring(0, index))\n\t\t}\n\n\t\tarr.push(\n\t\t\t(typeof newValueOrFn === 'function') ?\n\t\t\t\tnewValueOrFn(\n\t\t\t\t\tstring.substring(index, endIndex),\n\t\t\t\t\tindex + globalOffset,\n\t\t\t\t\tstring\n\t\t\t\t) :\n\t\t\t\tnewValueOrFn\n\t\t)\n\n\t\tif (endIndex < string.length) {\n\t\t\tarr.push(string.substring(endIndex))\n\t\t}\n\n\t\treturn arr\n\t} else {\n\t\treturn [string]\n\t}\n}\n\nfunction replaceUsingRegexp (string, regexp, newValueOrFn, globalOffset) {\n\tvar output = []\n\n\tvar replacerIsFn = (typeof newValueOrFn === 'function')\n\n\tvar storedLastIndex = regexp.lastIndex\n\tregexp.lastIndex = 0\n\n\tvar result\n\tvar lastIndex = 0\n\twhile (result = regexp.exec(string)) {\n\t\tvar index = result.index\n\n\t\tif (result[0] === '') {\n\t\t\t// When the regexp is an empty string\n\t\t\t// we still want to advance our cursor to the next item.\n\t\t\t// This is the behavior of String.replace.\n\t\t\tregexp.lastIndex++\n\t\t}\n\n\t\tif (index !== lastIndex) {\n\t\t\toutput.push(string.substring(lastIndex, index))\n\t\t}\n\n\t\tvar match = result[0]\n\t\tlastIndex = index + match.length\n\t\t\n\t\tvar out = replacerIsFn ?\n\t\t\tnewValueOrFn.apply(this, result.concat(index + globalOffset, result.input)) :\n\t\t\tnewValueOrFn\n\t\toutput.push(out)\n\n\t\tif (!regexp.global) {\n\t\t\tbreak\n\t\t}\n\t}\n\n\tif (lastIndex < string.length) {\n\t\toutput.push(string.substring(lastIndex))\n\t}\n\n\tregexp.lastIndex = storedLastIndex\n\treturn output\n}\n\nmodule.exports = function stringReplaceToArray (stringOrArray, regexpOrSubstr, newSubStrOrFn) {\n\tif (typeof stringOrArray === 'string') {\n\t\treturn replace(stringOrArray, regexpOrSubstr, newSubStrOrFn, 0)\n\t} else if (!Array.isArray(stringOrArray) || !stringOrArray[0]) {\n\t\tthrow new TypeError('First argument must be an array or non-empty string')\n\t} else {\n\t\tvar len = stringOrArray.length\n\t\tvar output = []\n\t\tvar globalOffset = 0\n\t\tfor (var i = 0; i < len; ++i) {\n\t\t\tvar arrayItem = stringOrArray[i]\n\t\t\tif (typeof arrayItem === 'string') {\n\t\t\t\toutput.push.apply(output, replace(arrayItem, regexpOrSubstr, newSubStrOrFn, globalOffset))\n\t\t\t\tglobalOffset += arrayItem.length\n\t\t\t} else {\n\t\t\t\toutput.push(arrayItem)\n\t\t\t}\n\t\t}\n\t\treturn output\n\t}\n}","var replaceStringToArray = require('string-replace-to-array')\n\n// This is based off of https://github.com/twitter/twemoji/blob/gh-pages/2/twemoji.js\n//\n// Ideally we'd use twemoji instead of replicating its logic.\n// The reason we can't is that we need to run our own replace.\n//\n// We could use it for most things (by essentially running twemoji.parse for each\n// regex match, and reading the code from the callback), but the one thing we'd always need\n// to copy and paste into this file is the regex since we need it to run the replace.\n//\n// Another option is to fork twemoji and expose a method in it that could help us, then\n// ask them to pull it in.\n//\n\n// RegExp based on emoji's official Unicode standards\n// http://www.unicode.org/Public/UNIDATA/EmojiSources.txt\nvar re = /(?:\\ud83d\\udc68\\ud83c\\udffb\\u200d\\u2764\\ufe0f\\u200d\\ud83d\\udc8b\\u200d\\ud83d\\udc68\\ud83c[\\udffb-\\udfff]|\\ud83d\\udc68\\ud83c\\udffc\\u200d\\u2764\\ufe0f\\u200d\\ud83d\\udc8b\\u200d\\ud83d\\udc68\\ud83c[\\udffb-\\udfff]|\\ud83d\\udc68\\ud83c\\udffd\\u200d\\u2764\\ufe0f\\u200d\\ud83d\\udc8b\\u200d\\ud83d\\udc68\\ud83c[\\udffb-\\udfff]|\\ud83d\\udc68\\ud83c\\udffe\\u200d\\u2764\\ufe0f\\u200d\\ud83d\\udc8b\\u200d\\ud83d\\udc68\\ud83c[\\udffb-\\udfff]|\\ud83d\\udc68\\ud83c\\udfff\\u200d\\u2764\\ufe0f\\u200d\\ud83d\\udc8b\\u200d\\ud83d\\udc68\\ud83c[\\udffb-\\udfff]|\\ud83d\\udc69\\ud83c\\udffb\\u200d\\u2764\\ufe0f\\u200d\\ud83d\\udc8b\\u200d\\ud83d\\udc68\\ud83c[\\udffb-\\udfff]|\\ud83d\\udc69\\ud83c\\udffb\\u200d\\u2764\\ufe0f\\u200d\\ud83d\\udc8b\\u200d\\ud83d\\udc69\\ud83c[\\udffb-\\udfff]|\\ud83d\\udc69\\ud83c\\udffc\\u200d\\u2764\\ufe0f\\u200d\\ud83d\\udc8b\\u200d\\ud83d\\udc68\\ud83c[\\udffb-\\udfff]|\\ud83d\\udc69\\ud83c\\udffc\\u200d\\u2764\\ufe0f\\u200d\\ud83d\\udc8b\\u200d\\ud83d\\udc69\\ud83c[\\udffb-\\udfff]|\\ud83d\\udc69\\ud83c\\udffd\\u200d\\u2764\\ufe0f\\u200d\\ud83d\\udc8b\\u200d\\ud83d\\udc68\\ud83c[\\udffb-\\udfff]|\\ud83d\\udc69\\ud83c\\udffd\\u200d\\u2764\\ufe0f\\u200d\\ud83d\\udc8b\\u200d\\ud83d\\udc69\\ud83c[\\udffb-\\udfff]|\\ud83d\\udc69\\ud83c\\udffe\\u200d\\u2764\\ufe0f\\u200d\\ud83d\\udc8b\\u200d\\ud83d\\udc68\\ud83c[\\udffb-\\udfff]|\\ud83d\\udc69\\ud83c\\udffe\\u200d\\u2764\\ufe0f\\u200d\\ud83d\\udc8b\\u200d\\ud83d\\udc69\\ud83c[\\udffb-\\udfff]|\\ud83d\\udc69\\ud83c\\udfff\\u200d\\u2764\\ufe0f\\u200d\\ud83d\\udc8b\\u200d\\ud83d\\udc68\\ud83c[\\udffb-\\udfff]|\\ud83d\\udc69\\ud83c\\udfff\\u200d\\u2764\\ufe0f\\u200d\\ud83d\\udc8b\\u200d\\ud83d\\udc69\\ud83c[\\udffb-\\udfff]|\\ud83e\\uddd1\\ud83c\\udffb\\u200d\\u2764\\ufe0f\\u200d\\ud83d\\udc8b\\u200d\\ud83e\\uddd1\\ud83c[\\udffc-\\udfff]|\\ud83e\\uddd1\\ud83c\\udffc\\u200d\\u2764\\ufe0f\\u200d\\ud83d\\udc8b\\u200d\\ud83e\\uddd1\\ud83c[\\udffb\\udffd-\\udfff]|\\ud83e\\uddd1\\ud83c\\udffd\\u200d\\u2764\\ufe0f\\u200d\\ud83d\\udc8b\\u200d\\ud83e\\uddd1\\ud83c[\\udffb\\udffc\\udffe\\udfff]|\\ud83e\\uddd1\\ud83c\\udffe\\u200d\\u2764\\ufe0f\\u200d\\ud83d\\udc8b\\u200d\\ud83e\\uddd1\\ud83c[\\udffb-\\udffd\\udfff]|\\ud83e\\uddd1\\ud83c\\udfff\\u200d\\u2764\\ufe0f\\u200d\\ud83d\\udc8b\\u200d\\ud83e\\uddd1\\ud83c[\\udffb-\\udffe]|\\ud83d\\udc68\\ud83c\\udffb\\u200d\\u2764\\ufe0f\\u200d\\ud83d\\udc68\\ud83c[\\udffb-\\udfff]|\\ud83d\\udc68\\ud83c\\udffb\\u200d\\ud83e\\udd1d\\u200d\\ud83d\\udc68\\ud83c[\\udffc-\\udfff]|\\ud83d\\udc68\\ud83c\\udffc\\u200d\\u2764\\ufe0f\\u200d\\ud83d\\udc68\\ud83c[\\udffb-\\udfff]|\\ud83d\\udc68\\ud83c\\udffc\\u200d\\ud83e\\udd1d\\u200d\\ud83d\\udc68\\ud83c[\\udffb\\udffd-\\udfff]|\\ud83d\\udc68\\ud83c\\udffd\\u200d\\u2764\\ufe0f\\u200d\\ud83d\\udc68\\ud83c[\\udffb-\\udfff]|\\ud83d\\udc68\\ud83c\\udffd\\u200d\\ud83e\\udd1d\\u200d\\ud83d\\udc68\\ud83c[\\udffb\\udffc\\udffe\\udfff]|\\ud83d\\udc68\\ud83c\\udffe\\u200d\\u2764\\ufe0f\\u200d\\ud83d\\udc68\\ud83c[\\udffb-\\udfff]|\\ud83d\\udc68\\ud83c\\udffe\\u200d\\ud83e\\udd1d\\u200d\\ud83d\\udc68\\ud83c[\\udffb-\\udffd\\udfff]|\\ud83d\\udc68\\ud83c\\udfff\\u200d\\u2764\\ufe0f\\u200d\\ud83d\\udc68\\ud83c[\\udffb-\\udfff]|\\ud83d\\udc68\\ud83c\\udfff\\u200d\\ud83e\\udd1d\\u200d\\ud83d\\udc68\\ud83c[\\udffb-\\udffe]|\\ud83d\\udc69\\ud83c\\udffb\\u200d\\u2764\\ufe0f\\u200d\\ud83d\\udc68\\ud83c[\\udffb-\\udfff]|\\ud83d\\udc69\\ud83c\\udffb\\u200d\\u2764\\ufe0f\\u200d\\ud83d\\udc69\\ud83c[\\udffb-\\udfff]|\\ud83d\\udc69\\ud83c\\udffb\\u200d\\ud83e\\udd1d\\u200d\\ud83d\\udc68\\ud83c[\\udffc-\\udfff]|\\ud83d\\udc69\\ud83c\\udffb\\u200d\\ud83e\\udd1d\\u200d\\ud83d\\udc69\\ud83c[\\udffc-\\udfff]|\\ud83d\\udc69\\ud83c\\udffc\\u200d\\u2764\\ufe0f\\u200d\\ud83d\\udc68\\ud83c[\\udffb-\\udfff]|\\ud83d\\udc69\\ud83c\\udffc\\u200d\\u2764\\ufe0f\\u200d\\ud83d\\udc69\\ud83c[\\udffb-\\udfff]|\\ud83d\\udc69\\ud83c\\udffc\\u200d\\ud83e\\udd1d\\u200d\\ud83d\\udc68\\ud83c[\\udffb\\udffd-\\udfff]|\\ud83d\\udc69\\ud83c\\udffc\\u200d\\ud83e\\udd1d\\u200d\\ud83d\\udc69\\ud83c[\\udffb\\udffd-\\udfff]|\\ud83d\\udc69\\ud83c\\udffd\\u200d\\u2764\\ufe0f\\u200d\\ud83d\\udc68\\ud83c[\\udffb-\\udfff]|\\ud83d\\udc69\\ud83c\\udffd\\u200d\\u2764\\ufe0f\\u200d\\ud83d\\udc69\\ud83c[\\udffb-\\udfff]|\\ud83d\\udc69\\ud83c\\udffd\\u200d\\ud83e\\udd1d\\u200d\\ud83d\\udc68\\ud83c[\\udffb\\udffc\\udffe\\udfff]|\\ud83d\\udc69\\ud83c\\udffd\\u200d\\ud83e\\udd1d\\u200d\\ud83d\\udc69\\ud83c[\\udffb\\udffc\\udffe\\udfff]|\\ud83d\\udc69\\ud83c\\udffe\\u200d\\u2764\\ufe0f\\u200d\\ud83d\\udc68\\ud83c[\\udffb-\\udfff]|\\ud83d\\udc69\\ud83c\\udffe\\u200d\\u2764\\ufe0f\\u200d\\ud83d\\udc69\\ud83c[\\udffb-\\udfff]|\\ud83d\\udc69\\ud83c\\udffe\\u200d\\ud83e\\udd1d\\u200d\\ud83d\\udc68\\ud83c[\\udffb-\\udffd\\udfff]|\\ud83d\\udc69\\ud83c\\udffe\\u200d\\ud83e\\udd1d\\u200d\\ud83d\\udc69\\ud83c[\\udffb-\\udffd\\udfff]|\\ud83d\\udc69\\ud83c\\udfff\\u200d\\u2764\\ufe0f\\u200d\\ud83d\\udc68\\ud83c[\\udffb-\\udfff]|\\ud83d\\udc69\\ud83c\\udfff\\u200d\\u2764\\ufe0f\\u200d\\ud83d\\udc69\\ud83c[\\udffb-\\udfff]|\\ud83d\\udc69\\ud83c\\udfff\\u200d\\ud83e\\udd1d\\u200d\\ud83d\\udc68\\ud83c[\\udffb-\\udffe]|\\ud83d\\udc69\\ud83c\\udfff\\u200d\\ud83e\\udd1d\\u200d\\ud83d\\udc69\\ud83c[\\udffb-\\udffe]|\\ud83e\\uddd1\\ud83c\\udffb\\u200d\\u2764\\ufe0f\\u200d\\ud83e\\uddd1\\ud83c[\\udffc-\\udfff]|\\ud83e\\uddd1\\ud83c\\udffb\\u200d\\ud83e\\udd1d\\u200d\\ud83e\\uddd1\\ud83c[\\udffb-\\udfff]|\\ud83e\\uddd1\\ud83c\\udffc\\u200d\\u2764\\ufe0f\\u200d\\ud83e\\uddd1\\ud83c[\\udffb\\udffd-\\udfff]|\\ud83e\\uddd1\\ud83c\\udffc\\u200d\\ud83e\\udd1d\\u200d\\ud83e\\uddd1\\ud83c[\\udffb-\\udfff]|\\ud83e\\uddd1\\ud83c\\udffd\\u200d\\u2764\\ufe0f\\u200d\\ud83e\\uddd1\\ud83c[\\udffb\\udffc\\udffe\\udfff]|\\ud83e\\uddd1\\ud83c\\udffd\\u200d\\ud83e\\udd1d\\u200d\\ud83e\\uddd1\\ud83c[\\udffb-\\udfff]|\\ud83e\\uddd1\\ud83c\\udffe\\u200d\\u2764\\ufe0f\\u200d\\ud83e\\uddd1\\ud83c[\\udffb-\\udffd\\udfff]|\\ud83e\\uddd1\\ud83c\\udffe\\u200d\\ud83e\\udd1d\\u200d\\ud83e\\uddd1\\ud83c[\\udffb-\\udfff]|\\ud83e\\uddd1\\ud83c\\udfff\\u200d\\u2764\\ufe0f\\u200d\\ud83e\\uddd1\\ud83c[\\udffb-\\udffe]|\\ud83e\\uddd1\\ud83c\\udfff\\u200d\\ud83e\\udd1d\\u200d\\ud83e\\uddd1\\ud83c[\\udffb-\\udfff]|\\ud83d\\udc68\\u200d\\u2764\\ufe0f\\u200d\\ud83d\\udc8b\\u200d\\ud83d\\udc68|\\ud83d\\udc69\\u200d\\u2764\\ufe0f\\u200d\\ud83d\\udc8b\\u200d\\ud83d[\\udc68\\udc69]|\\ud83e\\udef1\\ud83c\\udffb\\u200d\\ud83e\\udef2\\ud83c[\\udffc-\\udfff]|\\ud83e\\udef1\\ud83c\\udffc\\u200d\\ud83e\\udef2\\ud83c[\\udffb\\udffd-\\udfff]|\\ud83e\\udef1\\ud83c\\udffd\\u200d\\ud83e\\udef2\\ud83c[\\udffb\\udffc\\udffe\\udfff]|\\ud83e\\udef1\\ud83c\\udffe\\u200d\\ud83e\\udef2\\ud83c[\\udffb-\\udffd\\udfff]|\\ud83e\\udef1\\ud83c\\udfff\\u200d\\ud83e\\udef2\\ud83c[\\udffb-\\udffe]|\\ud83d\\udc68\\u200d\\u2764\\ufe0f\\u200d\\ud83d\\udc68|\\ud83d\\udc69\\u200d\\u2764\\ufe0f\\u200d\\ud83d[\\udc68\\udc69]|\\ud83e\\uddd1\\u200d\\ud83e\\udd1d\\u200d\\ud83e\\uddd1|\\ud83d\\udc6b\\ud83c[\\udffb-\\udfff]|\\ud83d\\udc6c\\ud83c[\\udffb-\\udfff]|\\ud83d\\udc6d\\ud83c[\\udffb-\\udfff]|\\ud83d\\udc8f\\ud83c[\\udffb-\\udfff]|\\ud83d\\udc91\\ud83c[\\udffb-\\udfff]|\\ud83e\\udd1d\\ud83c[\\udffb-\\udfff]|\\ud83d[\\udc6b-\\udc6d\\udc8f\\udc91]|\\ud83e\\udd1d)|(?:\\ud83d[\\udc68\\udc69]|\\ud83e\\uddd1)(?:\\ud83c[\\udffb-\\udfff])?\\u200d(?:\\u2695\\ufe0f|\\u2696\\ufe0f|\\u2708\\ufe0f|\\ud83c[\\udf3e\\udf73\\udf7c\\udf84\\udf93\\udfa4\\udfa8\\udfeb\\udfed]|\\ud83d[\\udcbb\\udcbc\\udd27\\udd2c\\ude80\\ude92]|\\ud83e[\\uddaf-\\uddb3\\uddbc\\uddbd])|(?:\\ud83c[\\udfcb\\udfcc]|\\ud83d[\\udd74\\udd75]|\\u26f9)((?:\\ud83c[\\udffb-\\udfff]|\\ufe0f)\\u200d[\\u2640\\u2642]\\ufe0f)|(?:\\ud83c[\\udfc3\\udfc4\\udfca]|\\ud83d[\\udc6e\\udc70\\udc71\\udc73\\udc77\\udc81\\udc82\\udc86\\udc87\\ude45-\\ude47\\ude4b\\ude4d\\ude4e\\udea3\\udeb4-\\udeb6]|\\ud83e[\\udd26\\udd35\\udd37-\\udd39\\udd3d\\udd3e\\uddb8\\uddb9\\uddcd-\\uddcf\\uddd4\\uddd6-\\udddd])(?:\\ud83c[\\udffb-\\udfff])?\\u200d[\\u2640\\u2642]\\ufe0f|(?:\\ud83d\\udc68\\u200d\\ud83d\\udc68\\u200d\\ud83d\\udc66\\u200d\\ud83d\\udc66|\\ud83d\\udc68\\u200d\\ud83d\\udc68\\u200d\\ud83d\\udc67\\u200d\\ud83d[\\udc66\\udc67]|\\ud83d\\udc68\\u200d\\ud83d\\udc69\\u200d\\ud83d\\udc66\\u200d\\ud83d\\udc66|\\ud83d\\udc68\\u200d\\ud83d\\udc69\\u200d\\ud83d\\udc67\\u200d\\ud83d[\\udc66\\udc67]|\\ud83d\\udc69\\u200d\\ud83d\\udc69\\u200d\\ud83d\\udc66\\u200d\\ud83d\\udc66|\\ud83d\\udc69\\u200d\\ud83d\\udc69\\u200d\\ud83d\\udc67\\u200d\\ud83d[\\udc66\\udc67]|\\ud83d\\udc68\\u200d\\ud83d\\udc66\\u200d\\ud83d\\udc66|\\ud83d\\udc68\\u200d\\ud83d\\udc67\\u200d\\ud83d[\\udc66\\udc67]|\\ud83d\\udc68\\u200d\\ud83d\\udc68\\u200d\\ud83d[\\udc66\\udc67]|\\ud83d\\udc68\\u200d\\ud83d\\udc69\\u200d\\ud83d[\\udc66\\udc67]|\\ud83d\\udc69\\u200d\\ud83d\\udc66\\u200d\\ud83d\\udc66|\\ud83d\\udc69\\u200d\\ud83d\\udc67\\u200d\\ud83d[\\udc66\\udc67]|\\ud83d\\udc69\\u200d\\ud83d\\udc69\\u200d\\ud83d[\\udc66\\udc67]|\\ud83c\\udff3\\ufe0f\\u200d\\u26a7\\ufe0f|\\ud83c\\udff3\\ufe0f\\u200d\\ud83c\\udf08|\\ud83d\\ude36\\u200d\\ud83c\\udf2b\\ufe0f|\\u2764\\ufe0f\\u200d\\ud83d\\udd25|\\u2764\\ufe0f\\u200d\\ud83e\\ude79|\\ud83c\\udff4\\u200d\\u2620\\ufe0f|\\ud83d\\udc15\\u200d\\ud83e\\uddba|\\ud83d\\udc3b\\u200d\\u2744\\ufe0f|\\ud83d\\udc41\\u200d\\ud83d\\udde8|\\ud83d\\udc68\\u200d\\ud83d[\\udc66\\udc67]|\\ud83d\\udc69\\u200d\\ud83d[\\udc66\\udc67]|\\ud83d\\udc6f\\u200d\\u2640\\ufe0f|\\ud83d\\udc6f\\u200d\\u2642\\ufe0f|\\ud83d\\ude2e\\u200d\\ud83d\\udca8|\\ud83d\\ude35\\u200d\\ud83d\\udcab|\\ud83e\\udd3c\\u200d\\u2640\\ufe0f|\\ud83e\\udd3c\\u200d\\u2642\\ufe0f|\\ud83e\\uddde\\u200d\\u2640\\ufe0f|\\ud83e\\uddde\\u200d\\u2642\\ufe0f|\\ud83e\\udddf\\u200d\\u2640\\ufe0f|\\ud83e\\udddf\\u200d\\u2642\\ufe0f|\\ud83d\\udc08\\u200d\\u2b1b)|[#*0-9]\\ufe0f?\\u20e3|(?:[©®\\u2122\\u265f]\\ufe0f)|(?:\\ud83c[\\udc04\\udd70\\udd71\\udd7e\\udd7f\\ude02\\ude1a\\ude2f\\ude37\\udf21\\udf24-\\udf2c\\udf36\\udf7d\\udf96\\udf97\\udf99-\\udf9b\\udf9e\\udf9f\\udfcd\\udfce\\udfd4-\\udfdf\\udff3\\udff5\\udff7]|\\ud83d[\\udc3f\\udc41\\udcfd\\udd49\\udd4a\\udd6f\\udd70\\udd73\\udd76-\\udd79\\udd87\\udd8a-\\udd8d\\udda5\\udda8\\uddb1\\uddb2\\uddbc\\uddc2-\\uddc4\\uddd1-\\uddd3\\udddc-\\uddde\\udde1\\udde3\\udde8\\uddef\\uddf3\\uddfa\\udecb\\udecd-\\udecf\\udee0-\\udee5\\udee9\\udef0\\udef3]|[\\u203c\\u2049\\u2139\\u2194-\\u2199\\u21a9\\u21aa\\u231a\\u231b\\u2328\\u23cf\\u23ed-\\u23ef\\u23f1\\u23f2\\u23f8-\\u23fa\\u24c2\\u25aa\\u25ab\\u25b6\\u25c0\\u25fb-\\u25fe\\u2600-\\u2604\\u260e\\u2611\\u2614\\u2615\\u2618\\u2620\\u2622\\u2623\\u2626\\u262a\\u262e\\u262f\\u2638-\\u263a\\u2640\\u2642\\u2648-\\u2653\\u2660\\u2663\\u2665\\u2666\\u2668\\u267b\\u267f\\u2692-\\u2697\\u2699\\u269b\\u269c\\u26a0\\u26a1\\u26a7\\u26aa\\u26ab\\u26b0\\u26b1\\u26bd\\u26be\\u26c4\\u26c5\\u26c8\\u26cf\\u26d1\\u26d3\\u26d4\\u26e9\\u26ea\\u26f0-\\u26f5\\u26f8\\u26fa\\u26fd\\u2702\\u2708\\u2709\\u270f\\u2712\\u2714\\u2716\\u271d\\u2721\\u2733\\u2734\\u2744\\u2747\\u2757\\u2763\\u2764\\u27a1\\u2934\\u2935\\u2b05-\\u2b07\\u2b1b\\u2b1c\\u2b50\\u2b55\\u3030\\u303d\\u3297\\u3299])(?:\\ufe0f|(?!\\ufe0e))|(?:(?:\\ud83c[\\udfcb\\udfcc]|\\ud83d[\\udd74\\udd75\\udd90]|[\\u261d\\u26f7\\u26f9\\u270c\\u270d])(?:\\ufe0f|(?!\\ufe0e))|(?:\\ud83c[\\udf85\\udfc2-\\udfc4\\udfc7\\udfca]|\\ud83d[\\udc42\\udc43\\udc46-\\udc50\\udc66-\\udc69\\udc6e\\udc70-\\udc78\\udc7c\\udc81-\\udc83\\udc85-\\udc87\\udcaa\\udd7a\\udd95\\udd96\\ude45-\\ude47\\ude4b-\\ude4f\\udea3\\udeb4-\\udeb6\\udec0\\udecc]|\\ud83e[\\udd0c\\udd0f\\udd18-\\udd1c\\udd1e\\udd1f\\udd26\\udd30-\\udd39\\udd3d\\udd3e\\udd77\\uddb5\\uddb6\\uddb8\\uddb9\\uddbb\\uddcd-\\uddcf\\uddd1-\\udddd\\udec3-\\udec5\\udef0-\\udef6]|[\\u270a\\u270b]))(?:\\ud83c[\\udffb-\\udfff])?|(?:\\ud83c\\udff4\\udb40\\udc67\\udb40\\udc62\\udb40\\udc65\\udb40\\udc6e\\udb40\\udc67\\udb40\\udc7f|\\ud83c\\udff4\\udb40\\udc67\\udb40\\udc62\\udb40\\udc73\\udb40\\udc63\\udb40\\udc74\\udb40\\udc7f|\\ud83c\\udff4\\udb40\\udc67\\udb40\\udc62\\udb40\\udc77\\udb40\\udc6c\\udb40\\udc73\\udb40\\udc7f|\\ud83c\\udde6\\ud83c[\\udde8-\\uddec\\uddee\\uddf1\\uddf2\\uddf4\\uddf6-\\uddfa\\uddfc\\uddfd\\uddff]|\\ud83c\\udde7\\ud83c[\\udde6\\udde7\\udde9-\\uddef\\uddf1-\\uddf4\\uddf6-\\uddf9\\uddfb\\uddfc\\uddfe\\uddff]|\\ud83c\\udde8\\ud83c[\\udde6\\udde8\\udde9\\uddeb-\\uddee\\uddf0-\\uddf5\\uddf7\\uddfa-\\uddff]|\\ud83c\\udde9\\ud83c[\\uddea\\uddec\\uddef\\uddf0\\uddf2\\uddf4\\uddff]|\\ud83c\\uddea\\ud83c[\\udde6\\udde8\\uddea\\uddec\\udded\\uddf7-\\uddfa]|\\ud83c\\uddeb\\ud83c[\\uddee-\\uddf0\\uddf2\\uddf4\\uddf7]|\\ud83c\\uddec\\ud83c[\\udde6\\udde7\\udde9-\\uddee\\uddf1-\\uddf3\\uddf5-\\uddfa\\uddfc\\uddfe]|\\ud83c\\udded\\ud83c[\\uddf0\\uddf2\\uddf3\\uddf7\\uddf9\\uddfa]|\\ud83c\\uddee\\ud83c[\\udde8-\\uddea\\uddf1-\\uddf4\\uddf6-\\uddf9]|\\ud83c\\uddef\\ud83c[\\uddea\\uddf2\\uddf4\\uddf5]|\\ud83c\\uddf0\\ud83c[\\uddea\\uddec-\\uddee\\uddf2\\uddf3\\uddf5\\uddf7\\uddfc\\uddfe\\uddff]|\\ud83c\\uddf1\\ud83c[\\udde6-\\udde8\\uddee\\uddf0\\uddf7-\\uddfb\\uddfe]|\\ud83c\\uddf2\\ud83c[\\udde6\\udde8-\\udded\\uddf0-\\uddff]|\\ud83c\\uddf3\\ud83c[\\udde6\\udde8\\uddea-\\uddec\\uddee\\uddf1\\uddf4\\uddf5\\uddf7\\uddfa\\uddff]|\\ud83c\\uddf4\\ud83c\\uddf2|\\ud83c\\uddf5\\ud83c[\\udde6\\uddea-\\udded\\uddf0-\\uddf3\\uddf7-\\uddf9\\uddfc\\uddfe]|\\ud83c\\uddf6\\ud83c\\udde6|\\ud83c\\uddf7\\ud83c[\\uddea\\uddf4\\uddf8\\uddfa\\uddfc]|\\ud83c\\uddf8\\ud83c[\\udde6-\\uddea\\uddec-\\uddf4\\uddf7-\\uddf9\\uddfb\\uddfd-\\uddff]|\\ud83c\\uddf9\\ud83c[\\udde6\\udde8\\udde9\\uddeb-\\udded\\uddef-\\uddf4\\uddf7\\uddf9\\uddfb\\uddfc\\uddff]|\\ud83c\\uddfa\\ud83c[\\udde6\\uddec\\uddf2\\uddf3\\uddf8\\uddfe\\uddff]|\\ud83c\\uddfb\\ud83c[\\udde6\\udde8\\uddea\\uddec\\uddee\\uddf3\\uddfa]|\\ud83c\\uddfc\\ud83c[\\uddeb\\uddf8]|\\ud83c\\uddfd\\ud83c\\uddf0|\\ud83c\\uddfe\\ud83c[\\uddea\\uddf9]|\\ud83c\\uddff\\ud83c[\\udde6\\uddf2\\uddfc]|\\ud83c[\\udccf\\udd8e\\udd91-\\udd9a\\udde6-\\uddff\\ude01\\ude32-\\ude36\\ude38-\\ude3a\\ude50\\ude51\\udf00-\\udf20\\udf2d-\\udf35\\udf37-\\udf7c\\udf7e-\\udf84\\udf86-\\udf93\\udfa0-\\udfc1\\udfc5\\udfc6\\udfc8\\udfc9\\udfcf-\\udfd3\\udfe0-\\udff0\\udff4\\udff8-\\udfff]|\\ud83d[\\udc00-\\udc3e\\udc40\\udc44\\udc45\\udc51-\\udc65\\udc6a\\udc6f\\udc79-\\udc7b\\udc7d-\\udc80\\udc84\\udc88-\\udc8e\\udc90\\udc92-\\udca9\\udcab-\\udcfc\\udcff-\\udd3d\\udd4b-\\udd4e\\udd50-\\udd67\\udda4\\uddfb-\\ude44\\ude48-\\ude4a\\ude80-\\udea2\\udea4-\\udeb3\\udeb7-\\udebf\\udec1-\\udec5\\uded0-\\uded2\\uded5-\\uded7\\udedd-\\udedf\\udeeb\\udeec\\udef4-\\udefc\\udfe0-\\udfeb\\udff0]|\\ud83e[\\udd0d\\udd0e\\udd10-\\udd17\\udd20-\\udd25\\udd27-\\udd2f\\udd3a\\udd3c\\udd3f-\\udd45\\udd47-\\udd76\\udd78-\\uddb4\\uddb7\\uddba\\uddbc-\\uddcc\\uddd0\\uddde-\\uddff\\ude70-\\ude74\\ude78-\\ude7c\\ude80-\\ude86\\ude90-\\udeac\\udeb0-\\udeba\\udec0-\\udec2\\uded0-\\uded9\\udee0-\\udee7]|[\\u23e9-\\u23ec\\u23f0\\u23f3\\u267e\\u26ce\\u2705\\u2728\\u274c\\u274e\\u2753-\\u2755\\u2795-\\u2797\\u27b0\\u27bf\\ue50a])|\\ufe0f/g\n\nfunction toCodePoint(unicodeSurrogates, sep) {\n var\n\t\tr = [],\n\t\tc = 0,\n\t\tp = 0,\n\t\ti = 0\n\t\t\n\twhile (i < unicodeSurrogates.length) {\n\t\tc = unicodeSurrogates.charCodeAt(i++)\n\t\tif (p) {\n\t\t\tr.push((0x10000 + ((p - 0xD800) << 10) + (c - 0xDC00)).toString(16))\n\t\t\tp = 0\n\t\t} else if (0xD800 <= c && c <= 0xDBFF) {\n\t\t\tp = c\n\t\t} else {\n\t\t\tr.push(c.toString(16))\n\t\t}\n\t}\n\treturn r.join(sep || '-')\n}\n\n// avoid runtime RegExp creation for not so smart,\n// not JIT based, and old browsers / engines\nvar UFE0Fg = /\\uFE0F/g\n\n// avoid using a string literal like '\\u200D' here because minifiers expand it inline\nvar U200D = String.fromCharCode(0x200D)\n\n/**\n* Used to both remove the possible variant\n* and to convert utf16 into code points.\n* If there is a zero-width-joiner (U+200D), leave the variants in.\n* @param string the raw text of the emoji match\n*/\nfunction grabTheRightIcon(rawText) {\n\t// if variant is present as \\uFE0F\n\treturn toCodePoint(rawText.indexOf(U200D) < 0 ?\n\t\trawText.replace(UFE0Fg, '') :\n\t\trawText\n\t);\n}\n\nmodule.exports = function replaceEmoji (string, render) {\n\t// Note: the latest regex added an empty matching group, so we ignore it.\n\treturn replaceStringToArray(string, re, function emojiReplacer (match, _, offset) {\n\t\tvar icon = grabTheRightIcon(match)\n\t\treturn render(icon, match, offset)\n\t})\n}\n","var createElement = require('react').createElement\n\nvar pageProtocol = (typeof location === 'undefined') ? '' : ((location.protocol === 'https:') ? 'https:' : 'http:')\n\nvar emojiStyle = {\n\theight: '1em',\n\twidth: '1em',\n\tmargin: '0 .05em 0 .1em',\n\tverticalAlign: '-0.1em'\n}\n\n// Accept protocol with or without a colon\nfunction normalizeProtocol(protocol) {\n\tif (protocol && protocol.length > 0 && protocol.charAt(protocol.length - 1) !== ':') {\n\t\treturn protocol + ':'\n\t}\n\treturn protocol\n}\n\nmodule.exports = function makeTwemojiRenderer(options) {\n\toptions = merge({\n\t\tprotocol: pageProtocol,\n\t\tbaseUrl: '//cdnjs.cloudflare.com/ajax/libs/twemoji/14.0.2/',\n\t\tsize: '72x72',\n\t\text: '.png',\n\t\tprops: null\n\t}, options)\n\n\treturn function renderTwemoji (icon, match, offset) {\n\t\tvar src = ''\n\t\tif (options.baseUrl.indexOf('http') !== 0) {\n\t\t\tsrc += normalizeProtocol(options.protocol)\n\t\t}\n\n\t\tsrc += options.baseUrl + options.size + '/' + icon + options.ext\n\n\t\treturn createElement(\n\t\t\t'img',\n\t\t\tmerge({\n\t\t\t\tkey: offset,\n\t\t\t\talt: match,\n\t\t\t\tdraggable: false,\n\t\t\t\tsrc: src,\n\t\t\t\tstyle: emojiStyle\n\t\t\t}, options.props)\n\t\t)\n\t}\n}\n\nfunction merge() {\n\tvar out = {}, len = arguments.length\n\tfor(var i = 0; i < len; ++i) {\n\t\tvar source = arguments[i]\n\t\tif (source) {\n\t\t\tfor (var key in source) {\n\t\t\t\tif (Object.prototype.hasOwnProperty.call(source, key)) {\n\t\t\t\t\tout[key] = source[key]\n\t\t\t\t}\n\t\t\t}\n\t\t}\n }\n return out\n}","var replaceEmoji = require('./lib/replaceEmoji'),\n\tmakeTwemojiRenderer = require('./lib/makeTwemojiRenderer')\n\nmodule.exports = function reactEasyEmoji (element, optionsOrFn) {\n\tvar render = (typeof optionsOrFn === 'function') ? optionsOrFn : makeTwemojiRenderer(optionsOrFn)\n\treturn replaceEmoji(element, render)\n}","// @ts-check\n\nimport { useCallback, useRef } from \"react\";\nimport { renderToString } from 'react-dom/server'\nimport emoji from 'react-easy-emoji'\nimport { removeHtmlExceptBr } from \"../utils/input-event-utils\";\n\nconst EMOJI_REGEX = new RegExp(\n /(?:[\\u2700-\\u27bf]|(?:\\ud83c[\\udde6-\\uddff]){2}|[\\ud800-\\udbff][\\udc00-\\udfff])[\\ufe0e\\ufe0f]?(?:[\\u0300-\\u036f\\ufe20-\\ufe23\\u20d0-\\u20f0]|\\ud83c[\\udffb-\\udfff])?(?:\\u200d(?:[^\\ud800-\\udfff]|(?:\\ud83c[\\udde6-\\uddff]){2}|[\\ud800-\\udbff][\\udc00-\\udfff])[\\ufe0e\\ufe0f]?(?:[\\u0300-\\u036f\\ufe20-\\ufe23\\u20d0-\\u20f0]|\\ud83c[\\udffb-\\udfff])?)*/g\n)\n\n/**\n * @typedef {import('../types/types').SanitizeFn} SanitizeFn\n */\n\n// eslint-disable-next-line valid-jsdoc\n/**\n * @param {boolean} shouldReturn\n * @param {boolean} shouldConvertEmojiToImage\n */\nexport function useSanitize(shouldReturn, shouldConvertEmojiToImage) {\n /** @type {React.MutableRefObject<SanitizeFn[]>} */\n const sanitizeFnsRef = useRef([]);\n\n const sanitizedTextRef = useRef(\"\");\n\n /** @type {(fn: SanitizeFn) => void} */\n const addSanitizeFn = useCallback(fn => {\n sanitizeFnsRef.current.push(fn);\n }, []);\n\n /** @type {(html: string) => string} */\n const sanitize = useCallback(html => {\n let result = sanitizeFnsRef.current.reduce((acc, fn) => {\n return fn(acc);\n }, html);\n\n result = replaceAllHtmlToString(result, shouldReturn);\n\n if (shouldConvertEmojiToImage) {\n result = convertEmojiToImage(result);\n }\n\n sanitizedTextRef.current = result;\n\n return result;\n }, [shouldReturn, shouldConvertEmojiToImage]);\n\n return { addSanitizeFn, sanitize, sanitizedTextRef };\n}\n\n/**\n *\n * @param {string} html\n * @param {boolean} shouldReturn\n * @return {string}\n */\nexport function replaceAllHtmlToString(html, shouldReturn) {\n const container = document.createElement(\"div\");\n container.innerHTML = html;\n let text\n if(shouldReturn) {\n text = removeHtmlExceptBr(container)\n } else {\n text = container.innerText || \"\";\n }\n\n // remove all ↵ for safari\n text = text.replace(/\\n/gi, \"\");\n\n return text;\n}\n\n/**\n * \n * @param {string} text \n * @return {string}\n */\nfunction convertEmojiToImage(text) {\n text = handleEmoji(text)\n text = renderToString(emoji(text))\n text = text.replace(\n new RegExp('<span class="message-emoji">', 'g'),\n '<span class=\"message-emoji\">'\n )\n text = text.replace(new RegExp('</span>', 'g'), '</span>')\n \n return text \n}\n\n/**\n * \n * @param {string} text \n * @return {string}\n */\nfunction handleEmoji (text) {\n return text.replace(EMOJI_REGEX, '<span class=\"message-emoji\">$&</span>')\n}\n","// @ts-check\n\nimport { useImperativeHandle } from \"react\";\nimport { useSanitize } from \"./use-sanitize\";\n\n/**\n * @typedef {Object} Props\n * @property {React.Ref<any>} ref\n * @property {React.MutableRefObject<import('../text-input').Ref | null>} textInputRef\n * @property {(value: string) => void} setValue\n * @property {() => void} emitChange\n * @property {boolean=} shouldConvertEmojiToImage\n */\n\n/**\n *\n * @param {Props} props\n */\nexport function useExpose({ ref, textInputRef, setValue, emitChange, shouldConvertEmojiToImage }) {\n const { sanitize, sanitizedTextRef } = useSanitize(false, shouldConvertEmojiToImage);\n\n useImperativeHandle(ref, () => ({\n get value() {\n return sanitizedTextRef.current;\n },\n set value(value) {\n setValue(value);\n },\n focus: () => {\n if (textInputRef.current === null) return\n textInputRef.current.focus();\n },\n blur: () => {\n if (textInputRef.current !== null) {\n sanitize(textInputRef.current.html);\n\n }\n\n emitChange();\n }\n }));\n}\n","// @ts-check\n\nimport { useCallback, useEffect, useRef } from \"react\";\n\n// eslint-disable-next-line valid-jsdoc\n/**\n * useEmit\n * @param {React.MutableRefObject<import('../text-input').Ref | null>} textInputRef\n * @param {(size: {width: number, height: number}) => void} onResize\n * @param {(text: string) => void} onChange\n */\nexport function useEmit(textInputRef, onResize, onChange) {\n /** @type {React.MutableRefObject<{width: number; height: number} | null>} */\n const currentSizeRef = useRef(null);\n const onChangeFn = useRef(onChange);\n\n const checkAndEmitResize = useCallback(() => {\n if (textInputRef.current !== null) {\n const currentSize = currentSizeRef.current;\n\n const nextSize = textInputRef.current.size;\n\n if (\n (!currentSize ||\n currentSize.width !== nextSize.width ||\n currentSize.height !== nextSize.height) &&\n typeof onResize === \"function\"\n ) {\n onResize(nextSize);\n }\n\n currentSizeRef.current = nextSize;\n }\n }, [onResize, textInputRef]);\n\n const emitChange = useCallback((sanitizedText) => {\n if (typeof onChangeFn.current === \"function\") {\n onChangeFn.current(sanitizedText);\n }\n\n if (typeof onResize === \"function\") {\n checkAndEmitResize();\n }\n }, [checkAndEmitResize, onResize]);\n\n useEffect(() => {\n if (textInputRef.current) {\n checkAndEmitResize();\n }\n }, [checkAndEmitResize, textInputRef]);\n\n return emitChange;\n}\n","// @ts-check\n// vendors\nimport React, { useImperativeHandle, forwardRef, useRef, useMemo } from \"react\";\nimport { addLineBreak, handlePasteHtmlAtCaret } from \"./utils/input-event-utils\";\nimport { replaceAllTextEmojiToString } from \"./utils/emoji-utils\";\n\n/**\n * @typedef {Object} Props\n * @property {(event: React.KeyboardEvent) => void} onKeyDown\n * @property {(event: React.KeyboardEvent) => void} onKeyUp\n * @property {() => void} onFocus\n * @property {() => void} onBlur\n * @property {(sanitizedText: string) => void=} onChange\n * @property {(event: React.KeyboardEvent) => void} onArrowUp\n * @property {(event: React.KeyboardEvent) => void} onArrowDown\n * @property {(event: React.KeyboardEvent) => void} onEnter\n * @property {boolean} shouldReturn\n * @property {(event: React.ClipboardEvent) => void} onCopy\n * @property {(event: React.ClipboardEvent) => void} onPaste\n * @property {string} placeholder\n * @property {{borderRadius?: number; color?: string; borderColor?: string; fontSize?: number; fontFamily?: string; background: string; placeholderColor?: string;}} style\n * @property {number} tabIndex\n * @property {string} className\n * @property {(html: string) => void} onChange\n */\n\n/**\n * @typedef {{\n * appendContent: (html: string) => void;\n * html: string;\n * text: string;\n * size: { width: number; height: number;};\n * focus: () => void;\n * }} Ref\n */\n\n// eslint-disable-next-line valid-jsdoc\n/** @type {React.ForwardRefRenderFunction<Ref, Props>} */\nconst TextInput = (\n { placeholder, style, tabIndex, className, onChange, ...props },\n ref\n) => {\n useImperativeHandle(ref, () => ({\n appendContent: html => {\n if (textInputRef.current) {\n textInputRef.current.focus();\n }\n\n handlePasteHtmlAtCaret(html);\n\n if (textInputRef.current) {\n textInputRef.current.focus();\n }\n\n if (textInputRef.current && placeholderRef.current && replaceAllTextEmojiToString(textInputRef.current.innerHTML) === \"\") {\n placeholderRef.current.style.visibility = \"visible\";\n } else if (placeholderRef.current) {\n placeholderRef.current.style.visibility = \"hidden\";\n }\n\n if (textInputRef.current && typeof onChange === 'function') {\n onChange(textInputRef.current.innerHTML);\n }\n },\n set html(value) {\n if (textInputRef.current) {\n textInputRef.current.innerHTML = value;\n }\n \n if (placeholderRef.current) {\n const text = replaceAllTextEmojiToString(value)\n if (text === \"\") {\n placeholderRef.current.style.visibility = \"visible\";\n } else {\n placeholderRef.current.style.visibility = \"hidden\";\n }\n }\n\n if (typeof onChange === 'function' && textInputRef.current) {\n onChange(textInputRef.current.innerHTML);\n }\n },\n get html() {\n if (!textInputRef.current) return ''\n\n return textInputRef.current.innerHTML;\n },\n get text() {\n if (!textInputRef.current) return ''\n\n return textInputRef.current.innerText;\n },\n get size() {\n if (!textInputRef.current) {\n return {\n width: 0,\n height: 0\n }\n }\n\n return {\n width: textInputRef.current.offsetWidth,\n height: textInputRef.current.offsetHeight\n };\n },\n focus() {\n if (!textInputRef.current) return\n\n textInputRef.current.focus();\n }\n }));\n\n /** @type {React.CSSProperties} */\n const placeholderStyle = useMemo(() => {\n const placeholderStyle = {}\n\n if (style.placeholderColor) {\n placeholderStyle.color = style.placeholderColor\n }\n\n return placeholderStyle\n }, [style?.placeholderColor])\n\n /** @type {React.CSSProperties} */\n const inputStyle = useMemo(() => {\n const inputStyle = {}\n\n if (style.color) {\n inputStyle.color = style.color\n }\n\n return inputStyle\n }, [style?.color])\n\n /** @type {React.MutableRefObject<HTMLDivElement | null>} */\n const placeholderRef = useRef(null);\n /** @type {React.MutableRefObject<HTMLDivElement | null>} */\n const textInputRef = useRef(null);\n\n /**\n *\n * @param {React.KeyboardEvent} event\n */\n function handleKeyDown(event) { \n if (event.key === \"Enter\" && (event.shiftKey === true || event.ctrlKey === true) && props.shouldReturn) {\n event.preventDefault();\n if(textInputRef.current) {\n addLineBreak()\n return;\n }\n } \n if (event.key === \"Enter\") {\n props.onEnter(event);\n } else if (event.key === \"ArrowUp\") {\n props.onArrowUp(event);\n } else if (event.key === \"ArrowDown\") {\n props.onArrowDown(event);\n } else {\n if (event.key.length === 1 && placeholderRef.current) {\n placeholderRef.current.style.visibility = \"hidden\";\n }\n }\n\n props.onKeyDown(event);\n }\n\n /** */\n function handleClick() {\n props.onFocus();\n }\n\n /**\n *\n * @param {React.KeyboardEvent} event\n */\n function handleKeyUp(event) {\n props.onKeyUp(event);\n\n const input = textInputRef.current;\n\n if (placeholderRef.current && input) {\n const text = replaceAllTextEmojiToString(input.innerHTML)\n if (text === \"\") {\n placeholderRef.current.style.visibility = \"visible\";\n } else {\n placeholderRef.current.style.visibility = \"hidden\";\n }\n }\n\n if (typeof onChange === 'function' && textInputRef.current) {\n onChange(textInputRef.current.innerHTML);\n }\n }\n\n return (\n <div className=\"react-input-emoji--container\" style={style}>\n <div className=\"react-input-emoji--wrapper\" onClick={handleClick}>\n <div ref={placeholderRef} className=\"react-input-emoji--placeholder\" style={placeholderStyle}>\n {placeholder}\n </div>\n <div\n ref={textInputRef}\n onKeyDown={handleKeyDown}\n onKeyUp={handleKeyUp}\n tabIndex={tabIndex}\n contentEditable\n className={`react-input-emoji--input${className ? ` ${className}` : \"\"\n }`}\n onBlur={props.onBlur}\n onCopy={props.onCopy}\n onPaste={props.onPaste}\n data-testid=\"react-input-emoji--input\"\n style={inputStyle}\n />\n </div>\n </div>\n );\n};\n\nconst TextInputWithRef = forwardRef(TextInput);\n\nexport default TextInputWithRef;\n","// vendors\nimport React, { useEffect, useRef, useState } from \"react\";\n\n/**\n * @typedef {object} Props\n * @property {boolean} showPicker\n * @property {(event: React.MouseEvent) => void} toggleShowPicker\n * @property {HTMLDivElement=} buttonElement\n * @property {React.MutableRefObject=} buttonRef\n */\n\n/**\n * Emoji Picker Button Component\n * @param {Props} props\n * @return {JSX.Element}\n */\nfunction EmojiPickerButton({ showPicker, toggleShowPicker, buttonElement, buttonRef }) {\n \n const localButtonRef = useRef(null);\n const [showCustomButtonContent, setShowCustomButtonContent] = useState(false);\n\n useEffect(() => {\n if ((buttonRef?.current?.childNodes?.length ?? 0) > 2) {\n localButtonRef.current.appendChild(buttonRef.current.childNodes[0]);\n setShowCustomButtonContent(true);\n } else if ((buttonElement?.childNodes?.length ?? 0) > 2) {\n localButtonRef.current.appendChild(buttonElement?.childNodes[0]);\n setShowCustomButtonContent(true);\n }\n }, [buttonElement?.childNodes]);\n\n return (\n <button\n ref={localButtonRef}\n type=\"button\"\n className={`react-input-emoji--button${\n showPicker ? \" react-input-emoji--button__show\" : \"\"\n }`}\n onClick={toggleShowPicker}\n >\n {!showCustomButtonContent && (\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n viewBox=\"0 0 24 24\"\n width=\"24\"\n height=\"24\"\n className=\"react-input-emoji--button--icon\"\n >\n {/* eslint-disable-next-line max-len */}\n <path d=\"M12 0C5.373 0 0 5.373 0 12s5.373 12 12 12 12-5.373 12-12S18.627 0 12 0m0 22C6.486 22 2 17.514 2 12S6.486 2 12 2s10 4.486 10 10-4.486 10-10 10\" />\n {/* eslint-disable-next-line max-len */}\n <path d=\"M8 7a2 2 0 1 0-.001 3.999A2 2 0 0 0 8 7M16 7a2 2 0 1 0-.001 3.999A2 2 0 0 0 16 7M15.232 15c-.693 1.195-1.87 2-3.349 2-1.477 0-2.655-.805-3.347-2H15m3-2H6a6 6 0 1 0 12 0\" />\n </svg>\n )}\n </button>\n );\n}\n\nexport default EmojiPickerButton;\n","import $dvPge$react, {useRef as $dvPge$useRef, useEffect as $dvPge$useEffect} from \"react\";\nimport {Picker as $dvPge$Picker} from \"emoji-mart\";\n\n\n\nfunction $e5534fc185f7111e$export$2e2bcd8739ae039(props) {\n const ref = (0, $dvPge$useRef)(null);\n const instance = (0, $dvPge$useRef)(null);\n if (instance.current) instance.current.update(props);\n (0, $dvPge$useEffect)(()=>{\n instance.current = new (0, $dvPge$Picker)({\n ...props,\n ref: ref\n });\n return ()=>{\n instance.current = null;\n };\n }, []);\n return /*#__PURE__*/ (0, $dvPge$react).createElement(\"div\", {\n ref: ref\n });\n}\n\n\nexport {$e5534fc185f7111e$export$2e2bcd8739ae039 as default};\n//# sourceMappingURL=module.js.map\n","// vendors\nimport React, { memo, useEffect, useMemo, useState } from \"react\";\nimport Picker from \"@emoji-mart/react\";\n\nconst EMOJI_MART_DATA_URL = \"https://cdn.jsdelivr.net/npm/@emoji-mart/data\";\nconst cacheI18n = {};\n\n/**\n * @typedef {object} Props\n * @property {'light' | 'dark' | 'auto'} theme\n * @property {function(import(\"../types/types\").EmojiMartItem): void} onSelectEmoji\n * @property {boolean} disableRecent\n * @property {any[]=} customEmojis\n * @property {import('../types/types').Languages=} language\n */\n\n/**\n * Emoji Picker Component\n * @param {Props} props\n */\nfunction EmojiPicker(props) {\n const { theme, onSelectEmoji, disableRecent, customEmojis, language } = props;\n\n /** @type {string[]} */\n const categories = useMemo(() => {\n /** @type {string[]} */\n let categoryies = [];\n\n if (!disableRecent) {\n categoryies.push(\"frequent\");\n }\n\n categoryies = [\n ...categoryies,\n \"people\",\n \"nature\",\n \"foods\",\n \"activity\",\n \"places\",\n \"objects\",\n \"symbols\",\n \"flags\"\n ];\n\n return categoryies;\n }, [disableRecent]);\n\n const [i18n, setI18n] = useState(undefined);\n\n useEffect(() => {\n if (!language) {\n if (cacheI18n.en) {\n setI18n(cacheI18n.en);\n return;\n }\n\n // @ts-ignore\n fetch(`${EMOJI_MART_DATA_URL}/i18n/en.json`)\n .then(async data => {\n const translations = await data.json();\n setI18n(translations);\n cacheI18n.en = translations;\n })\n .catch(error => {\n console.error(\"Failed to load translations:\", error);\n });\n return;\n }\n\n if (cacheI18n[language]) {\n setI18n(cacheI18n[language]);\n return;\n }\n\n // @ts-ignore\n fetch(`${EMOJI_MART_DATA_URL}/i18n/${language}.json`)\n .then(async data => {\n const translations = await data.json();\n setI18n(translations);\n cacheI18n[language] = translations;\n })\n .catch(error => {\n console.error(\"Failed to load translations:\", error);\n });\n }, [language]);\n\n if (!i18n) {\n return null;\n }\n\n return (\n <Picker\n data={undefined}\n theme={theme}\n previewPosition=\"none\"\n onEmojiSelect={onSelectEmoji}\n custom={customEmojis}\n categories={categories}\n set=\"apple\"\n i18n={i18n}\n />\n );\n}\n\n\nexport default memo(EmojiPicker);\n","import React from \"react\";\nimport EmojiPicker from \"./emoji-picker\";\n\n/**\n * @typedef {object} Props\n * @property {boolean} showPicker\n * @property {'light' | 'dark' | 'auto'} theme\n * @property {(emoji: import(\"../types/types\").EmojiMartItem) => void} handleSelectEmoji\n * @property {boolean} disableRecent\n * @property {any[]=} customEmojis\n * @property {('above' | 'below')=} position\n * @property {import('../types/types').Languages=} language\n */\n\n/**\n * Emoji Picker Button Component\n * @param {Props} props\n * @return {JSX.Element}\n */\nfunction EmojiPickerContainer({\n showPicker,\n theme,\n handleSelectEmoji,\n disableRecent,\n customEmojis,\n position,\n language\n}) {\n return (\n <div className=\"react-emoji-picker--container\">\n {showPicker && (\n <div\n className=\"react-emoji-picker--wrapper\"\n onClick={evt => evt.stopPropagation()}\n style={position === 'below' ? {top: '40px'} : {}}\n >\n <div className=\"react-emoji-picker\">\n <EmojiPicker\n theme={theme}\n onSelectEmoji={handleSelectEmoji}\n disableRecent={disableRecent}\n customEmojis={customEmojis}\n language={language}\n />\n </div>\n </div>\n )}\n </div>\n );\n}\n\nexport default EmojiPickerContainer;\n","// @ts-check\n// vendors\nimport React, { useEffect, useState } from \"react\";\nimport ReactDOM from \"react-dom\";\nimport {\n getImageEmoji,\n replaceAllTextEmojis,\n replaceAllTextEmojiToString\n} from \"../utils/emoji-utils\";\n\nimport EmojiPickerButton from \"./emoji-picker-button\";\nimport EmojiPickerContainer from \"./emoji-picker-container\";\nimport { cacheCurrentRange } from \"../utils/input-event-utils\";\n\nconst EMOJI_PICKER_CONTAINER_HEIGHT = 435;\n\n/**\n * @typedef {import('../types/types').SanitizeFn} SanitizeFn\n */\n\n/**\n * @typedef {import('../types/types').PolluteFn} PolluteFn\n */\n\n/**\n * @typedef {Object} Props\n * @property {'light' | 'dark' | 'auto'} theme\n * @property {boolean} keepOpened\n * @property {boolean} disableRecent\n * @property {any[]=} customEmojis\n * @property {(fn: SanitizeFn) => void} addSanitizeFn\n * @property {(fn: PolluteFn) => void} addPolluteFn\n * @property {(html: string) => void} appendContent\n * @property {HTMLDivElement=} buttonElement\n * @property {React.MutableRefObject=} buttonRef\n * @property {import('../types/types').Languages=} language\n */\n\n// eslint-disable-next-line valid-jsdoc\n/** @type {React.FC<Props>} */\nconst EmojiPickerWrapper = props => {\n const {\n theme,\n keepOpened,\n disableRecent,\n customEmojis,\n addSanitizeFn,\n addPolluteFn,\n appendContent,\n buttonElement,\n buttonRef,\n language\n } = props;\n\n const [showPicker, setShowPicker] = useState(false);\n /** @type {[HTMLDivElement | undefined, React.Dispatch<React.SetStateAction<HTMLDivElement | undefined>>]} */\n const [customButton, setCustomButton] = useState();\n /** @type {['above' | 'below' | undefined, React.Dispatch<React.SetStateAction<'above' | 'below' | undefined>>]} */\n const [emojiPickerPosition, setEmojiPickerPosition] = useState()\n\n useEffect(() => {\n if (showPicker) {\n cacheCurrentRange()\n }\n }, [showPicker])\n\n useEffect(() => {\n addSanitizeFn(replaceAllTextEmojiToString);\n }, [addSanitizeFn]);\n\n useEffect(() => {\n addPolluteFn(replaceAllTextEmojis);\n }, [addPolluteFn]);\n\n useEffect(() => {\n /**\n *\n * @param {MouseEvent} event\n */\n function checkClickOutside(event) {\n /** @type {HTMLElement} */\n // @ts-ignore\n const element = event.target;\n\n if (\n element.classList.contains(\"react-input-emoji--button\") ||\n element.classList.contains(\"react-input-emoji--button--icon\")\n ) {\n return;\n }\n\n setShowPicker(false);\n }\n\n document.addEventListener(\"click\", checkClickOutside);\n\n return () => {\n document.removeEventListener(\"click\", checkClickOutside);\n };\n }, []);\n\n /**\n *\n * @param {React.MouseEvent} event\n */\n function toggleShowPicker(event) {\n event.stopPropagation();\n event.preventDefault();\n\n setEmojiPickerPosition(calcTopPosition(event))\n\n setShowPicker(currentShowPicker => !currentShowPicker);\n }\n\n /**\n * \n * @param {React.MouseEvent} event\n * @return {'above' | 'below'}\n */\n function calcTopPosition(event) {\n const btn = event.currentTarget\n const btnRect = btn.getBoundingClientRect();\n\n const popoverHeight = EMOJI_PICKER_CONTAINER_HEIGHT;\n\n // Decide to display above or below based on available space\n if (btnRect.top >= popoverHeight) {\n // Display above\n return 'above'\n } else {\n // Display below\n return 'below'\n }\n }\n\n // eslint-disable-next-line valid-jsdoc\n /**\n *\n * @param {import(\"../types/types\").EmojiMartItem} emoji\n */\n function handleSelectEmoji(emoji) {\n appendContent(getImageEmoji(emoji));\n\n if (!keepOpened) {\n setShowPicker(currentShowPicker => !currentShowPicker);\n }\n }\n\n useEffect(() => {\n if (buttonRef?.current?.style) {\n buttonRef.current.style.position = \"relative\";\n setCustomButton(buttonRef.current);\n } else if (buttonElement?.style) {\n buttonElement.style.position = \"relative\";\n setCustomButton(buttonElement);\n }\n }, [buttonRef, buttonElement]);\n\n return customButton ? (\n (ReactDOM.createPortal(\n <>\n <EmojiPickerContainer\n showPicker={showPicker}\n theme={theme}\n handleSelectEmoji={handleSelectEmoji}\n disableRecent={disableRecent}\n customEmojis={customEmojis}\n position={emojiPickerPosition}\n language={language}\n />\n <EmojiPickerButton\n showPicker={showPicker}\n toggleShowPicker={toggleShowPicker}\n buttonElement={customButton}\n buttonRef={buttonRef}\n />\n </>,\n customButton\n ))\n ) : (\n (<>\n <EmojiPickerContainer\n showPicker={showPicker}\n theme={theme}\n handleSelectEmoji={handleSelectEmoji}\n disableRecent={disableRecent}\n customEmojis={customEmojis}\n position={emojiPickerPosition}\n language={language}\n />\n <EmojiPickerButton\n showPicker={showPicker}\n toggleShowPicker={toggleShowPicker}\n />\n </>)\n );\n};\n\nexport default EmojiPickerWrapper;\n","// @ts-check\n\n/**\n *\n * @return {string | null}\n */\nexport function getTextFromAtToCaret() {\n const range = getRangeFromAtToCaret();\n\n if (!range) return null;\n\n const text = range.text.substring(range.begin, range.end);\n\n return text || null;\n}\n\n// eslint-disable-next-line valid-jsdoc\n/** */\nexport function deleteTextFromAtToCaret() {\n const range = getRangeFromAtToCaret();\n\n if (!range) return;\n\n // @ts-ignore\n range.element.deleteData(range.begin, range.end - range.begin);\n}\n\n/**\n *\n * @return {{begin: number, end: number, text: string, element: Node} | null}\n */\nfunction getRangeFromAtToCaret() {\n const elementWithFocus = getElementWithFocus();\n\n if (!elementWithFocus) {\n return null;\n }\n\n const { element, caretOffset } = elementWithFocus;\n const text = element.textContent;\n const lastAt = text.lastIndexOf(\"@\");\n\n if (\n lastAt === -1 ||\n lastAt >= caretOffset ||\n (lastAt !== 0 && text[lastAt - 1] !== \" \")\n ) {\n return null;\n }\n\n return { begin: lastAt, end: caretOffset, text, element };\n}\n\n/**\n *\n * @return {{element: Node, caretOffset: number}}\n */\nexport function getElementWithFocus() {\n const element = getSelectionStart();\n\n if (element === null) {\n return null;\n }\n\n let caretOffset = 0;\n if (typeof window.getSelection != \"undefined\") {\n const range = window.getSelection().getRangeAt(0);\n const preCaretRange = range.cloneRange();\n preCaretRange.selectNodeContents(element);\n preCaretRange.setEnd(range.endContainer, range.endOffset);\n caretOffset = preCaretRange.toString().length;\n } else if (\n // @ts-ignore\n typeof document.selection != \"undefined\" &&\n // @ts-ignore\n document.selection.type != \"Control\"\n ) {\n // @ts-ignore\n const textRange = document.selection.createRange();\n // @ts-ignore\n const preCaretTextRange = document.body.createTextRange();\n preCaretTextRange.moveToElementText(element);\n preCaretTextRange.setEndPoint(\"EndToEnd\", textRange);\n caretOffset = preCaretTextRange.text.length;\n }\n\n return { element, caretOffset };\n}\n\n/**\n *\n * @return {Node | null}\n */\nfunction getSelectionStart() {\n const node = document.getSelection().anchorNode;\n return node?.nodeType == 3 ? node : null;\n}\n","// @ts-check\nimport { useCallback, useState } from \"react\";\nimport {\n deleteTextFromAtToCaret,\n getElementWithFocus,\n getTextFromAtToCaret\n} from \"../utils/mention-utils\";\n\n/**\n * @typedef {import('../types/types').MentionUser} MentionUser\n */\n\n// eslint-disable-next-line valid-jsdoc\n/**\n *\n * @param {(text: string) => Promise<MentionUser[]>=} searchMention\n * @returns {{mentionSearchText: string | null, mentionUsers: MentionUser[], onKeyUp: (event: React.KeyboardEvent) => void, onFocus: () => void, onSelectUser: () => void, loading: boolean}}\n */\nexport function useMention(searchMention) {\n const [loading, setLoading] = useState(false);\n\n /** @type {[MentionUser[], React.Dispatch<React.SetStateAction<MentionUser[]>>]} */\n const [mentionUsers, setMentionUsers] = useState([]);\n\n /** @type {[string | null, React.Dispatch<React.SetStateAction<string | null>>]} */\n const [mentionSearchText, setMentionSearchText] = useState(null);\n\n const onSelectUser = useCallback(() => {\n deleteTextFromAtToCaret();\n setMentionUsers([]);\n }, []);\n\n /** */\n const checkMentionText = useCallback(async () => {\n const metionText = getTextFromAtToCaret();\n\n setMentionSearchText(metionText);\n\n if (metionText === null) {\n setMentionUsers([]);\n } else {\n setLoading(true);\n const users = await searchMention(metionText);\n setLoading(false);\n setMentionUsers(users);\n }\n }, [searchMention]);\n\n /** @type {(event: React.KeyboardEvent) => void} */\n const onKeyUp = useCallback(\n async event => {\n if (typeof searchMention !== \"function\") return;\n\n if (\n event.key === \"Backspace\" &&\n getElementWithFocus()?.element.parentElement.hasAttribute(\n \"data-mention-id\"\n )\n ) {\n const elementWithFocus = getElementWithFocus();\n elementWithFocus.element.parentElement.remove();\n } else if (\n ![\"ArrowUp\", \"ArrowDown\", \"Esc\", \"Escape\"].includes(event.key)\n ) {\n checkMentionText();\n }\n },\n [checkMentionText, searchMention]\n );\n\n const onFocus = useCallback(() => {\n checkMentionText();\n }, [checkMentionText]);\n\n return {\n mentionSearchText,\n mentionUsers,\n onKeyUp,\n onFocus,\n onSelectUser,\n loading\n };\n}\n","// @ts-check\n// vendors\nimport React, {\n useImperativeHandle,\n useState,\n forwardRef,\n useMemo,\n useEffect\n} from \"react\";\n\n/**\n * @typedef {import('../types/types').MentionUser} MentionUser\n */\n\n/**\n * @typedef {import('../types/types').TextInputListeners} TextInputListeners\n */\n\n/**\n * @typedef {Object} Props\n * @property {MentionUser[]} users\n * @property {string | null} mentionSearchText\n * @property {(user: MentionUser) => void} onSelect\n * @property {(event: keyof TextInputListeners, fn: import('../types/types').Listerner<any>) => () => void} addEventListener\n */\n\n/**\n * @typedef {{prevUser: () => void; nextUser: () => void;}} Ref\n */\n\n// eslint-disable-next-line valid-jsdoc\n/** @type {React.ForwardRefRenderFunction<Ref, Props>} */\nconst MentionUserList = (\n { users, mentionSearchText, onSelect, addEventListener },\n ref\n) => {\n const [selectedUser, setSelectedUser] = useState(0);\n\n useImperativeHandle(ref, () => ({\n prevUser: () => {\n setSelectedUser(currentSelectedUser => {\n if (currentSelectedUser === 0) {\n return 0;\n }\n\n return currentSelectedUser - 1;\n });\n },\n nextUser: () => {\n setSelectedUser(currentSelectedUser => {\n if (currentSelectedUser === users.length - 1) {\n return users.length - 1;\n }\n\n return currentSelectedUser + 1;\n });\n }\n }));\n\n useEffect(() => {\n setSelectedUser(0);\n }, [users]);\n\n /**\n *\n * @param {string} selectedText\n * @param {string} rest\n * @return {string}\n */\n function getMentionSelectedNameEl(selectedText, rest) {\n return `<span class=\"react-input-emoji--mention--item--name__selected\" data-testid=\"metion-selected-word\">${selectedText}</span>${rest}`;\n }\n\n /** @type {(MentionUser & {nameHtml: string})[]} */\n const usersFiltered = useMemo(() => {\n const searchText = mentionSearchText\n ? mentionSearchText.substring(1).toLocaleLowerCase()\n : \"\";\n return users.map(user => {\n let nameHtml = user.name;\n\n if (mentionSearchText && mentionSearchText.length > 1) {\n if (user.name.toLowerCase().startsWith(searchText)) {\n nameHtml = getMentionSelectedNameEl(\n user.name.substring(0, searchText.length),\n user.name.substring(searchText.length)\n );\n } else {\n const names = user.name.split(\" \");\n\n nameHtml = names\n .map(name => {\n if (name.toLocaleLowerCase().startsWith(searchText)) {\n return getMentionSelectedNameEl(\n name.substring(0, searchText.length),\n name.substring(searchText.length)\n );\n }\n return name;\n })\n .join(\" \");\n }\n }\n\n return {\n ...user,\n nameHtml\n };\n });\n }, [mentionSearchText, users]);\n\n // eslint-disable-next-line valid-jsdoc\n /**\n *\n * @param {MentionUser} user\n * @returns {(event: React.MouseEvent) => void} event\n */\n function handleClick(user) {\n return event => {\n event.stopPropagation();\n event.preventDefault();\n\n onSelect(user);\n };\n }\n\n useEffect(() => {\n const unsubscribe = addEventListener(\"enter\", event => {\n event.stopPropagation();\n event.preventDefault();\n onSelect(usersFiltered[selectedUser]);\n });\n\n return () => {\n unsubscribe();\n };\n }, [addEventListener, onSelect, selectedUser, usersFiltered]);\n\n return (\n <ul\n className=\"react-input-emoji--mention--list\"\n data-testid=\"mention-user-list\"\n >\n {usersFiltered.map((user, index) => (\n <li key={user.id}>\n <button\n type=\"button\"\n onClick={handleClick(user)}\n className={`react-input-emoji--mention--item${\n selectedUser === index\n ? \" react-input-emoji--mention--item__selected\"\n : \"\"\n }`}\n onMouseOver={() => setSelectedUser(index)}\n >\n <img\n className=\"react-input-emoji--mention--item--img\"\n src={user.image}\n />\n <div\n className=\"react-input-emoji--mention--item--name\"\n dangerouslySetInnerHTML={{ __html: user.nameHtml }}\n />\n </button>\n </li>\n ))}\n </ul>\n );\n};\n\nconst MentionUserListWithRef = forwardRef(MentionUserList);\n\nexport default MentionUserListWithRef;\n","// @ts-check\n// vendors\nimport React, { useEffect, useRef, useState } from \"react\";\n\n// hooks\nimport { useMention } from \"../hooks/use-mention\";\n\n// components\nimport MentionUserList from \"./mention-user-list\";\n\n/**\n * @typedef {import('../types/types').MentionUser} MetionUser\n */\n\n/**\n * @typedef {import('../types/types').TextInputListeners} TextInputListeners\n */\n\n/**\n * @typedef {import('../types/types').SanitizeFn} SanitizeFn\n */\n\n/**\n * @typedef {Object} Props\n * @property {(text: string) => Promise<MetionUser[]>=} searchMention\n * @property {(event: keyof TextInputListeners, fn: import('../types/types').Listerner<any>) => () => void} addEventListener\n * @property {(html: string) => void} appendContent\n * @property {(fn: SanitizeFn) => void} addSanitizeFn\n */\n\n// eslint-disable-next-line valid-jsdoc\n/** @type {React.FC<Props>} */\nconst MentionWrapper = ({\n searchMention,\n addEventListener,\n appendContent,\n addSanitizeFn\n}) => {\n /** @type {React.MutableRefObject<import('./mention-user-list').Ref | null>} */\n const metionUserListRef = useRef(null);\n const [showUserList, setShowUserList] = useState(false);\n\n const {\n mentionSearchText,\n mentionUsers,\n loading,\n onKeyUp,\n onFocus,\n onSelectUser\n } = useMention(searchMention);\n\n useEffect(() => {\n addSanitizeFn(html => {\n const container = document.createElement(\"div\");\n container.innerHTML = html;\n\n const mentionsEl = Array.prototype.slice.call(\n container.querySelectorAll(\".react-input-emoji--mention--text\")\n );\n\n mentionsEl.forEach(mentionEl => {\n container.innerHTML = container.innerHTML.replace(\n mentionEl.outerHTML,\n `@[${mentionEl.dataset.mentionName}](userId:${mentionEl.dataset.mentionId})`\n );\n });\n\n return container.innerHTML;\n });\n }, [addSanitizeFn]);\n\n useEffect(() => {\n setShowUserList(mentionUsers.length > 0);\n }, [mentionUsers]);\n\n useEffect(() => {\n /** */\n function checkClickOutside() {\n setShowUserList(false);\n }\n\n document.addEventListener(\"click\", checkClickOutside);\n\n return () => {\n document.removeEventListener(\"click\", checkClickOutside);\n };\n }, []);\n\n useEffect(() => {\n const unsubscribe = addEventListener(\"keyUp\", onKeyUp);\n\n return () => {\n unsubscribe();\n };\n }, [addEventListener, onKeyUp]);\n\n useEffect(() => {\n /**\n *\n * @param {React.KeyboardEvent} event\n */\n function handleKeyDown(event) {\n switch (event.key) {\n case \"Esc\": // IE/Edge specific value\n case \"Escape\":\n setShowUserList(false);\n break;\n default:\n break;\n }\n }\n\n const unsubscribe = addEventListener(\"keyDown\", handleKeyDown);\n\n return () => {\n unsubscribe();\n };\n }, [addEventListener]);\n\n useEffect(() => {\n const unsubscribe = addEventListener(\"focus\", onFocus);\n\n return () => {\n unsubscribe();\n };\n }, [addEventListener, onFocus]);\n\n useEffect(() => {\n if (showUserList) {\n const unsubscribeArrowUp = addEventListener(\"arrowUp\", event => {\n event.stopPropagation();\n event.preventDefault();\n metionUserListRef.current.prevUser();\n });\n\n const unsubscribeArrowDown = addEventListener(\"arrowDown\", event => {\n event.stopPropagation();\n event.preventDefault();\n metionUserListRef.current.nextUser();\n });\n\n return () => {\n unsubscribeArrowUp();\n unsubscribeArrowDown();\n };\n }\n }, [addEventListener, showUserList]);\n\n /**\n *\n * @param {MetionUser} user\n */\n function handleSelect(user) {\n onSelectUser();\n appendContent(\n `<span class=\"react-input-emoji--mention--text\" data-mention-id=\"${user.id}\" data-mention-name=\"${user.name}\">@${user.name}</span> `\n );\n }\n\n return (\n <>\n {loading ? (\n <div className=\"react-input-emoji--mention--container\">\n <div className=\"react-input-emoji--mention--loading\">\n <div className=\"react-input-emoji--mention--loading--spinner\">\n Loading...\n </div>\n </div>\n </div>\n ) : (\n showUserList && (\n <div\n className=\"react-input-emoji--mention--container\"\n onClick={evt => evt.stopPropagation()}\n >\n <MentionUserList\n ref={metionUserListRef}\n mentionSearchText={mentionSearchText}\n users={mentionUsers}\n onSelect={handleSelect}\n addEventListener={addEventListener}\n />\n </div>\n )\n )}\n </>\n );\n};\n\nexport default MentionWrapper;\n","// @ts-check\n\n// eslint-disable-next-line valid-jsdoc\n/**\n * @template T\n * @returns {import('../types/types').ListenerObj<T>}\n */\nexport function createObserver() {\n /** @type {import('../types/types').Listerner<T>[]} */\n let listeners = [];\n\n return {\n subscribe: listener => {\n listeners.push(listener);\n return () => {\n listeners = listeners.filter(l => l !== listener);\n };\n },\n publish: event => {\n listeners.forEach(listener => listener(event));\n },\n get currentListerners() {\n return listeners;\n }\n };\n}\n","// @ts-check\n\nimport { useCallback, useMemo } from \"react\";\nimport { createObserver } from \"../utils/observer\";\n\n/**\n * @typedef {import('../types/types').TextInputListeners} TextInputListeners\n */\n\n// eslint-disable-next-line valid-jsdoc\n/** */\nexport function useEventListeners() {\n /** @type {TextInputListeners} */\n const listeners = useMemo(\n () => ({\n keyDown: createObserver(),\n keyUp: createObserver(),\n arrowUp: createObserver(),\n arrowDown: createObserver(),\n enter: createObserver(),\n focus: createObserver(),\n blur: createObserver()\n }),\n []\n );\n\n /**\n * @template {keyof TextInputListeners} T, K\n * @type {(event: keyof TextInputListeners, fn: import('../types/types').Listerner<any>) => () => void}\n */\n const addEventListener = useCallback(\n (event, fn) => {\n return listeners[event].subscribe(fn);\n },\n [listeners]\n );\n\n return { addEventListener, listeners };\n}\n","// @ts-check\n\nimport { useCallback, useRef } from \"react\";\n\n/**\n * @typedef {import('../types/types').PolluteFn} PolluteFn\n */\n\n// eslint-disable-next-line valid-jsdoc\n/** */\nexport function usePollute() {\n /** @type {React.MutableRefObject<PolluteFn[]>} */\n const polluteFnsRef = useRef([]);\n\n /** @type {(fn: PolluteFn) => void} */\n const addPolluteFn = useCallback(fn => {\n polluteFnsRef.current.push(fn);\n }, []);\n\n /** @type {(html: string) => string} */\n const pollute = useCallback(text => {\n const result = polluteFnsRef.current.reduce((acc, fn) => {\n return fn(acc);\n }, text);\n\n return result;\n }, []);\n\n return { addPolluteFn, pollute };\n}\n","// @ts-check\n// vendors\nimport React, { useEffect, useRef, forwardRef, useCallback } from \"react\";\n\n// css\nimport \"./styles.css\";\n\n// utils\nimport { replaceAllTextEmojis } from \"./utils/emoji-utils\";\nimport { handleCopy, totalCharacters } from \"./utils/input-event-utils\";\n\n// hooks\nimport { useExpose } from \"./hooks/use-expose\";\nimport { useEmit } from \"./hooks/use-emit\";\n\n// components\nimport TextInput from \"./text-input\";\nimport EmojiPickerWrapper from \"./components/emoji-picker-wrapper\";\nimport MentionWrapper from \"./components/mention-wrapper\";\nimport { useEventListeners } from \"./hooks/use-event-listeners\";\nimport { useSanitize } from \"./hooks/use-sanitize\";\nimport { usePollute } from \"./hooks/user-pollute\";\n\n/**\n * @typedef {import('./types/types').MentionUser} MetionUser\n */\n\n/**\n * @typedef {import('./types/types').ListenerObj<any>} ListenerObj\n */\n\n/**\n * @typedef {object} Props\n * @property {string} value\n * @property {(value: string) => void} onChange\n * @property {\"light\" | \"dark\" | \"auto\"=} theme\n * @property {boolean=} cleanOnEnter\n * @property {(text: string) => void=} onEnter\n * @property {string=} placeholder\n * @property {string=} placeholderColor\n * @property {string=} color\n * @property {(size: {width: number, height: number}) => void=} onResize\n * @property {() => void=} onClick\n * @property {() => void=} onFocus\n * @property {() => void=} onBlur\n * @property {boolean} shouldReturn\n * @property {number=} maxLength\n * @property {boolean=} keepOpened\n * @property {(event: KeyboardEvent) => void=} onKeyDown\n * @property {string=} inputClass\n * @property {boolean=} disableRecent\n * @property {number=} tabIndex\n * @property {number=} height\n * @property {number=} borderRadius\n * @property {string=} borderColor\n * @property {number=} fontSize\n * @property {string=} fontFamily\n * @property {string=} background\n * @property {{id: string; name: string; emojis: {id: string; name: string; keywords: string[], skins: {src: string}[]}}[]=} customEmojis\n * @property {import('./types/types').Languages=} language\n * @property {(text: string) => Promise<MetionUser[]>=} searchMention\n * @property {HTMLDivElement=} buttonElement\n * @property {React.MutableRefObject=} buttonRef\n * @property {boolean} shouldConvertEmojiToImage\n */\n\n/**\n * Input Emoji Component\n * @param {Props} props\n * @param {React.Ref<any>} ref\n * @return {JSX.Element}\n */\nfunction InputEmoji(props, ref) {\n const {\n onChange,\n onEnter,\n onResize,\n onClick,\n onFocus,\n onBlur,\n onKeyDown,\n theme,\n cleanOnEnter,\n placeholder,\n maxLength,\n keepOpened,\n inputClass,\n disableRecent,\n tabIndex,\n value,\n customEmojis,\n language,\n searchMention,\n buttonElement,\n buttonRef,\n shouldReturn,\n shouldConvertEmojiToImage,\n // style\n borderRadius,\n borderColor,\n fontSize,\n fontFamily,\n background,\n placeholderColor,\n color,\n } = props;\n\n /** @type {React.MutableRefObject<import('./text-input').Ref | null>} */\n const textInputRef = useRef(null);\n\n const { addEventListener, listeners } = useEventListeners();\n\n const { addSanitizeFn, sanitize, sanitizedTextRef } = useSanitize(shouldReturn, shouldConvertEmojiToImage);\n\n const { addPolluteFn, pollute } = usePollute();\n\n const updateHTML = useCallback(\n (nextValue = \"\") => {\n if (textInputRef.current === null) return;\n\n textInputRef.current.html = replaceAllTextEmojis(nextValue);\n sanitizedTextRef.current = nextValue;\n },\n [sanitizedTextRef]\n );\n\n const setValue = useCallback(\n /**\n * \n * @param {string} value\n */\n (value) => {\n updateHTML(value);\n },\n [updateHTML]\n );\n\n const emitChange = useEmit(textInputRef, onResize, onChange);\n\n useExpose({\n ref,\n setValue,\n textInputRef,\n emitChange,\n shouldConvertEmojiToImage\n });\n\n useEffect(() => {\n if (sanitizedTextRef.current !== value) {\n setValue(value);\n }\n }, [sanitizedTextRef, setValue, value]);\n\n // useEffect(() => {\n // updateHTML();\n // }, [updateHTML]);\n\n useEffect(() => {\n /**\n * Handle keydown event\n * @param {React.KeyboardEvent} event\n * @return {boolean}\n */\n function handleKeydown(event) {\n if (\n typeof maxLength !== \"undefined\" &&\n event.key !== \"Backspace\" &&\n textInputRef.current !== null &&\n totalCharacters(textInputRef.current) >= maxLength\n ) {\n event.preventDefault();\n }\n\n if (event.key === \"Enter\" && textInputRef.current) {\n event.preventDefault();\n\n const text = sanitize(textInputRef.current.html);\n\n emitChange(sanitizedTextRef.current);\n\n if (\n typeof onEnter === \"function\" &&\n listeners.enter.currentListerners.length === 0\n ) {\n onEnter(text);\n }\n\n if (cleanOnEnter && listeners.enter.currentListerners.length === 0) {\n updateHTML(\"\");\n }\n\n if (typeof onKeyDown === \"function\") {\n onKeyDown(event.nativeEvent);\n }\n\n return false;\n }\n\n if (typeof onKeyDown === \"function\") {\n onKeyDown(event.nativeEvent);\n }\n\n return true;\n }\n\n const unsubscribe = addEventListener(\"keyDown\", handleKeydown);\n\n return () => {\n unsubscribe();\n };\n }, [\n addEventListener,\n cleanOnEnter,\n emitChange,\n listeners.enter.currentListerners.length,\n maxLength,\n onEnter,\n onKeyDown,\n sanitize,\n sanitizedTextRef,\n updateHTML\n ]);\n\n useEffect(() => {\n /** */\n function handleFocus() {\n if (typeof onClick === \"function\") {\n onClick();\n }\n\n if (typeof onFocus === \"function\") {\n onFocus();\n }\n }\n\n const unsubscribe = addEventListener(\"focus\", handleFocus);\n\n return () => {\n unsubscribe();\n };\n }, [addEventListener, onClick, onFocus]);\n\n useEffect(() => {\n /** */\n function handleBlur() {\n if (typeof onBlur === \"function\") {\n onBlur();\n }\n }\n\n const unsubscribe = addEventListener(\"blur\", handleBlur);\n\n return () => {\n unsubscribe();\n };\n }, [addEventListener, onBlur]);\n\n /**\n *\n * @param {string} html\n */\n function handleTextInputChange(html) {\n sanitize(html);\n\n if (value !== sanitizedTextRef.current) {\n emitChange(sanitizedTextRef.current);\n }\n }\n\n /**\n *\n * @param {string} html\n */\n function appendContent(html) {\n if (\n typeof maxLength !== \"undefined\" &&\n textInputRef.current !== null &&\n totalCharacters(textInputRef.current) >= maxLength\n ) {\n return;\n }\n\n if (textInputRef.current !== null) {\n textInputRef.current.appendContent(html);\n }\n }\n\n /**\n * Handle past on input\n * @param {React.ClipboardEvent} event\n */\n function handlePaste(event) {\n event.preventDefault();\n let content;\n if (event.clipboardData) {\n content = event.clipboardData.getData(\"text/plain\");\n content = pollute(content);\n document.execCommand(\"insertHTML\", false, content);\n }\n }\n\n return (\n <div className=\"react-emoji\">\n <MentionWrapper\n searchMention={searchMention}\n addEventListener={addEventListener}\n appendContent={appendContent}\n addSanitizeFn={addSanitizeFn}\n />\n <TextInput\n ref={textInputRef}\n onCopy={handleCopy}\n onPaste={handlePaste}\n shouldReturn={shouldReturn}\n onBlur={listeners.blur.publish}\n onFocus={listeners.focus.publish}\n onArrowUp={listeners.arrowUp.publish}\n onArrowDown={listeners.arrowDown.publish}\n onKeyUp={listeners.keyUp.publish}\n onKeyDown={listeners.keyDown.publish}\n onEnter={listeners.enter.publish}\n placeholder={placeholder}\n style={{\n borderRadius,\n borderColor,\n fontSize,\n fontFamily,\n background,\n placeholderColor,\n color\n }}\n tabIndex={tabIndex}\n className={inputClass}\n onChange={handleTextInputChange}\n />\n <EmojiPickerWrapper\n theme={theme}\n keepOpened={keepOpened}\n disableRecent={disableRecent}\n customEmojis={customEmojis}\n addSanitizeFn={addSanitizeFn}\n addPolluteFn={addPolluteFn}\n appendContent={appendContent}\n buttonElement={buttonElement}\n buttonRef={buttonRef}\n language={language}\n />\n </div>\n );\n}\n\nconst InputEmojiWithRef = forwardRef(InputEmoji);\n\nInputEmojiWithRef.defaultProps = {\n theme: /** @type {const} */ (\"auto\"),\n height: 30,\n placeholder: \"Type a message\",\n borderRadius: 21,\n borderColor: \"#EAEAEA\",\n color: \"black\",\n fontSize: 15,\n fontFamily: \"sans-serif\",\n background: \"white\",\n tabIndex: 0,\n shouldReturn: false,\n shouldConvertEmojiToImage: false,\n customEmojis: [],\n language: undefined,\n};\n\nexport default InputEmojiWithRef;\n"],"names":["styleInject","css","ref","insertAt","document","head","getElementsByTagName","style","createElement","type","firstChild","insertBefore","appendChild","styleSheet","cssText","createTextNode","TRANSPARENT_GIF","replaceAllTextEmojis","text","allEmojis","getAllEmojisFromText","_toConsumableArray","Set","forEach","emoji","replaceAll","getInputEmojiHTML","str","find","replace","RegExp","match","getImageEmoji","_emojiPickerEl$shadow","emojiPickerEl","querySelector","getInputEmojiNativeHTML","emojiSpanEl","shadowRoot","concat","name","replaceAllTextEmojiToString","html","container","innerHTML","images","Array","prototype","slice","call","querySelectorAll","image","outerHTML","dataset","handleCopy","event","selectedText","window","getSelection","i","len","rangeCount","getRangeAt","cloneContents","replaceEmojiToString","clipboardData","setData","innerText","preventDefault","currentRangeCached","cacheCurrentRange","selection","anchorNode","parentNode","range","cloneRange","handlePasteHtmlAtCaret","sel","_currentRangeCached","deleteContents","el","frag","createDocumentFragment","node","lastNode","insertNode","setStartAfter","collapse","removeAllRanges","addRange","totalCharacters","_ref2","textCount","length","emojisCount","removeHtmlExceptBr","inputDiv","temp","tempContainer","stripped","final","getSelectionStart","startContainer","offset","startOffset","nodeType","Node","TEXT_NODE","nextSibling","commonAncestorContainer","getCursor","selectionStart","addLineBreak","_getCursor","isCollapsed","textContent","br","setEndAfter","br2","setStart","setEnd","string","regexpOrSubstr","newValueOrFn","globalOffset","Error","fn","replaceUsingString","replaceUsingRegexp","patternString","index","indexOf","arr","endIndex","push","substring","regexp","output","replacerIsFn","storedLastIndex","lastIndex","result","exec","out","apply","input","global","module","stringReplaceToArray","stringOrArray","newSubStrOrFn","isArray","TypeError","arrayItem","re","toCodePoint","unicodeSurrogates","sep","r","c","p","charCodeAt","toString","join","UFE0Fg","U200D","String","fromCharCode","grabTheRightIcon","rawText","replaceEmoji","render","replaceStringToArray","emojiReplacer","_","icon","require","pageProtocol","location","protocol","emojiStyle","height","width","margin","verticalAlign","normalizeProtocol","charAt","makeTwemojiRenderer","options","merge","baseUrl","size","ext","props","renderTwemoji","src","key","alt","draggable","arguments","source","Object","hasOwnProperty","reactEasyEmoji","element","optionsOrFn","EMOJI_REGEX","useSanitize","shouldReturn","shouldConvertEmojiToImage","sanitizeFnsRef","useRef","sanitizedTextRef","addSanitizeFn","useCallback","current","sanitize","reduce","acc","replaceAllHtmlToString","convertEmojiToImage","handleEmoji","renderToString","useExpose","_ref","textInputRef","setValue","emitChange","_useSanitize","useImperativeHandle","value","focus","blur","useEmit","onResize","onChange","currentSizeRef","onChangeFn","checkAndEmitResize","currentSize","nextSize","sanitizedText","useEffect","TextInput","placeholder","tabIndex","className","_objectWithoutProperties","_excluded","appendContent","placeholderRef","visibility","offsetWidth","offsetHeight","placeholderStyle","useMemo","placeholderColor","color","inputStyle","handleKeyDown","shiftKey","ctrlKey","onEnter","onArrowUp","onArrowDown","onKeyDown","handleClick","onFocus","handleKeyUp","onKeyUp","React","onClick","contentEditable","onBlur","onCopy","onPaste","TextInputWithRef","forwardRef","EmojiPickerButton","showPicker","toggleShowPicker","buttonElement","buttonRef","localButtonRef","_useState","useState","_useState2","_slicedToArray","showCustomButtonContent","setShowCustomButtonContent","_buttonRef$current$ch","_buttonRef$current","_buttonElement$childN","_buttonElement$childN2","childNodes","xmlns","viewBox","d","$e5534fc185f7111e$export$2e2bcd8739ae039","$dvPge$useRef","instance","update","$dvPge$useEffect","$dvPge$Picker","$dvPge$react","EMOJI_MART_DATA_URL","cacheI18n","EmojiPicker","theme","onSelectEmoji","disableRecent","customEmojis","language","categories","categoryies","undefined","i18n","setI18n","en","fetch","then","_x","_asyncToGenerator","_regeneratorRuntime","mark","_callee","data","translations","wrap","_callee$","_context","prev","next","json","sent","stop","error","console","_x2","_callee2","_callee2$","_context2","Picker","previewPosition","onEmojiSelect","custom","set","memo","EmojiPickerContainer","handleSelectEmoji","position","evt","stopPropagation","top","EMOJI_PICKER_CONTAINER_HEIGHT","EmojiPickerWrapper","keepOpened","addPolluteFn","setShowPicker","_useState3","_useState4","customButton","setCustomButton","_useState5","_useState6","emojiPickerPosition","setEmojiPickerPosition","checkClickOutside","target","classList","contains","addEventListener","removeEventListener","calcTopPosition","currentShowPicker","btn","currentTarget","btnRect","getBoundingClientRect","popoverHeight","ReactDOM","createPortal","Fragment","getTextFromAtToCaret","getRangeFromAtToCaret","begin","end","deleteTextFromAtToCaret","deleteData","elementWithFocus","getElementWithFocus","caretOffset","lastAt","lastIndexOf","preCaretRange","selectNodeContents","endContainer","endOffset","textRange","createRange","preCaretTextRange","body","createTextRange","moveToElementText","setEndPoint","useMention","searchMention","loading","setLoading","mentionUsers","setMentionUsers","mentionSearchText","setMentionSearchText","onSelectUser","checkMentionText","metionText","users","_getElementWithFocus","abrupt","parentElement","hasAttribute","remove","includes","MentionUserList","onSelect","selectedUser","setSelectedUser","prevUser","currentSelectedUser","nextUser","getMentionSelectedNameEl","rest","usersFiltered","searchText","toLocaleLowerCase","map","user","nameHtml","toLowerCase","startsWith","names","split","_objectSpread","unsubscribe","id","onMouseOver","dangerouslySetInnerHTML","__html","MentionUserListWithRef","MentionWrapper","metionUserListRef","showUserList","setShowUserList","_useMention","mentionsEl","mentionEl","mentionName","mentionId","unsubscribeArrowUp","unsubscribeArrowDown","handleSelect","createObserver","listeners","subscribe","listener","filter","l","publish","currentListerners","useEventListeners","keyDown","keyUp","arrowUp","arrowDown","enter","usePollute","polluteFnsRef","pollute","InputEmoji","cleanOnEnter","maxLength","inputClass","borderRadius","borderColor","fontSize","fontFamily","background","_useEventListeners","_usePollute","updateHTML","nextValue","handleKeydown","nativeEvent","handleFocus","handleBlur","handleTextInputChange","handlePaste","content","getData","execCommand","InputEmojiWithRef","defaultProps"],"mappings":";;;;;;;;;;;AAAA,SAASA,WAAWA,CAACC,GAAG,EAAEC,GAAG,EAAE;EAC7B,IAAKA,GAAG,KAAK,KAAK,CAAC,EAAGA,GAAG,GAAG,EAAE,CAAA;AAC9B,EAAA,IAAIC,QAAQ,GAAGD,GAAG,CAACC,QAAQ,CAAA;AAE3B,EAAA,IAAI,CAACF,GAAG,IAAI,OAAOG,QAAQ,KAAK,WAAW,EAAE;AAAE,IAAA,OAAA;AAAQ,GAAA;AAEvD,EAAA,IAAIC,IAAI,GAAGD,QAAQ,CAACC,IAAI,IAAID,QAAQ,CAACE,oBAAoB,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,CAAA;AACpE,EAAA,IAAIC,KAAK,GAAGH,QAAQ,CAACI,aAAa,CAAC,OAAO,CAAC,CAAA;EAC3CD,KAAK,CAACE,IAAI,GAAG,UAAU,CAAA;EAEvB,IAAIN,QAAQ,KAAK,KAAK,EAAE;IACtB,IAAIE,IAAI,CAACK,UAAU,EAAE;MACnBL,IAAI,CAACM,YAAY,CAACJ,KAAK,EAAEF,IAAI,CAACK,UAAU,CAAC,CAAA;AAC3C,KAAC,MAAM;AACLL,MAAAA,IAAI,CAACO,WAA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