diff --git a/js/dist/forum.js.map b/js/dist/forum.js.map
index 7309085c..652a3b04 100644
--- a/js/dist/forum.js.map
+++ b/js/dist/forum.js.map
@@ -1 +1 @@
-{"version":3,"file":"forum.js","mappings":"MACA,IAAIA,EAAsB,CCA1BA,EAAyBC,IACxB,IAAIC,EAASD,GAAUA,EAAOE,WAC7B,IAAOF,EAAiB,QACxB,IAAM,EAEP,OADAD,EAAoBI,EAAEF,EAAQ,CAAEG,EAAGH,IAC5BA,CAAM,ECLdF,EAAwB,CAACM,EAASC,KACjC,IAAI,IAAIC,KAAOD,EACXP,EAAoBS,EAAEF,EAAYC,KAASR,EAAoBS,EAAEH,EAASE,IAC5EE,OAAOC,eAAeL,EAASE,EAAK,CAAEI,YAAY,EAAMC,IAAKN,EAAWC,IAE1E,ECNDR,EAAwB,CAACc,EAAKC,IAAUL,OAAOM,UAAUC,eAAeC,KAAKJ,EAAKC,GCClFf,EAAyBM,IACH,oBAAXa,QAA0BA,OAAOC,aAC1CV,OAAOC,eAAeL,EAASa,OAAOC,YAAa,CAAEC,MAAO,WAE7DX,OAAOC,eAAeL,EAAS,aAAc,CAAEe,OAAO,GAAO,G,sFCL9D,MAAM,EAA+BC,OAAOC,KAAKC,OAAO,a,aCAxD,MAAM,EAA+BF,OAAOC,KAAKC,OAAO,iBCAlD,EAA+BF,OAAOC,KAAKC,OAAO,2B,aCAxD,MAAM,EAA+BF,OAAOC,KAAKC,OAAO,mC,aCAxD,MAAM,EAA+BF,OAAOC,KAAKC,OAAO,4B,aCOxD,MCPM,EAA+BF,OAAOC,KAAKC,OAAO,0B,aCAxD,MAAM,EAA+BF,OAAOC,KAAKC,OAAO,uC,aCAxD,MAAM,EAA+BF,OAAOC,KAAKC,OAAO,kC,aCAzC,SAASC,EAAgBhB,EAAGiB,GAKzC,OAJAD,EAAkBf,OAAOiB,eAAiBjB,OAAOiB,eAAeC,OAAS,SAAyBnB,EAAGiB,GAEnG,OADAjB,EAAEoB,UAAYH,EACPjB,CACT,EAC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AC1B,GAAI,OACtB3J,IAAAA,MAAUiE,KAAK9F,EAAiB,CAC9BwE,SAAU,SAACH,GAAI,OACbxC,IAAAA,MACG2F,aAAa,SACbE,KAAK,MAECrD,EAAI,CACPuK,cAAe,CACbpD,KAAAA,KAGJ,CACEnH,KAAM,CACJmC,QAAS,oCAId3B,MAAK,SAAC5D,GAAS,MAGd,OAF6B,OAA7B,EAAAuK,EAAKqD,gBAAgB,WAAc,MAAnC,EAA+BtN,MAA/B,EAA+BA,KAAO,CAAEe,KAAM,QAASiE,GAAItF,EAAKsF,OAEzDtF,CACT,GAAE,GACN,GAEJ8E,EAAAA,EAAAA,QAAO+I,KAAc,sBAAsB,SAAU3M,EAAOqJ,IACrDA,EAAKoC,YAAcpC,EAAKtF,gBAC3B/D,EAAME,IACJ,UACA,EAAC,IAAM,CAACK,KAAK,cAAcC,QAASuK,EAAWzN,KAAKU,KAAMqL,IACvD3J,IAAAA,WAAeC,MAAM,mCAI9B,GD3BF,G","sources":["webpack://@fof/polls/webpack/bootstrap","webpack://@fof/polls/webpack/runtime/compat get default export","webpack://@fof/polls/webpack/runtime/define property getters","webpack://@fof/polls/webpack/runtime/hasOwnProperty shorthand","webpack://@fof/polls/webpack/runtime/make namespace object","webpack://@fof/polls/external root \"flarum.core.compat['forum/app']\"","webpack://@fof/polls/external root \"flarum.core.compat['common/extend']\"","webpack://@fof/polls/external root \"flarum.core.compat['common/components/Badge']\"","webpack://@fof/polls/external root \"flarum.core.compat['forum/components/DiscussionList']\"","webpack://@fof/polls/external root \"flarum.core.compat['common/models/Discussion']\"","webpack://@fof/polls/./src/forum/addDiscussionBadge.js","webpack://@fof/polls/external root \"flarum.core.compat['common/utils/classList']\"","webpack://@fof/polls/external root \"flarum.core.compat['forum/components/DiscussionComposer']\"","webpack://@fof/polls/external root \"flarum.core.compat['forum/components/ReplyComposer']\"","webpack://@fof/polls/./node_modules/@babel/runtime/helpers/esm/setPrototypeOf.js","webpack://@fof/polls/./node_modules/@babel/runtime/helpers/esm/inheritsLoose.js","webpack://@fof/polls/external root \"flarum.core.compat['common/components/Button']\"","webpack://@fof/polls/external root \"flarum.core.compat['common/components/Modal']\"","webpack://@fof/polls/external root \"flarum.core.compat['common/components/Switch']\"","webpack://@fof/polls/external root \"flarum.core.compat['common/utils/ItemList']\"","webpack://@fof/polls/external root \"flarum.core.compat['common/utils/Stream']\"","webpack://@fof/polls/external root \"flarum.core.compat['common/utils/extractText']\"","webpack://@fof/polls/./src/forum/components/CreatePollModal.js","webpack://@fof/polls/./src/forum/addComposerItems.js","webpack://@fof/polls/external root \"flarum.core.compat['forum/components/CommentPost']\"","webpack://@fof/polls/external root \"flarum.core.compat['common/Component']\"","webpack://@fof/polls/external root \"flarum.core.compat['forum/components/LogInModal']\"","webpack://@fof/polls/external root \"flarum.core.compat['common/helpers/avatar']\"","webpack://@fof/polls/external root \"flarum.core.compat['common/helpers/username']\"","webpack://@fof/polls/external root \"flarum.core.compat['common/components/Link']\"","webpack://@fof/polls/external root \"flarum.core.compat['common/components/LoadingIndicator']\"","webpack://@fof/polls/./src/forum/components/ListVotersModal.js","webpack://@fof/polls/external root \"flarum.core.compat['common/components/Tooltip']\"","webpack://@fof/polls/external root \"flarum.core.compat['common/helpers/icon']\"","webpack://@fof/polls/./src/forum/components/EditPollModal.js","webpack://@fof/polls/./src/forum/components/PostPoll.js","webpack://@fof/polls/external root \"flarum.core.compat['forum/components/DiscussionPage']\"","webpack://@fof/polls/./node_modules/@babel/runtime/helpers/esm/extends.js","webpack://@fof/polls/external root \"flarum.core.compat['forum/utils/PostControls']\"","webpack://@fof/polls/./src/forum/components/index.js","webpack://@fof/polls/external root \"flarum.core.compat['common/Model']\"","webpack://@fof/polls/./src/forum/models/Poll.js","webpack://@fof/polls/./src/forum/models/PollOption.js","webpack://@fof/polls/./src/forum/models/PollVote.js","webpack://@fof/polls/./src/forum/models/index.js","webpack://@fof/polls/external root \"flarum.core.compat['common/extenders']\"","webpack://@fof/polls/external root \"flarum.core.compat['common/models/Post']\"","webpack://@fof/polls/external root \"flarum.core.compat['common/models/Forum']\"","webpack://@fof/polls/./src/forum/extend.js","webpack://@fof/polls/./src/forum/index.js","webpack://@fof/polls/./src/forum/addPostControls.js","webpack://@fof/polls/./src/forum/addPollsToPost.js"],"sourcesContent":["// The require scope\nvar __webpack_require__ = {};\n\n","// getDefaultExport function for compatibility with non-harmony modules\n__webpack_require__.n = (module) => {\n\tvar getter = module && module.__esModule ?\n\t\t() => (module['default']) :\n\t\t() => (module);\n\t__webpack_require__.d(getter, { a: getter });\n\treturn getter;\n};","// define getter functions for harmony exports\n__webpack_require__.d = (exports, definition) => {\n\tfor(var key in definition) {\n\t\tif(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {\n\t\t\tObject.defineProperty(exports, key, { enumerable: true, get: definition[key] });\n\t\t}\n\t}\n};","__webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))","// define __esModule on exports\n__webpack_require__.r = (exports) => {\n\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n\t}\n\tObject.defineProperty(exports, '__esModule', { value: true });\n};","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['forum/app'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/extend'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/components/Badge'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['forum/components/DiscussionList'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/models/Discussion'];","import app from 'flarum/forum/app';\n\nimport { extend } from 'flarum/common/extend';\nimport Badge from 'flarum/common/components/Badge';\nimport DiscussionList from 'flarum/forum/components/DiscussionList';\nimport Discussion from 'flarum/common/models/Discussion';\n\nexport default () => {\n extend(DiscussionList.prototype, 'requestParams', (params) => {\n params.include.push('poll');\n });\n\n extend(Discussion.prototype, 'badges', function (badges) {\n if (this.hasPoll()) {\n badges.add(\n 'poll',\n Badge.component({\n type: 'poll',\n label: app.translator.trans('fof-polls.forum.tooltip.badge'),\n icon: 'fas fa-signal',\n }),\n 5\n );\n }\n });\n};\n","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/utils/classList'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['forum/components/DiscussionComposer'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['forum/components/ReplyComposer'];","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/components/Button'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/components/Modal'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/components/Switch'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/utils/ItemList'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/utils/Stream'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/utils/extractText'];","import app from 'flarum/forum/app';\n\nimport Button from 'flarum/common/components/Button';\nimport Modal from 'flarum/common/components/Modal';\nimport Switch from 'flarum/common/components/Switch';\nimport ItemList from 'flarum/common/utils/ItemList';\nimport Stream from 'flarum/common/utils/Stream';\nimport extractText from 'flarum/common/utils/extractText';\n\nexport default class CreatePollModal extends Modal {\n oninit(vnode) {\n super.oninit(vnode);\n\n this.options = [Stream(''), Stream('')];\n this.optionImageUrls = [Stream(''), Stream('')];\n\n this.question = Stream('');\n\n this.endDate = Stream();\n\n this.publicPoll = Stream(false);\n this.hideVotes = Stream(false);\n this.allowChangeVote = Stream(true);\n this.allowMultipleVotes = Stream(false);\n this.maxVotes = Stream(0);\n\n this.datepickerMinDate = this.formatDate(undefined);\n\n const { poll } = this.attrs;\n\n // When re-opening the modal for the same discussion composer where we already set poll attributes\n if (poll && Array.isArray(poll.options)) {\n this.options = [];\n this.optionImageUrls = [];\n poll.options.forEach((option) => {\n this.options.push(Stream(option.answer));\n this.optionImageUrls.push(Stream(option.imageUrl));\n });\n\n this.question(poll.question);\n this.publicPoll(poll.publicPoll);\n this.hideVotes(poll.hideVotes);\n this.allowChangeVote(poll.allowChangeVote);\n this.allowMultipleVotes(poll.allowMultipleVotes);\n this.maxVotes(poll.maxVotes || 0);\n\n this.endDate(this.formatDate(poll.endDate));\n\n // Replace minimum of 'today' for poll end date only if the poll is not already closed\n if (this.endDate() && dayjs(poll.endDate).isAfter(dayjs())) {\n this.datepickerMinDate = this.formatDate(poll.endDate);\n }\n }\n }\n\n title() {\n return app.translator.trans('fof-polls.forum.modal.add_title');\n }\n\n className() {\n return 'PollDiscussionModal Modal--medium';\n }\n\n content() {\n return [\n
\n
{this.fields().toArray()}
\n
,\n ];\n }\n\n fields() {\n const items = new ItemList();\n\n items.add(\n 'question',\n \n \n\n \n
,\n 100\n );\n\n items.add(\n 'answers',\n \n \n\n {this.displayOptions()}\n
,\n 80\n );\n\n items.add(\n 'date',\n \n
\n\n
\n \n {Button.component({\n className: 'Button PollModal--button',\n icon: 'fas fa-times',\n onclick: this.endDate.bind(this, null),\n })}\n
\n\n {this.endDate() && (\n
\n \n \n {dayjs(this.endDate()).isBefore(dayjs())\n ? app.translator.trans('fof-polls.forum.poll_ended')\n : app.translator.trans('fof-polls.forum.days_remaining', { time: dayjs(this.endDate()).fromNow() })}\n
\n )}\n
,\n 40\n );\n\n items.add(\n 'public',\n \n {Switch.component(\n {\n state: this.publicPoll() || false,\n onchange: this.publicPoll,\n },\n app.translator.trans('fof-polls.forum.modal.public_poll_label')\n )}\n
,\n 20\n );\n\n items.add(\n 'hide-votes',\n \n \n {app.translator.trans('fof-polls.forum.modal.hide_votes_label')}\n \n
,\n 20\n );\n\n items.add(\n 'allow-change-vote',\n \n \n {app.translator.trans('fof-polls.forum.modal.allow_change_vote_label')}\n \n
,\n 20\n );\n\n items.add(\n 'allow-multiple-votes',\n \n {Switch.component(\n {\n state: this.allowMultipleVotes() || false,\n onchange: this.allowMultipleVotes,\n },\n app.translator.trans('fof-polls.forum.modal.allow_multiple_votes_label')\n )}\n
,\n 15\n );\n\n if (this.allowMultipleVotes()) {\n items.add(\n 'max-votes',\n \n
\n\n
\n\n
{app.translator.trans('fof-polls.forum.modal.max_votes_help')}
\n
,\n 15\n );\n }\n\n items.add(\n 'submit',\n \n {Button.component(\n {\n type: 'submit',\n className: 'Button Button--primary PollModal-SubmitButton',\n loading: this.loading,\n },\n app.translator.trans('fof-polls.forum.modal.submit')\n )}\n
,\n -10\n );\n\n return items;\n }\n\n displayOptions() {\n return Object.keys(this.options).map((el, i) => (\n \n
\n {i >= 2\n ? Button.component({\n type: 'button',\n className: 'Button Button--warning PollModal--button',\n icon: 'fas fa-minus',\n onclick: i >= 2 ? this.removeOption.bind(this, i) : '',\n })\n : ''}\n \n ));\n }\n\n addOption() {\n const max = Math.max(app.forum.attribute('pollMaxOptions'), 2);\n\n if (this.options.length < max) {\n this.options.push(Stream(''));\n this.optionImageUrls.push(Stream(''));\n } else {\n alert(extractText(app.translator.trans('fof-polls.forum.modal.max', { max })));\n }\n }\n\n removeOption(option) {\n this.options.splice(option, 1);\n this.optionImageUrls.splice(option, 1);\n }\n\n data() {\n const poll = {\n question: this.question(),\n endDate: this.dateToTimestamp(this.endDate()),\n publicPoll: this.publicPoll(),\n hideVotes: this.hideVotes(),\n allowChangeVote: this.allowChangeVote(),\n allowMultipleVotes: this.allowMultipleVotes(),\n maxVotes: this.maxVotes(),\n options: [],\n };\n\n this.options.forEach((answer, index) => {\n if (answer()) {\n poll.options.push({\n answer: answer(),\n imageUrl: this.optionImageUrls[index](),\n });\n }\n });\n\n if (this.question() === '') {\n alert(app.translator.trans('fof-polls.forum.modal.include_question'));\n\n return null;\n }\n\n if (poll.options.length < 2) {\n alert(app.translator.trans('fof-polls.forum.modal.min'));\n\n return null;\n }\n\n return poll;\n }\n\n onsubmit(e) {\n e.preventDefault();\n\n const data = this.data();\n\n if (data === null) {\n return;\n }\n\n const promise = this.attrs.onsubmit(data);\n\n if (promise instanceof Promise) {\n this.loading = true;\n\n promise.then(this.hide.bind(this), (err) => {\n console.error(err);\n this.onerror(err);\n this.loaded();\n });\n } else {\n app.modal.close();\n }\n }\n\n formatDate(date, def = false) {\n const dayjsDate = dayjs(date);\n\n if (date === false || !dayjsDate.isValid()) return def !== false ? this.formatDate(def) : null;\n\n return dayjsDate.format('YYYY-MM-DDTHH:mm');\n }\n\n dateToTimestamp(date) {\n const dayjsDate = dayjs(date);\n\n if (!date || !dayjsDate.isValid()) return false;\n\n return dayjsDate.format();\n }\n}\n","import app from 'flarum/forum/app';\n\nimport { extend } from 'flarum/common/extend';\nimport classList from 'flarum/common/utils/classList';\nimport DiscussionComposer from 'flarum/forum/components/DiscussionComposer';\nimport ReplyComposer from 'flarum/forum/components/ReplyComposer';\n\nimport CreatePollModal from './components/CreatePollModal';\n\nexport const addToComposer = (composer) => {\n composer.prototype.addPoll = function () {\n app.modal.show(CreatePollModal, {\n poll: this.composer.fields.poll,\n onsubmit: (poll) => (this.composer.fields.poll = poll),\n });\n };\n\n // Add button to DiscussionComposer header\n extend(composer.prototype, 'headerItems', function (items) {\n const discussion = this.composer.body?.attrs?.discussion;\n const canStartPoll = discussion?.canStartPoll() ?? app.forum.canStartPolls();\n\n if (canStartPoll) {\n items.add(\n 'polls',\n \n \n {app.translator.trans(`fof-polls.forum.composer_discussion.${this.composer.fields.poll ? 'edit' : 'add'}_poll`)}\n \n ,\n 1\n );\n }\n });\n\n extend(composer.prototype, 'data', function (data) {\n if (this.composer.fields.poll) {\n data.poll = this.composer.fields.poll;\n }\n });\n};\n\nexport default () => {\n addToComposer(DiscussionComposer);\n addToComposer(ReplyComposer);\n};\n","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['forum/components/CommentPost'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/Component'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['forum/components/LogInModal'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/helpers/avatar'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/helpers/username'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/components/Link'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/components/LoadingIndicator'];","import app from 'flarum/forum/app';\n\nimport Modal from 'flarum/common/components/Modal';\nimport avatar from 'flarum/common/helpers/avatar';\nimport username from 'flarum/common/helpers/username';\nimport Link from 'flarum/common/components/Link';\nimport Stream from 'flarum/common/utils/Stream';\nimport LoadingIndicator from 'flarum/common/components/LoadingIndicator';\n\nexport default class ListVotersModal extends Modal {\n oninit(vnode) {\n super.oninit(vnode);\n\n this.loading = Stream(true);\n\n app.store\n .find('fof/polls', this.attrs.poll.id(), {\n include: 'votes,votes.user,votes.option',\n })\n .then(() => this.loading(false))\n .finally(() => m.redraw());\n }\n\n className() {\n return 'Modal--medium VotesModal';\n }\n\n title() {\n return app.translator.trans('fof-polls.forum.votes_modal.title');\n }\n\n content() {\n return {this.loading() ? : this.attrs.poll.options().map(this.optionContent.bind(this))}
;\n }\n\n optionContent(opt) {\n const votes = (this.attrs.poll.votes() || []).filter((v) => opt.id() === v.option().id());\n\n return (\n \n
{opt.answer() + ':'}
\n\n {votes.length ? (\n
{votes.map(this.voteContent.bind(this))}
\n ) : (\n
{app.translator.trans('fof-polls.forum.modal.no_voters')}
\n )}\n
\n );\n }\n\n voteContent(vote) {\n const user = vote.user();\n const attrs = user && { href: app.route.user(user) };\n\n return (\n \n {avatar(user)} {username(user)}\n \n );\n }\n}\n","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/components/Tooltip'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/helpers/icon'];","import app from 'flarum/forum/app';\n\nimport Button from 'flarum/common/components/Button';\nimport Stream from 'flarum/common/utils/Stream';\nimport extractText from 'flarum/common/utils/extractText';\nimport CreatePollModal from './CreatePollModal';\n\nexport default class EditPollModal extends CreatePollModal {\n oninit(vnode) {\n super.oninit(vnode);\n\n this.poll = this.attrs.poll;\n\n this.options = this.poll.options();\n this.optionAnswers = this.options.map((o) => Stream(o.answer()));\n this.optionImageUrls = this.options.map((o) => Stream(o.imageUrl()));\n this.question = Stream(this.poll.question());\n this.endDate = Stream(this.formatDate(this.poll.endDate()));\n this.publicPoll = Stream(this.poll.publicPoll());\n this.allowMultipleVotes = Stream(this.poll.allowMultipleVotes());\n this.hideVotes = Stream(this.poll.hideVotes());\n this.allowChangeVote = Stream(this.poll.allowChangeVote());\n this.maxVotes = Stream(this.poll.maxVotes() || 0);\n\n if (this.endDate() && dayjs(this.poll.endDate()).isAfter(dayjs())) {\n this.datepickerMinDate = this.formatDate(this.endDate());\n }\n }\n\n title() {\n return app.translator.trans('fof-polls.forum.modal.edit_title');\n }\n\n displayOptions() {\n return this.options.map((opt, i) => (\n \n
\n\n {i >= 2\n ? Button.component({\n type: 'button',\n className: 'Button PollModal--button',\n icon: 'fas fa-minus',\n onclick: i >= 2 ? this.removeOption.bind(this, i) : '',\n })\n : ''}\n \n ));\n }\n\n addOption() {\n const max = Math.max(app.forum.attribute('pollMaxOptions'), 2);\n\n if (this.options.length < max) {\n this.options.push(app.store.createRecord('poll_options'));\n this.optionAnswers.push(Stream(''));\n this.optionImageUrls.push(Stream(''));\n } else {\n alert(extractText(app.translator.trans('fof-polls.forum.modal.max', { max })));\n }\n }\n\n removeOption(i) {\n this.options.splice(i, 1);\n this.optionAnswers.splice(i, 1);\n this.optionImageUrls.splice(i, 1);\n }\n\n data() {\n const options = this.options.map((o, i) => {\n if (!o.data.attributes) o.data.attributes = {};\n\n o.data.attributes.answer = this.optionAnswers[i]();\n o.data.attributes.imageUrl = this.optionImageUrls[i]();\n\n return o.data;\n });\n\n return {\n question: this.question(),\n endDate: this.dateToTimestamp(this.endDate()),\n publicPoll: this.publicPoll(),\n hideVotes: this.hideVotes(),\n allowChangeVote: this.allowChangeVote(),\n allowMultipleVotes: this.allowMultipleVotes(),\n maxVotes: this.maxVotes(),\n options,\n };\n }\n\n onsubmit(e) {\n e.preventDefault();\n\n if (this.loading) return;\n\n this.loading = true;\n\n return this.poll\n .save(this.data())\n .then(() => {\n this.hide();\n m.redraw();\n })\n .catch((e) => {\n this.loaded();\n this.onerror(e);\n });\n }\n}\n","import app from 'flarum/forum/app';\n\nimport Component from 'flarum/common/Component';\nimport Button from 'flarum/common/components/Button';\nimport LogInModal from 'flarum/forum/components/LogInModal';\nimport ListVotersModal from './ListVotersModal';\nimport classList from 'flarum/common/utils/classList';\nimport ItemList from 'flarum/common/utils/ItemList';\nimport Tooltip from 'flarum/common/components/Tooltip';\nimport icon from 'flarum/common/helpers/icon';\nimport EditPollModal from './EditPollModal';\n\nexport default class PostPoll extends Component {\n oninit(vnode) {\n super.oninit(vnode);\n\n this.loadingOptions = false;\n\n this.useSubmitUI = !this.attrs.poll?.canChangeVote() && this.attrs.poll?.allowMultipleVotes();\n this.pendingSubmit = false;\n this.pendingOptions = null;\n }\n\n oncreate(vnode) {\n super.oncreate(vnode);\n\n this.preventClose = this.preventClose.bind(this);\n window.addEventListener('beforeunload', this.preventClose);\n }\n\n onremove(vnode) {\n super.onremove(vnode);\n\n window.removeEventListener('beforeunload', this.preventClose);\n }\n\n view() {\n const poll = this.attrs.poll;\n const options = poll.options() || [];\n let maxVotes = poll.allowMultipleVotes() ? poll.maxVotes() : 1;\n\n if (maxVotes === 0) maxVotes = options.length;\n\n const infoItems = this.infoItems(maxVotes);\n\n return (\n \n
\n
{poll.question()}
\n\n {poll.canSeeVoters() && (\n \n \n \n )}\n\n {poll.canEdit() && (\n \n \n \n )}\n {poll.canDelete() && (\n \n \n \n )}\n \n\n
\n
{options.map(this.viewOption.bind(this))}
\n\n
\n {!infoItems.isEmpty() &&
{infoItems.toArray()}
}\n\n {this.useSubmitUI && this.pendingSubmit && (\n
\n )}\n
\n
\n
\n );\n }\n\n infoItems(maxVotes) {\n const items = new ItemList();\n const poll = this.attrs.poll;\n const hasVoted = poll.myVotes()?.length > 0;\n\n if (app.session.user && !poll.canVote() && !poll.hasEnded()) {\n items.add(\n 'no-permission',\n \n \n {app.translator.trans('fof-polls.forum.no_permission')}\n \n );\n }\n\n if (poll.endDate()) {\n items.add(\n 'end-date',\n \n \n {poll.hasEnded()\n ? app.translator.trans('fof-polls.forum.poll_ended')\n : app.translator.trans('fof-polls.forum.days_remaining', { time: dayjs(poll.endDate()).fromNow() })}\n \n );\n }\n\n if (poll.canVote()) {\n items.add(\n 'max-votes',\n \n \n {app.translator.trans('fof-polls.forum.max_votes_allowed', { max: maxVotes })}\n \n );\n\n if (!poll.canChangeVote()) {\n items.add(\n 'cannot-change-vote',\n \n \n {app.translator.trans('fof-polls.forum.poll.cannot_change_vote')}\n \n );\n }\n }\n\n return items;\n }\n\n viewOption(opt) {\n const poll = this.attrs.poll;\n const hasVoted = poll.myVotes()?.length > 0;\n const totalVotes = poll.voteCount();\n\n const voted = this.pendingOptions ? this.pendingOptions.has(opt.id()) : poll.myVotes()?.some?.((vote) => vote.option() === opt);\n const votes = opt.voteCount();\n const percent = totalVotes > 0 ? Math.round((votes / totalVotes) * 100) : 0;\n\n // isNaN(null) is false, so we have to check type directly now that API always returns the field\n const canSeeVoteCount = typeof votes === 'number';\n const isDisabled = this.loadingOptions || (hasVoted && !poll.canChangeVote());\n const width = canSeeVoteCount ? percent : (Number(voted) / (poll.myVotes()?.length || 1)) * 100;\n\n const showCheckmark = !app.session.user || (!poll.hasEnded() && poll.canVote() && (!hasVoted || poll.canChangeVote()));\n\n const bar = (\n \n {showCheckmark && (\n
\n )}\n\n
\n {opt.answer()}\n {voted && !showCheckmark && icon('fas fa-check-circle', { className: 'PollAnswer-check' })}\n {canSeeVoteCount && {percent}%}\n
\n\n {opt.imageUrl() ?
: null}\n
\n );\n\n return (\n \n {canSeeVoteCount ? (\n \n {bar}\n \n ) : (\n bar\n )}\n
\n );\n }\n\n changeVote(option, evt) {\n if (!app.session.user) {\n app.modal.show(LogInModal);\n evt.target.checked = false;\n return;\n }\n\n const optionIds = this.pendingOptions || new Set(this.attrs.poll.myVotes().map?.((v) => v.option().id()));\n const isUnvoting = optionIds.delete(option.id());\n const allowsMultiple = this.attrs.poll.allowMultipleVotes();\n\n if (!allowsMultiple) {\n optionIds.clear();\n }\n\n if (!isUnvoting) {\n optionIds.add(option.id());\n }\n\n if (this.useSubmitUI) {\n this.pendingOptions = optionIds.size ? optionIds : null;\n this.pendingSubmit = !!this.pendingOptions;\n return;\n }\n\n return this.submit(optionIds, null, () => (evt.target.checked = isUnvoting));\n }\n\n onsubmit() {\n return this.submit(this.pendingOptions, () => {\n this.pendingOptions = null;\n this.pendingSubmit = false;\n });\n }\n\n submit(optionIds, cb, onerror) {\n this.loadingOptions = true;\n m.redraw();\n\n return app\n .request({\n method: 'PATCH',\n url: `${app.forum.attribute('apiUrl')}/fof/polls/${this.attrs.poll.id()}/votes`,\n body: {\n data: {\n optionIds: Array.from(optionIds),\n },\n },\n })\n .then((res) => {\n app.store.pushPayload(res);\n cb?.();\n })\n .catch((err) => {\n onerror?.(err);\n })\n .finally(() => {\n this.loadingOptions = false;\n\n m.redraw();\n });\n }\n\n showVoters() {\n // Load all the votes only when opening the votes list\n app.modal.show(ListVotersModal, {\n poll: this.attrs.poll,\n post: this.attrs.post,\n });\n }\n\n deletePoll() {\n if (confirm(app.translator.trans('fof-polls.forum.moderation.delete_confirm'))) {\n this.attrs.poll.delete().then(() => {\n m.redraw.sync();\n });\n }\n }\n\n /**\n * Attempting to use the `tooltipVisible` attr on the Tooltip component set to 'false' when no vote count\n * caused the tooltip to break on click. This is a workaround to hide the tooltip when no vote count is available,\n * called on 'onremove' of the Tooltip component. It doesn't always work as intended either, but it does the job.\n */\n hideOptionTooltip(vnode) {\n vnode.attrs.tooltipVisible = false;\n vnode.state.updateVisibility();\n }\n\n /**\n * Alert before navigating away using browser's 'beforeunload' event\n */\n preventClose(e) {\n if (this.pendingOptions) {\n e.preventDefault();\n return true;\n }\n }\n}\n","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['forum/components/DiscussionPage'];","export default function _extends() {\n _extends = Object.assign ? Object.assign.bind() : function (target) {\n for (var i = 1; i < arguments.length; i++) {\n var source = arguments[i];\n for (var key in source) {\n if (Object.prototype.hasOwnProperty.call(source, key)) {\n target[key] = source[key];\n }\n }\n }\n return target;\n };\n return _extends.apply(this, arguments);\n}","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['forum/utils/PostControls'];","import CreatePollModal from './CreatePollModal';\nimport PostPoll from './PostPoll';\nimport EditPollModal from './EditPollModal';\nimport ListVotersModal from './ListVotersModal';\n\nexport const components = {\n CreatePollModal,\n PostPoll,\n EditPollModal,\n ListVotersModal,\n};\n","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/Model'];","import Model from 'flarum/common/Model';\n\nexport default class Poll extends Model {\n question = Model.attribute('question');\n hasEnded = Model.attribute('hasEnded');\n endDate = Model.attribute('endDate');\n\n publicPoll = Model.attribute('publicPoll');\n hideVotes = Model.attribute('hideVotes');\n allowChangeVote = Model.attribute('allowChangeVote');\n allowMultipleVotes = Model.attribute('allowMultipleVotes');\n maxVotes = Model.attribute('maxVotes');\n\n voteCount = Model.attribute('voteCount');\n\n canVote = Model.attribute('canVote');\n canEdit = Model.attribute('canEdit');\n canDelete = Model.attribute('canDelete');\n canSeeVoters = Model.attribute('canSeeVoters');\n canChangeVote = Model.attribute('canChangeVote');\n\n options = Model.hasMany('options');\n votes = Model.hasMany('votes');\n myVotes = Model.hasMany('myVotes');\n\n apiEndpoint() {\n return `/fof/polls${this.exists ? `/${this.data.id}` : ''}`;\n }\n}\n","import Model from 'flarum/common/Model';\n\nexport default class PollOption extends Model {\n answer = Model.attribute('answer');\n imageUrl = Model.attribute('imageUrl');\n voteCount = Model.attribute('voteCount');\n\n poll = Model.hasOne('polls');\n votes = Model.hasMany('votes');\n\n apiEndpoint() {\n return `/fof/polls/answers${this.exists ? `/${this.data.id}` : ''}`;\n }\n}\n","import Model from 'flarum/common/Model';\n\nexport default class PollVote extends Model {\n poll = Model.hasOne('poll');\n option = Model.hasOne('option');\n user = Model.hasOne('user');\n\n pollId = Model.attribute('pollId');\n optionId = Model.attribute('optionId');\n\n apiEndpoint() {\n return `/fof/polls/${this.pollId()}/vote`;\n }\n}\n","import Poll from './Poll';\nimport PollOption from './PollOption';\nimport PollVote from './PollVote';\n\nexport const models = {\n Poll,\n PollOption,\n PollVote,\n};\n","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/extenders'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/models/Post'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/models/Forum'];","import Extend from 'flarum/common/extenders';\nimport Post from 'flarum/common/models/Post';\nimport Forum from 'flarum/common/models/Forum';\nimport Discussion from 'flarum/common/models/Discussion';\nimport Poll from './models/Poll';\nimport PollOption from './models/PollOption';\nimport PollVote from './models/PollVote';\n\nexport default [\n new Extend.Store().add('polls', Poll).add('poll_options', PollOption).add('poll_votes', PollVote),\n\n new Extend.Model(Post).hasMany('polls').attribute('canStartPoll'),\n\n new Extend.Model(Forum).attribute('canStartPolls'),\n\n new Extend.Model(Discussion).attribute('hasPoll').attribute('canStartPoll'),\n];\n","import app from 'flarum/forum/app';\n\nimport addDiscussionBadge from './addDiscussionBadge';\nimport addComposerItems from './addComposerItems';\nimport addPollsToPost from './addPollsToPost';\nimport addPostControls from './addPostControls';\n\nexport * from './components';\nexport * from './models';\n\napp.initializers.add('fof/polls', () => {\n addDiscussionBadge();\n addComposerItems();\n addPollsToPost();\n addPostControls();\n});\n\nexport { default as extend } from './extend';\n","import app from 'flarum/forum/app';\n\nimport { extend } from 'flarum/common/extend';\nimport PostControls from 'flarum/forum/utils/PostControls';\nimport CreatePollModal from './components/CreatePollModal';\nimport Button from 'flarum/common/components/Button';\n\nexport default () => {\n const createPoll = (post) =>\n app.modal.show(CreatePollModal, {\n onsubmit: (data) =>\n app.store\n .createRecord('polls')\n .save(\n {\n ...data,\n relationships: {\n post,\n },\n },\n {\n data: {\n include: 'options,myVotes,myVotes.option',\n },\n }\n )\n .then((poll) => {\n post.rawRelationship('polls')?.push?.({ type: 'polls', id: poll.id() });\n\n return poll;\n }),\n });\n\n extend(PostControls, 'moderationControls', function (items, post) {\n if (!post.isHidden() && post.canStartPoll()) {\n items.add(\n 'addPoll',\n \n );\n }\n });\n};\n","import app from 'flarum/forum/app';\n\nimport { extend } from 'flarum/common/extend';\nimport CommentPost from 'flarum/forum/components/CommentPost';\nimport PostPoll from './components/PostPoll';\nimport DiscussionPage from 'flarum/forum/components/DiscussionPage';\n\nexport default () => {\n extend(CommentPost.prototype, 'content', function (content) {\n const post = this.attrs.post;\n\n if ((!post.isHidden() || this.revealContent) && post.polls()) {\n for (const poll of post.polls()) {\n if (poll) {\n content.push();\n }\n }\n }\n });\n\n extend(CommentPost.prototype, 'oninit', function () {\n this.subtree.check(() => {\n const polls = this.attrs.post.polls();\n\n const checks = polls?.map?.(\n (poll) =>\n poll && [\n poll.data?.attributes,\n poll.options().map?.((option) => option?.data?.attributes),\n poll.myVotes().map?.((vote) => vote.option()?.id()),\n ]\n );\n\n return JSON.stringify(checks);\n });\n });\n\n extend(DiscussionPage.prototype, 'oncreate', function () {\n if (app.pusher) {\n app.pusher.then((binding) => {\n // We will listen for updates to all polls and options\n // Even if that model is not in the current discussion, it doesn't really matter\n binding.channels.main.bind('updatedPollOptions', (data) => {\n const poll = app.store.getById('polls', data['pollId']);\n\n if (poll) {\n poll.pushAttributes({\n voteCount: data['pollVoteCount'],\n });\n\n // Not redrawing here, as the option below should trigger the redraw already\n }\n\n const changedOptions = data['options'];\n\n for (const optionId in changedOptions) {\n const option = app.store.getById('poll_options', optionId);\n\n if (option && option.voteCount() !== undefined) {\n option.pushAttributes({\n voteCount: changedOptions[optionId],\n });\n }\n }\n\n m.redraw();\n });\n });\n }\n });\n\n extend(DiscussionPage.prototype, 'onremove', function () {\n if (app.pusher) {\n app.pusher.then((binding) => {\n binding.channels.main.unbind('updatedPollOptions');\n });\n }\n });\n};\n"],"names":["__webpack_require__","module","getter","__esModule","d","a","exports","definition","key","o","Object","defineProperty","enumerable","get","obj","prop","prototype","hasOwnProperty","call","Symbol","toStringTag","value","flarum","core","compat","_setPrototypeOf","p","setPrototypeOf","bind","__proto__","_inheritsLoose","subClass","superClass","create","constructor","CreatePollModal","oninit","vnode","this","options","Stream","optionImageUrls","question","endDate","publicPoll","hideVotes","allowChangeVote","allowMultipleVotes","maxVotes","datepickerMinDate","formatDate","undefined","poll","attrs","Array","isArray","forEach","option","push","answer","imageUrl","dayjs","isAfter","title","app","trans","className","content","fields","toArray","items","ItemList","add","type","name","bidi","Button","icon","onclick","addOption","displayOptions","min","max","class","isBefore","time","fromNow","Switch","state","onchange","disabled","length","loading","keys","map","el","i","placeholder","attribute","removeOption","Math","alert","extractText","splice","data","dateToTimestamp","index","onsubmit","e","preventDefault","promise","Promise","then","hide","err","console","error","onerror","loaded","close","date","def","dayjsDate","isValid","format","Modal","addToComposer","composer","addPoll","show","extend","discussion","body","canStartPoll","canStartPolls","classList","ListVotersModal","find","id","include","m","redraw","optionContent","opt","votes","filter","v","voteContent","vote","user","href","avatar","username","EditPollModal","optionAnswers","createRecord","attributes","save","PostPoll","loadingOptions","useSubmitUI","canChangeVote","pendingSubmit","pendingOptions","oncreate","preventClose","window","addEventListener","onremove","removeEventListener","view","infoItems","canSeeVoters","text","showVoters","canEdit","canDelete","deletePoll","viewOption","isEmpty","hasVoted","myVotes","canVote","hasEnded","totalVotes","voteCount","voted","has","some","percent","round","canSeeVoteCount","isDisabled","width","Number","showCheckmark","bar","style","changeVote","checked","src","alt","count","hideOptionTooltip","evt","LogInModal","target","optionIds","Set","isUnvoting","clear","size","submit","cb","method","url","from","res","pushPayload","post","confirm","sync","tooltipVisible","updateVisibility","Component","_extends","assign","arguments","source","apply","components","Poll","Model","apiEndpoint","exists","PollOption","PollVote","pollId","optionId","models","Extend","Post","hasMany","Forum","Discussion","createPoll","DiscussionList","params","badges","hasPoll","Badge","label","DiscussionComposer","ReplyComposer","CommentPost","isHidden","revealContent","polls","subtree","check","checks","JSON","stringify","DiscussionPage","binding","channels","main","getById","pushAttributes","changedOptions","unbind","relationships","rawRelationship","PostControls"],"sourceRoot":""}
\ No newline at end of file
+{"version":3,"file":"forum.js","mappings":"MACA,IAAIA,EAAsB,CCA1BA,EAAyBC,IACxB,IAAIC,EAASD,GAAUA,EAAOE,WAC7B,IAAOF,EAAiB,QACxB,IAAM,EAEP,OADAD,EAAoBI,EAAEF,EAAQ,CAAEG,EAAGH,IAC5BA,CAAM,ECLdF,EAAwB,CAACM,EAASC,KACjC,IAAI,IAAIC,KAAOD,EACXP,EAAoBS,EAAEF,EAAYC,KAASR,EAAoBS,EAAEH,EAASE,IAC5EE,OAAOC,eAAeL,EAASE,EAAK,CAAEI,YAAY,EAAMC,IAAKN,EAAWC,IAE1E,ECNDR,EAAwB,CAACc,EAAKC,IAAUL,OAAOM,UAAUC,eAAeC,KAAKJ,EAAKC,GCClFf,EAAyBM,IACH,oBAAXa,QAA0BA,OAAOC,aAC1CV,OAAOC,eAAeL,EAASa,OAAOC,YAAa,CAAEC,MAAO,WAE7DX,OAAOC,eAAeL,EAAS,aAAc,CAAEe,OAAO,GAAO,G,sFCL9D,MAAM,EAA+BC,OAAOC,KAAKC,OAAO,a,aCAxD,MAAM,EAA+BF,OAAOC,KAAKC,OAAO,iBCAlD,EAA+BF,OAAOC,KAAKC,OAAO,2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Ae,CAClBlG,UAAWhG,EAAoB,gBAMnC,IAAMmM,EAAiBnM,EAAc,QAErC,IAAK,IAAM0J,KAAYyC,EAAgB,CACrC,IAAMpP,EAASO,IAAAA,MAAU2O,QAAQ,eAAgBvC,GAE7C3M,QAAiCN,IAAvBM,EAAOiJ,aACnBjJ,EAAOmP,eAAe,CACpBlG,UAAWmG,EAAezC,IAGhC,CAEAhM,EAAE+E,QACJ,GACF,GAEJ,KAEAb,EAAAA,EAAAA,QAAOiK,KAAAA,UAA0B,YAAY,WACvCvO,IAAAA,QACFA,IAAAA,OAAWoD,MAAK,SAACoL,GACfA,EAAQC,SAASC,KAAKI,OAAO,qBAC/B,GAEJ,IDrEMnC,EAAa,SAAC7B,GAAI,OACtB9K,IAAAA,MAAUqE,KAAKvG,EAAiB,CAC9BgF,SAAU,SAACJ,GAAI,OACb1C,IAAAA,MACGoG,aAAa,SACbE,KAAI8E,GAAC,CAAD,EAEE1I,EAAI,CACPqM,cAAe,CACbjE,KAAAA,KAGJ,CACEpI,KAAM,CACJwC,QAAS,oCAId9B,MAAK,SAAChE,GAAS,IAAA4P,EAGd,OAF6B,OAA7BA,EAAAlE,EAAKmE,gBAAgB,WAAc,MAAnCD,EAA+BtP,MAA/BsP,EAA+BtP,KAAO,CAAEgB,KAAM,QAASuE,GAAI7F,EAAK6F,OAEzD7F,CACT,GAAE,GACN,GAEJkF,EAAAA,EAAAA,QAAO4K,KAAc,sBAAsB,SAAU3O,EAAOuK,IACrDA,EAAKuC,YAAcvC,EAAKlG,gBAC3BrE,EAAME,IACJ,UACAL,EAACS,IAAM,CAACC,KAAK,cAAcC,QAAS4L,EAAWpP,KAAKe,KAAMwM,IACvD9K,IAAAA,WAAeC,MAAM,mCAI9B,GD3BF,G","sources":["webpack://@fof/polls/webpack/bootstrap","webpack://@fof/polls/webpack/runtime/compat get default export","webpack://@fof/polls/webpack/runtime/define property getters","webpack://@fof/polls/webpack/runtime/hasOwnProperty shorthand","webpack://@fof/polls/webpack/runtime/make namespace object","webpack://@fof/polls/external root \"flarum.core.compat['forum/app']\"","webpack://@fof/polls/external root \"flarum.core.compat['common/extend']\"","webpack://@fof/polls/external root \"flarum.core.compat['common/components/Badge']\"","webpack://@fof/polls/external root \"flarum.core.compat['forum/components/DiscussionList']\"","webpack://@fof/polls/external root \"flarum.core.compat['common/models/Discussion']\"","webpack://@fof/polls/./src/forum/addDiscussionBadge.js","webpack://@fof/polls/external root \"flarum.core.compat['common/utils/classList']\"","webpack://@fof/polls/external root \"flarum.core.compat['forum/components/DiscussionComposer']\"","webpack://@fof/polls/external root \"flarum.core.compat['forum/components/ReplyComposer']\"","webpack://@fof/polls/./node_modules/@babel/runtime/helpers/esm/setPrototypeOf.js","webpack://@fof/polls/./node_modules/@babel/runtime/helpers/esm/inheritsLoose.js","webpack://@fof/polls/external root \"flarum.core.compat['common/components/Button']\"","webpack://@fof/polls/external root \"flarum.core.compat['common/components/Modal']\"","webpack://@fof/polls/external root \"flarum.core.compat['common/components/Switch']\"","webpack://@fof/polls/external root \"flarum.core.compat['common/utils/ItemList']\"","webpack://@fof/polls/external root \"flarum.core.compat['common/utils/Stream']\"","webpack://@fof/polls/external root \"flarum.core.compat['common/utils/extractText']\"","webpack://@fof/polls/./src/forum/components/CreatePollModal.js","webpack://@fof/polls/./src/forum/addComposerItems.js","webpack://@fof/polls/external root \"flarum.core.compat['forum/components/CommentPost']\"","webpack://@fof/polls/external root \"flarum.core.compat['common/Component']\"","webpack://@fof/polls/external root \"flarum.core.compat['forum/components/LogInModal']\"","webpack://@fof/polls/external root \"flarum.core.compat['common/helpers/avatar']\"","webpack://@fof/polls/external root \"flarum.core.compat['common/helpers/username']\"","webpack://@fof/polls/external root \"flarum.core.compat['common/components/Link']\"","webpack://@fof/polls/external root \"flarum.core.compat['common/components/LoadingIndicator']\"","webpack://@fof/polls/./src/forum/components/ListVotersModal.js","webpack://@fof/polls/external root \"flarum.core.compat['common/components/Tooltip']\"","webpack://@fof/polls/external root \"flarum.core.compat['common/helpers/icon']\"","webpack://@fof/polls/./src/forum/components/EditPollModal.js","webpack://@fof/polls/./src/forum/components/PostPoll.js","webpack://@fof/polls/external root \"flarum.core.compat['forum/components/DiscussionPage']\"","webpack://@fof/polls/./node_modules/@babel/runtime/helpers/esm/extends.js","webpack://@fof/polls/external root \"flarum.core.compat['forum/utils/PostControls']\"","webpack://@fof/polls/./src/forum/components/index.js","webpack://@fof/polls/external root \"flarum.core.compat['common/Model']\"","webpack://@fof/polls/./src/forum/models/Poll.js","webpack://@fof/polls/./src/forum/models/PollOption.js","webpack://@fof/polls/./src/forum/models/PollVote.js","webpack://@fof/polls/./src/forum/models/index.js","webpack://@fof/polls/external root \"flarum.core.compat['common/extenders']\"","webpack://@fof/polls/external root \"flarum.core.compat['common/models/Post']\"","webpack://@fof/polls/external root \"flarum.core.compat['common/models/Forum']\"","webpack://@fof/polls/./src/forum/extend.js","webpack://@fof/polls/./src/forum/index.js","webpack://@fof/polls/./src/forum/addPostControls.js","webpack://@fof/polls/./src/forum/addPollsToPost.js"],"sourcesContent":["// The require scope\nvar __webpack_require__ = {};\n\n","// getDefaultExport function for compatibility with non-harmony modules\n__webpack_require__.n = (module) => {\n\tvar getter = module && module.__esModule ?\n\t\t() => (module['default']) :\n\t\t() => (module);\n\t__webpack_require__.d(getter, { a: getter });\n\treturn getter;\n};","// define getter functions for harmony exports\n__webpack_require__.d = (exports, definition) => {\n\tfor(var key in definition) {\n\t\tif(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {\n\t\t\tObject.defineProperty(exports, key, { enumerable: true, get: definition[key] });\n\t\t}\n\t}\n};","__webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))","// define __esModule on exports\n__webpack_require__.r = (exports) => {\n\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n\t}\n\tObject.defineProperty(exports, '__esModule', { value: true });\n};","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['forum/app'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/extend'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/components/Badge'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['forum/components/DiscussionList'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/models/Discussion'];","import app from 'flarum/forum/app';\n\nimport { extend } from 'flarum/common/extend';\nimport Badge from 'flarum/common/components/Badge';\nimport DiscussionList from 'flarum/forum/components/DiscussionList';\nimport Discussion from 'flarum/common/models/Discussion';\n\nexport default () => {\n extend(DiscussionList.prototype, 'requestParams', (params) => {\n params.include.push('poll');\n });\n\n extend(Discussion.prototype, 'badges', function (badges) {\n if (this.hasPoll()) {\n badges.add(\n 'poll',\n Badge.component({\n type: 'poll',\n label: app.translator.trans('fof-polls.forum.tooltip.badge'),\n icon: 'fas fa-signal',\n }),\n 5\n );\n }\n });\n};\n","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/utils/classList'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['forum/components/DiscussionComposer'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['forum/components/ReplyComposer'];","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/components/Button'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/components/Modal'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/components/Switch'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/utils/ItemList'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/utils/Stream'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/utils/extractText'];","import app from 'flarum/forum/app';\n\nimport Button from 'flarum/common/components/Button';\nimport Modal from 'flarum/common/components/Modal';\nimport Switch from 'flarum/common/components/Switch';\nimport ItemList from 'flarum/common/utils/ItemList';\nimport Stream from 'flarum/common/utils/Stream';\nimport extractText from 'flarum/common/utils/extractText';\n\nexport default class CreatePollModal extends Modal {\n oninit(vnode) {\n super.oninit(vnode);\n\n this.options = [Stream(''), Stream('')];\n this.optionImageUrls = [Stream(''), Stream('')];\n\n this.question = Stream('');\n\n this.endDate = Stream();\n\n this.publicPoll = Stream(false);\n this.hideVotes = Stream(false);\n this.allowChangeVote = Stream(true);\n this.allowMultipleVotes = Stream(false);\n this.maxVotes = Stream(0);\n\n this.datepickerMinDate = this.formatDate(undefined);\n\n const { poll } = this.attrs;\n\n // When re-opening the modal for the same discussion composer where we already set poll attributes\n if (poll && Array.isArray(poll.options)) {\n this.options = [];\n this.optionImageUrls = [];\n poll.options.forEach((option) => {\n this.options.push(Stream(option.answer));\n this.optionImageUrls.push(Stream(option.imageUrl));\n });\n\n this.question(poll.question);\n this.publicPoll(poll.publicPoll);\n this.hideVotes(poll.hideVotes);\n this.allowChangeVote(poll.allowChangeVote);\n this.allowMultipleVotes(poll.allowMultipleVotes);\n this.maxVotes(poll.maxVotes || 0);\n\n this.endDate(this.formatDate(poll.endDate));\n\n // Replace minimum of 'today' for poll end date only if the poll is not already closed\n if (this.endDate() && dayjs(poll.endDate).isAfter(dayjs())) {\n this.datepickerMinDate = this.formatDate(poll.endDate);\n }\n }\n }\n\n title() {\n return app.translator.trans('fof-polls.forum.modal.add_title');\n }\n\n className() {\n return 'PollDiscussionModal Modal--medium';\n }\n\n content() {\n return [\n \n
{this.fields().toArray()}
\n
,\n ];\n }\n\n fields() {\n const items = new ItemList();\n\n items.add(\n 'question',\n \n \n\n \n
,\n 100\n );\n\n items.add(\n 'answers',\n \n \n\n {this.displayOptions()}\n
,\n 80\n );\n\n items.add(\n 'date',\n \n
\n\n
\n \n {Button.component({\n className: 'Button PollModal--button',\n icon: 'fas fa-times',\n onclick: this.endDate.bind(this, null),\n })}\n
\n\n {this.endDate() && (\n
\n \n \n {dayjs(this.endDate()).isBefore(dayjs())\n ? app.translator.trans('fof-polls.forum.poll_ended')\n : app.translator.trans('fof-polls.forum.days_remaining', { time: dayjs(this.endDate()).fromNow() })}\n
\n )}\n
,\n 40\n );\n\n items.add(\n 'public',\n \n {Switch.component(\n {\n state: this.publicPoll() || false,\n onchange: this.publicPoll,\n },\n app.translator.trans('fof-polls.forum.modal.public_poll_label')\n )}\n
,\n 20\n );\n\n items.add(\n 'hide-votes',\n \n \n {app.translator.trans('fof-polls.forum.modal.hide_votes_label')}\n \n
,\n 20\n );\n\n items.add(\n 'allow-change-vote',\n \n \n {app.translator.trans('fof-polls.forum.modal.allow_change_vote_label')}\n \n
,\n 20\n );\n\n items.add(\n 'allow-multiple-votes',\n \n {Switch.component(\n {\n state: this.allowMultipleVotes() || false,\n onchange: this.allowMultipleVotes,\n },\n app.translator.trans('fof-polls.forum.modal.allow_multiple_votes_label')\n )}\n
,\n 15\n );\n\n if (this.allowMultipleVotes()) {\n items.add(\n 'max-votes',\n \n
\n\n
\n\n
{app.translator.trans('fof-polls.forum.modal.max_votes_help')}
\n
,\n 15\n );\n }\n\n items.add(\n 'submit',\n \n {Button.component(\n {\n type: 'submit',\n className: 'Button Button--primary PollModal-SubmitButton',\n loading: this.loading,\n },\n app.translator.trans('fof-polls.forum.modal.submit')\n )}\n
,\n -10\n );\n\n return items;\n }\n\n displayOptions() {\n return Object.keys(this.options).map((el, i) => (\n \n
\n {i >= 2\n ? Button.component({\n type: 'button',\n className: 'Button Button--warning PollModal--button',\n icon: 'fas fa-minus',\n onclick: i >= 2 ? this.removeOption.bind(this, i) : '',\n })\n : ''}\n \n ));\n }\n\n addOption() {\n const max = Math.max(app.forum.attribute('pollMaxOptions'), 2);\n\n if (this.options.length < max) {\n this.options.push(Stream(''));\n this.optionImageUrls.push(Stream(''));\n } else {\n alert(extractText(app.translator.trans('fof-polls.forum.modal.max', { max })));\n }\n }\n\n removeOption(option) {\n this.options.splice(option, 1);\n this.optionImageUrls.splice(option, 1);\n }\n\n data() {\n const poll = {\n question: this.question(),\n endDate: this.dateToTimestamp(this.endDate()),\n publicPoll: this.publicPoll(),\n hideVotes: this.hideVotes(),\n allowChangeVote: this.allowChangeVote(),\n allowMultipleVotes: this.allowMultipleVotes(),\n maxVotes: this.maxVotes(),\n options: [],\n };\n\n this.options.forEach((answer, index) => {\n if (answer()) {\n poll.options.push({\n answer: answer(),\n imageUrl: this.optionImageUrls[index](),\n });\n }\n });\n\n if (this.question() === '') {\n alert(app.translator.trans('fof-polls.forum.modal.include_question'));\n\n return null;\n }\n\n if (poll.options.length < 2) {\n alert(app.translator.trans('fof-polls.forum.modal.min'));\n\n return null;\n }\n\n return poll;\n }\n\n onsubmit(e) {\n e.preventDefault();\n\n const data = this.data();\n\n if (data === null) {\n return;\n }\n\n const promise = this.attrs.onsubmit(data);\n\n if (promise instanceof Promise) {\n this.loading = true;\n\n promise.then(this.hide.bind(this), (err) => {\n console.error(err);\n this.onerror(err);\n this.loaded();\n });\n } else {\n app.modal.close();\n }\n }\n\n formatDate(date, def = false) {\n const dayjsDate = dayjs(date);\n\n if (date === false || !dayjsDate.isValid()) return def !== false ? this.formatDate(def) : null;\n\n return dayjsDate.format('YYYY-MM-DDTHH:mm');\n }\n\n dateToTimestamp(date) {\n const dayjsDate = dayjs(date);\n\n if (!date || !dayjsDate.isValid()) return false;\n\n return dayjsDate.format();\n }\n}\n","import app from 'flarum/forum/app';\n\nimport { extend } from 'flarum/common/extend';\nimport classList from 'flarum/common/utils/classList';\nimport DiscussionComposer from 'flarum/forum/components/DiscussionComposer';\nimport ReplyComposer from 'flarum/forum/components/ReplyComposer';\n\nimport CreatePollModal from './components/CreatePollModal';\n\nexport const addToComposer = (composer) => {\n composer.prototype.addPoll = function () {\n app.modal.show(CreatePollModal, {\n poll: this.composer.fields.poll,\n onsubmit: (poll) => (this.composer.fields.poll = poll),\n });\n };\n\n // Add button to DiscussionComposer header\n extend(composer.prototype, 'headerItems', function (items) {\n const discussion = this.composer.body?.attrs?.discussion;\n const canStartPoll = discussion?.canStartPoll() ?? app.forum.canStartPolls();\n\n if (canStartPoll) {\n items.add(\n 'polls',\n \n \n {app.translator.trans(`fof-polls.forum.composer_discussion.${this.composer.fields.poll ? 'edit' : 'add'}_poll`)}\n \n ,\n 1\n );\n }\n });\n\n extend(composer.prototype, 'data', function (data) {\n if (this.composer.fields.poll) {\n data.poll = this.composer.fields.poll;\n }\n });\n};\n\nexport default () => {\n addToComposer(DiscussionComposer);\n addToComposer(ReplyComposer);\n};\n","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['forum/components/CommentPost'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/Component'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['forum/components/LogInModal'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/helpers/avatar'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/helpers/username'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/components/Link'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/components/LoadingIndicator'];","import app from 'flarum/forum/app';\n\nimport Modal from 'flarum/common/components/Modal';\nimport avatar from 'flarum/common/helpers/avatar';\nimport username from 'flarum/common/helpers/username';\nimport Link from 'flarum/common/components/Link';\nimport Stream from 'flarum/common/utils/Stream';\nimport LoadingIndicator from 'flarum/common/components/LoadingIndicator';\n\nexport default class ListVotersModal extends Modal {\n oninit(vnode) {\n super.oninit(vnode);\n\n this.loading = Stream(true);\n\n app.store\n .find('fof/polls', this.attrs.poll.id(), {\n include: 'votes,votes.user,votes.option',\n })\n .then(() => this.loading(false))\n .finally(() => m.redraw());\n }\n\n className() {\n return 'Modal--medium VotesModal';\n }\n\n title() {\n return app.translator.trans('fof-polls.forum.votes_modal.title');\n }\n\n content() {\n return {this.loading() ? : this.attrs.poll.options().map(this.optionContent.bind(this))}
;\n }\n\n optionContent(opt) {\n const votes = (this.attrs.poll.votes() || []).filter((v) => opt.id() === v.option().id());\n\n return (\n \n
{opt.answer() + ':'}
\n\n {votes.length ? (\n
{votes.map(this.voteContent.bind(this))}
\n ) : (\n
{app.translator.trans('fof-polls.forum.modal.no_voters')}
\n )}\n
\n );\n }\n\n voteContent(vote) {\n const user = vote.user();\n const attrs = user && { href: app.route.user(user) };\n\n return (\n \n {avatar(user)} {username(user)}\n \n );\n }\n}\n","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/components/Tooltip'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/helpers/icon'];","import app from 'flarum/forum/app';\n\nimport Button from 'flarum/common/components/Button';\nimport Stream from 'flarum/common/utils/Stream';\nimport extractText from 'flarum/common/utils/extractText';\nimport CreatePollModal from './CreatePollModal';\n\nexport default class EditPollModal extends CreatePollModal {\n oninit(vnode) {\n super.oninit(vnode);\n\n this.poll = this.attrs.poll;\n\n this.options = this.poll.options();\n this.optionAnswers = this.options.map((o) => Stream(o.answer()));\n this.optionImageUrls = this.options.map((o) => Stream(o.imageUrl()));\n this.question = Stream(this.poll.question());\n this.endDate = Stream(this.formatDate(this.poll.endDate()));\n this.publicPoll = Stream(this.poll.publicPoll());\n this.allowMultipleVotes = Stream(this.poll.allowMultipleVotes());\n this.hideVotes = Stream(this.poll.hideVotes());\n this.allowChangeVote = Stream(this.poll.allowChangeVote());\n this.maxVotes = Stream(this.poll.maxVotes() || 0);\n\n if (this.endDate() && dayjs(this.poll.endDate()).isAfter(dayjs())) {\n this.datepickerMinDate = this.formatDate(this.endDate());\n }\n }\n\n title() {\n return app.translator.trans('fof-polls.forum.modal.edit_title');\n }\n\n displayOptions() {\n return this.options.map((opt, i) => (\n \n
\n\n {i >= 2\n ? Button.component({\n type: 'button',\n className: 'Button PollModal--button',\n icon: 'fas fa-minus',\n onclick: i >= 2 ? this.removeOption.bind(this, i) : '',\n })\n : ''}\n \n ));\n }\n\n addOption() {\n const max = Math.max(app.forum.attribute('pollMaxOptions'), 2);\n\n if (this.options.length < max) {\n this.options.push(app.store.createRecord('poll_options'));\n this.optionAnswers.push(Stream(''));\n this.optionImageUrls.push(Stream(''));\n } else {\n alert(extractText(app.translator.trans('fof-polls.forum.modal.max', { max })));\n }\n }\n\n removeOption(i) {\n this.options.splice(i, 1);\n this.optionAnswers.splice(i, 1);\n this.optionImageUrls.splice(i, 1);\n }\n\n data() {\n const options = this.options.map((o, i) => {\n if (!o.data.attributes) o.data.attributes = {};\n\n o.data.attributes.answer = this.optionAnswers[i]();\n o.data.attributes.imageUrl = this.optionImageUrls[i]();\n\n return o.data;\n });\n\n return {\n question: this.question(),\n endDate: this.dateToTimestamp(this.endDate()),\n publicPoll: this.publicPoll(),\n hideVotes: this.hideVotes(),\n allowChangeVote: this.allowChangeVote(),\n allowMultipleVotes: this.allowMultipleVotes(),\n maxVotes: this.maxVotes(),\n options,\n };\n }\n\n onsubmit(e) {\n e.preventDefault();\n\n if (this.loading) return;\n\n this.loading = true;\n\n return this.poll\n .save(this.data())\n .then(() => {\n this.hide();\n m.redraw();\n })\n .catch((e) => {\n this.loaded();\n this.onerror(e);\n });\n }\n}\n","import app from 'flarum/forum/app';\n\nimport Component from 'flarum/common/Component';\nimport Button from 'flarum/common/components/Button';\nimport LogInModal from 'flarum/forum/components/LogInModal';\nimport ListVotersModal from './ListVotersModal';\nimport classList from 'flarum/common/utils/classList';\nimport ItemList from 'flarum/common/utils/ItemList';\nimport Tooltip from 'flarum/common/components/Tooltip';\nimport icon from 'flarum/common/helpers/icon';\nimport EditPollModal from './EditPollModal';\n\nexport default class PostPoll extends Component {\n oninit(vnode) {\n super.oninit(vnode);\n\n this.loadingOptions = false;\n\n this.useSubmitUI = !this.attrs.poll?.canChangeVote() && this.attrs.poll?.allowMultipleVotes();\n this.pendingSubmit = false;\n this.pendingOptions = null;\n }\n\n oncreate(vnode) {\n super.oncreate(vnode);\n\n this.preventClose = this.preventClose.bind(this);\n window.addEventListener('beforeunload', this.preventClose);\n }\n\n onremove(vnode) {\n super.onremove(vnode);\n\n window.removeEventListener('beforeunload', this.preventClose);\n }\n\n view() {\n const poll = this.attrs.poll;\n const options = poll.options() || [];\n let maxVotes = poll.allowMultipleVotes() ? poll.maxVotes() : 1;\n\n if (maxVotes === 0) maxVotes = options.length;\n\n const infoItems = this.infoItems(maxVotes);\n\n return (\n \n
\n
{poll.question()}
\n\n {poll.canSeeVoters() && (\n \n \n \n )}\n\n {poll.canEdit() && (\n \n \n \n )}\n {poll.canDelete() && (\n \n \n \n )}\n \n\n
\n
{options.map(this.viewOption.bind(this))}
\n\n
\n {!infoItems.isEmpty() &&
{infoItems.toArray()}
}\n\n {this.useSubmitUI && this.pendingSubmit && (\n
\n )}\n
\n
\n
\n );\n }\n\n infoItems(maxVotes) {\n const items = new ItemList();\n const poll = this.attrs.poll;\n const hasVoted = poll.myVotes()?.length > 0;\n\n if (app.session.user && !poll.canVote() && !poll.hasEnded()) {\n items.add(\n 'no-permission',\n \n \n {app.translator.trans('fof-polls.forum.no_permission')}\n \n );\n }\n\n if (poll.endDate()) {\n items.add(\n 'end-date',\n \n \n {poll.hasEnded()\n ? app.translator.trans('fof-polls.forum.poll_ended')\n : app.translator.trans('fof-polls.forum.days_remaining', { time: dayjs(poll.endDate()).fromNow() })}\n \n );\n }\n\n if (poll.canVote()) {\n items.add(\n 'max-votes',\n \n \n {app.translator.trans('fof-polls.forum.max_votes_allowed', { max: maxVotes })}\n \n );\n\n if (!poll.canChangeVote()) {\n items.add(\n 'cannot-change-vote',\n \n \n {app.translator.trans('fof-polls.forum.poll.cannot_change_vote')}\n \n );\n }\n }\n\n return items;\n }\n\n viewOption(opt) {\n const poll = this.attrs.poll;\n const hasVoted = poll.myVotes()?.length > 0;\n const totalVotes = poll.voteCount();\n\n const voted = this.pendingOptions ? this.pendingOptions.has(opt.id()) : poll.myVotes()?.some?.((vote) => vote.option() === opt);\n const votes = opt.voteCount();\n const percent = totalVotes > 0 ? Math.round((votes / totalVotes) * 100) : 0;\n\n // isNaN(null) is false, so we have to check type directly now that API always returns the field\n const canSeeVoteCount = typeof votes === 'number';\n const isDisabled = this.loadingOptions || (hasVoted && !poll.canChangeVote());\n const width = canSeeVoteCount ? percent : (Number(voted) / (poll.myVotes()?.length || 1)) * 100;\n\n const showCheckmark = !app.session.user || (!poll.hasEnded() && poll.canVote() && (!hasVoted || poll.canChangeVote()));\n\n const bar = (\n \n {showCheckmark && (\n
\n )}\n\n
\n {opt.answer()}\n {voted && !showCheckmark && icon('fas fa-check-circle', { className: 'PollAnswer-check' })}\n {canSeeVoteCount && {percent}%}\n
\n\n {opt.imageUrl() ?
: null}\n
\n );\n\n return (\n \n {canSeeVoteCount ? (\n \n {bar}\n \n ) : (\n bar\n )}\n
\n );\n }\n\n changeVote(option, evt) {\n if (!app.session.user) {\n app.modal.show(LogInModal);\n evt.target.checked = false;\n return;\n }\n\n const optionIds = this.pendingOptions || new Set(this.attrs.poll.myVotes().map?.((v) => v.option().id()));\n const isUnvoting = optionIds.delete(option.id());\n const allowsMultiple = this.attrs.poll.allowMultipleVotes();\n\n if (!allowsMultiple) {\n optionIds.clear();\n }\n\n if (!isUnvoting) {\n optionIds.add(option.id());\n }\n\n if (this.useSubmitUI) {\n this.pendingOptions = optionIds.size ? optionIds : null;\n this.pendingSubmit = !!this.pendingOptions;\n return;\n }\n\n return this.submit(optionIds, null, () => (evt.target.checked = isUnvoting));\n }\n\n onsubmit() {\n return this.submit(this.pendingOptions, () => {\n this.pendingOptions = null;\n this.pendingSubmit = false;\n });\n }\n\n submit(optionIds, cb, onerror) {\n this.loadingOptions = true;\n m.redraw();\n\n return app\n .request({\n method: 'PATCH',\n url: `${app.forum.attribute('apiUrl')}/fof/polls/${this.attrs.poll.id()}/votes`,\n body: {\n data: {\n optionIds: Array.from(optionIds),\n },\n },\n })\n .then((res) => {\n app.store.pushPayload(res);\n cb?.();\n })\n .catch((err) => {\n onerror?.(err);\n })\n .finally(() => {\n this.loadingOptions = false;\n\n m.redraw();\n });\n }\n\n showVoters() {\n // Load all the votes only when opening the votes list\n app.modal.show(ListVotersModal, {\n poll: this.attrs.poll,\n post: this.attrs.post,\n });\n }\n\n deletePoll() {\n if (confirm(app.translator.trans('fof-polls.forum.moderation.delete_confirm'))) {\n this.attrs.poll.delete().then(() => {\n m.redraw.sync();\n });\n }\n }\n\n /**\n * Attempting to use the `tooltipVisible` attr on the Tooltip component set to 'false' when no vote count\n * caused the tooltip to break on click. This is a workaround to hide the tooltip when no vote count is available,\n * called on 'onremove' of the Tooltip component. It doesn't always work as intended either, but it does the job.\n */\n hideOptionTooltip(vnode) {\n vnode.attrs.tooltipVisible = false;\n vnode.state.updateVisibility();\n }\n\n /**\n * Alert before navigating away using browser's 'beforeunload' event\n */\n preventClose(e) {\n if (this.pendingOptions) {\n e.preventDefault();\n return true;\n }\n }\n}\n","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['forum/components/DiscussionPage'];","export default function _extends() {\n _extends = Object.assign ? Object.assign.bind() : function (target) {\n for (var i = 1; i < arguments.length; i++) {\n var source = arguments[i];\n for (var key in source) {\n if (Object.prototype.hasOwnProperty.call(source, key)) {\n target[key] = source[key];\n }\n }\n }\n return target;\n };\n return _extends.apply(this, arguments);\n}","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['forum/utils/PostControls'];","import CreatePollModal from './CreatePollModal';\nimport PostPoll from './PostPoll';\nimport EditPollModal from './EditPollModal';\nimport ListVotersModal from './ListVotersModal';\n\nexport const components = {\n CreatePollModal,\n PostPoll,\n EditPollModal,\n ListVotersModal,\n};\n","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/Model'];","import Model from 'flarum/common/Model';\n\nexport default class Poll extends Model {\n question = Model.attribute('question');\n hasEnded = Model.attribute('hasEnded');\n endDate = Model.attribute('endDate');\n\n publicPoll = Model.attribute('publicPoll');\n hideVotes = Model.attribute('hideVotes');\n allowChangeVote = Model.attribute('allowChangeVote');\n allowMultipleVotes = Model.attribute('allowMultipleVotes');\n maxVotes = Model.attribute('maxVotes');\n\n voteCount = Model.attribute('voteCount');\n\n canVote = Model.attribute('canVote');\n canEdit = Model.attribute('canEdit');\n canDelete = Model.attribute('canDelete');\n canSeeVoters = Model.attribute('canSeeVoters');\n canChangeVote = Model.attribute('canChangeVote');\n\n options = Model.hasMany('options');\n votes = Model.hasMany('votes');\n myVotes = Model.hasMany('myVotes');\n\n apiEndpoint() {\n return `/fof/polls${this.exists ? `/${this.data.id}` : ''}`;\n }\n}\n","import Model from 'flarum/common/Model';\n\nexport default class PollOption extends Model {\n answer = Model.attribute('answer');\n imageUrl = Model.attribute('imageUrl');\n voteCount = Model.attribute('voteCount');\n\n poll = Model.hasOne('polls');\n votes = Model.hasMany('votes');\n\n apiEndpoint() {\n return `/fof/polls/answers${this.exists ? `/${this.data.id}` : ''}`;\n }\n}\n","import Model from 'flarum/common/Model';\n\nexport default class PollVote extends Model {\n poll = Model.hasOne('poll');\n option = Model.hasOne('option');\n user = Model.hasOne('user');\n\n pollId = Model.attribute('pollId');\n optionId = Model.attribute('optionId');\n\n apiEndpoint() {\n return `/fof/polls/${this.pollId()}/vote`;\n }\n}\n","import Poll from './Poll';\nimport PollOption from './PollOption';\nimport PollVote from './PollVote';\n\nexport const models = {\n Poll,\n PollOption,\n PollVote,\n};\n","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/extenders'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/models/Post'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/models/Forum'];","import Extend from 'flarum/common/extenders';\nimport Post from 'flarum/common/models/Post';\nimport Forum from 'flarum/common/models/Forum';\nimport Discussion from 'flarum/common/models/Discussion';\nimport Poll from './models/Poll';\nimport PollOption from './models/PollOption';\nimport PollVote from './models/PollVote';\n\nexport default [\n new Extend.Store().add('polls', Poll).add('poll_options', PollOption).add('poll_votes', PollVote),\n\n new Extend.Model(Post).hasMany('polls').attribute('canStartPoll'),\n\n new Extend.Model(Forum).attribute('canStartPolls'),\n\n new Extend.Model(Discussion).attribute('hasPoll').attribute('canStartPoll'),\n];\n","import app from 'flarum/forum/app';\n\nimport addDiscussionBadge from './addDiscussionBadge';\nimport addComposerItems from './addComposerItems';\nimport addPollsToPost from './addPollsToPost';\nimport addPostControls from './addPostControls';\n\nexport * from './components';\nexport * from './models';\n\napp.initializers.add('fof/polls', () => {\n addDiscussionBadge();\n addComposerItems();\n addPollsToPost();\n addPostControls();\n});\n\nexport { default as extend } from './extend';\n","import app from 'flarum/forum/app';\n\nimport { extend } from 'flarum/common/extend';\nimport PostControls from 'flarum/forum/utils/PostControls';\nimport CreatePollModal from './components/CreatePollModal';\nimport Button from 'flarum/common/components/Button';\n\nexport default () => {\n const createPoll = (post) =>\n app.modal.show(CreatePollModal, {\n onsubmit: (data) =>\n app.store\n .createRecord('polls')\n .save(\n {\n ...data,\n relationships: {\n post,\n },\n },\n {\n data: {\n include: 'options,myVotes,myVotes.option',\n },\n }\n )\n .then((poll) => {\n post.rawRelationship('polls')?.push?.({ type: 'polls', id: poll.id() });\n\n return poll;\n }),\n });\n\n extend(PostControls, 'moderationControls', function (items, post) {\n if (!post.isHidden() && post.canStartPoll()) {\n items.add(\n 'addPoll',\n \n );\n }\n });\n};\n","import app from 'flarum/forum/app';\n\nimport { extend } from 'flarum/common/extend';\nimport CommentPost from 'flarum/forum/components/CommentPost';\nimport PostPoll from './components/PostPoll';\nimport DiscussionPage from 'flarum/forum/components/DiscussionPage';\n\nexport default () => {\n extend(CommentPost.prototype, 'content', function (content) {\n const post = this.attrs.post;\n\n if ((!post.isHidden() || this.revealContent) && post.polls()) {\n for (const poll of post.polls()) {\n if (poll) {\n content.push();\n }\n }\n }\n });\n\n extend(CommentPost.prototype, 'oninit', function () {\n this.subtree.check(() => {\n const polls = this.attrs.post.polls();\n\n const checks = polls?.map?.(\n (poll) =>\n poll && [\n poll.data?.attributes,\n poll.options().map?.((option) => option?.data?.attributes),\n poll.myVotes().map?.((vote) => vote.option()?.id()),\n ]\n );\n\n return JSON.stringify(checks);\n });\n });\n\n extend(DiscussionPage.prototype, 'oncreate', function () {\n if (app.pusher) {\n app.pusher.then((binding) => {\n // We will listen for updates to all polls and options\n // Even if that model is not in the current discussion, it doesn't really matter\n binding.channels.main.bind('updatedPollOptions', (data) => {\n const poll = app.store.getById('polls', data['pollId']);\n\n if (poll) {\n poll.pushAttributes({\n voteCount: data['pollVoteCount'],\n });\n\n // Not redrawing here, as the option below should trigger the redraw already\n }\n\n const changedOptions = data['options'];\n\n for (const optionId in changedOptions) {\n const option = app.store.getById('poll_options', optionId);\n\n if (option && option.voteCount() !== undefined) {\n option.pushAttributes({\n voteCount: changedOptions[optionId],\n });\n }\n }\n\n m.redraw();\n });\n });\n }\n });\n\n extend(DiscussionPage.prototype, 'onremove', function () {\n if (app.pusher) {\n app.pusher.then((binding) => {\n binding.channels.main.unbind('updatedPollOptions');\n });\n }\n });\n};\n"],"names":["__webpack_require__","module","getter","__esModule","d","a","exports","definition","key","o","Object","defineProperty","enumerable","get","obj","prop","prototype","hasOwnProperty","call","Symbol","toStringTag","value","flarum","core","compat","_setPrototypeOf","p","setPrototypeOf","bind","__proto__","_inheritsLoose","subClass","superClass","create","constructor","CreatePollModal","_Modal","apply","arguments","_proto","oninit","vnode","_this","this","options","Stream","optionImageUrls","question","endDate","publicPoll","hideVotes","allowChangeVote","allowMultipleVotes","maxVotes","datepickerMinDate","formatDate","undefined","poll","attrs","Array","isArray","forEach","option","push","answer","imageUrl","dayjs","isAfter","title","app","trans","className","content","m","fields","toArray","items","ItemList","add","type","name","bidi","Button","icon","onclick","addOption","displayOptions","min","max","class","isBefore","time","fromNow","Switch","state","onchange","disabled","length","loading","_this2","keys","map","el","i","placeholder","attribute","removeOption","Math","alert","extractText","splice","data","_this3","dateToTimestamp","index","onsubmit","e","_this4","preventDefault","promise","Promise","then","hide","err","console","error","onerror","loaded","close","date","def","dayjsDate","isValid","format","Modal","addToComposer","composer","addPoll","show","extend","_this$composer$body","_this$composer$body$a","_discussion$canStartP","discussion","body","canStartPoll","canStartPolls","classList","ListVotersModal","find","id","include","redraw","LoadingIndicator","optionContent","opt","votes","filter","v","voteContent","vote","user","href","Link","avatar","username","EditPollModal","_CreatePollModal","optionAnswers","createRecord","attributes","save","PostPoll","_Component","_this$attrs$poll","_this$attrs$poll2","loadingOptions","useSubmitUI","canChangeVote","pendingSubmit","pendingOptions","oncreate","preventClose","window","addEventListener","onremove","removeEventListener","view","infoItems","canSeeVoters","Tooltip","text","showVoters","canEdit","canDelete","deletePoll","viewOption","isEmpty","_poll$myVotes","hasVoted","myVotes","canVote","hasEnded","_poll$myVotes2","_poll$myVotes3","_poll$myVotes4","totalVotes","voteCount","voted","has","some","percent","round","canSeeVoteCount","isDisabled","width","Number","showCheckmark","bar","style","changeVote","checked","src","alt","count","hideOptionTooltip","evt","_this$attrs$poll$myVo","_this$attrs$poll$myVo2","LogInModal","target","optionIds","Set","isUnvoting","clear","size","submit","cb","method","url","from","res","pushPayload","post","confirm","sync","tooltipVisible","updateVisibility","Component","_extends","assign","source","components","Poll","_Model","_len","args","_key","concat","Model","apiEndpoint","exists","PollOption","PollVote","pollId","optionId","models","Extend","Post","hasMany","Forum","Discussion","createPoll","DiscussionList","params","badges","hasPoll","Badge","label","DiscussionComposer","ReplyComposer","CommentPost","isHidden","revealContent","polls","_step","_iterator","_createForOfIteratorHelperLoose","done","subtree","check","checks","_poll$data","_poll$options$map","_poll$options","_poll$myVotes$map","_option$data","_vote$option","JSON","stringify","DiscussionPage","binding","channels","main","getById","pushAttributes","changedOptions","unbind","relationships","_post$rawRelationship","rawRelationship","PostControls"],"sourceRoot":""}
\ No newline at end of file