diff --git a/js/dist/admin.js b/js/dist/admin.js index 31b5252..63572ec 100755 --- a/js/dist/admin.js +++ b/js/dist/admin.js @@ -1,2 +1,2 @@ -(()=>{var a={n:t=>{var n=t&&t.__esModule?()=>t.default:()=>t;return a.d(n,{a:n}),n},d:(t,n)=>{for(var o in n)a.o(n,o)&&!a.o(t,o)&&Object.defineProperty(t,o,{enumerable:!0,get:n[o]})},o:(a,t)=>Object.prototype.hasOwnProperty.call(a,t),r:a=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(a,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(a,"__esModule",{value:!0})}},t={};(()=>{"use strict";function n(a,t){return n=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(a,t){return a.__proto__=t,a},n(a,t)}function o(a,t){a.prototype=Object.create(t.prototype),a.prototype.constructor=a,n(a,t)}a.r(t),a.d(t,{components:()=>E,helpers:()=>V,models:()=>l});const e=flarum.core.compat["common/Model"];var s=a.n(e);const i=flarum.core.compat["common/utils/mixin"];var r=function(a){function t(){return a.apply(this,arguments)||this}return o(t,a),t}(a.n(i)()(s(),{points:s().attribute("points"),name:s().attribute("name"),color:s().attribute("color")})),l={Rank:r};const c=flarum.core.compat["admin/app"];var u=a.n(c);const f=flarum.core.compat["admin/components/ExtensionPage"];var p=a.n(f);const d=flarum.core.compat["common/components/Button"];var g=a.n(d);const v=flarum.core.compat["admin/utils/saveSettings"];var h=a.n(v);const b=flarum.core.compat["common/components/Switch"];var k=a.n(b);const w=flarum.core.compat["common/utils/withAttr"];var P=a.n(w);const y=flarum.core.compat["common/utils/Stream"];var N=a.n(y);const _=flarum.core.compat["common/utils/ItemList"];var R=a.n(_);const x=flarum.core.compat["admin/components/UploadImageButton"];var I=function(a){function t(){return a.apply(this,arguments)||this}return o(t,a),t.prototype.resourceUrl=function(){return u().forum.attribute("apiUrl")+"/"+this.attrs.path},t}(a.n(x)());const O=flarum.core.compat["common/Component"];var S=a.n(O);const A=flarum.core.compat["common/components/Select"];var L=a.n(A);const U=flarum.core.compat["common/components/Tooltip"];var C=a.n(U);const M=flarum.core.compat["common/utils/extractText"];var B=a.n(M);const D=flarum.core.compat["common/models/Group"];var T=a.n(D),F=function(a){function t(){for(var t,n=arguments.length,o=new Array(n),e=0;e{var a={n:t=>{var n=t&&t.__esModule?()=>t.default:()=>t;return a.d(n,{a:n}),n},d:(t,n)=>{for(var o in n)a.o(n,o)&&!a.o(t,o)&&Object.defineProperty(t,o,{enumerable:!0,get:n[o]})},o:(a,t)=>Object.prototype.hasOwnProperty.call(a,t),r:a=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(a,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(a,"__esModule",{value:!0})}},t={};(()=>{"use strict";function n(a,t){return n=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(a,t){return a.__proto__=t,a},n(a,t)}function o(a,t){a.prototype=Object.create(t.prototype),a.prototype.constructor=a,n(a,t)}a.r(t),a.d(t,{components:()=>E,helpers:()=>G,models:()=>l});const e=flarum.core.compat["common/Model"];var s=a.n(e);const i=flarum.core.compat["common/utils/mixin"];var r=function(a){function t(){return a.apply(this,arguments)||this}return o(t,a),t}(a.n(i)()(s(),{points:s().attribute("points"),name:s().attribute("name"),color:s().attribute("color")})),l={Rank:r};const c=flarum.core.compat["admin/app"];var u=a.n(c);const f=flarum.core.compat["admin/components/ExtensionPage"];var p=a.n(f);const d=flarum.core.compat["common/components/Button"];var g=a.n(d);const v=flarum.core.compat["admin/utils/saveSettings"];var h=a.n(v);const b=flarum.core.compat["common/components/Switch"];var k=a.n(b);const w=flarum.core.compat["common/utils/withAttr"];var y=a.n(w);const P=flarum.core.compat["common/utils/Stream"];var N=a.n(P);const _=flarum.core.compat["common/utils/ItemList"];var R=a.n(_);const x=flarum.core.compat["admin/components/UploadImageButton"];var I=function(a){function t(){return a.apply(this,arguments)||this}return o(t,a),t.prototype.resourceUrl=function(){return u().forum.attribute("apiUrl")+"/"+this.attrs.path},t}(a.n(x)());const S=flarum.core.compat["common/Component"];var O=a.n(S);const A=flarum.core.compat["common/components/Select"];var L=a.n(A);const U=flarum.core.compat["common/components/Tooltip"];var C=a.n(U);const M=flarum.core.compat["common/utils/extractText"];var B=a.n(M);const V=flarum.core.compat["common/models/Group"];var D=a.n(V),T=function(a){function t(){for(var t,n=arguments.length,o=new Array(n),e=0;e {\n\tvar getter = module && module.__esModule ?\n\t\t() => (module['default']) :\n\t\t() => (module);\n\t__webpack_require__.d(getter, { a: getter });\n\treturn getter;\n};","// define getter functions for harmony exports\n__webpack_require__.d = (exports, definition) => {\n\tfor(var key in definition) {\n\t\tif(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {\n\t\t\tObject.defineProperty(exports, key, { enumerable: true, get: definition[key] });\n\t\t}\n\t}\n};","__webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))","// define __esModule on exports\n__webpack_require__.r = (exports) => {\n\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n\t}\n\tObject.defineProperty(exports, '__esModule', { value: true });\n};","export default function _setPrototypeOf(o, p) {\n _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) {\n o.__proto__ = p;\n return o;\n };\n return _setPrototypeOf(o, p);\n}","import setPrototypeOf from \"./setPrototypeOf.js\";\nexport default function _inheritsLoose(subClass, superClass) {\n subClass.prototype = Object.create(superClass.prototype);\n subClass.prototype.constructor = subClass;\n setPrototypeOf(subClass, superClass);\n}","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/Model'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/utils/mixin'];","import Model from 'flarum/common/Model';\nimport mixin from 'flarum/common/utils/mixin';\n\nexport default class Rank extends mixin(Model, {\n points: Model.attribute('points'),\n name: Model.attribute('name'),\n color: Model.attribute('color'),\n}) {}\n","import Rank from './Rank';\n\nexport const models = {\n Rank,\n};\n","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['admin/app'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['admin/components/ExtensionPage'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/components/Button'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['admin/utils/saveSettings'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/components/Switch'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/utils/withAttr'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/utils/Stream'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/utils/ItemList'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['admin/components/UploadImageButton'];","import app from 'flarum/admin/app';\nimport FlarumUploadImageButton from 'flarum/admin/components/UploadImageButton';\n\nexport default class UploadImageButton extends FlarumUploadImageButton {\n resourceUrl() {\n return app.forum.attribute('apiUrl') + '/' + this.attrs.path;\n }\n}\n","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/Component'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/components/Select'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/components/Tooltip'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/utils/extractText'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/models/Group'];","import app from 'flarum/admin/app';\nimport Component from 'flarum/common/Component';\nimport Button from 'flarum/common/components/Button';\nimport Select from 'flarum/common/components/Select';\nimport Tooltip from 'flarum/common/components/Tooltip';\nimport extractText from 'flarum/common/utils/extractText';\nimport withAttr from 'flarum/common/utils/withAttr';\nimport Stream from 'flarum/common/utils/Stream';\nimport Group from 'flarum/common/models/Group';\n\ninterface SettingsEntry {\n groupId?: number;\n minPoints?: number;\n maxPoints?: number;\n}\n\ninterface GroupSettingsAttrs {\n value: string;\n onchange: (value: string) => void;\n}\n\nexport default class GroupSettings extends Component {\n newGroupId = Stream('');\n newMinPoints = Stream('');\n newMaxPoints = Stream('');\n\n view() {\n let entries: SettingsEntry[] = [];\n\n try {\n entries = JSON.parse(this.attrs.value);\n } catch (error) {\n // silence errors. Will reset to empty array below\n }\n\n if (!Array.isArray(entries)) {\n entries = [];\n }\n\n let groupOptions: { [id: string]: string } = {};\n\n app.store.all('groups').forEach((group) => {\n // Don't allow Member or Guest since those are virtual, and don't allow Admin as it's too dangerous and could strip admins of their roles\n if ([Group.ADMINISTRATOR_ID, Group.MEMBER_ID, Group.GUEST_ID].indexOf(group.id()!) !== -1) {\n return;\n }\n\n groupOptions[group.id()!] = group.nameSingular();\n });\n\n const addHandler = () => {\n const newEntry: SettingsEntry = {\n groupId: parseInt(this.newGroupId()),\n };\n\n if (this.newMinPoints()) {\n newEntry.minPoints = parseInt(this.newMinPoints());\n }\n\n if (this.newMaxPoints()) {\n newEntry.maxPoints = parseInt(this.newMaxPoints());\n }\n\n entries.push(newEntry);\n\n this.attrs.onchange(JSON.stringify(entries));\n\n this.newGroupId('');\n this.newMinPoints('');\n this.newMaxPoints('');\n };\n\n return (\n \n \n \n \n \n \n \n \n \n {entries.map((entry, entryIndex) => {\n const valueChangeHandler = (attribute: keyof SettingsEntry) => {\n return (value: string) => {\n if (value === '') {\n delete entry[attribute];\n } else {\n entry[attribute] = parseInt(value);\n }\n\n this.attrs.onchange(JSON.stringify(entries));\n };\n };\n\n const deleteHandler = () => {\n entries.splice(entryIndex, 1);\n\n this.attrs.onchange(JSON.stringify(entries));\n };\n\n return (\n \n \n \n \n \n \n );\n })}\n \n \n \n \n \n \n \n
{app.translator.trans('fof-gamification.admin.page.groups.column.group')}{app.translator.trans('fof-gamification.admin.page.groups.column.minPoints')}{app.translator.trans('fof-gamification.admin.page.groups.column.maxPoints')}
\n \n \n \n \n \n \n \n \n
\n \n \n \n \n \n \n \n \n
\n );\n }\n}\n","import app from 'flarum/admin/app';\nimport ExtensionPage from 'flarum/admin/components/ExtensionPage';\nimport Button from 'flarum/common/components/Button';\nimport saveSettings from 'flarum/admin/utils/saveSettings';\nimport Switch from 'flarum/common/components/Switch';\nimport withAttr from 'flarum/common/utils/withAttr';\nimport Stream from 'flarum/common/utils/Stream';\nimport ItemList from 'flarum/common/utils/ItemList';\nimport UploadImageButton from './UploadImageButton';\nimport GroupSettings from './GroupSettings';\n\nexport default class SettingsPage extends ExtensionPage {\n oninit(vnode) {\n super.oninit(vnode);\n\n this.fields = [\n 'convertedLikes',\n 'amountPerPost',\n 'amountPerDiscussion',\n 'postStartAmount',\n 'rankAmt',\n 'iconName',\n 'blockedUsers',\n 'iconNameAlt',\n 'autoAssignedGroups',\n ];\n\n this.switches = [\n 'autoUpvotePosts',\n 'customRankingImages',\n 'rateLimit',\n 'showVotesOnDiscussionPage',\n 'useAlternateLayout',\n 'altPostVotingUi',\n 'upVotesOnly',\n 'firstPostOnly',\n ];\n\n this.ranks = app.store.all('ranks');\n\n this.values = {};\n\n this.settingsPrefix = 'fof-gamification';\n\n const settings = app.data.settings;\n\n this.fields.forEach((key) => (this.values[key] = Stream(settings[this.addPrefix(key)])));\n\n this.switches.forEach((key) => (this.values[key] = Stream(!!Number(settings[this.addPrefix(key)]))));\n\n this.newRank = {\n points: Stream(''),\n name: Stream(''),\n color: Stream(''),\n };\n }\n\n /**\n * @returns {*}\n */\n content() {\n return (\n
\n
\n
{this.settingsItems().toArray()}
\n
\n
\n );\n }\n\n updateName(rank, value) {\n rank.save({ name: value });\n }\n\n updatePoints(rank, value) {\n rank.save({ points: value });\n }\n\n updateColor(rank, value) {\n rank.save({ color: value });\n }\n\n deleteRank(rankToDelete) {\n rankToDelete.delete();\n this.ranks.some((rank, i) => {\n if (rank.data.id === rankToDelete.data.id) {\n this.ranks.splice(i, 1);\n return true;\n }\n });\n }\n\n addRank() {\n app.store\n .createRecord('ranks')\n .save({\n points: this.newRank.points(),\n name: this.newRank.name(),\n color: this.newRank.color(),\n })\n .then(() => {\n this.newRank.color('');\n this.newRank.name('');\n this.newRank.points('');\n\n m.redraw();\n });\n }\n\n /**\n *\n * @returns boolean\n */\n changed() {\n var switchesCheck = this.switches.some((key) => this.values[key]() !== (app.data.settings[this.addPrefix(key)] == '1'));\n var fieldsCheck = this.fields.some((key) => this.values[key]() !== app.data.settings[this.addPrefix(key)]);\n return fieldsCheck || switchesCheck;\n }\n\n prepareSubmissionData() {\n const settings = {};\n\n this.switches.forEach((key) => (settings[this.addPrefix(key)] = this.values[key]()));\n this.fields.forEach((key) => (settings[this.addPrefix(key)] = this.values[key]()));\n\n return settings;\n }\n\n /**\n * @param e\n */\n onsubmit(e) {\n e.preventDefault();\n\n if (this.loading) return;\n\n this.loading = true;\n\n app.alerts.dismiss(this.successAlert);\n\n saveSettings(this.prepareSubmissionData())\n .then(this.onsaved.bind(this))\n .then(() => window.location.reload())\n .catch(console.error)\n .then(() => {\n this.loading = false;\n });\n }\n\n /**\n * @returns string\n */\n addPrefix(key) {\n return this.settingsPrefix + '.' + key;\n }\n\n settingsItems() {\n const items = new ItemList();\n\n items.add(\n 'convertLikesToUpvotes',\n
\n
{app.translator.trans('fof-gamification.admin.page.convert.help')}
\n {this.values.convertedLikes() === undefined ? (\n {\n app\n .request({\n url: app.forum.attribute('apiUrl') + '/fof/gamification/convert',\n method: 'POST',\n })\n .then(this.values.convertedLikes('converting'));\n }}\n >\n {app.translator.trans('fof-gamification.admin.page.convert.button')}\n \n ) : this.values.convertedLikes() === 'converting' ? (\n \n ) : (\n \n )}\n
,\n 100\n );\n\n items.add(\n 'ranks',\n
\n {app.translator.trans('fof-gamification.admin.page.ranks.title')}\n \n
{app.translator.trans('fof-gamification.admin.page.ranks.help.help')}
\n
\n {this.ranks.map((rank) => (\n
\n \n \n \n
\n ))}\n
\n
\n \n \n \n\n \n
\n \n \n
,\n 90\n );\n\n items.add(\n 'voteSettings',\n <>\n {app.translator.trans('fof-gamification.admin.page.votes.title')}\n {this.voteItems().toArray()}\n ,\n 80\n );\n\n items.add(\n 'rankingsPage',\n <>\n {app.translator.trans('fof-gamification.admin.page.rankings.title')}\n {this.rankingsItems().toArray()}\n ,\n 70\n );\n\n items.add(\n 'groups',\n
\n {app.translator.trans('fof-gamification.admin.page.groups.title')}\n
{app.translator.trans('fof-gamification.admin.page.groups.help')}
\n \n
,\n 60\n );\n\n items.add(\n 'submit',\n ,\n 0\n );\n\n return items;\n }\n\n voteItems() {\n const items = new ItemList();\n\n items.add(\n 'icon',\n <>\n \n
{app.translator.trans('fof-gamification.admin.page.votes.icon_help')}
\n \n ,\n 100\n );\n\n items.add(\n 'altIcon',\n <>\n \n
{app.translator.trans('fof-gamification.admin.page.votes.icon_help')}
\n \n ,\n 90\n );\n\n items.add(\n 'autoUpvote',\n \n {app.translator.trans('fof-gamification.admin.page.votes.auto_upvote')}\n ,\n 80\n );\n\n items.add(\n 'rateLimit',\n \n {app.translator.trans('fof-gamification.admin.page.votes.rate_limit')}\n ,\n 70\n );\n\n items.add(\n 'opVotesOnDiscussionList',\n \n {app.translator.trans('fof-gamification.admin.page.votes.discussion_page')}\n ,\n 60\n );\n\n items.add(\n 'altDiscussionListLayout',\n \n {app.translator.trans('fof-gamification.admin.page.votes.alternate_layout')}\n ,\n 50\n );\n\n items.add(\n 'altPostLayout',\n \n {app.translator.trans('fof-gamification.admin.page.votes.alternate_post_layout')}\n ,\n 40\n );\n\n items.add(\n 'upvotesOnly',\n \n {app.translator.trans('fof-gamification.admin.page.votes.upvotes_only')}\n ,\n 30\n );\n\n items.add(\n 'firstPostOnly',\n \n {app.translator.trans('fof-gamification.admin.page.votes.first_post_only')}\n ,\n 20\n );\n\n return items;\n }\n\n rankingsItems() {\n const items = new ItemList();\n\n items.add(\n 'customImages',\n \n {app.translator.trans('fof-gamification.admin.page.rankings.enable')}\n ,\n 100\n );\n\n items.add(\n 'ignoredUsers',\n <>\n \n \n ,\n 90\n );\n\n items.add(\n 'customImages',\n <>\n
{app.translator.trans('fof-gamification.admin.page.rankings.blocked.help')}
\n {[1, 2, 3].map((num) => (\n <>\n \n \n
\n \n ))}\n ,\n 80\n );\n\n return items;\n }\n}\n","import rankLabel from './rankLabel';\n\nexport const helpers = {\n rankLabel,\n};\n","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","import SettingsPage from './SettingsPage';\nimport UploadImageButton from './UploadImageButton';\n\nexport const components = {\n SettingsPage,\n UploadImageButton,\n};\n","import app from 'flarum/admin/app';\nimport SettingsPage from './components/SettingsPage';\nimport Rank from '../common/models/Rank';\n\napp.initializers.add('fof-gamification', (app) => {\n app.store.models.ranks = Rank;\n\n app.extensionData\n .for('fof-gamification')\n .registerPermission(\n {\n icon: 'fas fa-thumbs-up',\n label: app.translator.trans('fof-gamification.admin.permissions.vote_label'),\n permission: 'discussion.votePosts',\n },\n 'reply'\n )\n .registerPermission(\n {\n icon: 'fas fa-thumbs-up',\n label: app.translator.trans('fof-gamification.admin.permissions.see_votes_label'),\n permission: 'discussion.canSeeVotes',\n allowGuest: true,\n },\n 'view'\n )\n .registerPermission(\n {\n icon: 'fas fa-info-circle',\n label: app.translator.trans('fof-gamification.admin.permissions.see_voters_label'),\n permission: 'discussion.canSeeVoters',\n },\n 'view'\n )\n .registerPermission(\n {\n icon: 'fas fa-trophy',\n label: app.translator.trans('fof-gamification.admin.permissions.see_ranking_page'),\n permission: 'fof.gamification.viewRankingPage',\n allowGuest: true,\n },\n 'view'\n )\n .registerPermission(\n {\n icon: 'fas fa-bell',\n label: app.translator.trans('fof-gamification.admin.permissions.upvote_notifications'),\n permission: 'discussion.upvote_notifications',\n },\n 'view'\n )\n .registerPermission(\n {\n icon: 'fas fa-bell',\n label: app.translator.trans('fof-gamification.admin.permissions.downvote_notifications'),\n permission: 'discussion.downvote_notifications',\n },\n 'view'\n )\n .registerPage(SettingsPage);\n});\n\nexport * from '../common/helpers';\nexport * from './components';\n"],"names":["__webpack_require__","module","getter","__esModule","d","a","exports","definition","key","o","Object","defineProperty","enumerable","get","obj","prop","prototype","hasOwnProperty","call","Symbol","toStringTag","value","_setPrototypeOf","p","setPrototypeOf","bind","__proto__","_inheritsLoose","subClass","superClass","create","constructor","flarum","core","compat","Rank","mixin","Model","points","name","color","models","UploadImageButton","resourceUrl","app","this","attrs","path","FlarumUploadImageButton","GroupSettings","newGroupId","Stream","newMinPoints","newMaxPoints","view","entries","JSON","parse","error","Array","isArray","groupOptions","forEach","group","Group","indexOf","id","nameSingular","map","entry","entryIndex","valueChangeHandler","attribute","parseInt","onchange","stringify","options","groupId","className","type","minPoints","withAttr","maxPoints","text","extractText","icon","onclick","splice","bidi","newEntry","push","disabled","Component","SettingsPage","oninit","vnode","fields","switches","ranks","values","settingsPrefix","settings","addPrefix","Number","newRank","content","onsubmit","settingsItems","toArray","updateName","rank","save","updatePoints","updateColor","deleteRank","rankToDelete","some","i","data","addRank","then","m","redraw","changed","switchesCheck","prepareSubmissionData","e","preventDefault","loading","successAlert","saveSettings","onsaved","window","location","reload","console","items","ItemList","add","undefined","convertedLikes","url","method","number","placeholder","oninput","rankAmt","voteItems","rankingsItems","autoAssignedGroups","iconName","iconNameAlt","state","autoUpvotePosts","rateLimit","showVotesOnDiscussionPage","useAlternateLayout","altPostVotingUi","upVotesOnly","firstPostOnly","customRankingImages","blockedUsers","num","ExtensionPage","helpers","rankLabel","style","backgroundColor","components","store","extensionData","registerPermission","label","translator","trans","permission","allowGuest","registerPage"],"sourceRoot":""} \ No newline at end of file +{"version":3,"file":"admin.js","mappings":"MACA,IAAIA,EAAsB,CCA1BA,EAAyBC,IACxB,IAAIC,EAASD,GAAUA,EAAOE,WAC7B,IAAOF,EAAiB,QACxB,IAAM,EAEP,OADAD,EAAoBI,EAAEF,EAAQ,CAAEG,E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mBACC,CACExF,KAAM,qBACNyF,MAAOlI,EAAImI,WAAWC,MAAM,uDAC5BC,WAAY,2BAEd,QAEDJ,mBACC,CACExF,KAAM,gBACNyF,MAAOlI,EAAImI,WAAWC,MAAM,uDAC5BC,WAAY,mCACZC,YAAY,GAEd,QAEDL,mBACC,CACExF,KAAM,cACNyF,MAAOlI,EAAImI,WAAWC,MAAM,2DAC5BC,WAAY,mCAEd,QAEDJ,mBACC,CACExF,KAAM,cACNyF,MAAOlI,EAAImI,WAAWC,MAAM,6DAC5BC,WAAY,qCAEd,QAEDE,aAAatF,EACjB,G","sources":["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/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/external root \"flarum.core.compat['common/utils/mixin']\"","webpack://@fof/gamification/./src/common/models/Rank.js","webpack://@fof/gamification/./src/common/models/index.js","webpack://@fof/gamification/external root \"flarum.core.compat['admin/app']\"","webpack://@fof/gamification/external root \"flarum.core.compat['admin/components/ExtensionPage']\"","webpack://@fof/gamification/external root \"flarum.core.compat['common/components/Button']\"","webpack://@fof/gamification/external root \"flarum.core.compat['admin/utils/saveSettings']\"","webpack://@fof/gamification/external root \"flarum.core.compat['common/components/Switch']\"","webpack://@fof/gamification/external root \"flarum.core.compat['common/utils/withAttr']\"","webpack://@fof/gamification/external root \"flarum.core.compat['common/utils/Stream']\"","webpack://@fof/gamification/external root \"flarum.core.compat['common/utils/ItemList']\"","webpack://@fof/gamification/external root \"flarum.core.compat['admin/components/UploadImageButton']\"","webpack://@fof/gamification/./src/admin/components/UploadImageButton.js","webpack://@fof/gamification/external root \"flarum.core.compat['common/Component']\"","webpack://@fof/gamification/external root \"flarum.core.compat['common/components/Select']\"","webpack://@fof/gamification/external root \"flarum.core.compat['common/components/Tooltip']\"","webpack://@fof/gamification/external root \"flarum.core.compat['common/utils/extractText']\"","webpack://@fof/gamification/external root \"flarum.core.compat['common/models/Group']\"","webpack://@fof/gamification/./src/admin/components/GroupSettings.tsx","webpack://@fof/gamification/./src/admin/components/SettingsPage.js","webpack://@fof/gamification/./src/common/helpers/index.js","webpack://@fof/gamification/./src/common/helpers/rankLabel.js","webpack://@fof/gamification/./src/admin/components/index.js","webpack://@fof/gamification/./src/admin/index.js"],"sourcesContent":["// The require scope\nvar __webpack_require__ = {};\n\n","// getDefaultExport function for compatibility with non-harmony modules\n__webpack_require__.n = (module) => {\n\tvar getter = module && module.__esModule ?\n\t\t() => (module['default']) :\n\t\t() => (module);\n\t__webpack_require__.d(getter, { a: getter });\n\treturn getter;\n};","// define getter functions for harmony exports\n__webpack_require__.d = (exports, definition) => {\n\tfor(var key in definition) {\n\t\tif(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {\n\t\t\tObject.defineProperty(exports, key, { enumerable: true, get: definition[key] });\n\t\t}\n\t}\n};","__webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))","// define __esModule on exports\n__webpack_require__.r = (exports) => {\n\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n\t}\n\tObject.defineProperty(exports, '__esModule', { value: true });\n};","export default function _setPrototypeOf(o, p) {\n _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) {\n o.__proto__ = p;\n return o;\n };\n return _setPrototypeOf(o, p);\n}","import setPrototypeOf from \"./setPrototypeOf.js\";\nexport default function _inheritsLoose(subClass, superClass) {\n subClass.prototype = Object.create(superClass.prototype);\n subClass.prototype.constructor = subClass;\n setPrototypeOf(subClass, superClass);\n}","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/Model'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/utils/mixin'];","import Model from 'flarum/common/Model';\nimport mixin from 'flarum/common/utils/mixin';\n\nexport default class Rank extends mixin(Model, {\n points: Model.attribute('points'),\n name: Model.attribute('name'),\n color: Model.attribute('color'),\n}) {}\n","import Rank from './Rank';\n\nexport const models = {\n Rank,\n};\n","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['admin/app'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['admin/components/ExtensionPage'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/components/Button'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['admin/utils/saveSettings'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/components/Switch'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/utils/withAttr'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/utils/Stream'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/utils/ItemList'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['admin/components/UploadImageButton'];","import app from 'flarum/admin/app';\nimport FlarumUploadImageButton from 'flarum/admin/components/UploadImageButton';\n\nexport default class UploadImageButton extends FlarumUploadImageButton {\n resourceUrl() {\n return app.forum.attribute('apiUrl') + '/' + this.attrs.path;\n }\n}\n","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/Component'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/components/Select'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/components/Tooltip'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/utils/extractText'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/models/Group'];","import app from 'flarum/admin/app';\nimport Component from 'flarum/common/Component';\nimport Button from 'flarum/common/components/Button';\nimport Select from 'flarum/common/components/Select';\nimport Tooltip from 'flarum/common/components/Tooltip';\nimport extractText from 'flarum/common/utils/extractText';\nimport withAttr from 'flarum/common/utils/withAttr';\nimport Stream from 'flarum/common/utils/Stream';\nimport Group from 'flarum/common/models/Group';\n\ninterface SettingsEntry {\n groupId?: number;\n minPoints?: number;\n maxPoints?: number;\n}\n\ninterface GroupSettingsAttrs {\n value: string;\n onchange: (value: string) => void;\n}\n\nexport default class GroupSettings extends Component {\n newGroupId = Stream('');\n newMinPoints = Stream('');\n newMaxPoints = Stream('');\n\n view() {\n let entries: SettingsEntry[] = [];\n\n try {\n entries = JSON.parse(this.attrs.value);\n } catch (error) {\n // silence errors. Will reset to empty array below\n }\n\n if (!Array.isArray(entries)) {\n entries = [];\n }\n\n let groupOptions: { [id: string]: string } = {};\n\n app.store.all('groups').forEach((group) => {\n // Don't allow Member or Guest since those are virtual, and don't allow Admin as it's too dangerous and could strip admins of their roles\n if ([Group.ADMINISTRATOR_ID, Group.MEMBER_ID, Group.GUEST_ID].indexOf(group.id()!) !== -1) {\n return;\n }\n\n groupOptions[group.id()!] = group.nameSingular();\n });\n\n const addHandler = () => {\n const newEntry: SettingsEntry = {\n groupId: parseInt(this.newGroupId()),\n };\n\n if (this.newMinPoints()) {\n newEntry.minPoints = parseInt(this.newMinPoints());\n }\n\n if (this.newMaxPoints()) {\n newEntry.maxPoints = parseInt(this.newMaxPoints());\n }\n\n entries.push(newEntry);\n\n this.attrs.onchange(JSON.stringify(entries));\n\n this.newGroupId('');\n this.newMinPoints('');\n this.newMaxPoints('');\n };\n\n return (\n \n \n \n \n \n \n \n \n \n {entries.map((entry, entryIndex) => {\n const valueChangeHandler = (attribute: keyof SettingsEntry) => {\n return (value: string) => {\n if (value === '') {\n delete entry[attribute];\n } else {\n entry[attribute] = parseInt(value);\n }\n\n this.attrs.onchange(JSON.stringify(entries));\n };\n };\n\n const deleteHandler = () => {\n entries.splice(entryIndex, 1);\n\n this.attrs.onchange(JSON.stringify(entries));\n };\n\n return (\n \n \n \n \n \n \n );\n })}\n \n \n \n \n \n \n \n
{app.translator.trans('fof-gamification.admin.page.groups.column.group')}{app.translator.trans('fof-gamification.admin.page.groups.column.minPoints')}{app.translator.trans('fof-gamification.admin.page.groups.column.maxPoints')}
\n \n \n \n \n \n \n \n \n
\n \n \n \n \n \n \n \n \n
\n );\n }\n}\n","import app from 'flarum/admin/app';\nimport ExtensionPage from 'flarum/admin/components/ExtensionPage';\nimport Button from 'flarum/common/components/Button';\nimport saveSettings from 'flarum/admin/utils/saveSettings';\nimport Switch from 'flarum/common/components/Switch';\nimport withAttr from 'flarum/common/utils/withAttr';\nimport Stream from 'flarum/common/utils/Stream';\nimport ItemList from 'flarum/common/utils/ItemList';\nimport UploadImageButton from './UploadImageButton';\nimport GroupSettings from './GroupSettings';\n\nexport default class SettingsPage extends ExtensionPage {\n oninit(vnode) {\n super.oninit(vnode);\n\n this.fields = [\n 'convertedLikes',\n 'amountPerPost',\n 'amountPerDiscussion',\n 'postStartAmount',\n 'rankAmt',\n 'iconName',\n 'blockedUsers',\n 'iconNameAlt',\n 'autoAssignedGroups',\n ];\n\n this.switches = [\n 'autoUpvotePosts',\n 'customRankingImages',\n 'rateLimit',\n 'showVotesOnDiscussionPage',\n 'useAlternateLayout',\n 'altPostVotingUi',\n 'upVotesOnly',\n 'firstPostOnly',\n 'allowSelfVotes',\n ];\n\n this.ranks = app.store.all('ranks');\n\n this.values = {};\n\n this.settingsPrefix = 'fof-gamification';\n\n const settings = app.data.settings;\n\n this.fields.forEach((key) => (this.values[key] = Stream(settings[this.addPrefix(key)])));\n\n this.switches.forEach((key) => (this.values[key] = Stream(!!Number(settings[this.addPrefix(key)]))));\n\n this.newRank = {\n points: Stream(''),\n name: Stream(''),\n color: Stream(''),\n };\n }\n\n /**\n * @returns {*}\n */\n content() {\n return (\n
\n
\n
{this.settingsItems().toArray()}
\n
\n
\n );\n }\n\n updateName(rank, value) {\n rank.save({ name: value });\n }\n\n updatePoints(rank, value) {\n rank.save({ points: value });\n }\n\n updateColor(rank, value) {\n rank.save({ color: value });\n }\n\n deleteRank(rankToDelete) {\n rankToDelete.delete();\n this.ranks.some((rank, i) => {\n if (rank.data.id === rankToDelete.data.id) {\n this.ranks.splice(i, 1);\n return true;\n }\n });\n }\n\n addRank() {\n app.store\n .createRecord('ranks')\n .save({\n points: this.newRank.points(),\n name: this.newRank.name(),\n color: this.newRank.color(),\n })\n .then(() => {\n this.newRank.color('');\n this.newRank.name('');\n this.newRank.points('');\n\n m.redraw();\n });\n }\n\n /**\n *\n * @returns boolean\n */\n changed() {\n var switchesCheck = this.switches.some((key) => this.values[key]() !== (app.data.settings[this.addPrefix(key)] == '1'));\n var fieldsCheck = this.fields.some((key) => this.values[key]() !== app.data.settings[this.addPrefix(key)]);\n return fieldsCheck || switchesCheck;\n }\n\n prepareSubmissionData() {\n const settings = {};\n\n this.switches.forEach((key) => (settings[this.addPrefix(key)] = this.values[key]()));\n this.fields.forEach((key) => (settings[this.addPrefix(key)] = this.values[key]()));\n\n return settings;\n }\n\n /**\n * @param e\n */\n onsubmit(e) {\n e.preventDefault();\n\n if (this.loading) return;\n\n this.loading = true;\n\n app.alerts.dismiss(this.successAlert);\n\n saveSettings(this.prepareSubmissionData())\n .then(this.onsaved.bind(this))\n .then(() => window.location.reload())\n .catch(console.error)\n .then(() => {\n this.loading = false;\n });\n }\n\n /**\n * @returns string\n */\n addPrefix(key) {\n return this.settingsPrefix + '.' + key;\n }\n\n settingsItems() {\n const items = new ItemList();\n\n items.add(\n 'convertLikesToUpvotes',\n
\n
{app.translator.trans('fof-gamification.admin.page.convert.help')}
\n {this.values.convertedLikes() === undefined ? (\n {\n app\n .request({\n url: app.forum.attribute('apiUrl') + '/fof/gamification/convert',\n method: 'POST',\n })\n .then(this.values.convertedLikes('converting'));\n }}\n >\n {app.translator.trans('fof-gamification.admin.page.convert.button')}\n \n ) : this.values.convertedLikes() === 'converting' ? (\n \n ) : (\n \n )}\n
,\n 100\n );\n\n items.add(\n 'ranks',\n
\n {app.translator.trans('fof-gamification.admin.page.ranks.title')}\n \n
{app.translator.trans('fof-gamification.admin.page.ranks.help.help')}
\n
\n {this.ranks.map((rank) => (\n
\n \n \n \n
\n ))}\n
\n
\n \n \n \n\n \n
\n \n \n
,\n 90\n );\n\n items.add(\n 'voteSettings',\n <>\n {app.translator.trans('fof-gamification.admin.page.votes.title')}\n {this.voteItems().toArray()}\n ,\n 80\n );\n\n items.add(\n 'rankingsPage',\n <>\n {app.translator.trans('fof-gamification.admin.page.rankings.title')}\n {this.rankingsItems().toArray()}\n ,\n 70\n );\n\n items.add(\n 'groups',\n
\n {app.translator.trans('fof-gamification.admin.page.groups.title')}\n
{app.translator.trans('fof-gamification.admin.page.groups.help')}
\n \n
,\n 60\n );\n\n items.add(\n 'submit',\n ,\n 0\n );\n\n return items;\n }\n\n voteItems() {\n const items = new ItemList();\n\n items.add(\n 'icon',\n <>\n \n
{app.translator.trans('fof-gamification.admin.page.votes.icon_help')}
\n \n ,\n 100\n );\n\n items.add(\n 'altIcon',\n <>\n \n
{app.translator.trans('fof-gamification.admin.page.votes.icon_help')}
\n \n ,\n 90\n );\n\n items.add(\n 'autoUpvote',\n \n {app.translator.trans('fof-gamification.admin.page.votes.auto_upvote')}\n ,\n 80\n );\n\n items.add(\n 'rateLimit',\n \n {app.translator.trans('fof-gamification.admin.page.votes.rate_limit')}\n ,\n 70\n );\n\n items.add(\n 'opVotesOnDiscussionList',\n \n {app.translator.trans('fof-gamification.admin.page.votes.discussion_page')}\n ,\n 60\n );\n\n items.add(\n 'altDiscussionListLayout',\n \n {app.translator.trans('fof-gamification.admin.page.votes.alternate_layout')}\n ,\n 50\n );\n\n items.add(\n 'altPostLayout',\n \n {app.translator.trans('fof-gamification.admin.page.votes.alternate_post_layout')}\n ,\n 40\n );\n\n items.add(\n 'upvotesOnly',\n \n {app.translator.trans('fof-gamification.admin.page.votes.upvotes_only')}\n ,\n 30\n );\n\n items.add(\n 'firstPostOnly',\n \n {app.translator.trans('fof-gamification.admin.page.votes.first_post_only')}\n ,\n 20\n );\n\n items.add(\n 'allowSelfVotes',\n \n {app.translator.trans('fof-gamification.admin.page.votes.allow_self_votes')}\n ,\n 10\n );\n\n return items;\n }\n\n rankingsItems() {\n const items = new ItemList();\n\n items.add(\n 'customImages',\n \n {app.translator.trans('fof-gamification.admin.page.rankings.enable')}\n ,\n 100\n );\n\n items.add(\n 'ignoredUsers',\n <>\n \n \n ,\n 90\n );\n\n items.add(\n 'customImages',\n <>\n
{app.translator.trans('fof-gamification.admin.page.rankings.blocked.help')}
\n {[1, 2, 3].map((num) => (\n <>\n \n \n
\n \n ))}\n ,\n 80\n );\n\n return items;\n }\n}\n","import rankLabel from './rankLabel';\n\nexport const helpers = {\n rankLabel,\n};\n","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","import SettingsPage from './SettingsPage';\nimport UploadImageButton from './UploadImageButton';\n\nexport const components = {\n SettingsPage,\n UploadImageButton,\n};\n","import app from 'flarum/admin/app';\nimport SettingsPage from './components/SettingsPage';\nimport Rank from '../common/models/Rank';\n\napp.initializers.add('fof-gamification', (app) => {\n app.store.models.ranks = Rank;\n\n app.extensionData\n .for('fof-gamification')\n .registerPermission(\n {\n icon: 'fas fa-thumbs-up',\n label: app.translator.trans('fof-gamification.admin.permissions.vote_label'),\n permission: 'discussion.votePosts',\n },\n 'reply'\n )\n .registerPermission(\n {\n icon: 'fas fa-thumbs-up',\n label: app.translator.trans('fof-gamification.admin.permissions.see_votes_label'),\n permission: 'discussion.canSeeVotes',\n allowGuest: true,\n },\n 'view'\n )\n .registerPermission(\n {\n icon: 'fas fa-info-circle',\n label: app.translator.trans('fof-gamification.admin.permissions.see_voters_label'),\n permission: 'discussion.canSeeVoters',\n },\n 'view'\n )\n .registerPermission(\n {\n icon: 'fas fa-trophy',\n label: app.translator.trans('fof-gamification.admin.permissions.see_ranking_page'),\n permission: 'fof.gamification.viewRankingPage',\n allowGuest: true,\n },\n 'view'\n )\n .registerPermission(\n {\n icon: 'fas fa-bell',\n label: app.translator.trans('fof-gamification.admin.permissions.upvote_notifications'),\n permission: 'discussion.upvote_notifications',\n },\n 'view'\n )\n .registerPermission(\n {\n icon: 'fas fa-bell',\n label: app.translator.trans('fof-gamification.admin.permissions.downvote_notifications'),\n permission: 'discussion.downvote_notifications',\n },\n 'view'\n )\n .registerPage(SettingsPage);\n});\n\nexport * from '../common/helpers';\nexport * from './components';\n"],"names":["__webpack_require__","module","getter","__esModule","d","a","exports","definition","key","o","Object","defineProperty","enumerable","get","obj","prop","prototype","hasOwnProperty","call","Symbol","toStringTag","value","_setPrototypeOf","p","setPrototypeOf","bind","__proto__","_inheritsLoose","subClass","superClass","create","constructor","flarum","core","compat","Rank","mixin","Model","points","name","color","models","UploadImageButton","resourceUrl","app","this","attrs","path","FlarumUploadImageButton","GroupSettings","newGroupId","Stream","newMinPoints","newMaxPoints","view","entries","JSON","parse","error","Array","isArray","groupOptions","forEach","group","Group","indexOf","id","nameSingular","map","entry","entryIndex","valueChangeHandler","attribute","parseInt","onchange","stringify","options","groupId","className","type","minPoints","withAttr","maxPoints","text","extractText","icon","onclick","splice","bidi","newEntry","push","disabled","Component","SettingsPage","oninit","vnode","fields","switches","ranks","values","settingsPrefix","settings","addPrefix","Number","newRank","content","onsubmit","settingsItems","toArray","updateName","rank","save","updatePoints","updateColor","deleteRank","rankToDelete","some","i","data","addRank","then","m","redraw","changed","switchesCheck","prepareSubmissionData","e","preventDefault","loading","successAlert","saveSettings","onsaved","window","location","reload","console","items","ItemList","add","undefined","convertedLikes","url","method","number","placeholder","oninput","rankAmt","min","voteItems","rankingsItems","autoAssignedGroups","iconName","iconNameAlt","state","autoUpvotePosts","rateLimit","showVotesOnDiscussionPage","useAlternateLayout","altPostVotingUi","upVotesOnly","firstPostOnly","allowSelfVotes","customRankingImages","blockedUsers","num","ExtensionPage","helpers","rankLabel","style","backgroundColor","components","store","extensionData","registerPermission","label","translator","trans","permission","allowGuest","registerPage"],"sourceRoot":""} \ No newline at end of file diff --git a/js/dist/forum.js b/js/dist/forum.js index 929ca31..3674daf 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={987:(t,o,e)=>{var n=/^\s+|\s+$/g,r=/^[-+]0x[0-9a-f]+$/i,a=/^0b[01]+$/i,i=/^0o[0-7]+$/i,s=parseInt,c="object"==typeof e.g&&e.g&&e.g.Object===Object&&e.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(n,"");var e=a.test(t);return e||i.test(t)?s(t.slice(2),e?2:8):r.test(t)?NaN:+t}t.exports=function(t,o,e){var n,r,a,i,s,c,u=0,l=!1,f=!1,y=!0;if("function"!=typeof t)throw new TypeError("Expected a function");function g(o){var e=n,a=r;return n=r=void 0,u=o,i=t.apply(a,e)}function b(t){return u=t,s=setTimeout(x,o),l?g(t):i}function w(t){var e=t-c;return void 0===c||e>=o||e<0||f&&t-u>=a}function x(){var t=d();if(w(t))return N(t);s=setTimeout(x,function(t){var e=o-(t-c);return f?p(e,a-(t-u)):e}(t))}function N(t){return s=void 0,y&&n?g(t):(n=r=void 0,i)}function L(){var t=d(),e=w(t);if(n=arguments,r=this,c=t,e){if(void 0===s)return b(c);if(f)return s=setTimeout(x,o),g(c)}return void 0===s&&(s=setTimeout(x,o)),i}return o=h(o)||0,v(e)&&(l=!!e.leading,a=(f="maxWait"in e)?m(h(e.maxWait)||0,o):a,y="trailing"in e?!!e.trailing:y),L.cancel=function(){void 0!==s&&clearTimeout(s),u=0,n=c=r=s=void 0},L.flush=function(){return void 0===s?i:N(d())},L}},648:(t,o,e)=>{var n=e(288).default;function r(){"use strict";t.exports=r=function(){return o},t.exports.__esModule=!0,t.exports.default=t.exports;var o={},e=Object.prototype,a=e.hasOwnProperty,i="function"==typeof Symbol?Symbol:{},s=i.iterator||"@@iterator",c=i.asyncIterator||"@@asyncIterator",u=i.toStringTag||"@@toStringTag";function l(t,o,e){return Object.defineProperty(t,o,{value:e,enumerable:!0,configurable:!0,writable:!0}),t[o]}try{l({},"")}catch(t){l=function(t,o,e){return t[o]=e}}function f(t,o,e,n){var r=o&&o.prototype instanceof d?o:d,a=Object.create(r.prototype),i=new V(n||[]);return a._invoke=function(t,o,e){var n="suspendedStart";return function(r,a){if("executing"===n)throw new Error("Generator is already running");if("completed"===n){if("throw"===r)throw a;return{value:void 0,done:!0}}for(e.method=r,e.arg=a;;){var i=e.delegate;if(i){var s=L(i,e);if(s){if(s===p)continue;return s}}if("next"===e.method)e.sent=e._sent=e.arg;else if("throw"===e.method){if("suspendedStart"===n)throw n="completed",e.arg;e.dispatchException(e.arg)}else"return"===e.method&&e.abrupt("return",e.arg);n="executing";var c=m(t,o,e);if("normal"===c.type){if(n=e.done?"completed":"suspendedYield",c.arg===p)continue;return{value:c.arg,done:e.done}}"throw"===c.type&&(n="completed",e.method="throw",e.arg=c.arg)}}}(t,e,i),a}function m(t,o,e){try{return{type:"normal",arg:t.call(o,e)}}catch(t){return{type:"throw",arg:t}}}o.wrap=f;var p={};function d(){}function v(){}function h(){}var y={};l(y,s,(function(){return this}));var g=Object.getPrototypeOf,b=g&&g(g(_([])));b&&b!==e&&a.call(b,s)&&(y=b);var w=h.prototype=d.prototype=Object.create(y);function x(t){["next","throw","return"].forEach((function(o){l(t,o,(function(t){return this._invoke(o,t)}))}))}function N(t,o){function e(r,i,s,c){var u=m(t[r],t,i);if("throw"!==u.type){var l=u.arg,f=l.value;return f&&"object"==n(f)&&a.call(f,"__await")?o.resolve(f.__await).then((function(t){e("next",t,s,c)}),(function(t){e("throw",t,s,c)})):o.resolve(f).then((function(t){l.value=t,s(l)}),(function(t){return e("throw",t,s,c)}))}c(u.arg)}var r;this._invoke=function(t,n){function a(){return new o((function(o,r){e(t,n,o,r)}))}return r=r?r.then(a,a):a()}}function L(t,o){var e=t.iterator[o.method];if(void 0===e){if(o.delegate=null,"throw"===o.method){if(t.iterator.return&&(o.method="return",o.arg=void 0,L(t,o),"throw"===o.method))return p;o.method="throw",o.arg=new TypeError("The iterator does not provide a 'throw' method")}return p}var n=m(e,t.iterator,o.arg);if("throw"===n.type)return o.method="throw",o.arg=n.arg,o.delegate=null,p;var r=n.arg;return r?r.done?(o[t.resultName]=r.value,o.next=t.nextLoc,"return"!==o.method&&(o.method="next",o.arg=void 0),o.delegate=null,p):r:(o.method="throw",o.arg=new TypeError("iterator result is not an object"),o.delegate=null,p)}function k(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 P(t){var o=t.completion||{};o.type="normal",delete o.arg,t.completion=o}function V(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(k,this),this.reset(!0)}function _(t){if(t){var o=t[s];if(o)return o.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var e=-1,n=function o(){for(;++e=0;--n){var r=this.tryEntries[n],i=r.completion;if("root"===r.tryLoc)return e("end");if(r.tryLoc<=this.prev){var s=a.call(r,"catchLoc"),c=a.call(r,"finallyLoc");if(s&&c){if(this.prev=0;--e){var n=this.tryEntries[e];if(n.tryLoc<=this.prev&&a.call(n,"finallyLoc")&&this.prev=0;--o){var e=this.tryEntries[o];if(e.finallyLoc===t)return this.complete(e.completion,e.afterLoc),P(e),p}},catch:function(t){for(var o=this.tryEntries.length-1;o>=0;--o){var e=this.tryEntries[o];if(e.tryLoc===t){var n=e.completion;if("throw"===n.type){var r=n.arg;P(e)}return r}}throw new Error("illegal catch attempt")},delegateYield:function(t,o,e){return this.delegate={iterator:_(t),resultName:o,nextLoc:e},"next"===this.method&&(this.arg=void 0),p}},o}t.exports=r,t.exports.__esModule=!0,t.exports.default=t.exports},288:t=>{function o(e){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(e)}t.exports=o,t.exports.__esModule=!0,t.exports.default=t.exports},357:(t,o,e)=>{var n=e(648)();t.exports=n;try{regeneratorRuntime=n}catch(t){"object"==typeof globalThis?globalThis.regeneratorRuntime=n:Function("r","regeneratorRuntime = r")(n)}}},o={};function e(n){var r=o[n];if(void 0!==r)return r.exports;var a=o[n]={exports:{}};return t[n](a,a.exports,e),a.exports}e.n=t=>{var o=t&&t.__esModule?()=>t.default:()=>t;return e.d(o,{a:o}),o},e.d=(t,o)=>{for(var n in o)e.o(o,n)&&!e.o(t,n)&&Object.defineProperty(t,n,{enumerable:!0,get:o[n]})},e.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(t){if("object"==typeof window)return window}}(),e.o=(t,o)=>Object.prototype.hasOwnProperty.call(t,o),e.r=t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})};var n={};(()=>{"use strict";function t(o,e){return t=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,o){return t.__proto__=o,t},t(o,e)}function o(o,e){o.prototype=Object.create(e.prototype),o.prototype.constructor=o,t(o,e)}e.r(n),e.d(n,{components:()=>Dt,helpers:()=>Ut,models:()=>c});const r=flarum.core.compat["common/Model"];var a=e.n(r);const i=flarum.core.compat["common/utils/mixin"];var s=function(t){function e(){return t.apply(this,arguments)||this}return o(e,t),e}(e.n(i)()(a(),{points:a().attribute("points"),name:a().attribute("name"),color:a().attribute("color")})),c={Rank:s};const u=flarum.core.compat["forum/app"];var l=e.n(u);const f=flarum.core.compat["common/models/Discussion"];var p=e.n(f);const d=flarum.core.compat["common/models/Post"];var v=e.n(d);const h=flarum.core.compat["common/models/User"];var y=e.n(h);const g=flarum.core.compat["common/helpers/avatar"];var b=e.n(g);const w=flarum.core.compat["common/components/Page"];var x=e.n(w);const N=flarum.core.compat["forum/components/IndexPage"];var L=e.n(N);const k=flarum.core.compat["common/components/Button"];var P=e.n(k);const V=flarum.core.compat["common/components/LoadingIndicator"];var _=e.n(V);const F=flarum.core.compat["common/helpers/listItems"];var O=e.n(F);const j=flarum.core.compat["common/helpers/username"];var I=e.n(j);const S=flarum.core.compat["common/helpers/icon"];var E=e.n(S);const G=function(t,o){void 0===o&&(o=!1);var e=l().data["fof-gamification."+t];return o?!!parseInt(e):e},R=flarum.core.compat["common/components/Link"];var B=e.n(R),D=function(t){function e(){return t.apply(this,arguments)||this}o(e,t);var n=e.prototype;return n.oninit=function(o){t.prototype.oninit.call(this,o),l().forum.attribute("canViewRankingPage")||m.route.set("/"),this.loading=!0,this.users=[],this.refresh()},n.view=function(){var t,o=this;return t=this.loading?_().component():P().component({className:"Button",onclick:this.loadMore.bind(this)},l().translator.trans("core.forum.discussion_list.load_more_button")),m("div",{className:"IndexPage"},L().prototype.hero(),m("div",{className:"container"},m("div",{className:"sideNavContainer"},m("nav",{className:"IndexPage-nav sideNav"},m("ul",null,O()(L().prototype.sidebarItems().toArray()))),m("div",{className:"IndexPage-results sideNavOffset"},m("table",{class:"rankings"},m("tr",null,m("th",{className:"rankings-mobile"},l().translator.trans("fof-gamification.forum.ranking.rank")),m("th",null,l().translator.trans("fof-gamification.forum.ranking.name")),m("th",null,l().translator.trans("fof-gamification.forum.ranking.amount"))),this.users.map((function(t,e){return++e,[m("tr",{className:"ranking-"+e},e<4?G("customRankingImages",!0)?m("img",{className:"rankings-mobile rankings-image",src:l().forum.attribute("baseUrl")+l().forum.attribute("fof-gamification.topimage"+e+"Url")}):m("td",{className:"rankings-mobile rankings-"+e},E()("fas fa-trophy")):m("td",{className:"rankings-4 rankings-mobile"},o.addOrdinalSuffix(e)),m("td",null,m("div",{className:"PostUser"},m("h3",{className:"rankings-info"},m(B(),{href:l().route.user(t),force:!0},e<4?b()(t,{className:"info-avatar rankings-"+e+"-avatar"}):""," ",I()(t))))),e<4?m("td",{className:"rankings-"+e},t.points()):m("td",{className:"rankings-4"},t.points()))]}))),m("div",{className:"rankings-loadmore"}," ",t)))))},n.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()}))},n.addOrdinalSuffix=function(t){if("en"===l().data.locale){var o=t%10,e=t%100;return 1===o&&11!==e?t+"st":2===o&&12!==e?t+"nd":3===o&&13!==e?t+"rd":t+"th"}return t},n.loadResults=function(t){var o={};return o.page={offset:t,limit:"10"},l().store.find("rankings",o)},n.loadMore=function(){this.loading=!0,this.loadResults(this.users.length).then(this.parseResults.bind(this))},n.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},e}(x());const M=flarum.core.compat["common/extend"],U=flarum.core.compat["forum/states/DiscussionListState"];var T=e.n(U);const A=flarum.core.compat["common/components/LinkButton"];var C=e.n(A);const $=flarum.core.compat["forum/components/CommentPost"];var z=e.n($);const H=flarum.core.compat["common/utils/classList"];var W=e.n(H);const Y=flarum.core.compat["forum/utils/PostControls"];var q=e.n(Y);const J=flarum.core.compat["common/components/Modal"];var K=function(t){function e(){return t.apply(this,arguments)||this}o(e,t);var n=e.prototype;return n.className=function(){return"VotesModal Modal--small"},n.title=function(){return l().translator.trans("fof-gamification.forum.modal.title")},n.oninit=function(o){t.prototype.oninit.call(this,o),this.loading=!this.attrs.post.upvotes()||!this.attrs.post.downvotes(),this.loading&&this.load()},n.content=function(){var t=this;return this.loading?m("div",{className:"Modal-body"},m(_(),null)):m("div",{className:"Modal-body"},m("ul",{className:"VotesModal-list"},["upvotes","downvotes"].map((function(o){var e=t.attrs.post[o]();if(e&&e.length)return m("div",null,m("legend",null,l().translator.trans("fof-gamification.forum.modal."+o+"_label")),e.map((function(t){return m("li",null,m(B(),{href:l().route.user(t)},b()(t)," ",I()(t)))})))}))))},n.load=function(){return l().store.find("posts",this.attrs.post.id(),{include:"upvotes,downvotes"}).then(this.loaded.bind(this))},e}(e.n(J)());const Q=flarum.core.compat["forum/utils/DiscussionControls"];var X=e.n(Q);const Z=function(t,o,e,n,r){if(void 0===r&&(r=t.discussion()),l().session.user){if(!r||r.canVote()||t.canVote())return o&&e&&(o=!1,e=!1),n&&n(!0),m.redraw(),t.save([o,e,"vote"]).then((function(){return null}),(function(){return null})).then((function(){n&&n(!1),r&&r.pushAttributes({votes:t.votes()}),m.redraw()}))}else X().replyAction.call(r,!0)},tt=flarum.core.compat["forum/components/DiscussionListItem"];var ot=e.n(tt);const et=flarum.core.compat["common/utils/abbreviateNumber"];var nt=e.n(et);const rt=flarum.core.compat["forum/components/PostUser"];var at=e.n(rt);const it=flarum.core.compat["forum/components/UserCard"];var st=e.n(it);function ct(t,o){void 0===o&&(o={}),o.style=o.style||{},o.className="rankLabel "+(o.className||"");var e=t.color();return o.style.backgroundColor=o.style.color=e,o.className+=" colored",m("span",o,m("span",{className:"rankLabel-text"},t.name()))}function ut(){var t=function(t){return function(o){return o&&o.attrs&&o.attrs.className&&String(o.attrs.className).split(" ").includes(t)}},o=function o(e,n){var r=[];if(e&&e.children&&Array.isArray(e.children)){var a=e.children.find(t(n));a&&r.push(a),e.children.forEach((function(t){r.push.apply(r,o(t,n))}))}return r};(0,M.extend)(st().prototype,"infoItems",(function(t){var o=this.attrs.user;t.add("points",m("div",null,E()("fas fa-medal"),l().translator.trans("fof-gamification.forum.user.card.points",{count:o.points()})),50)})),(0,M.extend)(st().prototype,"view",(function(e){var n=this.attrs.user,r=o(e,"UserCard-profile")[0],a=Number(G("rankAmt"));if(r){var i=r.children.find(t("UserCard-badges"));return n.ranks()&&(i?n.ranks().reverse().map((function(t,o){if(!a||o0?"fas fa-"+t+"-up":"fas fa-"+t+"-down"},n.href=function(){return l().route.post(this.attrs.notification.subject())},n.content=function(){var t=this.attrs.notification.fromUser();return parseInt(this.attrs.notification.content())>0?l().translator.trans("fof-gamification.forum.notification.upvote",{user:t}):l().translator.trans("fof-gamification.forum.notification.downvote",{user:t})},n.excerpt=function(){return this.attrs.notification.subject().contentPlain()},e}(e.n(bt)());const xt=flarum.core.compat["forum/components/NotificationGrid"];var Nt=e.n(xt);function Lt(t,o,e,n,r,a,i){try{var s=t[a](i),c=s.value}catch(t){return void e(t)}s.done?o(c):Promise.resolve(c).then(n,r)}var kt=e(357),Pt=e.n(kt);const Vt=flarum.core.compat["common/Component"];var _t=e.n(Vt);const Ft=flarum.core.compat["common/components/Tooltip"];var Ot=e.n(Ft);const jt=flarum.core.compat["common/utils/SubtreeRetainer"];var It=e.n(jt),St=function(t){function e(){for(var o,e=arguments.length,n=new Array(e),r=0;r15?m("span",{className:"FoFGamification-voters-item FoFGamification-voters-item--plus"},m("span",{className:"Avatar"},"+"+(t.length-15))):null)))},n.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,l().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,e=arguments;return new Promise((function(n,r){var a=t.apply(o,e);function i(t){Lt(a,n,r,i,s,"next",t)}function s(t){Lt(a,n,r,i,s,"throw",t)}i(void 0)}))});return function(){return o.apply(this,arguments)}}(),e}(_t());const Et=flarum.core.compat["forum/components/UserPage"];var Gt=e.n(Et);const Rt=flarum.core.compat["forum/components/PostsUserPage"];var Bt=function(t){function e(){return t.apply(this,arguments)||this}return o(e,t),e.prototype.loadResults=function(t){return l().store.find("posts",{filter:{type:"comment",voted:this.user.id()},page:{offset:t,limit:this.loadLimit},sort:"-createdAt"})},e}(e.n(Rt)()),Dt={RankingsPage:D,VoteNotification:wt,VotesModal:K,Voters:St};function Mt(){return Mt=Object.assign?Object.assign.bind():function(t){for(var o=1;o{var t={987:(t,o,e)=>{var n=/^\s+|\s+$/g,r=/^[-+]0x[0-9a-f]+$/i,a=/^0b[01]+$/i,i=/^0o[0-7]+$/i,s=parseInt,c="object"==typeof e.g&&e.g&&e.g.Object===Object&&e.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(n,"");var e=a.test(t);return e||i.test(t)?s(t.slice(2),e?2:8):r.test(t)?NaN:+t}t.exports=function(t,o,e){var n,r,a,i,s,c,u=0,l=!1,f=!1,y=!0;if("function"!=typeof t)throw new TypeError("Expected a function");function g(o){var e=n,a=r;return n=r=void 0,u=o,i=t.apply(a,e)}function b(t){return u=t,s=setTimeout(N,o),l?g(t):i}function w(t){var e=t-c;return void 0===c||e>=o||e<0||f&&t-u>=a}function N(){var t=d();if(w(t))return x(t);s=setTimeout(N,function(t){var e=o-(t-c);return f?p(e,a-(t-u)):e}(t))}function x(t){return s=void 0,y&&n?g(t):(n=r=void 0,i)}function L(){var t=d(),e=w(t);if(n=arguments,r=this,c=t,e){if(void 0===s)return b(c);if(f)return s=setTimeout(N,o),g(c)}return void 0===s&&(s=setTimeout(N,o)),i}return o=h(o)||0,v(e)&&(l=!!e.leading,a=(f="maxWait"in e)?m(h(e.maxWait)||0,o):a,y="trailing"in e?!!e.trailing:y),L.cancel=function(){void 0!==s&&clearTimeout(s),u=0,n=c=r=s=void 0},L.flush=function(){return void 0===s?i:x(d())},L}},648:(t,o,e)=>{var n=e(288).default;function r(){"use strict";t.exports=r=function(){return o},t.exports.__esModule=!0,t.exports.default=t.exports;var o={},e=Object.prototype,a=e.hasOwnProperty,i="function"==typeof Symbol?Symbol:{},s=i.iterator||"@@iterator",c=i.asyncIterator||"@@asyncIterator",u=i.toStringTag||"@@toStringTag";function l(t,o,e){return Object.defineProperty(t,o,{value:e,enumerable:!0,configurable:!0,writable:!0}),t[o]}try{l({},"")}catch(t){l=function(t,o,e){return t[o]=e}}function f(t,o,e,n){var r=o&&o.prototype instanceof d?o:d,a=Object.create(r.prototype),i=new V(n||[]);return a._invoke=function(t,o,e){var n="suspendedStart";return function(r,a){if("executing"===n)throw new Error("Generator is already running");if("completed"===n){if("throw"===r)throw a;return{value:void 0,done:!0}}for(e.method=r,e.arg=a;;){var i=e.delegate;if(i){var s=L(i,e);if(s){if(s===p)continue;return s}}if("next"===e.method)e.sent=e._sent=e.arg;else if("throw"===e.method){if("suspendedStart"===n)throw n="completed",e.arg;e.dispatchException(e.arg)}else"return"===e.method&&e.abrupt("return",e.arg);n="executing";var c=m(t,o,e);if("normal"===c.type){if(n=e.done?"completed":"suspendedYield",c.arg===p)continue;return{value:c.arg,done:e.done}}"throw"===c.type&&(n="completed",e.method="throw",e.arg=c.arg)}}}(t,e,i),a}function m(t,o,e){try{return{type:"normal",arg:t.call(o,e)}}catch(t){return{type:"throw",arg:t}}}o.wrap=f;var p={};function d(){}function v(){}function h(){}var y={};l(y,s,(function(){return this}));var g=Object.getPrototypeOf,b=g&&g(g(_([])));b&&b!==e&&a.call(b,s)&&(y=b);var w=h.prototype=d.prototype=Object.create(y);function N(t){["next","throw","return"].forEach((function(o){l(t,o,(function(t){return this._invoke(o,t)}))}))}function x(t,o){function e(r,i,s,c){var u=m(t[r],t,i);if("throw"!==u.type){var l=u.arg,f=l.value;return f&&"object"==n(f)&&a.call(f,"__await")?o.resolve(f.__await).then((function(t){e("next",t,s,c)}),(function(t){e("throw",t,s,c)})):o.resolve(f).then((function(t){l.value=t,s(l)}),(function(t){return e("throw",t,s,c)}))}c(u.arg)}var r;this._invoke=function(t,n){function a(){return new o((function(o,r){e(t,n,o,r)}))}return r=r?r.then(a,a):a()}}function L(t,o){var e=t.iterator[o.method];if(void 0===e){if(o.delegate=null,"throw"===o.method){if(t.iterator.return&&(o.method="return",o.arg=void 0,L(t,o),"throw"===o.method))return p;o.method="throw",o.arg=new TypeError("The iterator does not provide a 'throw' method")}return p}var n=m(e,t.iterator,o.arg);if("throw"===n.type)return o.method="throw",o.arg=n.arg,o.delegate=null,p;var r=n.arg;return r?r.done?(o[t.resultName]=r.value,o.next=t.nextLoc,"return"!==o.method&&(o.method="next",o.arg=void 0),o.delegate=null,p):r:(o.method="throw",o.arg=new TypeError("iterator result is not an object"),o.delegate=null,p)}function k(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 P(t){var o=t.completion||{};o.type="normal",delete o.arg,t.completion=o}function V(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(k,this),this.reset(!0)}function _(t){if(t){var o=t[s];if(o)return o.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var e=-1,n=function o(){for(;++e=0;--n){var r=this.tryEntries[n],i=r.completion;if("root"===r.tryLoc)return e("end");if(r.tryLoc<=this.prev){var s=a.call(r,"catchLoc"),c=a.call(r,"finallyLoc");if(s&&c){if(this.prev=0;--e){var n=this.tryEntries[e];if(n.tryLoc<=this.prev&&a.call(n,"finallyLoc")&&this.prev=0;--o){var e=this.tryEntries[o];if(e.finallyLoc===t)return this.complete(e.completion,e.afterLoc),P(e),p}},catch:function(t){for(var o=this.tryEntries.length-1;o>=0;--o){var e=this.tryEntries[o];if(e.tryLoc===t){var n=e.completion;if("throw"===n.type){var r=n.arg;P(e)}return r}}throw new Error("illegal catch attempt")},delegateYield:function(t,o,e){return this.delegate={iterator:_(t),resultName:o,nextLoc:e},"next"===this.method&&(this.arg=void 0),p}},o}t.exports=r,t.exports.__esModule=!0,t.exports.default=t.exports},288:t=>{function o(e){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(e)}t.exports=o,t.exports.__esModule=!0,t.exports.default=t.exports},357:(t,o,e)=>{var n=e(648)();t.exports=n;try{regeneratorRuntime=n}catch(t){"object"==typeof globalThis?globalThis.regeneratorRuntime=n:Function("r","regeneratorRuntime = r")(n)}}},o={};function e(n){var r=o[n];if(void 0!==r)return r.exports;var a=o[n]={exports:{}};return t[n](a,a.exports,e),a.exports}e.n=t=>{var o=t&&t.__esModule?()=>t.default:()=>t;return e.d(o,{a:o}),o},e.d=(t,o)=>{for(var n in o)e.o(o,n)&&!e.o(t,n)&&Object.defineProperty(t,n,{enumerable:!0,get:o[n]})},e.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(t){if("object"==typeof window)return window}}(),e.o=(t,o)=>Object.prototype.hasOwnProperty.call(t,o),e.r=t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})};var n={};(()=>{"use strict";function t(o,e){return t=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,o){return t.__proto__=o,t},t(o,e)}function o(o,e){o.prototype=Object.create(e.prototype),o.prototype.constructor=o,t(o,e)}e.r(n),e.d(n,{components:()=>Dt,helpers:()=>Ut,models:()=>c});const r=flarum.core.compat["common/Model"];var a=e.n(r);const i=flarum.core.compat["common/utils/mixin"];var s=function(t){function e(){return t.apply(this,arguments)||this}return o(e,t),e}(e.n(i)()(a(),{points:a().attribute("points"),name:a().attribute("name"),color:a().attribute("color")})),c={Rank:s};const u=flarum.core.compat["forum/app"];var l=e.n(u);const f=flarum.core.compat["common/models/Discussion"];var p=e.n(f);const d=flarum.core.compat["common/models/Post"];var v=e.n(d);const h=flarum.core.compat["common/models/User"];var y=e.n(h);const g=flarum.core.compat["common/helpers/avatar"];var b=e.n(g);const w=flarum.core.compat["common/components/Page"];var N=e.n(w);const x=flarum.core.compat["forum/components/IndexPage"];var L=e.n(x);const k=flarum.core.compat["common/components/Button"];var P=e.n(k);const V=flarum.core.compat["common/components/LoadingIndicator"];var _=e.n(V);const F=flarum.core.compat["common/helpers/listItems"];var O=e.n(F);const j=flarum.core.compat["common/helpers/username"];var I=e.n(j);const S=flarum.core.compat["common/helpers/icon"];var E=e.n(S);const G=function(t,o){void 0===o&&(o=!1);var e=l().data["fof-gamification."+t];return o?!!parseInt(e):e},R=flarum.core.compat["common/components/Link"];var B=e.n(R),D=function(t){function e(){return t.apply(this,arguments)||this}o(e,t);var n=e.prototype;return n.oninit=function(o){t.prototype.oninit.call(this,o),l().forum.attribute("canViewRankingPage")||m.route.set("/"),this.loading=!0,this.users=[],this.refresh()},n.view=function(){var t,o=this;return t=this.loading?_().component():P().component({className:"Button",onclick:this.loadMore.bind(this)},l().translator.trans("core.forum.discussion_list.load_more_button")),m("div",{className:"IndexPage"},L().prototype.hero(),m("div",{className:"container"},m("div",{className:"sideNavContainer"},m("nav",{className:"IndexPage-nav sideNav"},m("ul",null,O()(L().prototype.sidebarItems().toArray()))),m("div",{className:"IndexPage-results sideNavOffset"},m("table",{class:"rankings"},m("tr",null,m("th",{className:"rankings-mobile"},l().translator.trans("fof-gamification.forum.ranking.rank")),m("th",null,l().translator.trans("fof-gamification.forum.ranking.name")),m("th",null,l().translator.trans("fof-gamification.forum.ranking.amount"))),this.users.map((function(t,e){return++e,[m("tr",{className:"ranking-"+e},e<4?G("customRankingImages",!0)?m("img",{className:"rankings-mobile rankings-image",src:l().forum.attribute("baseUrl")+l().forum.attribute("fof-gamification.topimage"+e+"Url")}):m("td",{className:"rankings-mobile rankings-"+e},E()("fas fa-trophy")):m("td",{className:"rankings-4 rankings-mobile"},o.addOrdinalSuffix(e)),m("td",null,m("div",{className:"PostUser"},m("h3",{className:"rankings-info"},m(B(),{href:l().route.user(t),force:!0},e<4?b()(t,{className:"info-avatar rankings-"+e+"-avatar"}):""," ",I()(t))))),e<4?m("td",{className:"rankings-"+e},t.points()):m("td",{className:"rankings-4"},t.points()))]}))),m("div",{className:"rankings-loadmore"}," ",t)))))},n.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()}))},n.addOrdinalSuffix=function(t){if("en"===l().data.locale){var o=t%10,e=t%100;return 1===o&&11!==e?t+"st":2===o&&12!==e?t+"nd":3===o&&13!==e?t+"rd":t+"th"}return t},n.loadResults=function(t){var o={};return o.page={offset:t,limit:"10"},l().store.find("rankings",o)},n.loadMore=function(){this.loading=!0,this.loadResults(this.users.length).then(this.parseResults.bind(this))},n.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},e}(N());const M=flarum.core.compat["common/extend"],U=flarum.core.compat["forum/states/DiscussionListState"];var T=e.n(U);const A=flarum.core.compat["common/components/LinkButton"];var C=e.n(A);const H=flarum.core.compat["forum/components/CommentPost"];var $=e.n(H);const z=flarum.core.compat["common/utils/classList"];var W=e.n(z);const Y=flarum.core.compat["forum/utils/PostControls"];var q=e.n(Y);const J=flarum.core.compat["common/components/Modal"];var K=function(t){function e(){return t.apply(this,arguments)||this}o(e,t);var n=e.prototype;return n.className=function(){return"VotesModal Modal--small"},n.title=function(){return l().translator.trans("fof-gamification.forum.modal.title")},n.oninit=function(o){t.prototype.oninit.call(this,o),this.loading=!this.attrs.post.upvotes()||!this.attrs.post.downvotes(),this.loading&&this.load()},n.content=function(){var t=this;return this.loading?m("div",{className:"Modal-body"},m(_(),null)):m("div",{className:"Modal-body"},m("ul",{className:"VotesModal-list"},["upvotes","downvotes"].map((function(o){var e=t.attrs.post[o]();if(e&&e.length)return m("div",null,m("legend",null,l().translator.trans("fof-gamification.forum.modal."+o+"_label")),e.map((function(t){return m("li",null,m(B(),{href:l().route.user(t)},b()(t)," ",I()(t)))})))}))))},n.load=function(){return l().store.find("posts",this.attrs.post.id(),{include:"upvotes,downvotes"}).then(this.loaded.bind(this))},e}(e.n(J)());const Q=flarum.core.compat["forum/utils/DiscussionControls"];var X=e.n(Q);const Z=function(t,o,e,n,r){if(void 0===r&&(r=t.discussion()),l().session.user){if(!r||r.canVote()||t.canVote())return o&&e&&(o=!1,e=!1),n&&n(!0),m.redraw(),t.save([o,e,"vote"]).then((function(){return null}),(function(){return null})).then((function(){n&&n(!1),r&&r.pushAttributes({votes:t.votes()}),m.redraw()}))}else X().replyAction.call(r,!0)},tt=flarum.core.compat["forum/components/DiscussionListItem"];var ot=e.n(tt);const et=flarum.core.compat["common/utils/abbreviateNumber"];var nt=e.n(et);const rt=flarum.core.compat["forum/components/PostUser"];var at=e.n(rt);const it=flarum.core.compat["forum/components/UserCard"];var st=e.n(it);function ct(t,o){void 0===o&&(o={}),o.style=o.style||{},o.className="rankLabel "+(o.className||"");var e=t.color();return o.style.backgroundColor=o.style.color=e,o.className+=" colored",m("span",o,m("span",{className:"rankLabel-text"},t.name()))}function ut(){var t=function(t){return function(o){return o&&o.attrs&&o.attrs.className&&String(o.attrs.className).split(" ").includes(t)}},o=function o(e,n){var r=[];if(e&&e.children&&Array.isArray(e.children)){var a=e.children.find(t(n));a&&r.push(a),e.children.forEach((function(t){r.push.apply(r,o(t,n))}))}return r};(0,M.extend)(st().prototype,"infoItems",(function(t){var o=this.attrs.user;t.add("points",m("div",null,E()("fas fa-medal"),l().translator.trans("fof-gamification.forum.user.card.points",{count:o.points()})),50)})),(0,M.extend)(st().prototype,"view",(function(e){var n=this.attrs.user,r=o(e,"UserCard-profile")[0],a=Number(G("rankAmt"));if(r){var i=r.children.find(t("UserCard-badges"));return n.ranks()&&(i?n.ranks().reverse().map((function(t,o){if(!a||o0?"fas fa-"+t+"-up":"fas fa-"+t+"-down"},n.href=function(){return l().route.post(this.attrs.notification.subject())},n.content=function(){var t=this.attrs.notification.fromUser();return parseInt(this.attrs.notification.content())>0?l().translator.trans("fof-gamification.forum.notification.upvote",{user:t}):l().translator.trans("fof-gamification.forum.notification.downvote",{user:t})},n.excerpt=function(){return this.attrs.notification.subject().contentPlain()},e}(e.n(bt)());const Nt=flarum.core.compat["forum/components/NotificationGrid"];var xt=e.n(Nt);function Lt(t,o,e,n,r,a,i){try{var s=t[a](i),c=s.value}catch(t){return void e(t)}s.done?o(c):Promise.resolve(c).then(n,r)}var kt=e(357),Pt=e.n(kt);const Vt=flarum.core.compat["common/Component"];var _t=e.n(Vt);const Ft=flarum.core.compat["common/components/Tooltip"];var Ot=e.n(Ft);const jt=flarum.core.compat["common/utils/SubtreeRetainer"];var It=e.n(jt),St=function(t){function e(){for(var o,e=arguments.length,n=new Array(e),r=0;r15?m("span",{className:"FoFGamification-voters-item FoFGamification-voters-item--plus"},m("span",{className:"Avatar"},"+"+(t.length-15))):null)))},n.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,l().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,e=arguments;return new Promise((function(n,r){var a=t.apply(o,e);function i(t){Lt(a,n,r,i,s,"next",t)}function s(t){Lt(a,n,r,i,s,"throw",t)}i(void 0)}))});return function(){return o.apply(this,arguments)}}(),e}(_t());const Et=flarum.core.compat["forum/components/UserPage"];var Gt=e.n(Et);const Rt=flarum.core.compat["forum/components/PostsUserPage"];var Bt=function(t){function e(){return t.apply(this,arguments)||this}return o(e,t),e.prototype.loadResults=function(t){return l().store.find("posts",{filter:{type:"comment",voted:this.user.id()},page:{offset:t,limit:this.loadLimit},sort:"-createdAt"})},e}(e.n(Rt)()),Dt={RankingsPage:D,VoteNotification:wt,VotesModal:K,Voters:St};function Mt(){return Mt=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\"];\n\nfunction _regeneratorRuntime() {\n \"use strict\";\n /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */\n\n module.exports = _regeneratorRuntime = function _regeneratorRuntime() {\n return exports;\n }, module.exports.__esModule = true, module.exports[\"default\"] = module.exports;\n var exports = {},\n Op = Object.prototype,\n hasOwn = Op.hasOwnProperty,\n $Symbol = \"function\" == typeof Symbol ? Symbol : {},\n iteratorSymbol = $Symbol.iterator || \"@@iterator\",\n asyncIteratorSymbol = $Symbol.asyncIterator || \"@@asyncIterator\",\n toStringTagSymbol = $Symbol.toStringTag || \"@@toStringTag\";\n\n function define(obj, key, value) {\n return Object.defineProperty(obj, key, {\n value: value,\n enumerable: !0,\n configurable: !0,\n writable: !0\n }), obj[key];\n }\n\n try {\n define({}, \"\");\n } catch (err) {\n define = function define(obj, key, value) {\n return obj[key] = value;\n };\n }\n\n function wrap(innerFn, outerFn, self, tryLocsList) {\n var protoGenerator = outerFn && outerFn.prototype instanceof Generator ? outerFn : Generator,\n generator = Object.create(protoGenerator.prototype),\n context = new Context(tryLocsList || []);\n return generator._invoke = function (innerFn, self, context) {\n var state = \"suspendedStart\";\n return function (method, arg) {\n if (\"executing\" === state) throw new Error(\"Generator is already running\");\n\n if (\"completed\" === state) {\n if (\"throw\" === method) throw arg;\n return doneResult();\n }\n\n for (context.method = method, context.arg = arg;;) {\n var delegate = context.delegate;\n\n if (delegate) {\n var delegateResult = maybeInvokeDelegate(delegate, context);\n\n if (delegateResult) {\n if (delegateResult === ContinueSentinel) continue;\n return delegateResult;\n }\n }\n\n if (\"next\" === context.method) context.sent = context._sent = context.arg;else if (\"throw\" === context.method) {\n if (\"suspendedStart\" === state) throw state = \"completed\", context.arg;\n context.dispatchException(context.arg);\n } else \"return\" === context.method && context.abrupt(\"return\", context.arg);\n state = \"executing\";\n var record = tryCatch(innerFn, self, context);\n\n if (\"normal\" === record.type) {\n if (state = context.done ? \"completed\" : \"suspendedYield\", record.arg === ContinueSentinel) continue;\n return {\n value: record.arg,\n done: context.done\n };\n }\n\n \"throw\" === record.type && (state = \"completed\", context.method = \"throw\", context.arg = record.arg);\n }\n };\n }(innerFn, self, context), generator;\n }\n\n function tryCatch(fn, obj, arg) {\n try {\n return {\n type: \"normal\",\n arg: fn.call(obj, arg)\n };\n } catch (err) {\n return {\n type: \"throw\",\n arg: err\n };\n }\n }\n\n exports.wrap = wrap;\n var ContinueSentinel = {};\n\n function Generator() {}\n\n function GeneratorFunction() {}\n\n function GeneratorFunctionPrototype() {}\n\n var IteratorPrototype = {};\n define(IteratorPrototype, iteratorSymbol, function () {\n return this;\n });\n var getProto = Object.getPrototypeOf,\n NativeIteratorPrototype = getProto && getProto(getProto(values([])));\n NativeIteratorPrototype && NativeIteratorPrototype !== Op && hasOwn.call(NativeIteratorPrototype, iteratorSymbol) && (IteratorPrototype = NativeIteratorPrototype);\n var Gp = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(IteratorPrototype);\n\n function defineIteratorMethods(prototype) {\n [\"next\", \"throw\", \"return\"].forEach(function (method) {\n define(prototype, method, function (arg) {\n return this._invoke(method, arg);\n });\n });\n }\n\n function AsyncIterator(generator, PromiseImpl) {\n function invoke(method, arg, resolve, reject) {\n var record = tryCatch(generator[method], generator, arg);\n\n if (\"throw\" !== record.type) {\n var result = record.arg,\n value = result.value;\n return value && \"object\" == _typeof(value) && hasOwn.call(value, \"__await\") ? PromiseImpl.resolve(value.__await).then(function (value) {\n invoke(\"next\", value, resolve, reject);\n }, function (err) {\n invoke(\"throw\", err, resolve, reject);\n }) : PromiseImpl.resolve(value).then(function (unwrapped) {\n result.value = unwrapped, resolve(result);\n }, function (error) {\n return invoke(\"throw\", error, resolve, reject);\n });\n }\n\n reject(record.arg);\n }\n\n var previousPromise;\n\n this._invoke = function (method, arg) {\n function callInvokeWithMethodAndArg() {\n return new PromiseImpl(function (resolve, reject) {\n invoke(method, arg, resolve, reject);\n });\n }\n\n return previousPromise = previousPromise ? previousPromise.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg();\n };\n }\n\n function maybeInvokeDelegate(delegate, context) {\n var method = delegate.iterator[context.method];\n\n if (undefined === method) {\n if (context.delegate = null, \"throw\" === context.method) {\n if (delegate.iterator[\"return\"] && (context.method = \"return\", context.arg = undefined, maybeInvokeDelegate(delegate, context), \"throw\" === context.method)) return ContinueSentinel;\n context.method = \"throw\", context.arg = new TypeError(\"The iterator does not provide a 'throw' method\");\n }\n\n return ContinueSentinel;\n }\n\n var record = tryCatch(method, delegate.iterator, context.arg);\n if (\"throw\" === record.type) return context.method = \"throw\", context.arg = record.arg, context.delegate = null, ContinueSentinel;\n var info = record.arg;\n return info ? info.done ? (context[delegate.resultName] = info.value, context.next = delegate.nextLoc, \"return\" !== context.method && (context.method = \"next\", context.arg = undefined), context.delegate = null, ContinueSentinel) : info : (context.method = \"throw\", context.arg = new TypeError(\"iterator result is not an object\"), context.delegate = null, ContinueSentinel);\n }\n\n function pushTryEntry(locs) {\n var entry = {\n tryLoc: locs[0]\n };\n 1 in locs && (entry.catchLoc = locs[1]), 2 in locs && (entry.finallyLoc = locs[2], entry.afterLoc = locs[3]), this.tryEntries.push(entry);\n }\n\n function resetTryEntry(entry) {\n var record = entry.completion || {};\n record.type = \"normal\", delete record.arg, entry.completion = record;\n }\n\n function Context(tryLocsList) {\n this.tryEntries = [{\n tryLoc: \"root\"\n }], tryLocsList.forEach(pushTryEntry, this), this.reset(!0);\n }\n\n function values(iterable) {\n if (iterable) {\n var iteratorMethod = iterable[iteratorSymbol];\n if (iteratorMethod) return iteratorMethod.call(iterable);\n if (\"function\" == typeof iterable.next) return iterable;\n\n if (!isNaN(iterable.length)) {\n var i = -1,\n next = function next() {\n for (; ++i < iterable.length;) {\n if (hasOwn.call(iterable, i)) return next.value = iterable[i], next.done = !1, next;\n }\n\n return next.value = undefined, next.done = !0, next;\n };\n\n return next.next = next;\n }\n }\n\n return {\n next: doneResult\n };\n }\n\n function doneResult() {\n return {\n value: undefined,\n done: !0\n };\n }\n\n return GeneratorFunction.prototype = GeneratorFunctionPrototype, define(Gp, \"constructor\", GeneratorFunctionPrototype), define(GeneratorFunctionPrototype, \"constructor\", GeneratorFunction), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, toStringTagSymbol, \"GeneratorFunction\"), exports.isGeneratorFunction = function (genFun) {\n var ctor = \"function\" == typeof genFun && genFun.constructor;\n return !!ctor && (ctor === GeneratorFunction || \"GeneratorFunction\" === (ctor.displayName || ctor.name));\n }, exports.mark = function (genFun) {\n return Object.setPrototypeOf ? Object.setPrototypeOf(genFun, GeneratorFunctionPrototype) : (genFun.__proto__ = GeneratorFunctionPrototype, define(genFun, toStringTagSymbol, \"GeneratorFunction\")), genFun.prototype = Object.create(Gp), genFun;\n }, exports.awrap = function (arg) {\n return {\n __await: arg\n };\n }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, asyncIteratorSymbol, function () {\n return this;\n }), exports.AsyncIterator = AsyncIterator, exports.async = function (innerFn, outerFn, self, tryLocsList, PromiseImpl) {\n void 0 === PromiseImpl && (PromiseImpl = Promise);\n var iter = new AsyncIterator(wrap(innerFn, outerFn, self, tryLocsList), PromiseImpl);\n return exports.isGeneratorFunction(outerFn) ? iter : iter.next().then(function (result) {\n return result.done ? result.value : iter.next();\n });\n }, defineIteratorMethods(Gp), define(Gp, toStringTagSymbol, \"Generator\"), define(Gp, iteratorSymbol, function () {\n return this;\n }), define(Gp, \"toString\", function () {\n return \"[object Generator]\";\n }), exports.keys = function (object) {\n var keys = [];\n\n for (var key in object) {\n keys.push(key);\n }\n\n return keys.reverse(), function next() {\n for (; keys.length;) {\n var key = keys.pop();\n if (key in object) return next.value = key, next.done = !1, next;\n }\n\n return next.done = !0, next;\n };\n }, exports.values = values, Context.prototype = {\n constructor: Context,\n reset: function reset(skipTempReset) {\n if (this.prev = 0, this.next = 0, this.sent = this._sent = undefined, this.done = !1, this.delegate = null, this.method = \"next\", this.arg = undefined, this.tryEntries.forEach(resetTryEntry), !skipTempReset) for (var name in this) {\n \"t\" === name.charAt(0) && hasOwn.call(this, name) && !isNaN(+name.slice(1)) && (this[name] = undefined);\n }\n },\n stop: function stop() {\n this.done = !0;\n var rootRecord = this.tryEntries[0].completion;\n if (\"throw\" === rootRecord.type) throw rootRecord.arg;\n return this.rval;\n },\n dispatchException: function dispatchException(exception) {\n if (this.done) throw exception;\n var context = this;\n\n function handle(loc, caught) {\n return record.type = \"throw\", record.arg = exception, context.next = loc, caught && (context.method = \"next\", context.arg = undefined), !!caught;\n }\n\n for (var i = this.tryEntries.length - 1; i >= 0; --i) {\n var entry = this.tryEntries[i],\n record = entry.completion;\n if (\"root\" === entry.tryLoc) return handle(\"end\");\n\n if (entry.tryLoc <= this.prev) {\n var hasCatch = hasOwn.call(entry, \"catchLoc\"),\n hasFinally = hasOwn.call(entry, \"finallyLoc\");\n\n if (hasCatch && hasFinally) {\n if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0);\n if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc);\n } else if (hasCatch) {\n if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0);\n } else {\n if (!hasFinally) throw new Error(\"try statement without catch or finally\");\n if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc);\n }\n }\n }\n },\n abrupt: function abrupt(type, arg) {\n for (var i = this.tryEntries.length - 1; i >= 0; --i) {\n var entry = this.tryEntries[i];\n\n if (entry.tryLoc <= this.prev && hasOwn.call(entry, \"finallyLoc\") && this.prev < entry.finallyLoc) {\n var finallyEntry = entry;\n break;\n }\n }\n\n finallyEntry && (\"break\" === type || \"continue\" === type) && finallyEntry.tryLoc <= arg && arg <= finallyEntry.finallyLoc && (finallyEntry = null);\n var record = finallyEntry ? finallyEntry.completion : {};\n return record.type = type, record.arg = arg, finallyEntry ? (this.method = \"next\", this.next = finallyEntry.finallyLoc, ContinueSentinel) : this.complete(record);\n },\n complete: function complete(record, afterLoc) {\n if (\"throw\" === record.type) throw record.arg;\n return \"break\" === record.type || \"continue\" === record.type ? this.next = record.arg : \"return\" === record.type ? (this.rval = this.arg = record.arg, this.method = \"return\", this.next = \"end\") : \"normal\" === record.type && afterLoc && (this.next = afterLoc), ContinueSentinel;\n },\n finish: function finish(finallyLoc) {\n for (var i = this.tryEntries.length - 1; i >= 0; --i) {\n var entry = this.tryEntries[i];\n if (entry.finallyLoc === finallyLoc) return this.complete(entry.completion, entry.afterLoc), resetTryEntry(entry), ContinueSentinel;\n }\n },\n \"catch\": function _catch(tryLoc) {\n for (var i = this.tryEntries.length - 1; i >= 0; --i) {\n var entry = this.tryEntries[i];\n\n if (entry.tryLoc === tryLoc) {\n var record = entry.completion;\n\n if (\"throw\" === record.type) {\n var thrown = record.arg;\n resetTryEntry(entry);\n }\n\n return thrown;\n }\n }\n\n throw new Error(\"illegal catch attempt\");\n },\n delegateYield: function delegateYield(iterable, resultName, nextLoc) {\n return this.delegate = {\n iterator: values(iterable),\n resultName: resultName,\n nextLoc: nextLoc\n }, \"next\" === this.method && (this.arg = undefined), ContinueSentinel;\n }\n }, exports;\n}\n\nmodule.exports = _regeneratorRuntime, module.exports.__esModule = true, module.exports[\"default\"] = module.exports;","function _typeof(obj) {\n \"@babel/helpers - typeof\";\n\n return (module.exports = _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (obj) {\n return typeof obj;\n } : function (obj) {\n return obj && \"function\" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj;\n }, module.exports.__esModule = true, module.exports[\"default\"] = module.exports), _typeof(obj);\n}\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};","export default function _setPrototypeOf(o, p) {\n _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) {\n o.__proto__ = p;\n return o;\n };\n return _setPrototypeOf(o, p);\n}","import setPrototypeOf from \"./setPrototypeOf.js\";\nexport default function _inheritsLoose(subClass, superClass) {\n subClass.prototype = Object.create(superClass.prototype);\n subClass.prototype.constructor = subClass;\n setPrototypeOf(subClass, superClass);\n}","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/Model'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/utils/mixin'];","import Model from 'flarum/common/Model';\nimport mixin from 'flarum/common/utils/mixin';\n\nexport default class Rank extends mixin(Model, {\n points: Model.attribute('points'),\n name: Model.attribute('name'),\n color: Model.attribute('color'),\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/models/Discussion'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/models/Post'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/models/User'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/helpers/avatar'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/components/Page'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['forum/components/IndexPage'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/components/Button'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/components/LoadingIndicator'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/helpers/listItems'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/helpers/username'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/helpers/icon'];","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['common/components/Link'];","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 icon from 'flarum/common/helpers/icon';\nimport setting from '../helpers/setting';\nimport Link from 'flarum/common/components/Link';\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 setting('customRankingImages', true) ? (\n \n ) : (\n \n )\n ) : (\n \n )}\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')}
{icon('fas fa-trophy')}{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/extend'];","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['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'];","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","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['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","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 matchTag = (tagName) => {\n return (node) => node && node.tag && node.tag === tagName;\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(matchTag('h3'));\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","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(gen, resolve, reject, _next, _throw, key, arg) {\n try {\n var info = gen[key](arg);\n var value = info.value;\n } catch (error) {\n reject(error);\n return;\n }\n\n if (info.done) {\n resolve(value);\n } else {\n Promise.resolve(value).then(_next, _throw);\n }\n}\n\nexport default function _asyncToGenerator(fn) {\n return function () {\n var self = this,\n args = arguments;\n return new Promise(function (resolve, reject) {\n var gen = fn.apply(self, args);\n\n function _next(value) {\n asyncGeneratorStep(gen, resolve, reject, _next, _throw, \"next\", value);\n }\n\n function _throw(err) {\n asyncGeneratorStep(gen, resolve, reject, _next, _throw, \"throw\", err);\n }\n\n _next(undefined);\n });\n };\n}","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","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","export default function _extends() {\n _extends = Object.assign ? Object.assign.bind() : function (target) {\n for (var i = 1; i < arguments.length; i++) {\n var source = arguments[i];\n\n for (var key in source) {\n if (Object.prototype.hasOwnProperty.call(source, key)) {\n target[key] = source[key];\n }\n }\n }\n\n return target;\n };\n return _extends.apply(this, arguments);\n}","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';\nimport Model from 'flarum/common/Model';\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\nimport RankingsPage from './components/RankingsPage';\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\napp.initializers.add('fof-gamification', (app) => {\n Discussion.prototype.votes = Model.attribute('votes');\n Discussion.prototype.hasUpvoted = Model.attribute('hasUpvoted');\n Discussion.prototype.hasDownvoted = Model.attribute('hasDownvoted');\n Discussion.prototype.canVote = Model.attribute('canVote');\n Discussion.prototype.seeVotes = Model.attribute('seeVotes');\n\n User.prototype.points = Model.attribute('points');\n User.prototype.ranks = Model.hasMany('ranks');\n\n Post.prototype.upvotes = Model.hasMany('upvotes');\n Post.prototype.downvotes = Model.hasMany('downvotes');\n\n Post.prototype.votes = Model.attribute('votes');\n Post.prototype.canVote = Model.attribute('canVote');\n Post.prototype.canSeeVotes = Model.attribute('canSeeVotes');\n Post.prototype.hasUpvoted = Model.attribute('hasUpvoted');\n Post.prototype.hasDownvoted = Model.attribute('hasDownvoted');\n Post.prototype.seeVoters = Model.attribute('seeVoters');\n\n app.store.models.ranks = Rank;\n\n app.routes.rankings = { path: '/rankings', component: RankingsPage };\n\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 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) {\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\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?.() && !!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","leadingEdge","setTimeout","timerExpired","shouldInvoke","timeSinceLastCall","trailingEdge","remainingWait","debounced","isInvoking","arguments","this","cancel","clearTimeout","flush","_typeof","require","_regeneratorRuntime","__esModule","Op","hasOwn","hasOwnProperty","$Symbol","Symbol","iteratorSymbol","iterator","asyncIteratorSymbol","asyncIterator","toStringTagSymbol","toStringTag","define","obj","key","defineProperty","enumerable","configurable","writable","err","wrap","innerFn","outerFn","tryLocsList","protoGenerator","Generator","generator","create","context","Context","_invoke","state","method","arg","Error","done","delegate","delegateResult","maybeInvokeDelegate","ContinueSentinel","sent","_sent","dispatchException","abrupt","record","tryCatch","fn","GeneratorFunction","GeneratorFunctionPrototype","IteratorPrototype","getProto","getPrototypeOf","NativeIteratorPrototype","values","Gp","defineIteratorMethods","forEach","AsyncIterator","PromiseImpl","invoke","resolve","reject","__await","then","unwrapped","error","previousPromise","callInvokeWithMethodAndArg","info","resultName","next","nextLoc","pushTryEntry","locs","entry","tryLoc","catchLoc","finallyLoc","afterLoc","tryEntries","push","resetTryEntry","completion","reset","iterable","iteratorMethod","isNaN","length","i","doneResult","displayName","isGeneratorFunction","genFun","ctor","constructor","name","mark","setPrototypeOf","__proto__","awrap","async","Promise","iter","keys","object","reverse","pop","skipTempReset","prev","charAt","stop","rootRecord","rval","exception","handle","loc","caught","hasCatch","hasFinally","finallyEntry","complete","finish","thrown","delegateYield","runtime","regeneratorRuntime","accidentalStrictMode","globalThis","__webpack_module_cache__","__webpack_require__","moduleId","cachedModule","__webpack_modules__","n","getter","d","a","definition","o","get","g","e","window","prop","r","_setPrototypeOf","p","bind","_inheritsLoose","subClass","superClass","flarum","core","compat","Rank","mixin","Model","points","color","models","isBool","val","app","RankingsPage","oninit","vnode","m","route","set","loading","users","refresh","view","LoadingIndicator","Button","className","onclick","loadMore","IndexPage","listItems","toArray","class","map","user","setting","src","icon","addOrdinalSuffix","href","force","avatar","username","clear","loadResults","results","parseResults","redraw","j","k","offset","params","page","limit","sort","b","parseFloat","Page","VotesModal","title","attrs","post","upvotes","downvotes","load","content","voters","id","include","loaded","Modal","upvoted","downvoted","discussion","canVote","save","pushAttributes","votes","DiscussionControls","rankLabel","rank","style","backgroundColor","matchClass","node","String","split","includes","findMatchClass","arr","children","Array","isArray","nodeInChildren","find","currentValue","extend","UserCard","items","add","count","profile_node","amt","Number","badges_node","ranks","splice","PostUser","header_node","tag","concat","filter","el","fetch","postId","firstPost","UpvotedNotification","notification","subject","fromUser","excerpt","contentPlain","Notification","asyncGeneratorStep","gen","_next","_throw","Voters","subtreeRetainer","lastRenderVotes","SubtreeRetainer","onbeforeupdate","needsRebuild","onupdate","display","slug","text","Component","VotesUserPage","voted","loadLimit","PostsUserPage","components","VoteNotification","_extends","assign","target","source","helpers","saveVote","Discussion","User","Post","store","routes","rankings","path","component","PostControls","seeVoters","CommentPost","hasDownvoted","hasUpvoted","upVotesOnly","canSeeVotes","voteLoading","classList","disabled","LinkButton","DiscussionListState","hot","addUserInfo","DiscussionListItem","seeVotes","abbreviateNumber","DiscussionPage","channels","pusher","data","post_id","userId","user_id","debounce","unbind","NotificationGrid","label","posts","UserPage","subtree","check","vdom","v","upvotesOnly","altIcon","unshift","size","isHidden","remove","classes"],"sourceRoot":""} \ No newline at end of file +{"version":3,"file":"forum.js","mappings":";2BAUA,IASIA,EAAS,aAGTC,EAAa,qBAGbC,EAAa,aAGbC,EAAY,cAGZC,EAAeC,SAGfC,EAA8B,iBAAVC,EAAAA,GAAsBA,EAAAA,GAAUA,EAAAA,EAAOC,SAAWA,QAAUD,EAAAA,EAGhFE,EAA0B,iBAARC,MAAoBA,MAAQA,KAAKF,SAAWA,QAAUE,KAGxEC,EAAOL,GAAcG,GAAYG,SAAS,cAATA,GAUjCC,EAPcL,OAAOM,UAOQC,SAG7BC,EAAYC,KAAKC,IACjBC,EAAYF,KAAKG,IAkBjBC,EAAM,WACR,OAAOV,EAAKW,KAAKD,KAClB,EA2MD,SAASE,EAASC,GAChB,IAAIC,SAAcD,EAClB,QAASA,IAAkB,UAARC,GAA4B,YAARA,EACxC,CA2ED,SAASC,EAASF,GAChB,GAAoB,iBAATA,EACT,OAAOA,EAET,GAhCF,SAAkBA,GAChB,MAAuB,iBAATA,GAtBhB,SAAsBA,GACpB,QAASA,GAAyB,iBAATA,CAC1B,CAqBIG,CAAaH,IAzTF,mBAyTYX,EAAee,KAAKJ,EAC/C,CA6BKK,CAASL,GACX,OA3VM,IA6VR,GAAID,EAASC,GAAQ,CACnB,IAAIM,EAAgC,mBAAjBN,EAAMO,QAAwBP,EAAMO,UAAYP,EACnEA,EAAQD,EAASO,GAAUA,EAAQ,GAAMA,CAC1C,CACD,GAAoB,iBAATN,EACT,OAAiB,IAAVA,EAAcA,GAASA,EAEhCA,EAAQA,EAAMQ,QAAQhC,EAAQ,IAC9B,IAAIiC,EAAW/B,EAAWgC,KAAKV,GAC/B,OAAQS,GAAY9B,EAAU+B,KAAKV,GAC/BpB,EAAaoB,EAAMW,MAAM,GAAIF,EAAW,EAAI,GAC3ChC,EAAWiC,KAAKV,GAxWb,KAwW6BA,CACt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UAAU,yEACVW,KAAI,gBAAkBA,EAAlB,QACJ,cAAayH,EACbM,UAAW1F,GAAWtO,KAAK8T,YAC3BvI,QAAS,kBAAMA,GAAQ,GAAQmI,EAAtB,EACT,aAAYjJ,IAAAA,WAAAA,MAAqB,iDAIpCzK,KAAK8T,aAAe,EAAC,IAAD,CAAkB5B,QAAQ,SAAS2D,KAAK,WAE/D,IA7C6B,CA+ChC,IRjBF","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/external root \"flarum.core.compat['common/utils/mixin']\"","webpack://@fof/gamification/./src/common/models/Rank.js","webpack://@fof/gamification/./src/common/models/index.js","webpack://@fof/gamification/external root \"flarum.core.compat['forum/app']\"","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/external root \"flarum.core.compat['common/helpers/avatar']\"","webpack://@fof/gamification/external root \"flarum.core.compat['common/components/Page']\"","webpack://@fof/gamification/external root \"flarum.core.compat['forum/components/IndexPage']\"","webpack://@fof/gamification/external root \"flarum.core.compat['common/components/Button']\"","webpack://@fof/gamification/external root \"flarum.core.compat['common/components/LoadingIndicator']\"","webpack://@fof/gamification/external root \"flarum.core.compat['common/helpers/listItems']\"","webpack://@fof/gamification/external root \"flarum.core.compat['common/helpers/username']\"","webpack://@fof/gamification/external root \"flarum.core.compat['common/helpers/icon']\"","webpack://@fof/gamification/./src/forum/helpers/setting.js","webpack://@fof/gamification/external root \"flarum.core.compat['common/components/Link']\"","webpack://@fof/gamification/./src/forum/components/RankingsPage.js","webpack://@fof/gamification/external root \"flarum.core.compat['common/extend']\"","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['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/./src/forum/components/VotesModal.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['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/./src/forum/addUserInfo.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/./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.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\"];\n\nfunction _regeneratorRuntime() {\n \"use strict\";\n /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */\n\n module.exports = _regeneratorRuntime = function _regeneratorRuntime() {\n return exports;\n }, module.exports.__esModule = true, module.exports[\"default\"] = module.exports;\n var exports = {},\n Op = Object.prototype,\n hasOwn = Op.hasOwnProperty,\n $Symbol = \"function\" == typeof Symbol ? Symbol : {},\n iteratorSymbol = $Symbol.iterator || \"@@iterator\",\n asyncIteratorSymbol = $Symbol.asyncIterator || \"@@asyncIterator\",\n toStringTagSymbol = $Symbol.toStringTag || \"@@toStringTag\";\n\n function define(obj, key, value) {\n return Object.defineProperty(obj, key, {\n value: value,\n enumerable: !0,\n configurable: !0,\n writable: !0\n }), obj[key];\n }\n\n try {\n define({}, \"\");\n } catch (err) {\n define = function define(obj, key, value) {\n return obj[key] = value;\n };\n }\n\n function wrap(innerFn, outerFn, self, tryLocsList) {\n var protoGenerator = outerFn && outerFn.prototype instanceof Generator ? outerFn : Generator,\n generator = Object.create(protoGenerator.prototype),\n context = new Context(tryLocsList || []);\n return generator._invoke = function (innerFn, self, context) {\n var state = \"suspendedStart\";\n return function (method, arg) {\n if (\"executing\" === state) throw new Error(\"Generator is already running\");\n\n if (\"completed\" === state) {\n if (\"throw\" === method) throw arg;\n return doneResult();\n }\n\n for (context.method = method, context.arg = arg;;) {\n var delegate = context.delegate;\n\n if (delegate) {\n var delegateResult = maybeInvokeDelegate(delegate, context);\n\n if (delegateResult) {\n if (delegateResult === ContinueSentinel) continue;\n return delegateResult;\n }\n }\n\n if (\"next\" === context.method) context.sent = context._sent = context.arg;else if (\"throw\" === context.method) {\n if (\"suspendedStart\" === state) throw state = \"completed\", context.arg;\n context.dispatchException(context.arg);\n } else \"return\" === context.method && context.abrupt(\"return\", context.arg);\n state = \"executing\";\n var record = tryCatch(innerFn, self, context);\n\n if (\"normal\" === record.type) {\n if (state = context.done ? \"completed\" : \"suspendedYield\", record.arg === ContinueSentinel) continue;\n return {\n value: record.arg,\n done: context.done\n };\n }\n\n \"throw\" === record.type && (state = \"completed\", context.method = \"throw\", context.arg = record.arg);\n }\n };\n }(innerFn, self, context), generator;\n }\n\n function tryCatch(fn, obj, arg) {\n try {\n return {\n type: \"normal\",\n arg: fn.call(obj, arg)\n };\n } catch (err) {\n return {\n type: \"throw\",\n arg: err\n };\n }\n }\n\n exports.wrap = wrap;\n var ContinueSentinel = {};\n\n function Generator() {}\n\n function GeneratorFunction() {}\n\n function GeneratorFunctionPrototype() {}\n\n var IteratorPrototype = {};\n define(IteratorPrototype, iteratorSymbol, function () {\n return this;\n });\n var getProto = Object.getPrototypeOf,\n NativeIteratorPrototype = getProto && getProto(getProto(values([])));\n NativeIteratorPrototype && NativeIteratorPrototype !== Op && hasOwn.call(NativeIteratorPrototype, iteratorSymbol) && (IteratorPrototype = NativeIteratorPrototype);\n var Gp = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(IteratorPrototype);\n\n function defineIteratorMethods(prototype) {\n [\"next\", \"throw\", \"return\"].forEach(function (method) {\n define(prototype, method, function (arg) {\n return this._invoke(method, arg);\n });\n });\n }\n\n function AsyncIterator(generator, PromiseImpl) {\n function invoke(method, arg, resolve, reject) {\n var record = tryCatch(generator[method], generator, arg);\n\n if (\"throw\" !== record.type) {\n var result = record.arg,\n value = result.value;\n return value && \"object\" == _typeof(value) && hasOwn.call(value, \"__await\") ? PromiseImpl.resolve(value.__await).then(function (value) {\n invoke(\"next\", value, resolve, reject);\n }, function (err) {\n invoke(\"throw\", err, resolve, reject);\n }) : PromiseImpl.resolve(value).then(function (unwrapped) {\n result.value = unwrapped, resolve(result);\n }, function (error) {\n return invoke(\"throw\", error, resolve, reject);\n });\n }\n\n reject(record.arg);\n }\n\n var previousPromise;\n\n this._invoke = function (method, arg) {\n function callInvokeWithMethodAndArg() {\n return new PromiseImpl(function (resolve, reject) {\n invoke(method, arg, resolve, reject);\n });\n }\n\n return previousPromise = previousPromise ? previousPromise.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg();\n };\n }\n\n function maybeInvokeDelegate(delegate, context) {\n var method = delegate.iterator[context.method];\n\n if (undefined === method) {\n if (context.delegate = null, \"throw\" === context.method) {\n if (delegate.iterator[\"return\"] && (context.method = \"return\", context.arg = undefined, maybeInvokeDelegate(delegate, context), \"throw\" === context.method)) return ContinueSentinel;\n context.method = \"throw\", context.arg = new TypeError(\"The iterator does not provide a 'throw' method\");\n }\n\n return ContinueSentinel;\n }\n\n var record = tryCatch(method, delegate.iterator, context.arg);\n if (\"throw\" === record.type) return context.method = \"throw\", context.arg = record.arg, context.delegate = null, ContinueSentinel;\n var info = record.arg;\n return info ? info.done ? (context[delegate.resultName] = info.value, context.next = delegate.nextLoc, \"return\" !== context.method && (context.method = \"next\", context.arg = undefined), context.delegate = null, ContinueSentinel) : info : (context.method = \"throw\", context.arg = new TypeError(\"iterator result is not an object\"), context.delegate = null, ContinueSentinel);\n }\n\n function pushTryEntry(locs) {\n var entry = {\n tryLoc: locs[0]\n };\n 1 in locs && (entry.catchLoc = locs[1]), 2 in locs && (entry.finallyLoc = locs[2], entry.afterLoc = locs[3]), this.tryEntries.push(entry);\n }\n\n function resetTryEntry(entry) {\n var record = entry.completion || {};\n record.type = \"normal\", delete record.arg, entry.completion = record;\n }\n\n function Context(tryLocsList) {\n this.tryEntries = [{\n tryLoc: \"root\"\n }], tryLocsList.forEach(pushTryEntry, this), this.reset(!0);\n }\n\n function values(iterable) {\n if (iterable) {\n var iteratorMethod = iterable[iteratorSymbol];\n if (iteratorMethod) return iteratorMethod.call(iterable);\n if (\"function\" == typeof iterable.next) return iterable;\n\n if (!isNaN(iterable.length)) {\n var i = -1,\n next = function next() {\n for (; ++i < iterable.length;) {\n if (hasOwn.call(iterable, i)) return next.value = iterable[i], next.done = !1, next;\n }\n\n return next.value = undefined, next.done = !0, next;\n };\n\n return next.next = next;\n }\n }\n\n return {\n next: doneResult\n };\n }\n\n function doneResult() {\n return {\n value: undefined,\n done: !0\n };\n }\n\n return GeneratorFunction.prototype = GeneratorFunctionPrototype, define(Gp, \"constructor\", GeneratorFunctionPrototype), define(GeneratorFunctionPrototype, \"constructor\", GeneratorFunction), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, toStringTagSymbol, \"GeneratorFunction\"), exports.isGeneratorFunction = function (genFun) {\n var ctor = \"function\" == typeof genFun && genFun.constructor;\n return !!ctor && (ctor === GeneratorFunction || \"GeneratorFunction\" === (ctor.displayName || ctor.name));\n }, exports.mark = function (genFun) {\n return Object.setPrototypeOf ? Object.setPrototypeOf(genFun, GeneratorFunctionPrototype) : (genFun.__proto__ = GeneratorFunctionPrototype, define(genFun, toStringTagSymbol, \"GeneratorFunction\")), genFun.prototype = Object.create(Gp), genFun;\n }, exports.awrap = function (arg) {\n return {\n __await: arg\n };\n }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, asyncIteratorSymbol, function () {\n return this;\n }), exports.AsyncIterator = AsyncIterator, exports.async = function (innerFn, outerFn, self, tryLocsList, PromiseImpl) {\n void 0 === PromiseImpl && (PromiseImpl = Promise);\n var iter = new AsyncIterator(wrap(innerFn, outerFn, self, tryLocsList), PromiseImpl);\n return exports.isGeneratorFunction(outerFn) ? iter : iter.next().then(function (result) {\n return result.done ? result.value : iter.next();\n });\n }, defineIteratorMethods(Gp), define(Gp, toStringTagSymbol, \"Generator\"), define(Gp, iteratorSymbol, function () {\n return this;\n }), define(Gp, \"toString\", function () {\n return \"[object Generator]\";\n }), exports.keys = function (object) {\n var keys = [];\n\n for (var key in object) {\n keys.push(key);\n }\n\n return keys.reverse(), function next() {\n for (; keys.length;) {\n var key = keys.pop();\n if (key in object) return next.value = key, next.done = !1, next;\n }\n\n return next.done = !0, next;\n };\n }, exports.values = values, Context.prototype = {\n constructor: Context,\n reset: function reset(skipTempReset) {\n if (this.prev = 0, this.next = 0, this.sent = this._sent = undefined, this.done = !1, this.delegate = null, this.method = \"next\", this.arg = undefined, this.tryEntries.forEach(resetTryEntry), !skipTempReset) for (var name in this) {\n \"t\" === name.charAt(0) && hasOwn.call(this, name) && !isNaN(+name.slice(1)) && (this[name] = undefined);\n }\n },\n stop: function stop() {\n this.done = !0;\n var rootRecord = this.tryEntries[0].completion;\n if (\"throw\" === rootRecord.type) throw rootRecord.arg;\n return this.rval;\n },\n dispatchException: function dispatchException(exception) {\n if (this.done) throw exception;\n var context = this;\n\n function handle(loc, caught) {\n return record.type = \"throw\", record.arg = exception, context.next = loc, caught && (context.method = \"next\", context.arg = undefined), !!caught;\n }\n\n for (var i = this.tryEntries.length - 1; i >= 0; --i) {\n var entry = this.tryEntries[i],\n record = entry.completion;\n if (\"root\" === entry.tryLoc) return handle(\"end\");\n\n if (entry.tryLoc <= this.prev) {\n var hasCatch = hasOwn.call(entry, \"catchLoc\"),\n hasFinally = hasOwn.call(entry, \"finallyLoc\");\n\n if (hasCatch && hasFinally) {\n if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0);\n if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc);\n } else if (hasCatch) {\n if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0);\n } else {\n if (!hasFinally) throw new Error(\"try statement without catch or finally\");\n if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc);\n }\n }\n }\n },\n abrupt: function abrupt(type, arg) {\n for (var i = this.tryEntries.length - 1; i >= 0; --i) {\n var entry = this.tryEntries[i];\n\n if (entry.tryLoc <= this.prev && hasOwn.call(entry, \"finallyLoc\") && this.prev < entry.finallyLoc) {\n var finallyEntry = entry;\n break;\n }\n }\n\n finallyEntry && (\"break\" === type || \"continue\" === type) && finallyEntry.tryLoc <= arg && arg <= finallyEntry.finallyLoc && (finallyEntry = null);\n var record = finallyEntry ? finallyEntry.completion : {};\n return record.type = type, record.arg = arg, finallyEntry ? (this.method = \"next\", this.next = finallyEntry.finallyLoc, ContinueSentinel) : this.complete(record);\n },\n complete: function complete(record, afterLoc) {\n if (\"throw\" === record.type) throw record.arg;\n return \"break\" === record.type || \"continue\" === record.type ? this.next = record.arg : \"return\" === record.type ? (this.rval = this.arg = record.arg, this.method = \"return\", this.next = \"end\") : \"normal\" === record.type && afterLoc && (this.next = afterLoc), ContinueSentinel;\n },\n finish: function finish(finallyLoc) {\n for (var i = this.tryEntries.length - 1; i >= 0; --i) {\n var entry = this.tryEntries[i];\n if (entry.finallyLoc === finallyLoc) return this.complete(entry.completion, entry.afterLoc), resetTryEntry(entry), ContinueSentinel;\n }\n },\n \"catch\": function _catch(tryLoc) {\n for (var i = this.tryEntries.length - 1; i >= 0; --i) {\n var entry = this.tryEntries[i];\n\n if (entry.tryLoc === tryLoc) {\n var record = entry.completion;\n\n if (\"throw\" === record.type) {\n var thrown = record.arg;\n resetTryEntry(entry);\n }\n\n return thrown;\n }\n }\n\n throw new Error(\"illegal catch attempt\");\n },\n delegateYield: function delegateYield(iterable, resultName, nextLoc) {\n return this.delegate = {\n iterator: values(iterable),\n resultName: resultName,\n nextLoc: nextLoc\n }, \"next\" === this.method && (this.arg = undefined), ContinueSentinel;\n }\n }, exports;\n}\n\nmodule.exports = _regeneratorRuntime, module.exports.__esModule = true, module.exports[\"default\"] = module.exports;","function _typeof(obj) {\n \"@babel/helpers - typeof\";\n\n return (module.exports = _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (obj) {\n return typeof obj;\n } : function (obj) {\n return obj && \"function\" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj;\n }, module.exports.__esModule = true, module.exports[\"default\"] = module.exports), _typeof(obj);\n}\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};","export default function _setPrototypeOf(o, p) {\n _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) {\n o.__proto__ = p;\n return o;\n };\n return _setPrototypeOf(o, p);\n}","import setPrototypeOf from \"./setPrototypeOf.js\";\nexport default function _inheritsLoose(subClass, superClass) {\n subClass.prototype = Object.create(superClass.prototype);\n subClass.prototype.constructor = subClass;\n setPrototypeOf(subClass, superClass);\n}","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/Model'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/utils/mixin'];","import Model from 'flarum/common/Model';\nimport mixin from 'flarum/common/utils/mixin';\n\nexport default class Rank extends mixin(Model, {\n points: Model.attribute('points'),\n name: Model.attribute('name'),\n color: Model.attribute('color'),\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/models/Discussion'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/models/Post'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/models/User'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/helpers/avatar'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/components/Page'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['forum/components/IndexPage'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/components/Button'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/components/LoadingIndicator'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/helpers/listItems'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/helpers/username'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/helpers/icon'];","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['common/components/Link'];","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 icon from 'flarum/common/helpers/icon';\nimport setting from '../helpers/setting';\nimport Link from 'flarum/common/components/Link';\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 setting('customRankingImages', true) ? (\n \n ) : (\n \n )\n ) : (\n \n )}\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')}
    {icon('fas fa-trophy')}{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/extend'];","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['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'];","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","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['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","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 matchTag = (tagName) => {\n return (node) => node && node.tag && node.tag === tagName;\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(matchTag('h3'));\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","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(gen, resolve, reject, _next, _throw, key, arg) {\n try {\n var info = gen[key](arg);\n var value = info.value;\n } catch (error) {\n reject(error);\n return;\n }\n\n if (info.done) {\n resolve(value);\n } else {\n Promise.resolve(value).then(_next, _throw);\n }\n}\n\nexport default function _asyncToGenerator(fn) {\n return function () {\n var self = this,\n args = arguments;\n return new Promise(function (resolve, reject) {\n var gen = fn.apply(self, args);\n\n function _next(value) {\n asyncGeneratorStep(gen, resolve, reject, _next, _throw, \"next\", value);\n }\n\n function _throw(err) {\n asyncGeneratorStep(gen, resolve, reject, _next, _throw, \"throw\", err);\n }\n\n _next(undefined);\n });\n };\n}","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","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","export default function _extends() {\n _extends = Object.assign ? Object.assign.bind() : function (target) {\n for (var i = 1; i < arguments.length; i++) {\n var source = arguments[i];\n\n for (var key in source) {\n if (Object.prototype.hasOwnProperty.call(source, key)) {\n target[key] = source[key];\n }\n }\n }\n\n return target;\n };\n return _extends.apply(this, arguments);\n}","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';\nimport Model from 'flarum/common/Model';\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\nimport RankingsPage from './components/RankingsPage';\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\napp.initializers.add('fof-gamification', () => {\n Discussion.prototype.votes = Model.attribute('votes');\n Discussion.prototype.hasUpvoted = Model.attribute('hasUpvoted');\n Discussion.prototype.hasDownvoted = Model.attribute('hasDownvoted');\n Discussion.prototype.canVote = Model.attribute('canVote');\n Discussion.prototype.seeVotes = Model.attribute('seeVotes');\n\n User.prototype.points = Model.attribute('points');\n User.prototype.ranks = Model.hasMany('ranks');\n User.prototype.canHaveVotingNotifications = Model.attribute('canHaveVotingNotifications');\n\n Post.prototype.upvotes = Model.hasMany('upvotes');\n Post.prototype.downvotes = Model.hasMany('downvotes');\n\n Post.prototype.votes = Model.attribute('votes');\n Post.prototype.canVote = Model.attribute('canVote');\n Post.prototype.canSeeVotes = Model.attribute('canSeeVotes');\n Post.prototype.hasUpvoted = Model.attribute('hasUpvoted');\n Post.prototype.hasDownvoted = Model.attribute('hasDownvoted');\n Post.prototype.seeVoters = Model.attribute('seeVoters');\n\n app.store.models.ranks = Rank;\n\n app.routes.rankings = { path: '/rankings', component: RankingsPage };\n\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 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\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?.() && !!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","leadingEdge","setTimeout","timerExpired","shouldInvoke","timeSinceLastCall","trailingEdge","remainingWait","debounced","isInvoking","arguments","this","cancel","clearTimeout","flush","_typeof","require","_regeneratorRuntime","__esModule","Op","hasOwn","hasOwnProperty","$Symbol","Symbol","iteratorSymbol","iterator","asyncIteratorSymbol","asyncIterator","toStringTagSymbol","toStringTag","define","obj","key","defineProperty","enumerable","configurable","writable","err","wrap","innerFn","outerFn","tryLocsList","protoGenerator","Generator","generator","create","context","Context","_invoke","state","method","arg","Error","done","delegate","delegateResult","maybeInvokeDelegate","ContinueSentinel","sent","_sent","dispatchException","abrupt","record","tryCatch","fn","GeneratorFunction","GeneratorFunctionPrototype","IteratorPrototype","getProto","getPrototypeOf","NativeIteratorPrototype","values","Gp","defineIteratorMethods","forEach","AsyncIterator","PromiseImpl","invoke","resolve","reject","__await","then","unwrapped","error","previousPromise","callInvokeWithMethodAndArg","info","resultName","next","nextLoc","pushTryEntry","locs","entry","tryLoc","catchLoc","finallyLoc","afterLoc","tryEntries","push","resetTryEntry","completion","reset","iterable","iteratorMethod","isNaN","length","i","doneResult","displayName","isGeneratorFunction","genFun","ctor","constructor","name","mark","setPrototypeOf","__proto__","awrap","async","Promise","iter","keys","object","reverse","pop","skipTempReset","prev","charAt","stop","rootRecord","rval","exception","handle","loc","caught","hasCatch","hasFinally","finallyEntry","complete","finish","thrown","delegateYield","runtime","regeneratorRuntime","accidentalStrictMode","globalThis","__webpack_module_cache__","__webpack_require__","moduleId","cachedModule","__webpack_modules__","n","getter","d","a","definition","o","get","g","e","window","prop","r","_setPrototypeOf","p","bind","_inheritsLoose","subClass","superClass","flarum","core","compat","Rank","mixin","Model","points","color","models","isBool","val","app","RankingsPage","oninit","vnode","m","route","set","loading","users","refresh","view","LoadingIndicator","Button","className","onclick","loadMore","IndexPage","listItems","toArray","class","map","user","setting","src","icon","addOrdinalSuffix","href","force","avatar","username","clear","loadResults","results","parseResults","redraw","j","k","offset","params","page","limit","sort","b","parseFloat","Page","VotesModal","title","attrs","post","upvotes","downvotes","load","content","voters","id","include","loaded","Modal","upvoted","downvoted","discussion","canVote","save","pushAttributes","votes","DiscussionControls","rankLabel","rank","style","backgroundColor","matchClass","node","String","split","includes","findMatchClass","arr","children","Array","isArray","nodeInChildren","find","currentValue","extend","UserCard","items","add","count","profile_node","amt","Number","badges_node","ranks","splice","PostUser","header_node","tag","concat","filter","el","fetch","postId","firstPost","UpvotedNotification","notification","subject","fromUser","excerpt","contentPlain","Notification","asyncGeneratorStep","gen","_next","_throw","Voters","subtreeRetainer","lastRenderVotes","SubtreeRetainer","onbeforeupdate","needsRebuild","onupdate","display","slug","text","Component","VotesUserPage","voted","loadLimit","PostsUserPage","components","VoteNotification","_extends","assign","target","source","helpers","saveVote","Discussion","User","Post","path","component","PostControls","seeVoters","CommentPost","hasDownvoted","hasUpvoted","upVotesOnly","canSeeVotes","voteLoading","classList","disabled","LinkButton","DiscussionListState","hot","addUserInfo","DiscussionListItem","seeVotes","abbreviateNumber","DiscussionPage","channels","pusher","data","post_id","userId","user_id","debounce","unbind","NotificationGrid","canHaveVotingNotifications","label","posts","UserPage","subtree","check","vdom","v","upvotesOnly","altIcon","unshift","size","isHidden","remove","classes"],"sourceRoot":""} \ No newline at end of file