From 83f80ac28977ce1ee482575c4cce7774f4c33c77 Mon Sep 17 00:00:00 2001 From: flarum-bot Date: Sun, 10 Nov 2024 08:51:08 +0000 Subject: [PATCH] Bundled output for commit f80781de3c36f5446eef123eed7744deff784bff 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 4dd6c5d..38aec45 100755 --- a/js/dist/forum.js +++ b/js/dist/forum.js @@ -1,3 +1,3 @@ /*! For license information please see forum.js.LICENSE.txt */ -(()=>{var t={976:(t,o,n)=>{var e=/^\s+|\s+$/g,r=/^[-+]0x[0-9a-f]+$/i,a=/^0b[01]+$/i,i=/^0o[0-7]+$/i,s=parseInt,c="object"==typeof n.g&&n.g&&n.g.Object===Object&&n.g,u="object"==typeof self&&self&&self.Object===Object&&self,l=c||u||Function("return this")(),f=Object.prototype.toString,m=Math.max,p=Math.min,d=function(){return l.Date.now()};function v(t){var o=typeof t;return!!t&&("object"==o||"function"==o)}function h(t){if("number"==typeof t)return t;if(function(t){return"symbol"==typeof t||function(t){return!!t&&"object"==typeof t}(t)&&"[object Symbol]"==f.call(t)}(t))return NaN;if(v(t)){var o="function"==typeof t.valueOf?t.valueOf():t;t=v(o)?o+"":o}if("string"!=typeof t)return 0===t?t:+t;t=t.replace(e,"");var n=a.test(t);return n||i.test(t)?s(t.slice(2),n?2:8):r.test(t)?NaN:+t}t.exports=function(t,o,n){var e,r,a,i,s,c,u=0,l=!1,f=!1,g=!0;if("function"!=typeof t)throw new TypeError("Expected a function");function y(o){var n=e,a=r;return e=r=void 0,u=o,i=t.apply(a,n)}function b(t){var n=t-c;return void 0===c||n>=o||n<0||f&&t-u>=a}function w(){var t=d();if(b(t))return N(t);s=setTimeout(w,function(t){var n=o-(t-c);return f?p(n,a-(t-u)):n}(t))}function N(t){return s=void 0,g&&e?y(t):(e=r=void 0,i)}function x(){var t=d(),n=b(t);if(e=arguments,r=this,c=t,n){if(void 0===s)return function(t){return u=t,s=setTimeout(w,o),l?y(t):i}(c);if(f)return s=setTimeout(w,o),y(c)}return void 0===s&&(s=setTimeout(w,o)),i}return o=h(o)||0,v(n)&&(l=!!n.leading,a=(f="maxWait"in n)?m(h(n.maxWait)||0,o):a,g="trailing"in n?!!n.trailing:g),x.cancel=function(){void 0!==s&&clearTimeout(s),u=0,e=c=r=s=void 0},x.flush=function(){return void 0===s?i:N(d())},x}},24:(t,o,n)=>{var e=n(116).default;function r(){"use strict";t.exports=r=function(){return n},t.exports.__esModule=!0,t.exports.default=t.exports;var o,n={},a=Object.prototype,i=a.hasOwnProperty,s=Object.defineProperty||function(t,o,n){t[o]=n.value},c="function"==typeof Symbol?Symbol:{},u=c.iterator||"@@iterator",l=c.asyncIterator||"@@asyncIterator",f=c.toStringTag||"@@toStringTag";function m(t,o,n){return Object.defineProperty(t,o,{value:n,enumerable:!0,configurable:!0,writable:!0}),t[o]}try{m({},"")}catch(o){m=function(t,o,n){return t[o]=n}}function p(t,o,n,e){var r=o&&o.prototype instanceof w?o:w,a=Object.create(r.prototype),i=new E(e||[]);return s(a,"_invoke",{value:O(t,n,i)}),a}function d(t,o,n){try{return{type:"normal",arg:t.call(o,n)}}catch(t){return{type:"throw",arg:t}}}n.wrap=p;var v="suspendedStart",h="suspendedYield",g="executing",y="completed",b={};function w(){}function N(){}function x(){}var L={};m(L,u,(function(){return this}));var k=Object.getPrototypeOf,P=k&&k(k(M([])));P&&P!==a&&i.call(P,u)&&(L=P);var V=x.prototype=w.prototype=Object.create(L);function _(t){["next","throw","return"].forEach((function(o){m(t,o,(function(t){return this._invoke(o,t)}))}))}function F(t,o){function n(r,a,s,c){var u=d(t[r],t,a);if("throw"!==u.type){var l=u.arg,f=l.value;return f&&"object"==e(f)&&i.call(f,"__await")?o.resolve(f.__await).then((function(t){n("next",t,s,c)}),(function(t){n("throw",t,s,c)})):o.resolve(f).then((function(t){l.value=t,s(l)}),(function(t){return n("throw",t,s,c)}))}c(u.arg)}var r;s(this,"_invoke",{value:function(t,e){function a(){return new o((function(o,r){n(t,e,o,r)}))}return r=r?r.then(a,a):a()}})}function O(t,n,e){var r=v;return function(a,i){if(r===g)throw Error("Generator is already running");if(r===y){if("throw"===a)throw i;return{value:o,done:!0}}for(e.method=a,e.arg=i;;){var s=e.delegate;if(s){var c=j(s,e);if(c){if(c===b)continue;return c}}if("next"===e.method)e.sent=e._sent=e.arg;else if("throw"===e.method){if(r===v)throw r=y,e.arg;e.dispatchException(e.arg)}else"return"===e.method&&e.abrupt("return",e.arg);r=g;var u=d(t,n,e);if("normal"===u.type){if(r=e.done?y:h,u.arg===b)continue;return{value:u.arg,done:e.done}}"throw"===u.type&&(r=y,e.method="throw",e.arg=u.arg)}}}function j(t,n){var e=n.method,r=t.iterator[e];if(r===o)return n.delegate=null,"throw"===e&&t.iterator.return&&(n.method="return",n.arg=o,j(t,n),"throw"===n.method)||"return"!==e&&(n.method="throw",n.arg=new TypeError("The iterator does not provide a '"+e+"' method")),b;var a=d(r,t.iterator,n.arg);if("throw"===a.type)return n.method="throw",n.arg=a.arg,n.delegate=null,b;var i=a.arg;return i?i.done?(n[t.resultName]=i.value,n.next=t.nextLoc,"return"!==n.method&&(n.method="next",n.arg=o),n.delegate=null,b):i:(n.method="throw",n.arg=new TypeError("iterator result is not an object"),n.delegate=null,b)}function I(t){var o={tryLoc:t[0]};1 in t&&(o.catchLoc=t[1]),2 in t&&(o.finallyLoc=t[2],o.afterLoc=t[3]),this.tryEntries.push(o)}function S(t){var o=t.completion||{};o.type="normal",delete o.arg,t.completion=o}function E(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(I,this),this.reset(!0)}function M(t){if(t||""===t){var n=t[u];if(n)return n.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var r=-1,a=function n(){for(;++r=0;--r){var a=this.tryEntries[r],s=a.completion;if("root"===a.tryLoc)return e("end");if(a.tryLoc<=this.prev){var c=i.call(a,"catchLoc"),u=i.call(a,"finallyLoc");if(c&&u){if(this.prev=0;--n){var e=this.tryEntries[n];if(e.tryLoc<=this.prev&&i.call(e,"finallyLoc")&&this.prev=0;--o){var n=this.tryEntries[o];if(n.finallyLoc===t)return this.complete(n.completion,n.afterLoc),S(n),b}},catch:function(t){for(var o=this.tryEntries.length-1;o>=0;--o){var n=this.tryEntries[o];if(n.tryLoc===t){var e=n.completion;if("throw"===e.type){var r=e.arg;S(n)}return r}}throw Error("illegal catch attempt")},delegateYield:function(t,n,e){return this.delegate={iterator:M(t),resultName:n,nextLoc:e},"next"===this.method&&(this.arg=o),b}},n}t.exports=r,t.exports.__esModule=!0,t.exports.default=t.exports},116:t=>{function o(n){return t.exports=o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},t.exports.__esModule=!0,t.exports.default=t.exports,o(n)}t.exports=o,t.exports.__esModule=!0,t.exports.default=t.exports},183:(t,o,n)=>{var e=n(24)();t.exports=e;try{regeneratorRuntime=e}catch(t){"object"==typeof globalThis?globalThis.regeneratorRuntime=e:Function("r","regeneratorRuntime = r")(e)}}},o={};function n(e){var r=o[e];if(void 0!==r)return r.exports;var a=o[e]={exports:{}};return t[e](a,a.exports,n),a.exports}n.n=t=>{var o=t&&t.__esModule?()=>t.default:()=>t;return n.d(o,{a:o}),o},n.d=(t,o)=>{for(var e in o)n.o(o,e)&&!n.o(t,e)&&Object.defineProperty(t,e,{enumerable:!0,get:o[e]})},n.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(t){if("object"==typeof window)return window}}(),n.o=(t,o)=>Object.prototype.hasOwnProperty.call(t,o),n.r=t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})};var e={};(()=>{"use strict";function t(o,n){return t=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,o){return t.__proto__=o,t},t(o,n)}function o(o,n){o.prototype=Object.create(n.prototype),o.prototype.constructor=o,t(o,n)}n.r(e),n.d(e,{components:()=>At,extend:()=>Tt,helpers:()=>Ht,models:()=>s});const r=flarum.core.compat["common/Model"];var a=n.n(r),i=function(t){function n(){return t.apply(this,arguments)||this}o(n,t);var e=n.prototype;return e.points=function(){return a().attribute("points").call(this)},e.name=function(){return a().attribute("name").call(this)},e.color=function(){return a().attribute("color").call(this)},n}(a()),s={Rank:i};const c=flarum.core.compat["forum/app"];var u=n.n(c);const l=flarum.core.compat["common/extend"],f=flarum.core.compat["forum/components/IndexPage"];var p=n.n(f);const d=flarum.core.compat["forum/states/DiscussionListState"];var v=n.n(d);const h=flarum.core.compat["common/components/LinkButton"];var g=n.n(h);const y=flarum.core.compat["common/components/Button"];var b=n.n(y);const w=flarum.core.compat["forum/components/CommentPost"];var N=n.n(w);const x=flarum.core.compat["common/utils/classList"];var L=n.n(x);const k=flarum.core.compat["forum/utils/PostControls"];var P=n.n(k);const V=flarum.core.compat["common/components/Modal"];var _=n.n(V);const F=flarum.core.compat["common/components/LoadingIndicator"];var O=n.n(F);const j=flarum.core.compat["common/helpers/avatar"];var I=n.n(j);const S=flarum.core.compat["common/helpers/username"];var E=n.n(S);const M=flarum.core.compat["common/components/Link"];var G=n.n(M),R=function(t){function n(){return t.apply(this,arguments)||this}o(n,t);var e=n.prototype;return e.className=function(){return"VotesModal Modal--small"},e.title=function(){return u().translator.trans("fof-gamification.forum.modal.title")},e.oninit=function(o){t.prototype.oninit.call(this,o),this.loading=!this.attrs.post.upvotes()||!this.attrs.post.downvotes(),this.loading&&this.load()},e.content=function(){var t=this;return this.loading?m("div",{className:"Modal-body"},m(O(),null)):m("div",{className:"Modal-body"},m("ul",{className:"VotesModal-list"},["upvotes","downvotes"].map((function(o){var n=t.attrs.post[o]();if(n&&n.length)return m("div",null,m("legend",null,u().translator.trans("fof-gamification.forum.modal."+o+"_label")),n.map((function(t){return m("li",null,m(G(),{href:u().route.user(t)},I()(t)," ",E()(t)))})))}))))},e.load=function(){return u().store.find("posts",this.attrs.post.id(),{include:"upvotes,downvotes"}).then(this.loaded.bind(this))},n}(_());const B=function(t,o){void 0===o&&(o=!1);var n=u().data["fof-gamification."+t];return o?!!parseInt(n):n},D=flarum.core.compat["forum/utils/DiscussionControls"];var U=n.n(D);const T=function(t,o,n,e,r){if(void 0===r&&(r=t.discussion()),u().session.user){if(!r||r.canVote()||t.canVote())return o&&n&&(o=!1,n=!1),e&&e(!0),m.redraw(),t.save([o,n,"vote"]).then((function(){return null}),(function(){return null})).then((function(){e&&e(!1),r&&r.pushAttributes({votes:t.votes()}),m.redraw()}))}else U().replyAction.call(r,!0)},A=flarum.core.compat["forum/components/DiscussionListItem"];var C=n.n(A);const H=flarum.core.compat["common/utils/abbreviateNumber"];var $=n.n(H);const z=flarum.core.compat["common/helpers/icon"];var W=n.n(z);const Y=flarum.core.compat["forum/components/PostUser"];var q=n.n(Y);const J=flarum.core.compat["forum/components/UserCard"];var K=n.n(J);function Q(t,o){void 0===o&&(o={}),o.style=o.style||{},o.className="rankLabel "+(o.className||"");var n=t.color();return o.style.backgroundColor=o.style.color=n,o.className+=" colored",m("span",o,m("span",{className:"rankLabel-text"},t.name()))}const X=flarum.core.compat["forum/components/DiscussionPage"];var Z=n.n(X),tt=n(976),ot=n.n(tt),nt=function(t){return u().store.find("posts",t).then((function(){return m.redraw()}))},et=[];var rt=function(t,o){var n=t.firstPost();return n&&void 0!==n[o]()?n[o]():t[o]()};const at=flarum.core.compat["common/states/DiscussionListState"];var it=n.n(at);const st=flarum.core.compat["forum/components/Notification"];var ct=function(t){function n(){return t.apply(this,arguments)||this}o(n,t);var e=n.prototype;return e.icon=function(){var t=B("iconName")||"thumbs";return this.attrs.notification.content()>0?"fas fa-"+t+"-up":"fas fa-"+t+"-down"},e.href=function(){return u().route.post(this.attrs.notification.subject())},e.content=function(){var t=this.attrs.notification.fromUser();return parseInt(this.attrs.notification.content())>0?u().translator.trans("fof-gamification.forum.notification.upvote",{user:t}):u().translator.trans("fof-gamification.forum.notification.downvote",{user:t})},e.excerpt=function(){return this.attrs.notification.subject().contentPlain()},n}(n.n(st)());const ut=flarum.core.compat["forum/components/NotificationGrid"];var lt=n.n(ut);function ft(t,o,n,e,r,a,i){try{var s=t[a](i),c=s.value}catch(t){return void n(t)}s.done?o(c):Promise.resolve(c).then(e,r)}var mt=n(183),pt=n.n(mt);const dt=flarum.core.compat["common/Component"];var vt=n.n(dt);const ht=flarum.core.compat["common/components/Tooltip"];var gt=n.n(ht);const yt=flarum.core.compat["common/utils/SubtreeRetainer"];var bt=n.n(yt),wt=function(t){function n(){for(var o,n=arguments.length,e=new Array(n),r=0;r15?m("span",{className:"FoFGamification-voters-item FoFGamification-voters-item--plus"},m("span",{className:"Avatar"},"+"+(t.length-15))):null)))},e.load=function(){var t,o=(t=pt().mark((function t(){return pt().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,u().store.find("posts",this.attrs.post.id(),{include:"upvotes"});case 2:this.loading=!1,m.redraw();case 4:case"end":return t.stop()}}),t,this)})),function(){var o=this,n=arguments;return new Promise((function(e,r){var a=t.apply(o,n);function i(t){ft(a,e,r,i,s,"next",t)}function s(t){ft(a,e,r,i,s,"throw",t)}i(void 0)}))});return function(){return o.apply(this,arguments)}}(),n}(vt());const Nt=flarum.core.compat["forum/components/UserPage"];var xt=n.n(Nt);const Lt=flarum.core.compat["forum/components/PostsUserPage"];var kt=function(t){function n(){return t.apply(this,arguments)||this}return o(n,t),n.prototype.loadResults=function(t){return u().store.find("posts",{filter:{type:"comment",voted:this.user.id()},page:{offset:t,limit:this.loadLimit},sort:"-createdAt"})},n}(n.n(Lt)());const Pt=flarum.core.compat["common/extenders"];var Vt=n.n(Pt);const _t=[(new(Vt().Store)).add("ranks",i)],Ft=flarum.core.compat["common/components/Page"];var Ot=n.n(Ft);const jt=flarum.core.compat["common/helpers/listItems"];var It=n.n(jt),St=function(t){function n(){return t.apply(this,arguments)||this}return o(n,t),n.prototype.view=function(){var t=u().forum.attribute("fof-gamification.topimage"+this.attrs.place+"Url"),o=this.attrs.place;return t?m("img",{className:"rankings-mobile rankings-image rankings-"+o,src:t,alt:""}):m("td",{className:"rankings-mobile rankings-"+o},W()("fas fa-trophy"))},n}(vt()),Et=function(t){function n(){return t.apply(this,arguments)||this}o(n,t);var e=n.prototype;return e.oninit=function(o){t.prototype.oninit.call(this,o),u().forum.attribute("canViewRankingPage")||m.route.set("/"),this.loading=!0,this.users=[],this.refresh()},e.view=function(){var t,o=this;return t=this.loading?O().component():b().component({className:"Button",onclick:this.loadMore.bind(this)},u().translator.trans("core.forum.discussion_list.load_more_button")),m("div",{className:"IndexPage"},p().prototype.hero(),m("div",{className:"container"},m("div",{className:"sideNavContainer"},m("nav",{className:"IndexPage-nav sideNav"},m("ul",null,It()(p().prototype.sidebarItems().toArray()))),m("div",{className:"IndexPage-results sideNavOffset"},m("table",{class:"rankings"},m("tr",null,m("th",{className:"rankings-mobile"},u().translator.trans("fof-gamification.forum.ranking.rank")),m("th",null,u().translator.trans("fof-gamification.forum.ranking.name")),m("th",null,u().translator.trans("fof-gamification.forum.ranking.amount"))),this.users.map((function(t,n){return++n,[m("tr",{className:"ranking-"+n},n<4?m(St,{place:n}):m("td",{className:"rankings-4 rankings-mobile"},o.addOrdinalSuffix(n)),m("td",null,m("div",{className:"PostUser"},m("h3",{className:"PostUser-name rankings-info"},m(G(),{href:u().route.user(t),force:!0},n<4?I()(t,{className:"info-avatar rankings-"+n+"-avatar"}):""," ",E()(t))))),n<4?m("td",{className:"rankings-"+n},t.points()):m("td",{className:"rankings-4"},t.points()))]}))),m("div",{className:"rankings-loadmore"}," ",t)))))},e.refresh=function(t){var o=this;return void 0===t&&(t=!0),t&&(this.loading=!0,this.users=[]),this.loadResults().then((function(t){o.users=[],o.parseResults(t)}),(function(){o.loading=!1,m.redraw()}))},e.addOrdinalSuffix=function(t){if("en"===u().data.locale){var o=t%10,n=t%100;return 1===o&&11!==n?t+"st":2===o&&12!==n?t+"nd":3===o&&13!==n?t+"rd":t+"th"}return t},e.loadResults=function(t){var o={};return o.page={offset:t,limit:"10"},u().store.find("rankings",o)},e.loadMore=function(){this.loading=!0,this.loadResults(this.users.length).then(this.parseResults.bind(this))},e.parseResults=function(t){return[].push.apply(this.users,t),this.loading=!1,this.users.sort((function(t,o){return parseFloat(o.points())-parseFloat(t.points())})),m.redraw(),t},n}(Ot());const Mt=flarum.core.compat["common/models/Discussion"];var Gt=n.n(Mt);const Rt=flarum.core.compat["common/models/Post"];var Bt=n.n(Rt);const Dt=flarum.core.compat["common/models/User"];var Ut=n.n(Dt);const Tt=[].concat(_t,[(new(Vt().Routes)).add("rankings","/rankings",Et),new(Vt().Model)(Gt()).attribute("votes").attribute("hasUpvoted").attribute("hasDownvoted").attribute("canVote").attribute("seeVotes"),new(Vt().Model)(Bt()).hasMany("upvotes").hasMany("downvotes").attribute("votes").attribute("canVote").attribute("canSeeVotes").attribute("hasUpvoted").attribute("hasDownvoted").attribute("seeVoters"),new(Vt().Model)(Ut()).attribute("points").hasMany("ranks").attribute("canHaveVotingNotifications")]);var At={RankingsPage:Et,VoteNotification:ct,VotesModal:R,Voters:wt};function Ct(){return Ct=Object.assign?Object.assign.bind():function(t){for(var o=1;o{var t={976:(t,o,n)=>{var e=/^\s+|\s+$/g,r=/^[-+]0x[0-9a-f]+$/i,a=/^0b[01]+$/i,i=/^0o[0-7]+$/i,s=parseInt,c="object"==typeof n.g&&n.g&&n.g.Object===Object&&n.g,u="object"==typeof self&&self&&self.Object===Object&&self,l=c||u||Function("return this")(),f=Object.prototype.toString,m=Math.max,p=Math.min,d=function(){return l.Date.now()};function v(t){var o=typeof t;return!!t&&("object"==o||"function"==o)}function h(t){if("number"==typeof t)return t;if(function(t){return"symbol"==typeof t||function(t){return!!t&&"object"==typeof t}(t)&&"[object Symbol]"==f.call(t)}(t))return NaN;if(v(t)){var o="function"==typeof t.valueOf?t.valueOf():t;t=v(o)?o+"":o}if("string"!=typeof t)return 0===t?t:+t;t=t.replace(e,"");var n=a.test(t);return n||i.test(t)?s(t.slice(2),n?2:8):r.test(t)?NaN:+t}t.exports=function(t,o,n){var e,r,a,i,s,c,u=0,l=!1,f=!1,g=!0;if("function"!=typeof t)throw new TypeError("Expected a function");function y(o){var n=e,a=r;return e=r=void 0,u=o,i=t.apply(a,n)}function b(t){var n=t-c;return void 0===c||n>=o||n<0||f&&t-u>=a}function w(){var t=d();if(b(t))return N(t);s=setTimeout(w,function(t){var n=o-(t-c);return f?p(n,a-(t-u)):n}(t))}function N(t){return s=void 0,g&&e?y(t):(e=r=void 0,i)}function x(){var t=d(),n=b(t);if(e=arguments,r=this,c=t,n){if(void 0===s)return function(t){return u=t,s=setTimeout(w,o),l?y(t):i}(c);if(f)return s=setTimeout(w,o),y(c)}return void 0===s&&(s=setTimeout(w,o)),i}return o=h(o)||0,v(n)&&(l=!!n.leading,a=(f="maxWait"in n)?m(h(n.maxWait)||0,o):a,g="trailing"in n?!!n.trailing:g),x.cancel=function(){void 0!==s&&clearTimeout(s),u=0,e=c=r=s=void 0},x.flush=function(){return void 0===s?i:N(d())},x}},24:(t,o,n)=>{var e=n(116).default;function r(){"use strict";t.exports=r=function(){return n},t.exports.__esModule=!0,t.exports.default=t.exports;var o,n={},a=Object.prototype,i=a.hasOwnProperty,s=Object.defineProperty||function(t,o,n){t[o]=n.value},c="function"==typeof Symbol?Symbol:{},u=c.iterator||"@@iterator",l=c.asyncIterator||"@@asyncIterator",f=c.toStringTag||"@@toStringTag";function m(t,o,n){return Object.defineProperty(t,o,{value:n,enumerable:!0,configurable:!0,writable:!0}),t[o]}try{m({},"")}catch(o){m=function(t,o,n){return t[o]=n}}function p(t,o,n,e){var r=o&&o.prototype instanceof w?o:w,a=Object.create(r.prototype),i=new E(e||[]);return s(a,"_invoke",{value:O(t,n,i)}),a}function d(t,o,n){try{return{type:"normal",arg:t.call(o,n)}}catch(t){return{type:"throw",arg:t}}}n.wrap=p;var v="suspendedStart",h="suspendedYield",g="executing",y="completed",b={};function w(){}function N(){}function x(){}var L={};m(L,u,(function(){return this}));var k=Object.getPrototypeOf,P=k&&k(k(M([])));P&&P!==a&&i.call(P,u)&&(L=P);var V=x.prototype=w.prototype=Object.create(L);function _(t){["next","throw","return"].forEach((function(o){m(t,o,(function(t){return this._invoke(o,t)}))}))}function F(t,o){function n(r,a,s,c){var u=d(t[r],t,a);if("throw"!==u.type){var l=u.arg,f=l.value;return f&&"object"==e(f)&&i.call(f,"__await")?o.resolve(f.__await).then((function(t){n("next",t,s,c)}),(function(t){n("throw",t,s,c)})):o.resolve(f).then((function(t){l.value=t,s(l)}),(function(t){return n("throw",t,s,c)}))}c(u.arg)}var r;s(this,"_invoke",{value:function(t,e){function a(){return new o((function(o,r){n(t,e,o,r)}))}return r=r?r.then(a,a):a()}})}function O(t,n,e){var r=v;return function(a,i){if(r===g)throw Error("Generator is already running");if(r===y){if("throw"===a)throw i;return{value:o,done:!0}}for(e.method=a,e.arg=i;;){var s=e.delegate;if(s){var c=j(s,e);if(c){if(c===b)continue;return c}}if("next"===e.method)e.sent=e._sent=e.arg;else if("throw"===e.method){if(r===v)throw r=y,e.arg;e.dispatchException(e.arg)}else"return"===e.method&&e.abrupt("return",e.arg);r=g;var u=d(t,n,e);if("normal"===u.type){if(r=e.done?y:h,u.arg===b)continue;return{value:u.arg,done:e.done}}"throw"===u.type&&(r=y,e.method="throw",e.arg=u.arg)}}}function j(t,n){var e=n.method,r=t.iterator[e];if(r===o)return n.delegate=null,"throw"===e&&t.iterator.return&&(n.method="return",n.arg=o,j(t,n),"throw"===n.method)||"return"!==e&&(n.method="throw",n.arg=new TypeError("The iterator does not provide a '"+e+"' method")),b;var a=d(r,t.iterator,n.arg);if("throw"===a.type)return n.method="throw",n.arg=a.arg,n.delegate=null,b;var i=a.arg;return i?i.done?(n[t.resultName]=i.value,n.next=t.nextLoc,"return"!==n.method&&(n.method="next",n.arg=o),n.delegate=null,b):i:(n.method="throw",n.arg=new TypeError("iterator result is not an object"),n.delegate=null,b)}function I(t){var o={tryLoc:t[0]};1 in t&&(o.catchLoc=t[1]),2 in t&&(o.finallyLoc=t[2],o.afterLoc=t[3]),this.tryEntries.push(o)}function S(t){var o=t.completion||{};o.type="normal",delete o.arg,t.completion=o}function E(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(I,this),this.reset(!0)}function M(t){if(t||""===t){var n=t[u];if(n)return n.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var r=-1,a=function n(){for(;++r=0;--r){var a=this.tryEntries[r],s=a.completion;if("root"===a.tryLoc)return e("end");if(a.tryLoc<=this.prev){var c=i.call(a,"catchLoc"),u=i.call(a,"finallyLoc");if(c&&u){if(this.prev=0;--n){var e=this.tryEntries[n];if(e.tryLoc<=this.prev&&i.call(e,"finallyLoc")&&this.prev=0;--o){var n=this.tryEntries[o];if(n.finallyLoc===t)return this.complete(n.completion,n.afterLoc),S(n),b}},catch:function(t){for(var o=this.tryEntries.length-1;o>=0;--o){var n=this.tryEntries[o];if(n.tryLoc===t){var e=n.completion;if("throw"===e.type){var r=e.arg;S(n)}return r}}throw Error("illegal catch attempt")},delegateYield:function(t,n,e){return this.delegate={iterator:M(t),resultName:n,nextLoc:e},"next"===this.method&&(this.arg=o),b}},n}t.exports=r,t.exports.__esModule=!0,t.exports.default=t.exports},116:t=>{function o(n){return t.exports=o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},t.exports.__esModule=!0,t.exports.default=t.exports,o(n)}t.exports=o,t.exports.__esModule=!0,t.exports.default=t.exports},183:(t,o,n)=>{var e=n(24)();t.exports=e;try{regeneratorRuntime=e}catch(t){"object"==typeof globalThis?globalThis.regeneratorRuntime=e:Function("r","regeneratorRuntime = r")(e)}}},o={};function n(e){var r=o[e];if(void 0!==r)return r.exports;var a=o[e]={exports:{}};return t[e](a,a.exports,n),a.exports}n.n=t=>{var o=t&&t.__esModule?()=>t.default:()=>t;return n.d(o,{a:o}),o},n.d=(t,o)=>{for(var e in o)n.o(o,e)&&!n.o(t,e)&&Object.defineProperty(t,e,{enumerable:!0,get:o[e]})},n.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(t){if("object"==typeof window)return window}}(),n.o=(t,o)=>Object.prototype.hasOwnProperty.call(t,o),n.r=t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})};var e={};(()=>{"use strict";function t(o,n){return t=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,o){return t.__proto__=o,t},t(o,n)}function o(o,n){o.prototype=Object.create(n.prototype),o.prototype.constructor=o,t(o,n)}n.r(e),n.d(e,{components:()=>At,extend:()=>Tt,helpers:()=>Ht,models:()=>s});const r=flarum.core.compat["common/Model"];var a=n.n(r),i=function(t){function n(){return t.apply(this,arguments)||this}o(n,t);var e=n.prototype;return e.points=function(){return a().attribute("points").call(this)},e.name=function(){return a().attribute("name").call(this)},e.color=function(){return a().attribute("color").call(this)},n}(a()),s={Rank:i};const c=flarum.core.compat["forum/app"];var u=n.n(c);const l=flarum.core.compat["common/extend"],f=flarum.core.compat["forum/components/IndexPage"];var p=n.n(f);const d=flarum.core.compat["forum/states/DiscussionListState"];var v=n.n(d);const h=flarum.core.compat["common/components/LinkButton"];var g=n.n(h);const y=flarum.core.compat["common/components/Button"];var b=n.n(y);const w=flarum.core.compat["forum/components/CommentPost"];var N=n.n(w);const x=flarum.core.compat["common/utils/classList"];var L=n.n(x);const k=flarum.core.compat["forum/utils/PostControls"];var P=n.n(k);const V=flarum.core.compat["common/components/Modal"];var _=n.n(V);const F=flarum.core.compat["common/components/LoadingIndicator"];var O=n.n(F);const j=flarum.core.compat["common/helpers/avatar"];var I=n.n(j);const S=flarum.core.compat["common/helpers/username"];var E=n.n(S);const M=flarum.core.compat["common/components/Link"];var G=n.n(M),R=function(t){function n(){return t.apply(this,arguments)||this}o(n,t);var e=n.prototype;return e.className=function(){return"VotesModal Modal--small"},e.title=function(){return u().translator.trans("fof-gamification.forum.modal.title")},e.oninit=function(o){t.prototype.oninit.call(this,o),this.loading=!this.attrs.post.upvotes()||!this.attrs.post.downvotes(),this.loading&&this.load()},e.content=function(){var t=this;return this.loading?m("div",{className:"Modal-body"},m(O(),null)):m("div",{className:"Modal-body"},m("ul",{className:"VotesModal-list"},["upvotes","downvotes"].map((function(o){var n=t.attrs.post[o]();if(n&&n.length)return m("div",null,m("legend",null,u().translator.trans("fof-gamification.forum.modal."+o+"_label")),n.map((function(t){return m("li",null,m(G(),{href:u().route.user(t)},I()(t)," ",E()(t)))})))}))))},e.load=function(){return u().store.find("posts",this.attrs.post.id(),{include:"upvotes,downvotes"}).then(this.loaded.bind(this))},n}(_());const B=function(t,o){void 0===o&&(o=!1);var n=u().data["fof-gamification."+t];return o?!!parseInt(n):n},D=flarum.core.compat["forum/utils/DiscussionControls"];var U=n.n(D);const T=function(t,o,n,e,r){if(void 0===r&&(r=t.discussion()),u().session.user){if(!r||r.canVote()||t.canVote())return o&&n&&(o=!1,n=!1),e&&e(!0),m.redraw(),t.save([o,n,"vote"]).then((function(){return null}),(function(){return null})).then((function(){e&&e(!1),r&&r.pushAttributes({votes:t.votes()}),m.redraw()}))}else U().replyAction.call(r,!0)},A=flarum.core.compat["forum/components/DiscussionListItem"];var C=n.n(A);const H=flarum.core.compat["common/utils/abbreviateNumber"];var $=n.n(H);const z=flarum.core.compat["common/helpers/icon"];var W=n.n(z);const Y=flarum.core.compat["forum/components/PostUser"];var q=n.n(Y);const J=flarum.core.compat["forum/components/UserCard"];var K=n.n(J);function Q(t,o){void 0===o&&(o={}),o.style=o.style||{},o.className="rankLabel "+(o.className||"");var n=t.color();return o.style.backgroundColor=o.style.color=n,o.className+=" colored",m("span",o,m("span",{className:"rankLabel-text"},t.name()))}const X=flarum.core.compat["forum/components/DiscussionPage"];var Z=n.n(X),tt=n(976),ot=n.n(tt),nt=function(t){return u().store.find("posts",t).then((function(){return m.redraw()}))},et=[];var rt=function(t,o){var n=t.firstPost();return n&&void 0!==n[o]()?n[o]():t[o]()};const at=flarum.core.compat["common/states/DiscussionListState"];var it=n.n(at);const st=flarum.core.compat["forum/components/Notification"];var ct=function(t){function n(){return t.apply(this,arguments)||this}o(n,t);var e=n.prototype;return e.icon=function(){var t=B("iconName")||"thumbs";return this.attrs.notification.content()>0?"fas fa-"+t+"-up":"fas fa-"+t+"-down"},e.href=function(){return u().route.post(this.attrs.notification.subject())},e.content=function(){var t=this.attrs.notification.fromUser();return parseInt(this.attrs.notification.content())>0?u().translator.trans("fof-gamification.forum.notification.upvote",{user:t}):u().translator.trans("fof-gamification.forum.notification.downvote",{user:t})},e.excerpt=function(){return this.attrs.notification.subject().contentPlain()},n}(n.n(st)());const ut=flarum.core.compat["forum/components/NotificationGrid"];var lt=n.n(ut);function ft(t,o,n,e,r,a,i){try{var s=t[a](i),c=s.value}catch(t){return void n(t)}s.done?o(c):Promise.resolve(c).then(e,r)}var mt=n(183),pt=n.n(mt);const dt=flarum.core.compat["common/Component"];var vt=n.n(dt);const ht=flarum.core.compat["common/components/Tooltip"];var gt=n.n(ht);const yt=flarum.core.compat["common/utils/SubtreeRetainer"];var bt=n.n(yt),wt=function(t){function n(){for(var o,n=arguments.length,e=new Array(n),r=0;r15?m("span",{className:"FoFGamification-voters-item FoFGamification-voters-item--plus"},m("span",{className:"Avatar"},"+"+(t.length-15))):null)))},e.load=function(){var t,o=(t=pt().mark((function t(){return pt().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,u().store.find("posts",this.attrs.post.id(),{include:"upvotes"});case 2:this.loading=!1,m.redraw();case 4:case"end":return t.stop()}}),t,this)})),function(){var o=this,n=arguments;return new Promise((function(e,r){var a=t.apply(o,n);function i(t){ft(a,e,r,i,s,"next",t)}function s(t){ft(a,e,r,i,s,"throw",t)}i(void 0)}))});return function(){return o.apply(this,arguments)}}(),n}(vt());const Nt=flarum.core.compat["forum/components/UserPage"];var xt=n.n(Nt);const Lt=flarum.core.compat["forum/components/PostsUserPage"];var kt=function(t){function n(){return t.apply(this,arguments)||this}return o(n,t),n.prototype.loadResults=function(t){return u().store.find("posts",{filter:{type:"comment",voted:this.user.id()},page:{offset:t,limit:this.loadLimit},sort:"-createdAt"})},n}(n.n(Lt)());const Pt=flarum.core.compat["common/extenders"];var Vt=n.n(Pt);const _t=[(new(Vt().Store)).add("ranks",i)],Ft=flarum.core.compat["common/components/Page"];var Ot=n.n(Ft);const jt=flarum.core.compat["common/helpers/listItems"];var It=n.n(jt),St=function(t){function n(){return t.apply(this,arguments)||this}return o(n,t),n.prototype.view=function(){var t=u().forum.attribute("fof-gamification.topimage"+this.attrs.place+"Url"),o=this.attrs.place;return t?m("img",{className:"rankings-mobile rankings-image rankings-"+o,src:t,alt:""}):m("td",{className:"rankings-mobile rankings-"+o},W()("fas fa-trophy"))},n}(vt()),Et=function(t){function n(){return t.apply(this,arguments)||this}o(n,t);var e=n.prototype;return e.oninit=function(o){t.prototype.oninit.call(this,o),u().forum.attribute("canViewRankingPage")||m.route.set("/"),this.loading=!0,this.users=[],this.refresh()},e.view=function(){var t,o=this;return t=this.loading?O().component():b().component({className:"Button",onclick:this.loadMore.bind(this)},u().translator.trans("core.forum.discussion_list.load_more_button")),m("div",{className:"IndexPage"},p().prototype.hero(),m("div",{className:"container"},m("div",{className:"sideNavContainer"},m("nav",{className:"IndexPage-nav sideNav"},m("ul",null,It()(p().prototype.sidebarItems().toArray()))),m("div",{className:"IndexPage-results sideNavOffset"},m("table",{class:"rankings"},m("tr",null,m("th",{className:"rankings-mobile"},u().translator.trans("fof-gamification.forum.ranking.rank")),m("th",null,u().translator.trans("fof-gamification.forum.ranking.name")),m("th",null,u().translator.trans("fof-gamification.forum.ranking.amount"))),this.users.map((function(t,n){return++n,[m("tr",{className:"ranking-"+n},n<4?m(St,{place:n}):m("td",{className:"rankings-4 rankings-mobile"},o.addOrdinalSuffix(n)),m("td",null,m("div",{className:"PostUser"},m("h3",{className:"PostUser-name rankings-info"},m(G(),{href:u().route.user(t),force:!0},n<4?I()(t,{className:"info-avatar rankings-"+n+"-avatar"}):""," ",E()(t))))),n<4?m("td",{className:"rankings-"+n},t.points()):m("td",{className:"rankings-4"},t.points()))]}))),m("div",{className:"rankings-loadmore"}," ",t)))))},e.refresh=function(t){var o=this;return void 0===t&&(t=!0),t&&(this.loading=!0,this.users=[]),this.loadResults().then((function(t){o.users=[],o.parseResults(t)}),(function(){o.loading=!1,m.redraw()}))},e.addOrdinalSuffix=function(t){if("en"===u().data.locale){var o=t%10,n=t%100;return 1===o&&11!==n?t+"st":2===o&&12!==n?t+"nd":3===o&&13!==n?t+"rd":t+"th"}return t},e.loadResults=function(t){var o={};return o.page={offset:t,limit:"10"},u().store.find("rankings",o)},e.loadMore=function(){this.loading=!0,this.loadResults(this.users.length).then(this.parseResults.bind(this))},e.parseResults=function(t){return[].push.apply(this.users,t),this.loading=!1,this.users.sort((function(t,o){return parseFloat(o.points())-parseFloat(t.points())})),m.redraw(),t},n}(Ot());const Mt=flarum.core.compat["common/models/Discussion"];var Gt=n.n(Mt);const Rt=flarum.core.compat["common/models/Post"];var Bt=n.n(Rt);const Dt=flarum.core.compat["common/models/User"];var Ut=n.n(Dt);const Tt=[].concat(_t,[(new(Vt().Routes)).add("rankings","/rankings",Et),new(Vt().Model)(Gt()).attribute("votes").attribute("hasUpvoted").attribute("hasDownvoted").attribute("canVote").attribute("seeVotes"),new(Vt().Model)(Bt()).hasMany("upvotes").hasMany("downvotes").attribute("votes").attribute("canVote").attribute("canSeeVotes").attribute("hasUpvoted").attribute("hasDownvoted").attribute("seeVoters"),new(Vt().Model)(Ut()).attribute("points").hasMany("ranks").attribute("canHaveVotingNotifications")]);var At={RankingsPage:Et,VoteNotification:ct,VotesModal:R,Voters:wt};function Ct(){return Ct=Object.assign?Object.assign.bind():function(t){for(var o=1;o\n * Build: `lodash modularize exports=\"npm\" -o ./`\n * Copyright jQuery Foundation and other contributors \n * Released under MIT license \n * Based on Underscore.js 1.8.3 \n * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors\n */\n\n/** Used as the `TypeError` message for \"Functions\" methods. */\nvar FUNC_ERROR_TEXT = 'Expected a function';\n\n/** Used as references for various `Number` constants. */\nvar NAN = 0 / 0;\n\n/** `Object#toString` result references. */\nvar symbolTag = '[object Symbol]';\n\n/** Used to match leading and trailing whitespace. */\nvar reTrim = /^\\s+|\\s+$/g;\n\n/** Used to detect bad signed hexadecimal string values. */\nvar reIsBadHex = /^[-+]0x[0-9a-f]+$/i;\n\n/** Used to detect binary string values. */\nvar reIsBinary = /^0b[01]+$/i;\n\n/** Used to detect octal string values. */\nvar reIsOctal = /^0o[0-7]+$/i;\n\n/** Built-in method references without a dependency on `root`. */\nvar freeParseInt = parseInt;\n\n/** Detect free variable `global` from Node.js. */\nvar freeGlobal = typeof global == 'object' && global && global.Object === Object && global;\n\n/** Detect free variable `self`. */\nvar freeSelf = typeof self == 'object' && self && self.Object === Object && self;\n\n/** Used as a reference to the global object. */\nvar root = freeGlobal || freeSelf || Function('return this')();\n\n/** Used for built-in method references. */\nvar objectProto = Object.prototype;\n\n/**\n * Used to resolve the\n * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)\n * of values.\n */\nvar objectToString = objectProto.toString;\n\n/* Built-in method references for those with the same name as other `lodash` methods. */\nvar nativeMax = Math.max,\n nativeMin = Math.min;\n\n/**\n * Gets the timestamp of the number of milliseconds that have elapsed since\n * the Unix epoch (1 January 1970 00:00:00 UTC).\n *\n * @static\n * @memberOf _\n * @since 2.4.0\n * @category Date\n * @returns {number} Returns the timestamp.\n * @example\n *\n * _.defer(function(stamp) {\n * console.log(_.now() - stamp);\n * }, _.now());\n * // => Logs the number of milliseconds it took for the deferred invocation.\n */\nvar now = function() {\n return root.Date.now();\n};\n\n/**\n * Creates a debounced function that delays invoking `func` until after `wait`\n * milliseconds have elapsed since the last time the debounced function was\n * invoked. The debounced function comes with a `cancel` method to cancel\n * delayed `func` invocations and a `flush` method to immediately invoke them.\n * Provide `options` to indicate whether `func` should be invoked on the\n * leading and/or trailing edge of the `wait` timeout. The `func` is invoked\n * with the last arguments provided to the debounced function. Subsequent\n * calls to the debounced function return the result of the last `func`\n * invocation.\n *\n * **Note:** If `leading` and `trailing` options are `true`, `func` is\n * invoked on the trailing edge of the timeout only if the debounced function\n * is invoked more than once during the `wait` timeout.\n *\n * If `wait` is `0` and `leading` is `false`, `func` invocation is deferred\n * until to the next tick, similar to `setTimeout` with a timeout of `0`.\n *\n * See [David Corbacho's article](https://css-tricks.com/debouncing-throttling-explained-examples/)\n * for details over the differences between `_.debounce` and `_.throttle`.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Function\n * @param {Function} func The function to debounce.\n * @param {number} [wait=0] The number of milliseconds to delay.\n * @param {Object} [options={}] The options object.\n * @param {boolean} [options.leading=false]\n * Specify invoking on the leading edge of the timeout.\n * @param {number} [options.maxWait]\n * The maximum time `func` is allowed to be delayed before it's invoked.\n * @param {boolean} [options.trailing=true]\n * Specify invoking on the trailing edge of the timeout.\n * @returns {Function} Returns the new debounced function.\n * @example\n *\n * // Avoid costly calculations while the window size is in flux.\n * jQuery(window).on('resize', _.debounce(calculateLayout, 150));\n *\n * // Invoke `sendMail` when clicked, debouncing subsequent calls.\n * jQuery(element).on('click', _.debounce(sendMail, 300, {\n * 'leading': true,\n * 'trailing': false\n * }));\n *\n * // Ensure `batchLog` is invoked once after 1 second of debounced calls.\n * var debounced = _.debounce(batchLog, 250, { 'maxWait': 1000 });\n * var source = new EventSource('/stream');\n * jQuery(source).on('message', debounced);\n *\n * // Cancel the trailing debounced invocation.\n * jQuery(window).on('popstate', debounced.cancel);\n */\nfunction debounce(func, wait, options) {\n var lastArgs,\n lastThis,\n maxWait,\n result,\n timerId,\n lastCallTime,\n lastInvokeTime = 0,\n leading = false,\n maxing = false,\n trailing = true;\n\n if (typeof func != 'function') {\n throw new TypeError(FUNC_ERROR_TEXT);\n }\n wait = toNumber(wait) || 0;\n if (isObject(options)) {\n leading = !!options.leading;\n maxing = 'maxWait' in options;\n maxWait = maxing ? nativeMax(toNumber(options.maxWait) || 0, wait) : maxWait;\n trailing = 'trailing' in options ? !!options.trailing : trailing;\n }\n\n function invokeFunc(time) {\n var args = lastArgs,\n thisArg = lastThis;\n\n lastArgs = lastThis = undefined;\n lastInvokeTime = time;\n result = func.apply(thisArg, args);\n return result;\n }\n\n function leadingEdge(time) {\n // Reset any `maxWait` timer.\n lastInvokeTime = time;\n // Start the timer for the trailing edge.\n timerId = setTimeout(timerExpired, wait);\n // Invoke the leading edge.\n return leading ? invokeFunc(time) : result;\n }\n\n function remainingWait(time) {\n var timeSinceLastCall = time - lastCallTime,\n timeSinceLastInvoke = time - lastInvokeTime,\n result = wait - timeSinceLastCall;\n\n return maxing ? nativeMin(result, maxWait - timeSinceLastInvoke) : result;\n }\n\n function shouldInvoke(time) {\n var timeSinceLastCall = time - lastCallTime,\n timeSinceLastInvoke = time - lastInvokeTime;\n\n // Either this is the first call, activity has stopped and we're at the\n // trailing edge, the system time has gone backwards and we're treating\n // it as the trailing edge, or we've hit the `maxWait` limit.\n return (lastCallTime === undefined || (timeSinceLastCall >= wait) ||\n (timeSinceLastCall < 0) || (maxing && timeSinceLastInvoke >= maxWait));\n }\n\n function timerExpired() {\n var time = now();\n if (shouldInvoke(time)) {\n return trailingEdge(time);\n }\n // Restart the timer.\n timerId = setTimeout(timerExpired, remainingWait(time));\n }\n\n function trailingEdge(time) {\n timerId = undefined;\n\n // Only invoke if we have `lastArgs` which means `func` has been\n // debounced at least once.\n if (trailing && lastArgs) {\n return invokeFunc(time);\n }\n lastArgs = lastThis = undefined;\n return result;\n }\n\n function cancel() {\n if (timerId !== undefined) {\n clearTimeout(timerId);\n }\n lastInvokeTime = 0;\n lastArgs = lastCallTime = lastThis = timerId = undefined;\n }\n\n function flush() {\n return timerId === undefined ? result : trailingEdge(now());\n }\n\n function debounced() {\n var time = now(),\n isInvoking = shouldInvoke(time);\n\n lastArgs = arguments;\n lastThis = this;\n lastCallTime = time;\n\n if (isInvoking) {\n if (timerId === undefined) {\n return leadingEdge(lastCallTime);\n }\n if (maxing) {\n // Handle invocations in a tight loop.\n timerId = setTimeout(timerExpired, wait);\n return invokeFunc(lastCallTime);\n }\n }\n if (timerId === undefined) {\n timerId = setTimeout(timerExpired, wait);\n }\n return result;\n }\n debounced.cancel = cancel;\n debounced.flush = flush;\n return debounced;\n}\n\n/**\n * Checks if `value` is the\n * [language type](http://www.ecma-international.org/ecma-262/7.0/#sec-ecmascript-language-types)\n * of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`)\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is an object, else `false`.\n * @example\n *\n * _.isObject({});\n * // => true\n *\n * _.isObject([1, 2, 3]);\n * // => true\n *\n * _.isObject(_.noop);\n * // => true\n *\n * _.isObject(null);\n * // => false\n */\nfunction isObject(value) {\n var type = typeof value;\n return !!value && (type == 'object' || type == 'function');\n}\n\n/**\n * Checks if `value` is object-like. A value is object-like if it's not `null`\n * and has a `typeof` result of \"object\".\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is object-like, else `false`.\n * @example\n *\n * _.isObjectLike({});\n * // => true\n *\n * _.isObjectLike([1, 2, 3]);\n * // => true\n *\n * _.isObjectLike(_.noop);\n * // => false\n *\n * _.isObjectLike(null);\n * // => false\n */\nfunction isObjectLike(value) {\n return !!value && typeof value == 'object';\n}\n\n/**\n * Checks if `value` is classified as a `Symbol` primitive or object.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a symbol, else `false`.\n * @example\n *\n * _.isSymbol(Symbol.iterator);\n * // => true\n *\n * _.isSymbol('abc');\n * // => false\n */\nfunction isSymbol(value) {\n return typeof value == 'symbol' ||\n (isObjectLike(value) && objectToString.call(value) == symbolTag);\n}\n\n/**\n * Converts `value` to a number.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to process.\n * @returns {number} Returns the number.\n * @example\n *\n * _.toNumber(3.2);\n * // => 3.2\n *\n * _.toNumber(Number.MIN_VALUE);\n * // => 5e-324\n *\n * _.toNumber(Infinity);\n * // => Infinity\n *\n * _.toNumber('3.2');\n * // => 3.2\n */\nfunction toNumber(value) {\n if (typeof value == 'number') {\n return value;\n }\n if (isSymbol(value)) {\n return NAN;\n }\n if (isObject(value)) {\n var other = typeof value.valueOf == 'function' ? value.valueOf() : value;\n value = isObject(other) ? (other + '') : other;\n }\n if (typeof value != 'string') {\n return value === 0 ? value : +value;\n }\n value = value.replace(reTrim, '');\n var isBinary = reIsBinary.test(value);\n return (isBinary || reIsOctal.test(value))\n ? freeParseInt(value.slice(2), isBinary ? 2 : 8)\n : (reIsBadHex.test(value) ? NAN : +value);\n}\n\nmodule.exports = debounce;\n","var _typeof = require(\"./typeof.js\")[\"default\"];\nfunction _regeneratorRuntime() {\n \"use strict\"; /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */\n module.exports = _regeneratorRuntime = function _regeneratorRuntime() {\n return e;\n }, module.exports.__esModule = true, module.exports[\"default\"] = module.exports;\n var t,\n e = {},\n r = Object.prototype,\n n = r.hasOwnProperty,\n o = Object.defineProperty || function (t, e, r) {\n t[e] = r.value;\n },\n i = \"function\" == typeof Symbol ? Symbol : {},\n a = i.iterator || \"@@iterator\",\n c = i.asyncIterator || \"@@asyncIterator\",\n u = i.toStringTag || \"@@toStringTag\";\n function define(t, e, r) {\n return Object.defineProperty(t, e, {\n value: r,\n enumerable: !0,\n configurable: !0,\n writable: !0\n }), t[e];\n }\n try {\n define({}, \"\");\n } catch (t) {\n define = function define(t, e, r) {\n return t[e] = r;\n };\n }\n function wrap(t, e, r, n) {\n var i = e && e.prototype instanceof Generator ? e : Generator,\n a = Object.create(i.prototype),\n c = new Context(n || []);\n return o(a, \"_invoke\", {\n value: makeInvokeMethod(t, r, c)\n }), a;\n }\n function tryCatch(t, e, r) {\n try {\n return {\n type: \"normal\",\n arg: t.call(e, r)\n };\n } catch (t) {\n return {\n type: \"throw\",\n arg: t\n };\n }\n }\n e.wrap = wrap;\n var h = \"suspendedStart\",\n l = \"suspendedYield\",\n f = \"executing\",\n s = \"completed\",\n y = {};\n function Generator() {}\n function GeneratorFunction() {}\n function GeneratorFunctionPrototype() {}\n var p = {};\n define(p, a, function () {\n return this;\n });\n var d = Object.getPrototypeOf,\n v = d && d(d(values([])));\n v && v !== r && n.call(v, a) && (p = v);\n var g = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(p);\n function defineIteratorMethods(t) {\n [\"next\", \"throw\", \"return\"].forEach(function (e) {\n define(t, e, function (t) {\n return this._invoke(e, t);\n });\n });\n }\n function AsyncIterator(t, e) {\n function invoke(r, o, i, a) {\n var c = tryCatch(t[r], t, o);\n if (\"throw\" !== c.type) {\n var u = c.arg,\n h = u.value;\n return h && \"object\" == _typeof(h) && n.call(h, \"__await\") ? e.resolve(h.__await).then(function (t) {\n invoke(\"next\", t, i, a);\n }, function (t) {\n invoke(\"throw\", t, i, a);\n }) : e.resolve(h).then(function (t) {\n u.value = t, i(u);\n }, function (t) {\n return invoke(\"throw\", t, i, a);\n });\n }\n a(c.arg);\n }\n var r;\n o(this, \"_invoke\", {\n value: function value(t, n) {\n function callInvokeWithMethodAndArg() {\n return new e(function (e, r) {\n invoke(t, n, e, r);\n });\n }\n return r = r ? r.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg();\n }\n });\n }\n function makeInvokeMethod(e, r, n) {\n var o = h;\n return function (i, a) {\n if (o === f) throw Error(\"Generator is already running\");\n if (o === s) {\n if (\"throw\" === i) throw a;\n return {\n value: t,\n done: !0\n };\n }\n for (n.method = i, n.arg = a;;) {\n var c = n.delegate;\n if (c) {\n var u = maybeInvokeDelegate(c, n);\n if (u) {\n if (u === y) continue;\n return u;\n }\n }\n if (\"next\" === n.method) n.sent = n._sent = n.arg;else if (\"throw\" === n.method) {\n if (o === h) throw o = s, n.arg;\n n.dispatchException(n.arg);\n } else \"return\" === n.method && n.abrupt(\"return\", n.arg);\n o = f;\n var p = tryCatch(e, r, n);\n if (\"normal\" === p.type) {\n if (o = n.done ? s : l, p.arg === y) continue;\n return {\n value: p.arg,\n done: n.done\n };\n }\n \"throw\" === p.type && (o = s, n.method = \"throw\", n.arg = p.arg);\n }\n };\n }\n function maybeInvokeDelegate(e, r) {\n var n = r.method,\n o = e.iterator[n];\n if (o === t) return r.delegate = null, \"throw\" === n && e.iterator[\"return\"] && (r.method = \"return\", r.arg = t, maybeInvokeDelegate(e, r), \"throw\" === r.method) || \"return\" !== n && (r.method = \"throw\", r.arg = new TypeError(\"The iterator does not provide a '\" + n + \"' method\")), y;\n var i = tryCatch(o, e.iterator, r.arg);\n if (\"throw\" === i.type) return r.method = \"throw\", r.arg = i.arg, r.delegate = null, y;\n var a = i.arg;\n return a ? a.done ? (r[e.resultName] = a.value, r.next = e.nextLoc, \"return\" !== r.method && (r.method = \"next\", r.arg = t), r.delegate = null, y) : a : (r.method = \"throw\", r.arg = new TypeError(\"iterator result is not an object\"), r.delegate = null, y);\n }\n function pushTryEntry(t) {\n var e = {\n tryLoc: t[0]\n };\n 1 in t && (e.catchLoc = t[1]), 2 in t && (e.finallyLoc = t[2], e.afterLoc = t[3]), this.tryEntries.push(e);\n }\n function resetTryEntry(t) {\n var e = t.completion || {};\n e.type = \"normal\", delete e.arg, t.completion = e;\n }\n function Context(t) {\n this.tryEntries = [{\n tryLoc: \"root\"\n }], t.forEach(pushTryEntry, this), this.reset(!0);\n }\n function values(e) {\n if (e || \"\" === e) {\n var r = e[a];\n if (r) return r.call(e);\n if (\"function\" == typeof e.next) return e;\n if (!isNaN(e.length)) {\n var o = -1,\n i = function next() {\n for (; ++o < e.length;) if (n.call(e, o)) return next.value = e[o], next.done = !1, next;\n return next.value = t, next.done = !0, next;\n };\n return i.next = i;\n }\n }\n throw new TypeError(_typeof(e) + \" is not iterable\");\n }\n return GeneratorFunction.prototype = GeneratorFunctionPrototype, o(g, \"constructor\", {\n value: GeneratorFunctionPrototype,\n configurable: !0\n }), o(GeneratorFunctionPrototype, \"constructor\", {\n value: GeneratorFunction,\n configurable: !0\n }), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, u, \"GeneratorFunction\"), e.isGeneratorFunction = function (t) {\n var e = \"function\" == typeof t && t.constructor;\n return !!e && (e === GeneratorFunction || \"GeneratorFunction\" === (e.displayName || e.name));\n }, e.mark = function (t) {\n return Object.setPrototypeOf ? Object.setPrototypeOf(t, GeneratorFunctionPrototype) : (t.__proto__ = GeneratorFunctionPrototype, define(t, u, \"GeneratorFunction\")), t.prototype = Object.create(g), t;\n }, e.awrap = function (t) {\n return {\n __await: t\n };\n }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, c, function () {\n return this;\n }), e.AsyncIterator = AsyncIterator, e.async = function (t, r, n, o, i) {\n void 0 === i && (i = Promise);\n var a = new AsyncIterator(wrap(t, r, n, o), i);\n return e.isGeneratorFunction(r) ? a : a.next().then(function (t) {\n return t.done ? t.value : a.next();\n });\n }, defineIteratorMethods(g), define(g, u, \"Generator\"), define(g, a, function () {\n return this;\n }), define(g, \"toString\", function () {\n return \"[object Generator]\";\n }), e.keys = function (t) {\n var e = Object(t),\n r = [];\n for (var n in e) r.push(n);\n return r.reverse(), function next() {\n for (; r.length;) {\n var t = r.pop();\n if (t in e) return next.value = t, next.done = !1, next;\n }\n return next.done = !0, next;\n };\n }, e.values = values, Context.prototype = {\n constructor: Context,\n reset: function reset(e) {\n if (this.prev = 0, this.next = 0, this.sent = this._sent = t, this.done = !1, this.delegate = null, this.method = \"next\", this.arg = t, this.tryEntries.forEach(resetTryEntry), !e) for (var r in this) \"t\" === r.charAt(0) && n.call(this, r) && !isNaN(+r.slice(1)) && (this[r] = t);\n },\n stop: function stop() {\n this.done = !0;\n var t = this.tryEntries[0].completion;\n if (\"throw\" === t.type) throw t.arg;\n return this.rval;\n },\n dispatchException: function dispatchException(e) {\n if (this.done) throw e;\n var r = this;\n function handle(n, o) {\n return a.type = \"throw\", a.arg = e, r.next = n, o && (r.method = \"next\", r.arg = t), !!o;\n }\n for (var o = this.tryEntries.length - 1; o >= 0; --o) {\n var i = this.tryEntries[o],\n a = i.completion;\n if (\"root\" === i.tryLoc) return handle(\"end\");\n if (i.tryLoc <= this.prev) {\n var c = n.call(i, \"catchLoc\"),\n u = n.call(i, \"finallyLoc\");\n if (c && u) {\n if (this.prev < i.catchLoc) return handle(i.catchLoc, !0);\n if (this.prev < i.finallyLoc) return handle(i.finallyLoc);\n } else if (c) {\n if (this.prev < i.catchLoc) return handle(i.catchLoc, !0);\n } else {\n if (!u) throw Error(\"try statement without catch or finally\");\n if (this.prev < i.finallyLoc) return handle(i.finallyLoc);\n }\n }\n }\n },\n abrupt: function abrupt(t, e) {\n for (var r = this.tryEntries.length - 1; r >= 0; --r) {\n var o = this.tryEntries[r];\n if (o.tryLoc <= this.prev && n.call(o, \"finallyLoc\") && this.prev < o.finallyLoc) {\n var i = o;\n break;\n }\n }\n i && (\"break\" === t || \"continue\" === t) && i.tryLoc <= e && e <= i.finallyLoc && (i = null);\n var a = i ? i.completion : {};\n return a.type = t, a.arg = e, i ? (this.method = \"next\", this.next = i.finallyLoc, y) : this.complete(a);\n },\n complete: function complete(t, e) {\n if (\"throw\" === t.type) throw t.arg;\n return \"break\" === t.type || \"continue\" === t.type ? this.next = t.arg : \"return\" === t.type ? (this.rval = this.arg = t.arg, this.method = \"return\", this.next = \"end\") : \"normal\" === t.type && e && (this.next = e), y;\n },\n finish: function finish(t) {\n for (var e = this.tryEntries.length - 1; e >= 0; --e) {\n var r = this.tryEntries[e];\n if (r.finallyLoc === t) return this.complete(r.completion, r.afterLoc), resetTryEntry(r), y;\n }\n },\n \"catch\": function _catch(t) {\n for (var e = this.tryEntries.length - 1; e >= 0; --e) {\n var r = this.tryEntries[e];\n if (r.tryLoc === t) {\n var n = r.completion;\n if (\"throw\" === n.type) {\n var o = n.arg;\n resetTryEntry(r);\n }\n return o;\n }\n }\n throw Error(\"illegal catch attempt\");\n },\n delegateYield: function delegateYield(e, r, n) {\n return this.delegate = {\n iterator: values(e),\n resultName: r,\n nextLoc: n\n }, \"next\" === this.method && (this.arg = t), y;\n }\n }, e;\n}\nmodule.exports = _regeneratorRuntime, module.exports.__esModule = true, module.exports[\"default\"] = module.exports;","function _typeof(o) {\n \"@babel/helpers - typeof\";\n\n return module.exports = _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (o) {\n return typeof o;\n } : function (o) {\n return o && \"function\" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? \"symbol\" : typeof o;\n }, module.exports.__esModule = true, module.exports[\"default\"] = module.exports, _typeof(o);\n}\nmodule.exports = _typeof, module.exports.__esModule = true, module.exports[\"default\"] = module.exports;","// TODO(Babel 8): Remove this file.\n\nvar runtime = require(\"../helpers/regeneratorRuntime\")();\nmodule.exports = runtime;\n\n// Copied from https://github.com/facebook/regenerator/blob/main/packages/runtime/runtime.js#L736=\ntry {\n regeneratorRuntime = runtime;\n} catch (accidentalStrictMode) {\n if (typeof globalThis === \"object\") {\n globalThis.regeneratorRuntime = runtime;\n } else {\n Function(\"r\", \"regeneratorRuntime = r\")(runtime);\n }\n}\n","// 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__.g = (function() {\n\tif (typeof globalThis === 'object') return globalThis;\n\ttry {\n\t\treturn this || new Function('return this')();\n\t} catch (e) {\n\t\tif (typeof window === 'object') return window;\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};","function _setPrototypeOf(t, e) {\n return _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function (t, e) {\n return t.__proto__ = e, t;\n }, _setPrototypeOf(t, e);\n}\nexport { _setPrototypeOf as default };","import setPrototypeOf from \"./setPrototypeOf.js\";\nfunction _inheritsLoose(t, o) {\n t.prototype = Object.create(o.prototype), t.prototype.constructor = t, setPrototypeOf(t, o);\n}\nexport { _inheritsLoose as default };","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/Model'];","import Model from 'flarum/common/Model';\n\nexport default class Rank extends Model {\n points() {\n return Model.attribute('points').call(this);\n }\n\n name() {\n return Model.attribute('name').call(this);\n }\n\n color() {\n return Model.attribute('color').call(this);\n }\n}\n","import Rank from './Rank';\n\nexport const models = {\n Rank,\n};\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['forum/components/IndexPage'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['forum/states/DiscussionListState'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/components/LinkButton'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/components/Button'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['forum/components/CommentPost'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/utils/classList'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['forum/utils/PostControls'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/components/Modal'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/components/LoadingIndicator'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/helpers/avatar'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/helpers/username'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/components/Link'];","import app from 'flarum/forum/app';\nimport Modal from 'flarum/common/components/Modal';\nimport LoadingIndicator from 'flarum/common/components/LoadingIndicator';\nimport avatar from 'flarum/common/helpers/avatar';\nimport username from 'flarum/common/helpers/username';\nimport Link from 'flarum/common/components/Link';\n\nexport default class VotesModal extends Modal {\n className() {\n return 'VotesModal Modal--small';\n }\n\n title() {\n return app.translator.trans('fof-gamification.forum.modal.title');\n }\n\n oninit(vnode) {\n super.oninit(vnode);\n\n this.loading = !this.attrs.post.upvotes() || !this.attrs.post.downvotes();\n\n if (this.loading) {\n this.load();\n }\n }\n\n content() {\n if (this.loading) {\n return (\n
\n \n
\n );\n }\n\n return (\n
\n
    \n {['upvotes', 'downvotes'].map((type) => {\n const voters = this.attrs.post[type]();\n\n if (!voters || !voters.length) return;\n\n return (\n
    \n {app.translator.trans(`fof-gamification.forum.modal.${type}_label`)}\n {voters.map((user) => (\n
  • \n \n {avatar(user)} {username(user)}\n \n
  • \n ))}\n
    \n );\n })}\n
\n
\n );\n }\n\n load() {\n return app.store\n .find('posts', this.attrs.post.id(), {\n include: 'upvotes,downvotes',\n })\n .then(this.loaded.bind(this));\n }\n}\n","import app from 'flarum/forum/app';\n\nexport default (key, isBool = false) => {\n const val = app.data[`fof-gamification.${key}`];\n\n if (isBool) {\n return !!parseInt(val);\n }\n\n return val;\n};\n","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['forum/utils/DiscussionControls'];","import app from 'flarum/forum/app';\nimport DiscussionControls from 'flarum/forum/utils/DiscussionControls';\n\nexport default (post, upvoted, downvoted, load, discussion = post.discussion()) => {\n if (!app.session.user) {\n // We use this instead of showing LogInModal so that extensions can override it\n DiscussionControls.replyAction.call(discussion, true);\n return;\n } else if (discussion && !discussion.canVote() && !post.canVote()) {\n return;\n }\n\n if (upvoted && downvoted) {\n upvoted = false;\n downvoted = false;\n }\n\n if (load) load(true);\n\n m.redraw();\n\n return post\n .save([upvoted, downvoted, 'vote'])\n .then(\n () => null,\n () => null\n )\n .then(() => {\n if (load) load(false);\n\n if (discussion) {\n discussion.pushAttributes({\n votes: post.votes(),\n });\n }\n\n m.redraw();\n });\n};\n","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['forum/components/DiscussionListItem'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/utils/abbreviateNumber'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/helpers/icon'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['forum/components/PostUser'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['forum/components/UserCard'];","export default function rankLabel(rank, attrs = {}) {\n attrs.style = attrs.style || {};\n attrs.className = 'rankLabel ' + (attrs.className || '');\n\n const color = rank.color();\n attrs.style.backgroundColor = attrs.style.color = color;\n attrs.className += ' colored';\n\n return m('span', attrs, {rank.name()});\n}\n","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['forum/components/DiscussionPage'];","import app from 'flarum/forum/app';\nimport { extend } from 'flarum/common/extend';\nimport DiscussionPage from 'flarum/forum/components/DiscussionPage';\n\nimport debounce from 'lodash.debounce';\n\nconst fetch = (postId) => app.store.find('posts', postId).then(() => m.redraw());\nconst debounced = [];\nconst update = (postId) => {\n let func = debounced[postId];\n\n if (func) return func(postId);\n\n func = debounced[postId] = debounce(fetch, 1500);\n\n return func(postId);\n};\n\nexport default () => {\n extend(DiscussionPage.prototype, 'oncreate', function () {\n if (app.pusher) {\n app.pusher.then((channels) => {\n channels.pusher.bind('newVote', (data) => {\n const post = app.store.getById('posts', data.post_id);\n const userId = data.user_id;\n\n if (!post || post.votes() === data.votes || userId == app.session.user.id()) return;\n\n update(post.id());\n });\n });\n }\n });\n\n extend(DiscussionPage.prototype, 'onremove', function () {\n if (app.pusher) {\n app.pusher.then((channels) => {\n channels.pusher.unbind('newVote');\n });\n }\n });\n};\n","import app from 'flarum/forum/app';\nimport { extend } from 'flarum/common/extend';\n\nimport DiscussionListItem from 'flarum/forum/components/DiscussionListItem';\nimport abbreviateNumber from 'flarum/common/utils/abbreviateNumber';\nimport Button from 'flarum/common/components/Button';\nimport LoadingIndicator from 'flarum/common/components/LoadingIndicator';\n\nimport saveVote from './helpers/saveVote';\nimport setting from './helpers/setting';\n\nconst get = (discussion, key) => {\n const post = discussion.firstPost();\n\n if (post && post[key]() !== undefined) {\n return post[key]();\n }\n\n return discussion[key]();\n};\n\nexport default function addAlternateLayout() {\n extend(DiscussionListItem.prototype, 'oninit', function () {\n const discussion = this.attrs.discussion;\n\n if (!discussion.seeVotes()) {\n return;\n }\n\n this.subtree.check(() => this.voteLoading);\n });\n\n extend(DiscussionListItem.prototype, 'view', function (vdom) {\n const discussion = this.attrs.discussion;\n\n if (!discussion.seeVotes()) {\n return;\n }\n\n if (!vdom || !vdom.children) return;\n\n const content = vdom.children.find((v) => v && v.attrs && v.attrs.className && v.attrs.className.includes('DiscussionListItem-content'));\n const post = discussion.firstPost();\n\n const hasUpvoted = get(discussion, 'hasUpvoted');\n const hasDownvoted = get(discussion, 'hasDownvoted');\n // We set canVote to true for guest users so that they can access the login by clicking the button\n const canVote = !app.session.user || get(discussion, 'canVote');\n\n const upvotesOnly = setting('upVotesOnly', true);\n const altIcon = setting('iconNameAlt') || 'arrow';\n\n const onclick = (upvoted, downvoted) => saveVote(post, upvoted, downvoted, (val) => (this.voteLoading = val));\n\n content.children.unshift(\n
\n onclick(!hasUpvoted, false)}\n aria-label={app.translator.trans('fof-gamification.forum.post.upvote_button')}\n />\n\n {abbreviateNumber(get(discussion, 'votes') || 0)}\n\n {!upvotesOnly && (\n onclick(false, !hasDownvoted)}\n aria-label={app.translator.trans('fof-gamification.forum.post.downvote_button')}\n />\n )}\n\n {this.voteLoading && }\n
\n );\n });\n}\n","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/states/DiscussionListState'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['forum/components/Notification'];","import app from 'flarum/forum/app';\nimport Notification from 'flarum/forum/components/Notification';\nimport setting from '../helpers/setting';\n\nexport default class UpvotedNotification extends Notification {\n icon() {\n const icon = setting('iconName') || 'thumbs';\n\n if (this.attrs.notification.content() > 0) {\n return `fas fa-${icon}-up`;\n } else {\n return `fas fa-${icon}-down`;\n }\n }\n\n href() {\n return app.route.post(this.attrs.notification.subject());\n }\n\n content() {\n const user = this.attrs.notification.fromUser();\n const content = parseInt(this.attrs.notification.content());\n\n if (content > 0) {\n return app.translator.trans('fof-gamification.forum.notification.upvote', { user });\n } else {\n return app.translator.trans('fof-gamification.forum.notification.downvote', { user });\n }\n }\n\n excerpt() {\n return this.attrs.notification.subject().contentPlain();\n }\n}\n","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['forum/components/NotificationGrid'];","function asyncGeneratorStep(n, t, e, r, o, a, c) {\n try {\n var i = n[a](c),\n u = i.value;\n } catch (n) {\n return void e(n);\n }\n i.done ? t(u) : Promise.resolve(u).then(r, o);\n}\nfunction _asyncToGenerator(n) {\n return function () {\n var t = this,\n e = arguments;\n return new Promise(function (r, o) {\n var a = n.apply(t, e);\n function _next(n) {\n asyncGeneratorStep(a, r, o, _next, _throw, \"next\", n);\n }\n function _throw(n) {\n asyncGeneratorStep(a, r, o, _next, _throw, \"throw\", n);\n }\n _next(void 0);\n });\n };\n}\nexport { _asyncToGenerator as default };","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/Component'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/components/Tooltip'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/utils/SubtreeRetainer'];","import app from 'flarum/forum/app';\n\nimport Component from 'flarum/common/Component';\nimport LoadingIndicator from 'flarum/common/components/LoadingIndicator';\nimport Link from 'flarum/common/components/Link';\nimport Tooltip from 'flarum/common/components/Tooltip';\nimport avatar from 'flarum/common/helpers/avatar';\nimport icon from 'flarum/common/helpers/icon';\nimport SubtreeRetainer from 'flarum/common/utils/SubtreeRetainer';\n\nimport type Mithril from 'mithril';\n\nexport default class Voters extends Component {\n subtreeRetainer!: SubtreeRetainer;\n lastRenderVotes: number = -1;\n loading: boolean = false;\n\n oninit(vnode: Mithril.Vnode) {\n super.oninit(vnode);\n\n this.loading = !this.attrs.post.upvotes();\n\n if (this.loading) {\n this.load();\n }\n\n this.subtreeRetainer = new SubtreeRetainer(\n () => this.loading,\n () => this.attrs.post.votes(),\n () => this.attrs.post?.upvotes?.()?.length\n );\n }\n\n onbeforeupdate(vnode: Mithril.Vnode) {\n super.onbeforeupdate(vnode);\n\n return this.subtreeRetainer.needsRebuild();\n }\n\n onupdate(vnode: Mithril.Vnode) {\n if (this.lastRenderVotes !== this.attrs.post.votes()) {\n this.loading = true;\n setTimeout(() => m.redraw(), 0);\n this.lastRenderVotes = this.attrs.post.votes();\n this.load();\n }\n }\n\n view() {\n // if (this.loading) {\n if (this.attrs.post.votes() === false || this.attrs.post.upvotes() === false) {\n return (\n
\n
\n
\n \n {icon('fas fa-users')}\n {app.translator.trans('fof-gamification.forum.voters.label')}\n \n {app.translator.trans('fof-gamification.forum.voters.label')}\n \n \n
\n\n \n
\n
\n );\n }\n\n const max = 15;\n const voters = this.attrs.post.upvotes();\n\n return (\n
\n
\n
\n \n {icon('fas fa-users')}\n {app.translator.trans('fof-gamification.forum.voters.label')}\n \n {voters.length === 0\n ? app.translator.trans('fof-gamification.forum.voters.label_none')\n : app.translator.trans('fof-gamification.forum.voters.label')}\n \n \n
\n
\n {voters.length === 0 ? app.translator.trans('fof-gamification.forum.voters.none') : null}\n
\n
\n {voters.slice(0, max).map((user: any) => (\n \n {avatar(user)}\n \n ))}\n {voters.length > max ? (\n \n {`+${voters.length - max}`}\n \n ) : null}\n
\n
\n
\n );\n }\n\n async load() {\n await app.store.find('posts', this.attrs.post.id(), {\n include: 'upvotes',\n });\n\n this.loading = false;\n\n m.redraw();\n }\n}\n","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['forum/components/UserPage'];","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 `VotesUserPage` component shows posts which user voted on.\n */\nexport default class VotesUserPage extends PostsUserPage {\n /**\n * Load a new page of the user's activity feed.\n *\n * @param offset The position to start getting results from.\n * @protected\n */\n loadResults(offset: number) {\n return app.store.find('posts', {\n filter: {\n type: 'comment',\n voted: this.user.id(),\n },\n page: { offset, limit: this.loadLimit },\n sort: '-createdAt',\n });\n }\n}\n","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/extenders'];","import Extend from 'flarum/common/extenders';\nimport Rank from './models/Rank';\n\nexport default [\n new Extend.Store() //\n .add('ranks', Rank),\n];\n","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/components/Page'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/helpers/listItems'];","import app from 'flarum/forum/app';\nimport Component, { ComponentAttrs } from 'flarum/common/Component';\nimport type Mithril from 'mithril';\nimport icon from 'flarum/common/helpers/icon';\n\ninterface RankingImageAttrs extends ComponentAttrs {\n place: number;\n}\n\nexport default class RankingImage extends Component {\n view() {\n const imgUrl = app.forum.attribute(`fof-gamification.topimage${this.attrs.place}Url`);\n const place = this.attrs.place;\n\n return imgUrl ? (\n \"\"\n ) : (\n {icon('fas fa-trophy')}\n );\n }\n}\n","import app from 'flarum/forum/app';\nimport avatar from 'flarum/common/helpers/avatar';\nimport Page from 'flarum/common/components/Page';\nimport IndexPage from 'flarum/forum/components/IndexPage';\nimport Button from 'flarum/common/components/Button';\nimport LoadingIndicator from 'flarum/common/components/LoadingIndicator';\nimport listItems from 'flarum/common/helpers/listItems';\nimport username from 'flarum/common/helpers/username';\nimport Link from 'flarum/common/components/Link';\nimport RankingImage from './RankingImage';\n\n/**\n * This page re-uses Flarum's IndexPage CSS classes\n */\nexport default class RankingsPage extends Page {\n oninit(vnode) {\n super.oninit(vnode);\n\n if (!app.forum.attribute('canViewRankingPage')) {\n m.route.set('/');\n }\n\n this.loading = true;\n this.users = [];\n this.refresh();\n }\n\n view() {\n let loading;\n\n if (this.loading) {\n loading = LoadingIndicator.component();\n } else {\n loading = Button.component(\n {\n className: 'Button',\n onclick: this.loadMore.bind(this),\n },\n app.translator.trans('core.forum.discussion_list.load_more_button')\n );\n }\n\n return (\n
\n {IndexPage.prototype.hero()}\n
\n
\n \n
\n \n \n \n \n \n \n {this.users.map((user, i) => {\n ++i;\n return [\n \n {i < 4 ? : }\n \n {i < 4 ? : }\n ,\n ];\n })}\n
{app.translator.trans('fof-gamification.forum.ranking.rank')}{app.translator.trans('fof-gamification.forum.ranking.name')}{app.translator.trans('fof-gamification.forum.ranking.amount')}
{this.addOrdinalSuffix(i)}\n
\n

\n \n {i < 4 ? avatar(user, { className: 'info-avatar rankings-' + i + '-avatar' }) : ''} {username(user)}\n \n

\n
\n
{user.points()}{user.points()}
\n
{loading}
\n
\n
\n
\n
\n );\n }\n\n refresh(clear = true) {\n if (clear) {\n this.loading = true;\n this.users = [];\n }\n\n return this.loadResults().then(\n (results) => {\n this.users = [];\n this.parseResults(results);\n },\n () => {\n this.loading = false;\n m.redraw();\n }\n );\n }\n\n addOrdinalSuffix(i) {\n if (app.data.locale === 'en') {\n const j = i % 10;\n const k = i % 100;\n\n if (j === 1 && k !== 11) {\n return i + 'st';\n } else if (j === 2 && k !== 12) {\n return i + 'nd';\n } else if (j === 3 && k !== 13) {\n return i + 'rd';\n }\n return i + 'th';\n } else {\n return i;\n }\n }\n\n loadResults(offset) {\n const params = {};\n params.page = {\n offset: offset,\n limit: '10',\n };\n\n return app.store.find('rankings', params);\n }\n\n loadMore() {\n this.loading = true;\n\n this.loadResults(this.users.length).then(this.parseResults.bind(this));\n }\n\n parseResults(results) {\n [].push.apply(this.users, results);\n\n this.loading = false;\n\n this.users.sort(function (a, b) {\n return parseFloat(b.points()) - parseFloat(a.points());\n });\n\n m.redraw();\n\n return results;\n }\n}\n","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/models/Discussion'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/models/Post'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/models/User'];","import Extend from 'flarum/common/extenders';\nimport { default as commonExtend } from '../common/extend';\n\nimport RankingsPage from './components/RankingsPage';\nimport Discussion from 'flarum/common/models/Discussion';\nimport Post from 'flarum/common/models/Post';\nimport User from 'flarum/common/models/User';\n\nimport Rank from '../common/models/Rank';\n\nexport default [\n ...commonExtend,\n\n new Extend.Routes() //\n .add('rankings', '/rankings', RankingsPage),\n\n new Extend.Model(Discussion) //\n .attribute('votes')\n .attribute('hasUpvoted')\n .attribute('hasDownvoted')\n .attribute('canVote')\n .attribute('seeVotes'),\n\n new Extend.Model(Post) //\n .hasMany('upvotes')\n .hasMany('downvotes')\n .attribute('votes')\n .attribute('canVote')\n .attribute('canSeeVotes')\n .attribute('hasUpvoted')\n .attribute('hasDownvoted')\n .attribute('seeVoters'),\n\n new Extend.Model(User) //\n .attribute('points')\n .hasMany('ranks')\n .attribute('canHaveVotingNotifications'),\n];\n","import RankingsPage from './RankingsPage';\nimport VoteNotification from './VoteNotification';\nimport VotesModal from './VotesModal';\nimport Voters from './Voters';\n\nexport const components = {\n RankingsPage,\n VoteNotification,\n VotesModal,\n Voters,\n};\n","function _extends() {\n return _extends = Object.assign ? Object.assign.bind() : function (n) {\n for (var e = 1; e < arguments.length; e++) {\n var t = arguments[e];\n for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]);\n }\n return n;\n }, _extends.apply(null, arguments);\n}\nexport { _extends as default };","import rankLabel from './rankLabel';\n\nexport const helpers = {\n rankLabel,\n};\n","import saveVote from './saveVote';\nimport setting from './setting';\n\nimport { helpers as commonHelpers } from '../../common/helpers';\n\nexport const helpers = {\n saveVote,\n setting,\n ...commonHelpers,\n};\n","import app from 'flarum/forum/app';\n\nimport addHotnessSort from './addHotnessSort';\nimport addVoteButtons from './addVoteButtons';\nimport addUpvotesToDiscussion from './addUpvotesToDiscussion';\nimport addUserInfo from './addUserInfo';\nimport addPusher from './addPusher';\nimport addAlternateLayout from './addAlternateLayout';\n\nimport setting from './helpers/setting';\nimport addVotesSort from './addVotesSort';\nimport useAlternatePostVoteLayout from './useAlternatePostVoteLayout';\nimport addNotifications from './addNotifications';\nimport addVotersToDiscussionPageSideBar from './addVotersToDiscussionPageSideBar';\nimport addUpvoteTabToUserProfile from './addUpvoteTabToUserProfile';\n\nexport { default as extend } from './extend';\n\napp.initializers.add('fof-gamification', () => {\n addVoteButtons();\n addHotnessSort();\n addVotesSort();\n addUserInfo();\n addUpvotesToDiscussion();\n addPusher();\n addNotifications();\n addVotersToDiscussionPageSideBar();\n addUpvoteTabToUserProfile();\n\n if (setting('useAlternateLayout', true)) {\n addAlternateLayout();\n }\n\n if (setting('altPostVotingUi', true)) {\n useAlternatePostVoteLayout();\n }\n});\n\nexport * from './components';\nexport * from './helpers';\n","import app from 'flarum/forum/app';\nimport { extend } from 'flarum/common/extend';\nimport PostUser from 'flarum/forum/components/PostUser';\nimport UserCard from 'flarum/forum/components/UserCard';\nimport rankLabel from '../common/helpers/rankLabel';\nimport setting from './helpers/setting';\nimport icon from 'flarum/common/helpers/icon';\n\nexport default function () {\n const matchClass = (className) => {\n return (node) => node && node.attrs && node.attrs.className && String(node.attrs.className).split(' ').includes(className);\n };\n\n const findMatchClass = function (node, className) {\n const arr = [];\n\n if (node && node.children && Array.isArray(node.children)) {\n const nodeInChildren = node.children.find(matchClass(className));\n\n if (nodeInChildren) {\n arr.push(nodeInChildren);\n }\n\n node.children.forEach(function (currentValue) {\n arr.push(...findMatchClass(currentValue, className));\n });\n }\n\n return arr;\n };\n\n extend(UserCard.prototype, 'infoItems', function (items) {\n const user = this.attrs.user;\n\n items.add(\n 'points',\n
\n {icon('fas fa-medal')}\n {app.translator.trans('fof-gamification.forum.user.card.points', {\n count: user.points(),\n })}\n
,\n 50\n );\n });\n\n extend(UserCard.prototype, 'view', function (vnode) {\n const user = this.attrs.user;\n const profile_node = findMatchClass(vnode, 'UserCard-profile')[0];\n const amt = Number(setting('rankAmt'));\n\n if (!profile_node) return;\n\n let badges_node = profile_node.children.find(matchClass('UserCard-badges'));\n if (user.ranks()) {\n if (!badges_node) {\n profile_node.children.splice(\n 1,\n 0,\n
    \n {user\n .ranks()\n .reverse()\n .map((rank, i) => {\n if (!amt || i < amt) {\n return
  • {rankLabel(rank)}
  • ;\n }\n })}\n
\n );\n } else {\n user\n .ranks()\n .reverse()\n .map((rank, i) => {\n if (!amt || i < amt) {\n return
  • {rankLabel(rank)}
  • ;\n }\n })\n .forEach((rank) => {\n if (!rank) {\n return;\n }\n badges_node.children.push(rank);\n });\n }\n }\n\n return vnode;\n });\n\n extend(PostUser.prototype, 'view', function (vnode) {\n const post = this.attrs.post;\n const user = post.user();\n\n if (!user) {\n return vnode;\n }\n\n const header_node = vnode.children.find(matchClass('PostUser-name'));\n const amt = Number(setting('rankAmt')) ?? user.ranks().length;\n\n header_node.children = header_node.children\n .concat(\n user\n .ranks()\n .reverse()\n .splice(0, amt)\n .map((rank) => {\n return {rankLabel(rank)};\n })\n )\n .filter(function (el) {\n return el.tag !== undefined;\n });\n });\n}\n","import app from 'flarum/forum/app';\nimport { extend } from 'flarum/common/extend';\nimport Button from 'flarum/common/components/Button';\nimport CommentPost from 'flarum/forum/components/CommentPost';\nimport classList from 'flarum/common/utils/classList';\nimport PostControls from 'flarum/forum/utils/PostControls';\n\nimport VotesModal from './components/VotesModal';\nimport setting from './helpers/setting';\nimport saveVote from './helpers/saveVote';\n\nexport default function () {\n extend(PostControls, 'moderationControls', function (items, post) {\n if (post.seeVoters()) {\n items.add('viewVotes', [\n m(\n Button,\n {\n icon: 'fas fa-thumbs-up',\n onclick: () => {\n app.modal.show(VotesModal, { post });\n },\n },\n app.translator.trans('fof-gamification.forum.mod_item')\n ),\n ]);\n }\n });\n\n extend(CommentPost.prototype, 'actionItems', function (items) {\n const post = this.attrs.post;\n\n //if (!post.canVote()) return;\n\n const hasDownvoted = post.hasDownvoted();\n const hasUpvoted = post.hasUpvoted();\n\n const icon = setting('iconName') || 'thumbs';\n const upVotesOnly = setting('upVotesOnly', true);\n\n const canSeeVotes = post.canSeeVotes();\n\n // We set canVote to true for guest users so that they can access the login by clicking the button\n const canVote = !app.session.user || post.canVote();\n\n const onclick = (upvoted, downvoted) => saveVote(post, upvoted, downvoted, (val) => (this.voteLoading = val));\n\n items.add(\n 'votes',\n
    \n {Button.component({\n icon: this.voteLoading ? undefined : `fas fa-fw fa-${icon}-up`,\n className: classList('Post-vote Post-upvote', hasUpvoted && 'Post-vote--active'),\n loading: this.voteLoading,\n disabled: this.voteLoading || !canVote || !canSeeVotes,\n onclick: () => onclick(!hasUpvoted, false),\n 'aria-label': app.translator.trans('fof-gamification.forum.post.upvote_button'),\n })}\n\n \n\n {!upVotesOnly &&\n Button.component({\n icon: this.voteLoading ? undefined : `fas fa-fw fa-${icon}-down`,\n className: classList('Post-vote Post-downvote', hasDownvoted && 'Post-vote--active'),\n loading: this.voteLoading,\n disabled: !canVote || !canSeeVotes,\n onclick: () => onclick(false, !hasDownvoted),\n 'aria-label': app.translator.trans('fof-gamification.forum.post.downvote_button'),\n })}\n
    ,\n 10\n );\n });\n}\n","import app from 'flarum/forum/app';\nimport { extend } from 'flarum/common/extend';\nimport IndexPage from 'flarum/forum/components/IndexPage';\nimport DiscussionListState from 'flarum/forum/states/DiscussionListState';\nimport LinkButton from 'flarum/common/components/LinkButton';\n\nexport default function () {\n extend(IndexPage.prototype, 'navItems', function (items) {\n if (!app.forum.attribute('canViewRankingPage')) {\n return;\n }\n\n items.add(\n 'rankings',\n LinkButton.component(\n {\n href: app.route('rankings'),\n icon: 'fas fa-trophy',\n },\n app.translator.trans('fof-gamification.forum.nav.name')\n ),\n 80\n );\n });\n\n extend(DiscussionListState.prototype, 'sortMap', function (map) {\n map.hot = '-hotness';\n });\n}\n","import { extend } from 'flarum/common/extend';\nimport DiscussionListState from 'flarum/common/states/DiscussionListState';\n\nexport default function () {\n extend(DiscussionListState.prototype, 'sortMap', function (map) {\n map.votes = '-votes';\n });\n}\n","import app from 'flarum/forum/app';\nimport { extend } from 'flarum/common/extend';\nimport DiscussionListItem from 'flarum/forum/components/DiscussionListItem';\nimport abbreviateNumber from 'flarum/common/utils/abbreviateNumber';\nimport icon from 'flarum/common/helpers/icon';\nimport setting from './helpers/setting';\n\nexport default function () {\n if (!setting('showVotesOnDiscussionPage', true) || setting('useAlternateLayout', true)) {\n return;\n }\n\n extend(DiscussionListItem.prototype, 'elementAttrs', function (attrs) {\n if (!this.attrs.discussion.seeVotes()) {\n return;\n }\n\n attrs.className += ' DiscussionListItem--withVotes';\n });\n\n extend(DiscussionListItem.prototype, 'infoItems', function (items) {\n const discussion = this.attrs.discussion;\n\n if (!discussion.seeVotes()) {\n return;\n }\n\n items.add(\n 'discussion-votes',\n \n {icon('far fa-thumbs-up')}\n {abbreviateNumber(this.attrs.discussion.votes())}\n ,\n 20\n );\n });\n}\n","import { extend } from 'flarum/common/extend';\nimport app from 'flarum/forum/app';\nimport VoteNotification from './components/VoteNotification';\nimport NotificationGrid from 'flarum/forum/components/NotificationGrid';\nimport ItemList from 'flarum/common/utils/ItemList';\n\nexport default function addNotifications() {\n app.notificationComponents.vote = VoteNotification;\n\n extend(NotificationGrid.prototype, 'notificationTypes', function (items: ItemList<{ name: string; icon: string; label: any }>) {\n const user = app.session?.user;\n\n if (!user?.canHaveVotingNotifications?.()) return;\n\n items.add('vote', {\n name: 'vote',\n icon: 'fas fa-thumbs-up',\n label: app.translator.trans('fof-gamification.forum.notification.prefrences.vote'),\n });\n });\n}\n","import app from 'flarum/forum/app';\nimport { extend } from 'flarum/common/extend';\nimport DiscussionPage from 'flarum/forum/components/DiscussionPage';\nimport Voters from './components/Voters';\nimport type ItemList from 'flarum/common/utils/ItemList';\n\nimport type Mithril from 'mithril';\n\n/**\n * Adds our custom {@link Voters} component to the discussion sidebar.\n */\nexport default function addVotersToDiscussionPageSideBar() {\n extend(DiscussionPage.prototype, 'sidebarItems', function (this: DiscussionPage, items: ItemList) {\n const discussion = this.discussion;\n const posts = discussion!.posts() || [];\n const firstPost = posts?.[0];\n\n if (firstPost?.canSeeVotes?.() && firstPost?.seeVoters?.() && !!app.forum.attribute('fof-gamification-op-votes-only')) {\n items.add('op-voters', , 90);\n }\n });\n}\n","import { extend } from 'flarum/common/extend';\nimport app from 'flarum/forum/app';\nimport UserPage from 'flarum/forum/components/UserPage';\nimport LinkButton from 'flarum/common/components/LinkButton';\nimport VotesUserPage from './components/VotesUserPage';\nimport setting from './helpers/setting';\n\nexport default function addUpvoteTabToUserProfile() {\n app.routes['user.votes'] = { path: '/u/:username/votes', component: VotesUserPage };\n extend(UserPage.prototype, 'navItems', function (items) {\n const user = this.user;\n const icon = setting('iconName') || 'thumbs';\n items.add(\n 'votes',\n \n {app.translator.trans('fof-gamification.forum.user.votes_link')}\n ,\n 85\n );\n });\n}\n","import app from 'flarum/forum/app';\n\nimport { extend } from 'flarum/common/extend';\n\nimport CommentPost from 'flarum/forum/components/CommentPost';\nimport Button from 'flarum/common/components/Button';\nimport abbreviateNumber from 'flarum/common/utils/abbreviateNumber';\nimport LoadingIndicator from 'flarum/common/components/LoadingIndicator';\nimport type ItemList from 'flarum/common/utils/ItemList';\n\nimport setting from './helpers/setting';\nimport saveVote from './helpers/saveVote';\n\nexport default function useAlternatePostVoteLayout() {\n extend(CommentPost.prototype, 'actionItems', function (this: CommentPost, items: ItemList) {\n if (this.attrs.post.isHidden()) return;\n\n items.remove('votes');\n });\n\n extend(CommentPost.prototype, 'classes', function (this: CommentPost, classes: string[]) {\n if (this.attrs.post.isHidden()) return;\n\n const upvotesOnly = setting('upVotesOnly', true);\n\n classes.push('votesAlternativeLayout');\n\n if (upvotesOnly) {\n classes.push('votesUpvotesOnly');\n }\n });\n\n extend(CommentPost.prototype, 'headerItems', function (this: CommentPost, items: ItemList) {\n const post = this.attrs.post;\n\n if (post.isHidden()) return;\n if (!post.canSeeVotes()) return;\n\n const hasDownvoted = post.hasDownvoted();\n const hasUpvoted = post.hasUpvoted();\n\n const icon = setting('iconName') || 'thumbs';\n const upvotesOnly = setting('upVotesOnly', true);\n\n const canSeeVotes = post.canSeeVotes();\n\n // We set canVote to true for guest users so that they can access the login by clicking the button\n const canVote = !app.session.user || post.canVote();\n\n const onclick = (upvoted, downvoted) =>\n saveVote(post, upvoted, downvoted, (val) => {\n this.voteLoading = val;\n });\n\n items.add(\n 'votes',\n
    \n onclick(!hasUpvoted, false)}\n aria-label={app.translator.trans('fof-gamification.forum.post.upvote_button')}\n />\n\n {abbreviateNumber(post.votes() || 0)}\n\n {!upvotesOnly && (\n onclick(false, !hasDownvoted)}\n aria-label={app.translator.trans('fof-gamification.forum.post.downvote_button')}\n />\n )}\n\n {this.voteLoading && }\n
    ,\n 10000\n );\n });\n}\n"],"names":["reTrim","reIsBadHex","reIsBinary","reIsOctal","freeParseInt","parseInt","freeGlobal","global","Object","freeSelf","self","root","Function","objectToString","prototype","toString","nativeMax","Math","max","nativeMin","min","now","Date","isObject","value","type","toNumber","isObjectLike","call","isSymbol","other","valueOf","replace","isBinary","test","slice","module","exports","func","wait","options","lastArgs","lastThis","maxWait","result","timerId","lastCallTime","lastInvokeTime","leading","maxing","trailing","TypeError","invokeFunc","time","args","thisArg","undefined","apply","shouldInvoke","timeSinceLastCall","timerExpired","trailingEdge","setTimeout","remainingWait","debounced","isInvoking","arguments","this","leadingEdge","cancel","clearTimeout","flush","_typeof","require","_regeneratorRuntime","e","__esModule","t","r","n","hasOwnProperty","o","defineProperty","i","Symbol","a","iterator","c","asyncIterator","u","toStringTag","define","enumerable","configurable","writable","wrap","Generator","create","Context","makeInvokeMethod","tryCatch","arg","h","l","f","s","y","GeneratorFunction","GeneratorFunctionPrototype","p","d","getPrototypeOf","v","values","g","defineIteratorMethods","forEach","_invoke","AsyncIterator","invoke","resolve","__await","then","callInvokeWithMethodAndArg","Error","done","method","delegate","maybeInvokeDelegate","sent","_sent","dispatchException","abrupt","resultName","next","nextLoc","pushTryEntry","tryLoc","catchLoc","finallyLoc","afterLoc","tryEntries","push","resetTryEntry","completion","reset","isNaN","length","displayName","isGeneratorFunction","constructor","name","mark","setPrototypeOf","__proto__","awrap","async","Promise","keys","reverse","pop","prev","charAt","stop","rval","handle","complete","finish","delegateYield","runtime","regeneratorRuntime","accidentalStrictMode","globalThis","__webpack_module_cache__","__webpack_require__","moduleId","cachedModule","__webpack_modules__","getter","definition","key","get","window","obj","prop","_setPrototypeOf","bind","_inheritsLoose","flarum","core","compat","Rank","_Model","_proto","points","Model","color","models","VotesModal","_Modal","className","title","app","trans","oninit","vnode","loading","attrs","post","upvotes","downvotes","load","content","_this","m","LoadingIndicator","map","voters","user","Link","href","avatar","username","find","id","include","loaded","Modal","isBool","val","upvoted","downvoted","discussion","canVote","redraw","save","pushAttributes","votes","DiscussionControls","rankLabel","rank","style","backgroundColor","fetch","postId","firstPost","UpvotedNotification","_Notification","icon","setting","notification","subject","fromUser","excerpt","contentPlain","Notification","asyncGeneratorStep","Voters","_Component","_len","Array","_key","concat","subtreeRetainer","lastRenderVotes","_this2","SubtreeRetainer","_this2$attrs$post","onbeforeupdate","needsRebuild","onupdate","view","display","slug","Tooltip","text","_load","_callee","_context","_next","_throw","Component","VotesUserPage","_PostsUserPage","loadResults","offset","filter","voted","page","limit","loadLimit","sort","PostsUserPage","Extend","add","RankingImage","imgUrl","attribute","place","src","alt","RankingsPage","_Page","route","set","users","refresh","Button","onclick","loadMore","IndexPage","hero","listItems","sidebarItems","toArray","class","addOrdinalSuffix","force","clear","results","parseResults","locale","j","k","params","b","parseFloat","Page","commonExtend","Discussion","Post","hasMany","User","components","VoteNotification","_extends","assign","helpers","saveVote","matchClass","findMatchClass","extend","PostControls","items","seeVoters","show","CommentPost","hasDownvoted","hasUpvoted","upVotesOnly","canSeeVotes","voteLoading","classList","disabled","LinkButton","DiscussionListState","hot","node","String","split","includes","arr","children","isArray","nodeInChildren","currentValue","UserCard","count","profile_node","amt","Number","badges_node","ranks","splice","PostUser","_Number","header_node","el","tag","DiscussionListItem","seeVotes","abbreviateNumber","DiscussionPage","channels","pusher","data","getById","post_id","userId","user_id","debounce","unbind","vote","NotificationGrid","_app$session","canHaveVotingNotifications","label","posts","path","component","UserPage","subtree","check","vdom","upvotesOnly","altIcon","unshift","size","isHidden","remove","classes"],"sourceRoot":""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CjC,IT/CF","sources":["webpack://@fof/gamification/./node_modules/lodash.debounce/index.js","webpack://@fof/gamification/./node_modules/@babel/runtime/helpers/regeneratorRuntime.js","webpack://@fof/gamification/./node_modules/@babel/runtime/helpers/typeof.js","webpack://@fof/gamification/./node_modules/@babel/runtime/regenerator/index.js","webpack://@fof/gamification/webpack/bootstrap","webpack://@fof/gamification/webpack/runtime/compat get default export","webpack://@fof/gamification/webpack/runtime/define property getters","webpack://@fof/gamification/webpack/runtime/global","webpack://@fof/gamification/webpack/runtime/hasOwnProperty shorthand","webpack://@fof/gamification/webpack/runtime/make namespace object","webpack://@fof/gamification/./node_modules/@babel/runtime/helpers/esm/setPrototypeOf.js","webpack://@fof/gamification/./node_modules/@babel/runtime/helpers/esm/inheritsLoose.js","webpack://@fof/gamification/external root \"flarum.core.compat['common/Model']\"","webpack://@fof/gamification/./src/common/models/Rank.ts","webpack://@fof/gamification/./src/common/models/index.ts","webpack://@fof/gamification/external root \"flarum.core.compat['forum/app']\"","webpack://@fof/gamification/external root \"flarum.core.compat['common/extend']\"","webpack://@fof/gamification/external root \"flarum.core.compat['forum/components/IndexPage']\"","webpack://@fof/gamification/external root \"flarum.core.compat['forum/states/DiscussionListState']\"","webpack://@fof/gamification/external root \"flarum.core.compat['common/components/LinkButton']\"","webpack://@fof/gamification/external root \"flarum.core.compat['common/components/Button']\"","webpack://@fof/gamification/external root \"flarum.core.compat['forum/components/CommentPost']\"","webpack://@fof/gamification/external root \"flarum.core.compat['common/utils/classList']\"","webpack://@fof/gamification/external root \"flarum.core.compat['forum/utils/PostControls']\"","webpack://@fof/gamification/external root \"flarum.core.compat['common/components/Modal']\"","webpack://@fof/gamification/external root \"flarum.core.compat['common/components/LoadingIndicator']\"","webpack://@fof/gamification/external root \"flarum.core.compat['common/helpers/avatar']\"","webpack://@fof/gamification/external root \"flarum.core.compat['common/helpers/username']\"","webpack://@fof/gamification/external root \"flarum.core.compat['common/components/Link']\"","webpack://@fof/gamification/./src/forum/components/VotesModal.js","webpack://@fof/gamification/./src/forum/helpers/setting.js","webpack://@fof/gamification/external root \"flarum.core.compat['forum/utils/DiscussionControls']\"","webpack://@fof/gamification/./src/forum/helpers/saveVote.js","webpack://@fof/gamification/external root \"flarum.core.compat['forum/components/DiscussionListItem']\"","webpack://@fof/gamification/external root \"flarum.core.compat['common/utils/abbreviateNumber']\"","webpack://@fof/gamification/external root \"flarum.core.compat['common/helpers/icon']\"","webpack://@fof/gamification/external root \"flarum.core.compat['forum/components/PostUser']\"","webpack://@fof/gamification/external root \"flarum.core.compat['forum/components/UserCard']\"","webpack://@fof/gamification/./src/common/helpers/rankLabel.js","webpack://@fof/gamification/external root \"flarum.core.compat['forum/components/DiscussionPage']\"","webpack://@fof/gamification/./src/forum/addPusher.js","webpack://@fof/gamification/./src/forum/addAlternateLayout.js","webpack://@fof/gamification/external root \"flarum.core.compat['common/states/DiscussionListState']\"","webpack://@fof/gamification/external root \"flarum.core.compat['forum/components/Notification']\"","webpack://@fof/gamification/./src/forum/components/VoteNotification.js","webpack://@fof/gamification/external root \"flarum.core.compat['forum/components/NotificationGrid']\"","webpack://@fof/gamification/./node_modules/@babel/runtime/helpers/esm/asyncToGenerator.js","webpack://@fof/gamification/external root \"flarum.core.compat['common/Component']\"","webpack://@fof/gamification/external root \"flarum.core.compat['common/components/Tooltip']\"","webpack://@fof/gamification/external root \"flarum.core.compat['common/utils/SubtreeRetainer']\"","webpack://@fof/gamification/./src/forum/components/Voters.tsx","webpack://@fof/gamification/external root \"flarum.core.compat['forum/components/UserPage']\"","webpack://@fof/gamification/external root \"flarum.core.compat['forum/components/PostsUserPage']\"","webpack://@fof/gamification/./src/forum/components/VotesUserPage.ts","webpack://@fof/gamification/external root \"flarum.core.compat['common/extenders']\"","webpack://@fof/gamification/./src/common/extend.ts","webpack://@fof/gamification/external root \"flarum.core.compat['common/components/Page']\"","webpack://@fof/gamification/external root \"flarum.core.compat['common/helpers/listItems']\"","webpack://@fof/gamification/./src/forum/components/RankingImage.tsx","webpack://@fof/gamification/./src/forum/components/RankingsPage.js","webpack://@fof/gamification/external root \"flarum.core.compat['common/models/Discussion']\"","webpack://@fof/gamification/external root \"flarum.core.compat['common/models/Post']\"","webpack://@fof/gamification/external root \"flarum.core.compat['common/models/User']\"","webpack://@fof/gamification/./src/forum/extend.ts","webpack://@fof/gamification/./src/forum/components/index.js","webpack://@fof/gamification/./node_modules/@babel/runtime/helpers/esm/extends.js","webpack://@fof/gamification/./src/common/helpers/index.js","webpack://@fof/gamification/./src/forum/helpers/index.js","webpack://@fof/gamification/./src/forum/index.ts","webpack://@fof/gamification/./src/forum/addUserInfo.js","webpack://@fof/gamification/./src/forum/addVoteButtons.js","webpack://@fof/gamification/./src/forum/addHotnessSort.js","webpack://@fof/gamification/./src/forum/addVotesSort.js","webpack://@fof/gamification/./src/forum/addUpvotesToDiscussion.js","webpack://@fof/gamification/./src/forum/addNotifications.ts","webpack://@fof/gamification/./src/forum/addVotersToDiscussionPageSideBar.tsx","webpack://@fof/gamification/./src/forum/addUpvoteTabToUserProfile.js","webpack://@fof/gamification/./src/forum/useAlternatePostVoteLayout.tsx"],"sourcesContent":["/**\n * lodash (Custom Build) \n * Build: `lodash modularize exports=\"npm\" -o ./`\n * Copyright jQuery Foundation and other contributors \n * Released under MIT license \n * Based on Underscore.js 1.8.3 \n * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors\n */\n\n/** Used as the `TypeError` message for \"Functions\" methods. */\nvar FUNC_ERROR_TEXT = 'Expected a function';\n\n/** Used as references for various `Number` constants. */\nvar NAN = 0 / 0;\n\n/** `Object#toString` result references. */\nvar symbolTag = '[object Symbol]';\n\n/** Used to match leading and trailing whitespace. */\nvar reTrim = /^\\s+|\\s+$/g;\n\n/** Used to detect bad signed hexadecimal string values. */\nvar reIsBadHex = /^[-+]0x[0-9a-f]+$/i;\n\n/** Used to detect binary string values. */\nvar reIsBinary = /^0b[01]+$/i;\n\n/** Used to detect octal string values. */\nvar reIsOctal = /^0o[0-7]+$/i;\n\n/** Built-in method references without a dependency on `root`. */\nvar freeParseInt = parseInt;\n\n/** Detect free variable `global` from Node.js. */\nvar freeGlobal = typeof global == 'object' && global && global.Object === Object && global;\n\n/** Detect free variable `self`. */\nvar freeSelf = typeof self == 'object' && self && self.Object === Object && self;\n\n/** Used as a reference to the global object. */\nvar root = freeGlobal || freeSelf || Function('return this')();\n\n/** Used for built-in method references. */\nvar objectProto = Object.prototype;\n\n/**\n * Used to resolve the\n * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)\n * of values.\n */\nvar objectToString = objectProto.toString;\n\n/* Built-in method references for those with the same name as other `lodash` methods. */\nvar nativeMax = Math.max,\n nativeMin = Math.min;\n\n/**\n * Gets the timestamp of the number of milliseconds that have elapsed since\n * the Unix epoch (1 January 1970 00:00:00 UTC).\n *\n * @static\n * @memberOf _\n * @since 2.4.0\n * @category Date\n * @returns {number} Returns the timestamp.\n * @example\n *\n * _.defer(function(stamp) {\n * console.log(_.now() - stamp);\n * }, _.now());\n * // => Logs the number of milliseconds it took for the deferred invocation.\n */\nvar now = function() {\n return root.Date.now();\n};\n\n/**\n * Creates a debounced function that delays invoking `func` until after `wait`\n * milliseconds have elapsed since the last time the debounced function was\n * invoked. The debounced function comes with a `cancel` method to cancel\n * delayed `func` invocations and a `flush` method to immediately invoke them.\n * Provide `options` to indicate whether `func` should be invoked on the\n * leading and/or trailing edge of the `wait` timeout. The `func` is invoked\n * with the last arguments provided to the debounced function. Subsequent\n * calls to the debounced function return the result of the last `func`\n * invocation.\n *\n * **Note:** If `leading` and `trailing` options are `true`, `func` is\n * invoked on the trailing edge of the timeout only if the debounced function\n * is invoked more than once during the `wait` timeout.\n *\n * If `wait` is `0` and `leading` is `false`, `func` invocation is deferred\n * until to the next tick, similar to `setTimeout` with a timeout of `0`.\n *\n * See [David Corbacho's article](https://css-tricks.com/debouncing-throttling-explained-examples/)\n * for details over the differences between `_.debounce` and `_.throttle`.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Function\n * @param {Function} func The function to debounce.\n * @param {number} [wait=0] The number of milliseconds to delay.\n * @param {Object} [options={}] The options object.\n * @param {boolean} [options.leading=false]\n * Specify invoking on the leading edge of the timeout.\n * @param {number} [options.maxWait]\n * The maximum time `func` is allowed to be delayed before it's invoked.\n * @param {boolean} [options.trailing=true]\n * Specify invoking on the trailing edge of the timeout.\n * @returns {Function} Returns the new debounced function.\n * @example\n *\n * // Avoid costly calculations while the window size is in flux.\n * jQuery(window).on('resize', _.debounce(calculateLayout, 150));\n *\n * // Invoke `sendMail` when clicked, debouncing subsequent calls.\n * jQuery(element).on('click', _.debounce(sendMail, 300, {\n * 'leading': true,\n * 'trailing': false\n * }));\n *\n * // Ensure `batchLog` is invoked once after 1 second of debounced calls.\n * var debounced = _.debounce(batchLog, 250, { 'maxWait': 1000 });\n * var source = new EventSource('/stream');\n * jQuery(source).on('message', debounced);\n *\n * // Cancel the trailing debounced invocation.\n * jQuery(window).on('popstate', debounced.cancel);\n */\nfunction debounce(func, wait, options) {\n var lastArgs,\n lastThis,\n maxWait,\n result,\n timerId,\n lastCallTime,\n lastInvokeTime = 0,\n leading = false,\n maxing = false,\n trailing = true;\n\n if (typeof func != 'function') {\n throw new TypeError(FUNC_ERROR_TEXT);\n }\n wait = toNumber(wait) || 0;\n if (isObject(options)) {\n leading = !!options.leading;\n maxing = 'maxWait' in options;\n maxWait = maxing ? nativeMax(toNumber(options.maxWait) || 0, wait) : maxWait;\n trailing = 'trailing' in options ? !!options.trailing : trailing;\n }\n\n function invokeFunc(time) {\n var args = lastArgs,\n thisArg = lastThis;\n\n lastArgs = lastThis = undefined;\n lastInvokeTime = time;\n result = func.apply(thisArg, args);\n return result;\n }\n\n function leadingEdge(time) {\n // Reset any `maxWait` timer.\n lastInvokeTime = time;\n // Start the timer for the trailing edge.\n timerId = setTimeout(timerExpired, wait);\n // Invoke the leading edge.\n return leading ? invokeFunc(time) : result;\n }\n\n function remainingWait(time) {\n var timeSinceLastCall = time - lastCallTime,\n timeSinceLastInvoke = time - lastInvokeTime,\n result = wait - timeSinceLastCall;\n\n return maxing ? nativeMin(result, maxWait - timeSinceLastInvoke) : result;\n }\n\n function shouldInvoke(time) {\n var timeSinceLastCall = time - lastCallTime,\n timeSinceLastInvoke = time - lastInvokeTime;\n\n // Either this is the first call, activity has stopped and we're at the\n // trailing edge, the system time has gone backwards and we're treating\n // it as the trailing edge, or we've hit the `maxWait` limit.\n return (lastCallTime === undefined || (timeSinceLastCall >= wait) ||\n (timeSinceLastCall < 0) || (maxing && timeSinceLastInvoke >= maxWait));\n }\n\n function timerExpired() {\n var time = now();\n if (shouldInvoke(time)) {\n return trailingEdge(time);\n }\n // Restart the timer.\n timerId = setTimeout(timerExpired, remainingWait(time));\n }\n\n function trailingEdge(time) {\n timerId = undefined;\n\n // Only invoke if we have `lastArgs` which means `func` has been\n // debounced at least once.\n if (trailing && lastArgs) {\n return invokeFunc(time);\n }\n lastArgs = lastThis = undefined;\n return result;\n }\n\n function cancel() {\n if (timerId !== undefined) {\n clearTimeout(timerId);\n }\n lastInvokeTime = 0;\n lastArgs = lastCallTime = lastThis = timerId = undefined;\n }\n\n function flush() {\n return timerId === undefined ? result : trailingEdge(now());\n }\n\n function debounced() {\n var time = now(),\n isInvoking = shouldInvoke(time);\n\n lastArgs = arguments;\n lastThis = this;\n lastCallTime = time;\n\n if (isInvoking) {\n if (timerId === undefined) {\n return leadingEdge(lastCallTime);\n }\n if (maxing) {\n // Handle invocations in a tight loop.\n timerId = setTimeout(timerExpired, wait);\n return invokeFunc(lastCallTime);\n }\n }\n if (timerId === undefined) {\n timerId = setTimeout(timerExpired, wait);\n }\n return result;\n }\n debounced.cancel = cancel;\n debounced.flush = flush;\n return debounced;\n}\n\n/**\n * Checks if `value` is the\n * [language type](http://www.ecma-international.org/ecma-262/7.0/#sec-ecmascript-language-types)\n * of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`)\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is an object, else `false`.\n * @example\n *\n * _.isObject({});\n * // => true\n *\n * _.isObject([1, 2, 3]);\n * // => true\n *\n * _.isObject(_.noop);\n * // => true\n *\n * _.isObject(null);\n * // => false\n */\nfunction isObject(value) {\n var type = typeof value;\n return !!value && (type == 'object' || type == 'function');\n}\n\n/**\n * Checks if `value` is object-like. A value is object-like if it's not `null`\n * and has a `typeof` result of \"object\".\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is object-like, else `false`.\n * @example\n *\n * _.isObjectLike({});\n * // => true\n *\n * _.isObjectLike([1, 2, 3]);\n * // => true\n *\n * _.isObjectLike(_.noop);\n * // => false\n *\n * _.isObjectLike(null);\n * // => false\n */\nfunction isObjectLike(value) {\n return !!value && typeof value == 'object';\n}\n\n/**\n * Checks if `value` is classified as a `Symbol` primitive or object.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a symbol, else `false`.\n * @example\n *\n * _.isSymbol(Symbol.iterator);\n * // => true\n *\n * _.isSymbol('abc');\n * // => false\n */\nfunction isSymbol(value) {\n return typeof value == 'symbol' ||\n (isObjectLike(value) && objectToString.call(value) == symbolTag);\n}\n\n/**\n * Converts `value` to a number.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to process.\n * @returns {number} Returns the number.\n * @example\n *\n * _.toNumber(3.2);\n * // => 3.2\n *\n * _.toNumber(Number.MIN_VALUE);\n * // => 5e-324\n *\n * _.toNumber(Infinity);\n * // => Infinity\n *\n * _.toNumber('3.2');\n * // => 3.2\n */\nfunction toNumber(value) {\n if (typeof value == 'number') {\n return value;\n }\n if (isSymbol(value)) {\n return NAN;\n }\n if (isObject(value)) {\n var other = typeof value.valueOf == 'function' ? value.valueOf() : value;\n value = isObject(other) ? (other + '') : other;\n }\n if (typeof value != 'string') {\n return value === 0 ? value : +value;\n }\n value = value.replace(reTrim, '');\n var isBinary = reIsBinary.test(value);\n return (isBinary || reIsOctal.test(value))\n ? freeParseInt(value.slice(2), isBinary ? 2 : 8)\n : (reIsBadHex.test(value) ? NAN : +value);\n}\n\nmodule.exports = debounce;\n","var _typeof = require(\"./typeof.js\")[\"default\"];\nfunction _regeneratorRuntime() {\n \"use strict\"; /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */\n module.exports = _regeneratorRuntime = function _regeneratorRuntime() {\n return e;\n }, module.exports.__esModule = true, module.exports[\"default\"] = module.exports;\n var t,\n e = {},\n r = Object.prototype,\n n = r.hasOwnProperty,\n o = Object.defineProperty || function (t, e, r) {\n t[e] = r.value;\n },\n i = \"function\" == typeof Symbol ? Symbol : {},\n a = i.iterator || \"@@iterator\",\n c = i.asyncIterator || \"@@asyncIterator\",\n u = i.toStringTag || \"@@toStringTag\";\n function define(t, e, r) {\n return Object.defineProperty(t, e, {\n value: r,\n enumerable: !0,\n configurable: !0,\n writable: !0\n }), t[e];\n }\n try {\n define({}, \"\");\n } catch (t) {\n define = function define(t, e, r) {\n return t[e] = r;\n };\n }\n function wrap(t, e, r, n) {\n var i = e && e.prototype instanceof Generator ? e : Generator,\n a = Object.create(i.prototype),\n c = new Context(n || []);\n return o(a, \"_invoke\", {\n value: makeInvokeMethod(t, r, c)\n }), a;\n }\n function tryCatch(t, e, r) {\n try {\n return {\n type: \"normal\",\n arg: t.call(e, r)\n };\n } catch (t) {\n return {\n type: \"throw\",\n arg: t\n };\n }\n }\n e.wrap = wrap;\n var h = \"suspendedStart\",\n l = \"suspendedYield\",\n f = \"executing\",\n s = \"completed\",\n y = {};\n function Generator() {}\n function GeneratorFunction() {}\n function GeneratorFunctionPrototype() {}\n var p = {};\n define(p, a, function () {\n return this;\n });\n var d = Object.getPrototypeOf,\n v = d && d(d(values([])));\n v && v !== r && n.call(v, a) && (p = v);\n var g = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(p);\n function defineIteratorMethods(t) {\n [\"next\", \"throw\", \"return\"].forEach(function (e) {\n define(t, e, function (t) {\n return this._invoke(e, t);\n });\n });\n }\n function AsyncIterator(t, e) {\n function invoke(r, o, i, a) {\n var c = tryCatch(t[r], t, o);\n if (\"throw\" !== c.type) {\n var u = c.arg,\n h = u.value;\n return h && \"object\" == _typeof(h) && n.call(h, \"__await\") ? e.resolve(h.__await).then(function (t) {\n invoke(\"next\", t, i, a);\n }, function (t) {\n invoke(\"throw\", t, i, a);\n }) : e.resolve(h).then(function (t) {\n u.value = t, i(u);\n }, function (t) {\n return invoke(\"throw\", t, i, a);\n });\n }\n a(c.arg);\n }\n var r;\n o(this, \"_invoke\", {\n value: function value(t, n) {\n function callInvokeWithMethodAndArg() {\n return new e(function (e, r) {\n invoke(t, n, e, r);\n });\n }\n return r = r ? r.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg();\n }\n });\n }\n function makeInvokeMethod(e, r, n) {\n var o = h;\n return function (i, a) {\n if (o === f) throw Error(\"Generator is already running\");\n if (o === s) {\n if (\"throw\" === i) throw a;\n return {\n value: t,\n done: !0\n };\n }\n for (n.method = i, n.arg = a;;) {\n var c = n.delegate;\n if (c) {\n var u = maybeInvokeDelegate(c, n);\n if (u) {\n if (u === y) continue;\n return u;\n }\n }\n if (\"next\" === n.method) n.sent = n._sent = n.arg;else if (\"throw\" === n.method) {\n if (o === h) throw o = s, n.arg;\n n.dispatchException(n.arg);\n } else \"return\" === n.method && n.abrupt(\"return\", n.arg);\n o = f;\n var p = tryCatch(e, r, n);\n if (\"normal\" === p.type) {\n if (o = n.done ? s : l, p.arg === y) continue;\n return {\n value: p.arg,\n done: n.done\n };\n }\n \"throw\" === p.type && (o = s, n.method = \"throw\", n.arg = p.arg);\n }\n };\n }\n function maybeInvokeDelegate(e, r) {\n var n = r.method,\n o = e.iterator[n];\n if (o === t) return r.delegate = null, \"throw\" === n && e.iterator[\"return\"] && (r.method = \"return\", r.arg = t, maybeInvokeDelegate(e, r), \"throw\" === r.method) || \"return\" !== n && (r.method = \"throw\", r.arg = new TypeError(\"The iterator does not provide a '\" + n + \"' method\")), y;\n var i = tryCatch(o, e.iterator, r.arg);\n if (\"throw\" === i.type) return r.method = \"throw\", r.arg = i.arg, r.delegate = null, y;\n var a = i.arg;\n return a ? a.done ? (r[e.resultName] = a.value, r.next = e.nextLoc, \"return\" !== r.method && (r.method = \"next\", r.arg = t), r.delegate = null, y) : a : (r.method = \"throw\", r.arg = new TypeError(\"iterator result is not an object\"), r.delegate = null, y);\n }\n function pushTryEntry(t) {\n var e = {\n tryLoc: t[0]\n };\n 1 in t && (e.catchLoc = t[1]), 2 in t && (e.finallyLoc = t[2], e.afterLoc = t[3]), this.tryEntries.push(e);\n }\n function resetTryEntry(t) {\n var e = t.completion || {};\n e.type = \"normal\", delete e.arg, t.completion = e;\n }\n function Context(t) {\n this.tryEntries = [{\n tryLoc: \"root\"\n }], t.forEach(pushTryEntry, this), this.reset(!0);\n }\n function values(e) {\n if (e || \"\" === e) {\n var r = e[a];\n if (r) return r.call(e);\n if (\"function\" == typeof e.next) return e;\n if (!isNaN(e.length)) {\n var o = -1,\n i = function next() {\n for (; ++o < e.length;) if (n.call(e, o)) return next.value = e[o], next.done = !1, next;\n return next.value = t, next.done = !0, next;\n };\n return i.next = i;\n }\n }\n throw new TypeError(_typeof(e) + \" is not iterable\");\n }\n return GeneratorFunction.prototype = GeneratorFunctionPrototype, o(g, \"constructor\", {\n value: GeneratorFunctionPrototype,\n configurable: !0\n }), o(GeneratorFunctionPrototype, \"constructor\", {\n value: GeneratorFunction,\n configurable: !0\n }), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, u, \"GeneratorFunction\"), e.isGeneratorFunction = function (t) {\n var e = \"function\" == typeof t && t.constructor;\n return !!e && (e === GeneratorFunction || \"GeneratorFunction\" === (e.displayName || e.name));\n }, e.mark = function (t) {\n return Object.setPrototypeOf ? Object.setPrototypeOf(t, GeneratorFunctionPrototype) : (t.__proto__ = GeneratorFunctionPrototype, define(t, u, \"GeneratorFunction\")), t.prototype = Object.create(g), t;\n }, e.awrap = function (t) {\n return {\n __await: t\n };\n }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, c, function () {\n return this;\n }), e.AsyncIterator = AsyncIterator, e.async = function (t, r, n, o, i) {\n void 0 === i && (i = Promise);\n var a = new AsyncIterator(wrap(t, r, n, o), i);\n return e.isGeneratorFunction(r) ? a : a.next().then(function (t) {\n return t.done ? t.value : a.next();\n });\n }, defineIteratorMethods(g), define(g, u, \"Generator\"), define(g, a, function () {\n return this;\n }), define(g, \"toString\", function () {\n return \"[object Generator]\";\n }), e.keys = function (t) {\n var e = Object(t),\n r = [];\n for (var n in e) r.push(n);\n return r.reverse(), function next() {\n for (; r.length;) {\n var t = r.pop();\n if (t in e) return next.value = t, next.done = !1, next;\n }\n return next.done = !0, next;\n };\n }, e.values = values, Context.prototype = {\n constructor: Context,\n reset: function reset(e) {\n if (this.prev = 0, this.next = 0, this.sent = this._sent = t, this.done = !1, this.delegate = null, this.method = \"next\", this.arg = t, this.tryEntries.forEach(resetTryEntry), !e) for (var r in this) \"t\" === r.charAt(0) && n.call(this, r) && !isNaN(+r.slice(1)) && (this[r] = t);\n },\n stop: function stop() {\n this.done = !0;\n var t = this.tryEntries[0].completion;\n if (\"throw\" === t.type) throw t.arg;\n return this.rval;\n },\n dispatchException: function dispatchException(e) {\n if (this.done) throw e;\n var r = this;\n function handle(n, o) {\n return a.type = \"throw\", a.arg = e, r.next = n, o && (r.method = \"next\", r.arg = t), !!o;\n }\n for (var o = this.tryEntries.length - 1; o >= 0; --o) {\n var i = this.tryEntries[o],\n a = i.completion;\n if (\"root\" === i.tryLoc) return handle(\"end\");\n if (i.tryLoc <= this.prev) {\n var c = n.call(i, \"catchLoc\"),\n u = n.call(i, \"finallyLoc\");\n if (c && u) {\n if (this.prev < i.catchLoc) return handle(i.catchLoc, !0);\n if (this.prev < i.finallyLoc) return handle(i.finallyLoc);\n } else if (c) {\n if (this.prev < i.catchLoc) return handle(i.catchLoc, !0);\n } else {\n if (!u) throw Error(\"try statement without catch or finally\");\n if (this.prev < i.finallyLoc) return handle(i.finallyLoc);\n }\n }\n }\n },\n abrupt: function abrupt(t, e) {\n for (var r = this.tryEntries.length - 1; r >= 0; --r) {\n var o = this.tryEntries[r];\n if (o.tryLoc <= this.prev && n.call(o, \"finallyLoc\") && this.prev < o.finallyLoc) {\n var i = o;\n break;\n }\n }\n i && (\"break\" === t || \"continue\" === t) && i.tryLoc <= e && e <= i.finallyLoc && (i = null);\n var a = i ? i.completion : {};\n return a.type = t, a.arg = e, i ? (this.method = \"next\", this.next = i.finallyLoc, y) : this.complete(a);\n },\n complete: function complete(t, e) {\n if (\"throw\" === t.type) throw t.arg;\n return \"break\" === t.type || \"continue\" === t.type ? this.next = t.arg : \"return\" === t.type ? (this.rval = this.arg = t.arg, this.method = \"return\", this.next = \"end\") : \"normal\" === t.type && e && (this.next = e), y;\n },\n finish: function finish(t) {\n for (var e = this.tryEntries.length - 1; e >= 0; --e) {\n var r = this.tryEntries[e];\n if (r.finallyLoc === t) return this.complete(r.completion, r.afterLoc), resetTryEntry(r), y;\n }\n },\n \"catch\": function _catch(t) {\n for (var e = this.tryEntries.length - 1; e >= 0; --e) {\n var r = this.tryEntries[e];\n if (r.tryLoc === t) {\n var n = r.completion;\n if (\"throw\" === n.type) {\n var o = n.arg;\n resetTryEntry(r);\n }\n return o;\n }\n }\n throw Error(\"illegal catch attempt\");\n },\n delegateYield: function delegateYield(e, r, n) {\n return this.delegate = {\n iterator: values(e),\n resultName: r,\n nextLoc: n\n }, \"next\" === this.method && (this.arg = t), y;\n }\n }, e;\n}\nmodule.exports = _regeneratorRuntime, module.exports.__esModule = true, module.exports[\"default\"] = module.exports;","function _typeof(o) {\n \"@babel/helpers - typeof\";\n\n return module.exports = _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (o) {\n return typeof o;\n } : function (o) {\n return o && \"function\" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? \"symbol\" : typeof o;\n }, module.exports.__esModule = true, module.exports[\"default\"] = module.exports, _typeof(o);\n}\nmodule.exports = _typeof, module.exports.__esModule = true, module.exports[\"default\"] = module.exports;","// TODO(Babel 8): Remove this file.\n\nvar runtime = require(\"../helpers/regeneratorRuntime\")();\nmodule.exports = runtime;\n\n// Copied from https://github.com/facebook/regenerator/blob/main/packages/runtime/runtime.js#L736=\ntry {\n regeneratorRuntime = runtime;\n} catch (accidentalStrictMode) {\n if (typeof globalThis === \"object\") {\n globalThis.regeneratorRuntime = runtime;\n } else {\n Function(\"r\", \"regeneratorRuntime = r\")(runtime);\n }\n}\n","// 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__.g = (function() {\n\tif (typeof globalThis === 'object') return globalThis;\n\ttry {\n\t\treturn this || new Function('return this')();\n\t} catch (e) {\n\t\tif (typeof window === 'object') return window;\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};","function _setPrototypeOf(t, e) {\n return _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function (t, e) {\n return t.__proto__ = e, t;\n }, _setPrototypeOf(t, e);\n}\nexport { _setPrototypeOf as default };","import setPrototypeOf from \"./setPrototypeOf.js\";\nfunction _inheritsLoose(t, o) {\n t.prototype = Object.create(o.prototype), t.prototype.constructor = t, setPrototypeOf(t, o);\n}\nexport { _inheritsLoose as default };","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/Model'];","import Model from 'flarum/common/Model';\n\nexport default class Rank extends Model {\n points() {\n return Model.attribute('points').call(this);\n }\n\n name() {\n return Model.attribute('name').call(this);\n }\n\n color() {\n return Model.attribute('color').call(this);\n }\n}\n","import Rank from './Rank';\n\nexport const models = {\n Rank,\n};\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['forum/components/IndexPage'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['forum/states/DiscussionListState'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/components/LinkButton'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/components/Button'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['forum/components/CommentPost'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/utils/classList'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['forum/utils/PostControls'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/components/Modal'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/components/LoadingIndicator'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/helpers/avatar'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/helpers/username'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/components/Link'];","import app from 'flarum/forum/app';\nimport Modal from 'flarum/common/components/Modal';\nimport LoadingIndicator from 'flarum/common/components/LoadingIndicator';\nimport avatar from 'flarum/common/helpers/avatar';\nimport username from 'flarum/common/helpers/username';\nimport Link from 'flarum/common/components/Link';\n\nexport default class VotesModal extends Modal {\n className() {\n return 'VotesModal Modal--small';\n }\n\n title() {\n return app.translator.trans('fof-gamification.forum.modal.title');\n }\n\n oninit(vnode) {\n super.oninit(vnode);\n\n this.loading = !this.attrs.post.upvotes() || !this.attrs.post.downvotes();\n\n if (this.loading) {\n this.load();\n }\n }\n\n content() {\n if (this.loading) {\n return (\n
    \n \n
    \n );\n }\n\n return (\n
    \n
      \n {['upvotes', 'downvotes'].map((type) => {\n const voters = this.attrs.post[type]();\n\n if (!voters || !voters.length) return;\n\n return (\n
      \n {app.translator.trans(`fof-gamification.forum.modal.${type}_label`)}\n {voters.map((user) => (\n
    • \n \n {avatar(user)} {username(user)}\n \n
    • \n ))}\n
      \n );\n })}\n
    \n
    \n );\n }\n\n load() {\n return app.store\n .find('posts', this.attrs.post.id(), {\n include: 'upvotes,downvotes',\n })\n .then(this.loaded.bind(this));\n }\n}\n","import app from 'flarum/forum/app';\n\nexport default (key, isBool = false) => {\n const val = app.data[`fof-gamification.${key}`];\n\n if (isBool) {\n return !!parseInt(val);\n }\n\n return val;\n};\n","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['forum/utils/DiscussionControls'];","import app from 'flarum/forum/app';\nimport DiscussionControls from 'flarum/forum/utils/DiscussionControls';\n\nexport default (post, upvoted, downvoted, load, discussion = post.discussion()) => {\n if (!app.session.user) {\n // We use this instead of showing LogInModal so that extensions can override it\n DiscussionControls.replyAction.call(discussion, true);\n return;\n } else if (discussion && !discussion.canVote() && !post.canVote()) {\n return;\n }\n\n if (upvoted && downvoted) {\n upvoted = false;\n downvoted = false;\n }\n\n if (load) load(true);\n\n m.redraw();\n\n return post\n .save([upvoted, downvoted, 'vote'])\n .then(\n () => null,\n () => null\n )\n .then(() => {\n if (load) load(false);\n\n if (discussion) {\n discussion.pushAttributes({\n votes: post.votes(),\n });\n }\n\n m.redraw();\n });\n};\n","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['forum/components/DiscussionListItem'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/utils/abbreviateNumber'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/helpers/icon'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['forum/components/PostUser'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['forum/components/UserCard'];","export default function rankLabel(rank, attrs = {}) {\n attrs.style = attrs.style || {};\n attrs.className = 'rankLabel ' + (attrs.className || '');\n\n const color = rank.color();\n attrs.style.backgroundColor = attrs.style.color = color;\n attrs.className += ' colored';\n\n return m('span', attrs, {rank.name()});\n}\n","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['forum/components/DiscussionPage'];","import app from 'flarum/forum/app';\nimport { extend } from 'flarum/common/extend';\nimport DiscussionPage from 'flarum/forum/components/DiscussionPage';\n\nimport debounce from 'lodash.debounce';\n\nconst fetch = (postId) => app.store.find('posts', postId).then(() => m.redraw());\nconst debounced = [];\nconst update = (postId) => {\n let func = debounced[postId];\n\n if (func) return func(postId);\n\n func = debounced[postId] = debounce(fetch, 1500);\n\n return func(postId);\n};\n\nexport default () => {\n extend(DiscussionPage.prototype, 'oncreate', function () {\n if (app.pusher) {\n app.pusher.then((channels) => {\n channels.pusher.bind('newVote', (data) => {\n const post = app.store.getById('posts', data.post_id);\n const userId = data.user_id;\n\n if (!post || post.votes() === data.votes || userId == app.session.user.id()) return;\n\n update(post.id());\n });\n });\n }\n });\n\n extend(DiscussionPage.prototype, 'onremove', function () {\n if (app.pusher) {\n app.pusher.then((channels) => {\n channels.pusher.unbind('newVote');\n });\n }\n });\n};\n","import app from 'flarum/forum/app';\nimport { extend } from 'flarum/common/extend';\n\nimport DiscussionListItem from 'flarum/forum/components/DiscussionListItem';\nimport abbreviateNumber from 'flarum/common/utils/abbreviateNumber';\nimport Button from 'flarum/common/components/Button';\nimport LoadingIndicator from 'flarum/common/components/LoadingIndicator';\n\nimport saveVote from './helpers/saveVote';\nimport setting from './helpers/setting';\n\nconst get = (discussion, key) => {\n const post = discussion.firstPost();\n\n if (post && post[key]() !== undefined) {\n return post[key]();\n }\n\n return discussion[key]();\n};\n\nexport default function addAlternateLayout() {\n extend(DiscussionListItem.prototype, 'oninit', function () {\n const discussion = this.attrs.discussion;\n\n if (!discussion.seeVotes()) {\n return;\n }\n\n this.subtree.check(() => this.voteLoading);\n });\n\n extend(DiscussionListItem.prototype, 'view', function (vdom) {\n const discussion = this.attrs.discussion;\n\n if (!discussion.seeVotes()) {\n return;\n }\n\n if (!vdom || !vdom.children) return;\n\n const content = vdom.children.find((v) => v && v.attrs && v.attrs.className && v.attrs.className.includes('DiscussionListItem-content'));\n const post = discussion.firstPost();\n\n const hasUpvoted = get(discussion, 'hasUpvoted');\n const hasDownvoted = get(discussion, 'hasDownvoted');\n // We set canVote to true for guest users so that they can access the login by clicking the button\n const canVote = !app.session.user || get(discussion, 'canVote');\n\n const upvotesOnly = setting('upVotesOnly', true);\n const altIcon = setting('iconNameAlt') || 'arrow';\n\n const onclick = (upvoted, downvoted) => saveVote(post, upvoted, downvoted, (val) => (this.voteLoading = val));\n\n content.children.unshift(\n
    \n onclick(!hasUpvoted, false)}\n aria-label={app.translator.trans('fof-gamification.forum.post.upvote_button')}\n />\n\n {abbreviateNumber(get(discussion, 'votes') || 0)}\n\n {!upvotesOnly && (\n onclick(false, !hasDownvoted)}\n aria-label={app.translator.trans('fof-gamification.forum.post.downvote_button')}\n />\n )}\n\n {this.voteLoading && }\n
    \n );\n });\n}\n","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/states/DiscussionListState'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['forum/components/Notification'];","import app from 'flarum/forum/app';\nimport Notification from 'flarum/forum/components/Notification';\nimport setting from '../helpers/setting';\n\nexport default class UpvotedNotification extends Notification {\n icon() {\n const icon = setting('iconName') || 'thumbs';\n\n if (this.attrs.notification.content() > 0) {\n return `fas fa-${icon}-up`;\n } else {\n return `fas fa-${icon}-down`;\n }\n }\n\n href() {\n return app.route.post(this.attrs.notification.subject());\n }\n\n content() {\n const user = this.attrs.notification.fromUser();\n const content = parseInt(this.attrs.notification.content());\n\n if (content > 0) {\n return app.translator.trans('fof-gamification.forum.notification.upvote', { user });\n } else {\n return app.translator.trans('fof-gamification.forum.notification.downvote', { user });\n }\n }\n\n excerpt() {\n return this.attrs.notification.subject().contentPlain();\n }\n}\n","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['forum/components/NotificationGrid'];","function asyncGeneratorStep(n, t, e, r, o, a, c) {\n try {\n var i = n[a](c),\n u = i.value;\n } catch (n) {\n return void e(n);\n }\n i.done ? t(u) : Promise.resolve(u).then(r, o);\n}\nfunction _asyncToGenerator(n) {\n return function () {\n var t = this,\n e = arguments;\n return new Promise(function (r, o) {\n var a = n.apply(t, e);\n function _next(n) {\n asyncGeneratorStep(a, r, o, _next, _throw, \"next\", n);\n }\n function _throw(n) {\n asyncGeneratorStep(a, r, o, _next, _throw, \"throw\", n);\n }\n _next(void 0);\n });\n };\n}\nexport { _asyncToGenerator as default };","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/Component'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/components/Tooltip'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/utils/SubtreeRetainer'];","import app from 'flarum/forum/app';\n\nimport Component from 'flarum/common/Component';\nimport LoadingIndicator from 'flarum/common/components/LoadingIndicator';\nimport Link from 'flarum/common/components/Link';\nimport Tooltip from 'flarum/common/components/Tooltip';\nimport avatar from 'flarum/common/helpers/avatar';\nimport icon from 'flarum/common/helpers/icon';\nimport SubtreeRetainer from 'flarum/common/utils/SubtreeRetainer';\n\nimport type Mithril from 'mithril';\n\nexport default class Voters extends Component {\n subtreeRetainer!: SubtreeRetainer;\n lastRenderVotes: number = -1;\n loading: boolean = false;\n\n oninit(vnode: Mithril.Vnode) {\n super.oninit(vnode);\n\n this.loading = !this.attrs.post.upvotes();\n\n if (this.loading) {\n this.load();\n }\n\n this.subtreeRetainer = new SubtreeRetainer(\n () => this.loading,\n () => this.attrs.post.votes(),\n () => this.attrs.post?.upvotes?.()?.length\n );\n }\n\n onbeforeupdate(vnode: Mithril.Vnode) {\n super.onbeforeupdate(vnode);\n\n return this.subtreeRetainer.needsRebuild();\n }\n\n onupdate(vnode: Mithril.Vnode) {\n if (this.lastRenderVotes !== this.attrs.post.votes()) {\n this.loading = true;\n setTimeout(() => m.redraw(), 0);\n this.lastRenderVotes = this.attrs.post.votes();\n this.load();\n }\n }\n\n view() {\n // if (this.loading) {\n if (this.attrs.post.votes() === false || this.attrs.post.upvotes() === false) {\n return (\n
    \n
    \n
    \n \n {icon('fas fa-users')}\n {app.translator.trans('fof-gamification.forum.voters.label')}\n \n {app.translator.trans('fof-gamification.forum.voters.label')}\n \n \n
    \n\n \n
    \n
    \n );\n }\n\n const max = 15;\n const voters = this.attrs.post.upvotes();\n\n return (\n
    \n
    \n
    \n \n {icon('fas fa-users')}\n {app.translator.trans('fof-gamification.forum.voters.label')}\n \n {voters.length === 0\n ? app.translator.trans('fof-gamification.forum.voters.label_none')\n : app.translator.trans('fof-gamification.forum.voters.label')}\n \n \n
    \n
    \n {voters.length === 0 ? app.translator.trans('fof-gamification.forum.voters.none') : null}\n
    \n
    \n {voters.slice(0, max).map((user: any) => (\n \n {avatar(user)}\n \n ))}\n {voters.length > max ? (\n \n {`+${voters.length - max}`}\n \n ) : null}\n
    \n
    \n
    \n );\n }\n\n async load() {\n await app.store.find('posts', this.attrs.post.id(), {\n include: 'upvotes',\n });\n\n this.loading = false;\n\n m.redraw();\n }\n}\n","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['forum/components/UserPage'];","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 `VotesUserPage` component shows posts which user voted on.\n */\nexport default class VotesUserPage extends PostsUserPage {\n /**\n * Load a new page of the user's activity feed.\n *\n * @param offset The position to start getting results from.\n * @protected\n */\n loadResults(offset: number) {\n return app.store.find('posts', {\n filter: {\n type: 'comment',\n voted: this.user.id(),\n },\n page: { offset, limit: this.loadLimit },\n sort: '-createdAt',\n });\n }\n}\n","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/extenders'];","import Extend from 'flarum/common/extenders';\nimport Rank from './models/Rank';\n\nexport default [\n new Extend.Store() //\n .add('ranks', Rank),\n];\n","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/components/Page'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/helpers/listItems'];","import app from 'flarum/forum/app';\nimport Component, { ComponentAttrs } from 'flarum/common/Component';\nimport type Mithril from 'mithril';\nimport icon from 'flarum/common/helpers/icon';\n\ninterface RankingImageAttrs extends ComponentAttrs {\n place: number;\n}\n\nexport default class RankingImage extends Component {\n view() {\n const imgUrl = app.forum.attribute(`fof-gamification.topimage${this.attrs.place}Url`);\n const place = this.attrs.place;\n\n return imgUrl ? (\n \"\"\n ) : (\n {icon('fas fa-trophy')}\n );\n }\n}\n","import app from 'flarum/forum/app';\nimport avatar from 'flarum/common/helpers/avatar';\nimport Page from 'flarum/common/components/Page';\nimport IndexPage from 'flarum/forum/components/IndexPage';\nimport Button from 'flarum/common/components/Button';\nimport LoadingIndicator from 'flarum/common/components/LoadingIndicator';\nimport listItems from 'flarum/common/helpers/listItems';\nimport username from 'flarum/common/helpers/username';\nimport Link from 'flarum/common/components/Link';\nimport RankingImage from './RankingImage';\n\n/**\n * This page re-uses Flarum's IndexPage CSS classes\n */\nexport default class RankingsPage extends Page {\n oninit(vnode) {\n super.oninit(vnode);\n\n if (!app.forum.attribute('canViewRankingPage')) {\n m.route.set('/');\n }\n\n this.loading = true;\n this.users = [];\n this.refresh();\n }\n\n view() {\n let loading;\n\n if (this.loading) {\n loading = LoadingIndicator.component();\n } else {\n loading = Button.component(\n {\n className: 'Button',\n onclick: this.loadMore.bind(this),\n },\n app.translator.trans('core.forum.discussion_list.load_more_button')\n );\n }\n\n return (\n
    \n {IndexPage.prototype.hero()}\n
    \n
    \n \n
    \n \n \n \n \n \n \n {this.users.map((user, i) => {\n ++i;\n return [\n \n {i < 4 ? : }\n \n {i < 4 ? : }\n ,\n ];\n })}\n
    {app.translator.trans('fof-gamification.forum.ranking.rank')}{app.translator.trans('fof-gamification.forum.ranking.name')}{app.translator.trans('fof-gamification.forum.ranking.amount')}
    {this.addOrdinalSuffix(i)}\n
    \n

    \n \n {i < 4 ? avatar(user, { className: 'info-avatar rankings-' + i + '-avatar' }) : ''} {username(user)}\n \n

    \n
    \n
    {user.points()}{user.points()}
    \n
    {loading}
    \n
    \n
    \n
    \n
    \n );\n }\n\n refresh(clear = true) {\n if (clear) {\n this.loading = true;\n this.users = [];\n }\n\n return this.loadResults().then(\n (results) => {\n this.users = [];\n this.parseResults(results);\n },\n () => {\n this.loading = false;\n m.redraw();\n }\n );\n }\n\n addOrdinalSuffix(i) {\n if (app.data.locale === 'en') {\n const j = i % 10;\n const k = i % 100;\n\n if (j === 1 && k !== 11) {\n return i + 'st';\n } else if (j === 2 && k !== 12) {\n return i + 'nd';\n } else if (j === 3 && k !== 13) {\n return i + 'rd';\n }\n return i + 'th';\n } else {\n return i;\n }\n }\n\n loadResults(offset) {\n const params = {};\n params.page = {\n offset: offset,\n limit: '10',\n };\n\n return app.store.find('rankings', params);\n }\n\n loadMore() {\n this.loading = true;\n\n this.loadResults(this.users.length).then(this.parseResults.bind(this));\n }\n\n parseResults(results) {\n [].push.apply(this.users, results);\n\n this.loading = false;\n\n this.users.sort(function (a, b) {\n return parseFloat(b.points()) - parseFloat(a.points());\n });\n\n m.redraw();\n\n return results;\n }\n}\n","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/models/Discussion'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/models/Post'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/models/User'];","import Extend from 'flarum/common/extenders';\nimport { default as commonExtend } from '../common/extend';\n\nimport RankingsPage from './components/RankingsPage';\nimport Discussion from 'flarum/common/models/Discussion';\nimport Post from 'flarum/common/models/Post';\nimport User from 'flarum/common/models/User';\n\nimport Rank from '../common/models/Rank';\n\nexport default [\n ...commonExtend,\n\n new Extend.Routes() //\n .add('rankings', '/rankings', RankingsPage),\n\n new Extend.Model(Discussion) //\n .attribute('votes')\n .attribute('hasUpvoted')\n .attribute('hasDownvoted')\n .attribute('canVote')\n .attribute('seeVotes'),\n\n new Extend.Model(Post) //\n .hasMany('upvotes')\n .hasMany('downvotes')\n .attribute('votes')\n .attribute('canVote')\n .attribute('canSeeVotes')\n .attribute('hasUpvoted')\n .attribute('hasDownvoted')\n .attribute('seeVoters'),\n\n new Extend.Model(User) //\n .attribute('points')\n .hasMany('ranks')\n .attribute('canHaveVotingNotifications'),\n];\n","import RankingsPage from './RankingsPage';\nimport VoteNotification from './VoteNotification';\nimport VotesModal from './VotesModal';\nimport Voters from './Voters';\n\nexport const components = {\n RankingsPage,\n VoteNotification,\n VotesModal,\n Voters,\n};\n","function _extends() {\n return _extends = Object.assign ? Object.assign.bind() : function (n) {\n for (var e = 1; e < arguments.length; e++) {\n var t = arguments[e];\n for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]);\n }\n return n;\n }, _extends.apply(null, arguments);\n}\nexport { _extends as default };","import rankLabel from './rankLabel';\n\nexport const helpers = {\n rankLabel,\n};\n","import saveVote from './saveVote';\nimport setting from './setting';\n\nimport { helpers as commonHelpers } from '../../common/helpers';\n\nexport const helpers = {\n saveVote,\n setting,\n ...commonHelpers,\n};\n","import app from 'flarum/forum/app';\n\nimport addHotnessSort from './addHotnessSort';\nimport addVoteButtons from './addVoteButtons';\nimport addUpvotesToDiscussion from './addUpvotesToDiscussion';\nimport addUserInfo from './addUserInfo';\nimport addPusher from './addPusher';\nimport addAlternateLayout from './addAlternateLayout';\n\nimport setting from './helpers/setting';\nimport addVotesSort from './addVotesSort';\nimport useAlternatePostVoteLayout from './useAlternatePostVoteLayout';\nimport addNotifications from './addNotifications';\nimport addVotersToDiscussionPageSideBar from './addVotersToDiscussionPageSideBar';\nimport addUpvoteTabToUserProfile from './addUpvoteTabToUserProfile';\n\nexport { default as extend } from './extend';\n\napp.initializers.add('fof-gamification', () => {\n addVoteButtons();\n addHotnessSort();\n addVotesSort();\n addUserInfo();\n addUpvotesToDiscussion();\n addPusher();\n addNotifications();\n addVotersToDiscussionPageSideBar();\n addUpvoteTabToUserProfile();\n\n if (setting('useAlternateLayout', true)) {\n addAlternateLayout();\n }\n\n if (setting('altPostVotingUi', true)) {\n useAlternatePostVoteLayout();\n }\n});\n\nexport * from './components';\nexport * from './helpers';\n","import app from 'flarum/forum/app';\nimport { extend } from 'flarum/common/extend';\nimport PostUser from 'flarum/forum/components/PostUser';\nimport UserCard from 'flarum/forum/components/UserCard';\nimport rankLabel from '../common/helpers/rankLabel';\nimport setting from './helpers/setting';\nimport icon from 'flarum/common/helpers/icon';\n\nexport default function () {\n const matchClass = (className) => {\n return (node) => node && node.attrs && node.attrs.className && String(node.attrs.className).split(' ').includes(className);\n };\n\n const findMatchClass = function (node, className) {\n const arr = [];\n\n if (node && node.children && Array.isArray(node.children)) {\n const nodeInChildren = node.children.find(matchClass(className));\n\n if (nodeInChildren) {\n arr.push(nodeInChildren);\n }\n\n node.children.forEach(function (currentValue) {\n arr.push(...findMatchClass(currentValue, className));\n });\n }\n\n return arr;\n };\n\n extend(UserCard.prototype, 'infoItems', function (items) {\n const user = this.attrs.user;\n\n items.add(\n 'points',\n
    \n {icon('fas fa-medal')}\n {app.translator.trans('fof-gamification.forum.user.card.points', {\n count: user.points(),\n })}\n
    ,\n 50\n );\n });\n\n extend(UserCard.prototype, 'view', function (vnode) {\n const user = this.attrs.user;\n const profile_node = findMatchClass(vnode, 'UserCard-profile')[0];\n const amt = Number(setting('rankAmt'));\n\n if (!profile_node) return;\n\n let badges_node = profile_node.children.find(matchClass('UserCard-badges'));\n if (user.ranks()) {\n if (!badges_node) {\n profile_node.children.splice(\n 1,\n 0,\n
      \n {user\n .ranks()\n .reverse()\n .map((rank, i) => {\n if (!amt || i < amt) {\n return
    • {rankLabel(rank)}
    • ;\n }\n })}\n
    \n );\n } else {\n user\n .ranks()\n .reverse()\n .map((rank, i) => {\n if (!amt || i < amt) {\n return
  • {rankLabel(rank)}
  • ;\n }\n })\n .forEach((rank) => {\n if (!rank) {\n return;\n }\n badges_node.children.push(rank);\n });\n }\n }\n\n return vnode;\n });\n\n extend(PostUser.prototype, 'view', function (vnode) {\n const post = this.attrs.post;\n const user = post.user();\n\n if (!user) {\n return vnode;\n }\n\n const header_node = vnode.children.find(matchClass('PostUser-name'));\n const amt = Number(setting('rankAmt')) ?? user.ranks().length;\n\n if (!user.ranks()) return;\n\n header_node.children = header_node.children\n .concat(\n user\n .ranks()\n .reverse()\n .splice(0, amt)\n .map((rank) => {\n return {rankLabel(rank)};\n })\n )\n .filter(function (el) {\n return el.tag !== undefined;\n });\n });\n}\n","import app from 'flarum/forum/app';\nimport { extend } from 'flarum/common/extend';\nimport Button from 'flarum/common/components/Button';\nimport CommentPost from 'flarum/forum/components/CommentPost';\nimport classList from 'flarum/common/utils/classList';\nimport PostControls from 'flarum/forum/utils/PostControls';\n\nimport VotesModal from './components/VotesModal';\nimport setting from './helpers/setting';\nimport saveVote from './helpers/saveVote';\n\nexport default function () {\n extend(PostControls, 'moderationControls', function (items, post) {\n if (post.seeVoters()) {\n items.add('viewVotes', [\n m(\n Button,\n {\n icon: 'fas fa-thumbs-up',\n onclick: () => {\n app.modal.show(VotesModal, { post });\n },\n },\n app.translator.trans('fof-gamification.forum.mod_item')\n ),\n ]);\n }\n });\n\n extend(CommentPost.prototype, 'actionItems', function (items) {\n const post = this.attrs.post;\n\n //if (!post.canVote()) return;\n\n const hasDownvoted = post.hasDownvoted();\n const hasUpvoted = post.hasUpvoted();\n\n const icon = setting('iconName') || 'thumbs';\n const upVotesOnly = setting('upVotesOnly', true);\n\n const canSeeVotes = post.canSeeVotes();\n\n // We set canVote to true for guest users so that they can access the login by clicking the button\n const canVote = !app.session.user || post.canVote();\n\n const onclick = (upvoted, downvoted) => saveVote(post, upvoted, downvoted, (val) => (this.voteLoading = val));\n\n items.add(\n 'votes',\n
    \n {Button.component({\n icon: this.voteLoading ? undefined : `fas fa-fw fa-${icon}-up`,\n className: classList('Post-vote Post-upvote', hasUpvoted && 'Post-vote--active'),\n loading: this.voteLoading,\n disabled: this.voteLoading || !canVote || !canSeeVotes,\n onclick: () => onclick(!hasUpvoted, false),\n 'aria-label': app.translator.trans('fof-gamification.forum.post.upvote_button'),\n })}\n\n \n\n {!upVotesOnly &&\n Button.component({\n icon: this.voteLoading ? undefined : `fas fa-fw fa-${icon}-down`,\n className: classList('Post-vote Post-downvote', hasDownvoted && 'Post-vote--active'),\n loading: this.voteLoading,\n disabled: !canVote || !canSeeVotes,\n onclick: () => onclick(false, !hasDownvoted),\n 'aria-label': app.translator.trans('fof-gamification.forum.post.downvote_button'),\n })}\n
    ,\n 10\n );\n });\n}\n","import app from 'flarum/forum/app';\nimport { extend } from 'flarum/common/extend';\nimport IndexPage from 'flarum/forum/components/IndexPage';\nimport DiscussionListState from 'flarum/forum/states/DiscussionListState';\nimport LinkButton from 'flarum/common/components/LinkButton';\n\nexport default function () {\n extend(IndexPage.prototype, 'navItems', function (items) {\n if (!app.forum.attribute('canViewRankingPage')) {\n return;\n }\n\n items.add(\n 'rankings',\n LinkButton.component(\n {\n href: app.route('rankings'),\n icon: 'fas fa-trophy',\n },\n app.translator.trans('fof-gamification.forum.nav.name')\n ),\n 80\n );\n });\n\n extend(DiscussionListState.prototype, 'sortMap', function (map) {\n map.hot = '-hotness';\n });\n}\n","import { extend } from 'flarum/common/extend';\nimport DiscussionListState from 'flarum/common/states/DiscussionListState';\n\nexport default function () {\n extend(DiscussionListState.prototype, 'sortMap', function (map) {\n map.votes = '-votes';\n });\n}\n","import app from 'flarum/forum/app';\nimport { extend } from 'flarum/common/extend';\nimport DiscussionListItem from 'flarum/forum/components/DiscussionListItem';\nimport abbreviateNumber from 'flarum/common/utils/abbreviateNumber';\nimport icon from 'flarum/common/helpers/icon';\nimport setting from './helpers/setting';\n\nexport default function () {\n if (!setting('showVotesOnDiscussionPage', true) || setting('useAlternateLayout', true)) {\n return;\n }\n\n extend(DiscussionListItem.prototype, 'elementAttrs', function (attrs) {\n if (!this.attrs.discussion.seeVotes()) {\n return;\n }\n\n attrs.className += ' DiscussionListItem--withVotes';\n });\n\n extend(DiscussionListItem.prototype, 'infoItems', function (items) {\n const discussion = this.attrs.discussion;\n\n if (!discussion.seeVotes()) {\n return;\n }\n\n items.add(\n 'discussion-votes',\n \n {icon('far fa-thumbs-up')}\n {abbreviateNumber(this.attrs.discussion.votes())}\n ,\n 20\n );\n });\n}\n","import { extend } from 'flarum/common/extend';\nimport app from 'flarum/forum/app';\nimport VoteNotification from './components/VoteNotification';\nimport NotificationGrid from 'flarum/forum/components/NotificationGrid';\nimport ItemList from 'flarum/common/utils/ItemList';\n\nexport default function addNotifications() {\n app.notificationComponents.vote = VoteNotification;\n\n extend(NotificationGrid.prototype, 'notificationTypes', function (items: ItemList<{ name: string; icon: string; label: any }>) {\n const user = app.session?.user;\n\n if (!user?.canHaveVotingNotifications?.()) return;\n\n items.add('vote', {\n name: 'vote',\n icon: 'fas fa-thumbs-up',\n label: app.translator.trans('fof-gamification.forum.notification.prefrences.vote'),\n });\n });\n}\n","import app from 'flarum/forum/app';\nimport { extend } from 'flarum/common/extend';\nimport DiscussionPage from 'flarum/forum/components/DiscussionPage';\nimport Voters from './components/Voters';\nimport type ItemList from 'flarum/common/utils/ItemList';\n\nimport type Mithril from 'mithril';\n\n/**\n * Adds our custom {@link Voters} component to the discussion sidebar.\n */\nexport default function addVotersToDiscussionPageSideBar() {\n extend(DiscussionPage.prototype, 'sidebarItems', function (this: DiscussionPage, items: ItemList) {\n const discussion = this.discussion;\n const posts = discussion!.posts() || [];\n const firstPost = posts?.[0];\n\n if (firstPost?.canSeeVotes?.() && firstPost?.seeVoters?.() && !!app.forum.attribute('fof-gamification-op-votes-only')) {\n items.add('op-voters', , 90);\n }\n });\n}\n","import { extend } from 'flarum/common/extend';\nimport app from 'flarum/forum/app';\nimport UserPage from 'flarum/forum/components/UserPage';\nimport LinkButton from 'flarum/common/components/LinkButton';\nimport VotesUserPage from './components/VotesUserPage';\nimport setting from './helpers/setting';\n\nexport default function addUpvoteTabToUserProfile() {\n app.routes['user.votes'] = { path: '/u/:username/votes', component: VotesUserPage };\n extend(UserPage.prototype, 'navItems', function (items) {\n const user = this.user;\n const icon = setting('iconName') || 'thumbs';\n items.add(\n 'votes',\n \n {app.translator.trans('fof-gamification.forum.user.votes_link')}\n ,\n 85\n );\n });\n}\n","import app from 'flarum/forum/app';\n\nimport { extend } from 'flarum/common/extend';\n\nimport CommentPost from 'flarum/forum/components/CommentPost';\nimport Button from 'flarum/common/components/Button';\nimport abbreviateNumber from 'flarum/common/utils/abbreviateNumber';\nimport LoadingIndicator from 'flarum/common/components/LoadingIndicator';\nimport type ItemList from 'flarum/common/utils/ItemList';\n\nimport setting from './helpers/setting';\nimport saveVote from './helpers/saveVote';\n\nexport default function useAlternatePostVoteLayout() {\n extend(CommentPost.prototype, 'actionItems', function (this: CommentPost, items: ItemList) {\n if (this.attrs.post.isHidden()) return;\n\n items.remove('votes');\n });\n\n extend(CommentPost.prototype, 'classes', function (this: CommentPost, classes: string[]) {\n if (this.attrs.post.isHidden()) return;\n\n const upvotesOnly = setting('upVotesOnly', true);\n\n classes.push('votesAlternativeLayout');\n\n if (upvotesOnly) {\n classes.push('votesUpvotesOnly');\n }\n });\n\n extend(CommentPost.prototype, 'headerItems', function (this: CommentPost, items: ItemList) {\n const post = this.attrs.post;\n\n if (post.isHidden()) return;\n if (!post.canSeeVotes()) return;\n\n const hasDownvoted = post.hasDownvoted();\n const hasUpvoted = post.hasUpvoted();\n\n const icon = setting('iconName') || 'thumbs';\n const upvotesOnly = setting('upVotesOnly', true);\n\n const canSeeVotes = post.canSeeVotes();\n\n // We set canVote to true for guest users so that they can access the login by clicking the button\n const canVote = !app.session.user || post.canVote();\n\n const onclick = (upvoted, downvoted) =>\n saveVote(post, upvoted, downvoted, (val) => {\n this.voteLoading = val;\n });\n\n items.add(\n 'votes',\n
    \n onclick(!hasUpvoted, false)}\n aria-label={app.translator.trans('fof-gamification.forum.post.upvote_button')}\n />\n\n {abbreviateNumber(post.votes() || 0)}\n\n {!upvotesOnly && (\n onclick(false, !hasDownvoted)}\n aria-label={app.translator.trans('fof-gamification.forum.post.downvote_button')}\n />\n )}\n\n {this.voteLoading && }\n
    ,\n 10000\n );\n });\n}\n"],"names":["reTrim","reIsBadHex","reIsBinary","reIsOctal","freeParseInt","parseInt","freeGlobal","global","Object","freeSelf","self","root","Function","objectToString","prototype","toString","nativeMax","Math","max","nativeMin","min","now","Date","isObject","value","type","toNumber","isObjectLike","call","isSymbol","other","valueOf","replace","isBinary","test","slice","module","exports","func","wait","options","lastArgs","lastThis","maxWait","result","timerId","lastCallTime","lastInvokeTime","leading","maxing","trailing","TypeError","invokeFunc","time","args","thisArg","undefined","apply","shouldInvoke","timeSinceLastCall","timerExpired","trailingEdge","setTimeout","remainingWait","debounced","isInvoking","arguments","this","leadingEdge","cancel","clearTimeout","flush","_typeof","require","_regeneratorRuntime","e","__esModule","t","r","n","hasOwnProperty","o","defineProperty","i","Symbol","a","iterator","c","asyncIterator","u","toStringTag","define","enumerable","configurable","writable","wrap","Generator","create","Context","makeInvokeMethod","tryCatch","arg","h","l","f","s","y","GeneratorFunction","GeneratorFunctionPrototype","p","d","getPrototypeOf","v","values","g","defineIteratorMethods","forEach","_invoke","AsyncIterator","invoke","resolve","__await","then","callInvokeWithMethodAndArg","Error","done","method","delegate","maybeInvokeDelegate","sent","_sent","dispatchException","abrupt","resultName","next","nextLoc","pushTryEntry","tryLoc","catchLoc","finallyLoc","afterLoc","tryEntries","push","resetTryEntry","completion","reset","isNaN","length","displayName","isGeneratorFunction","constructor","name","mark","setPrototypeOf","__proto__","awrap","async","Promise","keys","reverse","pop","prev","charAt","stop","rval","handle","complete","finish","delegateYield","runtime","regeneratorRuntime","accidentalStrictMode","globalThis","__webpack_module_cache__","__webpack_require__","moduleId","cachedModule","__webpack_modules__","getter","definition","key","get","window","obj","prop","_setPrototypeOf","bind","_inheritsLoose","flarum","core","compat","Rank","_Model","_proto","points","Model","color","models","VotesModal","_Modal","className","title","app","trans","oninit","vnode","loading","attrs","post","upvotes","downvotes","load","content","_this","m","LoadingIndicator","map","voters","user","Link","href","avatar","username","find","id","include","loaded","Modal","isBool","val","upvoted","downvoted","discussion","canVote","redraw","save","pushAttributes","votes","DiscussionControls","rankLabel","rank","style","backgroundColor","fetch","postId","firstPost","UpvotedNotification","_Notification","icon","setting","notification","subject","fromUser","excerpt","contentPlain","Notification","asyncGeneratorStep","Voters","_Component","_len","Array","_key","concat","subtreeRetainer","lastRenderVotes","_this2","SubtreeRetainer","_this2$attrs$post","onbeforeupdate","needsRebuild","onupdate","view","display","slug","Tooltip","text","_load","_callee","_context","_next","_throw","Component","VotesUserPage","_PostsUserPage","loadResults","offset","filter","voted","page","limit","loadLimit","sort","PostsUserPage","Extend","add","RankingImage","imgUrl","attribute","place","src","alt","RankingsPage","_Page","route","set","users","refresh","Button","onclick","loadMore","IndexPage","hero","listItems","sidebarItems","toArray","class","addOrdinalSuffix","force","clear","results","parseResults","locale","j","k","params","b","parseFloat","Page","commonExtend","Discussion","Post","hasMany","User","components","VoteNotification","_extends","assign","helpers","saveVote","matchClass","findMatchClass","extend","PostControls","items","seeVoters","show","CommentPost","hasDownvoted","hasUpvoted","upVotesOnly","canSeeVotes","voteLoading","classList","disabled","LinkButton","DiscussionListState","hot","node","String","split","includes","arr","children","isArray","nodeInChildren","currentValue","UserCard","count","profile_node","amt","Number","badges_node","ranks","splice","PostUser","_Number","header_node","el","tag","DiscussionListItem","seeVotes","abbreviateNumber","DiscussionPage","channels","pusher","data","getById","post_id","userId","user_id","debounce","unbind","vote","NotificationGrid","_app$session","canHaveVotingNotifications","label","posts","path","component","UserPage","subtree","check","vdom","upvotesOnly","altIcon","unshift","size","isHidden","remove","classes"],"sourceRoot":""} \ No newline at end of file