From 5c6764aa85196561d217cb12f121a88b9859ede2 Mon Sep 17 00:00:00 2001 From: flarum-bot Date: Sat, 16 Sep 2023 21:54:57 +0000 Subject: [PATCH] Bundled output for commit 1cfd93b661fe9427de62ff41f934c679104c5979 Includes transpiled JS/TS, and Typescript declaration files (typings). [skip ci] --- js/dist/forum.js | 2 +- js/dist/forum.js.map | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/js/dist/forum.js b/js/dist/forum.js index 5386203..4a98062 100644 --- a/js/dist/forum.js +++ b/js/dist/forum.js @@ -1,2 +1,2 @@ -(()=>{var t={472:t=>{"use strict";t.exports=flarum.extensions["fof-user-directory"]}},e={};function s(n){var r=e[n];if(void 0!==r)return r.exports;var o=e[n]={exports:{}};return t[n](o,o.exports,s),o.exports}s.n=t=>{var e=t&&t.__esModule?()=>t.default:()=>t;return s.d(e,{a:e}),e},s.d=(t,e)=>{for(var n in e)s.o(e,n)&&!s.o(t,n)&&Object.defineProperty(t,n,{enumerable:!0,get:e[n]})},s.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),s.r=t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})};var n={};(()=>{"use strict";s.r(n),s.d(n,{components:()=>lt});const t=flarum.core.compat["forum/app"];var e=s.n(t);const r=flarum.core.compat["common/extend"],o=flarum.core.compat["common/models/Discussion"];var a=s.n(o);const i=flarum.core.compat["tags/models/Tag"];var c=s.n(i);const u=flarum.core.compat["common/Model"];var f=s.n(u);const l=flarum.core.compat["forum/components/IndexPage"];var p=s.n(l);const d=flarum.core.compat["common/components/Dropdown"];var b=s.n(d);const w=flarum.core.compat["common/components/Button"];var h=s.n(w);const v=flarum.core.compat["forum/states/DiscussionListState"];var A=s.n(v);const y=flarum.core.compat["forum/components/DiscussionComposer"];var _=s.n(y);function P(t,e){return P=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},P(t,e)}function g(t,e){t.prototype=Object.create(e.prototype),t.prototype.constructor=t,P(t,e)}const B=flarum.core.compat["forum/components/Notification"];var x=s.n(B),S=function(t){function s(){return t.apply(this,arguments)||this}g(s,t);var n=s.prototype;return n.icon=function(){return"fas fa-comment-dots"},n.href=function(){var t=this.attrs.notification.subject();return e().route.discussion(t)},n.content=function(){return e().translator.trans("fof-best-answer.forum.notification.content")},n.excerpt=function(){return null},s}(x());const k=flarum.core.compat["forum/utils/PostControls"];var O=s.n(k);const C=flarum.core.compat["forum/components/DiscussionPage"];var j=s.n(C);const I=flarum.core.compat["forum/components/CommentPost"];var N=s.n(I);function U(t,e){(null==e||e>t.length)&&(e=t.length);for(var s=0,n=new Array(e);s-1&&r.splice(e,1)},i=function(t,e){var s="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(s)return(s=s.call(t)).next.bind(s);if(Array.isArray(t)||(s=function(t,e){if(t){if("string"==typeof t)return U(t,e);var s=Object.prototype.toString.call(t).slice(8,-1);return"Object"===s&&t.constructor&&(s=t.constructor.name),"Map"===s||"Set"===s?Array.from(t):"Arguments"===s||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(s)?U(t,e):void 0}}(t))||e&&t&&"number"==typeof t.length){s&&(t=s);var n=0;return function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}(u());!(o=i()).done;)a();e().current.matches(j())&&e().current.get("stream").update(),m.redraw(),s&&m.route.set(e().route.discussion(t))}))},(0,r.extend)(O(),"moderationControls",(function(s,r){if(!e().forum.attribute("useAlternativeBestAnswerUi")){var a=r.discussion(),c=o(a,r);r.pushAttributes({isBestAnswer:c}),"comment"===r.contentType()&&(t(a,r)||n(r)||!e().current.matches(j())||s.add("bestAnswer",h().component({icon:"fa"+(c?"s":"r")+" fa-comment-dots",onclick:function(){l(a,c=!c,r)}},i(c))))}})),(0,r.extend)(N().prototype,"actionItems",(function(s){if(e().forum.attribute("useAlternativeBestAnswerUi")){var r=this.attrs.post,a=this.attrs.post.discussion(),c=o(a,r),u=!1!==a.bestAnswerPost();r.pushAttributes({isBestAnswer:c}),t(a,r)||n(r)||!e().current.matches(j())||s.add("bestAnswer",h().component({className:u?c?"Button Button--primary":"Button Button--link":"Button Button--primary",onclick:function(){u=!u,l(a,c=!c,r)}},i(c)))}})),(0,r.extend)(N().prototype,"headerItems",(function(t){var e=this.attrs.post;e.discussion().bestAnswerPost()&&e.discussion().bestAnswerPost().id()===e.id()&&!e.isHidden()&&t.add("isBestAnswer",tt.component({post:e,discussion:e.discussion()}))})),(0,r.extend)(N().prototype,"footerItems",(function(t){var s=this.attrs.post,n=s.discussion(),r=n.bestAnswerPost(),o=e().forum.attribute("fof-best-answer.show_max_lines");if(r&&!r.isHidden()&&1===s.number()&&!s.isHidden()){var a=r.user();t.add("bestAnswerPost",m("div",{className:"CommentPost",onclick:function(){return e().current.get("stream").goToNumber(r.number())}},m("div",{className:"Post-header"},m("ul",null,m("li",{className:"item-user"},m("div",{className:"PostUser"},a&&z()(a),m("h3",null,a?m(E(),{href:e().route.user(a)},q()(a)):q()(a)))),r.discussion()&&m("li",{className:"item-meta"},Q().component({post:r})),tt.component({post:r,discussion:n}))),m("div",{className:$()("Post-body",o>0&&"Post-body--truncate"),style:{"--max-lines":o}},m.trust(r.contentHtml()))),-10)}})),(0,r.extend)(D().prototype,"elementAttrs",(function(t){var e=this.attrs.post;e.discussion().bestAnswerPost()&&e.discussion().bestAnswerPost().id()===e.id()&&!e.isHidden()&&(t.className?t.className+=" Post--bestAnswer":t.className="Post--bestAnswer")})),ct().prototype.bestAnswerCount=f().attribute("bestAnswerCount"),(0,r.extend)(ft().prototype,"infoItems",(function(t){var s=this.attrs.user;t.add("best-answer-count",m("span",{className:"UserCard-bestAnswerCount"},V()("fas fa-check"),e().translator.trans("fof-best-answer.forum.user.best-answer-count",{count:s.bestAnswerCount()})),55)})),(d=s(472))&&(0,r.override)(d.SortMap.prototype,"sortMap",(function(t){return mt({},t(),{most_best_answers:"-bestAnswerCount",least_best_answers:"bestAnswerCount"})})),(0,r.extend)(at().prototype,"notificationTypes",(function(t){t.add("awardedBestAnswer",{name:"awardedBestAnswer",icon:"fas fa-check",label:e().translator.trans("fof-best-answer.forum.notification.preferences.awarded_best_answer")}),t.add("bestAnswerInDiscussion",{name:"bestAnswerInDiscussion",icon:"fas fa-check",label:e().translator.trans("fof-best-answer.forum.notification.preferences.best_answer_in_discussion")}),t.add("selectBestAnswer",{name:"selectBestAnswer",icon:"fas fa-stopwatch",label:e().translator.trans("fof-best-answer.forum.notification.preferences.select_best_answer")})})),(0,r.extend)(p().prototype,"sidebarItems",(function(t){var s=this.currentTag();if(null!=s&&null!=s.isQnA&&s.isQnA()){var n=e().forum.attribute("canStartDiscussion")||!e().session.user,r=t.get("newDiscussion");r.children=e().translator.trans(n?"fof-best-answer.forum.index.ask_question":"fof-best-answer.forum.index.cannot_ask_question"),t.replace("startDiscussion",r)}})),(0,r.extend)(p().prototype,"viewItems",(function(t){if(e().forum.attribute("showBestAnswerFilterUi")){var s=this.currentTag();if(null!=s&&null!=s.isQnA&&s.isQnA()){var n=["all","solved","unsolved"],r=e().discussions.bestAnswer;t.add("solved-filter",b().component({buttonClassName:"Button",label:e().translator.trans("fof-best-answer.forum.filter."+(n[r]||Object.keys(n).map((function(t){return n[t]}))[0])+"_label"),accessibleToggleLabel:e().translator.trans("fof-best-answer.forum.filter.accessible_label")},Object.keys(n).map((function(t){var s=n[t],o=(r||Object.keys(n)[0])===t;return h().component({icon:!o||"fas fa-check",active:o,onclick:function(){e().discussions.bestAnswer=t,"0"===t&&delete e().discussions.bestAnswer,e().discussions.refresh()}},e().translator.trans("fof-best-answer.forum.filter."+s+"_label"))}))))}else e().discussions.bestAnswer&&(delete e().discussions.bestAnswer,e().discussions.refresh())}})),(0,r.extend)(A().prototype,"requestParams",(function(t){if(e().discussions.bestAnswer){var s="2"===e().discussions.bestAnswer?"-":"";t.filter[s+"solved-discussions"]=!0,t.filter.q&&(t.filter.q+=" "+s+"is:solved")}})),(0,r.extend)(_().prototype,"headerItems",(function(t){var s=this.composer.fields.tags;void 0!==s&&s.some((function(t){return t.isQnA()}))&&(this.attrs.titlePlaceholder=e().translator.trans("fof-best-answer.forum.composer.titlePlaceholder"),t.replace("discussionTitle",m("h3",null,m("input",{className:"FormControl",bidi:this.title,placeholder:this.attrs.titlePlaceholder,disabled:!!this.attrs.disabled,onkeydown:this.onkeydown.bind(this)}))))}))}))})(),module.exports=n})(); +(()=>{var t={472:t=>{"use strict";t.exports=flarum.extensions["fof-user-directory"]}},s={};function e(n){var r=s[n];if(void 0!==r)return r.exports;var o=s[n]={exports:{}};return t[n](o,o.exports,e),o.exports}e.n=t=>{var s=t&&t.__esModule?()=>t.default:()=>t;return e.d(s,{a:s}),s},e.d=(t,s)=>{for(var n in s)e.o(s,n)&&!e.o(t,n)&&Object.defineProperty(t,n,{enumerable:!0,get:s[n]})},e.o=(t,s)=>Object.prototype.hasOwnProperty.call(t,s),e.r=t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})};var n={};(()=>{"use strict";e.r(n),e.d(n,{components:()=>ft});const t=flarum.core.compat["forum/app"];var s=e.n(t);const r=flarum.core.compat["common/extend"],o=flarum.core.compat["common/models/Discussion"];var a=e.n(o);const i=flarum.core.compat["tags/models/Tag"];var c=e.n(i);const u=flarum.core.compat["common/Model"];var f=e.n(u);const l=flarum.core.compat["forum/components/IndexPage"];var p=e.n(l);const d=flarum.core.compat["common/components/Dropdown"];var b=e.n(d);const w=flarum.core.compat["common/components/Button"];var h=e.n(w);const A=flarum.core.compat["forum/states/DiscussionListState"];var v=e.n(A);const y=flarum.core.compat["forum/components/DiscussionComposer"];var P=e.n(y);function _(t,s){return _=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,s){return t.__proto__=s,t},_(t,s)}function B(t,s){t.prototype=Object.create(s.prototype),t.prototype.constructor=t,_(t,s)}const g=flarum.core.compat["forum/components/Notification"];var x=e.n(g),k=function(t){function e(){return t.apply(this,arguments)||this}B(e,t);var n=e.prototype;return n.icon=function(){return"fas fa-comment-dots"},n.href=function(){var t=this.attrs.notification.subject();return s().route.discussion(t)},n.content=function(){return s().translator.trans("fof-best-answer.forum.notification.content")},n.excerpt=function(){return null},e}(x());const O=flarum.core.compat["forum/utils/PostControls"];var C=e.n(O);const S=flarum.core.compat["forum/components/DiscussionPage"];var N=e.n(S);const U=flarum.core.compat["forum/components/CommentPost"];var j=e.n(U);const I=flarum.core.compat["forum/components/Post"];var T=e.n(I);const D=flarum.core.compat["forum/components/PostMeta"];var M=e.n(D);const Q=flarum.core.compat["common/helpers/username"];var H=e.n(Q);const q=flarum.core.compat["common/helpers/userOnline"];var L=e.n(q);const z=flarum.core.compat["common/components/Link"];var F=e.n(z);const G=flarum.core.compat["common/utils/classList"];var E=e.n(G);const J=flarum.core.compat["common/Component"];var K=e.n(J);const R=flarum.core.compat["common/helpers/icon"];var V=e.n(R);const W=flarum.core.compat["common/helpers/humanTime"];var X=e.n(W);const Y=flarum.core.compat["common/utils/ItemList"];var Z=e.n(Y),$=function(t){function e(){return t.apply(this,arguments)||this}B(e,t);var n=e.prototype;return n.oninit=function(s){t.prototype.oninit.call(this,s);var e=this.attrs,n=e.post,r=e.discussion;this.post=n,this.discussion=r},n.view=function(){return m("li",{className:"Post--BestAnswer"},this.items().toArray())},n.getSetTime=function(t){if(null!==t.bestAnswerSetAt())return X()(t.bestAnswerSetAt())},n.items=function(){var t=this,e=new(Z());return e.add("post",this.post?m("span",null,V()("fas fa-check"),s().translator.trans("fof-best-answer.forum.best_answer_button")):m(F(),{href:s().route.post(this.post),"data-number":this.post.number()},V()("fas fa-check"),s().translator.trans("fof-best-answer.forum.best_answer_button"))),e.add("user",m("span",{className:"BestAnswer--User"},s().translator.trans("fof-best-answer.forum.best_answer_label",{user:this.discussion.bestAnswerUser(),time_set:this.getSetTime(this.discussion),a:m("a",{onclick:function(){return m.route.set(s().route.user(t.discussion.bestAnswerUser()))}})}))),e},e}(K());const tt=flarum.core.compat["common/components/Badge"];var st=e.n(tt),et=function(t){function e(){return t.apply(this,arguments)||this}B(e,t);var n=e.prototype;return n.icon=function(){return"fas fa-check"},n.href=function(){var t=this.attrs.notification.subject();return s().route.discussion(t)},n.content=function(){var t=this.attrs.notification.fromUser();return s().translator.trans("fof-best-answer.forum.notification.awarded",{user:t})},n.excerpt=function(){return null},e}(x()),nt=function(t){function e(){return t.apply(this,arguments)||this}B(e,t);var n=e.prototype;return n.icon=function(){return"fas fa-check"},n.href=function(){var t=this.attrs.notification.subject();return s().route.discussion(t)},n.content=function(){var t=this.attrs.notification.fromUser();return s().translator.trans("fof-best-answer.forum.notification.best_answer_in_discussion",{user:t})},n.excerpt=function(){return null},e}(x());const rt=flarum.core.compat["forum/components/NotificationGrid"];var ot=e.n(rt);const at=flarum.core.compat["common/models/User"];var it=e.n(at);const ct=flarum.core.compat["forum/components/UserCard"];var ut=e.n(ct);function mt(){return mt=Object.assign?Object.assign.bind():function(t){for(var s=1;s0&&"Post-body--truncate"),style:{"--max-lines":o}},m.trust(r.contentHtml()))),-10)}})),(0,r.extend)(T().prototype,"elementAttrs",(function(t){var s=this.attrs.post,e=s.discussion();null!=e&&e.hasBestAnswer()&&e.bestAnswerPost()&&e.bestAnswerPost().id()===s.id()&&!s.isHidden()&&(t.className?t.className+=" Post--bestAnswer":t.className="Post--bestAnswer")})),it().prototype.bestAnswerCount=f().attribute("bestAnswerCount"),(0,r.extend)(ut().prototype,"infoItems",(function(t){var e=this.attrs.user;t.add("best-answer-count",m("span",{className:"UserCard-bestAnswerCount"},V()("fas fa-check"),s().translator.trans("fof-best-answer.forum.user.best-answer-count",{count:e.bestAnswerCount()})),55)})),(l=e(472))&&(0,r.override)(l.SortMap.prototype,"sortMap",(function(t){return mt({},t(),{most_best_answers:"-bestAnswerCount",least_best_answers:"bestAnswerCount"})})),(0,r.extend)(ot().prototype,"notificationTypes",(function(t){t.add("awardedBestAnswer",{name:"awardedBestAnswer",icon:"fas fa-check",label:s().translator.trans("fof-best-answer.forum.notification.preferences.awarded_best_answer")}),t.add("bestAnswerInDiscussion",{name:"bestAnswerInDiscussion",icon:"fas fa-check",label:s().translator.trans("fof-best-answer.forum.notification.preferences.best_answer_in_discussion")}),t.add("selectBestAnswer",{name:"selectBestAnswer",icon:"fas fa-stopwatch",label:s().translator.trans("fof-best-answer.forum.notification.preferences.select_best_answer")})})),(0,r.extend)(p().prototype,"sidebarItems",(function(t){var e=this.currentTag();if(null!=e&&null!=e.isQnA&&e.isQnA()){var n=s().forum.attribute("canStartDiscussion")||!s().session.user,r=t.get("newDiscussion");r.children=s().translator.trans(n?"fof-best-answer.forum.index.ask_question":"fof-best-answer.forum.index.cannot_ask_question"),t.replace("startDiscussion",r)}})),(0,r.extend)(p().prototype,"viewItems",(function(t){if(s().forum.attribute("showBestAnswerFilterUi")){var e=this.currentTag();if(null!=e&&null!=e.isQnA&&e.isQnA()){var n=["all","solved","unsolved"],r=s().discussions.bestAnswer;t.add("solved-filter",b().component({buttonClassName:"Button",label:s().translator.trans("fof-best-answer.forum.filter."+(n[r]||Object.keys(n).map((function(t){return n[t]}))[0])+"_label"),accessibleToggleLabel:s().translator.trans("fof-best-answer.forum.filter.accessible_label")},Object.keys(n).map((function(t){var e=n[t],o=(r||Object.keys(n)[0])===t;return h().component({icon:!o||"fas fa-check",active:o,onclick:function(){s().discussions.bestAnswer=t,"0"===t&&delete s().discussions.bestAnswer,s().discussions.refresh()}},s().translator.trans("fof-best-answer.forum.filter."+e+"_label"))}))))}else s().discussions.bestAnswer&&(delete s().discussions.bestAnswer,s().discussions.refresh())}})),(0,r.extend)(v().prototype,"requestParams",(function(t){if(s().discussions.bestAnswer){var e="2"===s().discussions.bestAnswer?"-":"";t.filter[e+"solved-discussions"]=!0,t.filter.q&&(t.filter.q+=" "+e+"is:solved")}})),(0,r.extend)(P().prototype,"headerItems",(function(t){var e=this.composer.fields.tags;void 0!==e&&e.some((function(t){return t.isQnA()}))&&(this.attrs.titlePlaceholder=s().translator.trans("fof-best-answer.forum.composer.titlePlaceholder"),t.replace("discussionTitle",m("h3",null,m("input",{className:"FormControl",bidi:this.title,placeholder:this.attrs.titlePlaceholder,disabled:!!this.attrs.disabled,onkeydown:this.onkeydown.bind(this)}))))}))}))})(),module.exports=n})(); //# sourceMappingURL=forum.js.map \ No newline at end of file diff --git a/js/dist/forum.js.map b/js/dist/forum.js.map index e9bd9a9..97c59b3 100644 --- a/js/dist/forum.js.map +++ b/js/dist/forum.js.map @@ -1 +1 @@ -{"version":3,"file":"forum.js","mappings":"kCAAAA,EAAOC,QAAUC,OAAOC,WAAW,qB,GCC/BC,EAA2B,CAAC,EAGhC,SAASC,EAAoBC,GAE5B,IAAIC,EAAeH,EAAyBE,GAC5C,QAAqBE,IAAjBD,EACH,OAAOA,EAAaN,QAGrB,IAAID,EAASI,EAAyBE,GAAY,CAGjDL,QAAS,CAAC,GAOX,OAHAQ,EAAoBH,GAAUN,EAAQA,EAAOC,QAASI,GAG/CL,EAAOC,OACf,CCrBAI,EAAoBK,EAAKV,IACxB,IAAIW,EAASX,GAAUA,EAAOY,WAC7B,IAAOZ,EAAiB,QACxB,IAAM,EAEP,OADAK,EAAoBQ,EAAEF,EAAQ,CAAEG,EAAGH,IAC5BA,CAAM,ECLdN,EAAoBQ,EAAI,CAACZ,EAASc,KACjC,IAAI,IAAIC,KAAOD,EACXV,EAAoBY,EAAEF,EAAYC,KAASX,EAAoBY,EAAEhB,EAASe,IAC5EE,OAAOC,eAAelB,EAASe,EAAK,CAAEI,YAAY,EAAMC,IAAKN,EAAWC,IAE1E,ECNDX,EAAoBY,EAAI,CAACK,EAAKC,IAAUL,OAAOM,UAAUC,eAAeC,KAAKJ,EAAKC,GCClFlB,EAAoBsB,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,KAAKe,UAIvC,GACF,G","sources":["webpack://@fof/best-answer/external assign \"flarum.extensions['fof-user-directory']\"","webpack://@fof/best-answer/webpack/bootstrap","webpack://@fof/best-answer/webpack/runtime/compat get default export","webpack://@fof/best-answer/webpack/runtime/define property getters","webpack://@fof/best-answer/webpack/runtime/hasOwnProperty shorthand","webpack://@fof/best-answer/webpack/runtime/make namespace object","webpack://@fof/best-answer/external root \"flarum.core.compat['forum/app']\"","webpack://@fof/best-answer/external root \"flarum.core.compat['common/extend']\"","webpack://@fof/best-answer/external root \"flarum.core.compat['common/models/Discussion']\"","webpack://@fof/best-answer/external root \"flarum.core.compat['tags/models/Tag']\"","webpack://@fof/best-answer/external root \"flarum.core.compat['common/Model']\"","webpack://@fof/best-answer/external root \"flarum.core.compat['forum/components/IndexPage']\"","webpack://@fof/best-answer/external root \"flarum.core.compat['common/components/Dropdown']\"","webpack://@fof/best-answer/external root \"flarum.core.compat['common/components/Button']\"","webpack://@fof/best-answer/external root \"flarum.core.compat['forum/states/DiscussionListState']\"","webpack://@fof/best-answer/external root \"flarum.core.compat['forum/components/DiscussionComposer']\"","webpack://@fof/best-answer/./node_modules/@babel/runtime/helpers/esm/setPrototypeOf.js","webpack://@fof/best-answer/./node_modules/@babel/runtime/helpers/esm/inheritsLoose.js","webpack://@fof/best-answer/external root \"flarum.core.compat['forum/components/Notification']\"","webpack://@fof/best-answer/./src/forum/components/SelectBestAnswerNotification.js","webpack://@fof/best-answer/external root \"flarum.core.compat['forum/utils/PostControls']\"","webpack://@fof/best-answer/external root \"flarum.core.compat['forum/components/DiscussionPage']\"","webpack://@fof/best-answer/external root \"flarum.core.compat['forum/components/CommentPost']\"","webpack://@fof/best-answer/./src/forum/addBestAnswerAction.js","webpack://@fof/best-answer/external root \"flarum.core.compat['forum/components/Post']\"","webpack://@fof/best-answer/external root \"flarum.core.compat['forum/components/PostMeta']\"","webpack://@fof/best-answer/external root \"flarum.core.compat['common/helpers/username']\"","webpack://@fof/best-answer/external root \"flarum.core.compat['common/helpers/userOnline']\"","webpack://@fof/best-answer/external root \"flarum.core.compat['common/components/Link']\"","webpack://@fof/best-answer/external root \"flarum.core.compat['common/utils/classList']\"","webpack://@fof/best-answer/external root \"flarum.core.compat['common/Component']\"","webpack://@fof/best-answer/external root \"flarum.core.compat['common/helpers/icon']\"","webpack://@fof/best-answer/external root \"flarum.core.compat['common/helpers/humanTime']\"","webpack://@fof/best-answer/external root \"flarum.core.compat['common/utils/ItemList']\"","webpack://@fof/best-answer/./src/forum/components/SelectBestAnswerItem.js","webpack://@fof/best-answer/./src/forum/addBestAnswerView.js","webpack://@fof/best-answer/external root \"flarum.core.compat['common/components/Badge']\"","webpack://@fof/best-answer/./src/forum/components/AwardedBestAnswerNotification.js","webpack://@fof/best-answer/./src/forum/components/BestAnswerInDiscussionNotification.js","webpack://@fof/best-answer/external root \"flarum.core.compat['forum/components/NotificationGrid']\"","webpack://@fof/best-answer/external root \"flarum.core.compat['common/models/User']\"","webpack://@fof/best-answer/external root \"flarum.core.compat['forum/components/UserCard']\"","webpack://@fof/best-answer/./node_modules/@babel/runtime/helpers/esm/extends.js","webpack://@fof/best-answer/./src/forum/components/index.js","webpack://@fof/best-answer/./src/forum/index.js","webpack://@fof/best-answer/./src/common/addBestAnswerCountSort.ts","webpack://@fof/best-answer/./src/forum/addAnsweredBadge.tsx","webpack://@fof/best-answer/./src/forum/addBestAnswerCountToUsers.tsx","webpack://@fof/best-answer/./src/forum/extend/extendNotifications.ts"],"sourcesContent":["module.exports = flarum.extensions['fof-user-directory'];","// The module cache\nvar __webpack_module_cache__ = {};\n\n// The require function\nfunction __webpack_require__(moduleId) {\n\t// Check if module is in cache\n\tvar cachedModule = __webpack_module_cache__[moduleId];\n\tif (cachedModule !== undefined) {\n\t\treturn cachedModule.exports;\n\t}\n\t// Create a new module (and put it into the cache)\n\tvar module = __webpack_module_cache__[moduleId] = {\n\t\t// no module.id needed\n\t\t// no module.loaded needed\n\t\texports: {}\n\t};\n\n\t// Execute the module function\n\t__webpack_modules__[moduleId](module, module.exports, __webpack_require__);\n\n\t// Return the exports of the module\n\treturn module.exports;\n}\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['forum/app'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/extend'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/models/Discussion'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['tags/models/Tag'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/Model'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['forum/components/IndexPage'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/components/Dropdown'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/components/Button'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['forum/states/DiscussionListState'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['forum/components/DiscussionComposer'];","export default function _setPrototypeOf(o, p) {\n _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) {\n o.__proto__ = p;\n return o;\n };\n return _setPrototypeOf(o, p);\n}","import setPrototypeOf from \"./setPrototypeOf.js\";\nexport default function _inheritsLoose(subClass, superClass) {\n subClass.prototype = Object.create(superClass.prototype);\n subClass.prototype.constructor = subClass;\n setPrototypeOf(subClass, superClass);\n}","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['forum/components/Notification'];","import app from 'flarum/forum/app';\nimport Notification from 'flarum/forum/components/Notification';\n\nexport default class SelectBestAnswerNotification extends Notification {\n icon() {\n return 'fas fa-comment-dots';\n }\n\n href() {\n const notification = this.attrs.notification;\n const discussion = notification.subject();\n\n return app.route.discussion(discussion);\n }\n\n content() {\n return app.translator.trans('fof-best-answer.forum.notification.content');\n }\n\n excerpt() {\n return null;\n }\n}\n","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['forum/utils/PostControls'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['forum/components/DiscussionPage'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['forum/components/CommentPost'];","import app from 'flarum/forum/app';\nimport { extend } from 'flarum/common/extend';\nimport Button from 'flarum/common/components/Button';\nimport PostControls from 'flarum/forum/utils/PostControls';\nimport DiscussionPage from 'flarum/forum/components/DiscussionPage';\nimport CommentPost from 'flarum/forum/components/CommentPost';\n\nexport default () => {\n const ineligible = (discussion, post) => {\n return post.isHidden() || post.number() === 1 || !discussion.canSelectBestAnswer() || !app.session.user;\n };\n\n const blockSelectOwnPost = (post) => {\n return !app.forum.attribute('canSelectBestAnswerOwnPost') && post.user() && post.user().id() === app.session.user.id();\n };\n\n const isThisBestAnswer = (discussion, post) => {\n return discussion.bestAnswerPost() && discussion.bestAnswerPost().id() === post.id();\n };\n\n const actionLabel = (isBestAnswer) => {\n return app.translator.trans(isBestAnswer ? 'fof-best-answer.forum.remove_best_answer' : 'fof-best-answer.forum.this_best_answer');\n };\n\n const getBestAnswerTags = () => {\n const tagIds = app.forum.attribute('fof-best-answer.tags') || [];\n\n return app.store.all('tags').filter((t) => tagIds.includes(t.id()));\n };\n\n const saveDiscussion = (discussion, isBestAnswer, post) => {\n discussion\n .save({\n bestAnswerPostId: isBestAnswer ? post.id() : 0,\n bestAnswerUserId: app.session.user.id(),\n relationships: isBestAnswer\n ? { bestAnswerPost: post, bestAnswerUser: app.session.user }\n : delete discussion.data.relationships.bestAnswerPost,\n })\n .then(() => {\n const discussionTags = discussion.data.relationships.tags?.data || [];\n\n if (isBestAnswer) {\n discussionTags.push(...getBestAnswerTags().map((t) => ({ type: 'tags', id: t.id() })));\n } else {\n for (const tag of getBestAnswerTags()) {\n const index = discussionTags.findIndex((t) => t.id === tag.id());\n\n if (index > -1) discussionTags.splice(index, 1);\n }\n }\n\n if (app.current.matches(DiscussionPage)) {\n app.current.get('stream').update();\n }\n\n m.redraw();\n\n if (isBestAnswer) {\n m.route.set(app.route.discussion(discussion));\n }\n });\n };\n\n extend(PostControls, 'moderationControls', function (items, post) {\n if (app.forum.attribute('useAlternativeBestAnswerUi')) return;\n\n const discussion = post.discussion();\n let isBestAnswer = isThisBestAnswer(discussion, post);\n\n post.pushAttributes({ isBestAnswer });\n\n if (post.contentType() !== 'comment') return;\n\n if (ineligible(discussion, post) || blockSelectOwnPost(post) || !app.current.matches(DiscussionPage)) return;\n\n items.add(\n 'bestAnswer',\n Button.component(\n {\n icon: `fa${isBestAnswer ? 's' : 'r'} fa-comment-dots`,\n onclick: () => {\n isBestAnswer = !isBestAnswer;\n\n saveDiscussion(discussion, isBestAnswer, post);\n },\n },\n actionLabel(isBestAnswer)\n )\n );\n });\n\n extend(CommentPost.prototype, 'actionItems', function (items) {\n if (!app.forum.attribute('useAlternativeBestAnswerUi')) return;\n\n const post = this.attrs.post;\n const discussion = this.attrs.post.discussion();\n let isBestAnswer = isThisBestAnswer(discussion, post);\n let hasBestAnswer = discussion.bestAnswerPost() !== false;\n\n post.pushAttributes({ isBestAnswer });\n\n if (ineligible(discussion, post) || blockSelectOwnPost(post) || !app.current.matches(DiscussionPage)) return;\n\n items.add(\n 'bestAnswer',\n Button.component(\n {\n className: !hasBestAnswer ? 'Button Button--primary' : isBestAnswer ? 'Button Button--primary' : 'Button Button--link',\n onclick: function onclick() {\n hasBestAnswer = !hasBestAnswer;\n isBestAnswer = !isBestAnswer;\n\n saveDiscussion(discussion, isBestAnswer, post);\n },\n },\n actionLabel(isBestAnswer)\n )\n );\n });\n};\n","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['forum/components/Post'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['forum/components/PostMeta'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/helpers/username'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/helpers/userOnline'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/components/Link'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/utils/classList'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/Component'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/helpers/icon'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/helpers/humanTime'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/utils/ItemList'];","import app from 'flarum/forum/app';\nimport Component from 'flarum/common/Component';\nimport icon from 'flarum/common/helpers/icon';\nimport humanTime from 'flarum/common/helpers/humanTime';\nimport Link from 'flarum/common/components/Link';\nimport ItemList from 'flarum/common/utils/ItemList';\n\nexport default class SelectBestAnswerItem extends Component {\n oninit(vnode) {\n super.oninit(vnode);\n\n const { post, discussion } = this.attrs;\n\n this.post = post;\n this.discussion = discussion;\n }\n\n view() {\n return
  • {this.items().toArray()}
  • ;\n }\n\n getSetTime(discussion) {\n if (discussion.bestAnswerSetAt() === null) {\n return;\n }\n return humanTime(discussion.bestAnswerSetAt());\n }\n\n items() {\n const items = new ItemList();\n\n items.add(\n 'post',\n this.post ? (\n \n {icon('fas fa-check')}\n {app.translator.trans('fof-best-answer.forum.best_answer_button')}\n \n ) : (\n \n {icon('fas fa-check')}\n {app.translator.trans('fof-best-answer.forum.best_answer_button')}\n \n )\n );\n\n items.add(\n 'user',\n \n {app.translator.trans('fof-best-answer.forum.best_answer_label', {\n user: this.discussion.bestAnswerUser(),\n time_set: this.getSetTime(this.discussion),\n a: m.route.set(app.route.user(this.discussion.bestAnswerUser()))} />,\n })}\n \n );\n\n return items;\n }\n}\n","import app from 'flarum/forum/app';\nimport { extend } from 'flarum/common/extend';\nimport CommentPost from 'flarum/forum/components/CommentPost';\nimport PostComponent from 'flarum/forum/components/Post';\nimport PostMeta from 'flarum/forum/components/PostMeta';\nimport username from 'flarum/common/helpers/username';\nimport userOnline from 'flarum/common/helpers/userOnline';\nimport Link from 'flarum/common/components/Link';\nimport classList from 'flarum/common/utils/classList';\n\nimport SelectBestAnswerItem from './components/SelectBestAnswerItem';\n\nexport default () => {\n extend(CommentPost.prototype, 'headerItems', function (items) {\n const post = this.attrs.post;\n\n if (post.discussion().bestAnswerPost() && post.discussion().bestAnswerPost().id() === post.id() && !post.isHidden()) {\n items.add(\n 'isBestAnswer',\n SelectBestAnswerItem.component({\n post,\n discussion: post.discussion(),\n })\n );\n }\n });\n\n extend(CommentPost.prototype, 'footerItems', function (items) {\n const thisPost = this.attrs.post;\n const discussion = thisPost.discussion();\n const post = discussion.bestAnswerPost();\n\n const maxLines = app.forum.attribute('fof-best-answer.show_max_lines');\n\n if (post && !post.isHidden() && thisPost.number() === 1 && !thisPost.isHidden()) {\n const user = post.user();\n\n items.add(\n 'bestAnswerPost',\n
    app.current.get('stream').goToNumber(post.number())}>\n
    \n
      \n
    • \n
      \n {user && userOnline(user)}\n

      {user ? {username(user)} : username(user)}

      \n
      \n
    • \n {post.discussion() &&
    • {PostMeta.component({ post })}
    • }\n {SelectBestAnswerItem.component({\n post,\n discussion,\n })}\n
    \n
    \n
    0 && 'Post-body--truncate')} style={{ '--max-lines': maxLines }}>\n {m.trust(post.contentHtml())}\n
    \n
    ,\n -10\n );\n }\n });\n\n extend(PostComponent.prototype, 'elementAttrs', function (elementAttrs) {\n const post = this.attrs.post;\n if (post.discussion().bestAnswerPost() && post.discussion().bestAnswerPost().id() === post.id() && !post.isHidden()) {\n elementAttrs.className ? (elementAttrs.className += ' Post--bestAnswer') : (elementAttrs.className = 'Post--bestAnswer');\n }\n });\n};\n","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/components/Badge'];","import app from 'flarum/forum/app';\nimport Notification from 'flarum/forum/components/Notification';\n\nexport default class AwardedBestAnswerNotification extends Notification {\n icon() {\n return 'fas fa-check';\n }\n\n href() {\n const notification = this.attrs.notification;\n const discussion = notification.subject();\n\n return app.route.discussion(discussion);\n }\n\n content() {\n const user = this.attrs.notification.fromUser();\n return app.translator.trans('fof-best-answer.forum.notification.awarded', {\n user: user,\n });\n }\n\n excerpt() {\n return null;\n }\n}\n","import app from 'flarum/forum/app';\nimport Notification from 'flarum/forum/components/Notification';\n\nexport default class BestAnswerInDiscussionNotification extends Notification {\n icon() {\n return 'fas fa-check';\n }\n\n href() {\n const notification = this.attrs.notification;\n const discussion = notification.subject();\n\n return app.route.discussion(discussion);\n }\n\n content() {\n const user = this.attrs.notification.fromUser();\n return app.translator.trans('fof-best-answer.forum.notification.best_answer_in_discussion', {\n user: user,\n });\n }\n\n excerpt() {\n return null;\n }\n}\n","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['forum/components/NotificationGrid'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/models/User'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['forum/components/UserCard'];","export default function _extends() {\n _extends = Object.assign ? Object.assign.bind() : function (target) {\n for (var i = 1; i < arguments.length; i++) {\n var source = arguments[i];\n for (var key in source) {\n if (Object.prototype.hasOwnProperty.call(source, key)) {\n target[key] = source[key];\n }\n }\n }\n return target;\n };\n return _extends.apply(this, arguments);\n}","import SelectBestAnswerItem from './SelectBestAnswerItem';\n\nexport const components = {\n SelectBestAnswerItem,\n};\n","import app from 'flarum/forum/app';\nimport { extend } from 'flarum/common/extend';\nimport Discussion from 'flarum/common/models/Discussion';\nimport Tag from 'flarum/tags/models/Tag';\nimport Model from 'flarum/common/Model';\nimport IndexPage from 'flarum/forum/components/IndexPage';\nimport Dropdown from 'flarum/common/components/Dropdown';\nimport Button from 'flarum/common/components/Button';\nimport DiscussionListState from 'flarum/forum/states/DiscussionListState';\nimport DiscussionComposer from 'flarum/forum/components/DiscussionComposer';\n\nimport SelectBestAnswerNotification from './components/SelectBestAnswerNotification';\nimport addBestAnswerAction from './addBestAnswerAction';\nimport addBestAnswerView from './addBestAnswerView';\nimport addAnsweredBadge from './addAnsweredBadge';\nimport AwardedBestAnswerNotification from './components/AwardedBestAnswerNotification';\nimport BestAnswerInDiscussionNotification from './components/BestAnswerInDiscussionNotification';\nimport extendNotifications from './extend/extendNotifications';\nimport addBestAnswerCountToUsers from './addBestAnswerCountToUsers';\nimport addBestAnswerCountSort from '../common/addBestAnswerCountSort';\n\nexport * from './components';\n\napp.initializers.add('fof/best-answer', () => {\n Discussion.prototype.bestAnswerPost = Model.hasOne('bestAnswerPost');\n Discussion.prototype.bestAnswerUser = Model.hasOne('bestAnswerUser');\n Discussion.prototype.hasBestAnswer = Model.attribute('hasBestAnswer');\n Discussion.prototype.canSelectBestAnswer = Model.attribute('canSelectBestAnswer');\n Discussion.prototype.bestAnswerSetAt = Model.attribute('bestAnswerSetAt', Model.transformDate);\n\n if (app.initializers.has('flarum-tags')) {\n Tag.prototype.isQnA = Model.attribute('isQnA');\n }\n\n app.notificationComponents.selectBestAnswer = SelectBestAnswerNotification;\n app.notificationComponents.awardedBestAnswer = AwardedBestAnswerNotification;\n app.notificationComponents.bestAnswerInDiscussion = BestAnswerInDiscussionNotification;\n\n addAnsweredBadge();\n addBestAnswerAction();\n addBestAnswerView();\n addBestAnswerCountToUsers();\n addBestAnswerCountSort();\n\n extendNotifications();\n\n extend(IndexPage.prototype, 'sidebarItems', function (items) {\n const tag = this.currentTag();\n\n if (!tag?.isQnA?.()) return;\n\n const canStartDiscussion = app.forum.attribute('canStartDiscussion') || !app.session.user;\n const cta = items.get('newDiscussion');\n cta.children = app.translator.trans(\n canStartDiscussion ? 'fof-best-answer.forum.index.ask_question' : 'fof-best-answer.forum.index.cannot_ask_question'\n );\n\n items.replace('startDiscussion', cta);\n });\n\n extend(IndexPage.prototype, 'viewItems', function (items) {\n if (!app.forum.attribute('showBestAnswerFilterUi')) {\n return;\n }\n\n const tag = this.currentTag();\n\n if (!tag?.isQnA?.()) {\n if (app.discussions.bestAnswer) {\n delete app.discussions.bestAnswer;\n app.discussions.refresh();\n }\n\n return;\n }\n\n const options = ['all', 'solved', 'unsolved'];\n\n const selected = app.discussions.bestAnswer;\n\n items.add(\n 'solved-filter',\n Dropdown.component(\n {\n buttonClassName: 'Button',\n label: app.translator.trans(\n `fof-best-answer.forum.filter.${options[selected] || Object.keys(options).map((key) => options[key])[0]}_label`\n ),\n accessibleToggleLabel: app.translator.trans('fof-best-answer.forum.filter.accessible_label'),\n },\n Object.keys(options).map((value) => {\n const label = options[value];\n const active = (selected || Object.keys(options)[0]) === value;\n\n return Button.component(\n {\n icon: active ? 'fas fa-check' : true,\n active: active,\n onclick: () => {\n app.discussions.bestAnswer = value;\n if (value === '0') {\n delete app.discussions.bestAnswer;\n }\n app.discussions.refresh();\n },\n },\n app.translator.trans(`fof-best-answer.forum.filter.${label}_label`)\n );\n })\n )\n );\n });\n\n extend(DiscussionListState.prototype, 'requestParams', function (params) {\n if (app.discussions.bestAnswer) {\n const negate = app.discussions.bestAnswer === '2';\n const prepend = negate ? '-' : '';\n\n params.filter[`${prepend}solved-discussions`] = true;\n\n if (params.filter.q) {\n params.filter.q += ` ${prepend}is:solved`;\n }\n }\n });\n\n extend(DiscussionComposer.prototype, 'headerItems', function (items) {\n const tags = this.composer.fields.tags;\n if (tags === undefined) return;\n\n const qna = tags.some((t) => t.isQnA());\n\n if (!qna) return;\n\n this.attrs.titlePlaceholder = app.translator.trans('fof-best-answer.forum.composer.titlePlaceholder');\n\n items.replace(\n 'discussionTitle',\n

    \n \n

    \n );\n });\n});\n","import { override } from 'flarum/common/extend';\n\nexport default () => {\n const FoFUserDirectory = require('@fof-user-directory');\n\n if (!FoFUserDirectory) return;\n\n override(FoFUserDirectory.SortMap.prototype, 'sortMap', (map) => ({\n ...map(),\n most_best_answers: '-bestAnswerCount',\n least_best_answers: 'bestAnswerCount',\n }));\n};\n","import app from 'flarum/forum/app';\nimport { extend } from 'flarum/common/extend';\nimport Badge from 'flarum/common/components/Badge';\nimport Discussion from 'flarum/common/models/Discussion';\nimport ItemList from 'flarum/common/utils/ItemList';\n\nexport default function () {\n extend(Discussion.prototype, 'badges', function (items: ItemList) {\n if (this.hasBestAnswer() && !items.has('hidden')) {\n items.add('bestAnswer', );\n }\n });\n}\n","import app from 'flarum/forum/app';\nimport { extend } from 'flarum/common/extend';\nimport Model from 'flarum/common/Model';\nimport User from 'flarum/common/models/User';\nimport ItemList from 'flarum/common/utils/ItemList';\nimport UserCard from 'flarum/forum/components/UserCard';\nimport icon from 'flarum/common/helpers/icon';\n\nimport type Mithril from 'mithril';\n\nexport default function addBestAnswerCountToUsers() {\n User.prototype.bestAnswerCount = Model.attribute('bestAnswerCount');\n\n extend(UserCard.prototype, 'infoItems', function (items: ItemList) {\n const user = this.attrs.user;\n\n items.add(\n 'best-answer-count',\n \n {icon('fas fa-check')}\n {app.translator.trans('fof-best-answer.forum.user.best-answer-count', {\n count: user.bestAnswerCount(),\n })}\n ,\n 55\n );\n });\n}\n","import app from 'flarum/forum/app';\nimport { extend } from 'flarum/common/extend';\nimport ItemList from 'flarum/common/utils/ItemList';\nimport NotificationGrid from 'flarum/forum/components/NotificationGrid';\n\nexport default function () {\n extend(NotificationGrid.prototype, 'notificationTypes', function (items: ItemList) {\n items.add('awardedBestAnswer', {\n name: 'awardedBestAnswer',\n icon: 'fas fa-check',\n label: app.translator.trans('fof-best-answer.forum.notification.preferences.awarded_best_answer'),\n });\n items.add('bestAnswerInDiscussion', {\n name: 'bestAnswerInDiscussion',\n icon: 'fas fa-check',\n label: app.translator.trans('fof-best-answer.forum.notification.preferences.best_answer_in_discussion'),\n });\n items.add('selectBestAnswer', {\n name: 'selectBestAnswer',\n icon: 'fas fa-stopwatch',\n label: app.translator.trans('fof-best-answer.forum.notification.preferences.select_best_answer'),\n });\n });\n}\n"],"names":["module","exports","flarum","extensions","__webpack_module_cache__","__webpack_require__","moduleId","cachedModule","undefined","__webpack_modules__","n","getter","__esModule","d","a","definition","key","o","Object","defineProperty","enumerable","get","obj","prop","prototype","hasOwnProperty","call","r","Symbol","toStringTag","value","core","compat","_setPrototypeOf","p","setPrototypeOf","bind","__proto__","_inheritsLoose","subClass","superClass","create","constructor","SelectBestAnswerNotification","_Notification","apply","arguments","_proto","icon","href","discussion","this","attrs","notification","subject","app","content","trans","excerpt","Notification","SelectBestAnswerItem","_Component","oninit","vnode","_this$attrs","post","view","m","className","items","toArray","getSetTime","bestAnswerSetAt","humanTime","_this","ItemList","add","Link","number","user","bestAnswerUser","time_set","onclick","route","set","Component","AwardedBestAnswerNotification","fromUser","BestAnswerInDiscussionNotification","_extends","assign","target","i","length","source","components","ineligible","blockSelectOwnPost","isThisBestAnswer","actionLabel","getBestAnswerTags","saveDiscussion","FoFUserDirectory","Discussion","bestAnswerPost","Model","hasBestAnswer","canSelectBestAnswer","has","Tag","isQnA","selectBestAnswer","awardedBestAnswer","bestAnswerInDiscussion","extend","Badge","type","label","isHidden","attribute","id","isBestAnswer","tagIds","all","filter","t","includes","save","bestAnswerPostId","bestAnswerUserId","relationships","data","then","_discussion$data$rela","discussionTags","tags","push","map","_step","_loop","tag","index","findIndex","splice","_iterator","_createForOfIteratorHelperLoose","done","matches","DiscussionPage","update","redraw","PostControls","pushAttributes","contentType","Button","CommentPost","component","thisPost","maxLines","goToNumber","userOnline","username","PostMeta","classList","style","trust","contentHtml","PostComponent","elementAttrs","User","bestAnswerCount","UserCard","count","require","override","SortMap","most_best_answers","least_best_answers","NotificationGrid","name","IndexPage","currentTag","canStartDiscussion","cta","children","replace","options","selected","bestAnswer","Dropdown","buttonClassName","keys","accessibleToggleLabel","active","refresh","DiscussionListState","params","prepend","q","DiscussionComposer","composer","fields","some","titlePlaceholder","bidi","title","placeholder","disabled","onkeydown"],"sourceRoot":""} \ No newline at end of file +{"version":3,"file":"forum.js","mappings":"kCAAAA,EAAOC,QAAUC,OAAOC,WAAW,qB,GCC/BC,EAA2B,CAAC,EAGhC,SAASC,EAAoBC,GAE5B,IAAIC,EAAeH,EAAyBE,GAC5C,QAAqBE,IAAjBD,EACH,OAAOA,EAAaN,QAGrB,IAAID,EAASI,EAAyBE,GAAY,CAGjDL,QAAS,CAAC,GAOX,OAHAQ,EAAoBH,GAAUN,EAAQA,EAAOC,QAASI,GAG/CL,EAAOC,OACf,CCrBAI,EAAoBK,EAAKV,IACxB,IAAIW,EAASX,GAAUA,EAAOY,WAC7B,IAAOZ,EAAiB,QACxB,IAAM,EAEP,OADAK,EAAoBQ,EAAEF,EAAQ,CAAEG,EAAGH,IAC5BA,CAAM,ECLdN,EAAoBQ,EAAI,CAACZ,EAASc,KACjC,IAAI,IAAIC,KAAOD,EACXV,EAAoBY,EAAEF,EAAYC,KAASX,EAAoBY,EAAEhB,EAASe,IAC5EE,OAAOC,eAAelB,EAASe,EAAK,CAAEI,YAAY,EAAMC,IAAKN,EAAWC,IAE1E,ECNDX,EAAoBY,EAAI,CAACK,EAAKC,IAAUL,OAAOM,UAAUC,eAAeC,KAAKJ,EAAKC,GCClFlB,EAAoBsB,EAAK1B,IACH,oBAAX2B,QAA0BA,OAAOC,aAC1CX,OAAOC,eAAelB,EAAS2B,OAAOC,YAAa,CAAEC,MAAO,WAE7DZ,OAAOC,eAAelB,EAAS,aAAc,CAAE6B,OAAO,GAAO,E,8DCL9D,MAAM,EAA+B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BqH,oBACXrH,IAAAA,YAAgBqH,WACvBrH,IAAAA,YAAgB2H,UAPpB,CAgDF,KAEAjE,EAAAA,EAAAA,QAAOkE,IAAAA,UAA+B,iBAAiB,SAAUtD,GAC/D,GAAItE,IAAAA,YAAgBqH,WAAY,CAC9B,IACMQ,EADwC,MAA/B7H,IAAAA,YAAgBqH,WACN,IAAM,GAE/B/C,EAAOwD,OAAUD,EAAO,uBAAwB,EAE5CvD,EAAOwD,OAAOC,IAChBzD,EAAOwD,OAAOC,GAAK,IAAIF,EAAO,YAElC,CACF,KAEAnE,EAAAA,EAAAA,QAAOsE,IAAAA,UAA8B,eAAe,SAAUlH,GAC5D,IAAMmH,EAAOrI,KAAKsI,SAASC,OAAOF,UACrBhL,IAATgL,GAEQA,EAAKG,MAAK,SAACC,GAAC,OAAKA,EAAE/E,OAAO,MAItC1D,KAAKC,MAAMyI,iBAAmBtI,IAAAA,WAAeE,MAAM,mDAEnDY,EAAMoG,QACJ,kBACAtG,EAAA,UACEA,EAAA,SACEC,UAAU,cACV0H,KAAM3I,KAAK4I,MACXC,YAAa7I,KAAKC,MAAMyI,iBACxBI,WAAY9I,KAAKC,MAAM6I,SACvBC,UAAW/I,KAAK+I,UAAU9J,KAAKe,UAIvC,GACF,G","sources":["webpack://@fof/best-answer/external assign \"flarum.extensions['fof-user-directory']\"","webpack://@fof/best-answer/webpack/bootstrap","webpack://@fof/best-answer/webpack/runtime/compat get default export","webpack://@fof/best-answer/webpack/runtime/define property getters","webpack://@fof/best-answer/webpack/runtime/hasOwnProperty shorthand","webpack://@fof/best-answer/webpack/runtime/make namespace object","webpack://@fof/best-answer/external root \"flarum.core.compat['forum/app']\"","webpack://@fof/best-answer/external root \"flarum.core.compat['common/extend']\"","webpack://@fof/best-answer/external root \"flarum.core.compat['common/models/Discussion']\"","webpack://@fof/best-answer/external root \"flarum.core.compat['tags/models/Tag']\"","webpack://@fof/best-answer/external root \"flarum.core.compat['common/Model']\"","webpack://@fof/best-answer/external root \"flarum.core.compat['forum/components/IndexPage']\"","webpack://@fof/best-answer/external root \"flarum.core.compat['common/components/Dropdown']\"","webpack://@fof/best-answer/external root \"flarum.core.compat['common/components/Button']\"","webpack://@fof/best-answer/external root \"flarum.core.compat['forum/states/DiscussionListState']\"","webpack://@fof/best-answer/external root \"flarum.core.compat['forum/components/DiscussionComposer']\"","webpack://@fof/best-answer/./node_modules/@babel/runtime/helpers/esm/setPrototypeOf.js","webpack://@fof/best-answer/./node_modules/@babel/runtime/helpers/esm/inheritsLoose.js","webpack://@fof/best-answer/external root \"flarum.core.compat['forum/components/Notification']\"","webpack://@fof/best-answer/./src/forum/components/SelectBestAnswerNotification.js","webpack://@fof/best-answer/external root \"flarum.core.compat['forum/utils/PostControls']\"","webpack://@fof/best-answer/external root \"flarum.core.compat['forum/components/DiscussionPage']\"","webpack://@fof/best-answer/external root \"flarum.core.compat['forum/components/CommentPost']\"","webpack://@fof/best-answer/./src/forum/addBestAnswerAction.js","webpack://@fof/best-answer/external root \"flarum.core.compat['forum/components/Post']\"","webpack://@fof/best-answer/external root \"flarum.core.compat['forum/components/PostMeta']\"","webpack://@fof/best-answer/external root \"flarum.core.compat['common/helpers/username']\"","webpack://@fof/best-answer/external root \"flarum.core.compat['common/helpers/userOnline']\"","webpack://@fof/best-answer/external root \"flarum.core.compat['common/components/Link']\"","webpack://@fof/best-answer/external root \"flarum.core.compat['common/utils/classList']\"","webpack://@fof/best-answer/external root \"flarum.core.compat['common/Component']\"","webpack://@fof/best-answer/external root \"flarum.core.compat['common/helpers/icon']\"","webpack://@fof/best-answer/external root \"flarum.core.compat['common/helpers/humanTime']\"","webpack://@fof/best-answer/external root \"flarum.core.compat['common/utils/ItemList']\"","webpack://@fof/best-answer/./src/forum/components/SelectBestAnswerItem.js","webpack://@fof/best-answer/./src/forum/addBestAnswerView.js","webpack://@fof/best-answer/external root \"flarum.core.compat['common/components/Badge']\"","webpack://@fof/best-answer/./src/forum/components/AwardedBestAnswerNotification.js","webpack://@fof/best-answer/./src/forum/components/BestAnswerInDiscussionNotification.js","webpack://@fof/best-answer/external root \"flarum.core.compat['forum/components/NotificationGrid']\"","webpack://@fof/best-answer/external root \"flarum.core.compat['common/models/User']\"","webpack://@fof/best-answer/external root \"flarum.core.compat['forum/components/UserCard']\"","webpack://@fof/best-answer/./node_modules/@babel/runtime/helpers/esm/extends.js","webpack://@fof/best-answer/./src/forum/components/index.js","webpack://@fof/best-answer/./src/forum/index.js","webpack://@fof/best-answer/./src/common/addBestAnswerCountSort.ts","webpack://@fof/best-answer/./src/forum/addAnsweredBadge.tsx","webpack://@fof/best-answer/./src/forum/addBestAnswerCountToUsers.tsx","webpack://@fof/best-answer/./src/forum/extend/extendNotifications.ts"],"sourcesContent":["module.exports = flarum.extensions['fof-user-directory'];","// The module cache\nvar __webpack_module_cache__ = {};\n\n// The require function\nfunction __webpack_require__(moduleId) {\n\t// Check if module is in cache\n\tvar cachedModule = __webpack_module_cache__[moduleId];\n\tif (cachedModule !== undefined) {\n\t\treturn cachedModule.exports;\n\t}\n\t// Create a new module (and put it into the cache)\n\tvar module = __webpack_module_cache__[moduleId] = {\n\t\t// no module.id needed\n\t\t// no module.loaded needed\n\t\texports: {}\n\t};\n\n\t// Execute the module function\n\t__webpack_modules__[moduleId](module, module.exports, __webpack_require__);\n\n\t// Return the exports of the module\n\treturn module.exports;\n}\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['forum/app'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/extend'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/models/Discussion'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['tags/models/Tag'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/Model'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['forum/components/IndexPage'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/components/Dropdown'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/components/Button'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['forum/states/DiscussionListState'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['forum/components/DiscussionComposer'];","export default function _setPrototypeOf(o, p) {\n _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) {\n o.__proto__ = p;\n return o;\n };\n return _setPrototypeOf(o, p);\n}","import setPrototypeOf from \"./setPrototypeOf.js\";\nexport default function _inheritsLoose(subClass, superClass) {\n subClass.prototype = Object.create(superClass.prototype);\n subClass.prototype.constructor = subClass;\n setPrototypeOf(subClass, superClass);\n}","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['forum/components/Notification'];","import app from 'flarum/forum/app';\nimport Notification from 'flarum/forum/components/Notification';\n\nexport default class SelectBestAnswerNotification extends Notification {\n icon() {\n return 'fas fa-comment-dots';\n }\n\n href() {\n const notification = this.attrs.notification;\n const discussion = notification.subject();\n\n return app.route.discussion(discussion);\n }\n\n content() {\n return app.translator.trans('fof-best-answer.forum.notification.content');\n }\n\n excerpt() {\n return null;\n }\n}\n","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['forum/utils/PostControls'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['forum/components/DiscussionPage'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['forum/components/CommentPost'];","import app from 'flarum/forum/app';\nimport { extend } from 'flarum/common/extend';\nimport Button from 'flarum/common/components/Button';\nimport PostControls from 'flarum/forum/utils/PostControls';\nimport DiscussionPage from 'flarum/forum/components/DiscussionPage';\nimport CommentPost from 'flarum/forum/components/CommentPost';\n\nexport default () => {\n const ineligible = (discussion, post) => {\n return post.isHidden() || post.number() === 1 || !discussion.canSelectBestAnswer() || !app.session.user;\n };\n\n const blockSelectOwnPost = (post) => {\n return !app.forum.attribute('canSelectBestAnswerOwnPost') && post.user() && post.user().id() === app.session.user.id();\n };\n\n const isThisBestAnswer = (discussion, post) => {\n return discussion.hasBestAnswer() && discussion.bestAnswerPost() && discussion.bestAnswerPost().id() === post.id();\n };\n\n const actionLabel = (isBestAnswer) => {\n return app.translator.trans(isBestAnswer ? 'fof-best-answer.forum.remove_best_answer' : 'fof-best-answer.forum.this_best_answer');\n };\n\n const saveDiscussion = (discussion, isBestAnswer, post) =>\n discussion\n .save(\n {\n bestAnswerPostId: isBestAnswer ? post.id() : 0,\n bestAnswerUserId: app.session.user.id(),\n relationships: isBestAnswer ? { bestAnswerPost: post, bestAnswerUser: app.session.user } : { bestAnswerPost: null },\n },\n {\n params: {\n include: 'tags',\n },\n }\n )\n .then(() => {\n if (!isBestAnswer) {\n delete discussion.data.relationships.bestAnswerPost;\n delete discussion.data.relationships.bestAnswerUser;\n }\n\n if (app.current.matches(DiscussionPage)) {\n app.current.get('stream').update();\n }\n\n m.redraw();\n\n if (isBestAnswer) {\n m.route.set(app.route.discussion(discussion));\n }\n });\n\n extend(PostControls, 'moderationControls', function (items, post) {\n if (app.forum.attribute('useAlternativeBestAnswerUi')) return;\n\n const discussion = post.discussion();\n let isBestAnswer = isThisBestAnswer(discussion, post);\n\n post.pushAttributes({ isBestAnswer });\n\n if (post.contentType() !== 'comment') return;\n\n if (ineligible(discussion, post) || blockSelectOwnPost(post) || !app.current.matches(DiscussionPage)) return;\n\n items.add(\n 'bestAnswer',\n Button.component(\n {\n icon: `fa${isBestAnswer ? 's' : 'r'} fa-comment-dots`,\n onclick: () => {\n isBestAnswer = !isBestAnswer;\n\n saveDiscussion(discussion, isBestAnswer, post).finally(() => {\n isBestAnswer = isThisBestAnswer(discussion, post);\n });\n },\n },\n actionLabel(isBestAnswer)\n )\n );\n });\n\n extend(CommentPost.prototype, 'actionItems', function (items) {\n if (!app.forum.attribute('useAlternativeBestAnswerUi')) return;\n\n const post = this.attrs.post;\n const discussion = this.attrs.post.discussion();\n let isBestAnswer = isThisBestAnswer(discussion, post);\n let hasBestAnswer = discussion.bestAnswerPost() !== false;\n\n post.pushAttributes({ isBestAnswer });\n\n if (ineligible(discussion, post) || blockSelectOwnPost(post) || !app.current.matches(DiscussionPage)) return;\n\n items.add(\n 'bestAnswer',\n Button.component(\n {\n className: `Button Button--${!hasBestAnswer || isBestAnswer ? 'primary' : 'link'}`,\n onclick: function onclick() {\n hasBestAnswer = !hasBestAnswer;\n isBestAnswer = !isBestAnswer;\n\n saveDiscussion(discussion, isBestAnswer, post).finally(() => {\n hasBestAnswer = discussion.hasBestAnswer() && discussion.bestAnswerPost() !== false;\n isBestAnswer = isThisBestAnswer(discussion, post);\n });\n },\n },\n actionLabel(isBestAnswer)\n )\n );\n });\n};\n","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['forum/components/Post'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['forum/components/PostMeta'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/helpers/username'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/helpers/userOnline'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/components/Link'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/utils/classList'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/Component'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/helpers/icon'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/helpers/humanTime'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/utils/ItemList'];","import app from 'flarum/forum/app';\nimport Component from 'flarum/common/Component';\nimport icon from 'flarum/common/helpers/icon';\nimport humanTime from 'flarum/common/helpers/humanTime';\nimport Link from 'flarum/common/components/Link';\nimport ItemList from 'flarum/common/utils/ItemList';\n\nexport default class SelectBestAnswerItem extends Component {\n oninit(vnode) {\n super.oninit(vnode);\n\n const { post, discussion } = this.attrs;\n\n this.post = post;\n this.discussion = discussion;\n }\n\n view() {\n return
  • {this.items().toArray()}
  • ;\n }\n\n getSetTime(discussion) {\n if (discussion.bestAnswerSetAt() === null) {\n return;\n }\n return humanTime(discussion.bestAnswerSetAt());\n }\n\n items() {\n const items = new ItemList();\n\n items.add(\n 'post',\n this.post ? (\n \n {icon('fas fa-check')}\n {app.translator.trans('fof-best-answer.forum.best_answer_button')}\n \n ) : (\n \n {icon('fas fa-check')}\n {app.translator.trans('fof-best-answer.forum.best_answer_button')}\n \n )\n );\n\n items.add(\n 'user',\n \n {app.translator.trans('fof-best-answer.forum.best_answer_label', {\n user: this.discussion.bestAnswerUser(),\n time_set: this.getSetTime(this.discussion),\n a:
    m.route.set(app.route.user(this.discussion.bestAnswerUser()))} />,\n })}\n \n );\n\n return items;\n }\n}\n","import app from 'flarum/forum/app';\nimport { extend } from 'flarum/common/extend';\nimport CommentPost from 'flarum/forum/components/CommentPost';\nimport PostComponent from 'flarum/forum/components/Post';\nimport PostMeta from 'flarum/forum/components/PostMeta';\nimport username from 'flarum/common/helpers/username';\nimport userOnline from 'flarum/common/helpers/userOnline';\nimport Link from 'flarum/common/components/Link';\nimport classList from 'flarum/common/utils/classList';\n\nimport SelectBestAnswerItem from './components/SelectBestAnswerItem';\n\nexport default () => {\n extend(CommentPost.prototype, 'headerItems', function (items) {\n const post = this.attrs.post;\n const discussion = post.discussion();\n\n if (discussion?.hasBestAnswer() && discussion.bestAnswerPost() && discussion.bestAnswerPost().id() === post.id() && !post.isHidden()) {\n items.add(\n 'isBestAnswer',\n SelectBestAnswerItem.component({\n post,\n discussion: post.discussion(),\n })\n );\n }\n });\n\n extend(CommentPost.prototype, 'footerItems', function (items) {\n const thisPost = this.attrs.post;\n const discussion = thisPost.discussion();\n const post = discussion.hasBestAnswer() && discussion.bestAnswerPost();\n\n const maxLines = app.forum.attribute('fof-best-answer.show_max_lines');\n\n if (post && !post.isHidden() && thisPost.number() === 1 && !thisPost.isHidden()) {\n const user = post.user();\n\n items.add(\n 'bestAnswerPost',\n
    app.current.get('stream').goToNumber(post.number())}>\n
    \n
      \n
    • \n
      \n {user && userOnline(user)}\n

      {user ? {username(user)} : username(user)}

      \n
      \n
    • \n {post.discussion() &&
    • {PostMeta.component({ post })}
    • }\n {SelectBestAnswerItem.component({\n post,\n discussion,\n })}\n
    \n
    \n
    0 && 'Post-body--truncate')} style={{ '--max-lines': maxLines }}>\n {m.trust(post.contentHtml())}\n
    \n
    ,\n -10\n );\n }\n });\n\n extend(PostComponent.prototype, 'elementAttrs', function (elementAttrs) {\n const post = this.attrs.post;\n const discussion = post.discussion();\n\n if (discussion?.hasBestAnswer() && discussion.bestAnswerPost() && discussion.bestAnswerPost().id() === post.id() && !post.isHidden()) {\n elementAttrs.className ? (elementAttrs.className += ' Post--bestAnswer') : (elementAttrs.className = 'Post--bestAnswer');\n }\n });\n};\n","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/components/Badge'];","import app from 'flarum/forum/app';\nimport Notification from 'flarum/forum/components/Notification';\n\nexport default class AwardedBestAnswerNotification extends Notification {\n icon() {\n return 'fas fa-check';\n }\n\n href() {\n const notification = this.attrs.notification;\n const discussion = notification.subject();\n\n return app.route.discussion(discussion);\n }\n\n content() {\n const user = this.attrs.notification.fromUser();\n return app.translator.trans('fof-best-answer.forum.notification.awarded', {\n user: user,\n });\n }\n\n excerpt() {\n return null;\n }\n}\n","import app from 'flarum/forum/app';\nimport Notification from 'flarum/forum/components/Notification';\n\nexport default class BestAnswerInDiscussionNotification extends Notification {\n icon() {\n return 'fas fa-check';\n }\n\n href() {\n const notification = this.attrs.notification;\n const discussion = notification.subject();\n\n return app.route.discussion(discussion);\n }\n\n content() {\n const user = this.attrs.notification.fromUser();\n return app.translator.trans('fof-best-answer.forum.notification.best_answer_in_discussion', {\n user: user,\n });\n }\n\n excerpt() {\n return null;\n }\n}\n","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['forum/components/NotificationGrid'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/models/User'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['forum/components/UserCard'];","export default function _extends() {\n _extends = Object.assign ? Object.assign.bind() : function (target) {\n for (var i = 1; i < arguments.length; i++) {\n var source = arguments[i];\n for (var key in source) {\n if (Object.prototype.hasOwnProperty.call(source, key)) {\n target[key] = source[key];\n }\n }\n }\n return target;\n };\n return _extends.apply(this, arguments);\n}","import SelectBestAnswerItem from './SelectBestAnswerItem';\n\nexport const components = {\n SelectBestAnswerItem,\n};\n","import app from 'flarum/forum/app';\nimport { extend } from 'flarum/common/extend';\nimport Discussion from 'flarum/common/models/Discussion';\nimport Tag from 'flarum/tags/models/Tag';\nimport Model from 'flarum/common/Model';\nimport IndexPage from 'flarum/forum/components/IndexPage';\nimport Dropdown from 'flarum/common/components/Dropdown';\nimport Button from 'flarum/common/components/Button';\nimport DiscussionListState from 'flarum/forum/states/DiscussionListState';\nimport DiscussionComposer from 'flarum/forum/components/DiscussionComposer';\n\nimport SelectBestAnswerNotification from './components/SelectBestAnswerNotification';\nimport addBestAnswerAction from './addBestAnswerAction';\nimport addBestAnswerView from './addBestAnswerView';\nimport addAnsweredBadge from './addAnsweredBadge';\nimport AwardedBestAnswerNotification from './components/AwardedBestAnswerNotification';\nimport BestAnswerInDiscussionNotification from './components/BestAnswerInDiscussionNotification';\nimport extendNotifications from './extend/extendNotifications';\nimport addBestAnswerCountToUsers from './addBestAnswerCountToUsers';\nimport addBestAnswerCountSort from '../common/addBestAnswerCountSort';\n\nexport * from './components';\n\napp.initializers.add('fof/best-answer', () => {\n Discussion.prototype.bestAnswerPost = Model.hasOne('bestAnswerPost');\n Discussion.prototype.bestAnswerUser = Model.hasOne('bestAnswerUser');\n Discussion.prototype.hasBestAnswer = Model.attribute('hasBestAnswer');\n Discussion.prototype.canSelectBestAnswer = Model.attribute('canSelectBestAnswer');\n Discussion.prototype.bestAnswerSetAt = Model.attribute('bestAnswerSetAt', Model.transformDate);\n\n if (app.initializers.has('flarum-tags')) {\n Tag.prototype.isQnA = Model.attribute('isQnA');\n }\n\n app.notificationComponents.selectBestAnswer = SelectBestAnswerNotification;\n app.notificationComponents.awardedBestAnswer = AwardedBestAnswerNotification;\n app.notificationComponents.bestAnswerInDiscussion = BestAnswerInDiscussionNotification;\n\n addAnsweredBadge();\n addBestAnswerAction();\n addBestAnswerView();\n addBestAnswerCountToUsers();\n addBestAnswerCountSort();\n\n extendNotifications();\n\n extend(IndexPage.prototype, 'sidebarItems', function (items) {\n const tag = this.currentTag();\n\n if (!tag?.isQnA?.()) return;\n\n const canStartDiscussion = app.forum.attribute('canStartDiscussion') || !app.session.user;\n const cta = items.get('newDiscussion');\n cta.children = app.translator.trans(\n canStartDiscussion ? 'fof-best-answer.forum.index.ask_question' : 'fof-best-answer.forum.index.cannot_ask_question'\n );\n\n items.replace('startDiscussion', cta);\n });\n\n extend(IndexPage.prototype, 'viewItems', function (items) {\n if (!app.forum.attribute('showBestAnswerFilterUi')) {\n return;\n }\n\n const tag = this.currentTag();\n\n if (!tag?.isQnA?.()) {\n if (app.discussions.bestAnswer) {\n delete app.discussions.bestAnswer;\n app.discussions.refresh();\n }\n\n return;\n }\n\n const options = ['all', 'solved', 'unsolved'];\n\n const selected = app.discussions.bestAnswer;\n\n items.add(\n 'solved-filter',\n Dropdown.component(\n {\n buttonClassName: 'Button',\n label: app.translator.trans(\n `fof-best-answer.forum.filter.${options[selected] || Object.keys(options).map((key) => options[key])[0]}_label`\n ),\n accessibleToggleLabel: app.translator.trans('fof-best-answer.forum.filter.accessible_label'),\n },\n Object.keys(options).map((value) => {\n const label = options[value];\n const active = (selected || Object.keys(options)[0]) === value;\n\n return Button.component(\n {\n icon: active ? 'fas fa-check' : true,\n active: active,\n onclick: () => {\n app.discussions.bestAnswer = value;\n if (value === '0') {\n delete app.discussions.bestAnswer;\n }\n app.discussions.refresh();\n },\n },\n app.translator.trans(`fof-best-answer.forum.filter.${label}_label`)\n );\n })\n )\n );\n });\n\n extend(DiscussionListState.prototype, 'requestParams', function (params) {\n if (app.discussions.bestAnswer) {\n const negate = app.discussions.bestAnswer === '2';\n const prepend = negate ? '-' : '';\n\n params.filter[`${prepend}solved-discussions`] = true;\n\n if (params.filter.q) {\n params.filter.q += ` ${prepend}is:solved`;\n }\n }\n });\n\n extend(DiscussionComposer.prototype, 'headerItems', function (items) {\n const tags = this.composer.fields.tags;\n if (tags === undefined) return;\n\n const qna = tags.some((t) => t.isQnA());\n\n if (!qna) return;\n\n this.attrs.titlePlaceholder = app.translator.trans('fof-best-answer.forum.composer.titlePlaceholder');\n\n items.replace(\n 'discussionTitle',\n

    \n \n

    \n );\n });\n});\n","import { override } from 'flarum/common/extend';\n\nexport default () => {\n const FoFUserDirectory = require('@fof-user-directory');\n\n if (!FoFUserDirectory) return;\n\n override(FoFUserDirectory.SortMap.prototype, 'sortMap', (map) => ({\n ...map(),\n most_best_answers: '-bestAnswerCount',\n least_best_answers: 'bestAnswerCount',\n }));\n};\n","import app from 'flarum/forum/app';\nimport { extend } from 'flarum/common/extend';\nimport Badge from 'flarum/common/components/Badge';\nimport Discussion from 'flarum/common/models/Discussion';\n\nexport default function () {\n extend(Discussion.prototype, 'badges', function (this: Discussion, items) {\n if (this.hasBestAnswer() && !items.has('hidden')) {\n items.add('bestAnswer', );\n }\n });\n}\n","import app from 'flarum/forum/app';\nimport { extend } from 'flarum/common/extend';\nimport Model from 'flarum/common/Model';\nimport User from 'flarum/common/models/User';\nimport ItemList from 'flarum/common/utils/ItemList';\nimport UserCard from 'flarum/forum/components/UserCard';\nimport icon from 'flarum/common/helpers/icon';\n\nimport type Mithril from 'mithril';\n\nexport default function addBestAnswerCountToUsers() {\n User.prototype.bestAnswerCount = Model.attribute('bestAnswerCount');\n\n extend(UserCard.prototype, 'infoItems', function (items: ItemList) {\n const user = this.attrs.user;\n\n items.add(\n 'best-answer-count',\n \n {icon('fas fa-check')}\n {app.translator.trans('fof-best-answer.forum.user.best-answer-count', {\n count: user.bestAnswerCount(),\n })}\n ,\n 55\n );\n });\n}\n","import app from 'flarum/forum/app';\nimport { extend } from 'flarum/common/extend';\nimport ItemList from 'flarum/common/utils/ItemList';\nimport NotificationGrid from 'flarum/forum/components/NotificationGrid';\n\nexport default function () {\n extend(NotificationGrid.prototype, 'notificationTypes', function (items: ItemList) {\n items.add('awardedBestAnswer', {\n name: 'awardedBestAnswer',\n icon: 'fas fa-check',\n label: app.translator.trans('fof-best-answer.forum.notification.preferences.awarded_best_answer'),\n });\n items.add('bestAnswerInDiscussion', {\n name: 'bestAnswerInDiscussion',\n icon: 'fas fa-check',\n label: app.translator.trans('fof-best-answer.forum.notification.preferences.best_answer_in_discussion'),\n });\n items.add('selectBestAnswer', {\n name: 'selectBestAnswer',\n icon: 'fas fa-stopwatch',\n label: app.translator.trans('fof-best-answer.forum.notification.preferences.select_best_answer'),\n });\n });\n}\n"],"names":["module","exports","flarum","extensions","__webpack_module_cache__","__webpack_require__","moduleId","cachedModule","undefined","__webpack_modules__","n","getter","__esModule","d","a","definition","key","o","Object","defineProperty","enumerable","get","obj","prop","prototype","hasOwnProperty","call","r","Symbol","toStringTag","value","core","compat","_setPrototypeOf","p","setPrototypeOf","bind","__proto__","_inheritsLoose","subClass","superClass","create","constructor","SelectBestAnswerNotification","_Notification","apply","arguments","_proto","icon","href","discussion","this","attrs","notification","subject","app","content","trans","excerpt","Notification","SelectBestAnswerItem","_Component","oninit","vnode","_this$attrs","post","view","m","className","items","toArray","getSetTime","bestAnswerSetAt","humanTime","_this","ItemList","add","Link","number","user","bestAnswerUser","time_set","onclick","route","set","Component","AwardedBestAnswerNotification","fromUser","BestAnswerInDiscussionNotification","_extends","assign","target","i","length","source","components","ineligible","blockSelectOwnPost","isThisBestAnswer","actionLabel","saveDiscussion","FoFUserDirectory","Discussion","bestAnswerPost","Model","hasBestAnswer","canSelectBestAnswer","has","Tag","isQnA","selectBestAnswer","awardedBestAnswer","bestAnswerInDiscussion","extend","Badge","type","label","isHidden","attribute","id","isBestAnswer","save","bestAnswerPostId","bestAnswerUserId","relationships","params","include","then","data","matches","DiscussionPage","update","redraw","PostControls","pushAttributes","contentType","Button","CommentPost","component","thisPost","maxLines","goToNumber","userOnline","username","PostMeta","classList","style","trust","contentHtml","PostComponent","elementAttrs","User","bestAnswerCount","UserCard","count","require","override","SortMap","map","most_best_answers","least_best_answers","NotificationGrid","name","IndexPage","tag","currentTag","canStartDiscussion","cta","children","replace","options","selected","bestAnswer","Dropdown","buttonClassName","keys","accessibleToggleLabel","active","refresh","DiscussionListState","prepend","filter","q","DiscussionComposer","tags","composer","fields","some","t","titlePlaceholder","bidi","title","placeholder","disabled","onkeydown"],"sourceRoot":""} \ No newline at end of file