'),e=new Y;(0,n.extend)("flarum/common/components/TextEditor","onbuild",(function(){const n=this.$(".TextEditor-editor").wrap('');this.navigator=new(z()),this.navigator.when((()=>e.active)).onUp((()=>e.navigate(-1))).onDown((()=>e.navigate(1))).onSelect(e.complete.bind(e)).onCancel(e.hide.bind(e)).bindTo(n),n.after(t)})),(0,n.extend)("flarum/common/components/TextEditor","buildEditorParams",(function(n){let o,r,i,a=new ot({onmouseenter:function(){e.setIndex($(this).parent().index())},onclick:t=>{this.attrs.composer.editor.replaceBeforeCursor(r-1,t+" "),e.hide()}});n.inputListeners.push((()=>{const n=this.attrs.composer.editor.getSelectionRange(),u=n[0];if(n[1]-u>0)return;const l=this.attrs.composer.editor.getLastNChars(30);r=0;let c=null;for(let t=l.length-1;t>=0;t--){const e=l.substr(t,1);if(c=s().mentionFormats.get(e),c&&(0===t||/\s/.test(l.substr(t-1,1)))){o=t+1,r=u-l.length+t+1,a.init(c.makeMentionables());break}}if(e.hide(),e.active=!1,r){var d;const n=l.substring(o).toLowerCase();if(i=c.queryFromTyped(n),!i)return;a.typed=i;const s=()=>{const n=a.buildSuggestions();if(n.length){e.items=n,m.render(t[0],e.render()),e.show();const o=this.attrs.composer.editor.getCaretCoordinates(r),s=e.$().outerWidth(),i=e.$().outerHeight(),a=e.$().offsetParent();let u=o.left,l=o.top+15;l+i>a.height()&&(l=o.top-i-15),u+s>a.width()&&(u=a.width()-s),l=Math.max(-(a.offset().top-$(document).scrollTop()),l),u=Math.max(-a.offset().left,u),e.show(u,l)}else e.active=!1,e.hide()};e.active=!0,s(),e.setIndex(0),e.$().scrollTop(0),null==(d=a.search())||d.then(s)}}))})),(0,n.extend)("flarum/common/components/TextEditor","toolbarItems",(function(t){t.add("mention",m(O(),{onclick:()=>this.attrs.composer.editor.insertAtCursor(" @"),icon:"fas fa-at"},s().translator.trans("flarum-mentions.forum.composer.mention_tooltip")))}))}(),s().notificationComponents.postMentioned=it,s().notificationComponents.userMentioned=at,s().notificationComponents.groupMentioned=mt,(0,n.extend)("flarum/forum/components/NotificationGrid","notificationTypes",(function(t){t.add("postMentioned",{name:"postMentioned",icon:"fas fa-reply",label:s().translator.trans("flarum-mentions.forum.settings.notify_post_mentioned_label")}),t.add("userMentioned",{name:"userMentioned",icon:"fas fa-at",label:s().translator.trans("flarum-mentions.forum.settings.notify_user_mentioned_label")}),t.add("groupMentioned",{name:"groupMentioned",icon:"fas fa-at",label:s().translator.trans("flarum-mentions.forum.settings.notify_group_mentioned_label")})})),(0,n.extend)(St().prototype,"navItems",(function(t){const e=this.user;t.add("mentions",m(Ft(),{href:s().route("user.mentions",{username:e.slug()}),name:"mentions",icon:"fas fa-at"},s().translator.trans("flarum-mentions.forum.user.mentions_link")),80)})),r.getPlainContent.removeSelectors.push("a.PostMention"),(0,n.extend)(l().prototype,"oncreate",(function(){this.$(".GroupMention--colored, .TagMention--colored").each((function(){this.classList.add(a()(getComputedStyle(this).getPropertyValue("--color")))}))}))}))})(),module.exports=e})();
//# sourceMappingURL=forum.js.map
\ No newline at end of file
diff --git a/extensions/mentions/js/dist/forum.js.map b/extensions/mentions/js/dist/forum.js.map
index eec7f8686..6978e1e84 100644
--- a/extensions/mentions/js/dist/forum.js.map
+++ b/extensions/mentions/js/dist/forum.js.map
@@ -1 +1 @@
-{"version":3,"file":"forum.js","mappings":"MACA,IAAIA,EAAsB,CCA1BA,EAAyBC,IACxB,IAAIC,EAASD,GAAUA,EAAOE,WAC7B,IAAOF,EAAiB,QACxB,IAAM,EAEP,OADAD,EAAoBI,EAAEF,EAAQ,CAAEG,EAAGH,IAC5BA,CAAM,ECLdF,EAAwB,CAACM,EAASC,KACjC,IAAI,IAAIC,KAAOD,EACXP,EAAoBS,EAAEF,EAAYC,KAASR,EAAoBS,EAAEH,EAASE,IAC5EE,OAAOC,eAAeL,EAASE,EAAK,CAAEI,YAAY,EAAMC,IAAKN,EAAWC,IAE1E,ECNDR,EAAwB,CAACc,EAAKC,IAAUL,OAAOM,UAAUC,eAAeC,KAAKJ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MAAMwK,EAAOxL,KAAKwL,KAClBxK,EAAMpB,IAAI,WAAYgB,EAAE,KAAY,CAClCmF,KAAM,UAAU,gBAAiB,CAC/BiH,SAAUxB,EAAK6D,SAEjBhM,KAAM,WACN+H,KAAM,aACL,qBAAqB,6CAA8C,GACxE,IAGA,EAAAuL,gBAAA,qBAAqC,kBAGrC,IAAApK,QAAO,cAAgB,YAAY,WACjCvM,KAAK0D,EAAE,gDAAgDoO,MAAK,WAC1D9R,KAAK4W,UAAUhX,IAAI,IAAkBiX,iBAAiB7W,MAAM8W,iBAAiB,YAC/E,GACF,GACF,G","sources":["webpack://@flarum/mentions/webpack/bootstrap","webpack://@flarum/mentions/webpack/runtime/compat get default export","webpack://@flarum/mentions/webpack/runtime/define property getters","webpack://@flarum/mentions/webpack/runtime/hasOwnProperty shorthand","webpack://@flarum/mentions/webpack/runtime/make namespace object","webpack://@flarum/mentions/external root \"flarum.reg.get('core', 'common/extend')\"","webpack://@flarum/mentions/external root \"flarum.reg.get('core', 'forum/app')\"","webpack://@flarum/mentions/external root \"flarum.reg.get('core', 'common/utils/string')\"","webpack://@flarum/mentions/external root \"flarum.reg.get('core', 'common/helpers/textContrastClass')\"","webpack://@flarum/mentions/external root \"flarum.reg.get('core', 'forum/components/Post')\"","webpack://@flarum/mentions/external root \"flarum.reg.get('core', 'forum/components/CommentPost')\"","webpack://@flarum/mentions/external root \"flarum.reg.get('core', 'forum/components/PostPreview')\"","webpack://@flarum/mentions/external root \"flarum.reg.get('core', 'common/components/LoadingIndicator')\"","webpack://@flarum/mentions/external root \"flarum.reg.get('core', 'common/components/Link')\"","webpack://@flarum/mentions/external root \"flarum.reg.get('core', 'common/helpers/punctuateSeries')\"","webpack://@flarum/mentions/external root \"flarum.reg.get('core', 'common/helpers/username')\"","webpack://@flarum/mentions/external root \"flarum.reg.get('core', 'common/components/Icon')\"","webpack://@flarum/mentions/external root \"flarum.reg.get('core', 'common/components/Button')\"","webpack://@flarum/mentions/external root \"flarum.reg.get('core', 'common/components/Modal')\"","webpack://@flarum/mentions/external root \"flarum.reg.get('core', 'common/states/PaginatedListState')\"","webpack://@flarum/mentions/./src/forum/state/MentionedByModalState.ts","webpack://@flarum/mentions/external root \"flarum.reg.get('core', 'common/components/Form')\"","webpack://@flarum/mentions/./src/forum/components/MentionedByModal.tsx","webpack://@flarum/mentions/external root \"flarum.reg.get('core', 'forum/utils/DiscussionControls')\"","webpack://@flarum/mentions/./src/forum/utils/reply.js","webpack://@flarum/mentions/external root \"flarum.reg.get('core', 'common/Fragment')\"","webpack://@flarum/mentions/./src/forum/fragments/PostQuoteButton.js","webpack://@flarum/mentions/./src/forum/utils/selectedText.js","webpack://@flarum/mentions/external root \"flarum.reg.get('core', 'common/components/TextEditorButton')\"","webpack://@flarum/mentions/external root \"flarum.reg.get('core', 'common/utils/KeyboardNavigatable')\"","webpack://@flarum/mentions/../../../js-packages/webpack-config/node_modules/@babel/runtime/helpers/esm/typeof.js","webpack://@flarum/mentions/../../../js-packages/webpack-config/node_modules/@babel/runtime/helpers/esm/defineProperty.js","webpack://@flarum/mentions/../../../js-packages/webpack-config/node_modules/@babel/runtime/helpers/esm/toPropertyKey.js","webpack://@flarum/mentions/../../../js-packages/webpack-config/node_modules/@babel/runtime/helpers/esm/toPrimitive.js","webpack://@flarum/mentions/./src/forum/fragments/AutocompleteDropdown.js","webpack://@flarum/mentions/external root \"flarum.reg.get('core', 'common/Component')\"","webpack://@flarum/mentions/external root \"flarum.reg.get('core', 'common/utils/classList')\"","webpack://@flarum/mentions/./src/forum/components/MentionsDropdownItem.tsx","webpack://@flarum/mentions/external root \"flarum.reg.get('core', 'common/utils/throttleDebounce')\"","webpack://@flarum/mentions/./src/forum/mentionables/MentionableModels.tsx","webpack://@flarum/mentions/external root \"flarum.reg.get('core', 'forum/components/Notification')\"","webpack://@flarum/mentions/./src/forum/components/PostMentionedNotification.js","webpack://@flarum/mentions/./src/forum/components/UserMentionedNotification.js","webpack://@flarum/mentions/./src/forum/components/GroupMentionedNotification.js","webpack://@flarum/mentions/./src/forum/mentionables/formats/MentionFormat.ts","webpack://@flarum/mentions/external root \"flarum.reg.get('core', 'common/components/Avatar')\"","webpack://@flarum/mentions/external root \"flarum.reg.get('core', 'common/helpers/highlight')\"","webpack://@flarum/mentions/./src/forum/mentionables/MentionableModel.ts","webpack://@flarum/mentions/external root \"flarum.reg.get('core', 'common/utils/extractText')\"","webpack://@flarum/mentions/./src/forum/utils/getCleanDisplayName.js","webpack://@flarum/mentions/./src/forum/mentionables/UserMention.tsx","webpack://@flarum/mentions/./src/forum/mentionables/PostMention.tsx","webpack://@flarum/mentions/external root \"flarum.reg.get('core', 'common/models/Group')\"","webpack://@flarum/mentions/external root \"flarum.reg.get('core', 'common/components/Badge')\"","webpack://@flarum/mentions/./src/forum/mentionables/GroupMention.tsx","webpack://@flarum/mentions/./src/forum/mentionables/formats/AtMentionFormat.ts","webpack://@flarum/mentions/./src/forum/mentionables/TagMention.tsx","webpack://@flarum/mentions/./src/forum/mentionables/formats/HashMentionFormat.ts","webpack://@flarum/mentions/./src/forum/mentionables/formats/MentionFormats.ts","webpack://@flarum/mentions/external root \"flarum.reg.get('core', 'forum/components/UserPage')\"","webpack://@flarum/mentions/external root \"flarum.reg.get('core', 'common/components/LinkButton')\"","webpack://@flarum/mentions/external root \"flarum.reg.get('core', 'common/extenders')\"","webpack://@flarum/mentions/external root \"flarum.reg.get('core', 'common/models/Post')\"","webpack://@flarum/mentions/external root \"flarum.reg.get('core', 'common/models/User')\"","webpack://@flarum/mentions/external root \"flarum.reg.get('core', 'forum/components/PostsUserPage')\"","webpack://@flarum/mentions/./src/forum/components/MentionsUserPage.js","webpack://@flarum/mentions/./src/forum/extend.ts","webpack://@flarum/mentions/./src/forum/utils/textFormatter.js","webpack://@flarum/mentions/./src/forum/utils/getMentionText.js","webpack://@flarum/mentions/./src/forum/extenders/Mentionables.ts","webpack://@flarum/mentions/./src/forum/index.js","webpack://@flarum/mentions/./src/forum/addPostMentionPreviews.js","webpack://@flarum/mentions/./src/forum/addMentionedByList.js","webpack://@flarum/mentions/./src/forum/addPostReplyAction.js","webpack://@flarum/mentions/./src/forum/addPostQuoteButton.js","webpack://@flarum/mentions/./src/forum/addComposerAutocomplete.js"],"sourcesContent":["// The require scope\nvar __webpack_require__ = {};\n\n","// getDefaultExport function for compatibility with non-harmony modules\n__webpack_require__.n = (module) => {\n\tvar getter = module && module.__esModule ?\n\t\t() => (module['default']) :\n\t\t() => (module);\n\t__webpack_require__.d(getter, { a: getter });\n\treturn getter;\n};","// define getter functions for harmony exports\n__webpack_require__.d = (exports, definition) => {\n\tfor(var key in definition) {\n\t\tif(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {\n\t\t\tObject.defineProperty(exports, key, { enumerable: true, get: definition[key] });\n\t\t}\n\t}\n};","__webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))","// define __esModule on exports\n__webpack_require__.r = (exports) => {\n\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n\t}\n\tObject.defineProperty(exports, '__esModule', { value: true });\n};","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.reg.get('core', 'common/extend');","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.reg.get('core', 'forum/app');","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.reg.get('core', 'common/utils/string');","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.reg.get('core', 'common/helpers/textContrastClass');","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.reg.get('core', 'forum/components/Post');","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.reg.get('core', 'forum/components/CommentPost');","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.reg.get('core', 'forum/components/PostPreview');","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.reg.get('core', 'common/components/LoadingIndicator');","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.reg.get('core', 'common/components/Link');","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.reg.get('core', 'common/helpers/punctuateSeries');","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.reg.get('core', 'common/helpers/username');","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.reg.get('core', 'common/components/Icon');","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.reg.get('core', 'common/components/Button');","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.reg.get('core', 'common/components/Modal');","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.reg.get('core', 'common/states/PaginatedListState');","import PaginatedListState from 'flarum/common/states/PaginatedListState';\nexport default class MentionedByModalState extends PaginatedListState {\n constructor(params, page) {\n if (page === void 0) {\n page = 1;\n }\n const limit = 10;\n params.page = {\n ...(params.page || {}),\n limit\n };\n super(params, page, limit);\n }\n get type() {\n return 'posts';\n }\n}\nflarum.reg.add('flarum-mentions', 'forum/state/MentionedByModalState', MentionedByModalState);","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.reg.get('core', 'common/components/Form');","import app from 'flarum/forum/app';\nimport PostPreview from 'flarum/forum/components/PostPreview';\nimport Modal from 'flarum/common/components/Modal';\nimport LoadingIndicator from 'flarum/common/components/LoadingIndicator';\nimport Button from 'flarum/common/components/Button';\nimport MentionedByModalState from '../state/MentionedByModalState';\nimport Form from 'flarum/common/components/Form';\nexport default class MentionedByModal extends Modal {\n oninit(vnode) {\n super.oninit(vnode);\n this.state = new MentionedByModalState({\n filter: {\n mentionedPost: this.attrs.post.id()\n },\n sort: 'number'\n });\n this.state.refresh();\n }\n className() {\n return 'MentionedByModal';\n }\n title() {\n return app.translator.trans('flarum-mentions.forum.mentioned_by.title');\n }\n content() {\n return m('[', null, m(\"div\", {\n className: \"Modal-body\"\n }, this.state.isInitialLoading() ? m(LoadingIndicator, null) : m('[', null, m(\"ul\", {\n className: \"MentionedByModal-list Dropdown-menu Dropdown-menu--inline Post-mentionedBy-preview\"\n }, this.state.getPages().map(page => page.items.map(reply => m(\"li\", {\n \"data-number\": reply.number()\n }, m(PostPreview, {\n post: reply,\n onclick: () => app.modal.close()\n }))))))), this.state.hasNext() && m(\"div\", {\n className: \"Modal-footer\"\n }, m(Form, {\n className: \"Form--centered\"\n }, m(\"div\", {\n className: \"Form-group\"\n }, m(Button, {\n className: \"Button Button--block\",\n onclick: () => this.state.loadNext(),\n loading: this.state.isLoadingNext()\n }, app.translator.trans('flarum-mentions.forum.mentioned_by.load_more_button'))))));\n }\n}\nflarum.reg.add('flarum-mentions', 'forum/components/MentionedByModal', MentionedByModal);","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.reg.get('core', 'forum/utils/DiscussionControls');","import app from 'flarum/forum/app';\nimport DiscussionControls from 'flarum/forum/utils/DiscussionControls';\nexport function insertMention(post, composer, quote) {\n return new Promise(resolve => {\n const mention = app.mentionFormats.mentionable('post').replacement(post) + ' ';\n\n // If the composer is empty, then assume we're starting a new reply.\n // In which case we don't want the user to have to confirm if they\n // close the composer straight away.\n if (!composer.fields.content()) {\n composer.body.attrs.originalContent = mention;\n }\n const cursorPosition = composer.editor.getSelectionRange()[0];\n const preceding = composer.fields.content().slice(0, cursorPosition);\n const precedingNewlines = preceding.length == 0 ? 0 : 3 - preceding.match(/(\\n{0,2})$/)[0].length;\n composer.editor.insertAtCursor(Array(precedingNewlines).join('\\n') + (\n // Insert up to two newlines, depending on preceding whitespace\n quote ? '> ' + mention + quote.trim().replace(/\\n/g, '\\n> ') + '\\n\\n' : mention), false);\n return resolve(composer);\n });\n}\nexport default function reply(post, quote) {\n const EditPostComposer = flarum.reg.checkModule('core', 'forum/components/EditPostComposer');\n if (EditPostComposer && app.composer.bodyMatches(EditPostComposer) && app.composer.body.attrs.post.discussion() === post.discussion()) {\n // If we're already editing a post in the discussion of post we're quoting,\n // insert the mention directly.\n return insertMention(post, app.composer, quote);\n } else {\n // The default \"Reply\" action behavior will only open a new composer if\n // necessary, but it will always be a ReplyComposer, hence the exceptional\n // case above.\n return DiscussionControls.replyAction.call(post.discussion()).then(composer => insertMention(post, composer, quote));\n }\n}\nflarum.reg.add('flarum-mentions', 'forum/utils/reply', reply);","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.reg.get('core', 'common/Fragment');","import app from 'flarum/forum/app';\nimport Fragment from 'flarum/common/Fragment';\nimport Icon from 'flarum/common/components/Icon';\nimport reply from '../utils/reply';\nexport default class PostQuoteButton extends Fragment {\n constructor(post) {\n super();\n this.post = post;\n }\n view() {\n return m(\"button\", {\n className: \"Button PostQuoteButton\",\n onclick: () => {\n reply(this.post, this.content);\n }\n }, m(Icon, {\n name: \"fas fa-quote-left\",\n className: \"Button-icon\"\n }), app.translator.trans('flarum-mentions.forum.post.quote_button'));\n }\n show(left, top) {\n const $this = this.$().show();\n const parentOffset = $this.offsetParent().offset();\n $this.css('left', left - parentOffset.left).css('top', top - parentOffset.top);\n this.hideHandler = this.hide.bind(this);\n $(document).on('mouseup', this.hideHandler);\n }\n showStart(left, top) {\n const $this = this.$();\n this.show(left, $(window).scrollTop() + top - $this.outerHeight() - 5);\n }\n showEnd(right, bottom) {\n const $this = this.$();\n this.show(right - $this.outerWidth(), $(window).scrollTop() + bottom + 5);\n }\n hide() {\n this.$().hide();\n $(document).off('mouseup', this.hideHandler);\n }\n}\nflarum.reg.add('flarum-mentions', 'forum/fragments/PostQuoteButton', PostQuoteButton);","/**\n * Finds the selected text in the provided composer body.\n */\nexport default function selectedText(body) {\n const selection = window.getSelection();\n if (!selection.isCollapsed) {\n const range = selection.getRangeAt(0);\n const parent = range.commonAncestorContainer;\n if (body[0] === parent || $.contains(body[0], parent)) {\n const clone = $('
').append(range.cloneContents());\n\n // Replace emoji images with their shortcode (found in alt attribute)\n clone.find('img.emoji').replaceWith(function () {\n return this.alt;\n });\n\n // Replace all other images with a Markdown image\n clone.find('img').replaceWith(function () {\n return \"\");\n });\n\n // Replace all links with a Markdown link\n clone.find('a').replaceWith(function () {\n return \"[\".concat(this.innerText, \"](\").concat(this.href, \")\");\n });\n return clone.text();\n }\n }\n return '';\n}\nflarum.reg.add('flarum-mentions', 'forum/utils/selectedText', selectedText);","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.reg.get('core', 'common/components/TextEditorButton');","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.reg.get('core', 'common/utils/KeyboardNavigatable');","export default function _typeof(obj) {\n \"@babel/helpers - typeof\";\n\n return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (obj) {\n return typeof obj;\n } : function (obj) {\n return obj && \"function\" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj;\n }, _typeof(obj);\n}","import toPropertyKey from \"./toPropertyKey.js\";\nexport default function _defineProperty(obj, key, value) {\n key = toPropertyKey(key);\n if (key in obj) {\n Object.defineProperty(obj, key, {\n value: value,\n enumerable: true,\n configurable: true,\n writable: true\n });\n } else {\n obj[key] = value;\n }\n return obj;\n}","import _typeof from \"./typeof.js\";\nimport toPrimitive from \"./toPrimitive.js\";\nexport default function _toPropertyKey(arg) {\n var key = toPrimitive(arg, \"string\");\n return _typeof(key) === \"symbol\" ? key : String(key);\n}","import _typeof from \"./typeof.js\";\nexport default function _toPrimitive(input, hint) {\n if (_typeof(input) !== \"object\" || input === null) return input;\n var prim = input[Symbol.toPrimitive];\n if (prim !== undefined) {\n var res = prim.call(input, hint || \"default\");\n if (_typeof(res) !== \"object\") return res;\n throw new TypeError(\"@@toPrimitive must return a primitive value.\");\n }\n return (hint === \"string\" ? String : Number)(input);\n}","import _defineProperty from \"@babel/runtime/helpers/esm/defineProperty\";\nimport Fragment from 'flarum/common/Fragment';\nexport default class AutocompleteDropdown extends Fragment {\n constructor() {\n super(...arguments);\n _defineProperty(this, \"items\", []);\n _defineProperty(this, \"active\", false);\n _defineProperty(this, \"index\", 0);\n _defineProperty(this, \"keyWasJustPressed\", false);\n }\n view() {\n return m(\"ul\", {\n className: \"Dropdown-menu MentionsDropdown\"\n }, this.items.map(item => m(\"li\", null, item)));\n }\n show(left, top) {\n this.$().show().css({\n left: left + 'px',\n top: top + 'px'\n });\n this.active = true;\n }\n hide() {\n this.$().hide();\n this.active = false;\n }\n navigate(delta) {\n this.keyWasJustPressed = true;\n this.setIndex(this.index + delta, true);\n clearTimeout(this.keyWasJustPressedTimeout);\n this.keyWasJustPressedTimeout = setTimeout(() => this.keyWasJustPressed = false, 500);\n }\n complete() {\n this.$('li').eq(this.index).find('button').click();\n }\n setIndex(index, scrollToItem) {\n if (this.keyWasJustPressed && !scrollToItem) return;\n const $dropdown = this.$();\n const $items = $dropdown.find('li');\n let rangedIndex = index;\n if (rangedIndex < 0) {\n rangedIndex = $items.length - 1;\n } else if (rangedIndex >= $items.length) {\n rangedIndex = 0;\n }\n this.index = rangedIndex;\n const $item = $items.removeClass('active').eq(rangedIndex).addClass('active');\n if (scrollToItem) {\n const dropdownScroll = $dropdown.scrollTop();\n const dropdownTop = $dropdown.offset().top;\n const dropdownBottom = dropdownTop + $dropdown.outerHeight();\n const itemTop = $item.offset().top;\n const itemBottom = itemTop + $item.outerHeight();\n let scrollTop;\n if (itemTop < dropdownTop) {\n scrollTop = dropdownScroll - dropdownTop + itemTop - parseInt($dropdown.css('padding-top'), 10);\n } else if (itemBottom > dropdownBottom) {\n scrollTop = dropdownScroll - dropdownBottom + itemBottom + parseInt($dropdown.css('padding-bottom'), 10);\n }\n if (typeof scrollTop !== 'undefined') {\n $dropdown.stop(true).animate({\n scrollTop\n }, 100);\n }\n }\n }\n}\nflarum.reg.add('flarum-mentions', 'forum/fragments/AutocompleteDropdown', AutocompleteDropdown);","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.reg.get('core', 'common/Component');","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.reg.get('core', 'common/utils/classList');","import Component from 'flarum/common/Component';\nimport classList from 'flarum/common/utils/classList';\nexport default class MentionsDropdownItem extends Component {\n view(vnode) {\n const {\n mentionable,\n ...attrs\n } = this.attrs;\n const className = classList('MentionsDropdownItem', 'PostPreview', \"MentionsDropdown-\".concat(mentionable.type()));\n return m(\"button\", Object.assign({\n className: className\n }, attrs), m(\"span\", {\n className: \"PostPreview-content\"\n }, vnode.children));\n }\n}\nflarum.reg.add('flarum-mentions', 'forum/components/MentionsDropdownItem', MentionsDropdownItem);","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.reg.get('core', 'common/utils/throttleDebounce');","import _defineProperty from \"@babel/runtime/helpers/esm/defineProperty\";\nimport MentionsDropdownItem from '../components/MentionsDropdownItem';\nimport { throttle } from 'flarum/common/utils/throttleDebounce';\nexport default class MentionableModels {\n constructor(dropdownItemAttrs) {\n _defineProperty(this, \"mentionables\", void 0);\n /**\n * We store models returned from an API here to preserve order in which they are returned\n * This prevents the list jumping around while models are returned.\n * We also use a hashmap for model IDs to provide O(1) lookup for the users already in the list.\n */\n _defineProperty(this, \"results\", {});\n _defineProperty(this, \"typed\", null);\n _defineProperty(this, \"searched\", []);\n _defineProperty(this, \"dropdownItemAttrs\", {});\n /**\n * Don't send API calls searching for models until at least 2 characters have been typed.\n * This focuses the mention results on models already loaded.\n */\n _defineProperty(this, \"search\", throttle(250, async () => {\n if (!this.typed || this.typed.length <= 1) return;\n const typedLower = this.typed.toLowerCase();\n if (this.searched.includes(typedLower)) return;\n for (const mentionable of this.mentionables) {\n for (const model of await mentionable.search(typedLower)) {\n if (!this.results[mentionable.type()].has(model.id())) {\n this.results[mentionable.type()].set(model.id(), model);\n }\n }\n }\n this.searched.push(typedLower);\n return Promise.resolve();\n }));\n this.dropdownItemAttrs = dropdownItemAttrs;\n }\n init(mentionables) {\n this.typed = null;\n this.mentionables = mentionables;\n for (const mentionable of this.mentionables) {\n this.results[mentionable.type()] = new Map(mentionable.initialResults().map(result => [result.id(), result]));\n }\n }\n matches(mentionable, model) {\n var _this$typed;\n return mentionable.matches(model, ((_this$typed = this.typed) == null ? void 0 : _this$typed.toLowerCase()) || '');\n }\n makeSuggestion(mentionable, model) {\n const content = mentionable.suggestion(model, this.typed);\n const replacement = mentionable.replacement(model);\n const {\n onclick,\n ...attrs\n } = this.dropdownItemAttrs;\n return m(MentionsDropdownItem, Object.assign({\n mentionable: mentionable,\n onclick: () => onclick(replacement)\n }, attrs), content);\n }\n buildSuggestions() {\n const suggestions = [];\n for (const mentionable of this.mentionables) {\n if (!mentionable.enabled()) continue;\n let matches = Array.from(this.results[mentionable.type()].values()).filter(model => this.matches(mentionable, model));\n const max = mentionable.maxStoreMatchedResults();\n if (max) matches = matches.splice(0, max);\n for (const model of matches) {\n const dropdownItem = this.makeSuggestion(mentionable, model);\n suggestions.push(dropdownItem);\n }\n }\n return suggestions;\n }\n}\nflarum.reg.add('flarum-mentions', 'forum/mentionables/MentionableModels', MentionableModels);","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.reg.get('core', 'forum/components/Notification');","import app from 'flarum/forum/app';\nimport Notification from 'flarum/forum/components/Notification';\nimport { truncate } from 'flarum/common/utils/string';\nexport default class PostMentionedNotification extends Notification {\n icon() {\n return 'fas fa-reply';\n }\n href() {\n const notification = this.attrs.notification;\n const post = notification.subject();\n const content = notification.content();\n return app.route.discussion(post.discussion(), content && content.replyNumber);\n }\n content() {\n const notification = this.attrs.notification;\n const user = notification.fromUser();\n return app.translator.trans('flarum-mentions.forum.notifications.post_mentioned_text', {\n user,\n count: 1\n });\n }\n excerpt() {\n return truncate(this.attrs.notification.subject().contentPlain() || '', 200);\n }\n}\nflarum.reg.add('flarum-mentions', 'forum/components/PostMentionedNotification', PostMentionedNotification);","import app from 'flarum/forum/app';\nimport Notification from 'flarum/forum/components/Notification';\nimport { truncate } from 'flarum/common/utils/string';\nexport default class UserMentionedNotification extends Notification {\n icon() {\n return 'fas fa-at';\n }\n href() {\n const post = this.attrs.notification.subject();\n return app.route.discussion(post.discussion(), post.number());\n }\n content() {\n const user = this.attrs.notification.fromUser();\n return app.translator.trans('flarum-mentions.forum.notifications.user_mentioned_text', {\n user\n });\n }\n excerpt() {\n return truncate(this.attrs.notification.subject().contentPlain(), 200);\n }\n}\nflarum.reg.add('flarum-mentions', 'forum/components/UserMentionedNotification', UserMentionedNotification);","import app from 'flarum/forum/app';\nimport Notification from 'flarum/forum/components/Notification';\nimport { truncate } from 'flarum/common/utils/string';\nexport default class GroupMentionedNotification extends Notification {\n icon() {\n return 'fas fa-at';\n }\n href() {\n const post = this.attrs.notification.subject();\n return app.route.discussion(post.discussion(), post.number());\n }\n content() {\n const user = this.attrs.notification.fromUser();\n return app.translator.trans('flarum-mentions.forum.notifications.group_mentioned_text', {\n user\n });\n }\n excerpt() {\n return truncate(this.attrs.notification.subject().contentPlain(), 200);\n }\n}\nflarum.reg.add('flarum-mentions', 'forum/components/GroupMentionedNotification', GroupMentionedNotification);","import _defineProperty from \"@babel/runtime/helpers/esm/defineProperty\";\nexport default class MentionFormat {\n constructor() {\n _defineProperty(this, \"instances\", void 0);\n _defineProperty(this, \"mentionables\", void 0);\n _defineProperty(this, \"extendable\", void 0);\n }\n makeMentionables() {\n var _this$instances;\n return (_this$instances = this.instances) != null ? _this$instances : this.instances = this.mentionables.map(Mentionable => new Mentionable(this));\n }\n getMentionable(type) {\n var _this$makeMentionable;\n return (_this$makeMentionable = this.makeMentionables().find(mentionable => mentionable.type() === type)) != null ? _this$makeMentionable : null;\n }\n extend(mentionable) {\n if (!this.extendable) throw new Error('This mention format does not allow extending.');\n this.mentionables.push(mentionable);\n }\n\n /**\n * Picks the term to search in the API from the typed text.\n * @example:\n * * Full text = `Hello @\"John D`\n * * Typed text = `\"John D`\n * * Query = `John D`\n */\n}\nflarum.reg.add('flarum-mentions', 'forum/mentionables/formats/MentionFormat', MentionFormat);","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.reg.get('core', 'common/components/Avatar');","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.reg.get('core', 'common/helpers/highlight');","import _defineProperty from \"@babel/runtime/helpers/esm/defineProperty\";\nexport default class MentionableModel {\n constructor(format) {\n _defineProperty(this, \"format\", void 0);\n this.format = format;\n }\n}\nflarum.reg.add('flarum-mentions', 'forum/mentionables/MentionableModel', MentionableModel);","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.reg.get('core', 'common/utils/extractText');","import app from 'flarum/forum/app';\nimport extractText from 'flarum/common/utils/extractText';\n\n/**\n * Whether to use the old mentions format.\n *\n * `'@username'` or `'@\"Display name\"'`\n */\nexport const shouldUseOldFormat = () => app.forum.attribute('allowUsernameMentionFormat') || false;\nconst getDeletedUserText = () => extractText(app.translator.trans('core.lib.username.deleted_text'));\n\n/**\n * Fetches a user's username or display name.\n *\n * Chooses based on the format option set in the admin settings page.\n *\n * @param user An instance of the User model to fetch the username for\n * @param useDisplayName If `true`, uses `user.displayName()`, otherwise, uses `user.username()`\n */\nexport default function getCleanDisplayName(user, useDisplayName) {\n if (useDisplayName === void 0) {\n useDisplayName = true;\n }\n if (!user) return getDeletedUserText().replace(/\"#[a-z]{0,3}[0-9]+/, '_');\n const text = (useDisplayName ? user.displayName() : user.username()) || getDeletedUserText();\n return text.replace(/\"#[a-z]{0,3}[0-9]+/, '_');\n}\nflarum.reg.add('flarum-mentions', 'forum/utils/getCleanDisplayName', getCleanDisplayName);","import app from 'flarum/forum/app';\nimport usernameHelper from 'flarum/common/helpers/username';\nimport Avatar from 'flarum/common/components/Avatar';\nimport highlight from 'flarum/common/helpers/highlight';\nimport MentionableModel from './MentionableModel';\nimport getCleanDisplayName, { shouldUseOldFormat } from '../utils/getCleanDisplayName';\nexport default class UserMention extends MentionableModel {\n type() {\n return 'user';\n }\n initialResults() {\n return Array.from(app.store.all('users'));\n }\n\n /**\n * Automatically determines which mention syntax to be used based on the option in the\n * admin dashboard. Also performs display name clean-up automatically.\n *\n * @\"Display name\"#UserID or `@username`\n *\n * @example
New display name syntax
\n * // '@\"user\"#1'\n * forUser(User) // User is ID 1, display name is 'User'\n *\n * @example
Using old syntax
\n * // '@username'\n * forUser(user) // User's username is 'username'\n */\n replacement(user) {\n if (shouldUseOldFormat()) {\n const cleanText = getCleanDisplayName(user, false);\n return this.format.format(cleanText);\n }\n const cleanText = getCleanDisplayName(user);\n return this.format.format(cleanText, '', user.id());\n }\n suggestion(model, typed) {\n const username = usernameHelper(model, name => highlight(name, typed));\n return m('[', null, m(Avatar, {\n user: model\n }), username);\n }\n matches(model, typed) {\n if (!typed) return false;\n const names = [model.username(), model.displayName()];\n return names.some(name => name.toLowerCase().substr(0, typed.length) === typed);\n }\n maxStoreMatchedResults() {\n return null;\n }\n async search(typed) {\n return await app.store.find('users', {\n filter: {\n q: typed\n },\n page: {\n limit: 5\n }\n });\n }\n enabled() {\n return true;\n }\n}\nflarum.reg.add('flarum-mentions', 'forum/mentionables/UserMention', UserMention);","import app from 'flarum/forum/app';\nimport MentionableModel from './MentionableModel';\nimport usernameHelper from 'flarum/common/helpers/username';\nimport Avatar from 'flarum/common/components/Avatar';\nimport highlight from 'flarum/common/helpers/highlight';\nimport { truncate } from 'flarum/common/utils/string';\nimport getCleanDisplayName from '../utils/getCleanDisplayName';\nexport default class PostMention extends MentionableModel {\n type() {\n return 'post';\n }\n\n /**\n * If the user is replying to a discussion, or if they are editing a\n * post, then we can suggest other posts in the discussion to mention.\n * We will add the 5 most recent comments in the discussion which\n * match any username characters that have been typed.\n */\n initialResults() {\n const EditPostComposer = flarum.reg.checkModule('core', 'forum/components/EditPostComposer');\n const ReplyComposer = flarum.reg.checkModule('core', 'forum/components/ReplyComposer');\n if ((!ReplyComposer || !app.composer.bodyMatches(ReplyComposer)) && (!EditPostComposer || !app.composer.bodyMatches(EditPostComposer))) {\n return [];\n }\n\n // @ts-ignore\n const composerAttrs = app.composer.body.attrs;\n const composerPost = composerAttrs.post;\n const discussion = composerPost && composerPost.discussion() || composerAttrs.discussion;\n return discussion.posts()\n // Filter to only comment posts, and replies before this message\n .filter(post => post && post.contentType() === 'comment' && (!composerPost || post.number() < composerPost.number()))\n // Sort by new to old\n .sort((a, b) => b.createdAt().getTime() - a.createdAt().getTime());\n }\n\n /**\n * Generates the syntax for mentioning of a post. Also cleans up the display name.\n *\n * @example
Post mention
\n * // '@\"User\"#p13'\n * // @\"Display name\"#pPostID\n * forPostMention(user, 13) // User display name is 'User', post ID is 13\n */\n replacement(post) {\n const user = post.user();\n const cleanText = getCleanDisplayName(user);\n return this.format.format(cleanText, 'p', post.id());\n }\n suggestion(model, typed) {\n var _model$contentPlain;\n const user = model.user() || null;\n const username = usernameHelper(user, name => highlight(name, typed));\n return m('[', null, m(Avatar, {\n user: user\n }), username, [app.translator.trans('flarum-mentions.forum.composer.reply_to_post_text', {\n number: model.number()\n }), ' — ', truncate((_model$contentPlain = model.contentPlain()) != null ? _model$contentPlain : '', 200)]);\n }\n matches(model, typed) {\n const user = model.user();\n const userMentionable = app.mentionFormats.mentionable('user');\n return !typed || user && userMentionable.matches(user, typed);\n }\n maxStoreMatchedResults() {\n return 5;\n }\n\n /**\n * Post mention suggestions are only offered from current discussion posts.\n */\n search(typed) {\n return Promise.resolve([]);\n }\n enabled() {\n return true;\n }\n}\nflarum.reg.add('flarum-mentions', 'forum/mentionables/PostMention', PostMention);","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.reg.get('core', 'common/models/Group');","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.reg.get('core', 'common/components/Badge');","import app from 'flarum/forum/app';\nimport Group from 'flarum/common/models/Group';\nimport MentionableModel from './MentionableModel';\nimport Badge from 'flarum/common/components/Badge';\nimport highlight from 'flarum/common/helpers/highlight';\nexport default class GroupMention extends MentionableModel {\n type() {\n return 'group';\n }\n initialResults() {\n return Array.from(app.store.all('groups').filter(g => {\n return g.id() !== Group.GUEST_ID && g.id() !== Group.MEMBER_ID;\n }));\n }\n\n /**\n * Generates the mention syntax for a group mention.\n *\n * @\"Name Plural\"#gGroupID\n *\n * @example
Group mention
\n * // '@\"Mods\"#g4'\n * forGroup(group) // Group display name is 'Mods', group ID is 4\n */\n replacement(group) {\n return this.format.format(group.namePlural(), 'g', group.id());\n }\n suggestion(model, typed) {\n let groupName = model.namePlural();\n if (typed) {\n groupName = highlight(groupName, typed);\n }\n return m('[', null, m(Badge, {\n className: \"Avatar Badge Badge--group--\".concat(model.id(), \" Badge-icon\"),\n color: model.color(),\n type: \"group\",\n icon: model.icon()\n }), m(\"span\", {\n className: \"username\"\n }, groupName));\n }\n matches(model, typed) {\n if (!typed) return false;\n const names = [model.namePlural().toLowerCase(), model.nameSingular().toLowerCase()];\n return names.some(name => name.toLowerCase().substr(0, typed.length) === typed);\n }\n maxStoreMatchedResults() {\n return null;\n }\n\n /**\n * All groups are already loaded, so we don't need to search for them.\n */\n search(typed) {\n return Promise.resolve([]);\n }\n enabled() {\n var _app$session$user$can, _app$session, _app$session$user;\n return (_app$session$user$can = (_app$session = app.session) == null ? void 0 : (_app$session$user = _app$session.user) == null ? void 0 : _app$session$user.canMentionGroups()) != null ? _app$session$user$can : false;\n }\n}\nflarum.reg.add('flarum-mentions', 'forum/mentionables/GroupMention', GroupMention);","import _defineProperty from \"@babel/runtime/helpers/esm/defineProperty\";\nimport MentionFormat from './MentionFormat';\nimport UserMention from '../UserMention';\nimport PostMention from '../PostMention';\nimport GroupMention from '../GroupMention';\nexport default class AtMentionFormat extends MentionFormat {\n constructor() {\n super(...arguments);\n _defineProperty(this, \"mentionables\", [UserMention, PostMention, GroupMention]);\n _defineProperty(this, \"extendable\", true);\n }\n trigger() {\n return '@';\n }\n queryFromTyped(typed) {\n const matchTyped = typed.match(/^[\"“]?((?:(?!\"#).)+)$/);\n return matchTyped ? matchTyped[1] : null;\n }\n format(name, char, id) {\n if (char === void 0) {\n char = '';\n }\n if (id === void 0) {\n id = null;\n }\n return {\n simple: \"@\".concat(name),\n safe: \"@\\\"\".concat(name, \"\\\"#\").concat(char).concat(id)\n }[id ? 'safe' : 'simple'];\n }\n}\nflarum.reg.add('flarum-mentions', 'forum/mentionables/formats/AtMentionFormat', AtMentionFormat);","import app from 'flarum/forum/app';\nimport Badge from 'flarum/common/components/Badge';\nimport highlight from 'flarum/common/helpers/highlight';\nimport MentionableModel from './MentionableModel';\nexport default class TagMention extends MentionableModel {\n type() {\n return 'tag';\n }\n initialResults() {\n return Array.from(app.store.all('tags'));\n }\n\n /**\n * Generates the mention syntax for a tag mention.\n *\n * ~tagSlug\n *\n * @example
Tag mention
\n * // ~general\n * forTag(tag) // Tag display name is 'Tag', tag ID is 5\n */\n replacement(tag) {\n return this.format.format(tag.slug());\n }\n matches(model, typed) {\n if (!typed) return false;\n const names = [model.name().toLowerCase()];\n return names.some(name => name.toLowerCase().substr(0, typed.length) === typed);\n }\n maxStoreMatchedResults() {\n return null;\n }\n async search(typed) {\n return await app.store.find('tags', {\n filter: {\n q: typed\n },\n page: {\n limit: 5\n }\n });\n }\n suggestion(model, typed) {\n let tagName = model.name();\n if (typed) {\n tagName = highlight(tagName, typed);\n }\n return m('[', null, m(Badge, {\n className: \"Avatar\",\n icon: model.icon(),\n color: model.color(),\n type: \"tag\"\n }), m(\"span\", {\n className: \"username\"\n }, tagName));\n }\n enabled() {\n return 'flarum-tags' in flarum.extensions;\n }\n}\nflarum.reg.add('flarum-mentions', 'forum/mentionables/TagMention', TagMention);","import _defineProperty from \"@babel/runtime/helpers/esm/defineProperty\";\nimport MentionFormat from './MentionFormat';\nimport TagMention from '../TagMention';\nexport default class HashMentionFormat extends MentionFormat {\n constructor() {\n super(...arguments);\n _defineProperty(this, \"mentionables\", [TagMention]);\n _defineProperty(this, \"extendable\", true);\n }\n trigger() {\n return '#';\n }\n queryFromTyped(typed) {\n const matchTyped = typed.match(/^[-_\\p{L}\\p{N}\\p{M}]+$/giu);\n return matchTyped ? matchTyped[0] : null;\n }\n format(slug) {\n return \"#\".concat(slug);\n }\n}\nflarum.reg.add('flarum-mentions', 'forum/mentionables/formats/HashMentionFormat', HashMentionFormat);","import _defineProperty from \"@babel/runtime/helpers/esm/defineProperty\";\nimport AtMentionFormat from './AtMentionFormat';\nimport HashMentionFormat from './HashMentionFormat';\nexport default class MentionFormats {\n constructor() {\n _defineProperty(this, \"formats\", [new AtMentionFormat(), new HashMentionFormat()]);\n }\n get(symbol) {\n var _this$formats$find;\n return (_this$formats$find = this.formats.find(f => f.trigger() === symbol)) != null ? _this$formats$find : null;\n }\n mentionable(type) {\n for (const format of this.formats) {\n const mentionable = format.getMentionable(type);\n if (mentionable) return mentionable;\n }\n return null;\n }\n extend(format) {\n this.formats.push(new format());\n }\n}\nflarum.reg.add('flarum-mentions', 'forum/mentionables/formats/MentionFormats', MentionFormats);","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.reg.get('core', 'forum/components/UserPage');","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.reg.get('core', 'common/components/LinkButton');","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.reg.get('core', 'common/extenders');","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.reg.get('core', 'common/models/Post');","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.reg.get('core', 'common/models/User');","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.reg.get('core', 'forum/components/PostsUserPage');","import app from 'flarum/forum/app';\nimport PostsUserPage from 'flarum/forum/components/PostsUserPage';\n\n/**\n * The `MentionsUserPage` component shows post which user Mentioned at\n */\nexport default class MentionsUserPage extends PostsUserPage {\n /**\n * Load a new page of the user's activity feed.\n *\n * @param {Integer} [offset] The position to start getting results from.\n * @return {Promise}\n * @protected\n */\n loadResults(offset) {\n return app.store.find('posts', {\n filter: {\n type: 'comment',\n mentioned: this.user.id()\n },\n page: {\n offset,\n limit: this.loadLimit\n },\n sort: '-createdAt'\n });\n }\n}\nflarum.reg.add('flarum-mentions', 'forum/components/MentionsUserPage', MentionsUserPage);","import Extend from 'flarum/common/extenders';\nimport Post from 'flarum/common/models/Post';\nimport User from 'flarum/common/models/User';\nimport MentionsUserPage from './components/MentionsUserPage';\nexport default [new Extend.Routes() //\n.add('user.mentions', '/u/:username/mentions', MentionsUserPage), new Extend.Model(Post) //\n.hasMany('mentionedBy').attribute('mentionedByCount'), new Extend.Model(User) //\n.attribute('canMentionGroups')];","import app from 'flarum/forum/app';\nimport username from 'flarum/common/helpers/username';\nimport extractText from 'flarum/common/utils/extractText';\nexport function filterUserMentions(tag) {\n let user;\n if (app.forum.attribute('allowUsernameMentionFormat') && tag.hasAttribute('username')) user = app.store.getBy('users', 'username', tag.getAttribute('username'));else if (tag.hasAttribute('id')) user = app.store.getById('users', tag.getAttribute('id'));\n if (user) {\n tag.setAttribute('id', user.id());\n tag.setAttribute('slug', user.slug());\n tag.setAttribute('displayname', extractText(username(user)));\n return true;\n }\n tag.invalidate();\n}\nexport function postFilterUserMentions(tag) {\n tag.setAttribute('deleted', false);\n}\nexport function filterPostMentions(tag) {\n const post = app.store.getById('posts', tag.getAttribute('id'));\n if (post) {\n tag.setAttribute('discussionid', post.discussion().id());\n tag.setAttribute('number', post.number());\n tag.setAttribute('displayname', extractText(username(post.user())));\n return true;\n }\n}\nexport function postFilterPostMentions(tag) {\n tag.setAttribute('deleted', false);\n}\nexport function filterGroupMentions(tag) {\n var _app$session, _app$session$user;\n if ((_app$session = app.session) != null && (_app$session$user = _app$session.user) != null && _app$session$user.canMentionGroups()) {\n const group = app.store.getById('groups', tag.getAttribute('id'));\n if (group) {\n tag.setAttribute('groupname', extractText(group.namePlural()));\n return true;\n }\n }\n tag.invalidate();\n}\nexport function postFilterGroupMentions(tag) {\n var _app$session2, _app$session2$user;\n if ((_app$session2 = app.session) != null && (_app$session2$user = _app$session2.user) != null && _app$session2$user.canMentionGroups()) {\n const group = app.store.getById('groups', tag.getAttribute('id'));\n tag.setAttribute('color', group.color());\n tag.setAttribute('icon', group.icon());\n tag.setAttribute('deleted', false);\n }\n}\nexport function filterTagMentions(tag) {\n if ('flarum-tags' in flarum.extensions) {\n const model = app.store.getBy('tags', 'slug', tag.getAttribute('slug'));\n if (model) {\n tag.setAttribute('id', model.id());\n tag.setAttribute('tagname', model.name());\n return true;\n }\n }\n tag.invalidate();\n}\nexport function postFilterTagMentions(tag) {\n if ('flarum-tags' in flarum.extensions) {\n const model = app.store.getBy('tags', 'slug', tag.getAttribute('slug'));\n tag.setAttribute('icon', model.icon());\n tag.setAttribute('color', model.color());\n tag.setAttribute('deleted', false);\n }\n}\nflarum.reg.add('flarum-mentions', 'forum/utils/textFormatter', { filterUserMentions: filterUserMentions,postFilterUserMentions: postFilterUserMentions,filterPostMentions: filterPostMentions,postFilterPostMentions: postFilterPostMentions,filterGroupMentions: filterGroupMentions,postFilterGroupMentions: postFilterGroupMentions,filterTagMentions: filterTagMentions,postFilterTagMentions: postFilterTagMentions, });","import app from 'flarum/forum/app';\n\n/**\n * Fetches the mention text for a specified user (and optionally a post ID for replies or group).\n *\n * Automatically determines which mention syntax to be used based on the option in the\n * admin dashboard. Also performs display name clean-up automatically.\n *\n * @deprecated Use `app.mentionables.get('user').replacement(user)` instead. Will be removed in 2.0.\n */\nexport default function getMentionText(user, postId, group) {\n if (user !== undefined && postId === undefined) {\n return app.mentionables.get('user').replacement(user);\n } else if (user !== undefined && postId !== undefined) {\n return app.mentionables.get('post').replacement(app.store.getById('posts', postId));\n } else if (group !== undefined) {\n return app.mentionables.get('group').replacement(group);\n }\n throw 'No parameters were passed';\n}\nflarum.reg.add('flarum-mentions', 'forum/utils/getMentionText', getMentionText);","import _defineProperty from \"@babel/runtime/helpers/esm/defineProperty\";\nexport default class Mentionables {\n constructor() {\n _defineProperty(this, \"formats\", []);\n _defineProperty(this, \"mentionables\", {});\n }\n /**\n * Register a new mention format.\n * Must extend MentionFormat and have a unique unused trigger symbol.\n */\n format(format) {\n this.formats.push(format);\n return this;\n }\n\n /**\n * Register a new mentionable model to a mention format.\n * Only works if the format has already been registered,\n * and the format allows using multiple mentionables.\n *\n * @param symbol The trigger symbol of the format to extend (ex: @).\n * @param mentionable The mentionable instance to register.\n * Must extend MentionableModel.\n */\n mentionable(symbol, mentionable) {\n if (!this.mentionables[symbol]) {\n this.mentionables[symbol] = [];\n }\n this.mentionables[symbol].push(mentionable);\n return this;\n }\n extend(app) {\n for (const format of this.formats) {\n app.mentionFormats.extend(format);\n }\n for (const symbol in this.mentionables) {\n const format = app.mentionFormats.get(symbol);\n if (!format) continue;\n for (const mentionable of this.mentionables[symbol]) {\n format.extend(mentionable);\n }\n }\n }\n}\nflarum.reg.add('flarum-mentions', 'forum/extenders/Mentionables', Mentionables);","import { extend } from 'flarum/common/extend';\nimport app from 'flarum/forum/app';\nimport { getPlainContent } from 'flarum/common/utils/string';\nimport textContrastClass from 'flarum/common/helpers/textContrastClass';\nimport Post from 'flarum/forum/components/Post';\nimport addPostMentionPreviews from './addPostMentionPreviews';\nimport addMentionedByList from './addMentionedByList';\nimport addPostReplyAction from './addPostReplyAction';\nimport addPostQuoteButton from './addPostQuoteButton';\nimport addComposerAutocomplete from './addComposerAutocomplete';\nimport PostMentionedNotification from './components/PostMentionedNotification';\nimport UserMentionedNotification from './components/UserMentionedNotification';\nimport GroupMentionedNotification from './components/GroupMentionedNotification';\nimport MentionFormats from './mentionables/formats/MentionFormats';\nimport UserPage from 'flarum/forum/components/UserPage';\nimport LinkButton from 'flarum/common/components/LinkButton';\napp.mentionFormats = new MentionFormats();\nexport { default as extend } from './extend';\napp.initializers.add('flarum-mentions', function () {\n // For every mention of a post inside a post's content, set up a hover handler\n // that shows a preview of the mentioned post.\n addPostMentionPreviews();\n\n // In the footer of each post, show information about who has replied (i.e.\n // who the post has been mentioned by).\n addMentionedByList();\n\n // Add a 'reply' control to the footer of each post. When clicked, it will\n // open up the composer and add a post mention to its contents.\n addPostReplyAction();\n\n // Show a Quote button when Post text is selected\n addPostQuoteButton();\n\n // After typing '@' in the composer, show a dropdown suggesting a bunch of\n // posts or users that the user could mention.\n addComposerAutocomplete();\n app.notificationComponents.postMentioned = PostMentionedNotification;\n app.notificationComponents.userMentioned = UserMentionedNotification;\n app.notificationComponents.groupMentioned = GroupMentionedNotification;\n\n // Add notification preferences.\n extend('flarum/forum/components/NotificationGrid', 'notificationTypes', function (items) {\n items.add('postMentioned', {\n name: 'postMentioned',\n icon: 'fas fa-reply',\n label: app.translator.trans('flarum-mentions.forum.settings.notify_post_mentioned_label')\n });\n items.add('userMentioned', {\n name: 'userMentioned',\n icon: 'fas fa-at',\n label: app.translator.trans('flarum-mentions.forum.settings.notify_user_mentioned_label')\n });\n items.add('groupMentioned', {\n name: 'groupMentioned',\n icon: 'fas fa-at',\n label: app.translator.trans('flarum-mentions.forum.settings.notify_group_mentioned_label')\n });\n });\n\n // Add mentions tab in user profile\n extend(UserPage.prototype, 'navItems', function (items) {\n const user = this.user;\n items.add('mentions', m(LinkButton, {\n href: app.route('user.mentions', {\n username: user.slug()\n }),\n name: \"mentions\",\n icon: \"fas fa-at\"\n }, app.translator.trans('flarum-mentions.forum.user.mentions_link')), 80);\n });\n\n // Remove post mentions when rendering post previews.\n getPlainContent.removeSelectors.push('a.PostMention');\n\n // Apply color contrast fix on group mentions.\n extend(Post.prototype, 'oncreate', function () {\n this.$('.GroupMention--colored, .TagMention--colored').each(function () {\n this.classList.add(textContrastClass(getComputedStyle(this).getPropertyValue('--color')));\n });\n });\n});\nexport * from './utils/textFormatter';\nimport './forum';","import { extend } from 'flarum/common/extend';\nimport CommentPost from 'flarum/forum/components/CommentPost';\nimport PostPreview from 'flarum/forum/components/PostPreview';\nimport LoadingIndicator from 'flarum/common/components/LoadingIndicator';\nexport default function addPostMentionPreviews() {\n function addPreviews() {\n const contentHtml = this.attrs.post.contentHtml();\n if (contentHtml === this.oldPostContentHtml || this.isEditing()) return;\n this.oldPostContentHtml = contentHtml;\n const parentPost = this.attrs.post;\n const $parentPost = this.$();\n this.$().on('click', '.UserMention:not(.UserMention--deleted), .PostMention:not(.PostMention--deleted), .TagMention:not(.TagMention--deleted)', function (e) {\n m.route.set(this.getAttribute('href'));\n e.preventDefault();\n });\n this.$('.PostMention:not(.PostMention--deleted)').each(function () {\n const $this = $(this);\n const id = $this.data('id');\n let timeout;\n\n // Wrap the mention link in a wrapper element so that we can insert a\n // preview popup as its sibling and relatively position it.\n const $preview = $('
');\n $parentPost.append($preview);\n const getPostElement = () => {\n return $(\".PostStream-item[data-id=\\\"\".concat(id, \"\\\"]\"));\n };\n const showPreview = () => {\n // When the user hovers their mouse over the mention, look for the\n // post that it's referring to in the stream, and determine if it's\n // in the viewport. If it is, we will \"pulsate\" it.\n const $post = getPostElement();\n let visible = false;\n if ($post.length) {\n const top = $post.offset().top;\n const scrollTop = window.pageYOffset;\n if (top > scrollTop && top + $post.height() < scrollTop + $(window).height()) {\n $post.addClass('pulsate');\n visible = true;\n }\n }\n\n // Otherwise, we will show a popup preview of the post. If the post\n // hasn't yet been loaded, we will need to do that.\n if (!visible) {\n // Position the preview so that it appears above the mention.\n // (The offsetParent should be .Post-body.)\n const positionPreview = () => {\n const previewHeight = $preview.outerHeight(true);\n let offset = 0;\n\n // If the preview goes off the top of the viewport, reposition it to\n // be below the mention.\n if ($this.offset().top - previewHeight < $(window).scrollTop() + $('#header').outerHeight()) {\n offset += $this.outerHeight(true);\n } else {\n offset -= previewHeight;\n }\n $preview.show().css('top', $this.offset().top - $parentPost.offset().top + offset).css('left', $this.offsetParent().offset().left - $parentPost.offset().left).css('max-width', $this.offsetParent().width());\n };\n const showPost = post => {\n const discussion = post.discussion();\n m.render($preview[0], [discussion !== parentPost.discussion() && m(\"li\", null, m(\"span\", {\n className: \"PostMention-preview-discussion\"\n }, discussion.title())), m(\"li\", null, m(PostPreview, {\n post: post\n }))]);\n positionPreview();\n };\n const post = app.store.getById('posts', id);\n if (post && post.discussion()) {\n showPost(post);\n } else {\n m.render($preview[0], m(LoadingIndicator, null));\n app.store.find('posts', id).then(showPost);\n positionPreview();\n }\n setTimeout(() => $preview.off('transitionend').addClass('in'));\n }\n };\n const hidePreview = () => {\n getPostElement().removeClass('pulsate');\n if ($preview.hasClass('in')) {\n $preview.removeClass('in').one('transitionend', () => $preview.hide());\n }\n };\n\n // On a touch (mobile) device we cannot hover the link to reveal the preview.\n // Instead we cancel the navigation so that a click reveals the preview.\n // Users can then click on the preview to go to the post if desired.\n $this.on('touchend', e => {\n if (e.cancelable) {\n e.preventDefault();\n }\n });\n $this.add($preview).hover(() => {\n clearTimeout(timeout);\n timeout = setTimeout(showPreview, 250);\n }, () => {\n clearTimeout(timeout);\n getPostElement().removeClass('pulsate');\n timeout = setTimeout(hidePreview, 250);\n }).on('touchend', e => {\n showPreview();\n e.stopPropagation();\n });\n $(document).on('touchend', hidePreview);\n });\n }\n extend(CommentPost.prototype, 'oncreate', addPreviews);\n extend(CommentPost.prototype, 'onupdate', addPreviews);\n}","import app from 'flarum/forum/app';\nimport { extend } from 'flarum/common/extend';\nimport CommentPost from 'flarum/forum/components/CommentPost';\nimport Link from 'flarum/common/components/Link';\nimport PostPreview from 'flarum/forum/components/PostPreview';\nimport punctuateSeries from 'flarum/common/helpers/punctuateSeries';\nimport username from 'flarum/common/helpers/username';\nimport Icon from 'flarum/common/components/Icon';\nimport Button from 'flarum/common/components/Button';\nimport MentionedByModal from './components/MentionedByModal';\nexport default function addMentionedByList() {\n function hidePreview() {\n this.$('.Post-mentionedBy-preview').removeClass('in').one('transitionend', function () {\n $(this).hide();\n });\n }\n extend(CommentPost.prototype, 'oncreate', function () {\n let timeout;\n const post = this.attrs.post;\n const replies = post.mentionedBy();\n if (replies && replies.length) {\n const $preview = $('
');\n this.$().append($preview);\n const $parentPost = this.$();\n const $this = this.$('.Post-mentionedBy');\n const showPreview = () => {\n if (!$preview.hasClass('in') && $preview.is(':visible')) return;\n\n // When the user hovers their mouse over the list of people who have\n // replied to the post, render a list of reply previews into a\n // popup.\n m.render($preview[0], m('[', null, replies.map(reply => m(\"li\", {\n \"data-number\": reply.number()\n }, m(PostPreview, {\n post: reply,\n onclick: hidePreview.bind(this)\n }))), replies.length < post.mentionedByCount() && m(\"li\", {\n className: \"Post-mentionedBy-preview-more\"\n }, m(Button, {\n className: \"PostPreview Button\",\n onclick: () => {\n hidePreview.call(this);\n app.modal.show(MentionedByModal, {\n post\n });\n }\n }, m(\"span\", {\n className: \"PostPreview-content\"\n }, m(\"span\", {\n className: \"PostPreview-badge Avatar\"\n }, m(Icon, {\n name: 'fas fa-reply-all'\n })), m(\"span\", null, app.translator.trans('flarum-mentions.forum.post.mentioned_by_more_text', {\n count: post.mentionedByCount() - replies.length\n })))))));\n $preview.show().css('top', $this.offset().top - $parentPost.offset().top + $this.outerHeight(true)).css('left', $this.offsetParent().offset().left - $parentPost.offset().left).css('max-width', $parentPost.width());\n setTimeout(() => $preview.off('transitionend').addClass('in'));\n };\n $this.add($preview).hover(() => {\n clearTimeout(timeout);\n timeout = setTimeout(showPreview, 250);\n }, () => {\n clearTimeout(timeout);\n timeout = setTimeout(hidePreview, 250);\n });\n\n // Whenever the user hovers their mouse over a particular name in the\n // list of repliers, highlight the corresponding post in the preview\n // popup.\n this.$().find('.Post-mentionedBy-summary a').hover(function () {\n $preview.find('[data-number=\"' + $(this).data('number') + '\"]').addClass('active');\n }, function () {\n $preview.find('[data-number]').removeClass('active');\n });\n }\n });\n extend(CommentPost.prototype, 'footerItems', function (items) {\n const post = this.attrs.post;\n const replies = post.mentionedBy();\n if (replies && replies.length) {\n const users = [];\n const repliers = replies.sort(reply => reply.user() === app.session.user ? -1 : 0).filter(reply => {\n const user = reply.user();\n if (users.indexOf(user) === -1) {\n users.push(user);\n return true;\n }\n });\n const limit = 4;\n const overLimit = post.mentionedByCount() > limit;\n\n // Create a list of unique users who have replied. So even if a user has\n // replied twice, they will only be in this array once.\n const names = repliers.slice(0, overLimit ? limit - 1 : limit).map(reply => {\n const user = reply.user();\n return m(Link, {\n href: app.route.post(reply),\n onclick: hidePreview.bind(this),\n \"data-number\": reply.number()\n }, app.session.user === user ? app.translator.trans('flarum-mentions.forum.post.you_text') : username(user));\n });\n\n // If there are more users that we've run out of room to display, add a \"x\n // others\" name to the end of the list. Clicking on it will display a modal\n // with a full list of names.\n if (overLimit) {\n const count = post.mentionedByCount() - names.length;\n names.push(app.translator.trans('flarum-mentions.forum.post.others_text', {\n count\n }));\n }\n items.add('replies', m(\"div\", {\n className: \"Post-mentionedBy\"\n }, m(\"span\", {\n className: \"Post-mentionedBy-summary\"\n }, m(Icon, {\n name: 'fas fa-reply'\n }), app.translator.trans(\"flarum-mentions.forum.post.mentioned_by\".concat(repliers[0].user() === app.session.user ? '_self' : '', \"_text\"), {\n count: names.length,\n users: punctuateSeries(names)\n }))));\n }\n });\n}","import app from 'flarum/forum/app';\nimport { extend } from 'flarum/common/extend';\nimport Button from 'flarum/common/components/Button';\nimport CommentPost from 'flarum/forum/components/CommentPost';\nimport reply from './utils/reply';\nexport default function addPostReplyAction() {\n extend(CommentPost.prototype, 'actionItems', function (items) {\n const post = this.attrs.post;\n if (post.isHidden() || app.session.user && !post.discussion().canReply()) return;\n items.add('reply', m(Button, {\n className: \"Button Button--link\",\n onclick: () => reply(post)\n }, app.translator.trans('flarum-mentions.forum.post.reply_link')));\n });\n}","import app from 'flarum/forum/app';\nimport { extend } from 'flarum/common/extend';\nimport CommentPost from 'flarum/forum/components/CommentPost';\nimport PostQuoteButton from './fragments/PostQuoteButton';\nimport selectedText from './utils/selectedText';\nexport default function addPostQuoteButton() {\n extend(CommentPost.prototype, 'oncreate', function () {\n const post = this.attrs.post;\n if (post.isHidden() || app.session.user && !post.discussion().canReply()) return;\n const $postBody = this.$('.Post-body');\n\n // Wrap the quote button in a wrapper element so that we can render\n // button into it.\n const $container = $('');\n const button = new PostQuoteButton(post);\n const handler = function (e) {\n setTimeout(() => {\n const content = selectedText($postBody);\n if (content) {\n button.content = content;\n m.render($container[0], button.render());\n const rects = window.getSelection().getRangeAt(0).getClientRects();\n const firstRect = rects[0];\n if (e.clientY < firstRect.bottom && e.clientX - firstRect.right < firstRect.left - e.clientX) {\n button.showStart(firstRect.left, firstRect.top);\n } else {\n const lastRect = rects[rects.length - 1];\n button.showEnd(lastRect.right, lastRect.bottom);\n }\n }\n }, 1);\n };\n this.$().after($container).on('mouseup', handler);\n if ('ontouchstart' in window) {\n document.addEventListener('selectionchange', handler, false);\n }\n });\n}","import app from 'flarum/forum/app';\nimport { extend } from 'flarum/common/extend';\nimport TextEditorButton from 'flarum/common/components/TextEditorButton';\nimport KeyboardNavigatable from 'flarum/common/utils/KeyboardNavigatable';\nimport AutocompleteDropdown from './fragments/AutocompleteDropdown';\nimport MentionableModels from './mentionables/MentionableModels';\nexport default function addComposerAutocomplete() {\n const $container = $('');\n const dropdown = new AutocompleteDropdown();\n extend('flarum/common/components/TextEditor', 'onbuild', function () {\n const $editor = this.$('.TextEditor-editor').wrap('');\n this.navigator = new KeyboardNavigatable();\n this.navigator.when(() => dropdown.active).onUp(() => dropdown.navigate(-1)).onDown(() => dropdown.navigate(1)).onSelect(dropdown.complete.bind(dropdown)).onCancel(dropdown.hide.bind(dropdown)).bindTo($editor);\n $editor.after($container);\n });\n extend('flarum/common/components/TextEditor', 'buildEditorParams', function (params) {\n let relMentionStart;\n let absMentionStart;\n let matchTyped;\n let mentionables = new MentionableModels({\n onmouseenter: function () {\n dropdown.setIndex($(this).parent().index());\n },\n onclick: replacement => {\n this.attrs.composer.editor.replaceBeforeCursor(absMentionStart - 1, replacement + ' ');\n dropdown.hide();\n }\n });\n const suggestionsInputListener = () => {\n const selection = this.attrs.composer.editor.getSelectionRange();\n const cursor = selection[0];\n if (selection[1] - cursor > 0) return;\n\n // Search backwards from the cursor for a mention triggering symbol. If we find one,\n // we will want to show the correct autocomplete dropdown!\n // Check classes implementing the IMentionableModel interface to see triggering symbols.\n const lastChunk = this.attrs.composer.editor.getLastNChars(30);\n absMentionStart = 0;\n let activeFormat = null;\n for (let i = lastChunk.length - 1; i >= 0; i--) {\n const character = lastChunk.substr(i, 1);\n activeFormat = app.mentionFormats.get(character);\n if (activeFormat && (i === 0 || /\\s/.test(lastChunk.substr(i - 1, 1)))) {\n relMentionStart = i + 1;\n absMentionStart = cursor - lastChunk.length + i + 1;\n mentionables.init(activeFormat.makeMentionables());\n break;\n }\n }\n dropdown.hide();\n dropdown.active = false;\n if (absMentionStart) {\n var _mentionables$search;\n const typed = lastChunk.substring(relMentionStart).toLowerCase();\n matchTyped = activeFormat.queryFromTyped(typed);\n if (!matchTyped) return;\n mentionables.typed = matchTyped;\n const buildSuggestions = () => {\n // If the user has started to type a mention,\n // then suggest models matching.\n const suggestions = mentionables.buildSuggestions();\n if (suggestions.length) {\n dropdown.items = suggestions;\n m.render($container[0], dropdown.render());\n dropdown.show();\n const coordinates = this.attrs.composer.editor.getCaretCoordinates(absMentionStart);\n const width = dropdown.$().outerWidth();\n const height = dropdown.$().outerHeight();\n const parent = dropdown.$().offsetParent();\n let left = coordinates.left;\n let top = coordinates.top + 15;\n\n // Keep the dropdown inside the editor.\n if (top + height > parent.height()) {\n top = coordinates.top - height - 15;\n }\n if (left + width > parent.width()) {\n left = parent.width() - width;\n }\n\n // Prevent the dropdown from going off screen on mobile\n top = Math.max(-(parent.offset().top - $(document).scrollTop()), top);\n left = Math.max(-parent.offset().left, left);\n dropdown.show(left, top);\n } else {\n dropdown.active = false;\n dropdown.hide();\n }\n };\n dropdown.active = true;\n buildSuggestions();\n dropdown.setIndex(0);\n dropdown.$().scrollTop(0);\n (_mentionables$search = mentionables.search()) == null ? void 0 : _mentionables$search.then(buildSuggestions);\n }\n };\n params.inputListeners.push(suggestionsInputListener);\n });\n extend('flarum/common/components/TextEditor', 'toolbarItems', function (items) {\n items.add('mention', m(TextEditorButton, {\n onclick: () => this.attrs.composer.editor.insertAtCursor(' @'),\n icon: \"fas fa-at\"\n }, app.translator.trans('flarum-mentions.forum.composer.mention_tooltip')));\n });\n}"],"names":["__webpack_require__","module","getter","__esModule","d","a","exports","definition","key","o","Object","defineProperty","enumerable","get","obj","prop","prototype","hasOwnProperty","call","Symbol","toStringTag","value","flarum","reg","MentionedByModalState","constructor","params","page","limit","super","type","add","MentionedByModal","oninit","vnode","this","state","filter","mentionedPost","attrs","post","id","sort","refresh","className","title","content","m","isInitialLoading","getPages","map","items","reply","number","onclick","hasNext","loadNext","loading","isLoadingNext","insertMention","composer","quote","Promise","resolve","mention","replacement","fields","body","originalContent","cursorPosition","editor","getSelectionRange","preceding","slice","precedingNewlines","length","match","insertAtCursor","Array","join","trim","replace","EditPostComposer","checkModule","discussion","then","PostQuoteButton","view","name","show","left","top","$this","$","parentOffset","offsetParent","offset","css","hideHandler","hide","bind","document","on","showStart","window","scrollTop","outerHeight","showEnd","right","bottom","outerWidth","off","selectedText","selection","getSelection","isCollapsed","range","getRangeAt","parent","commonAncestorContainer","contains","clone","append","cloneContents","find","replaceWith","alt","concat","src","innerText","href","text","_typeof","iterator","_defineProperty","arg","input","hint","prim","toPrimitive","undefined","res","TypeError","String","toPropertyKey","configurable","writable","AutocompleteDropdown","arguments","item","active","navigate","delta","keyWasJustPressed","setIndex","index","clearTimeout","keyWasJustPressedTimeout","setTimeout","complete","eq","click","scrollToItem","$dropdown","$items","rangedIndex","$item","removeClass","addClass","dropdownScroll","dropdownTop","dropdownBottom","itemTop","itemBottom","parseInt","stop","animate","MentionsDropdownItem","mentionable","assign","children","MentionableModels","dropdownItemAttrs","throttle","async","typed","typedLower","toLowerCase","searched","includes","mentionables","model","search","results","has","set","push","init","Map","initialResults","result","matches","_this$typed","makeSuggestion","suggestion","buildSuggestions","suggestions","enabled","from","values","max","maxStoreMatchedResults","splice","dropdownItem","PostMentionedNotification","icon","notification","subject","replyNumber","user","fromUser","count","excerpt","truncate","contentPlain","UserMentionedNotification","GroupMentionedNotification","MentionFormat","makeMentionables","_this$instances","instances","Mentionable","getMentionable","_this$makeMentionable","extend","extendable","Error","MentionableModel","format","getDeletedUserText","getCleanDisplayName","useDisplayName","displayName","username","UserMention","cleanText","some","substr","q","PostMention","ReplyComposer","composerAttrs","composerPost","posts","contentType","b","createdAt","getTime","_model$contentPlain","userMentionable","GroupMention","g","group","namePlural","groupName","color","nameSingular","_app$session$user$can","_app$session","_app$session$user","canMentionGroups","AtMentionFormat","trigger","queryFromTyped","matchTyped","char","simple","safe","TagMention","tag","slug","tagName","extensions","HashMentionFormat","MentionFormats","symbol","_this$formats$find","formats","f","MentionsUserPage","loadResults","mentioned","loadLimit","hasMany","attribute","filterUserMentions","hasAttribute","getAttribute","setAttribute","invalidate","postFilterUserMentions","filterPostMentions","postFilterPostMentions","filterGroupMentions","postFilterGroupMentions","_app$session2","_app$session2$user","filterTagMentions","postFilterTagMentions","postId","app","mentionFormats","addPreviews","contentHtml","oldPostContentHtml","isEditing","parentPost","$parentPost","e","route","preventDefault","each","data","timeout","$preview","getPostElement","showPreview","$post","visible","pageYOffset","height","positionPreview","previewHeight","width","showPost","render","store","getById","hidePreview","hasClass","one","cancelable","hover","stopPropagation","addPostMentionPreviews","replies","mentionedBy","is","mentionedByCount","users","repliers","indexOf","overLimit","names","addMentionedByList","isHidden","canReply","$postBody","$container","button","handler","rects","getClientRects","firstRect","clientY","clientX","lastRect","after","addEventListener","dropdown","$editor","wrap","navigator","when","onUp","onDown","onSelect","onCancel","bindTo","relMentionStart","absMentionStart","onmouseenter","replaceBeforeCursor","inputListeners","cursor","lastChunk","getLastNChars","activeFormat","i","character","test","_mentionables$search","substring","coordinates","getCaretCoordinates","Math","addComposerAutocomplete","label","getPlainContent","classList","getComputedStyle","getPropertyValue"],"sourceRoot":""}
\ No newline at end of file
+{"version":3,"file":"forum.js","mappings":"MACA,IAAIA,EAAsB,CCA1BA,EAAyBC,IACxB,IAAIC,EAASD,GAAUA,EAAOE,WAC7B,IAAOF,EAAiB,QACxB,IAAM,EAEP,OADAD,EAAoBI,EAAEF,EAAQ,CAAEG,EAAGH,IAC5BA,CAAM,ECLdF,EAAwB,CAACM,EAASC,KACjC,IAAI,IAAIC,KAAOD,EACXP,EAAoBS,EAAEF,EAAYC,KAASR,EAAoBS,EAAEH,EAASE,IAC5EE,OAAOC,eAAeL,EAASE,EAAK,CAAEI,YAAY,EAAMC,IAAKN,EAAWC,IAE1E,ECNDR,EAAwB,CAACc,EAAKC,IAAUL,OAAOM,UAAUC,eAAeC,KAAKJ,EAAKC,GCClFf,EAAyBM,IACH,oBAAXa,QAA0BA,OAAOC,aAC1CV,OAAOC,eAAeL,EAASa,OAAO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bootstrap","webpack://@flarum/mentions/webpack/runtime/compat get default export","webpack://@flarum/mentions/webpack/runtime/define property getters","webpack://@flarum/mentions/webpack/runtime/hasOwnProperty shorthand","webpack://@flarum/mentions/webpack/runtime/make namespace object","webpack://@flarum/mentions/external root \"flarum.reg.get('core', 'common/extend')\"","webpack://@flarum/mentions/external root \"flarum.reg.get('core', 'forum/app')\"","webpack://@flarum/mentions/external root \"flarum.reg.get('core', 'common/utils/string')\"","webpack://@flarum/mentions/external root \"flarum.reg.get('core', 'common/helpers/textContrastClass')\"","webpack://@flarum/mentions/external root \"flarum.reg.get('core', 'forum/components/Post')\"","webpack://@flarum/mentions/external root \"flarum.reg.get('core', 'forum/components/CommentPost')\"","webpack://@flarum/mentions/external root \"flarum.reg.get('core', 'forum/components/PostPreview')\"","webpack://@flarum/mentions/external root \"flarum.reg.get('core', 'common/components/LoadingIndicator')\"","webpack://@flarum/mentions/external root \"flarum.reg.get('core', 'common/components/Link')\"","webpack://@flarum/mentions/external root \"flarum.reg.get('core', 'common/helpers/punctuateSeries')\"","webpack://@flarum/mentions/external root \"flarum.reg.get('core', 'common/helpers/username')\"","webpack://@flarum/mentions/external root \"flarum.reg.get('core', 'common/components/Icon')\"","webpack://@flarum/mentions/external root \"flarum.reg.get('core', 'common/components/Button')\"","webpack://@flarum/mentions/external root \"flarum.reg.get('core', 'common/components/Modal')\"","webpack://@flarum/mentions/external root \"flarum.reg.get('core', 'common/states/PaginatedListState')\"","webpack://@flarum/mentions/./src/forum/state/MentionedByModalState.ts","webpack://@flarum/mentions/external root \"flarum.reg.get('core', 'common/components/Form')\"","webpack://@flarum/mentions/./src/forum/components/MentionedByModal.tsx","webpack://@flarum/mentions/external root \"flarum.reg.get('core', 'forum/utils/DiscussionControls')\"","webpack://@flarum/mentions/./src/forum/utils/reply.js","webpack://@flarum/mentions/external root \"flarum.reg.get('core', 'common/Fragment')\"","webpack://@flarum/mentions/./src/forum/fragments/PostQuoteButton.js","webpack://@flarum/mentions/./src/forum/utils/selectedText.js","webpack://@flarum/mentions/external root \"flarum.reg.get('core', 'common/components/TextEditorButton')\"","webpack://@flarum/mentions/external root \"flarum.reg.get('core', 'common/utils/KeyboardNavigatable')\"","webpack://@flarum/mentions/../../../js-packages/webpack-config/node_modules/@babel/runtime/helpers/esm/typeof.js","webpack://@flarum/mentions/../../../js-packages/webpack-config/node_modules/@babel/runtime/helpers/esm/defineProperty.js","webpack://@flarum/mentions/../../../js-packages/webpack-config/node_modules/@babel/runtime/helpers/esm/toPropertyKey.js","webpack://@flarum/mentions/../../../js-packages/webpack-config/node_modules/@babel/runtime/helpers/esm/toPrimitive.js","webpack://@flarum/mentions/./src/forum/fragments/AutocompleteDropdown.js","webpack://@flarum/mentions/external root \"flarum.reg.get('core', 'common/Component')\"","webpack://@flarum/mentions/external root \"flarum.reg.get('core', 'common/utils/classList')\"","webpack://@flarum/mentions/./src/forum/components/MentionsDropdownItem.tsx","webpack://@flarum/mentions/external root \"flarum.reg.get('core', 'common/utils/throttleDebounce')\"","webpack://@flarum/mentions/./src/forum/mentionables/MentionableModels.tsx","webpack://@flarum/mentions/external root \"flarum.reg.get('core', 'forum/components/Notification')\"","webpack://@flarum/mentions/./src/forum/components/PostMentionedNotification.js","webpack://@flarum/mentions/./src/forum/components/UserMentionedNotification.js","webpack://@flarum/mentions/./src/forum/components/GroupMentionedNotification.js","webpack://@flarum/mentions/./src/forum/mentionables/formats/MentionFormat.ts","webpack://@flarum/mentions/external root \"flarum.reg.get('core', 'common/components/Avatar')\"","webpack://@flarum/mentions/external root \"flarum.reg.get('core', 'common/helpers/highlight')\"","webpack://@flarum/mentions/./src/forum/mentionables/MentionableModel.ts","webpack://@flarum/mentions/external root \"flarum.reg.get('core', 'common/utils/extractText')\"","webpack://@flarum/mentions/./src/forum/utils/getCleanDisplayName.js","webpack://@flarum/mentions/./src/forum/mentionables/UserMention.tsx","webpack://@flarum/mentions/./src/forum/mentionables/PostMention.tsx","webpack://@flarum/mentions/external root \"flarum.reg.get('core', 'common/models/Group')\"","webpack://@flarum/mentions/external root \"flarum.reg.get('core', 'common/components/Badge')\"","webpack://@flarum/mentions/./src/forum/mentionables/GroupMention.tsx","webpack://@flarum/mentions/./src/forum/mentionables/formats/AtMentionFormat.ts","webpack://@flarum/mentions/./src/forum/mentionables/TagMention.tsx","webpack://@flarum/mentions/./src/forum/mentionables/formats/HashMentionFormat.ts","webpack://@flarum/mentions/./src/forum/mentionables/formats/MentionFormats.ts","webpack://@flarum/mentions/external root \"flarum.reg.get('core', 'forum/components/UserPage')\"","webpack://@flarum/mentions/external root \"flarum.reg.get('core', 'common/components/LinkButton')\"","webpack://@flarum/mentions/external root \"flarum.reg.get('core', 'common/extenders')\"","webpack://@flarum/mentions/external root \"flarum.reg.get('core', 'common/models/Post')\"","webpack://@flarum/mentions/external root \"flarum.reg.get('core', 'common/models/User')\"","webpack://@flarum/mentions/external root \"flarum.reg.get('core', 'forum/components/PostsUserPage')\"","webpack://@flarum/mentions/./src/forum/components/MentionsUserPage.js","webpack://@flarum/mentions/./src/forum/extend.ts","webpack://@flarum/mentions/./src/forum/utils/textFormatter.js","webpack://@flarum/mentions/./src/forum/extenders/Mentionables.ts","webpack://@flarum/mentions/./src/forum/index.js","webpack://@flarum/mentions/./src/forum/addPostMentionPreviews.js","webpack://@flarum/mentions/./src/forum/addMentionedByList.js","webpack://@flarum/mentions/./src/forum/addPostReplyAction.js","webpack://@flarum/mentions/./src/forum/addPostQuoteButton.js","webpack://@flarum/mentions/./src/forum/addComposerAutocomplete.js"],"sourcesContent":["// The require scope\nvar __webpack_require__ = {};\n\n","// getDefaultExport function for compatibility with non-harmony modules\n__webpack_require__.n = (module) => {\n\tvar getter = module && module.__esModule ?\n\t\t() => (module['default']) :\n\t\t() => (module);\n\t__webpack_require__.d(getter, { a: getter });\n\treturn getter;\n};","// define getter functions for harmony exports\n__webpack_require__.d = (exports, definition) => {\n\tfor(var key in definition) {\n\t\tif(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {\n\t\t\tObject.defineProperty(exports, key, { enumerable: true, get: definition[key] });\n\t\t}\n\t}\n};","__webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))","// define __esModule on exports\n__webpack_require__.r = (exports) => {\n\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n\t}\n\tObject.defineProperty(exports, '__esModule', { value: true });\n};","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.reg.get('core', 'common/extend');","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.reg.get('core', 'forum/app');","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.reg.get('core', 'common/utils/string');","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.reg.get('core', 'common/helpers/textContrastClass');","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.reg.get('core', 'forum/components/Post');","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.reg.get('core', 'forum/components/CommentPost');","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.reg.get('core', 'forum/components/PostPreview');","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.reg.get('core', 'common/components/LoadingIndicator');","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.reg.get('core', 'common/components/Link');","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.reg.get('core', 'common/helpers/punctuateSeries');","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.reg.get('core', 'common/helpers/username');","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.reg.get('core', 'common/components/Icon');","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.reg.get('core', 'common/components/Button');","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.reg.get('core', 'common/components/Modal');","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.reg.get('core', 'common/states/PaginatedListState');","import PaginatedListState from 'flarum/common/states/PaginatedListState';\nexport default class MentionedByModalState extends PaginatedListState {\n constructor(params, page) {\n if (page === void 0) {\n page = 1;\n }\n const limit = 10;\n params.page = {\n ...(params.page || {}),\n limit\n };\n super(params, page, limit);\n }\n get type() {\n return 'posts';\n }\n}\nflarum.reg.add('flarum-mentions', 'forum/state/MentionedByModalState', MentionedByModalState);","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.reg.get('core', 'common/components/Form');","import app from 'flarum/forum/app';\nimport PostPreview from 'flarum/forum/components/PostPreview';\nimport Modal from 'flarum/common/components/Modal';\nimport LoadingIndicator from 'flarum/common/components/LoadingIndicator';\nimport Button from 'flarum/common/components/Button';\nimport MentionedByModalState from '../state/MentionedByModalState';\nimport Form from 'flarum/common/components/Form';\nexport default class MentionedByModal extends Modal {\n oninit(vnode) {\n super.oninit(vnode);\n this.state = new MentionedByModalState({\n filter: {\n mentionedPost: this.attrs.post.id()\n },\n sort: 'number'\n });\n this.state.refresh();\n }\n className() {\n return 'MentionedByModal';\n }\n title() {\n return app.translator.trans('flarum-mentions.forum.mentioned_by.title');\n }\n content() {\n return m('[', null, m(\"div\", {\n className: \"Modal-body\"\n }, this.state.isInitialLoading() ? m(LoadingIndicator, null) : m('[', null, m(\"ul\", {\n className: \"MentionedByModal-list Dropdown-menu Dropdown-menu--inline Post-mentionedBy-preview\"\n }, this.state.getPages().map(page => page.items.map(reply => m(\"li\", {\n \"data-number\": reply.number()\n }, m(PostPreview, {\n post: reply,\n onclick: () => app.modal.close()\n }))))))), this.state.hasNext() && m(\"div\", {\n className: \"Modal-footer\"\n }, m(Form, {\n className: \"Form--centered\"\n }, m(\"div\", {\n className: \"Form-group\"\n }, m(Button, {\n className: \"Button Button--block\",\n onclick: () => this.state.loadNext(),\n loading: this.state.isLoadingNext()\n }, app.translator.trans('flarum-mentions.forum.mentioned_by.load_more_button'))))));\n }\n}\nflarum.reg.add('flarum-mentions', 'forum/components/MentionedByModal', MentionedByModal);","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.reg.get('core', 'forum/utils/DiscussionControls');","import app from 'flarum/forum/app';\nimport DiscussionControls from 'flarum/forum/utils/DiscussionControls';\nexport function insertMention(post, composer, quote) {\n return new Promise(resolve => {\n const mention = app.mentionFormats.mentionable('post').replacement(post) + ' ';\n\n // If the composer is empty, then assume we're starting a new reply.\n // In which case we don't want the user to have to confirm if they\n // close the composer straight away.\n if (!composer.fields.content()) {\n composer.body.attrs.originalContent = mention;\n }\n const cursorPosition = composer.editor.getSelectionRange()[0];\n const preceding = composer.fields.content().slice(0, cursorPosition);\n const precedingNewlines = preceding.length == 0 ? 0 : 3 - preceding.match(/(\\n{0,2})$/)[0].length;\n composer.editor.insertAtCursor(Array(precedingNewlines).join('\\n') + (\n // Insert up to two newlines, depending on preceding whitespace\n quote ? '> ' + mention + quote.trim().replace(/\\n/g, '\\n> ') + '\\n\\n' : mention), false);\n return resolve(composer);\n });\n}\nexport default function reply(post, quote) {\n const EditPostComposer = flarum.reg.checkModule('core', 'forum/components/EditPostComposer');\n if (EditPostComposer && app.composer.bodyMatches(EditPostComposer) && app.composer.body.attrs.post.discussion() === post.discussion()) {\n // If we're already editing a post in the discussion of post we're quoting,\n // insert the mention directly.\n return insertMention(post, app.composer, quote);\n } else {\n // The default \"Reply\" action behavior will only open a new composer if\n // necessary, but it will always be a ReplyComposer, hence the exceptional\n // case above.\n return DiscussionControls.replyAction.call(post.discussion()).then(composer => insertMention(post, composer, quote));\n }\n}\nflarum.reg.add('flarum-mentions', 'forum/utils/reply', reply);","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.reg.get('core', 'common/Fragment');","import app from 'flarum/forum/app';\nimport Fragment from 'flarum/common/Fragment';\nimport Icon from 'flarum/common/components/Icon';\nimport reply from '../utils/reply';\nexport default class PostQuoteButton extends Fragment {\n constructor(post) {\n super();\n this.post = post;\n }\n view() {\n return m(\"button\", {\n className: \"Button PostQuoteButton\",\n onclick: () => {\n reply(this.post, this.content);\n }\n }, m(Icon, {\n name: \"fas fa-quote-left\",\n className: \"Button-icon\"\n }), app.translator.trans('flarum-mentions.forum.post.quote_button'));\n }\n show(left, top) {\n const $this = this.$().show();\n const parentOffset = $this.offsetParent().offset();\n $this.css('left', left - parentOffset.left).css('top', top - parentOffset.top);\n this.hideHandler = this.hide.bind(this);\n $(document).on('mouseup', this.hideHandler);\n }\n showStart(left, top) {\n const $this = this.$();\n this.show(left, $(window).scrollTop() + top - $this.outerHeight() - 5);\n }\n showEnd(right, bottom) {\n const $this = this.$();\n this.show(right - $this.outerWidth(), $(window).scrollTop() + bottom + 5);\n }\n hide() {\n this.$().hide();\n $(document).off('mouseup', this.hideHandler);\n }\n}\nflarum.reg.add('flarum-mentions', 'forum/fragments/PostQuoteButton', PostQuoteButton);","/**\n * Finds the selected text in the provided composer body.\n */\nexport default function selectedText(body) {\n const selection = window.getSelection();\n if (!selection.isCollapsed) {\n const range = selection.getRangeAt(0);\n const parent = range.commonAncestorContainer;\n if (body[0] === parent || $.contains(body[0], parent)) {\n const clone = $('
').append(range.cloneContents());\n\n // Replace emoji images with their shortcode (found in alt attribute)\n clone.find('img.emoji').replaceWith(function () {\n return this.alt;\n });\n\n // Replace all other images with a Markdown image\n clone.find('img').replaceWith(function () {\n return \"\");\n });\n\n // Replace all links with a Markdown link\n clone.find('a').replaceWith(function () {\n return \"[\".concat(this.innerText, \"](\").concat(this.href, \")\");\n });\n return clone.text();\n }\n }\n return '';\n}\nflarum.reg.add('flarum-mentions', 'forum/utils/selectedText', selectedText);","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.reg.get('core', 'common/components/TextEditorButton');","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.reg.get('core', 'common/utils/KeyboardNavigatable');","export default function _typeof(obj) {\n \"@babel/helpers - typeof\";\n\n return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (obj) {\n return typeof obj;\n } : function (obj) {\n return obj && \"function\" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj;\n }, _typeof(obj);\n}","import toPropertyKey from \"./toPropertyKey.js\";\nexport default function _defineProperty(obj, key, value) {\n key = toPropertyKey(key);\n if (key in obj) {\n Object.defineProperty(obj, key, {\n value: value,\n enumerable: true,\n configurable: true,\n writable: true\n });\n } else {\n obj[key] = value;\n }\n return obj;\n}","import _typeof from \"./typeof.js\";\nimport toPrimitive from \"./toPrimitive.js\";\nexport default function _toPropertyKey(arg) {\n var key = toPrimitive(arg, \"string\");\n return _typeof(key) === \"symbol\" ? key : String(key);\n}","import _typeof from \"./typeof.js\";\nexport default function _toPrimitive(input, hint) {\n if (_typeof(input) !== \"object\" || input === null) return input;\n var prim = input[Symbol.toPrimitive];\n if (prim !== undefined) {\n var res = prim.call(input, hint || \"default\");\n if (_typeof(res) !== \"object\") return res;\n throw new TypeError(\"@@toPrimitive must return a primitive value.\");\n }\n return (hint === \"string\" ? String : Number)(input);\n}","import _defineProperty from \"@babel/runtime/helpers/esm/defineProperty\";\nimport Fragment from 'flarum/common/Fragment';\nexport default class AutocompleteDropdown extends Fragment {\n constructor() {\n super(...arguments);\n _defineProperty(this, \"items\", []);\n _defineProperty(this, \"active\", false);\n _defineProperty(this, \"index\", 0);\n _defineProperty(this, \"keyWasJustPressed\", false);\n }\n view() {\n return m(\"ul\", {\n className: \"Dropdown-menu MentionsDropdown\"\n }, this.items.map(item => m(\"li\", null, item)));\n }\n show(left, top) {\n this.$().show().css({\n left: left + 'px',\n top: top + 'px'\n });\n this.active = true;\n }\n hide() {\n this.$().hide();\n this.active = false;\n }\n navigate(delta) {\n this.keyWasJustPressed = true;\n this.setIndex(this.index + delta, true);\n clearTimeout(this.keyWasJustPressedTimeout);\n this.keyWasJustPressedTimeout = setTimeout(() => this.keyWasJustPressed = false, 500);\n }\n complete() {\n this.$('li').eq(this.index).find('button').click();\n }\n setIndex(index, scrollToItem) {\n if (this.keyWasJustPressed && !scrollToItem) return;\n const $dropdown = this.$();\n const $items = $dropdown.find('li');\n let rangedIndex = index;\n if (rangedIndex < 0) {\n rangedIndex = $items.length - 1;\n } else if (rangedIndex >= $items.length) {\n rangedIndex = 0;\n }\n this.index = rangedIndex;\n const $item = $items.removeClass('active').eq(rangedIndex).addClass('active');\n if (scrollToItem) {\n const dropdownScroll = $dropdown.scrollTop();\n const dropdownTop = $dropdown.offset().top;\n const dropdownBottom = dropdownTop + $dropdown.outerHeight();\n const itemTop = $item.offset().top;\n const itemBottom = itemTop + $item.outerHeight();\n let scrollTop;\n if (itemTop < dropdownTop) {\n scrollTop = dropdownScroll - dropdownTop + itemTop - parseInt($dropdown.css('padding-top'), 10);\n } else if (itemBottom > dropdownBottom) {\n scrollTop = dropdownScroll - dropdownBottom + itemBottom + parseInt($dropdown.css('padding-bottom'), 10);\n }\n if (typeof scrollTop !== 'undefined') {\n $dropdown.stop(true).animate({\n scrollTop\n }, 100);\n }\n }\n }\n}\nflarum.reg.add('flarum-mentions', 'forum/fragments/AutocompleteDropdown', AutocompleteDropdown);","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.reg.get('core', 'common/Component');","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.reg.get('core', 'common/utils/classList');","import Component from 'flarum/common/Component';\nimport classList from 'flarum/common/utils/classList';\nexport default class MentionsDropdownItem extends Component {\n view(vnode) {\n const {\n mentionable,\n ...attrs\n } = this.attrs;\n const className = classList('MentionsDropdownItem', 'PostPreview', \"MentionsDropdown-\".concat(mentionable.type()));\n return m(\"button\", Object.assign({\n className: className\n }, attrs), m(\"span\", {\n className: \"PostPreview-content\"\n }, vnode.children));\n }\n}\nflarum.reg.add('flarum-mentions', 'forum/components/MentionsDropdownItem', MentionsDropdownItem);","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.reg.get('core', 'common/utils/throttleDebounce');","import _defineProperty from \"@babel/runtime/helpers/esm/defineProperty\";\nimport MentionsDropdownItem from '../components/MentionsDropdownItem';\nimport { throttle } from 'flarum/common/utils/throttleDebounce';\nexport default class MentionableModels {\n constructor(dropdownItemAttrs) {\n _defineProperty(this, \"mentionables\", void 0);\n /**\n * We store models returned from an API here to preserve order in which they are returned\n * This prevents the list jumping around while models are returned.\n * We also use a hashmap for model IDs to provide O(1) lookup for the users already in the list.\n */\n _defineProperty(this, \"results\", {});\n _defineProperty(this, \"typed\", null);\n _defineProperty(this, \"searched\", []);\n _defineProperty(this, \"dropdownItemAttrs\", {});\n /**\n * Don't send API calls searching for models until at least 2 characters have been typed.\n * This focuses the mention results on models already loaded.\n */\n _defineProperty(this, \"search\", throttle(250, async () => {\n if (!this.typed || this.typed.length <= 1) return;\n const typedLower = this.typed.toLowerCase();\n if (this.searched.includes(typedLower)) return;\n for (const mentionable of this.mentionables) {\n for (const model of await mentionable.search(typedLower)) {\n if (!this.results[mentionable.type()].has(model.id())) {\n this.results[mentionable.type()].set(model.id(), model);\n }\n }\n }\n this.searched.push(typedLower);\n return Promise.resolve();\n }));\n this.dropdownItemAttrs = dropdownItemAttrs;\n }\n init(mentionables) {\n this.typed = null;\n this.mentionables = mentionables;\n for (const mentionable of this.mentionables) {\n this.results[mentionable.type()] = new Map(mentionable.initialResults().map(result => [result.id(), result]));\n }\n }\n matches(mentionable, model) {\n var _this$typed;\n return mentionable.matches(model, ((_this$typed = this.typed) == null ? void 0 : _this$typed.toLowerCase()) || '');\n }\n makeSuggestion(mentionable, model) {\n const content = mentionable.suggestion(model, this.typed);\n const replacement = mentionable.replacement(model);\n const {\n onclick,\n ...attrs\n } = this.dropdownItemAttrs;\n return m(MentionsDropdownItem, Object.assign({\n mentionable: mentionable,\n onclick: () => onclick(replacement)\n }, attrs), content);\n }\n buildSuggestions() {\n const suggestions = [];\n for (const mentionable of this.mentionables) {\n if (!mentionable.enabled()) continue;\n let matches = Array.from(this.results[mentionable.type()].values()).filter(model => this.matches(mentionable, model));\n const max = mentionable.maxStoreMatchedResults();\n if (max) matches = matches.splice(0, max);\n for (const model of matches) {\n const dropdownItem = this.makeSuggestion(mentionable, model);\n suggestions.push(dropdownItem);\n }\n }\n return suggestions;\n }\n}\nflarum.reg.add('flarum-mentions', 'forum/mentionables/MentionableModels', MentionableModels);","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.reg.get('core', 'forum/components/Notification');","import app from 'flarum/forum/app';\nimport Notification from 'flarum/forum/components/Notification';\nimport { truncate } from 'flarum/common/utils/string';\nexport default class PostMentionedNotification extends Notification {\n icon() {\n return 'fas fa-reply';\n }\n href() {\n const notification = this.attrs.notification;\n const post = notification.subject();\n const content = notification.content();\n return app.route.discussion(post.discussion(), content && content.replyNumber);\n }\n content() {\n const notification = this.attrs.notification;\n const user = notification.fromUser();\n return app.translator.trans('flarum-mentions.forum.notifications.post_mentioned_text', {\n user,\n count: 1\n });\n }\n excerpt() {\n return truncate(this.attrs.notification.subject().contentPlain() || '', 200);\n }\n}\nflarum.reg.add('flarum-mentions', 'forum/components/PostMentionedNotification', PostMentionedNotification);","import app from 'flarum/forum/app';\nimport Notification from 'flarum/forum/components/Notification';\nimport { truncate } from 'flarum/common/utils/string';\nexport default class UserMentionedNotification extends Notification {\n icon() {\n return 'fas fa-at';\n }\n href() {\n const post = this.attrs.notification.subject();\n return app.route.discussion(post.discussion(), post.number());\n }\n content() {\n const user = this.attrs.notification.fromUser();\n return app.translator.trans('flarum-mentions.forum.notifications.user_mentioned_text', {\n user\n });\n }\n excerpt() {\n return truncate(this.attrs.notification.subject().contentPlain(), 200);\n }\n}\nflarum.reg.add('flarum-mentions', 'forum/components/UserMentionedNotification', UserMentionedNotification);","import app from 'flarum/forum/app';\nimport Notification from 'flarum/forum/components/Notification';\nimport { truncate } from 'flarum/common/utils/string';\nexport default class GroupMentionedNotification extends Notification {\n icon() {\n return 'fas fa-at';\n }\n href() {\n const post = this.attrs.notification.subject();\n return app.route.discussion(post.discussion(), post.number());\n }\n content() {\n const user = this.attrs.notification.fromUser();\n return app.translator.trans('flarum-mentions.forum.notifications.group_mentioned_text', {\n user\n });\n }\n excerpt() {\n return truncate(this.attrs.notification.subject().contentPlain(), 200);\n }\n}\nflarum.reg.add('flarum-mentions', 'forum/components/GroupMentionedNotification', GroupMentionedNotification);","import _defineProperty from \"@babel/runtime/helpers/esm/defineProperty\";\nexport default class MentionFormat {\n constructor() {\n _defineProperty(this, \"instances\", void 0);\n _defineProperty(this, \"mentionables\", void 0);\n _defineProperty(this, \"extendable\", void 0);\n }\n makeMentionables() {\n var _this$instances;\n return (_this$instances = this.instances) != null ? _this$instances : this.instances = this.mentionables.map(Mentionable => new Mentionable(this));\n }\n getMentionable(type) {\n var _this$makeMentionable;\n return (_this$makeMentionable = this.makeMentionables().find(mentionable => mentionable.type() === type)) != null ? _this$makeMentionable : null;\n }\n extend(mentionable) {\n if (!this.extendable) throw new Error('This mention format does not allow extending.');\n this.mentionables.push(mentionable);\n }\n\n /**\n * Picks the term to search in the API from the typed text.\n * @example:\n * * Full text = `Hello @\"John D`\n * * Typed text = `\"John D`\n * * Query = `John D`\n */\n}\nflarum.reg.add('flarum-mentions', 'forum/mentionables/formats/MentionFormat', MentionFormat);","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.reg.get('core', 'common/components/Avatar');","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.reg.get('core', 'common/helpers/highlight');","import _defineProperty from \"@babel/runtime/helpers/esm/defineProperty\";\nexport default class MentionableModel {\n constructor(format) {\n _defineProperty(this, \"format\", void 0);\n this.format = format;\n }\n}\nflarum.reg.add('flarum-mentions', 'forum/mentionables/MentionableModel', MentionableModel);","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.reg.get('core', 'common/utils/extractText');","import app from 'flarum/forum/app';\nimport extractText from 'flarum/common/utils/extractText';\n\n/**\n * Whether to use the old mentions format.\n *\n * `'@username'` or `'@\"Display name\"'`\n */\nexport const shouldUseOldFormat = () => app.forum.attribute('allowUsernameMentionFormat') || false;\nconst getDeletedUserText = () => extractText(app.translator.trans('core.lib.username.deleted_text'));\n\n/**\n * Fetches a user's username or display name.\n *\n * Chooses based on the format option set in the admin settings page.\n *\n * @param user An instance of the User model to fetch the username for\n * @param useDisplayName If `true`, uses `user.displayName()`, otherwise, uses `user.username()`\n */\nexport default function getCleanDisplayName(user, useDisplayName) {\n if (useDisplayName === void 0) {\n useDisplayName = true;\n }\n if (!user) return getDeletedUserText().replace(/\"#[a-z]{0,3}[0-9]+/, '_');\n const text = (useDisplayName ? user.displayName() : user.username()) || getDeletedUserText();\n return text.replace(/\"#[a-z]{0,3}[0-9]+/, '_');\n}\nflarum.reg.add('flarum-mentions', 'forum/utils/getCleanDisplayName', getCleanDisplayName);","import app from 'flarum/forum/app';\nimport usernameHelper from 'flarum/common/helpers/username';\nimport Avatar from 'flarum/common/components/Avatar';\nimport highlight from 'flarum/common/helpers/highlight';\nimport MentionableModel from './MentionableModel';\nimport getCleanDisplayName, { shouldUseOldFormat } from '../utils/getCleanDisplayName';\nexport default class UserMention extends MentionableModel {\n type() {\n return 'user';\n }\n initialResults() {\n return Array.from(app.store.all('users'));\n }\n\n /**\n * Automatically determines which mention syntax to be used based on the option in the\n * admin dashboard. Also performs display name clean-up automatically.\n *\n * @\"Display name\"#UserID or `@username`\n *\n * @example
New display name syntax
\n * // '@\"user\"#1'\n * forUser(User) // User is ID 1, display name is 'User'\n *\n * @example
Using old syntax
\n * // '@username'\n * forUser(user) // User's username is 'username'\n */\n replacement(user) {\n if (shouldUseOldFormat()) {\n const cleanText = getCleanDisplayName(user, false);\n return this.format.format(cleanText);\n }\n const cleanText = getCleanDisplayName(user);\n return this.format.format(cleanText, '', user.id());\n }\n suggestion(model, typed) {\n const username = usernameHelper(model, name => highlight(name, typed));\n return m('[', null, m(Avatar, {\n user: model\n }), username);\n }\n matches(model, typed) {\n if (!typed) return false;\n const names = [model.username(), model.displayName()];\n return names.some(name => name.toLowerCase().substr(0, typed.length) === typed);\n }\n maxStoreMatchedResults() {\n return null;\n }\n async search(typed) {\n return await app.store.find('users', {\n filter: {\n q: typed\n },\n page: {\n limit: 5\n }\n });\n }\n enabled() {\n return true;\n }\n}\nflarum.reg.add('flarum-mentions', 'forum/mentionables/UserMention', UserMention);","import app from 'flarum/forum/app';\nimport MentionableModel from './MentionableModel';\nimport usernameHelper from 'flarum/common/helpers/username';\nimport Avatar from 'flarum/common/components/Avatar';\nimport highlight from 'flarum/common/helpers/highlight';\nimport { truncate } from 'flarum/common/utils/string';\nimport getCleanDisplayName from '../utils/getCleanDisplayName';\nexport default class PostMention extends MentionableModel {\n type() {\n return 'post';\n }\n\n /**\n * If the user is replying to a discussion, or if they are editing a\n * post, then we can suggest other posts in the discussion to mention.\n * We will add the 5 most recent comments in the discussion which\n * match any username characters that have been typed.\n */\n initialResults() {\n const EditPostComposer = flarum.reg.checkModule('core', 'forum/components/EditPostComposer');\n const ReplyComposer = flarum.reg.checkModule('core', 'forum/components/ReplyComposer');\n if ((!ReplyComposer || !app.composer.bodyMatches(ReplyComposer)) && (!EditPostComposer || !app.composer.bodyMatches(EditPostComposer))) {\n return [];\n }\n\n // @ts-ignore\n const composerAttrs = app.composer.body.attrs;\n const composerPost = composerAttrs.post;\n const discussion = composerPost && composerPost.discussion() || composerAttrs.discussion;\n return discussion.posts()\n // Filter to only comment posts, and replies before this message\n .filter(post => post && post.contentType() === 'comment' && (!composerPost || post.number() < composerPost.number()))\n // Sort by new to old\n .sort((a, b) => b.createdAt().getTime() - a.createdAt().getTime());\n }\n\n /**\n * Generates the syntax for mentioning of a post. Also cleans up the display name.\n *\n * @example
Post mention
\n * // '@\"User\"#p13'\n * // @\"Display name\"#pPostID\n * forPostMention(user, 13) // User display name is 'User', post ID is 13\n */\n replacement(post) {\n const user = post.user();\n const cleanText = getCleanDisplayName(user);\n return this.format.format(cleanText, 'p', post.id());\n }\n suggestion(model, typed) {\n var _model$contentPlain;\n const user = model.user() || null;\n const username = usernameHelper(user, name => highlight(name, typed));\n return m('[', null, m(Avatar, {\n user: user\n }), username, [app.translator.trans('flarum-mentions.forum.composer.reply_to_post_text', {\n number: model.number()\n }), ' — ', truncate((_model$contentPlain = model.contentPlain()) != null ? _model$contentPlain : '', 200)]);\n }\n matches(model, typed) {\n const user = model.user();\n const userMentionable = app.mentionFormats.mentionable('user');\n return !typed || user && userMentionable.matches(user, typed);\n }\n maxStoreMatchedResults() {\n return 5;\n }\n\n /**\n * Post mention suggestions are only offered from current discussion posts.\n */\n search(typed) {\n return Promise.resolve([]);\n }\n enabled() {\n return true;\n }\n}\nflarum.reg.add('flarum-mentions', 'forum/mentionables/PostMention', PostMention);","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.reg.get('core', 'common/models/Group');","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.reg.get('core', 'common/components/Badge');","import app from 'flarum/forum/app';\nimport Group from 'flarum/common/models/Group';\nimport MentionableModel from './MentionableModel';\nimport Badge from 'flarum/common/components/Badge';\nimport highlight from 'flarum/common/helpers/highlight';\nexport default class GroupMention extends MentionableModel {\n type() {\n return 'group';\n }\n initialResults() {\n return Array.from(app.store.all('groups').filter(g => {\n return g.id() !== Group.GUEST_ID && g.id() !== Group.MEMBER_ID;\n }));\n }\n\n /**\n * Generates the mention syntax for a group mention.\n *\n * @\"Name Plural\"#gGroupID\n *\n * @example
Group mention
\n * // '@\"Mods\"#g4'\n * forGroup(group) // Group display name is 'Mods', group ID is 4\n */\n replacement(group) {\n return this.format.format(group.namePlural(), 'g', group.id());\n }\n suggestion(model, typed) {\n let groupName = model.namePlural();\n if (typed) {\n groupName = highlight(groupName, typed);\n }\n return m('[', null, m(Badge, {\n className: \"Avatar Badge Badge--group--\".concat(model.id(), \" Badge-icon\"),\n color: model.color(),\n type: \"group\",\n icon: model.icon()\n }), m(\"span\", {\n className: \"username\"\n }, groupName));\n }\n matches(model, typed) {\n if (!typed) return false;\n const names = [model.namePlural().toLowerCase(), model.nameSingular().toLowerCase()];\n return names.some(name => name.toLowerCase().substr(0, typed.length) === typed);\n }\n maxStoreMatchedResults() {\n return null;\n }\n\n /**\n * All groups are already loaded, so we don't need to search for them.\n */\n search(typed) {\n return Promise.resolve([]);\n }\n enabled() {\n var _app$session$user$can, _app$session, _app$session$user;\n return (_app$session$user$can = (_app$session = app.session) == null ? void 0 : (_app$session$user = _app$session.user) == null ? void 0 : _app$session$user.canMentionGroups()) != null ? _app$session$user$can : false;\n }\n}\nflarum.reg.add('flarum-mentions', 'forum/mentionables/GroupMention', GroupMention);","import _defineProperty from \"@babel/runtime/helpers/esm/defineProperty\";\nimport MentionFormat from './MentionFormat';\nimport UserMention from '../UserMention';\nimport PostMention from '../PostMention';\nimport GroupMention from '../GroupMention';\nexport default class AtMentionFormat extends MentionFormat {\n constructor() {\n super(...arguments);\n _defineProperty(this, \"mentionables\", [UserMention, PostMention, GroupMention]);\n _defineProperty(this, \"extendable\", true);\n }\n trigger() {\n return '@';\n }\n queryFromTyped(typed) {\n const matchTyped = typed.match(/^[\"“]?((?:(?!\"#).)+)$/);\n return matchTyped ? matchTyped[1] : null;\n }\n format(name, char, id) {\n if (char === void 0) {\n char = '';\n }\n if (id === void 0) {\n id = null;\n }\n return {\n simple: \"@\".concat(name),\n safe: \"@\\\"\".concat(name, \"\\\"#\").concat(char).concat(id)\n }[id ? 'safe' : 'simple'];\n }\n}\nflarum.reg.add('flarum-mentions', 'forum/mentionables/formats/AtMentionFormat', AtMentionFormat);","import app from 'flarum/forum/app';\nimport Badge from 'flarum/common/components/Badge';\nimport highlight from 'flarum/common/helpers/highlight';\nimport MentionableModel from './MentionableModel';\nexport default class TagMention extends MentionableModel {\n type() {\n return 'tag';\n }\n initialResults() {\n return Array.from(app.store.all('tags'));\n }\n\n /**\n * Generates the mention syntax for a tag mention.\n *\n * ~tagSlug\n *\n * @example
Tag mention
\n * // ~general\n * forTag(tag) // Tag display name is 'Tag', tag ID is 5\n */\n replacement(tag) {\n return this.format.format(tag.slug());\n }\n matches(model, typed) {\n if (!typed) return false;\n const names = [model.name().toLowerCase()];\n return names.some(name => name.toLowerCase().substr(0, typed.length) === typed);\n }\n maxStoreMatchedResults() {\n return null;\n }\n async search(typed) {\n return await app.store.find('tags', {\n filter: {\n q: typed\n },\n page: {\n limit: 5\n }\n });\n }\n suggestion(model, typed) {\n let tagName = model.name();\n if (typed) {\n tagName = highlight(tagName, typed);\n }\n return m('[', null, m(Badge, {\n className: \"Avatar\",\n icon: model.icon(),\n color: model.color(),\n type: \"tag\"\n }), m(\"span\", {\n className: \"username\"\n }, tagName));\n }\n enabled() {\n return 'flarum-tags' in flarum.extensions;\n }\n}\nflarum.reg.add('flarum-mentions', 'forum/mentionables/TagMention', TagMention);","import _defineProperty from \"@babel/runtime/helpers/esm/defineProperty\";\nimport MentionFormat from './MentionFormat';\nimport TagMention from '../TagMention';\nexport default class HashMentionFormat extends MentionFormat {\n constructor() {\n super(...arguments);\n _defineProperty(this, \"mentionables\", [TagMention]);\n _defineProperty(this, \"extendable\", true);\n }\n trigger() {\n return '#';\n }\n queryFromTyped(typed) {\n const matchTyped = typed.match(/^[-_\\p{L}\\p{N}\\p{M}]+$/giu);\n return matchTyped ? matchTyped[0] : null;\n }\n format(slug) {\n return \"#\".concat(slug);\n }\n}\nflarum.reg.add('flarum-mentions', 'forum/mentionables/formats/HashMentionFormat', HashMentionFormat);","import _defineProperty from \"@babel/runtime/helpers/esm/defineProperty\";\nimport AtMentionFormat from './AtMentionFormat';\nimport HashMentionFormat from './HashMentionFormat';\nexport default class MentionFormats {\n constructor() {\n _defineProperty(this, \"formats\", [new AtMentionFormat(), new HashMentionFormat()]);\n }\n get(symbol) {\n var _this$formats$find;\n return (_this$formats$find = this.formats.find(f => f.trigger() === symbol)) != null ? _this$formats$find : null;\n }\n mentionable(type) {\n for (const format of this.formats) {\n const mentionable = format.getMentionable(type);\n if (mentionable) return mentionable;\n }\n return null;\n }\n extend(format) {\n this.formats.push(new format());\n }\n}\nflarum.reg.add('flarum-mentions', 'forum/mentionables/formats/MentionFormats', MentionFormats);","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.reg.get('core', 'forum/components/UserPage');","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.reg.get('core', 'common/components/LinkButton');","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.reg.get('core', 'common/extenders');","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.reg.get('core', 'common/models/Post');","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.reg.get('core', 'common/models/User');","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.reg.get('core', 'forum/components/PostsUserPage');","import app from 'flarum/forum/app';\nimport PostsUserPage from 'flarum/forum/components/PostsUserPage';\n\n/**\n * The `MentionsUserPage` component shows post which user Mentioned at\n */\nexport default class MentionsUserPage extends PostsUserPage {\n /**\n * Load a new page of the user's activity feed.\n *\n * @param {Integer} [offset] The position to start getting results from.\n * @return {Promise}\n * @protected\n */\n loadResults(offset) {\n return app.store.find('posts', {\n filter: {\n type: 'comment',\n mentioned: this.user.id()\n },\n page: {\n offset,\n limit: this.loadLimit\n },\n sort: '-createdAt'\n });\n }\n}\nflarum.reg.add('flarum-mentions', 'forum/components/MentionsUserPage', MentionsUserPage);","import Extend from 'flarum/common/extenders';\nimport Post from 'flarum/common/models/Post';\nimport User from 'flarum/common/models/User';\nimport MentionsUserPage from './components/MentionsUserPage';\nexport default [new Extend.Routes() //\n.add('user.mentions', '/u/:username/mentions', MentionsUserPage), new Extend.Model(Post) //\n.hasMany('mentionedBy').attribute('mentionedByCount'), new Extend.Model(User) //\n.attribute('canMentionGroups')];","import app from 'flarum/forum/app';\nimport username from 'flarum/common/helpers/username';\nimport extractText from 'flarum/common/utils/extractText';\nexport function filterUserMentions(tag) {\n let user;\n if (app.forum.attribute('allowUsernameMentionFormat') && tag.hasAttribute('username')) user = app.store.getBy('users', 'username', tag.getAttribute('username'));else if (tag.hasAttribute('id')) user = app.store.getById('users', tag.getAttribute('id'));\n if (user) {\n tag.setAttribute('id', user.id());\n tag.setAttribute('slug', user.slug());\n tag.setAttribute('displayname', extractText(username(user)));\n return true;\n }\n tag.invalidate();\n}\nexport function postFilterUserMentions(tag) {\n tag.setAttribute('deleted', false);\n}\nexport function filterPostMentions(tag) {\n const post = app.store.getById('posts', tag.getAttribute('id'));\n if (post) {\n tag.setAttribute('discussionid', post.discussion().id());\n tag.setAttribute('number', post.number());\n tag.setAttribute('displayname', extractText(username(post.user())));\n return true;\n }\n}\nexport function postFilterPostMentions(tag) {\n tag.setAttribute('deleted', false);\n}\nexport function filterGroupMentions(tag) {\n var _app$session, _app$session$user;\n if ((_app$session = app.session) != null && (_app$session$user = _app$session.user) != null && _app$session$user.canMentionGroups()) {\n const group = app.store.getById('groups', tag.getAttribute('id'));\n if (group) {\n tag.setAttribute('groupname', extractText(group.namePlural()));\n return true;\n }\n }\n tag.invalidate();\n}\nexport function postFilterGroupMentions(tag) {\n var _app$session2, _app$session2$user;\n if ((_app$session2 = app.session) != null && (_app$session2$user = _app$session2.user) != null && _app$session2$user.canMentionGroups()) {\n const group = app.store.getById('groups', tag.getAttribute('id'));\n tag.setAttribute('color', group.color());\n tag.setAttribute('icon', group.icon());\n tag.setAttribute('deleted', false);\n }\n}\nexport function filterTagMentions(tag) {\n if ('flarum-tags' in flarum.extensions) {\n const model = app.store.getBy('tags', 'slug', tag.getAttribute('slug'));\n if (model) {\n tag.setAttribute('id', model.id());\n tag.setAttribute('tagname', model.name());\n return true;\n }\n }\n tag.invalidate();\n}\nexport function postFilterTagMentions(tag) {\n if ('flarum-tags' in flarum.extensions) {\n const model = app.store.getBy('tags', 'slug', tag.getAttribute('slug'));\n tag.setAttribute('icon', model.icon());\n tag.setAttribute('color', model.color());\n tag.setAttribute('deleted', false);\n }\n}\nflarum.reg.add('flarum-mentions', 'forum/utils/textFormatter', { filterUserMentions: filterUserMentions,postFilterUserMentions: postFilterUserMentions,filterPostMentions: filterPostMentions,postFilterPostMentions: postFilterPostMentions,filterGroupMentions: filterGroupMentions,postFilterGroupMentions: postFilterGroupMentions,filterTagMentions: filterTagMentions,postFilterTagMentions: postFilterTagMentions, });","import _defineProperty from \"@babel/runtime/helpers/esm/defineProperty\";\nexport default class Mentionables {\n constructor() {\n _defineProperty(this, \"formats\", []);\n _defineProperty(this, \"mentionables\", {});\n }\n /**\n * Register a new mention format.\n * Must extend MentionFormat and have a unique unused trigger symbol.\n */\n format(format) {\n this.formats.push(format);\n return this;\n }\n\n /**\n * Register a new mentionable model to a mention format.\n * Only works if the format has already been registered,\n * and the format allows using multiple mentionables.\n *\n * @param symbol The trigger symbol of the format to extend (ex: @).\n * @param mentionable The mentionable instance to register.\n * Must extend MentionableModel.\n */\n mentionable(symbol, mentionable) {\n if (!this.mentionables[symbol]) {\n this.mentionables[symbol] = [];\n }\n this.mentionables[symbol].push(mentionable);\n return this;\n }\n extend(app) {\n for (const format of this.formats) {\n app.mentionFormats.extend(format);\n }\n for (const symbol in this.mentionables) {\n const format = app.mentionFormats.get(symbol);\n if (!format) continue;\n for (const mentionable of this.mentionables[symbol]) {\n format.extend(mentionable);\n }\n }\n }\n}\nflarum.reg.add('flarum-mentions', 'forum/extenders/Mentionables', Mentionables);","import { extend } from 'flarum/common/extend';\nimport app from 'flarum/forum/app';\nimport { getPlainContent } from 'flarum/common/utils/string';\nimport textContrastClass from 'flarum/common/helpers/textContrastClass';\nimport Post from 'flarum/forum/components/Post';\nimport addPostMentionPreviews from './addPostMentionPreviews';\nimport addMentionedByList from './addMentionedByList';\nimport addPostReplyAction from './addPostReplyAction';\nimport addPostQuoteButton from './addPostQuoteButton';\nimport addComposerAutocomplete from './addComposerAutocomplete';\nimport PostMentionedNotification from './components/PostMentionedNotification';\nimport UserMentionedNotification from './components/UserMentionedNotification';\nimport GroupMentionedNotification from './components/GroupMentionedNotification';\nimport MentionFormats from './mentionables/formats/MentionFormats';\nimport UserPage from 'flarum/forum/components/UserPage';\nimport LinkButton from 'flarum/common/components/LinkButton';\napp.mentionFormats = new MentionFormats();\nexport { default as extend } from './extend';\napp.initializers.add('flarum-mentions', function () {\n // For every mention of a post inside a post's content, set up a hover handler\n // that shows a preview of the mentioned post.\n addPostMentionPreviews();\n\n // In the footer of each post, show information about who has replied (i.e.\n // who the post has been mentioned by).\n addMentionedByList();\n\n // Add a 'reply' control to the footer of each post. When clicked, it will\n // open up the composer and add a post mention to its contents.\n addPostReplyAction();\n\n // Show a Quote button when Post text is selected\n addPostQuoteButton();\n\n // After typing '@' in the composer, show a dropdown suggesting a bunch of\n // posts or users that the user could mention.\n addComposerAutocomplete();\n app.notificationComponents.postMentioned = PostMentionedNotification;\n app.notificationComponents.userMentioned = UserMentionedNotification;\n app.notificationComponents.groupMentioned = GroupMentionedNotification;\n\n // Add notification preferences.\n extend('flarum/forum/components/NotificationGrid', 'notificationTypes', function (items) {\n items.add('postMentioned', {\n name: 'postMentioned',\n icon: 'fas fa-reply',\n label: app.translator.trans('flarum-mentions.forum.settings.notify_post_mentioned_label')\n });\n items.add('userMentioned', {\n name: 'userMentioned',\n icon: 'fas fa-at',\n label: app.translator.trans('flarum-mentions.forum.settings.notify_user_mentioned_label')\n });\n items.add('groupMentioned', {\n name: 'groupMentioned',\n icon: 'fas fa-at',\n label: app.translator.trans('flarum-mentions.forum.settings.notify_group_mentioned_label')\n });\n });\n\n // Add mentions tab in user profile\n extend(UserPage.prototype, 'navItems', function (items) {\n const user = this.user;\n items.add('mentions', m(LinkButton, {\n href: app.route('user.mentions', {\n username: user.slug()\n }),\n name: \"mentions\",\n icon: \"fas fa-at\"\n }, app.translator.trans('flarum-mentions.forum.user.mentions_link')), 80);\n });\n\n // Remove post mentions when rendering post previews.\n getPlainContent.removeSelectors.push('a.PostMention');\n\n // Apply color contrast fix on group mentions.\n extend(Post.prototype, 'oncreate', function () {\n this.$('.GroupMention--colored, .TagMention--colored').each(function () {\n this.classList.add(textContrastClass(getComputedStyle(this).getPropertyValue('--color')));\n });\n });\n});\nexport * from './utils/textFormatter';\nimport './forum';","import { extend } from 'flarum/common/extend';\nimport CommentPost from 'flarum/forum/components/CommentPost';\nimport PostPreview from 'flarum/forum/components/PostPreview';\nimport LoadingIndicator from 'flarum/common/components/LoadingIndicator';\nexport default function addPostMentionPreviews() {\n function addPreviews() {\n const contentHtml = this.attrs.post.contentHtml();\n if (contentHtml === this.oldPostContentHtml || this.isEditing()) return;\n this.oldPostContentHtml = contentHtml;\n const parentPost = this.attrs.post;\n const $parentPost = this.$();\n this.$().on('click', '.UserMention:not(.UserMention--deleted), .PostMention:not(.PostMention--deleted), .TagMention:not(.TagMention--deleted)', function (e) {\n m.route.set(this.getAttribute('href'));\n e.preventDefault();\n });\n this.$('.PostMention:not(.PostMention--deleted)').each(function () {\n const $this = $(this);\n const id = $this.data('id');\n let timeout;\n\n // Wrap the mention link in a wrapper element so that we can insert a\n // preview popup as its sibling and relatively position it.\n const $preview = $('
');\n $parentPost.append($preview);\n const getPostElement = () => {\n return $(\".PostStream-item[data-id=\\\"\".concat(id, \"\\\"]\"));\n };\n const showPreview = () => {\n // When the user hovers their mouse over the mention, look for the\n // post that it's referring to in the stream, and determine if it's\n // in the viewport. If it is, we will \"pulsate\" it.\n const $post = getPostElement();\n let visible = false;\n if ($post.length) {\n const top = $post.offset().top;\n const scrollTop = window.pageYOffset;\n if (top > scrollTop && top + $post.height() < scrollTop + $(window).height()) {\n $post.addClass('pulsate');\n visible = true;\n }\n }\n\n // Otherwise, we will show a popup preview of the post. If the post\n // hasn't yet been loaded, we will need to do that.\n if (!visible) {\n // Position the preview so that it appears above the mention.\n // (The offsetParent should be .Post-body.)\n const positionPreview = () => {\n const previewHeight = $preview.outerHeight(true);\n let offset = 0;\n\n // If the preview goes off the top of the viewport, reposition it to\n // be below the mention.\n if ($this.offset().top - previewHeight < $(window).scrollTop() + $('#header').outerHeight()) {\n offset += $this.outerHeight(true);\n } else {\n offset -= previewHeight;\n }\n $preview.show().css('top', $this.offset().top - $parentPost.offset().top + offset).css('left', $this.offsetParent().offset().left - $parentPost.offset().left).css('max-width', $this.offsetParent().width());\n };\n const showPost = post => {\n const discussion = post.discussion();\n m.render($preview[0], [discussion !== parentPost.discussion() && m(\"li\", null, m(\"span\", {\n className: \"PostMention-preview-discussion\"\n }, discussion.title())), m(\"li\", null, m(PostPreview, {\n post: post\n }))]);\n positionPreview();\n };\n const post = app.store.getById('posts', id);\n if (post && post.discussion()) {\n showPost(post);\n } else {\n m.render($preview[0], m(LoadingIndicator, null));\n app.store.find('posts', id).then(showPost);\n positionPreview();\n }\n setTimeout(() => $preview.off('transitionend').addClass('in'));\n }\n };\n const hidePreview = () => {\n getPostElement().removeClass('pulsate');\n if ($preview.hasClass('in')) {\n $preview.removeClass('in').one('transitionend', () => $preview.hide());\n }\n };\n\n // On a touch (mobile) device we cannot hover the link to reveal the preview.\n // Instead we cancel the navigation so that a click reveals the preview.\n // Users can then click on the preview to go to the post if desired.\n $this.on('touchend', e => {\n if (e.cancelable) {\n e.preventDefault();\n }\n });\n $this.add($preview).hover(() => {\n clearTimeout(timeout);\n timeout = setTimeout(showPreview, 250);\n }, () => {\n clearTimeout(timeout);\n getPostElement().removeClass('pulsate');\n timeout = setTimeout(hidePreview, 250);\n }).on('touchend', e => {\n showPreview();\n e.stopPropagation();\n });\n $(document).on('touchend', hidePreview);\n });\n }\n extend(CommentPost.prototype, 'oncreate', addPreviews);\n extend(CommentPost.prototype, 'onupdate', addPreviews);\n}","import app from 'flarum/forum/app';\nimport { extend } from 'flarum/common/extend';\nimport CommentPost from 'flarum/forum/components/CommentPost';\nimport Link from 'flarum/common/components/Link';\nimport PostPreview from 'flarum/forum/components/PostPreview';\nimport punctuateSeries from 'flarum/common/helpers/punctuateSeries';\nimport username from 'flarum/common/helpers/username';\nimport Icon from 'flarum/common/components/Icon';\nimport Button from 'flarum/common/components/Button';\nimport MentionedByModal from './components/MentionedByModal';\nexport default function addMentionedByList() {\n function hidePreview() {\n this.$('.Post-mentionedBy-preview').removeClass('in').one('transitionend', function () {\n $(this).hide();\n });\n }\n extend(CommentPost.prototype, 'oncreate', function () {\n let timeout;\n const post = this.attrs.post;\n const replies = post.mentionedBy();\n if (replies && replies.length) {\n const $preview = $('
');\n this.$().append($preview);\n const $parentPost = this.$();\n const $this = this.$('.Post-mentionedBy');\n const showPreview = () => {\n if (!$preview.hasClass('in') && $preview.is(':visible')) return;\n\n // When the user hovers their mouse over the list of people who have\n // replied to the post, render a list of reply previews into a\n // popup.\n m.render($preview[0], m('[', null, replies.map(reply => m(\"li\", {\n \"data-number\": reply.number()\n }, m(PostPreview, {\n post: reply,\n onclick: hidePreview.bind(this)\n }))), replies.length < post.mentionedByCount() && m(\"li\", {\n className: \"Post-mentionedBy-preview-more\"\n }, m(Button, {\n className: \"PostPreview Button\",\n onclick: () => {\n hidePreview.call(this);\n app.modal.show(MentionedByModal, {\n post\n });\n }\n }, m(\"span\", {\n className: \"PostPreview-content\"\n }, m(\"span\", {\n className: \"PostPreview-badge Avatar\"\n }, m(Icon, {\n name: 'fas fa-reply-all'\n })), m(\"span\", null, app.translator.trans('flarum-mentions.forum.post.mentioned_by_more_text', {\n count: post.mentionedByCount() - replies.length\n })))))));\n $preview.show().css('top', $this.offset().top - $parentPost.offset().top + $this.outerHeight(true)).css('left', $this.offsetParent().offset().left - $parentPost.offset().left).css('max-width', $parentPost.width());\n setTimeout(() => $preview.off('transitionend').addClass('in'));\n };\n $this.add($preview).hover(() => {\n clearTimeout(timeout);\n timeout = setTimeout(showPreview, 250);\n }, () => {\n clearTimeout(timeout);\n timeout = setTimeout(hidePreview, 250);\n });\n\n // Whenever the user hovers their mouse over a particular name in the\n // list of repliers, highlight the corresponding post in the preview\n // popup.\n this.$().find('.Post-mentionedBy-summary a').hover(function () {\n $preview.find('[data-number=\"' + $(this).data('number') + '\"]').addClass('active');\n }, function () {\n $preview.find('[data-number]').removeClass('active');\n });\n }\n });\n extend(CommentPost.prototype, 'footerItems', function (items) {\n const post = this.attrs.post;\n const replies = post.mentionedBy();\n if (replies && replies.length) {\n const users = [];\n const repliers = replies.sort(reply => reply.user() === app.session.user ? -1 : 0).filter(reply => {\n const user = reply.user();\n if (users.indexOf(user) === -1) {\n users.push(user);\n return true;\n }\n });\n const limit = 4;\n const overLimit = post.mentionedByCount() > limit;\n\n // Create a list of unique users who have replied. So even if a user has\n // replied twice, they will only be in this array once.\n const names = repliers.slice(0, overLimit ? limit - 1 : limit).map(reply => {\n const user = reply.user();\n return m(Link, {\n href: app.route.post(reply),\n onclick: hidePreview.bind(this),\n \"data-number\": reply.number()\n }, app.session.user === user ? app.translator.trans('flarum-mentions.forum.post.you_text') : username(user));\n });\n\n // If there are more users that we've run out of room to display, add a \"x\n // others\" name to the end of the list. Clicking on it will display a modal\n // with a full list of names.\n if (overLimit) {\n const count = post.mentionedByCount() - names.length;\n names.push(app.translator.trans('flarum-mentions.forum.post.others_text', {\n count\n }));\n }\n items.add('replies', m(\"div\", {\n className: \"Post-mentionedBy\"\n }, m(\"span\", {\n className: \"Post-mentionedBy-summary\"\n }, m(Icon, {\n name: 'fas fa-reply'\n }), app.translator.trans(\"flarum-mentions.forum.post.mentioned_by\".concat(repliers[0].user() === app.session.user ? '_self' : '', \"_text\"), {\n count: names.length,\n users: punctuateSeries(names)\n }))));\n }\n });\n}","import app from 'flarum/forum/app';\nimport { extend } from 'flarum/common/extend';\nimport Button from 'flarum/common/components/Button';\nimport CommentPost from 'flarum/forum/components/CommentPost';\nimport reply from './utils/reply';\nexport default function addPostReplyAction() {\n extend(CommentPost.prototype, 'actionItems', function (items) {\n const post = this.attrs.post;\n if (post.isHidden() || app.session.user && !post.discussion().canReply()) return;\n items.add('reply', m(Button, {\n className: \"Button Button--link\",\n onclick: () => reply(post)\n }, app.translator.trans('flarum-mentions.forum.post.reply_link')));\n });\n}","import app from 'flarum/forum/app';\nimport { extend } from 'flarum/common/extend';\nimport CommentPost from 'flarum/forum/components/CommentPost';\nimport PostQuoteButton from './fragments/PostQuoteButton';\nimport selectedText from './utils/selectedText';\nexport default function addPostQuoteButton() {\n extend(CommentPost.prototype, 'oncreate', function () {\n const post = this.attrs.post;\n if (post.isHidden() || app.session.user && !post.discussion().canReply()) return;\n const $postBody = this.$('.Post-body');\n\n // Wrap the quote button in a wrapper element so that we can render\n // button into it.\n const $container = $('');\n const button = new PostQuoteButton(post);\n const handler = function (e) {\n setTimeout(() => {\n const content = selectedText($postBody);\n if (content) {\n button.content = content;\n m.render($container[0], button.render());\n const rects = window.getSelection().getRangeAt(0).getClientRects();\n const firstRect = rects[0];\n if (e.clientY < firstRect.bottom && e.clientX - firstRect.right < firstRect.left - e.clientX) {\n button.showStart(firstRect.left, firstRect.top);\n } else {\n const lastRect = rects[rects.length - 1];\n button.showEnd(lastRect.right, lastRect.bottom);\n }\n }\n }, 1);\n };\n this.$().after($container).on('mouseup', handler);\n if ('ontouchstart' in window) {\n document.addEventListener('selectionchange', handler, false);\n }\n });\n}","import app from 'flarum/forum/app';\nimport { extend } from 'flarum/common/extend';\nimport TextEditorButton from 'flarum/common/components/TextEditorButton';\nimport KeyboardNavigatable from 'flarum/common/utils/KeyboardNavigatable';\nimport AutocompleteDropdown from './fragments/AutocompleteDropdown';\nimport MentionableModels from './mentionables/MentionableModels';\nexport default function addComposerAutocomplete() {\n const $container = $('');\n const dropdown = new AutocompleteDropdown();\n extend('flarum/common/components/TextEditor', 'onbuild', function () {\n const $editor = this.$('.TextEditor-editor').wrap('');\n this.navigator = new KeyboardNavigatable();\n this.navigator.when(() => dropdown.active).onUp(() => dropdown.navigate(-1)).onDown(() => dropdown.navigate(1)).onSelect(dropdown.complete.bind(dropdown)).onCancel(dropdown.hide.bind(dropdown)).bindTo($editor);\n $editor.after($container);\n });\n extend('flarum/common/components/TextEditor', 'buildEditorParams', function (params) {\n let relMentionStart;\n let absMentionStart;\n let matchTyped;\n let mentionables = new MentionableModels({\n onmouseenter: function () {\n dropdown.setIndex($(this).parent().index());\n },\n onclick: replacement => {\n this.attrs.composer.editor.replaceBeforeCursor(absMentionStart - 1, replacement + ' ');\n dropdown.hide();\n }\n });\n const suggestionsInputListener = () => {\n const selection = this.attrs.composer.editor.getSelectionRange();\n const cursor = selection[0];\n if (selection[1] - cursor > 0) return;\n\n // Search backwards from the cursor for a mention triggering symbol. If we find one,\n // we will want to show the correct autocomplete dropdown!\n // Check classes implementing the IMentionableModel interface to see triggering symbols.\n const lastChunk = this.attrs.composer.editor.getLastNChars(30);\n absMentionStart = 0;\n let activeFormat = null;\n for (let i = lastChunk.length - 1; i >= 0; i--) {\n const character = lastChunk.substr(i, 1);\n activeFormat = app.mentionFormats.get(character);\n if (activeFormat && (i === 0 || /\\s/.test(lastChunk.substr(i - 1, 1)))) {\n relMentionStart = i + 1;\n absMentionStart = cursor - lastChunk.length + i + 1;\n mentionables.init(activeFormat.makeMentionables());\n break;\n }\n }\n dropdown.hide();\n dropdown.active = false;\n if (absMentionStart) {\n var _mentionables$search;\n const typed = lastChunk.substring(relMentionStart).toLowerCase();\n matchTyped = activeFormat.queryFromTyped(typed);\n if (!matchTyped) return;\n mentionables.typed = matchTyped;\n const buildSuggestions = () => {\n // If the user has started to type a mention,\n // then suggest models matching.\n const suggestions = mentionables.buildSuggestions();\n if (suggestions.length) {\n dropdown.items = suggestions;\n m.render($container[0], dropdown.render());\n dropdown.show();\n const coordinates = this.attrs.composer.editor.getCaretCoordinates(absMentionStart);\n const width = dropdown.$().outerWidth();\n const height = dropdown.$().outerHeight();\n const parent = dropdown.$().offsetParent();\n let left = coordinates.left;\n let top = coordinates.top + 15;\n\n // Keep the dropdown inside the editor.\n if (top + height > parent.height()) {\n top = coordinates.top - height - 15;\n }\n if (left + width > parent.width()) {\n left = parent.width() - width;\n }\n\n // Prevent the dropdown from going off screen on mobile\n top = Math.max(-(parent.offset().top - $(document).scrollTop()), top);\n left = Math.max(-parent.offset().left, left);\n dropdown.show(left, top);\n } else {\n dropdown.active = false;\n dropdown.hide();\n }\n };\n dropdown.active = true;\n buildSuggestions();\n dropdown.setIndex(0);\n dropdown.$().scrollTop(0);\n (_mentionables$search = mentionables.search()) == null ? void 0 : _mentionables$search.then(buildSuggestions);\n }\n };\n params.inputListeners.push(suggestionsInputListener);\n });\n extend('flarum/common/components/TextEditor', 'toolbarItems', function (items) {\n items.add('mention', m(TextEditorButton, {\n onclick: () => this.attrs.composer.editor.insertAtCursor(' @'),\n icon: \"fas fa-at\"\n }, app.translator.trans('flarum-mentions.forum.composer.mention_tooltip')));\n });\n}"],"names":["__webpack_require__","module","getter","__esModule","d","a","exports","definition","key","o","Object","defineProperty","enumerable","get","obj","prop","prototype","hasOwnProperty","call","Symbol","toStringTag","value","flarum","reg","MentionedByModalState","constructor","params","page","limit","super","type","add","MentionedByModal","oninit","vnode","this","state","filter","mentionedPost","attrs","post","id","sort","refresh","className","title","content","m","isInitialLoading","getPages","map","items","reply","number","onclick","hasNext","loadNext","loading","isLoadingNext","insertMention","composer","quote","Promise","resolve","mention","replacement","fields","body","originalContent","cursorPosition","editor","getSelectionRange","preceding","slice","precedingNewlines","length","match","insertAtCursor","Array","join","trim","replace","EditPostComposer","checkModule","discussion","then","PostQuoteButton","view","name","show","left","top","$this","$","parentOffset","offsetParent","offset","css","hideHandler","hide","bind","document","on","showStart","window","scrollTop","outerHeight","showEnd","right","bottom","outerWidth","off","selectedText","selection","getSelection","isCollapsed","range","getRangeAt","parent","commonAncestorContainer","contains","clone","append","cloneContents","find","replaceWith","alt","concat","src","innerText","href","text","_typeof","iterator","_defineProperty","arg","input","hint","prim","toPrimitive","undefined","res","TypeError","String","toPropertyKey","configurable","writable","AutocompleteDropdown","arguments","item","active","navigate","delta","keyWasJustPressed","setIndex","index","clearTimeout","keyWasJustPressedTimeout","setTimeout","complete","eq","click","scrollToItem","$dropdown","$items","rangedIndex","$item","removeClass","addClass","dropdownScroll","dropdownTop","dropdownBottom","itemTop","itemBottom","parseInt","stop","animate","MentionsDropdownItem","mentionable","assign","children","MentionableModels","dropdownItemAttrs","throttle","async","typed","typedLower","toLowerCase","searched","includes","mentionables","model","search","results","has","set","push","init","Map","initialResults","result","matches","_this$typed","makeSuggestion","suggestion","buildSuggestions","suggestions","enabled","from","values","max","maxStoreMatchedResults","splice","dropdownItem","PostMentionedNotification","icon","notification","subject","replyNumber","user","fromUser","count","excerpt","truncate","contentPlain","UserMentionedNotification","GroupMentionedNotification","MentionFormat","makeMentionables","_this$instances","instances","Mentionable","getMentionable","_this$makeMentionable","extend","extendable","Error","MentionableModel","format","getDeletedUserText","getCleanDisplayName","useDisplayName","displayName","username","UserMention","cleanText","some","substr","q","PostMention","ReplyComposer","composerAttrs","composerPost","posts","contentType","b","createdAt","getTime","_model$contentPlain","userMentionable","GroupMention","g","group","namePlural","groupName","color","nameSingular","_app$session$user$can","_app$session","_app$session$user","canMentionGroups","AtMentionFormat","trigger","queryFromTyped","matchTyped","char","simple","safe","TagMention","tag","slug","tagName","extensions","HashMentionFormat","MentionFormats","symbol","_this$formats$find","formats","f","MentionsUserPage","loadResults","mentioned","loadLimit","hasMany","attribute","filterUserMentions","hasAttribute","getAttribute","setAttribute","invalidate","postFilterUserMentions","filterPostMentions","postFilterPostMentions","filterGroupMentions","postFilterGroupMentions","_app$session2","_app$session2$user","filterTagMentions","postFilterTagMentions","app","mentionFormats","addPreviews","contentHtml","oldPostContentHtml","isEditing","parentPost","$parentPost","e","route","preventDefault","each","data","timeout","$preview","getPostElement","showPreview","$post","visible","pageYOffset","height","positionPreview","previewHeight","width","showPost","render","store","getById","hidePreview","hasClass","one","cancelable","hover","stopPropagation","addPostMentionPreviews","replies","mentionedBy","is","mentionedByCount","users","repliers","indexOf","overLimit","names","addMentionedByList","isHidden","canReply","$postBody","$container","button","handler","rects","getClientRects","firstRect","clientY","clientX","lastRect","after","addEventListener","dropdown","$editor","wrap","navigator","when","onUp","onDown","onSelect","onCancel","bindTo","relMentionStart","absMentionStart","onmouseenter","replaceBeforeCursor","inputListeners","cursor","lastChunk","getLastNChars","activeFormat","i","character","test","_mentionables$search","substring","coordinates","getCaretCoordinates","Math","addComposerAutocomplete","label","getPlainContent","classList","getComputedStyle","getPropertyValue"],"sourceRoot":""}
\ No newline at end of file
diff --git a/framework/core/js/dist-typings/admin/components/LoadingModal.d.ts b/framework/core/js/dist-typings/admin/components/LoadingModal.d.ts
index 83c5a912a..a1b3248db 100644
--- a/framework/core/js/dist-typings/admin/components/LoadingModal.d.ts
+++ b/framework/core/js/dist-typings/admin/components/LoadingModal.d.ts
@@ -3,10 +3,9 @@ import Modal, { IInternalModalAttrs } from '../../common/components/Modal';
export interface ILoadingModalAttrs extends IInternalModalAttrs {
}
export default class LoadingModal extends Modal {
- /**
- * @inheritdoc
- */
- static readonly isDismissible: boolean;
+ protected static readonly isDismissibleViaCloseButton: boolean;
+ protected static readonly isDismissibleViaEscKey: boolean;
+ protected static readonly isDismissibleViaBackdropClick: boolean;
className(): string;
title(): import("@askvortsov/rich-icu-message-formatter").NestedStringArray;
content(): null;
diff --git a/framework/core/js/dist-typings/common/Application.d.ts b/framework/core/js/dist-typings/common/Application.d.ts
index 88dd99821..695658c37 100644
--- a/framework/core/js/dist-typings/common/Application.d.ts
+++ b/framework/core/js/dist-typings/common/Application.d.ts
@@ -20,12 +20,6 @@ export declare type FlarumGenericRoute = RouteItem;
export interface FlarumRequestOptions extends Omit, 'extract'> {
errorHandler?: (error: RequestError) => void;
url: string;
- /**
- * Manipulate the response text before it is parsed into JSON.
- *
- * @deprecated Please use `modifyText` instead.
- */
- extract?: (responseText: string) => string;
/**
* Manipulate the response text before it is parsed into JSON.
*
diff --git a/framework/core/js/dist-typings/common/Store.d.ts b/framework/core/js/dist-typings/common/Store.d.ts
index 150a50c84..28345a217 100644
--- a/framework/core/js/dist-typings/common/Store.d.ts
+++ b/framework/core/js/dist-typings/common/Store.d.ts
@@ -92,7 +92,6 @@ export default class Store {
* registered for this resource type.
*/
pushObject(data: SavedModelData): M | null;
- pushObject(data: SavedModelData, allowUnregistered: false): M;
/**
* Make a request to the API to find record(s) of a specific type.
*/
diff --git a/framework/core/js/dist-typings/common/components/Button.d.ts b/framework/core/js/dist-typings/common/components/Button.d.ts
index 1e0708062..a2092a653 100644
--- a/framework/core/js/dist-typings/common/components/Button.d.ts
+++ b/framework/core/js/dist-typings/common/components/Button.d.ts
@@ -21,18 +21,6 @@ export interface IButtonAttrs extends ComponentAttrs {
* Default: `false`
*/
loading?: boolean;
- /**
- * **DEPRECATED:** Please use the `aria-label` attribute instead. For tooltips, use
- * the `` component.
- *
- * Accessible text for the button. This should always be present if the button only
- * contains an icon.
- *
- * The textual content of this attribute is passed to the DOM element as `aria-label`.
- *
- * @deprecated
- */
- title?: string | Mithril.ChildArray;
/**
* Accessible text for the button. This should always be present if the button only
* contains an icon.
diff --git a/framework/core/js/dist-typings/common/components/Modal.d.ts b/framework/core/js/dist-typings/common/components/Modal.d.ts
index 8272a53bb..a7ff112d5 100644
--- a/framework/core/js/dist-typings/common/components/Modal.d.ts
+++ b/framework/core/js/dist-typings/common/components/Modal.d.ts
@@ -10,10 +10,6 @@ export interface IInternalModalAttrs {
animateHide: ModalManager['animateHide'];
}
export interface IDismissibleOptions {
- /**
- * @deprecated Check specific individual attributes instead. Will be removed in Flarum 2.0.
- */
- isDismissible: boolean;
viaCloseButton: boolean;
viaEscKey: boolean;
viaBackdropClick: boolean;
@@ -23,12 +19,6 @@ export interface IDismissibleOptions {
* should implement the `className`, `title`, and `content` methods.
*/
export default abstract class Modal extends Component {
- /**
- * Determine whether or not the modal should be dismissible via an 'x' button.
- *
- * @deprecated Use the individual `isDismissibleVia...` attributes instead and remove references to this.
- */
- static readonly isDismissible: boolean;
/**
* Can the model be dismissed with a close button (X)?
*
@@ -49,7 +39,6 @@ export default abstract class Modal): void;
oncreate(vnode: Mithril.VnodeDOM): void;
onbeforeremove(vnode: Mithril.VnodeDOM): Promise | void;
/**
diff --git a/framework/core/js/dist-typings/common/utils/ItemList.d.ts b/framework/core/js/dist-typings/common/utils/ItemList.d.ts
index 9e2878d0f..b0dcb2d2a 100644
--- a/framework/core/js/dist-typings/common/utils/ItemList.d.ts
+++ b/framework/core/js/dist-typings/common/utils/ItemList.d.ts
@@ -17,15 +17,6 @@ export default class ItemList {
* The items in the list.
*/
protected _items: Record>;
- /**
- * A **read-only copy** of items in the list.
- *
- * We don't allow adding new items to the ItemList via setting new properties,
- * nor do we allow modifying existing items directly.
- *
- * @deprecated Use {@link ItemList.toObject} instead.
- */
- get items(): DeepReadonly>>;
/**
* Check whether the list is empty.
*/
@@ -51,30 +42,6 @@ export default class ItemList {
* will be positioned before items with a lower priority.
*/
add(key: string, content: T, priority?: number): this;
- /**
- * Replace an item and/or priority in the list, only if it is already present.
- *
- * If `content` or `priority` are `null`, these values will not be replaced.
- *
- * If the provided `key` is not present, nothing will happen.
- *
- * @deprecated Please use the {@link ItemList.setContent} and {@link ItemList.setPriority}
- * methods to replace items and their priorities. This method will be removed in Flarum 2.0.
- *
- * @param key The key of the item in the list
- * @param content The item's new content
- * @param priority The item's new priority
- *
- * @example
, 10);
- */
- replace(key: string, content?: T | null, priority?: number | null): this;
/**
* Replaces an item's content, if the provided item key exists.
*
diff --git a/framework/core/js/dist-typings/common/utils/evented.d.ts b/framework/core/js/dist-typings/common/utils/evented.d.ts
deleted file mode 100644
index 70c243658..000000000
--- a/framework/core/js/dist-typings/common/utils/evented.d.ts
+++ /dev/null
@@ -1,98 +0,0 @@
-declare namespace _default {
- const handlers: Record;
- /**
- * Get all of the registered handlers for an event.
- *
- * @param {string} event The name of the event.
- * @return {Function[]}
- * @protected
- *
- * @deprecated
- */
- function getHandlers(event: string): Function[];
- /**
- * Get all of the registered handlers for an event.
- *
- * @param {string} event The name of the event.
- * @return {Function[]}
- * @protected
- *
- * @deprecated
- */
- function getHandlers(event: string): Function[];
- /**
- * Trigger an event.
- *
- * @param {string} event The name of the event.
- * @param {any[]} args Arguments to pass to event handlers.
- *
- * @deprecated
- */
- function trigger(event: string, ...args: any[]): void;
- /**
- * Trigger an event.
- *
- * @param {string} event The name of the event.
- * @param {any[]} args Arguments to pass to event handlers.
- *
- * @deprecated
- */
- function trigger(event: string, ...args: any[]): void;
- /**
- * Register an event handler.
- *
- * @param {string} event The name of the event.
- * @param {Function} handler The function to handle the event.
- *
- * @deprecated
- */
- function on(event: string, handler: Function): void;
- /**
- * Register an event handler.
- *
- * @param {string} event The name of the event.
- * @param {Function} handler The function to handle the event.
- *
- * @deprecated
- */
- function on(event: string, handler: Function): void;
- /**
- * Register an event handler so that it will run only once, and then
- * unregister itself.
- *
- * @param {string} event The name of the event.
- * @param {Function} handler The function to handle the event.
- *
- * @deprecated
- */
- function one(event: string, handler: Function): void;
- /**
- * Register an event handler so that it will run only once, and then
- * unregister itself.
- *
- * @param {string} event The name of the event.
- * @param {Function} handler The function to handle the event.
- *
- * @deprecated
- */
- function one(event: string, handler: Function): void;
- /**
- * Unregister an event handler.
- *
- * @param {string} event The name of the event.
- * @param {Function} handler The function that handles the event.
- *
- * @deprecated
- */
- function off(event: string, handler: Function): void;
- /**
- * Unregister an event handler.
- *
- * @param {string} event The name of the event.
- * @param {Function} handler The function that handles the event.
- *
- * @deprecated
- */
- function off(event: string, handler: Function): void;
-}
-export default _default;
diff --git a/framework/core/js/dist-typings/forum/components/Search.d.ts b/framework/core/js/dist-typings/forum/components/Search.d.ts
index 2d2a34efb..280766ae3 100644
--- a/framework/core/js/dist-typings/forum/components/Search.d.ts
+++ b/framework/core/js/dist-typings/forum/components/Search.d.ts
@@ -50,13 +50,6 @@ export default class Search extends Compone
* The instance of `SearchState` for this component.
*/
protected searchState: SearchState;
- /**
- * The instance of `SearchState` for this component.
- *
- * @deprecated Replace with`this.searchState` instead.
- */
- get state(): SearchState;
- set state(state: SearchState);
/**
* Whether or not the search input has focus.
*/
diff --git a/framework/core/js/dist-typings/forum/components/WelcomeHero.d.ts b/framework/core/js/dist-typings/forum/components/WelcomeHero.d.ts
index 221362f30..75cfe94f2 100644
--- a/framework/core/js/dist-typings/forum/components/WelcomeHero.d.ts
+++ b/framework/core/js/dist-typings/forum/components/WelcomeHero.d.ts
@@ -8,10 +8,6 @@ export interface IWelcomeHeroAttrs {
* forum.
*/
export default class WelcomeHero extends Component {
- /**
- * @deprecated Extend the `isHidden` method instead.
- */
- hidden: boolean;
oninit(vnode: Mithril.Vnode): void;
view(vnode: Mithril.Vnode): JSX.Element | null;
/**
diff --git a/framework/core/js/dist/admin.js b/framework/core/js/dist/admin.js
index 3f63b07d2..c518e406d 100644
--- a/framework/core/js/dist/admin.js
+++ b/framework/core/js/dist/admin.js
@@ -1,3 +1,3 @@
/*! For license information please see admin.js.LICENSE.txt */
-(()=>{var t,e,n={2190:(t,e,n)=>{"use strict";n.d(e,{Z:()=>o});var r=n(7905);class o{constructor(){(0,r.Z)(this,"element",void 0),(0,r.Z)(this,"attrs",void 0),(0,r.Z)(this,"state",void 0)}oninit(t){this.setAttrs(t.attrs)}oncreate(t){this.element=t.dom}onbeforeupdate(t){this.setAttrs(t.attrs)}onupdate(t){}onbeforeremove(t){}onremove(t){}$(t){const e=$(this.element);return t?e.find(t):e}static component(t,e){void 0===t&&(t={}),void 0===e&&(e=null);const n={...t};return m(this,n,e)}setAttrs(t){if(void 0===t&&(t={}),this.constructor.initAttrs(t),t){if("children"in t)throw new Error("[".concat(this.constructor.name,'] The "children" attribute of attrs should never be used. Either pass children in as the vnode children or rename the attribute'));if("tag"in t)throw new Error("[".concat(this.constructor.name,'] You cannot use the "tag" attribute name with Mithril 2.'))}this.attrs=t}static initAttrs(t){}}flarum.reg.add("core","common/Component",o)},9175:(t,e,n)=>{"use strict";n.d(e,{Z:()=>s});var r=n(7905),o=n(7465),i=n(4300);class s{constructor(t,e){void 0===t&&(t={}),void 0===e&&(e=o.Z.store),(0,r.Z)(this,"data",{}),(0,r.Z)(this,"freshness",new Date),(0,r.Z)(this,"exists",!1),(0,r.Z)(this,"store",void 0),this.data=t,this.store=e}id(){return"id"in this.data?this.data.id:void 0}attribute(t){var e,n;return null==(e=this.data)||null==(n=e.attributes)?void 0:n[t]}pushData(t){if("id"in t&&(this.data.id=t.id),"type"in t&&(this.data.type=t.type),"attributes"in t){var e;(e=this.data).attributes||(e.attributes={});for(const e in t.attributes){const n=t.attributes[e];n&&n instanceof s&&((0,i.w)("Providing models as attributes to `Model.pushData()` or `Model.pushAttributes()` is deprecated.","3249"),delete t.attributes[e],t.relationships||(t.relationships={}),t.relationships[e]={data:s.getIdentifier(n)})}Object.assign(this.data.attributes,t.attributes)}if("relationships"in t){var n;const e=null!=(n=this.data.relationships)?n:{};for(const n in t.relationships){const r=t.relationships[n];if(null===r){delete e[n],delete t.relationships[n];continue}let o;o=r instanceof s?{data:s.getIdentifier(r)}:r instanceof Array?{data:r.map(s.getIdentifier)}:r,t.relationships[n]=o,e[n]=o}this.data.relationships=e}return this.freshness=new Date,this}pushAttributes(t){this.pushData({attributes:t})}save(t,e){void 0===e&&(e={});const n={type:this.data.type,attributes:t};if("id"in this.data&&(n.id=this.data.id),t.relationships){n.relationships={};for(const e in t.relationships){const r=t.relationships[e];null!==r&&(n.relationships[e]={data:r instanceof Array?r.map(s.getIdentifier):s.getIdentifier(r)})}delete t.relationships}const r=this.copyData();this.pushData(n);const i={data:n,meta:e.meta||void 0};return o.Z.request({method:this.exists?"PATCH":"POST",url:o.Z.forum.attribute("apiUrl")+this.apiEndpoint(),body:i,...e}).then((t=>this.store.pushPayload(t)),(t=>{throw this.pushData(r),m.redraw(),t}))}delete(t,e){return void 0===t&&(t={}),void 0===e&&(e={}),this.exists?o.Z.request({method:"DELETE",url:o.Z.forum.attribute("apiUrl")+this.apiEndpoint(),body:t,...e}).then((()=>{this.exists=!1,this.store.remove(this)})):Promise.resolve()}apiEndpoint(){return"/"+this.data.type+("id"in this.data?"/"+this.data.id:"")}copyData(){return JSON.parse(JSON.stringify(this.data))}rawRelationship(t){var e,n;return null==(e=this.data.relationships)||null==(n=e[t])?void 0:n.data}static attribute(t,e){return function(){return e?e(this.attribute(t)):this.attribute(t)}}static hasOne(t){return function(){var e,n;const r=null==(e=this.data.relationships)||null==(n=e[t])?void 0:n.data;if(r&&r instanceof Array)throw new Error("Relationship ".concat(t," on model ").concat(this.data.type," is plural, so the hasOne method cannot be used to access it."));return!!r&&this.store.getById(r.type,r.id)}}static hasMany(t){return function(){var e,n;const r=null==(e=this.data.relationships)||null==(n=e[t])?void 0:n.data;if(r&&!(r instanceof Array))throw new Error("Relationship ".concat(t," on model ").concat(this.data.type," is singular, so the hasMany method cannot be used to access it."));return!!r&&r.map((t=>this.store.getById(t.type,t.id)))}}static transformDate(t){return null!=t?new Date(t):t}static getIdentifier(t){return t&&"id"in t.data?{type:t.data.type,id:t.data.id}:null}}flarum.reg.add("core","common/Model",s)},7465:(t,e,n)=>{"use strict";n.d(e,{Z:()=>i});const r=window,o=new Proxy({},{get:(t,e)=>Reflect.get(r.app,e,r.app),set:(t,e,n)=>Reflect.set(r.app,e,n,r.app)}),i=o;flarum.reg.add("core","common/app",o)},3817:(t,e,n)=>{"use strict";n.d(e,{Z:()=>u});var r=n(2190),o=n(7202),i=n(1268),s=n(6786),a=n(3344),l=n(7465),c=n(9133);class u extends r.Z{view(t){const e=Object.assign({},this.attrs),n=(0,s.Z)(e,"type");e.className=(0,a.Z)("Alert","Alert--".concat(n),e.className);const r=(0,s.Z)(e,"title"),u=(0,s.Z)(e,"icon"),d=(0,s.Z)(e,"content")||t.children,h=(0,s.Z)(e,"controls")||[],p=(0,s.Z)(e,"dismissible"),f=(0,s.Z)(e,"ondismiss"),g=[];return(p||void 0===p)&&g.push(m(o.Z,{"aria-label":l.Z.translator.trans("core.lib.alert.dismiss_a11y_label"),icon:"fas fa-times",className:"Button Button--link Button--icon Alert-dismiss",onclick:f})),m("div",e,m("div",{className:(0,a.Z)("Alert-container",e.containerClassName)},!!r&&m("div",{className:"Alert-title"},!!u&&m("span",{className:"Alert-title-icon"},m(c.Z,{name:u})),m("span",{className:"Alert-title-text"},r)),m("span",{className:"Alert-body"},d),m("ul",{className:"Alert-controls"},(0,i.Z)(h.concat(g)))))}}flarum.reg.add("core","common/components/Alert",u)},3804:(t,e,n)=>{"use strict";n.d(e,{Z:()=>l});var r=n(6439),o=n(2190),i=n(3344),s=n(9215),a=n(9133);class l extends o.Z{view(){const{type:t,icon:e,label:n,color:o,style:l={},...c}=this.attrs,u=(0,i.Z)("Badge",[t&&"Badge--".concat(t)],c.className,(0,s.Z)(o)),d=e?m(a.Z,{name:e,className:"Badge-icon"}):m.trust(" "),h={...l,"--badge-bg":o},p={...c,className:u,style:h},f=m("div",p,d);return n?m(r.Z,{text:n},f):f}}flarum.reg.add("core","common/components/Badge",l)},7202:(t,e,n)=>{"use strict";n.d(e,{Z:()=>c});var r=n(2190),o=n(4300),i=n(3344),s=n(1552),a=n(5226),l=n(9133);class c extends r.Z{view(t){let{type:e,title:n,"aria-label":r,icon:o,disabled:a,loading:l,className:c,class:u,...d}=this.attrs;e||(e="button"),r||(r=n),"object"==typeof r&&(r=(0,s.Z)(r)),(a||l)&&delete d.onclick,c=(0,i.Z)(u,c,{hasIcon:o,disabled:a||l,loading:l});const h={disabled:a,className:c,type:e,"aria-label":r,...d};return m("button",h,this.getButtonContent(t.children))}oncreate(t){var e,n;super.oncreate(t);const{"aria-label":r}=this.attrs;this.view!==c.prototype.view||r||(0,s.Z)(t.children)||null!=(e=this.element)&&null!=(n=e.getAttribute)&&n.call(e,"aria-label")||(0,o.Z)('[Flarum Accessibility Warning] Button has no content and no accessible label. This means that screen-readers will not be able to interpret its meaning and just read "Button". Consider providing accessible text via the `aria-label` attribute. https://web.dev/button-name',this.element)}getButtonContent(t){const e=this.attrs.icon;return[e&&m(l.Z,{name:e,className:"Button-icon"}),t&&m("span",{className:"Button-label"},t),this.attrs.loading&&m(a.Z,{size:"small",display:"inline"})]}}flarum.reg.add("core","common/components/Button",c)},6352:(t,e,n)=>{"use strict";n.d(e,{Z:()=>i});var r=n(2190),o=n(3344);class i extends r.Z{view(t){const{label:e,description:n,className:r,...i}=t.attrs;return m("div",Object.assign({className:(0,o.Z)("Form",r)},i),m("div",{className:"Form-header"},e&&m("label",null,e),n&&m("p",{className:"helpText"},n)),m("div",{className:"Form-body"},t.children))}}flarum.reg.add("core","common/components/Form",i)},6697:(t,e,n)=>{"use strict";n.d(e,{Z:()=>o});var r=n(3804);class o extends r.Z{static initAttrs(t){super.initAttrs(t),t.group&&(t.icon=t.group.icon()||"",t.color=t.group.color()||"",t.label=void 0===t.label?t.group.nameSingular():t.label,t.type="group--"+t.group.id(),delete t.group)}}flarum.reg.add("core","common/components/GroupBadge",o)},9133:(t,e,n)=>{"use strict";n.d(e,{Z:()=>i});var r=n(3344),o=n(2190);class i extends o.Z{view(t){const{name:e,...n}=t.attrs;return n.className=(0,r.Z)("icon",e,n.className),m("i",Object.assign({"aria-hidden":"true"},n))}}flarum.reg.add("core","common/components/Icon",i)},5226:(t,e,n)=>{"use strict";n.d(e,{Z:()=>s});var r=n(7465),o=n(2190),i=n(3344);class s extends o.Z{view(){const{display:t="block",size:e="medium",containerClassName:n,className:o,...s}=this.attrs,a=(0,i.Z)("LoadingIndicator",o),l=(0,i.Z)("LoadingIndicator-container","unset"!==t&&"LoadingIndicator-container--".concat(t),e&&"LoadingIndicator-container--".concat(e),n);return m("div",Object.assign({"aria-label":r.Z.translator.trans("core.lib.loading_indicator.accessible_label"),role:"status"},s.containerAttrs,{"data-size":e,className:l}),m("div",Object.assign({"aria-hidden":"true",className:a},s)))}}flarum.reg.add("core","common/components/LoadingIndicator",s)},7108:(t,e,n)=>{"use strict";n.d(e,{Z:()=>u});var r=n(7905),o=n(7465),i=n(2190),s=n(3817),a=n(7202),l=n(4300),c=n(3344);class u extends i.Z{constructor(){super(...arguments),(0,r.Z)(this,"loading",!1),(0,r.Z)(this,"alertAttrs",null)}static get dismissibleOptions(){return this.isDismissible?{isDismissible:!0,viaCloseButton:this.isDismissibleViaCloseButton,viaEscKey:this.isDismissibleViaEscKey,viaBackdropClick:this.isDismissibleViaBackdropClick}:{isDismissible:!1,viaCloseButton:!1,viaEscKey:!1,viaBackdropClick:!1}}oninit(t){super.oninit(t);const e=[];["className","title","content","onsubmit"].forEach((t=>{this[t]||(this[t]=function(){},e.push(t))})),e.length>0&&(0,l.Z)("Modal `".concat(this.constructor.name,"` does not implement all abstract methods of the Modal super class. Missing methods: ").concat(e.join(", "),"."))}oncreate(t){super.oncreate(t),this.attrs.animateShow((()=>this.onready()))}onbeforeremove(t){if(super.onbeforeremove(t),!this.attrs.state.modal)return new Promise((t=>setTimeout(t,300)))}view(){return this.alertAttrs&&(this.alertAttrs.dismissible=!1),m("div",{className:(0,c.Z)("Modal modal-dialog fade",this.className())},m("div",{className:"Modal-content"},this.dismissibleOptions.viaCloseButton&&m("div",{className:"Modal-close App-backControl"},m(a.Z,{icon:"fas fa-times",onclick:()=>this.hide(),className:"Button Button--icon Button--link","aria-label":o.Z.translator.trans("core.lib.modal.close")})),m("form",{onsubmit:this.onsubmit.bind(this)},m("div",{className:"Modal-header"},m("h3",{className:"App-titleControl App-titleControl--text"},this.title())),!!this.alertAttrs&&m("div",{className:"Modal-alert"},m(s.Z,this.alertAttrs)),this.content())))}onsubmit(t){}onready(){this.$().find("input, select, textarea").first().trigger("focus").trigger("select")}hide(){this.attrs.animateHide()}loaded(){this.loading=!1,m.redraw()}onerror(t){var e;this.alertAttrs=t.alert,m.redraw(),422===t.status&&null!=(e=t.response)&&e.errors?this.$("form [name="+t.response.errors[0].source.pointer.replace("/data/attributes/","")+"]").trigger("select"):this.onready()}get dismissibleOptions(){return this.constructor.dismissibleOptions}}(0,r.Z)(u,"isDismissible",!0),(0,r.Z)(u,"isDismissibleViaCloseButton",!0),(0,r.Z)(u,"isDismissibleViaEscKey",!0),(0,r.Z)(u,"isDismissibleViaBackdropClick",!0),flarum.reg.add("core","common/components/Modal",u)},6439:(t,e,n)=>{"use strict";n.d(e,{Z:()=>a});var r=n(7905),o=n(2190),i=n(3344),s=n(1552);class a extends o.Z{constructor(){super(...arguments),(0,r.Z)(this,"firstChild",null),(0,r.Z)(this,"childDomNode",null),(0,r.Z)(this,"oldText",""),(0,r.Z)(this,"oldVisibility",void 0),(0,r.Z)(this,"shouldRecreateTooltip",!1),(0,r.Z)(this,"shouldChangeTooltipVisibility",!1)}view(t){const e=t.children,{text:n,tooltipVisible:r,showOnFocus:o=!0,position:i="top",ignoreTitleWarning:s=!1,html:a=!1,delay:l=0,...c}=this.attrs;this.attrs.title&&!s&&console.warn("`title` attribute was passed to Tooltip component. Was this intentional? Tooltip content should be passed to the `text` attr instead.");const u=this.getRealText();if(u!==this.oldText&&(this.oldText=u,this.shouldRecreateTooltip=!0),r!==this.oldVisibility&&(this.oldVisibility=this.attrs.tooltipVisible,this.shouldChangeTooltipVisibility=!0),void 0===e)throw new Error("Tooltip component was provided with no direct child DOM element. Tooltips must contain a single direct DOM node to attach to.");if(1!==e.length)throw new Error("Tooltip component was either passed more than one or no child node.\n\nPlease wrap multiple children in another element, such as a
or .");const d=e[0];if("object"!=typeof d||Array.isArray(d)||null===d)throw new Error("Tooltip component was provided with no direct child DOM element. Tooltips must contain a single direct DOM node to attach to.");if("string"==typeof d.tag&&["#","[","<"].includes(d.tag))throw new Error('Tooltip component with provided with a vnode with tag "'.concat(d.tag,'". This is not a DOM element, so is not a valid child element. Please wrap this vnode in another element, such as a