mirror of
https://github.com/flarum/framework.git
synced 2024-12-02 06:53:47 +08:00
7799c2fcd5
Includes transpiled JS/TS, and Typescript declaration files (typings). [skip ci]
1 line
103 KiB
Plaintext
Generated
1 line
103 KiB
Plaintext
Generated
{"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,OAAOC,YAAa,CAAEC,MAAO,WAE7DX,OAAOC,eAAeL,EAAS,aAAc,CAAEe,OAAO,GAAO,G,0kBCL9D,MAAM,EAA+BC,OAAOC,KAAKC,OAAO,iBCAlD,EAA+BF,OAAOC,KAAKC,OAAO,a,aCAxD,MAAM,EAA+BF,OAAOC,KAAKC,OAAO,qC,aCAxD,MAAM,EAA+BF,OAAOC,KAAKC,OAAO,uBCAlD,EAA+BF,OAAOC,KAAKC,OAAO,oC,aCAxD,MAAM,EAA+BF,OAAOC,KAAKC,OAAO,yB,aCAxD,MAAM,EAA+BF,OAAOC,KAAKC,OAAO,gC,aCAxD,MAAM,EAA+BF,OAAOC,KAAKC,OAAO,gC,aCAxD,MAAM,EAA+BF,OAAOC,KAAKC,OAAO,sC,aCAxD,MAAM,EAA+BF,OAAOC,KAAKC,OAAO,0B,aCAxD,MAAM,EAA+BF,OAAOC,KAAKC,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AI,gBAAiB,CACzBjG,KAAM,gBACNvH,KAAM,YACN2U,MAAO3X,IAAAA,WAAAA,MAAqB,gEAG9BQ,EAAMgQ,IAAI,iBAAkB,CAC1BjG,KAAM,iBACNvH,KAAM,YACN2U,MAAO3X,IAAAA,WAAAA,MAAqB,gEAEhC,KAGAkJ,EAAAA,EAAAA,QAAO0O,KAAAA,UAAoB,YAAY,SAAUpX,GAC/C,MAAMmJ,EAAOtK,KAAKsK,KAClBnJ,EAAMgQ,IACJ,WACAtQ,EAAC2X,KAAU,CAACnS,KAAM1F,IAAAA,MAAU,gBAAiB,CAAE8J,SAAUH,EAAK2D,SAAW/C,KAAK,WAAWvH,KAAK,aAC3FhD,IAAAA,WAAAA,MAAqB,6CAExB,GAEJ,IAGA8X,EAAAA,gBAAAA,gBAAAA,KAAqC,kBAGrC5O,EAAAA,EAAAA,QAAOuH,IAAAA,UAAgB,YAAY,WACjCpR,KAAKgE,EAAE,gDAAgDkP,MAAK,WAC1DlT,KAAK4O,UAAUuC,IAAIuH,IAAkBC,iBAAiB3Y,MAAM4Y,iBAAiB,YAC/E,GACF,GACF,IAQAva,OAAOwQ,OAAO1P,GAAAA,OAAQ0Z,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.core.compat['common/extend']\"","webpack://@flarum/mentions/external root \"flarum.core.compat['forum/app']\"","webpack://@flarum/mentions/external root \"flarum.core.compat['forum/components/NotificationGrid']\"","webpack://@flarum/mentions/external root \"flarum.core.compat['common/utils/string']\"","webpack://@flarum/mentions/external root \"flarum.core.compat['common/helpers/textContrastClass']\"","webpack://@flarum/mentions/external root \"flarum.core.compat['forum/components/Post']\"","webpack://@flarum/mentions/external root \"flarum.core.compat['forum/components/CommentPost']\"","webpack://@flarum/mentions/external root \"flarum.core.compat['forum/components/PostPreview']\"","webpack://@flarum/mentions/external root \"flarum.core.compat['common/components/LoadingIndicator']\"","webpack://@flarum/mentions/external root \"flarum.core.compat['common/components/Link']\"","webpack://@flarum/mentions/external root \"flarum.core.compat['common/helpers/punctuateSeries']\"","webpack://@flarum/mentions/external root \"flarum.core.compat['common/helpers/username']\"","webpack://@flarum/mentions/external root \"flarum.core.compat['common/helpers/icon']\"","webpack://@flarum/mentions/external root \"flarum.core.compat['common/components/Button']\"","webpack://@flarum/mentions/external root \"flarum.core.compat['common/components/Modal']\"","webpack://@flarum/mentions/external root \"flarum.core.compat['common/states/PaginatedListState']\"","webpack://@flarum/mentions/./src/forum/state/MentionedByModalState.ts","webpack://@flarum/mentions/./src/forum/components/MentionedByModal.tsx","webpack://@flarum/mentions/external root \"flarum.core.compat['forum/utils/DiscussionControls']\"","webpack://@flarum/mentions/external root \"flarum.core.compat['forum/components/EditPostComposer']\"","webpack://@flarum/mentions/./src/forum/utils/reply.js","webpack://@flarum/mentions/external root \"flarum.core.compat['common/Fragment']\"","webpack://@flarum/mentions/./src/forum/fragments/PostQuoteButton.js","webpack://@flarum/mentions/./src/forum/utils/selectedText.js","webpack://@flarum/mentions/external root \"flarum.core.compat['common/components/TextEditor']\"","webpack://@flarum/mentions/external root \"flarum.core.compat['common/components/TextEditorButton']\"","webpack://@flarum/mentions/external root \"flarum.core.compat['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/./src/forum/mentionables/formats/MentionFormat.ts","webpack://@flarum/mentions/external root \"flarum.core.compat['common/helpers/avatar']\"","webpack://@flarum/mentions/external root \"flarum.core.compat['common/helpers/highlight']\"","webpack://@flarum/mentions/./src/forum/mentionables/MentionableModel.ts","webpack://@flarum/mentions/external root \"flarum.core.compat['common/utils/extractText']\"","webpack://@flarum/mentions/./src/forum/utils/getCleanDisplayName.js","webpack://@flarum/mentions/./src/forum/mentionables/UserMention.tsx","webpack://@flarum/mentions/external root \"flarum.core.compat['forum/components/ReplyComposer']\"","webpack://@flarum/mentions/./src/forum/mentionables/PostMention.tsx","webpack://@flarum/mentions/external root \"flarum.core.compat['common/models/Group']\"","webpack://@flarum/mentions/external root \"flarum.core.compat['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.core.compat['common/Component']\"","webpack://@flarum/mentions/external root \"flarum.core.compat['common/utils/classList']\"","webpack://@flarum/mentions/./src/forum/components/MentionsDropdownItem.tsx","webpack://@flarum/mentions/external root \"flarum.core.compat['common/utils/throttleDebounce']\"","webpack://@flarum/mentions/./src/forum/mentionables/MentionableModels.tsx","webpack://@flarum/mentions/external root \"flarum.core.compat['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/external root \"flarum.core.compat['forum/components/UserPage']\"","webpack://@flarum/mentions/external root \"flarum.core.compat['common/components/LinkButton']\"","webpack://@flarum/mentions/external root \"flarum.core.compat['common/models/User']\"","webpack://@flarum/mentions/external root \"flarum.core.compat['common/Model']\"","webpack://@flarum/mentions/external root \"flarum.core.compat['common/extenders']\"","webpack://@flarum/mentions/external root \"flarum.core.compat['common/models/Post']\"","webpack://@flarum/mentions/external root \"flarum.core.compat['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/compat.js","webpack://@flarum/mentions/./src/forum/utils/getMentionText.js","webpack://@flarum/mentions/./src/forum/extenders/Mentionables.ts","webpack://@flarum/mentions/external assign \"flarum.core\"","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.core.compat['common/extend'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['forum/app'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['forum/components/NotificationGrid'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/utils/string'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/helpers/textContrastClass'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['forum/components/Post'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['forum/components/CommentPost'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['forum/components/PostPreview'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/components/LoadingIndicator'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/components/Link'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/helpers/punctuateSeries'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/helpers/username'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/helpers/icon'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/components/Button'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/components/Modal'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/states/PaginatedListState'];","import PaginatedListState, { PaginatedListParams } from 'flarum/common/states/PaginatedListState';\nimport Post from 'flarum/common/models/Post';\n\nexport interface MentionedByModalListParams extends PaginatedListParams {\n filter: {\n mentionedPost: string;\n };\n sort?: string;\n page?: {\n offset?: number;\n limit: number;\n };\n}\n\nexport default class MentionedByModalState<P extends MentionedByModalListParams = MentionedByModalListParams> extends PaginatedListState<Post, P> {\n constructor(params: P, page: number = 1) {\n const limit = 10;\n\n params.page = { ...(params.page || {}), limit };\n\n super(params, page, limit);\n }\n\n get type(): string {\n return 'posts';\n }\n}\n","import app from 'flarum/forum/app';\nimport PostPreview from 'flarum/forum/components/PostPreview';\nimport Modal, { IInternalModalAttrs } from 'flarum/common/components/Modal';\nimport type Mithril from 'mithril';\nimport type Post from 'flarum/common/models/Post';\nimport LoadingIndicator from 'flarum/common/components/LoadingIndicator';\nimport Button from 'flarum/common/components/Button';\nimport MentionedByModalState from '../state/MentionedByModalState';\n\nexport interface IMentionedByModalAttrs extends IInternalModalAttrs {\n post: Post;\n}\n\nexport default class MentionedByModal<CustomAttrs extends IMentionedByModalAttrs = IMentionedByModalAttrs> extends Modal<\n CustomAttrs,\n MentionedByModalState\n> {\n oninit(vnode: Mithril.Vnode<CustomAttrs, this>) {\n super.oninit(vnode);\n\n this.state = new MentionedByModalState({\n filter: {\n mentionedPost: this.attrs.post.id()!,\n },\n sort: 'number',\n });\n\n this.state.refresh();\n }\n\n className(): string {\n return 'MentionedByModal';\n }\n\n title(): Mithril.Children {\n return app.translator.trans('flarum-mentions.forum.mentioned_by.title');\n }\n\n content(): Mithril.Children {\n return (\n <>\n <div className=\"Modal-body\">\n {this.state.isInitialLoading() ? (\n <LoadingIndicator />\n ) : (\n <>\n <ul className=\"MentionedByModal-list Dropdown-menu Dropdown-menu--inline Post-mentionedBy-preview\">\n {this.state.getPages().map((page) =>\n page.items.map((reply) => (\n <li data-number={reply.number()}>\n <PostPreview post={reply} onclick={() => app.modal.close()} />\n </li>\n ))\n )}\n </ul>\n </>\n )}\n </div>\n {this.state.hasNext() && (\n <div className=\"Modal-footer\">\n <div className=\"Form Form--centered\">\n <div className=\"Form-group\">\n <Button className=\"Button Button--block\" onclick={() => this.state.loadNext()} loading={this.state.isLoadingNext()}>\n {app.translator.trans('flarum-mentions.forum.mentioned_by.load_more_button')}\n </Button>\n </div>\n </div>\n </div>\n )}\n </>\n );\n }\n}\n","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['forum/utils/DiscussionControls'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['forum/components/EditPostComposer'];","import app from 'flarum/forum/app';\nimport DiscussionControls from 'flarum/forum/utils/DiscussionControls';\nimport EditPostComposer from 'flarum/forum/components/EditPostComposer';\n\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\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\n composer.editor.insertAtCursor(\n Array(precedingNewlines).join('\\n') + // Insert up to two newlines, depending on preceding whitespace\n (quote ? '> ' + mention + quote.trim().replace(/\\n/g, '\\n> ') + '\\n\\n' : mention),\n false\n );\n return resolve(composer);\n });\n}\n\nexport default function reply(post, quote) {\n if (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}\n","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/Fragment'];","import app from 'flarum/forum/app';\nimport Fragment from 'flarum/common/Fragment';\nimport icon from 'flarum/common/helpers/icon';\n\nimport reply from '../utils/reply';\n\nexport default class PostQuoteButton extends Fragment {\n constructor(post) {\n super();\n\n this.post = post;\n }\n\n view() {\n return (\n <button\n className=\"Button PostQuoteButton\"\n onclick={() => {\n reply(this.post, this.content);\n }}\n >\n {icon('fas fa-quote-left', { className: 'Button-icon' })}\n {app.translator.trans('flarum-mentions.forum.post.quote_button')}\n </button>\n );\n }\n\n show(left, top) {\n const $this = this.$().show();\n const parentOffset = $this.offsetParent().offset();\n\n $this.css('left', left - parentOffset.left).css('top', top - parentOffset.top);\n\n this.hideHandler = this.hide.bind(this);\n $(document).on('mouseup', this.hideHandler);\n }\n\n showStart(left, top) {\n const $this = this.$();\n\n this.show(left, $(window).scrollTop() + top - $this.outerHeight() - 5);\n }\n\n showEnd(right, bottom) {\n const $this = this.$();\n\n this.show(right - $this.outerWidth(), $(window).scrollTop() + bottom + 5);\n }\n\n hide() {\n this.$().hide();\n $(document).off('mouseup', this.hideHandler);\n }\n}\n","/**\n * Finds the selected text in the provided composer body.\n */\nexport default function selectedText(body) {\n const selection = window.getSelection();\n\n if (!selection.isCollapsed) {\n const range = selection.getRangeAt(0);\n const parent = range.commonAncestorContainer;\n\n if (body[0] === parent || $.contains(body[0], parent)) {\n const clone = $('<div>').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 `![](${this.src})`;\n });\n\n // Replace all links with a Markdown link\n clone.find('a').replaceWith(function () {\n return `[${this.innerText}](${this.href})`;\n });\n\n return clone.text();\n }\n }\n return '';\n}\n","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/components/TextEditor'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/components/TextEditorButton'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['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 Fragment from 'flarum/common/Fragment';\n\nexport default class AutocompleteDropdown extends Fragment {\n items = [];\n active = false;\n index = 0;\n keyWasJustPressed = false;\n\n view() {\n return (\n <ul className=\"Dropdown-menu MentionsDropdown\">\n {this.items.map((item) => (\n <li>{item}</li>\n ))}\n </ul>\n );\n }\n\n show(left, top) {\n this.$()\n .show()\n .css({\n left: left + 'px',\n top: top + 'px',\n });\n this.active = true;\n }\n\n hide() {\n this.$().hide();\n this.active = false;\n }\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\n complete() {\n this.$('li').eq(this.index).find('button').click();\n }\n\n setIndex(index, scrollToItem) {\n if (this.keyWasJustPressed && !scrollToItem) return;\n\n const $dropdown = this.$();\n const $items = $dropdown.find('li');\n let rangedIndex = index;\n\n if (rangedIndex < 0) {\n rangedIndex = $items.length - 1;\n } else if (rangedIndex >= $items.length) {\n rangedIndex = 0;\n }\n\n this.index = rangedIndex;\n\n const $item = $items.removeClass('active').eq(rangedIndex).addClass('active');\n\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\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\n if (typeof scrollTop !== 'undefined') {\n $dropdown.stop(true).animate({ scrollTop }, 100);\n }\n }\n }\n}\n","import type MentionableModel from '../MentionableModel';\nimport type Model from 'flarum/common/Model';\n\nexport default abstract class MentionFormat {\n protected instances?: MentionableModel[];\n\n public makeMentionables(): MentionableModel[] {\n return this.instances ?? (this.instances = this.mentionables.map((Mentionable) => new Mentionable(this)));\n }\n\n public getMentionable(type: string): MentionableModel | null {\n return this.makeMentionables().find((mentionable) => mentionable.type() === type) ?? null;\n }\n\n public extend(mentionable: new (...args: any[]) => MentionableModel): void {\n if (!this.extendable) throw new Error('This mention format does not allow extending.');\n\n this.mentionables.push(mentionable);\n }\n\n abstract mentionables: (new (...args: any[]) => MentionableModel)[];\n\n protected abstract extendable: boolean;\n\n abstract trigger(): string;\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 abstract queryFromTyped(typed: string): string | null;\n\n abstract format(...args: any): string;\n}\n","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/helpers/avatar'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/helpers/highlight'];","import type Mithril from 'mithril';\nimport type Model from 'flarum/common/Model';\nimport type MentionFormat from './formats/MentionFormat';\n\nexport default abstract class MentionableModel<M extends Model = Model, Format extends MentionFormat = MentionFormat> {\n public format: Format;\n\n public constructor(format: Format) {\n this.format = format;\n }\n\n abstract type(): string;\n abstract initialResults(): M[];\n abstract search(typed: string): Promise<M[]>;\n abstract replacement(model: M): string;\n abstract suggestion(model: M, typed: string): Mithril.Children;\n abstract matches(model: M, typed: string): boolean;\n abstract maxStoreMatchedResults(): number | null;\n abstract enabled(): boolean;\n}\n","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['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;\n\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 = true) {\n if (!user) return getDeletedUserText().replace(/\"#[a-z]{0,3}[0-9]+/, '_');\n\n const text = (useDisplayName ? user.displayName() : user.username()) || getDeletedUserText();\n\n return text.replace(/\"#[a-z]{0,3}[0-9]+/, '_');\n}\n","import app from 'flarum/forum/app';\nimport type Mithril from 'mithril';\nimport type User from 'flarum/common/models/User';\nimport usernameHelper from 'flarum/common/helpers/username';\nimport avatar from 'flarum/common/helpers/avatar';\nimport highlight from 'flarum/common/helpers/highlight';\nimport MentionableModel from './MentionableModel';\nimport getCleanDisplayName, { shouldUseOldFormat } from '../utils/getCleanDisplayName';\nimport AtMentionFormat from './formats/AtMentionFormat';\n\nexport default class UserMention extends MentionableModel<User, AtMentionFormat> {\n type(): string {\n return 'user';\n }\n\n initialResults(): User[] {\n return Array.from(app.store.all<User>('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 <caption>New display name syntax</caption>\n * // '@\"user\"#1'\n * forUser(User) // User is ID 1, display name is 'User'\n *\n * @example <caption>Using old syntax</caption>\n * // '@username'\n * forUser(user) // User's username is 'username'\n */\n public replacement(user: User): string {\n if (shouldUseOldFormat()) {\n const cleanText = getCleanDisplayName(user, false);\n return this.format.format(cleanText);\n }\n\n const cleanText = getCleanDisplayName(user);\n return this.format.format(cleanText, '', user.id());\n }\n\n suggestion(model: User, typed: string): Mithril.Children {\n const username = usernameHelper(model, (name: string) => highlight(name, typed));\n\n return (\n <>\n {avatar(model)}\n {username}\n </>\n );\n }\n\n matches(model: User, typed: string): boolean {\n if (!typed) return false;\n\n const names = [model.username(), model.displayName()];\n\n return names.some((name) => name.toLowerCase().substr(0, typed.length) === typed);\n }\n\n maxStoreMatchedResults(): null {\n return null;\n }\n\n async search(typed: string): Promise<User[]> {\n return await app.store.find<User[]>('users', { filter: { q: typed }, page: { limit: 5 } });\n }\n\n enabled(): boolean {\n return true;\n }\n}\n","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['forum/components/ReplyComposer'];","import app from 'flarum/forum/app';\nimport MentionableModel from './MentionableModel';\nimport type Post from 'flarum/common/models/Post';\nimport type Mithril from 'mithril';\nimport usernameHelper from 'flarum/common/helpers/username';\nimport avatar from 'flarum/common/helpers/avatar';\nimport highlight from 'flarum/common/helpers/highlight';\nimport { truncate } from 'flarum/common/utils/string';\nimport ReplyComposer from 'flarum/forum/components/ReplyComposer';\nimport EditPostComposer from 'flarum/forum/components/EditPostComposer';\nimport getCleanDisplayName from '../utils/getCleanDisplayName';\nimport type AtMentionFormat from './formats/AtMentionFormat';\n\nexport default class PostMention extends MentionableModel<Post, AtMentionFormat> {\n type(): string {\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(): Post[] {\n if (!app.composer.bodyMatches(ReplyComposer) && !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\n return (\n discussion\n .posts()\n // Filter to only comment posts, and replies before this message\n .filter((post: Post) => post && post.contentType() === 'comment' && (!composerPost || post.number() < composerPost.number()))\n // Sort by new to old\n .sort((a: Post, b: Post) => b.createdAt().getTime() - a.createdAt().getTime())\n );\n }\n\n /**\n * Generates the syntax for mentioning of a post. Also cleans up the display name.\n *\n * @example <caption>Post mention</caption>\n * // '@\"User\"#p13'\n * // @\"Display name\"#pPostID\n * forPostMention(user, 13) // User display name is 'User', post ID is 13\n */\n public replacement(post: Post): string {\n const user = post.user();\n const cleanText = getCleanDisplayName(user);\n return this.format.format(cleanText, 'p', post.id());\n }\n\n suggestion(model: Post, typed: string): Mithril.Children {\n const user = model.user() || null;\n const username = usernameHelper(user, (name: string) => highlight(name, typed));\n\n return (\n <>\n {avatar(user)}\n {username}\n {[\n app.translator.trans('flarum-mentions.forum.composer.reply_to_post_text', { number: model.number() }),\n ' — ',\n truncate(model.contentPlain() ?? '', 200),\n ]}\n </>\n );\n }\n\n matches(model: Post, typed: string): boolean {\n const user = model.user();\n const userMentionable = app.mentionFormats.mentionable('user')!;\n\n return !typed || (user && userMentionable.matches(user, typed));\n }\n\n maxStoreMatchedResults(): number {\n return 5;\n }\n\n /**\n * Post mention suggestions are only offered from current discussion posts.\n */\n search(typed: string): Promise<Post[]> {\n return Promise.resolve([]);\n }\n\n enabled(): boolean {\n return true;\n }\n}\n","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/models/Group'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/components/Badge'];","import app from 'flarum/forum/app';\nimport Group from 'flarum/common/models/Group';\nimport MentionableModel from './MentionableModel';\nimport type Mithril from 'mithril';\nimport Badge from 'flarum/common/components/Badge';\nimport highlight from 'flarum/common/helpers/highlight';\nimport type AtMentionFormat from './formats/AtMentionFormat';\n\nexport default class GroupMention extends MentionableModel<Group, AtMentionFormat> {\n type(): string {\n return 'group';\n }\n\n initialResults(): Group[] {\n return Array.from(\n app.store.all<Group>('groups').filter((g: Group) => {\n return g.id() !== Group.GUEST_ID && g.id() !== Group.MEMBER_ID;\n })\n );\n }\n\n /**\n * Generates the mention syntax for a group mention.\n *\n * @\"Name Plural\"#gGroupID\n *\n * @example <caption>Group mention</caption>\n * // '@\"Mods\"#g4'\n * forGroup(group) // Group display name is 'Mods', group ID is 4\n */\n public replacement(group: Group): string {\n return this.format.format(group.namePlural(), 'g', group.id());\n }\n\n suggestion(model: Group, typed: string): Mithril.Children {\n let groupName: Mithril.Children = model.namePlural();\n\n if (typed) {\n groupName = highlight(groupName, typed);\n }\n\n return (\n <>\n <Badge className={`Avatar Badge Badge--group--${model.id()} Badge-icon`} color={model.color()} type=\"group\" icon={model.icon()} />\n <span className=\"username\">{groupName}</span>\n </>\n );\n }\n\n matches(model: Group, typed: string): boolean {\n if (!typed) return false;\n\n const names = [model.namePlural().toLowerCase(), model.nameSingular().toLowerCase()];\n\n return names.some((name) => name.toLowerCase().substr(0, typed.length) === typed);\n }\n\n maxStoreMatchedResults(): null {\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: string): Promise<Group[]> {\n return Promise.resolve([]);\n }\n\n enabled(): boolean {\n return app.session?.user?.canMentionGroups() ?? false;\n }\n}\n","import MentionFormat from './MentionFormat';\nimport type MentionableModel from '../MentionableModel';\nimport UserMention from '../UserMention';\nimport PostMention from '../PostMention';\nimport GroupMention from '../GroupMention';\n\nexport default class AtMentionFormat extends MentionFormat {\n public mentionables: (new (...args: any[]) => MentionableModel)[] = [UserMention, PostMention, GroupMention];\n protected extendable: boolean = true;\n\n public trigger(): string {\n return '@';\n }\n\n public queryFromTyped(typed: string): string | null {\n const matchTyped = typed.match(/^[\"“]?((?:(?!\"#).)+)$/);\n\n return matchTyped ? matchTyped[1] : null;\n }\n\n public format(name: string, char: string | null = '', id: string | null = null): string {\n return {\n simple: `@${name}`,\n safe: `@\"${name}\"#${char}${id}`,\n }[id ? 'safe' : 'simple'];\n }\n}\n","import app from 'flarum/forum/app';\nimport Badge from 'flarum/common/components/Badge';\nimport highlight from 'flarum/common/helpers/highlight';\nimport type Tag from 'flarum/tags/common/models/Tag';\nimport type Mithril from 'mithril';\nimport MentionableModel from './MentionableModel';\nimport type HashMentionFormat from './formats/HashMentionFormat';\n\nexport default class TagMention extends MentionableModel<Tag, HashMentionFormat> {\n type(): string {\n return 'tag';\n }\n\n initialResults(): Tag[] {\n return Array.from(app.store.all<Tag>('tags'));\n }\n\n /**\n * Generates the mention syntax for a tag mention.\n *\n * ~tagSlug\n *\n * @example <caption>Tag mention</caption>\n * // ~general\n * forTag(tag) // Tag display name is 'Tag', tag ID is 5\n */\n public replacement(tag: Tag): string {\n return this.format.format(tag.slug());\n }\n\n matches(model: Tag, typed: string): boolean {\n if (!typed) return false;\n\n const names = [model.name().toLowerCase()];\n\n return names.some((name) => name.toLowerCase().substr(0, typed.length) === typed);\n }\n\n maxStoreMatchedResults(): null {\n return null;\n }\n\n async search(typed: string): Promise<Tag[]> {\n return await app.store.find<Tag[]>('tags', { filter: { q: typed }, page: { limit: 5 } });\n }\n\n suggestion(model: Tag, typed: string): Mithril.Children {\n let tagName: Mithril.Children = model.name();\n\n if (typed) {\n tagName = highlight(tagName, typed);\n }\n\n return (\n <>\n <Badge className=\"Avatar\" icon={model.icon()} color={model.color()} type=\"tag\" />\n <span className=\"username\">{tagName}</span>\n </>\n );\n }\n\n enabled(): boolean {\n return 'flarum-tags' in flarum.extensions;\n }\n}\n","import MentionFormat from './MentionFormat';\nimport MentionableModel from '../MentionableModel';\nimport TagMention from '../TagMention';\n\nexport default class HashMentionFormat extends MentionFormat {\n public mentionables: (new (...args: any[]) => MentionableModel)[] = [TagMention];\n protected extendable: boolean = false;\n\n public trigger(): string {\n return '#';\n }\n\n public queryFromTyped(typed: string): string | null {\n const matchTyped = typed.match(/^[-_\\p{L}\\p{N}\\p{M}]+$/giu);\n\n return matchTyped ? matchTyped[0] : null;\n }\n\n public format(slug: string): string {\n return `#${slug}`;\n }\n}\n","import AtMentionFormat from './AtMentionFormat';\nimport HashMentionFormat from './HashMentionFormat';\nimport type MentionFormat from './MentionFormat';\nimport MentionableModel from '../MentionableModel';\n\nexport default class MentionFormats {\n protected formats: MentionFormat[] = [new AtMentionFormat(), new HashMentionFormat()];\n\n public get(symbol: string): MentionFormat | null {\n return this.formats.find((f) => f.trigger() === symbol) ?? null;\n }\n\n public mentionable(type: string): MentionableModel | null {\n for (const format of this.formats) {\n const mentionable = format.getMentionable(type);\n\n if (mentionable) return mentionable;\n }\n\n return null;\n }\n\n public extend(format: new () => MentionFormat) {\n this.formats.push(new format());\n }\n}\n","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/Component'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/utils/classList'];","import Component from 'flarum/common/Component';\nimport type { ComponentAttrs } from 'flarum/common/Component';\nimport classList from 'flarum/common/utils/classList';\nimport type MentionableModel from '../mentionables/MentionableModel';\nimport type Mithril from 'mithril';\n\nexport interface IMentionsDropdownItemAttrs extends ComponentAttrs {\n mentionable: MentionableModel;\n onclick: () => void;\n onmouseenter: () => void;\n}\n\nexport default class MentionsDropdownItem<CustomAttrs extends IMentionsDropdownItemAttrs> extends Component<CustomAttrs> {\n view(vnode: Mithril.Vnode<CustomAttrs>): Mithril.Children {\n const { mentionable, ...attrs } = this.attrs;\n\n const className = classList('MentionsDropdownItem', 'PostPreview', `MentionsDropdown-${mentionable.type()}`);\n\n return (\n <button className={className} {...attrs}>\n <span className=\"PostPreview-content\">{vnode.children}</span>\n </button>\n );\n }\n}\n","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/utils/throttleDebounce'];","import type MentionableModel from './MentionableModel';\nimport type Model from 'flarum/common/Model';\nimport type Mithril from 'mithril';\nimport MentionsDropdownItem from '../components/MentionsDropdownItem';\nimport { throttle } from 'flarum/common/utils/throttleDebounce';\n\nexport default class MentionableModels {\n protected mentionables?: MentionableModel[];\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 private results: Record<string, Map<string, Model>> = {};\n public typed: string | null = null;\n private searched: string[] = [];\n private dropdownItemAttrs: Record<string, any> = {};\n\n constructor(dropdownItemAttrs: Record<string, any>) {\n this.dropdownItemAttrs = dropdownItemAttrs;\n }\n\n public init(mentionables: MentionableModel[]): void {\n this.typed = null;\n this.mentionables = mentionables;\n\n for (const mentionable of this.mentionables) {\n this.results[mentionable.type()] = new Map(mentionable.initialResults().map((result) => [result.id() as string, result]));\n }\n }\n\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 public readonly search = throttle(250, async (): Promise<void> => {\n if (!this.typed || this.typed.length <= 1) return;\n\n const typedLower = this.typed.toLowerCase();\n\n if (this.searched.includes(typedLower)) return;\n\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() as string)) {\n this.results[mentionable.type()].set(model.id() as string, model);\n }\n }\n }\n\n this.searched.push(typedLower);\n\n return Promise.resolve();\n });\n\n public matches(mentionable: MentionableModel, model: Model): boolean {\n return mentionable.matches(model, this.typed?.toLowerCase() || '');\n }\n\n public makeSuggestion(mentionable: MentionableModel, model: Model): Mithril.Children {\n const content = mentionable.suggestion(model, this.typed!);\n const replacement = mentionable.replacement(model);\n\n const { onclick, ...attrs } = this.dropdownItemAttrs;\n\n return (\n <MentionsDropdownItem mentionable={mentionable} onclick={() => onclick(replacement)} {...attrs}>\n {content}\n </MentionsDropdownItem>\n );\n }\n\n public buildSuggestions(): Mithril.Children {\n const suggestions: Mithril.Children = [];\n\n for (const mentionable of this.mentionables!) {\n if (!mentionable.enabled()) continue;\n\n let matches = Array.from(this.results[mentionable.type()].values()).filter((model) => this.matches(mentionable, model));\n\n const max = mentionable.maxStoreMatchedResults();\n if (max) matches = matches.splice(0, max);\n\n for (const model of matches) {\n const dropdownItem = this.makeSuggestion(mentionable, model);\n suggestions.push(dropdownItem);\n }\n }\n\n return suggestions;\n }\n}\n","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['forum/components/Notification'];","import app from 'flarum/forum/app';\nimport Notification from 'flarum/forum/components/Notification';\nimport { truncate } from 'flarum/common/utils/string';\n\nexport default class PostMentionedNotification extends Notification {\n icon() {\n return 'fas fa-reply';\n }\n\n href() {\n const notification = this.attrs.notification;\n const post = notification.subject();\n const content = notification.content();\n\n return app.route.discussion(post.discussion(), content && content.replyNumber);\n }\n\n content() {\n const notification = this.attrs.notification;\n const user = notification.fromUser();\n\n return app.translator.trans('flarum-mentions.forum.notifications.post_mentioned_text', { user, count: 1 });\n }\n\n excerpt() {\n return truncate(this.attrs.notification.subject().contentPlain() || '', 200);\n }\n}\n","import app from 'flarum/forum/app';\nimport Notification from 'flarum/forum/components/Notification';\nimport { truncate } from 'flarum/common/utils/string';\n\nexport default class UserMentionedNotification extends Notification {\n icon() {\n return 'fas fa-at';\n }\n\n href() {\n const post = this.attrs.notification.subject();\n\n return app.route.discussion(post.discussion(), post.number());\n }\n\n content() {\n const user = this.attrs.notification.fromUser();\n\n return app.translator.trans('flarum-mentions.forum.notifications.user_mentioned_text', { user });\n }\n\n excerpt() {\n return truncate(this.attrs.notification.subject().contentPlain(), 200);\n }\n}\n","import app from 'flarum/forum/app';\nimport Notification from 'flarum/forum/components/Notification';\nimport { truncate } from 'flarum/common/utils/string';\n\nexport default class GroupMentionedNotification extends Notification {\n icon() {\n return 'fas fa-at';\n }\n\n href() {\n const post = this.attrs.notification.subject();\n\n return app.route.discussion(post.discussion(), post.number());\n }\n\n content() {\n const user = this.attrs.notification.fromUser();\n\n return app.translator.trans('flarum-mentions.forum.notifications.group_mentioned_text', { user });\n }\n\n excerpt() {\n return truncate(this.attrs.notification.subject().contentPlain(), 200);\n }\n}\n","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['forum/components/UserPage'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/components/LinkButton'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/models/User'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/Model'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/extenders'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/models/Post'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['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: { offset, limit: this.loadLimit },\n sort: '-createdAt',\n });\n }\n}\n","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';\n\nexport default [\n new Extend.Routes() //\n .add('user.mentions', '/u/:username/mentions', MentionsUserPage),\n\n new Extend.Model(Post) //\n .hasMany<Post>('mentionedBy')\n .attribute<number>('mentionedByCount'),\n\n new Extend.Model(User) //\n .attribute<boolean>('canMentionGroups'),\n];\n","import app from 'flarum/forum/app';\nimport username from 'flarum/common/helpers/username';\nimport extractText from 'flarum/common/utils/extractText';\n\nexport function filterUserMentions(tag) {\n let user;\n\n if (app.forum.attribute('allowUsernameMentionFormat') && tag.hasAttribute('username'))\n user = app.store.getBy('users', 'username', tag.getAttribute('username'));\n else if (tag.hasAttribute('id')) user = app.store.getById('users', tag.getAttribute('id'));\n\n if (user) {\n tag.setAttribute('id', user.id());\n tag.setAttribute('slug', user.slug());\n tag.setAttribute('displayname', extractText(username(user)));\n\n return true;\n }\n\n tag.invalidate();\n}\n\nexport function postFilterUserMentions(tag) {\n tag.setAttribute('deleted', false);\n}\n\nexport function filterPostMentions(tag) {\n const post = app.store.getById('posts', tag.getAttribute('id'));\n\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\n return true;\n }\n}\n\nexport function postFilterPostMentions(tag) {\n tag.setAttribute('deleted', false);\n}\n\nexport function filterGroupMentions(tag) {\n if (app.session?.user?.canMentionGroups()) {\n const group = app.store.getById('groups', tag.getAttribute('id'));\n\n if (group) {\n tag.setAttribute('groupname', extractText(group.namePlural()));\n\n return true;\n }\n }\n\n tag.invalidate();\n}\n\nexport function postFilterGroupMentions(tag) {\n if (app.session?.user?.canMentionGroups()) {\n const group = app.store.getById('groups', tag.getAttribute('id'));\n\n tag.setAttribute('color', group.color());\n tag.setAttribute('icon', group.icon());\n tag.setAttribute('deleted', false);\n }\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\n if (model) {\n tag.setAttribute('id', model.id());\n tag.setAttribute('tagname', model.name());\n\n return true;\n }\n }\n\n tag.invalidate();\n}\n\nexport function postFilterTagMentions(tag) {\n if ('flarum-tags' in flarum.extensions) {\n const model = app.store.getBy('tags', 'slug', tag.getAttribute('slug'));\n\n tag.setAttribute('icon', model.icon());\n tag.setAttribute('color', model.color());\n tag.setAttribute('deleted', false);\n }\n}\n","import GroupMentionedNotification from './components/GroupMentionedNotification';\nimport MentionsUserPage from './components/MentionsUserPage';\nimport PostMentionedNotification from './components/PostMentionedNotification';\nimport UserMentionedNotification from './components/UserMentionedNotification';\nimport AutocompleteDropdown from './fragments/AutocompleteDropdown';\nimport PostQuoteButton from './fragments/PostQuoteButton';\nimport getCleanDisplayName from './utils/getCleanDisplayName';\nimport getMentionText from './utils/getMentionText';\nimport * as reply from './utils/reply';\nimport selectedText from './utils/selectedText';\nimport * as textFormatter from './utils/textFormatter';\nimport MentionableModel from './mentionables/MentionableModel';\nimport MentionFormat from './mentionables/formats/MentionFormat';\nimport Mentionables from './extenders/Mentionables';\n\nexport default {\n 'mentions/components/MentionsUserPage': MentionsUserPage,\n 'mentions/components/PostMentionedNotification': PostMentionedNotification,\n 'mentions/components/UserMentionedNotification': UserMentionedNotification,\n 'mentions/components/GroupMentionedNotification': GroupMentionedNotification,\n 'mentions/fragments/AutocompleteDropdown': AutocompleteDropdown,\n 'mentions/fragments/PostQuoteButton': PostQuoteButton,\n 'mentions/utils/getCleanDisplayName': getCleanDisplayName,\n 'mentions/utils/getMentionText': getMentionText,\n 'mentions/utils/reply': reply,\n 'mentions/utils/selectedText': selectedText,\n 'mentions/utils/textFormatter': textFormatter,\n 'mentions/mentionables/MentionableModel': MentionableModel,\n 'mentions/mentionables/formats/MentionFormat': MentionFormat,\n 'mentions/extenders/Mentionables': Mentionables,\n};\n","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\n throw 'No parameters were passed';\n}\n","import type ForumApplication from 'flarum/forum/ForumApplication';\nimport type IExtender from 'flarum/common/extenders/IExtender';\nimport type MentionableModel from '../mentionables/MentionableModel';\nimport type MentionFormat from '../mentionables/formats/MentionFormat';\n\nexport default class Mentionables implements IExtender<ForumApplication> {\n protected formats: (new () => MentionFormat)[] = [];\n protected mentionables: Record<string, (new () => MentionableModel)[]> = {};\n\n /**\n * Register a new mention format.\n * Must extend MentionFormat and have a unique unused trigger symbol.\n */\n format(format: new () => MentionFormat): this {\n this.formats.push(format);\n\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: string, mentionable: new () => MentionableModel): this {\n if (!this.mentionables[symbol]) {\n this.mentionables[symbol] = [];\n }\n\n this.mentionables[symbol].push(mentionable);\n\n return this;\n }\n\n extend(app: ForumApplication): void {\n for (const format of this.formats) {\n app.mentionFormats.extend(format);\n }\n\n for (const symbol in this.mentionables) {\n const format = app.mentionFormats.get(symbol);\n\n if (!format) continue;\n\n for (const mentionable of this.mentionables[symbol]) {\n format.extend(mentionable);\n }\n }\n }\n}\n","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core;","import { extend } from 'flarum/common/extend';\nimport app from 'flarum/forum/app';\nimport NotificationGrid from 'flarum/forum/components/NotificationGrid';\nimport { getPlainContent } from 'flarum/common/utils/string';\nimport textContrastClass from 'flarum/common/helpers/textContrastClass';\nimport Post from 'flarum/forum/components/Post';\n\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 UserPage from 'flarum/forum/components/UserPage';\nimport LinkButton from 'flarum/common/components/LinkButton';\nimport User from 'flarum/common/models/User';\nimport Model from 'flarum/common/Model';\n\nexport { default as extend } from './extend';\n\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\n app.notificationComponents.postMentioned = PostMentionedNotification;\n app.notificationComponents.userMentioned = UserMentionedNotification;\n app.notificationComponents.groupMentioned = GroupMentionedNotification;\n\n // Add notification preferences.\n extend(NotificationGrid.prototype, '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\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\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(\n 'mentions',\n <LinkButton href={app.route('user.mentions', { username: user.slug() })} name=\"mentions\" icon=\"fas fa-at\">\n {app.translator.trans('flarum-mentions.forum.user.mentions_link')}\n </LinkButton>,\n 80\n );\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});\n\nexport * from './utils/textFormatter';\n\n// Expose compat API\nimport mentionsCompat from './compat';\nimport { compat } from '@flarum/core/forum';\n\nObject.assign(compat, mentionsCompat);\n","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';\n\nexport default function addPostMentionPreviews() {\n function addPreviews() {\n const contentHtml = this.attrs.post.contentHtml();\n\n if (contentHtml === this.oldPostContentHtml || this.isEditing()) return;\n\n this.oldPostContentHtml = contentHtml;\n\n const parentPost = this.attrs.post;\n const $parentPost = this.$();\n\n this.$().on(\n 'click',\n '.UserMention:not(.UserMention--deleted), .PostMention:not(.PostMention--deleted), .TagMention:not(.TagMention--deleted)',\n function (e) {\n m.route.set(this.getAttribute('href'));\n e.preventDefault();\n }\n );\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 = $('<ul class=\"Dropdown-menu PostMention-preview fade\"/>');\n $parentPost.append($preview);\n\n const getPostElement = () => {\n return $(`.PostStream-item[data-id=\"${id}\"]`);\n };\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\n $preview\n .show()\n .css('top', $this.offset().top - $parentPost.offset().top + offset)\n .css('left', $this.offsetParent().offset().left - $parentPost.offset().left)\n .css('max-width', $this.offsetParent().width());\n };\n\n const showPost = (post) => {\n const discussion = post.discussion();\n\n m.render($preview[0], [\n discussion !== parentPost.discussion() && (\n <li>\n <span className=\"PostMention-preview-discussion\">{discussion.title()}</span>\n </li>\n ),\n <li>\n <PostPreview post={post} />\n </li>,\n ]);\n positionPreview();\n };\n\n const post = app.store.getById('posts', id);\n if (post && post.discussion()) {\n showPost(post);\n } else {\n m.render($preview[0], <LoadingIndicator />);\n app.store.find('posts', id).then(showPost);\n positionPreview();\n }\n\n setTimeout(() => $preview.off('transitionend').addClass('in'));\n }\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\n $this\n .add($preview)\n .hover(\n () => {\n clearTimeout(timeout);\n timeout = setTimeout(showPreview, 250);\n },\n () => {\n clearTimeout(timeout);\n getPostElement().removeClass('pulsate');\n timeout = setTimeout(hidePreview, 250);\n }\n )\n .on('touchend', (e) => {\n showPreview();\n e.stopPropagation();\n });\n\n $(document).on('touchend', hidePreview);\n });\n }\n\n extend(CommentPost.prototype, 'oncreate', addPreviews);\n extend(CommentPost.prototype, 'onupdate', addPreviews);\n}\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/helpers/icon';\nimport Button from 'flarum/common/components/Button';\nimport MentionedByModal from './components/MentionedByModal';\n\nexport default function addMentionedByList() {\n function hidePreview() {\n this.$('.Post-mentionedBy-preview')\n .removeClass('in')\n .one('transitionend', function () {\n $(this).hide();\n });\n }\n\n extend(CommentPost.prototype, 'oncreate', function () {\n let timeout;\n const post = this.attrs.post;\n const replies = post.mentionedBy();\n\n if (replies && replies.length) {\n const $preview = $('<ul class=\"Dropdown-menu Post-mentionedBy-preview fade\"/>');\n this.$().append($preview);\n\n const $parentPost = this.$();\n const $this = this.$('.Post-mentionedBy');\n\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(\n $preview[0],\n <>\n {replies.map((reply) => (\n <li data-number={reply.number()}>\n <PostPreview post={reply} onclick={hidePreview.bind(this)} />\n </li>\n ))}\n {replies.length < post.mentionedByCount() && (\n <li className=\"Post-mentionedBy-preview-more\">\n <Button\n className=\"PostPreview Button\"\n onclick={() => {\n hidePreview.call(this);\n app.modal.show(MentionedByModal, { post });\n }}\n >\n <span className=\"PostPreview-content\">\n <span className=\"PostPreview-badge Avatar\">{icon('fas fa-reply-all')}</span>\n <span>\n {app.translator.trans('flarum-mentions.forum.post.mentioned_by_more_text', { count: post.mentionedByCount() - replies.length })}\n </span>\n </span>\n </Button>\n </li>\n )}\n </>\n );\n\n $preview\n .show()\n .css('top', $this.offset().top - $parentPost.offset().top + $this.outerHeight(true))\n .css('left', $this.offsetParent().offset().left - $parentPost.offset().left)\n .css('max-width', $parentPost.width());\n\n setTimeout(() => $preview.off('transitionend').addClass('in'));\n };\n\n $this.add($preview).hover(\n () => {\n clearTimeout(timeout);\n timeout = setTimeout(showPreview, 250);\n },\n () => {\n clearTimeout(timeout);\n timeout = setTimeout(hidePreview, 250);\n }\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.$()\n .find('.Post-mentionedBy-summary a')\n .hover(\n function () {\n $preview.find('[data-number=\"' + $(this).data('number') + '\"]').addClass('active');\n },\n function () {\n $preview.find('[data-number]').removeClass('active');\n }\n );\n }\n });\n\n extend(CommentPost.prototype, 'footerItems', function (items) {\n const post = this.attrs.post;\n const replies = post.mentionedBy();\n\n if (replies && replies.length) {\n const users = [];\n const repliers = replies\n .sort((reply) => (reply.user() === app.session.user ? -1 : 0))\n .filter((reply) => {\n const user = reply.user();\n if (users.indexOf(user) === -1) {\n users.push(user);\n return true;\n }\n });\n\n const limit = 4;\n const overLimit = repliers.length > 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\n return (\n <Link href={app.route.post(reply)} onclick={hidePreview.bind(this)} data-number={reply.number()}>\n {app.session.user === user ? app.translator.trans('flarum-mentions.forum.post.you_text') : username(user)}\n </Link>\n );\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 = repliers.length - names.length;\n\n names.push(app.translator.trans('flarum-mentions.forum.post.others_text', { count }));\n }\n\n items.add(\n 'replies',\n <div className=\"Post-mentionedBy\">\n <span className=\"Post-mentionedBy-summary\">\n {icon('fas fa-reply')}\n {app.translator.trans(`flarum-mentions.forum.post.mentioned_by${repliers[0].user() === app.session.user ? '_self' : ''}_text`, {\n count: names.length,\n users: punctuateSeries(names),\n })}\n </span>\n </div>\n );\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';\n\nimport reply from './utils/reply';\n\nexport default function () {\n extend(CommentPost.prototype, 'actionItems', function (items) {\n const post = this.attrs.post;\n\n if (post.isHidden() || (app.session.user && !post.discussion().canReply())) return;\n\n items.add(\n 'reply',\n <Button className=\"Button Button--link\" onclick={() => reply(post)}>\n {app.translator.trans('flarum-mentions.forum.post.reply_link')}\n </Button>\n );\n });\n}\n","import app from 'flarum/forum/app';\nimport { extend } from 'flarum/common/extend';\nimport CommentPost from 'flarum/forum/components/CommentPost';\n\nimport PostQuoteButton from './fragments/PostQuoteButton';\nimport selectedText from './utils/selectedText';\n\nexport default function addPostQuoteButton() {\n extend(CommentPost.prototype, 'oncreate', function () {\n const post = this.attrs.post;\n\n if (post.isHidden() || (app.session.user && !post.discussion().canReply())) return;\n\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 = $('<div class=\"Post-quoteButtonContainer\"></div>');\n\n const button = new PostQuoteButton(post);\n\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\n const rects = window.getSelection().getRangeAt(0).getClientRects();\n const firstRect = rects[0];\n\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\n this.$().after($container).on('mouseup', handler);\n\n if ('ontouchstart' in window) {\n document.addEventListener('selectionchange', handler, false);\n }\n });\n}\n","import app from 'flarum/forum/app';\nimport { extend } from 'flarum/common/extend';\nimport TextEditor from 'flarum/common/components/TextEditor';\nimport TextEditorButton from 'flarum/common/components/TextEditorButton';\nimport KeyboardNavigatable from 'flarum/common/utils/KeyboardNavigatable';\n\nimport AutocompleteDropdown from './fragments/AutocompleteDropdown';\nimport MentionFormats from './mentionables/formats/MentionFormats';\nimport MentionableModels from './mentionables/MentionableModels';\n\nexport default function addComposerAutocomplete() {\n app.mentionFormats = new MentionFormats();\n\n const $container = $('<div class=\"ComposerBody-mentionsDropdownContainer\"></div>');\n const dropdown = new AutocompleteDropdown();\n\n extend(TextEditor.prototype, 'oncreate', function () {\n const $editor = this.$('.TextEditor-editor').wrap('<div class=\"ComposerBody-mentionsWrapper\"></div>');\n\n this.navigator = new KeyboardNavigatable();\n this.navigator\n .when(() => dropdown.active)\n .onUp(() => dropdown.navigate(-1))\n .onDown(() => dropdown.navigate(1))\n .onSelect(dropdown.complete.bind(dropdown))\n .onCancel(dropdown.hide.bind(dropdown))\n .bindTo($editor);\n\n $editor.after($container);\n });\n\n extend(TextEditor.prototype, 'buildEditorParams', function (params) {\n let relMentionStart;\n let absMentionStart;\n let matchTyped;\n\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\n dropdown.hide();\n },\n });\n\n const suggestionsInputListener = () => {\n const selection = this.attrs.composer.editor.getSelectionRange();\n\n const cursor = selection[0];\n\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\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\n dropdown.hide();\n dropdown.active = false;\n\n if (absMentionStart) {\n const typed = lastChunk.substring(relMentionStart).toLowerCase();\n matchTyped = activeFormat.queryFromTyped(typed);\n\n if (!matchTyped) return;\n\n mentionables.typed = matchTyped;\n\n const buildSuggestions = () => {\n // If the user has started to type a mention,\n // then suggest models matching.\n const suggestions = mentionables.buildSuggestions();\n\n if (suggestions.length) {\n dropdown.items = suggestions;\n m.render($container[0], dropdown.render());\n\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\n dropdown.show(left, top);\n } else {\n dropdown.active = false;\n dropdown.hide();\n }\n };\n\n dropdown.active = true;\n\n buildSuggestions();\n\n dropdown.setIndex(0);\n dropdown.$().scrollTop(0);\n\n mentionables.search()?.then(buildSuggestions);\n }\n };\n\n params.inputListeners.push(suggestionsInputListener);\n });\n\n extend(TextEditor.prototype, 'toolbarItems', function (items) {\n items.add(\n 'mention',\n <TextEditorButton onclick={() => this.attrs.composer.editor.insertAtCursor(' @')} icon=\"fas fa-at\">\n {app.translator.trans('flarum-mentions.forum.composer.mention_tooltip')}\n </TextEditorButton>\n );\n });\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","core","compat","MentionedByModalState","PaginatedListState","constructor","params","page","limit","super","type","MentionedByModal","Modal","oninit","vnode","this","state","filter","mentionedPost","attrs","post","id","sort","refresh","className","title","app","content","m","'['","isInitialLoading","LoadingIndicator","getPages","map","items","reply","number","PostPreview","onclick","hasNext","Button","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","discussion","DiscussionControls","then","PostQuoteButton","Fragment","view","icon","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","MentionFormat","makeMentionables","_this$instances","instances","mentionables","Mentionable","getMentionable","_this$makeMentionable","mentionable","extend","extendable","Error","push","MentionableModel","format","getDeletedUserText","extractText","getCleanDisplayName","user","useDisplayName","displayName","username","UserMention","initialResults","from","cleanText","suggestion","model","typed","usernameHelper","name","highlight","avatar","matches","some","toLowerCase","substr","maxStoreMatchedResults","async","q","enabled","PostMention","ReplyComposer","composerAttrs","composerPost","posts","contentType","b","createdAt","getTime","_model$contentPlain","truncate","contentPlain","userMentionable","search","GroupMention","g","Group","group","namePlural","groupName","Badge","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","MentionsDropdownItem","Component","classList","assign","children","MentionableModels","dropdownItemAttrs","throttle","typedLower","searched","includes","results","has","set","init","Map","result","_this$typed","makeSuggestion","buildSuggestions","suggestions","values","max","splice","dropdownItem","PostMentionedNotification","Notification","notification","subject","replyNumber","fromUser","count","excerpt","UserMentionedNotification","GroupMentionedNotification","MentionsUserPage","PostsUserPage","loadResults","mentioned","loadLimit","Extend","add","Post","hasMany","attribute","User","filterUserMentions","hasAttribute","getAttribute","setAttribute","invalidate","postFilterUserMentions","filterPostMentions","postFilterPostMentions","filterGroupMentions","postFilterGroupMentions","_app$session2","_app$session2$user","filterTagMentions","postFilterTagMentions","postId","textFormatter","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","CommentPost","addPostMentionPreviews","replies","mentionedBy","is","mentionedByCount","users","repliers","indexOf","overLimit","names","Link","punctuateSeries","addMentionedByList","isHidden","canReply","$postBody","$container","button","handler","rects","getClientRects","firstRect","clientY","clientX","lastRect","after","addEventListener","dropdown","TextEditor","$editor","wrap","navigator","KeyboardNavigatable","when","onUp","onDown","onSelect","onCancel","bindTo","relMentionStart","absMentionStart","onmouseenter","replaceBeforeCursor","inputListeners","suggestionsInputListener","cursor","lastChunk","getLastNChars","activeFormat","i","character","test","_mentionables$search","substring","coordinates","getCaretCoordinates","Math","TextEditorButton","addComposerAutocomplete","NotificationGrid","label","UserPage","LinkButton","getPlainContent","textContrastClass","getComputedStyle","getPropertyValue","mentionsCompat"],"sourceRoot":""} |