From e859ea4711db67b0e432b9923973dde469bcc5a5 Mon Sep 17 00:00:00 2001 From: flarum-bot Date: Mon, 7 Oct 2024 12:28:15 +0000 Subject: [PATCH] Bundled output for commit c86833eda11895f2766fff589be07292c96c2cc7 Includes transpiled JS/TS, and Typescript declaration files (typings). [skip ci] --- js/dist/forum.js | 2 +- js/dist/forum.js.map | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/js/dist/forum.js b/js/dist/forum.js index a09ca241..694ebf50 100644 --- 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={24:(t,o,e)=>{var n=e(735).default;function r(){"use strict";t.exports=r=function(){return e},t.exports.__esModule=!0,t.exports.default=t.exports;var o,e={},a=Object.prototype,l=a.hasOwnProperty,s=Object.defineProperty||function(t,o,e){t[o]=e.value},i="function"==typeof Symbol?Symbol:{},u=i.iterator||"@@iterator",c=i.asyncIterator||"@@asyncIterator",p=i.toStringTag||"@@toStringTag";function m(t,o,e){return Object.defineProperty(t,o,{value:e,enumerable:!0,configurable:!0,writable:!0}),t[o]}try{m({},"")}catch(o){m=function(t,o,e){return t[o]=e}}function d(t,o,e,n){var r=o&&o.prototype instanceof w?o:w,a=Object.create(r.prototype),l=new M(n||[]);return s(a,"_invoke",{value:S(t,e,l)}),a}function f(t,o,e){try{return{type:"normal",arg:t.call(o,e)}}catch(t){return{type:"throw",arg:t}}}e.wrap=d;var h="suspendedStart",v="suspendedYield",g="executing",b="completed",y={};function w(){}function P(){}function N(){}var x={};m(x,u,(function(){return this}));var _=Object.getPrototypeOf,V=_&&_(_(L([])));V&&V!==a&&l.call(V,u)&&(x=V);var I=N.prototype=w.prototype=Object.create(x);function A(t){["next","throw","return"].forEach((function(o){m(t,o,(function(t){return this._invoke(o,t)}))}))}function C(t,o){function e(r,a,s,i){var u=f(t[r],t,a);if("throw"!==u.type){var c=u.arg,p=c.value;return p&&"object"==n(p)&&l.call(p,"__await")?o.resolve(p.__await).then((function(t){e("next",t,s,i)}),(function(t){e("throw",t,s,i)})):o.resolve(p).then((function(t){c.value=t,s(c)}),(function(t){return e("throw",t,s,i)}))}i(u.arg)}var r;s(this,"_invoke",{value: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 S(t,e,n){var r=h;return function(a,l){if(r===g)throw Error("Generator is already running");if(r===b){if("throw"===a)throw l;return{value:o,done:!0}}for(n.method=a,n.arg=l;;){var s=n.delegate;if(s){var i=O(s,n);if(i){if(i===y)continue;return i}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(r===h)throw r=b,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);r=g;var u=f(t,e,n);if("normal"===u.type){if(r=n.done?b:v,u.arg===y)continue;return{value:u.arg,done:n.done}}"throw"===u.type&&(r=b,n.method="throw",n.arg=u.arg)}}}function O(t,e){var n=e.method,r=t.iterator[n];if(r===o)return e.delegate=null,"throw"===n&&t.iterator.return&&(e.method="return",e.arg=o,O(t,e),"throw"===e.method)||"return"!==n&&(e.method="throw",e.arg=new TypeError("The iterator does not provide a '"+n+"' method")),y;var a=f(r,t.iterator,e.arg);if("throw"===a.type)return e.method="throw",e.arg=a.arg,e.delegate=null,y;var l=a.arg;return l?l.done?(e[t.resultName]=l.value,e.next=t.nextLoc,"return"!==e.method&&(e.method="next",e.arg=o),e.delegate=null,y):l:(e.method="throw",e.arg=new TypeError("iterator result is not an object"),e.delegate=null,y)}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 E(t){var o=t.completion||{};o.type="normal",delete o.arg,t.completion=o}function M(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(k,this),this.reset(!0)}function L(t){if(t||""===t){var e=t[u];if(e)return e.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var r=-1,a=function e(){for(;++r=0;--r){var a=this.tryEntries[r],s=a.completion;if("root"===a.tryLoc)return n("end");if(a.tryLoc<=this.prev){var i=l.call(a,"catchLoc"),u=l.call(a,"finallyLoc");if(i&&u){if(this.prev=0;--e){var n=this.tryEntries[e];if(n.tryLoc<=this.prev&&l.call(n,"finallyLoc")&&this.prev=0;--o){var e=this.tryEntries[o];if(e.finallyLoc===t)return this.complete(e.completion,e.afterLoc),E(e),y}},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;E(e)}return r}}throw Error("illegal catch attempt")},delegateYield:function(t,e,n){return this.delegate={iterator:L(t),resultName:e,nextLoc:n},"next"===this.method&&(this.arg=o),y}},e}t.exports=r,t.exports.__esModule=!0,t.exports.default=t.exports},735: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},183:(t,o,e)=>{var n=e(24)();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.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";e.r(n),e.d(n,{components:()=>_o,extend:()=>qo,models:()=>Eo,states:()=>Mo,utils:()=>Lo});const t=flarum.core.compat["forum/app"];var o=e.n(t);const r=flarum.core.compat["common/extend"],a=flarum.core.compat["common/components/Badge"];var l=e.n(a);const s=flarum.core.compat["forum/components/DiscussionList"];var i=e.n(s);const u=flarum.core.compat["common/models/Discussion"];var c=e.n(u);const p=flarum.core.compat["common/utils/classList"];var d=e.n(p);const f=flarum.core.compat["forum/components/DiscussionComposer"];var h=e.n(f);const v=flarum.core.compat["forum/components/ReplyComposer"];var g=e.n(v);function b(t,o,e,n,r,a,l){try{var s=t[a](l),i=s.value}catch(t){return void e(t)}s.done?o(i):Promise.resolve(i).then(n,r)}function y(t){return function(){var o=this,e=arguments;return new Promise((function(n,r){var a=t.apply(o,e);function l(t){b(a,n,r,l,s,"next",t)}function s(t){b(a,n,r,l,s,"throw",t)}l(void 0)}))}}function w(t,o){return w=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,o){return t.__proto__=o,t},w(t,o)}function P(t,o){t.prototype=Object.create(o.prototype),t.prototype.constructor=t,w(t,o)}var N=e(183),x=e.n(N);const _=flarum.core.compat["common/components/Modal"];var V=e.n(_);const I=flarum.core.compat["common/Component"];var A=e.n(I);const C=flarum.core.compat["common/components/Button"];var S=e.n(C);const O=flarum.core.compat["common/components/Switch"];var k=e.n(O);const E=flarum.core.compat["common/utils/ItemList"];var M=e.n(E);const L=flarum.core.compat["common/utils/Stream"];var U=e.n(L);const D=flarum.core.compat["common/utils/extractText"];var B=e.n(D);function T(t){return T=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},T(t)}function j(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return(j=function(){return!!t})()}function F(t){var o="function"==typeof Map?new Map:void 0;return F=function(t){if(null===t||!function(t){try{return-1!==Function.toString.call(t).indexOf("[native code]")}catch(o){return"function"==typeof t}}(t))return t;if("function"!=typeof t)throw new TypeError("Super expression must either be null or a function");if(void 0!==o){if(o.has(t))return o.get(t);o.set(t,e)}function e(){return function(t,o,e){if(j())return Reflect.construct.apply(null,arguments);var n=[null];n.push.apply(n,o);var r=new(t.bind.apply(t,n));return e&&w(r,e.prototype),r}(t,arguments,T(this).constructor)}return e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),w(e,t)},F(t)}var q=function(t){function o(o){return t.call(this,o+"")||this}return P(o,t),o}(F(Error)),H=function(){function t(o){this.poll=void 0,this.loading=void 0,this.deleting=void 0,this.expandedGroup=void 0,o||(o=t.createNewPoll()),this.loading=!1,this.deleting=!1,this.poll=o,this.expandedGroup="setup"}t.createNewPoll=function(){var t=o().store.createRecord("polls");return t.pushAttributes({question:"",endDate:"",publicPoll:!1,allowMultipleVotes:!1,hideVotes:!1,allowChangeVote:!1,maxVotes:0}),t.tempOptions=[o().store.createRecord("poll_options"),o().store.createRecord("poll_options")],t};var e=t.prototype;return e.isExpanded=function(t){return this.expandedGroup===t},e.expand=function(t){this.expandedGroup=t,m.redraw()},e.save=function(){var t=y(x().mark((function t(o){return x().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return this.loading=!0,m.redraw(),t.prev=2,t.next=5,this.poll.save(o);case 5:this.poll=t.sent,delete this.poll.data.attributes.options;case 7:return t.prev=7,this.loading=!1,m.redraw(),t.finish(7);case 11:case"end":return t.stop()}}),t,this,[[2,,7,11]])})));return function(o){return t.apply(this,arguments)}}(),e.delete=function(){var t=y(x().mark((function t(){return x().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return this.loading=!0,m.redraw(),t.prev=2,t.next=5,this.poll.delete();case 5:this.deleting=!0;case 6:return t.prev=6,this.loading=!1,m.redraw(),t.finish(6);case 10:case"end":return t.stop()}}),t,this,[[2,,6,10]])})));return function(){return t.apply(this,arguments)}}(),t}();const R=flarum.core.compat["common/components/Page"];var G=e.n(R);const z=flarum.core.compat["common/components/LoadingIndicator"];var Y=e.n(z);const Q=flarum.core.compat["common/components/LinkButton"];var J=e.n(Q),W=function(t){function e(){for(var o,e=arguments.length,n=new Array(e),r=0;r0?Math.round(this.votes/this.totalVotes*100):0},n.view=function(){var t;this.hasVoted=this.state.hasVoted(),this.totalVotes=this.state.overallVoteCount(),this.votes=this.option.voteCount(),this.voted=this.state.hasVotedFor(this.option);var e=this.state.loadingOptions||this.hasVoted&&!this.poll.canChangeVote(),n=this.canSeeVoteCount?this.percent():Number(this.voted)/((null==(t=this.poll.myVotes())?void 0:t.length)||1)*100,r=m("label",{className:"PollBar","data-selected":!!this.voted,style:"--poll-option-width: "+n+"%"},this.state.showCheckMarks&&m("div",{className:"PollAnswer-checkbox"},m("input",{className:"PollAnswer-input sr-only",type:"checkbox",id:this.option.id(),name:this.name,value:this.answer,checked:this.voted,disabled:e,"aria-labelledby":this.name+"-"+this.option.id()+"-label",onchange:this.state.changeVote.bind(this.state,this.option)}),m("span",{className:"checkmark"})),m("div",{className:"PollAnswer-text"},this.optionDisplayItems().toArray()),this.option.imageUrl()?m("img",{className:"PollAnswer-image",src:this.option.imageUrl(),alt:this.option.answer(),loading:"lazy"}):null);return m("div",{className:d()("PollOption",this.hasVoted&&"PollVoted",this.option.imageUrl()&&"PollOption-hasImage"),"data-id":this.option.id()},this.canSeeVoteCount?m(yt(),{text:o().translator.trans("fof-polls.forum.tooltip.votes",{count:this.votes}),onremove:this.hideOptionTooltip},r):r)},n.hideOptionTooltip=function(t){t.attrs.tooltipVisible=!1,t.state.updateVisibility()},n.optionDisplayItems=function(){var t=new(M());return t.add("answer",m("span",{className:"PollAnswer-text-answer",id:this.name+"-"+this.option.id()+"-label"},this.answer)),this.voted&&!this.state.showCheckMarks&&t.add("check",ht()("fas fa-check-circle",{className:"PollAnswer-check"})),this.canSeeVoteCount&&t.add("percent",m("span",{className:d()("PollPercent",100!==this.percent()&&"PollPercent--option")},this.percent(),"%")),t},e}(A()),Pt=function(t){function o(){return t.apply(this,arguments)||this}P(o,t);var e=o.prototype;return e.view=function(){return m("div",{className:"Poll-options list-layout"},this.pollOptions().toArray())},e.pollOptions=function(){var t=this,o=new(M());return this.attrs.options.forEach((function(e){o.add("option"+e.id(),t.createOptionView(e))})),o},e.createOptionView=function(t){return m(wt,{name:this.attrs.name,option:t,state:this.attrs.state})},o}(A()),Nt=function(t){function o(){for(var o,e=arguments.length,n=new Array(e),r=0;r0},e.overallVoteCount=function(){return this.poll.voteCount()},e.hasVotedFor=function(t){return this.pendingOptions?this.pendingOptions.has(t.id()):this.poll.myVotes().some((function(o){return o.option()===t}))},e.getMaxVotes=function(){var t=this.poll,o=t.allowMultipleVotes()?t.maxVotes():1;return 0===o&&(o=t.options().length),o},e.showButton=function(){return this.useSubmitUI&&this.pendingSubmit},e.changeVote=function(t,e){var n=e.target;if(!o().session.user)return o().modal.show(_t()),void(n.checked=!1);var r=this.pendingOptions||new Set(this.poll.myVotes().map((function(t){return t.option().id()}))),a=r.delete(t.id());if(this.poll.allowMultipleVotes()||r.clear(),a||r.add(t.id()),this.pendingOptions=r.size?r:null,this.pendingSubmit=!!this.pendingOptions,this.useSubmitUI)return this.pendingOptions=r.size?r:null,this.pendingSubmit=!!this.pendingOptions,void m.redraw();this.submit(r,null,(function(){return n.checked=a}))},e.hasSelectedOptions=function(){return this.pendingSubmit},e.onsubmit=function(){var t=this;return this.submit(this.pendingOptions,(function(){t.pendingOptions=null,t.pendingSubmit=!1}))},e.submit=function(t,e,n){var r=this;return void 0===n&&(n=null),this.loadingOptions=!0,m.redraw(),o().request({method:"PATCH",url:o().forum.attribute("apiUrl")+"/fof/polls/"+this.poll.id()+"/votes",body:{data:{optionIds:Array.from(t)}}}).then((function(t){o().store.pushPayload(t),null==e||e()})).catch((function(t){null==n||n(t)})).finally((function(){r.loadingOptions=!1,r.canSeeVoteCount="number"==typeof r.poll.voteCount(),m.redraw()}))},t}(),kt=function(t){function e(){return t.apply(this,arguments)||this}P(e,t);var n=e.prototype;return n.view=function(){var t=this,e=this.attrs.state;return m(S(),{className:"Button Button--primary Poll-submit",loading:e.loadingOptions,onclick:function(o){return t.pollButtonSubmit(e,o)},disabled:!e.hasSelectedOptions()},o().translator.trans("fof-polls.forum.poll.submit_button"))},n.pollButtonSubmit=function(t,o){t.onsubmit()},e}(A());const Et=flarum.core.compat["common/utils/string"];var Mt=function(t){function o(){return t.apply(this,arguments)||this}P(o,t);var e=o.prototype;return e.view=function(){return m("div",{className:"Poll-title-component"},this.pollTitleItems().toArray())},e.pollTitleItems=function(){var t=new(M());return t.add("title",m("h3",{className:"Poll-title"},this.attrs.poll.question())),t},o}(A()),Lt=function(t){function o(){return t.apply(this,arguments)||this}P(o,t);var e=o.prototype;return e.view=function(){if(this.attrs.poll.subtitle())return m("div",{className:"Poll-subtitle-component"},this.pollSubtitleItems().toArray())},e.pollSubtitleItems=function(){var t=new(M());return t.add("subtitle",m("p",{className:"Poll-subtitle"},this.attrs.poll.subtitle())),t},o}(A()),Ut=function(t){function e(){for(var o,e=arguments.length,n=new Array(e),r=0;rt.length)&&(o=t.length);for(var e=0,n=Array(o);e=t.length?{done:!0}:{done:!1,value:t[n++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}(this.pages);!(o=e()).done;){var n=o.value,r=n.items.indexOf(t);if(-1!==r){n.items.splice(r,1);break}}var a=this.extraPolls.indexOf(t);-1!==a&&this.extraPolls.splice(a),m.redraw()},n.addPoll=function(t){this.removePoll(t),this.extraPolls.unshift(t),m.redraw()},n.getAllItems=function(){return this.extraPolls.concat(t.prototype.getAllItems.call(this))},n.getPages=function(){var o=t.prototype.getPages.call(this);return this.extraPolls.length?[{number:-1,items:this.extraPolls}].concat(o):o},jt(e,[{key:"type",get:function(){return"fof/polls"}}])}(Qt()),Zt=function(t){function e(){return t.apply(this,arguments)||this}P(e,t);var n=e.prototype;return n.oninit=function(e){t.prototype.oninit.call(this,e),o().forum.attribute("globalPollsEnabled")?(this.state=new Xt({sort:m.route.param("sort"),filter:m.route.param("filter")}),this.state.refresh(),o().setTitle(B()(o().translator.trans("fof-polls.forum.page.nav")))):m.route.set("/")},n.view=function(){return this.loading?m(Y(),null):this.poll?m("div",{className:"PollsListPage"},m("div",{className:"container"},m(Ut,{poll:this.poll}))):m("div",{className:"PollsListPage"},t.prototype.hero.call(this),m("div",{className:"container"},m("div",{className:"sideNavContainer"},m("nav",{className:"PollsListPage-nav sideNav"},m("ul",null,X()(this.sidebarItems().toArray()))),m("div",{className:"PollsPage-results sideNavOffset"},m("div",{className:"IndexPage-toolbar"},m("ul",{className:"IndexPage-toolbar-view"},X()(this.viewItems().toArray())),m("ul",{className:"IndexPage-toolbar-action"},X()(this.actionItems().toArray()))),m(zt,{state:this.state})))))},n.sidebarItems=function(){var t=this,e=new(M()),n=o().forum.attribute("canStartGlobalPolls");return e.add("newGlobalPoll",m(S(),{icon:"fas fa-edit",className:"Button Button--primary App-primaryControl PollsPage-newPoll",itemClassName:"App-primaryControl",onclick:function(){t.newPollAction()},disabled:!n},o().translator.trans("fof-polls.forum.poll."+(n?"start_poll_button":"cannot_start_poll_button")))),e.add("nav",m(tt(),{buttonClassName:"Button",className:"App-titleControl",accessibleToggleLabel:o().translator.trans("core.forum.index.toggle_sidenav_dropdown_accessible_label")},this.navItems().toArray())),e},n.actionItems=function(){var t=this,e=new(M());return e.add("refresh",S().component({title:o().translator.trans("fof-polls.forum.page.refresh_tooltip"),icon:"fas fa-sync",className:"Button Button--icon",onclick:function(){t.state.refresh()}})),e},n.viewItems=function(){return et().prototype.viewItems()},n.navItems=function(){return et().prototype.navItems()},n.newPollAction=function(){o().session.user?m.route.set(o().route("fof.polls.compose")):o().modal.show(_t())},e}(qt);const to=flarum.core.compat["common/components/Separator"];var oo=e.n(to);const eo={controls:function(t,o){var e=this,n=new(M());return["poll","moderation","destructive"].forEach((function(r){var a=e[r+"Controls"](t,o).toArray();a.length&&(a.forEach((function(t){return n.add(t.itemName,t)})),n.add(r+"Separator",m(oo(),null)))})),n},pollControls:function(t,o){return new(M())},moderationControls:function(t,e){var n=new(M());return t.canEdit()&&n.add("edit",m(S(),{icon:"fas fa-pencil-alt",onclick:this.editAction.bind(this,t)},o().translator.trans("fof-polls.forum.poll_controls.edit_label"))),n},destructiveControls:function(t,e){var n=new(M());return t.canDelete()&&n.add("delete",m(S(),{icon:"far fa-trash-alt",onclick:this.deleteAction.bind(this,t)},o().translator.trans("fof-polls.forum.poll_controls.delete_label"))),n},deleteAction:function(t){var e=this;return y(x().mark((function n(){return x().wrap((function(n){for(;;)switch(n.prev=n.next){case 0:if(confirm(o().translator.trans("fof-polls.forum.poll_controls.delete_confirmation"))){n.next=2;break}return n.abrupt("return");case 2:return n.abrupt("return",t.delete().then((function(){e.showDeletionAlert(t,"success"),o().current.matches(nt,{id:t.id()})||o().current.matches(Zt,{id:t.id()})?o().history.back():window.location.reload()})).catch((function(){return e.showDeletionAlert(t,"error")})));case 3:case"end":return n.stop()}}),n)})))()},showDeletionAlert:function(t,e){var n={success:"fof-polls.forum.poll_controls.delete_success_message",error:"fof-polls.forum.poll_controls.delete_error_message"}[e];o().alerts.show({type:e},o().translator.trans(n,{poll:t}))},editAction:function(t){m.route.set(o().route("fof.polls.compose",{id:t.id()}))}};function no(){return no=Object.assign?Object.assign.bind():function(t){for(var o=1;o'),this.$input.appendTo("body").hide().trigger("click").on("change",(function(e){var n=new FormData;n.append(t.attrs.name,$(e.target)[0].files[0]),t.loading=!0,m.redraw(),o().request({method:"POST",url:t.resourceUrl(),serialize:function(t){return t},body:n}).then(t.success.bind(t),t.failure.bind(t))})))},n.remove=function(){var t,e,n=this;this.loading=!0,m.redraw();var r=void 0;null!=(t=this.attrs.poll)&&t.exists||null!=(e=this.attrs.option)&&e.exists||(r=this.fileName),o().request({method:"DELETE",url:this.resourceUrl(r)}).then((function(t){var o,e;return null!=(o=n.attrs.poll)&&o.exists&&n.attrs.poll.pushAttributes({image:null,imageUrl:null,isImageUpload:!1}),null!=(e=n.attrs.option)&&e.exists&&n.attrs.option.pushAttributes({imageUrl:!1}),t})).then(this.success.bind(this),this.failure.bind(this))},n.resourceUrl=function(t){void 0===t&&(t=void 0);var e=o().forum.attribute("apiUrl")+"/fof/polls/"+this.attrs.name,n=this.attrs.poll,r=this.attrs.option;return t?e+="/name/"+t:(null!=n&&n.exists&&(e+="/"+(null==n?void 0:n.id())),null!=r&&r.exists&&(e+="/"+(null==r?void 0:r.id()))),e},n.getImageUrl=function(){var t,o;return!1!==this.uploadedImageUrl?this.uploadedImageUrl:(null==(t=this.attrs.poll)?void 0:t.imageUrl())||(null==(o=this.attrs.option)?void 0:o.imageUrl())},n.success=function(t){var o,e,n;this.loading=!1,this.uploadedImageUrl=null==t?void 0:t.fileUrl,this.fileName=null==t?void 0:t.fileName,null==(o=(e=this.attrs).onUpload)||o.call(e,null==t?void 0:t.fileName),m.redraw(),null==(n=this.$input)||n.remove()},n.failure=function(t){var o;this.loading=!1,m.redraw(),null==(o=this.$input)||o.remove()},e}(S());const ao=flarum.core.compat["common/utils/RequestError"];var lo=e.n(ao),so=function(t){function e(){for(var o,e=arguments.length,n=new Array(e),r=0;r=2?S().component({type:"button",className:"Button PollModal--button Button--icon",icon:"fas fa-minus",onclick:r>=2?t.removeOption.bind(t,r):""}):""))})),e},n.addOption=function(){var t=Math.max(o().forum.attribute("pollMaxOptions"),2);this.options.length0;return!o().session.user||r.canVote()||r.hasEnded()||n.add("no-permission",m("span",null,m("i",{className:"icon fas fa-times-circle fa-fw"}),o().translator.trans("fof-polls.forum.no_permission"))),r.endDate()&&n.add("end-date",m("span",null,m("i",{class:"icon fas fa-clock fa-fw"}),r.hasEnded()?o().translator.trans("fof-polls.forum.poll_ended"):o().translator.trans("fof-polls.forum.days_remaining",{time:dayjs(r.endDate()).fromNow()}))),r.canVote()&&(n.add("max-votes",m("span",null,m("i",{className:"icon fas fa-poll fa-fw"}),o().translator.trans("fof-polls.forum.max_votes_allowed",{max:t}))),r.canChangeVote()||n.add("cannot-change-vote",m("span",null,m("i",{className:"icon fas fa-"+(a?"times":"exclamation")+"-circle fa-fw"}),o().translator.trans("fof-polls.forum.poll.cannot_change_vote")))),n},n.viewOption=function(t){var e,n,r,a=this.attrs.poll,l=(null==(e=a.myVotes())?void 0:e.length)>0,s=a.voteCount(),i=this.pendingOptions?this.pendingOptions.has(t.id()):null==(n=a.myVotes())||null==n.some?void 0:n.some((function(o){return o.option()===t})),u=t.voteCount(),c=s>0?Math.round(u/s*100):0,p="number"==typeof u,f=this.loadingOptions||l&&!a.canChangeVote(),h=p?c:Number(i)/((null==(r=a.myVotes())?void 0:r.length)||1)*100,v=!o().session.user||!a.hasEnded()&&a.canVote()&&(!l||a.canChangeVote()),g=m("div",{className:"PollBar","data-selected":!!i,style:"--poll-option-width: "+h+"%"},v&&m("label",{className:"PollAnswer-checkbox"},m("input",{onchange:this.changeVote.bind(this,t),type:"checkbox",checked:i,disabled:f}),m("span",{className:"checkmark"})),m("div",{className:"PollAnswer-text"},m("span",{className:"PollAnswer-text-answer"},t.answer()),i&&!v&&ht()("fas fa-check-circle",{className:"PollAnswer-check"}),p&&m("span",{className:d()("PollPercent",100!==c&&"PollPercent--option")},c,"%")),t.imageUrl()?m("img",{className:"PollAnswer-image",src:t.imageUrl(),alt:t.answer(),loading:"lazy"}):null);return m("div",{className:d()("PollOption",l&&"PollVoted",a.hasEnded()&&"PollEnded",t.imageUrl()&&"PollOption-hasImage"),"data-id":t.id()},p?m(yt(),{text:o().translator.trans("fof-polls.forum.tooltip.votes",{count:u}),onremove:this.hideOptionTooltip},g):g)},n.changeVote=function(t,e){var n,r;if(!o().session.user)return o().modal.show(_t()),void(e.target.checked=!1);var a=this.pendingOptions||new Set(null==(n=(r=this.attrs.poll.myVotes()).map)?void 0:n.call(r,(function(t){return t.option().id()}))),l=a.delete(t.id());return this.attrs.poll.allowMultipleVotes()||a.clear(),l||a.add(t.id()),this.useSubmitUI?(this.pendingOptions=a.size?a:null,void(this.pendingSubmit=!!this.pendingOptions)):this.submit(a,null,(function(){return e.target.checked=l}))},n.onsubmit=function(){var t=this;return this.submit(this.pendingOptions,(function(){t.pendingOptions=null,t.pendingSubmit=!1}))},n.submit=function(t,e,n){var r=this;return this.loadingOptions=!0,m.redraw(),o().request({method:"PATCH",url:o().forum.attribute("apiUrl")+"/fof/polls/"+this.attrs.poll.id()+"/votes",body:{data:{optionIds:Array.from(t)}}}).then((function(t){o().store.pushPayload(t),null==e||e()})).catch((function(t){null==n||n(t)})).finally((function(){r.loadingOptions=!1,m.redraw()}))},n.showVoters=function(){o().modal.show(St,{poll:this.attrs.poll,post:this.attrs.post})},n.deletePoll=function(){confirm(B()(o().translator.trans("fof-polls.forum.moderation.delete_confirm")))&&this.attrs.poll.delete().then((function(){m.redraw.sync()}))},n.hideOptionTooltip=function(t){t.attrs.tooltipVisible=!1,t.state.updateVisibility()},n.preventClose=function(t){if(this.pendingOptions)return t.preventDefault(),!0},e}(A());function bo(t,o){(null==o||o>t.length)&&(o=t.length);for(var e=0,n=Array(o);e=t.length?{done:!0}:{done:!1,value:t[n++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}(o.polls());!(e=n()).done;){var r=e.value;r&&t.push(m(go,{post:o,poll:r}))}})),(0,r.extend)(mo().prototype,"oninit",(function(){var t=this;this.subtree.check((function(){var o=t.attrs.post.polls(),e=null==o||null==o.map?void 0:o.map((function(t){var o,e,n,r,a;return t&&[null==(o=t.data)?void 0:o.attributes,null==(e=(n=t.options()).map)?void 0:e.call(n,(function(t){var o;return null==t||null==(o=t.data)?void 0:o.attributes})),null==(r=(a=t.myVotes()).map)?void 0:r.call(a,(function(t){var o;return null==(o=t.option())?void 0:o.id()}))]}));return JSON.stringify(e)}))})),(0,r.extend)(ho().prototype,"oncreate",(function(){o().pusher&&o().pusher.then((function(t){t.channels.main.bind("updatedPollOptions",(function(t){var e=o().store.getById("polls",t.pollId);e&&e.pushAttributes({voteCount:t.pollVoteCount});var n=t.options;for(var r in n){var a=o().store.getById("poll_options",r);a&&void 0!==a.voteCount()&&a.pushAttributes({voteCount:n[r]})}m.redraw()}))}))})),(0,r.extend)(ho().prototype,"onremove",(function(){o().pusher&&o().pusher.then((function(t){t.channels.main.unbind("updatedPollOptions")}))})),t=function(t){return o().modal.show(io,{onsubmit:function(e){return o().store.createRecord("polls").save(no({},e,{relationships:{post:t}}),{data:{include:"options,myVotes,myVotes.option"}}).then((function(o){var e;return null==(e=t.rawRelationship("polls"))||null==e.push||e.push({type:"polls",id:o.id()}),o}))}})},(0,r.extend)(wo(),"moderationControls",(function(e,n){!n.isHidden()&&n.canStartPoll()&&e.add("addPoll",m(S(),{icon:"fas fa-poll",onclick:t.bind(this,n)},o().translator.trans("fof-polls.forum.moderation.add")))})),(0,r.extend)(et().prototype,"navItems",(function(t){o().forum.attribute("globalPollsEnabled")&&(t.add("fof-polls-showcase",J().component({href:o().route("fof.polls.showcase"),icon:"fas fa-poll"},o().translator.trans("fof-polls.forum.page.nav")),35),o().forum.attribute("canStartGlobalPolls")&&t.add("fof-polls-list",J().component({href:o().route("fof.polls.list"),icon:"fas fa-list"},o().translator.trans("fof-polls.forum.page.nav-all")),32))}))}))})(),module.exports=n})(); +(()=>{var t={24:(t,o,e)=>{var n=e(735).default;function r(){"use strict";t.exports=r=function(){return e},t.exports.__esModule=!0,t.exports.default=t.exports;var o,e={},a=Object.prototype,l=a.hasOwnProperty,s=Object.defineProperty||function(t,o,e){t[o]=e.value},i="function"==typeof Symbol?Symbol:{},u=i.iterator||"@@iterator",c=i.asyncIterator||"@@asyncIterator",p=i.toStringTag||"@@toStringTag";function m(t,o,e){return Object.defineProperty(t,o,{value:e,enumerable:!0,configurable:!0,writable:!0}),t[o]}try{m({},"")}catch(o){m=function(t,o,e){return t[o]=e}}function d(t,o,e,n){var r=o&&o.prototype instanceof w?o:w,a=Object.create(r.prototype),l=new M(n||[]);return s(a,"_invoke",{value:S(t,e,l)}),a}function f(t,o,e){try{return{type:"normal",arg:t.call(o,e)}}catch(t){return{type:"throw",arg:t}}}e.wrap=d;var h="suspendedStart",v="suspendedYield",g="executing",b="completed",y={};function w(){}function P(){}function N(){}var x={};m(x,u,(function(){return this}));var _=Object.getPrototypeOf,I=_&&_(_(L([])));I&&I!==a&&l.call(I,u)&&(x=I);var V=N.prototype=w.prototype=Object.create(x);function A(t){["next","throw","return"].forEach((function(o){m(t,o,(function(t){return this._invoke(o,t)}))}))}function C(t,o){function e(r,a,s,i){var u=f(t[r],t,a);if("throw"!==u.type){var c=u.arg,p=c.value;return p&&"object"==n(p)&&l.call(p,"__await")?o.resolve(p.__await).then((function(t){e("next",t,s,i)}),(function(t){e("throw",t,s,i)})):o.resolve(p).then((function(t){c.value=t,s(c)}),(function(t){return e("throw",t,s,i)}))}i(u.arg)}var r;s(this,"_invoke",{value: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 S(t,e,n){var r=h;return function(a,l){if(r===g)throw Error("Generator is already running");if(r===b){if("throw"===a)throw l;return{value:o,done:!0}}for(n.method=a,n.arg=l;;){var s=n.delegate;if(s){var i=O(s,n);if(i){if(i===y)continue;return i}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(r===h)throw r=b,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);r=g;var u=f(t,e,n);if("normal"===u.type){if(r=n.done?b:v,u.arg===y)continue;return{value:u.arg,done:n.done}}"throw"===u.type&&(r=b,n.method="throw",n.arg=u.arg)}}}function O(t,e){var n=e.method,r=t.iterator[n];if(r===o)return e.delegate=null,"throw"===n&&t.iterator.return&&(e.method="return",e.arg=o,O(t,e),"throw"===e.method)||"return"!==n&&(e.method="throw",e.arg=new TypeError("The iterator does not provide a '"+n+"' method")),y;var a=f(r,t.iterator,e.arg);if("throw"===a.type)return e.method="throw",e.arg=a.arg,e.delegate=null,y;var l=a.arg;return l?l.done?(e[t.resultName]=l.value,e.next=t.nextLoc,"return"!==e.method&&(e.method="next",e.arg=o),e.delegate=null,y):l:(e.method="throw",e.arg=new TypeError("iterator result is not an object"),e.delegate=null,y)}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 E(t){var o=t.completion||{};o.type="normal",delete o.arg,t.completion=o}function M(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(k,this),this.reset(!0)}function L(t){if(t||""===t){var e=t[u];if(e)return e.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var r=-1,a=function e(){for(;++r=0;--r){var a=this.tryEntries[r],s=a.completion;if("root"===a.tryLoc)return n("end");if(a.tryLoc<=this.prev){var i=l.call(a,"catchLoc"),u=l.call(a,"finallyLoc");if(i&&u){if(this.prev=0;--e){var n=this.tryEntries[e];if(n.tryLoc<=this.prev&&l.call(n,"finallyLoc")&&this.prev=0;--o){var e=this.tryEntries[o];if(e.finallyLoc===t)return this.complete(e.completion,e.afterLoc),E(e),y}},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;E(e)}return r}}throw Error("illegal catch attempt")},delegateYield:function(t,e,n){return this.delegate={iterator:L(t),resultName:e,nextLoc:n},"next"===this.method&&(this.arg=o),y}},e}t.exports=r,t.exports.__esModule=!0,t.exports.default=t.exports},735: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},183:(t,o,e)=>{var n=e(24)();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.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";e.r(n),e.d(n,{components:()=>_o,extend:()=>qo,models:()=>Eo,states:()=>Mo,utils:()=>Lo});const t=flarum.core.compat["forum/app"];var o=e.n(t);const r=flarum.core.compat["common/extend"],a=flarum.core.compat["common/components/Badge"];var l=e.n(a);const s=flarum.core.compat["forum/components/DiscussionList"];var i=e.n(s);const u=flarum.core.compat["common/models/Discussion"];var c=e.n(u);const p=flarum.core.compat["common/utils/classList"];var d=e.n(p);const f=flarum.core.compat["forum/components/DiscussionComposer"];var h=e.n(f);const v=flarum.core.compat["forum/components/ReplyComposer"];var g=e.n(v);function b(t,o,e,n,r,a,l){try{var s=t[a](l),i=s.value}catch(t){return void e(t)}s.done?o(i):Promise.resolve(i).then(n,r)}function y(t){return function(){var o=this,e=arguments;return new Promise((function(n,r){var a=t.apply(o,e);function l(t){b(a,n,r,l,s,"next",t)}function s(t){b(a,n,r,l,s,"throw",t)}l(void 0)}))}}function w(t,o){return w=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,o){return t.__proto__=o,t},w(t,o)}function P(t,o){t.prototype=Object.create(o.prototype),t.prototype.constructor=t,w(t,o)}var N=e(183),x=e.n(N);const _=flarum.core.compat["common/components/Modal"];var I=e.n(_);const V=flarum.core.compat["common/Component"];var A=e.n(V);const C=flarum.core.compat["common/components/Button"];var S=e.n(C);const O=flarum.core.compat["common/components/Switch"];var k=e.n(O);const E=flarum.core.compat["common/utils/ItemList"];var M=e.n(E);const L=flarum.core.compat["common/utils/Stream"];var U=e.n(L);const D=flarum.core.compat["common/utils/extractText"];var B=e.n(D);function T(t){return T=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},T(t)}function j(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return(j=function(){return!!t})()}function F(t){var o="function"==typeof Map?new Map:void 0;return F=function(t){if(null===t||!function(t){try{return-1!==Function.toString.call(t).indexOf("[native code]")}catch(o){return"function"==typeof t}}(t))return t;if("function"!=typeof t)throw new TypeError("Super expression must either be null or a function");if(void 0!==o){if(o.has(t))return o.get(t);o.set(t,e)}function e(){return function(t,o,e){if(j())return Reflect.construct.apply(null,arguments);var n=[null];n.push.apply(n,o);var r=new(t.bind.apply(t,n));return e&&w(r,e.prototype),r}(t,arguments,T(this).constructor)}return e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),w(e,t)},F(t)}var q=function(t){function o(o){return t.call(this,o+"")||this}return P(o,t),o}(F(Error)),H=function(){function t(o){this.poll=void 0,this.loading=void 0,this.deleting=void 0,this.expandedGroup=void 0,o||(o=t.createNewPoll()),this.loading=!1,this.deleting=!1,this.poll=o,this.expandedGroup="setup"}t.createNewPoll=function(){var t=o().store.createRecord("polls");return t.pushAttributes({question:"",endDate:"",publicPoll:!1,allowMultipleVotes:!1,hideVotes:!1,allowChangeVote:!1,maxVotes:0}),t.tempOptions=[o().store.createRecord("poll_options"),o().store.createRecord("poll_options")],t};var e=t.prototype;return e.isExpanded=function(t){return this.expandedGroup===t},e.expand=function(t){this.expandedGroup=t,m.redraw()},e.save=function(){var t=y(x().mark((function t(o){return x().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return this.loading=!0,m.redraw(),t.prev=2,t.next=5,this.poll.save(o);case 5:this.poll=t.sent,delete this.poll.data.attributes.options;case 7:return t.prev=7,this.loading=!1,m.redraw(),t.finish(7);case 11:case"end":return t.stop()}}),t,this,[[2,,7,11]])})));return function(o){return t.apply(this,arguments)}}(),e.delete=function(){var t=y(x().mark((function t(){return x().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return this.loading=!0,m.redraw(),t.prev=2,t.next=5,this.poll.delete();case 5:this.deleting=!0;case 6:return t.prev=6,this.loading=!1,m.redraw(),t.finish(6);case 10:case"end":return t.stop()}}),t,this,[[2,,6,10]])})));return function(){return t.apply(this,arguments)}}(),t}();const R=flarum.core.compat["common/components/Page"];var G=e.n(R);const z=flarum.core.compat["common/components/LoadingIndicator"];var Y=e.n(z);const Q=flarum.core.compat["common/components/LinkButton"];var J=e.n(Q),W=function(t){function e(){for(var o,e=arguments.length,n=new Array(e),r=0;r0?Math.round(this.votes/this.totalVotes*100):0},n.view=function(){var t;this.hasVoted=this.state.hasVoted(),this.totalVotes=this.state.overallVoteCount(),this.votes=this.option.voteCount(),this.voted=this.state.hasVotedFor(this.option);var e=this.state.loadingOptions||this.hasVoted&&!this.poll.canChangeVote(),n=this.canSeeVoteCount?this.percent():Number(this.voted)/((null==(t=this.poll.myVotes())?void 0:t.length)||1)*100,r=m("label",{className:"PollBar","data-selected":!!this.voted,style:"--poll-option-width: "+n+"%"},this.state.showCheckMarks&&m("div",{className:"PollAnswer-checkbox"},m("input",{className:"PollAnswer-input sr-only",type:"checkbox",id:this.option.id(),name:this.name,value:this.answer,checked:this.voted,disabled:e,"aria-labelledby":this.name+"-"+this.option.id()+"-label",onchange:this.state.changeVote.bind(this.state,this.option)}),m("span",{className:"checkmark"})),m("div",{className:"PollAnswer-text"},this.optionDisplayItems().toArray()),this.option.imageUrl()?m("img",{className:"PollAnswer-image",src:this.option.imageUrl(),alt:this.option.answer(),loading:"lazy"}):null);return m("div",{className:d()("PollOption",this.hasVoted&&"PollVoted",this.option.imageUrl()&&"PollOption-hasImage"),"data-id":this.option.id()},this.canSeeVoteCount?m(yt(),{text:o().translator.trans("fof-polls.forum.tooltip.votes",{count:this.votes}),onremove:this.hideOptionTooltip},r):r)},n.hideOptionTooltip=function(t){t.attrs.tooltipVisible=!1,t.state.updateVisibility()},n.optionDisplayItems=function(){var t=new(M());return t.add("answer",m("span",{className:"PollAnswer-text-answer",id:this.name+"-"+this.option.id()+"-label"},this.answer)),this.voted&&!this.state.showCheckMarks&&t.add("check",ht()("fas fa-check-circle",{className:"PollAnswer-check"})),this.canSeeVoteCount&&t.add("percent",m("span",{className:d()("PollPercent",100!==this.percent()&&"PollPercent--option")},this.percent(),"%")),t},e}(A()),Pt=function(t){function o(){return t.apply(this,arguments)||this}P(o,t);var e=o.prototype;return e.view=function(){return m("div",{className:"Poll-options list-layout"},this.pollOptions().toArray())},e.pollOptions=function(){var t=this,o=new(M());return this.attrs.options.forEach((function(e){o.add("option"+e.id(),t.createOptionView(e))})),o},e.createOptionView=function(t){return m(wt,{name:this.attrs.name,option:t,state:this.attrs.state})},o}(A()),Nt=function(t){function o(){for(var o,e=arguments.length,n=new Array(e),r=0;r0},e.overallVoteCount=function(){return this.poll.voteCount()},e.hasVotedFor=function(t){return this.pendingOptions?this.pendingOptions.has(t.id()):this.poll.myVotes().some((function(o){return o.option()===t}))},e.getMaxVotes=function(){var t=this.poll,o=t.allowMultipleVotes()?t.maxVotes():1;return 0===o&&(o=t.options().length),o},e.showButton=function(){return this.useSubmitUI&&this.pendingSubmit},e.changeVote=function(t,e){var n=e.target;if(!o().session.user)return o().modal.show(_t()),void(n.checked=!1);var r=this.pendingOptions||new Set(this.poll.myVotes().map((function(t){return t.option().id()}))),a=r.delete(t.id());if(this.poll.allowMultipleVotes()||r.clear(),a||r.add(t.id()),this.pendingOptions=r.size?r:null,this.pendingSubmit=!!this.pendingOptions,this.useSubmitUI)return this.pendingOptions=r.size?r:null,this.pendingSubmit=!!this.pendingOptions,void m.redraw();this.submit(r,null,(function(){return n.checked=a}))},e.hasSelectedOptions=function(){return this.pendingSubmit},e.onsubmit=function(){var t=this;return this.submit(this.pendingOptions,(function(){t.pendingOptions=null,t.pendingSubmit=!1}))},e.submit=function(t,e,n){var r=this;return void 0===n&&(n=null),this.loadingOptions=!0,m.redraw(),o().request({method:"PATCH",url:o().forum.attribute("apiUrl")+"/fof/polls/"+this.poll.id()+"/votes",body:{data:{optionIds:Array.from(t)}}}).then((function(t){o().store.pushPayload(t),null==e||e()})).catch((function(t){null==n||n(t)})).finally((function(){r.loadingOptions=!1,r.canSeeVoteCount="number"==typeof r.poll.voteCount(),m.redraw()}))},t}(),kt=function(t){function e(){return t.apply(this,arguments)||this}P(e,t);var n=e.prototype;return n.view=function(){var t=this,e=this.attrs.state;return m(S(),{className:"Button Button--primary Poll-submit",loading:e.loadingOptions,onclick:function(o){return t.pollButtonSubmit(e,o)},disabled:!e.hasSelectedOptions()},o().translator.trans("fof-polls.forum.poll.submit_button"))},n.pollButtonSubmit=function(t,o){t.onsubmit()},e}(A());const Et=flarum.core.compat["common/utils/string"];var Mt=function(t){function o(){return t.apply(this,arguments)||this}P(o,t);var e=o.prototype;return e.view=function(){return m("div",{className:"Poll-title-component"},this.pollTitleItems().toArray())},e.pollTitleItems=function(){var t=new(M());return t.add("title",m("h3",{className:"Poll-title"},this.attrs.poll.question())),t},o}(A()),Lt=function(t){function o(){return t.apply(this,arguments)||this}P(o,t);var e=o.prototype;return e.view=function(){if(this.attrs.poll.subtitle())return m("div",{className:"Poll-subtitle-component"},this.pollSubtitleItems().toArray())},e.pollSubtitleItems=function(){var t=new(M());return t.add("subtitle",m("p",{className:"Poll-subtitle"},this.attrs.poll.subtitle())),t},o}(A()),Ut=function(t){function e(){for(var o,e=arguments.length,n=new Array(e),r=0;rt.length)&&(o=t.length);for(var e=0,n=Array(o);e=t.length?{done:!0}:{done:!1,value:t[n++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}(this.pages);!(o=e()).done;){var n=o.value,r=n.items.indexOf(t);if(-1!==r){n.items.splice(r,1);break}}var a=this.extraPolls.indexOf(t);-1!==a&&this.extraPolls.splice(a),m.redraw()},n.addPoll=function(t){this.removePoll(t),this.extraPolls.unshift(t),m.redraw()},n.getAllItems=function(){return this.extraPolls.concat(t.prototype.getAllItems.call(this))},n.getPages=function(){var o=t.prototype.getPages.call(this);return this.extraPolls.length?[{number:-1,items:this.extraPolls}].concat(o):o},jt(e,[{key:"type",get:function(){return"fof/polls"}}])}(Qt()),Zt=function(t){function e(){return t.apply(this,arguments)||this}P(e,t);var n=e.prototype;return n.oninit=function(e){t.prototype.oninit.call(this,e),o().forum.attribute("globalPollsEnabled")?(this.state=new Xt({sort:m.route.param("sort"),filter:m.route.param("filter")}),this.state.refresh(),o().setTitle(B()(o().translator.trans("fof-polls.forum.page.nav")))):m.route.set("/")},n.view=function(){return this.loading?m(Y(),null):this.poll?m("div",{className:"PollsListPage"},m("div",{className:"container"},m(Ut,{poll:this.poll}))):m("div",{className:"PollsListPage"},t.prototype.hero.call(this),m("div",{className:"container"},m("div",{className:"sideNavContainer"},m("nav",{className:"PollsListPage-nav sideNav"},m("ul",null,X()(this.sidebarItems().toArray()))),m("div",{className:"PollsPage-results sideNavOffset"},m("div",{className:"IndexPage-toolbar"},m("ul",{className:"IndexPage-toolbar-view"},X()(this.viewItems().toArray())),m("ul",{className:"IndexPage-toolbar-action"},X()(this.actionItems().toArray()))),m(zt,{state:this.state})))))},n.sidebarItems=function(){var t=this,e=new(M()),n=o().forum.attribute("canStartGlobalPolls");return e.add("newGlobalPoll",m(S(),{icon:"fas fa-edit",className:"Button Button--primary App-primaryControl PollsPage-newPoll",itemClassName:"App-primaryControl",onclick:function(){t.newPollAction()},disabled:!n},o().translator.trans("fof-polls.forum.poll."+(n?"start_poll_button":"cannot_start_poll_button")))),e.add("nav",m(tt(),{buttonClassName:"Button",className:"App-titleControl",accessibleToggleLabel:o().translator.trans("core.forum.index.toggle_sidenav_dropdown_accessible_label")},this.navItems().toArray())),e},n.actionItems=function(){var t=this,e=new(M());return e.add("refresh",S().component({title:o().translator.trans("fof-polls.forum.page.refresh_tooltip"),icon:"fas fa-sync",className:"Button Button--icon",onclick:function(){t.state.refresh()}})),e},n.viewItems=function(){return et().prototype.viewItems()},n.navItems=function(){return et().prototype.navItems()},n.newPollAction=function(){o().session.user?m.route.set(o().route("fof.polls.compose")):o().modal.show(_t())},e}(qt);const to=flarum.core.compat["common/components/Separator"];var oo=e.n(to);const eo={controls:function(t,o){var e=this,n=new(M());return["poll","moderation","destructive"].forEach((function(r){var a=e[r+"Controls"](t,o).toArray();a.length&&(a.forEach((function(t){return n.add(t.itemName,t)})),n.add(r+"Separator",m(oo(),null)))})),n},pollControls:function(t,o){return new(M())},moderationControls:function(t,e){var n=new(M());return t.canEdit()&&n.add("edit",m(S(),{icon:"fas fa-pencil-alt",onclick:this.editAction.bind(this,t)},o().translator.trans("fof-polls.forum.poll_controls.edit_label"))),n},destructiveControls:function(t,e){var n=new(M());return t.canDelete()&&n.add("delete",m(S(),{icon:"far fa-trash-alt",onclick:this.deleteAction.bind(this,t)},o().translator.trans("fof-polls.forum.poll_controls.delete_label"))),n},deleteAction:function(t){var e=this;return y(x().mark((function n(){return x().wrap((function(n){for(;;)switch(n.prev=n.next){case 0:if(confirm(o().translator.trans("fof-polls.forum.poll_controls.delete_confirmation"))){n.next=2;break}return n.abrupt("return");case 2:return n.abrupt("return",t.delete().then((function(){e.showDeletionAlert(t,"success"),o().current.matches(nt,{id:t.id()})||o().current.matches(Zt,{id:t.id()})?o().history.back():window.location.reload()})).catch((function(){return e.showDeletionAlert(t,"error")})));case 3:case"end":return n.stop()}}),n)})))()},showDeletionAlert:function(t,e){var n={success:"fof-polls.forum.poll_controls.delete_success_message",error:"fof-polls.forum.poll_controls.delete_error_message"}[e];o().alerts.show({type:e},o().translator.trans(n,{poll:t}))},editAction:function(t){m.route.set(o().route("fof.polls.compose",{id:t.id()}))}};function no(){return no=Object.assign?Object.assign.bind():function(t){for(var o=1;o'),this.$input.appendTo("body").hide().trigger("click").on("change",(function(e){var n=new FormData;n.append(t.attrs.name,$(e.target)[0].files[0]),t.loading=!0,m.redraw(),o().request({method:"POST",url:t.resourceUrl(),serialize:function(t){return t},body:n}).then(t.success.bind(t),t.failure.bind(t))})))},n.remove=function(){var t,e,n=this;this.loading=!0,m.redraw();var r=void 0;null!=(t=this.attrs.poll)&&t.exists||null!=(e=this.attrs.option)&&e.exists||(r=this.fileName),o().request({method:"DELETE",url:this.resourceUrl(r)}).then((function(t){var o,e;return null!=(o=n.attrs.poll)&&o.exists&&n.attrs.poll.pushAttributes({image:null,imageUrl:null,isImageUpload:!1}),null!=(e=n.attrs.option)&&e.exists&&n.attrs.option.pushAttributes({imageUrl:!1}),t})).then(this.success.bind(this),this.failure.bind(this))},n.resourceUrl=function(t){void 0===t&&(t=void 0);var e=o().forum.attribute("apiUrl")+"/fof/polls/"+this.attrs.name,n=this.attrs.poll,r=this.attrs.option;return t?e+="/name/"+t:(null!=n&&n.exists&&(e+="/"+(null==n?void 0:n.id())),null!=r&&r.exists&&(e+="/"+(null==r?void 0:r.id()))),e},n.getImageUrl=function(){var t,o;return!1!==this.uploadedImageUrl?this.uploadedImageUrl:(null==(t=this.attrs.poll)?void 0:t.imageUrl())||(null==(o=this.attrs.option)?void 0:o.imageUrl())},n.success=function(t){var o,e,n;this.loading=!1,this.uploadedImageUrl=null==t?void 0:t.fileUrl,this.fileName=null==t?void 0:t.fileName,null==(o=(e=this.attrs).onUpload)||o.call(e,null==t?void 0:t.fileName),m.redraw(),null==(n=this.$input)||n.remove()},n.failure=function(t){var o;this.loading=!1,m.redraw(),null==(o=this.$input)||o.remove()},e}(S());const ao=flarum.core.compat["common/utils/RequestError"];var lo=e.n(ao),so=function(t){function e(){for(var o,e=arguments.length,n=new Array(e),r=0;r=2?S().component({type:"button",className:"Button PollModal--button Button--icon",icon:"fas fa-minus",onclick:r>=2?t.removeOption.bind(t,r):""}):""))})),e},n.addOption=function(){var t=Math.max(o().forum.attribute("pollMaxOptions"),2);this.options.length0;return!o().session.user||r.canVote()||r.hasEnded()||n.add("no-permission",m("span",null,m("i",{className:"icon fas fa-times-circle fa-fw"}),o().translator.trans("fof-polls.forum.no_permission"))),r.endDate()&&n.add("end-date",m("span",null,m("i",{class:"icon fas fa-clock fa-fw"}),r.hasEnded()?o().translator.trans("fof-polls.forum.poll_ended"):o().translator.trans("fof-polls.forum.days_remaining",{time:dayjs(r.endDate()).fromNow()}))),r.canVote()&&(n.add("max-votes",m("span",null,m("i",{className:"icon fas fa-poll fa-fw"}),o().translator.trans("fof-polls.forum.max_votes_allowed",{max:t}))),r.canChangeVote()||n.add("cannot-change-vote",m("span",null,m("i",{className:"icon fas fa-"+(a?"times":"exclamation")+"-circle fa-fw"}),o().translator.trans("fof-polls.forum.poll.cannot_change_vote")))),n},n.viewOption=function(t){var e,n,r,a=this.attrs.poll,l=(null==(e=a.myVotes())?void 0:e.length)>0,s=a.voteCount(),i=this.pendingOptions?this.pendingOptions.has(t.id()):null==(n=a.myVotes())||null==n.some?void 0:n.some((function(o){return o.option()===t})),u=t.voteCount(),c=s>0?Math.round(u/s*100):0,p="number"==typeof u,f=this.loadingOptions||l&&!a.canChangeVote(),h=p?c:Number(i)/((null==(r=a.myVotes())?void 0:r.length)||1)*100,v=!o().session.user||!a.hasEnded()&&a.canVote()&&(!l||a.canChangeVote()),g=m("div",{className:"PollBar","data-selected":!!i,style:"--poll-option-width: "+h+"%"},v&&m("label",{className:"PollAnswer-checkbox"},m("input",{onchange:this.changeVote.bind(this,t),type:"checkbox",checked:i,disabled:f}),m("span",{className:"checkmark"})),m("div",{className:"PollAnswer-text"},m("span",{className:"PollAnswer-text-answer"},t.answer()),i&&!v&&ht()("fas fa-check-circle",{className:"PollAnswer-check"}),p&&m("span",{className:d()("PollPercent",100!==c&&"PollPercent--option")},c,"%")),t.imageUrl()?m("img",{className:"PollAnswer-image",src:t.imageUrl(),alt:t.answer(),loading:"lazy"}):null);return m("div",{className:d()("PollOption",l&&"PollVoted",a.hasEnded()&&"PollEnded",t.imageUrl()&&"PollOption-hasImage"),"data-id":t.id()},p?m(yt(),{text:o().translator.trans("fof-polls.forum.tooltip.votes",{count:u}),onremove:this.hideOptionTooltip},g):g)},n.changeVote=function(t,e){var n,r;if(!o().session.user)return o().modal.show(_t()),void(e.target.checked=!1);var a=this.pendingOptions||new Set(null==(n=(r=this.attrs.poll.myVotes()).map)?void 0:n.call(r,(function(t){return t.option().id()}))),l=a.delete(t.id());return this.attrs.poll.allowMultipleVotes()||a.clear(),l||a.add(t.id()),this.useSubmitUI?(this.pendingOptions=a.size?a:null,void(this.pendingSubmit=!!this.pendingOptions)):this.submit(a,null,(function(){return e.target.checked=l}))},n.onsubmit=function(){var t=this;return this.submit(this.pendingOptions,(function(){t.pendingOptions=null,t.pendingSubmit=!1}))},n.submit=function(t,e,n){var r=this;return this.loadingOptions=!0,m.redraw(),o().request({method:"PATCH",url:o().forum.attribute("apiUrl")+"/fof/polls/"+this.attrs.poll.id()+"/votes",body:{data:{optionIds:Array.from(t)}}}).then((function(t){o().store.pushPayload(t),null==e||e()})).catch((function(t){null==n||n(t)})).finally((function(){r.loadingOptions=!1,m.redraw()}))},n.showVoters=function(){o().modal.show(St,{poll:this.attrs.poll,post:this.attrs.post})},n.deletePoll=function(){confirm(B()(o().translator.trans("fof-polls.forum.moderation.delete_confirm")))&&this.attrs.poll.delete().then((function(){m.redraw.sync()}))},n.hideOptionTooltip=function(t){t.attrs.tooltipVisible=!1,t.state.updateVisibility()},n.preventClose=function(t){if(this.pendingOptions)return t.preventDefault(),!0},e}(A());function bo(t,o){(null==o||o>t.length)&&(o=t.length);for(var e=0,n=Array(o);e=t.length?{done:!0}:{done:!1,value:t[n++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}(o.polls());!(e=n()).done;){var r=e.value;r&&t.push(m(go,{post:o,poll:r}))}})),(0,r.extend)(mo().prototype,"oninit",(function(){var t=this;this.subtree.check((function(){var o=t.attrs.post.polls(),e=null==o||null==o.map?void 0:o.map((function(t){var o,e,n,r,a;return t&&[null==(o=t.data)?void 0:o.attributes,null==(e=(n=t.options()).map)?void 0:e.call(n,(function(t){var o;return null==t||null==(o=t.data)?void 0:o.attributes})),null==(r=(a=t.myVotes()).map)?void 0:r.call(a,(function(t){var o;return null==(o=t.option())?void 0:o.id()}))]}));return JSON.stringify(e)}))})),(0,r.extend)(ho().prototype,"oncreate",(function(){o().pusher&&o().pusher.then((function(t){t.channels.main.bind("updatedPollOptions",(function(t){var e=o().store.getById("polls",t.pollId);e&&e.pushAttributes({voteCount:t.pollVoteCount});var n=t.options;for(var r in n){var a=o().store.getById("poll_options",r);a&&void 0!==a.voteCount()&&a.pushAttributes({voteCount:n[r]})}m.redraw()}))}))})),(0,r.extend)(ho().prototype,"onremove",(function(){o().pusher&&o().pusher.then((function(t){t.channels.main.unbind("updatedPollOptions")}))})),t=function(t){return o().modal.show(io,{onsubmit:function(e){return o().store.createRecord("polls").save(no({},e,{relationships:{post:t}}),{data:{include:"options,myVotes,myVotes.option"}}).then((function(o){var e;return null==(e=t.rawRelationship("polls"))||null==e.push||e.push({type:"polls",id:o.id()}),o}))}})},(0,r.extend)(wo(),"moderationControls",(function(e,n){!n.isHidden()&&n.canStartPoll()&&e.add("addPoll",m(S(),{icon:"fas fa-poll",onclick:t.bind(this,n)},o().translator.trans("fof-polls.forum.moderation.add")))})),(0,r.extend)(et().prototype,"navItems",(function(t){o().forum.attribute("globalPollsEnabled")&&(t.add("fof-polls-showcase",J().component({href:o().route("fof.polls.showcase"),icon:"fas fa-poll"},o().translator.trans("fof-polls.forum.page.nav")),35),o().forum.attribute("canStartGlobalPolls")&&t.add("fof-polls-list",J().component({href:o().route("fof.polls.list"),icon:"fas fa-list"},o().translator.trans("fof-polls.forum.page.nav-all")),32))}))}))})(),module.exports=n})(); //# sourceMappingURL=forum.js.map \ No newline at end of file diff --git a/js/dist/forum.js.map b/js/dist/forum.js.map index 8b17502f..81ff1cfc 100644 --- a/js/dist/forum.js.map +++ b/js/dist/forum.js.map @@ -1 +1 @@ -{"version":3,"file":"forum.js","mappings":";0BAAA,IAAIA,EAAUC,EAAAA,KAAAA,QACd,SAASC,IACP,aACAC,EAAOC,QAAUF,EAAsB,WACrC,OAAOG,CACT,EAAGF,EAAOC,QAAQE,YAAa,EAAMH,EAAOC,QAAiB,QAAID,EAAOC,QACxE,IAAIG,EACFF,EAAI,CAAC,EACLG,EAAIC,OAAOC,UACXC,EAAIH,EAAEI,eACNC,EAAIJ,OAAOK,gBAAkB,SAAUP,EAAGF,EAAGG,GAC3CD,EAAEF,GAAKG,EAAEO,KACX,EACAC,EAAI,mBAAqBC,OAASA,OAAS,CAAC,EAC5CC,EAAIF,EAAEG,UAAY,aAClBC,EAAIJ,EAAEK,eAAiB,kBACvBC,EAAIN,EAAEO,aAAe,gBACvB,SAASC,EAAOjB,EAAGF,EAAGG,GACpB,OAAOC,OAAOK,eAAeP,EAAGF,EAAG,CACjCU,MAAOP,EACPiB,YAAY,EACZC,cAAc,EACdC,UAAU,IACRpB,EAAEF,EACR,CACA,IACEmB,EAAO,CAAC,EAAG,GACb,CAAE,MAAOjB,GACPiB,EAAS,SAAgBjB,EAAGF,EAAGG,GAC7B,OAAOD,EAAEF,GAAKG,CAChB,CACF,CACA,SAASoB,EAAKrB,EAAGF,EAAGG,EAAGG,GACrB,IAAIK,EAAIX,GAAKA,EAAEK,qBAAqBmB,EAAYxB,EAAIwB,EAClDX,EAAIT,OAAOqB,OAAOd,EAAEN,WACpBU,EAAI,IAAIW,EAAQpB,GAAK,IACvB,OAAOE,EAAEK,EAAG,UAAW,CACrBH,MAAOiB,EAAiBzB,EAAGC,EAAGY,KAC5BF,CACN,CACA,SAASe,EAAS1B,EAAGF,EAAGG,GACtB,IACE,MAAO,CACL0B,KAAM,SACNC,IAAK5B,EAAE6B,KAAK/B,EAAGG,GAEnB,CAAE,MAAOD,GACP,MAAO,CACL2B,KAAM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,KAAM,eAERjD,IAAAA,WAAeyC,MAAM,6BAEvB,IAGyBzC,IAAAA,MAAUyD,UAAmB,wBAGtDZ,EAAME,IACJ,iBACAC,IAAAA,UACE,CACEG,KAAMnD,IAAAA,MAAU,kBAChBiD,KAAM,eAERjD,IAAAA,WAAeyC,MAAM,iCAEvB,IAGN,GFnBF","sources":["webpack://@fof/polls/./node_modules/@babel/runtime/helpers/regeneratorRuntime.js","webpack://@fof/polls/./node_modules/@babel/runtime/helpers/typeof.js","webpack://@fof/polls/./node_modules/@babel/runtime/regenerator/index.js","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.tsx","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/asyncToGenerator.js","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/Modal']\"","webpack://@fof/polls/external root \"flarum.core.compat['common/Component']\"","webpack://@fof/polls/external root \"flarum.core.compat['common/components/Button']\"","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/./node_modules/@babel/runtime/helpers/esm/getPrototypeOf.js","webpack://@fof/polls/./node_modules/@babel/runtime/helpers/esm/isNativeReflectConstruct.js","webpack://@fof/polls/./node_modules/@babel/runtime/helpers/esm/wrapNativeSuper.js","webpack://@fof/polls/./node_modules/@babel/runtime/helpers/esm/isNativeFunction.js","webpack://@fof/polls/./node_modules/@babel/runtime/helpers/esm/construct.js","webpack://@fof/polls/./src/forum/components/form/FormError.tsx","webpack://@fof/polls/./src/forum/states/PollFormState.ts","webpack://@fof/polls/external root \"flarum.core.compat['common/components/Page']\"","webpack://@fof/polls/external root \"flarum.core.compat['common/components/LoadingIndicator']\"","webpack://@fof/polls/external root \"flarum.core.compat['common/components/LinkButton']\"","webpack://@fof/polls/./src/forum/components/ComposePollHero.tsx","webpack://@fof/polls/external root \"flarum.core.compat['common/helpers/listItems']\"","webpack://@fof/polls/external root \"flarum.core.compat['common/components/SelectDropdown']\"","webpack://@fof/polls/external root \"flarum.core.compat['forum/components/IndexPage']\"","webpack://@fof/polls/./src/forum/components/ComposePollPage.tsx","webpack://@fof/polls/external root \"flarum.core.compat['common/utils/SubtreeRetainer']\"","webpack://@fof/polls/external root \"flarum.core.compat['common/components/Dropdown']\"","webpack://@fof/polls/external root \"flarum.core.compat['common/components/Link']\"","webpack://@fof/polls/external root \"flarum.core.compat['common/helpers/highlight']\"","webpack://@fof/polls/external root \"flarum.core.compat['forum/utils/slidable']\"","webpack://@fof/polls/external root \"flarum.core.compat['common/helpers/icon']\"","webpack://@fof/polls/external root \"flarum.core.compat['common/utils/abbreviateNumber']\"","webpack://@fof/polls/external root \"flarum.core.compat['common/components/Tooltip']\"","webpack://@fof/polls/./src/forum/components/Poll/PollOption.tsx","webpack://@fof/polls/./src/forum/components/Poll/PollOptions.tsx","webpack://@fof/polls/./src/forum/components/Poll/PollImage.tsx","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/./src/forum/components/ListVotersModal.tsx","webpack://@fof/polls/./src/forum/states/PollState.ts","webpack://@fof/polls/./src/forum/components/Poll/PollSubmitButton.tsx","webpack://@fof/polls/external root \"flarum.core.compat['common/utils/string']\"","webpack://@fof/polls/./src/forum/components/Poll/PollTitle.tsx","webpack://@fof/polls/./src/forum/components/Poll/PollSubtitle.tsx","webpack://@fof/polls/./src/forum/components/PollView.tsx","webpack://@fof/polls/./node_modules/@babel/runtime/helpers/esm/typeof.js","webpack://@fof/polls/./node_modules/@babel/runtime/helpers/esm/toPropertyKey.js","webpack://@fof/polls/./node_modules/@babel/runtime/helpers/esm/toPrimitive.js","webpack://@fof/polls/./node_modules/@babel/runtime/helpers/esm/createClass.js","webpack://@fof/polls/./src/forum/components/PollPageHero.tsx","webpack://@fof/polls/./src/forum/components/AbstractPollPage.tsx","webpack://@fof/polls/./src/forum/components/PollViewPage.tsx","webpack://@fof/polls/./src/forum/components/Poll/PollListItem.tsx","webpack://@fof/polls/external root \"flarum.core.compat['common/components/Placeholder']\"","webpack://@fof/polls/./src/forum/components/Poll/PollList.tsx","webpack://@fof/polls/external root \"flarum.core.compat['common/states/PaginatedListState']\"","webpack://@fof/polls/external root \"flarum.core.compat['common/utils/EventEmitter']\"","webpack://@fof/polls/./src/forum/states/PollListState.ts","webpack://@fof/polls/./src/forum/components/PollsPage.tsx","webpack://@fof/polls/external root \"flarum.core.compat['common/components/Separator']\"","webpack://@fof/polls/./src/forum/utils/PollControls.tsx","webpack://@fof/polls/./node_modules/@babel/runtime/helpers/esm/extends.js","webpack://@fof/polls/./src/forum/components/UploadPollImageButton.tsx","webpack://@fof/polls/external root \"flarum.core.compat['common/utils/RequestError']\"","webpack://@fof/polls/./src/forum/components/PollForm.tsx","webpack://@fof/polls/./src/forum/components/CreatePollModal.tsx","webpack://@fof/polls/./src/forum/addComposerItems.tsx","webpack://@fof/polls/external root \"flarum.core.compat['forum/components/CommentPost']\"","webpack://@fof/polls/external root \"flarum.core.compat['forum/components/DiscussionPage']\"","webpack://@fof/polls/./src/forum/components/EditPollModal.tsx","webpack://@fof/polls/./src/forum/components/PostPoll.tsx","webpack://@fof/polls/./src/forum/addPollsToPost.tsx","webpack://@fof/polls/external root \"flarum.core.compat['forum/utils/PostControls']\"","webpack://@fof/polls/./src/forum/components/PollShowcaseItem.tsx","webpack://@fof/polls/./src/forum/components/PollShowcase.tsx","webpack://@fof/polls/./src/forum/components/PollsShowcasePage.tsx","webpack://@fof/polls/./src/forum/components/index.ts","webpack://@fof/polls/external root \"flarum.core.compat['common/Model']\"","webpack://@fof/polls/external root \"flarum.core.compat['common/utils/computed']\"","webpack://@fof/polls/./src/forum/models/Poll.ts","webpack://@fof/polls/./src/forum/models/PollOption.ts","webpack://@fof/polls/./src/forum/models/PollVote.ts","webpack://@fof/polls/./src/forum/models/index.ts","webpack://@fof/polls/./src/forum/states/index.ts","webpack://@fof/polls/./src/forum/utils/index.ts","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.ts","webpack://@fof/polls/./src/forum/index.ts","webpack://@fof/polls/./src/forum/addPostControls.tsx","webpack://@fof/polls/./src/forum/addNavItem.ts"],"sourcesContent":["var _typeof = require(\"./typeof.js\")[\"default\"];\nfunction _regeneratorRuntime() {\n \"use strict\"; /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */\n module.exports = _regeneratorRuntime = function _regeneratorRuntime() {\n return e;\n }, module.exports.__esModule = true, module.exports[\"default\"] = module.exports;\n var t,\n e = {},\n r = Object.prototype,\n n = r.hasOwnProperty,\n o = Object.defineProperty || function (t, e, r) {\n t[e] = r.value;\n },\n i = \"function\" == typeof Symbol ? Symbol : {},\n a = i.iterator || \"@@iterator\",\n c = i.asyncIterator || \"@@asyncIterator\",\n u = i.toStringTag || \"@@toStringTag\";\n function define(t, e, r) {\n return Object.defineProperty(t, e, {\n value: r,\n enumerable: !0,\n configurable: !0,\n writable: !0\n }), t[e];\n }\n try {\n define({}, \"\");\n } catch (t) {\n define = function define(t, e, r) {\n return t[e] = r;\n };\n }\n function wrap(t, e, r, n) {\n var i = e && e.prototype instanceof Generator ? e : Generator,\n a = Object.create(i.prototype),\n c = new Context(n || []);\n return o(a, \"_invoke\", {\n value: makeInvokeMethod(t, r, c)\n }), a;\n }\n function tryCatch(t, e, r) {\n try {\n return {\n type: \"normal\",\n arg: t.call(e, r)\n };\n } catch (t) {\n return {\n type: \"throw\",\n arg: t\n };\n }\n }\n e.wrap = wrap;\n var h = \"suspendedStart\",\n l = \"suspendedYield\",\n f = \"executing\",\n s = \"completed\",\n y = {};\n function Generator() {}\n function GeneratorFunction() {}\n function GeneratorFunctionPrototype() {}\n var p = {};\n define(p, a, function () {\n return this;\n });\n var d = Object.getPrototypeOf,\n v = d && d(d(values([])));\n v && v !== r && n.call(v, a) && (p = v);\n var g = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(p);\n function defineIteratorMethods(t) {\n [\"next\", \"throw\", \"return\"].forEach(function (e) {\n define(t, e, function (t) {\n return this._invoke(e, t);\n });\n });\n }\n function AsyncIterator(t, e) {\n function invoke(r, o, i, a) {\n var c = tryCatch(t[r], t, o);\n if (\"throw\" !== c.type) {\n var u = c.arg,\n h = u.value;\n return h && \"object\" == _typeof(h) && n.call(h, \"__await\") ? e.resolve(h.__await).then(function (t) {\n invoke(\"next\", t, i, a);\n }, function (t) {\n invoke(\"throw\", t, i, a);\n }) : e.resolve(h).then(function (t) {\n u.value = t, i(u);\n }, function (t) {\n return invoke(\"throw\", t, i, a);\n });\n }\n a(c.arg);\n }\n var r;\n o(this, \"_invoke\", {\n value: function value(t, n) {\n function callInvokeWithMethodAndArg() {\n return new e(function (e, r) {\n invoke(t, n, e, r);\n });\n }\n return r = r ? r.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg();\n }\n });\n }\n function makeInvokeMethod(e, r, n) {\n var o = h;\n return function (i, a) {\n if (o === f) throw Error(\"Generator is already running\");\n if (o === s) {\n if (\"throw\" === i) throw a;\n return {\n value: t,\n done: !0\n };\n }\n for (n.method = i, n.arg = a;;) {\n var c = n.delegate;\n if (c) {\n var u = maybeInvokeDelegate(c, n);\n if (u) {\n if (u === y) continue;\n return u;\n }\n }\n if (\"next\" === n.method) n.sent = n._sent = n.arg;else if (\"throw\" === n.method) {\n if (o === h) throw o = s, n.arg;\n n.dispatchException(n.arg);\n } else \"return\" === n.method && n.abrupt(\"return\", n.arg);\n o = f;\n var p = tryCatch(e, r, n);\n if (\"normal\" === p.type) {\n if (o = n.done ? s : l, p.arg === y) continue;\n return {\n value: p.arg,\n done: n.done\n };\n }\n \"throw\" === p.type && (o = s, n.method = \"throw\", n.arg = p.arg);\n }\n };\n }\n function maybeInvokeDelegate(e, r) {\n var n = r.method,\n o = e.iterator[n];\n if (o === t) return r.delegate = null, \"throw\" === n && e.iterator[\"return\"] && (r.method = \"return\", r.arg = t, maybeInvokeDelegate(e, r), \"throw\" === r.method) || \"return\" !== n && (r.method = \"throw\", r.arg = new TypeError(\"The iterator does not provide a '\" + n + \"' method\")), y;\n var i = tryCatch(o, e.iterator, r.arg);\n if (\"throw\" === i.type) return r.method = \"throw\", r.arg = i.arg, r.delegate = null, y;\n var a = i.arg;\n return a ? a.done ? (r[e.resultName] = a.value, r.next = e.nextLoc, \"return\" !== r.method && (r.method = \"next\", r.arg = t), r.delegate = null, y) : a : (r.method = \"throw\", r.arg = new TypeError(\"iterator result is not an object\"), r.delegate = null, y);\n }\n function pushTryEntry(t) {\n var e = {\n tryLoc: t[0]\n };\n 1 in t && (e.catchLoc = t[1]), 2 in t && (e.finallyLoc = t[2], e.afterLoc = t[3]), this.tryEntries.push(e);\n }\n function resetTryEntry(t) {\n var e = t.completion || {};\n e.type = \"normal\", delete e.arg, t.completion = e;\n }\n function Context(t) {\n this.tryEntries = [{\n tryLoc: \"root\"\n }], t.forEach(pushTryEntry, this), this.reset(!0);\n }\n function values(e) {\n if (e || \"\" === e) {\n var r = e[a];\n if (r) return r.call(e);\n if (\"function\" == typeof e.next) return e;\n if (!isNaN(e.length)) {\n var o = -1,\n i = function next() {\n for (; ++o < e.length;) if (n.call(e, o)) return next.value = e[o], next.done = !1, next;\n return next.value = t, next.done = !0, next;\n };\n return i.next = i;\n }\n }\n throw new TypeError(_typeof(e) + \" is not iterable\");\n }\n return GeneratorFunction.prototype = GeneratorFunctionPrototype, o(g, \"constructor\", {\n value: GeneratorFunctionPrototype,\n configurable: !0\n }), o(GeneratorFunctionPrototype, \"constructor\", {\n value: GeneratorFunction,\n configurable: !0\n }), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, u, \"GeneratorFunction\"), e.isGeneratorFunction = function (t) {\n var e = \"function\" == typeof t && t.constructor;\n return !!e && (e === GeneratorFunction || \"GeneratorFunction\" === (e.displayName || e.name));\n }, e.mark = function (t) {\n return Object.setPrototypeOf ? Object.setPrototypeOf(t, GeneratorFunctionPrototype) : (t.__proto__ = GeneratorFunctionPrototype, define(t, u, \"GeneratorFunction\")), t.prototype = Object.create(g), t;\n }, e.awrap = function (t) {\n return {\n __await: t\n };\n }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, c, function () {\n return this;\n }), e.AsyncIterator = AsyncIterator, e.async = function (t, r, n, o, i) {\n void 0 === i && (i = Promise);\n var a = new AsyncIterator(wrap(t, r, n, o), i);\n return e.isGeneratorFunction(r) ? a : a.next().then(function (t) {\n return t.done ? t.value : a.next();\n });\n }, defineIteratorMethods(g), define(g, u, \"Generator\"), define(g, a, function () {\n return this;\n }), define(g, \"toString\", function () {\n return \"[object Generator]\";\n }), e.keys = function (t) {\n var e = Object(t),\n r = [];\n for (var n in e) r.push(n);\n return r.reverse(), function next() {\n for (; r.length;) {\n var t = r.pop();\n if (t in e) return next.value = t, next.done = !1, next;\n }\n return next.done = !0, next;\n };\n }, e.values = values, Context.prototype = {\n constructor: Context,\n reset: function reset(e) {\n if (this.prev = 0, this.next = 0, this.sent = this._sent = t, this.done = !1, this.delegate = null, this.method = \"next\", this.arg = t, this.tryEntries.forEach(resetTryEntry), !e) for (var r in this) \"t\" === r.charAt(0) && n.call(this, r) && !isNaN(+r.slice(1)) && (this[r] = t);\n },\n stop: function stop() {\n this.done = !0;\n var t = this.tryEntries[0].completion;\n if (\"throw\" === t.type) throw t.arg;\n return this.rval;\n },\n dispatchException: function dispatchException(e) {\n if (this.done) throw e;\n var r = this;\n function handle(n, o) {\n return a.type = \"throw\", a.arg = e, r.next = n, o && (r.method = \"next\", r.arg = t), !!o;\n }\n for (var o = this.tryEntries.length - 1; o >= 0; --o) {\n var i = this.tryEntries[o],\n a = i.completion;\n if (\"root\" === i.tryLoc) return handle(\"end\");\n if (i.tryLoc <= this.prev) {\n var c = n.call(i, \"catchLoc\"),\n u = n.call(i, \"finallyLoc\");\n if (c && u) {\n if (this.prev < i.catchLoc) return handle(i.catchLoc, !0);\n if (this.prev < i.finallyLoc) return handle(i.finallyLoc);\n } else if (c) {\n if (this.prev < i.catchLoc) return handle(i.catchLoc, !0);\n } else {\n if (!u) throw Error(\"try statement without catch or finally\");\n if (this.prev < i.finallyLoc) return handle(i.finallyLoc);\n }\n }\n }\n },\n abrupt: function abrupt(t, e) {\n for (var r = this.tryEntries.length - 1; r >= 0; --r) {\n var o = this.tryEntries[r];\n if (o.tryLoc <= this.prev && n.call(o, \"finallyLoc\") && this.prev < o.finallyLoc) {\n var i = o;\n break;\n }\n }\n i && (\"break\" === t || \"continue\" === t) && i.tryLoc <= e && e <= i.finallyLoc && (i = null);\n var a = i ? i.completion : {};\n return a.type = t, a.arg = e, i ? (this.method = \"next\", this.next = i.finallyLoc, y) : this.complete(a);\n },\n complete: function complete(t, e) {\n if (\"throw\" === t.type) throw t.arg;\n return \"break\" === t.type || \"continue\" === t.type ? this.next = t.arg : \"return\" === t.type ? (this.rval = this.arg = t.arg, this.method = \"return\", this.next = \"end\") : \"normal\" === t.type && e && (this.next = e), y;\n },\n finish: function finish(t) {\n for (var e = this.tryEntries.length - 1; e >= 0; --e) {\n var r = this.tryEntries[e];\n if (r.finallyLoc === t) return this.complete(r.completion, r.afterLoc), resetTryEntry(r), y;\n }\n },\n \"catch\": function _catch(t) {\n for (var e = this.tryEntries.length - 1; e >= 0; --e) {\n var r = this.tryEntries[e];\n if (r.tryLoc === t) {\n var n = r.completion;\n if (\"throw\" === n.type) {\n var o = n.arg;\n resetTryEntry(r);\n }\n return o;\n }\n }\n throw Error(\"illegal catch attempt\");\n },\n delegateYield: function delegateYield(e, r, n) {\n return this.delegate = {\n iterator: values(e),\n resultName: r,\n nextLoc: n\n }, \"next\" === this.method && (this.arg = t), y;\n }\n }, e;\n}\nmodule.exports = _regeneratorRuntime, module.exports.__esModule = true, module.exports[\"default\"] = module.exports;","function _typeof(o) {\n \"@babel/helpers - typeof\";\n\n return (module.exports = _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (o) {\n return typeof o;\n } : function (o) {\n return o && \"function\" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? \"symbol\" : typeof o;\n }, module.exports.__esModule = true, module.exports[\"default\"] = module.exports), _typeof(o);\n}\nmodule.exports = _typeof, module.exports.__esModule = true, module.exports[\"default\"] = module.exports;","// TODO(Babel 8): Remove this file.\n\nvar runtime = require(\"../helpers/regeneratorRuntime\")();\nmodule.exports = runtime;\n\n// Copied from https://github.com/facebook/regenerator/blob/main/packages/runtime/runtime.js#L736=\ntry {\n regeneratorRuntime = runtime;\n} catch (accidentalStrictMode) {\n if (typeof globalThis === \"object\") {\n globalThis.regeneratorRuntime = runtime;\n } else {\n Function(\"r\", \"regeneratorRuntime = r\")(runtime);\n }\n}\n","// The module cache\nvar __webpack_module_cache__ = {};\n\n// The require function\nfunction __webpack_require__(moduleId) {\n\t// Check if module is in cache\n\tvar cachedModule = __webpack_module_cache__[moduleId];\n\tif (cachedModule !== undefined) {\n\t\treturn cachedModule.exports;\n\t}\n\t// Create a new module (and put it into the cache)\n\tvar module = __webpack_module_cache__[moduleId] = {\n\t\t// no module.id needed\n\t\t// no module.loaded needed\n\t\texports: {}\n\t};\n\n\t// Execute the module function\n\t__webpack_modules__[moduleId](module, module.exports, __webpack_require__);\n\n\t// Return the exports of the module\n\treturn module.exports;\n}\n\n","// getDefaultExport function for compatibility with non-harmony modules\n__webpack_require__.n = (module) => {\n\tvar getter = module && module.__esModule ?\n\t\t() => (module['default']) :\n\t\t() => (module);\n\t__webpack_require__.d(getter, { a: getter });\n\treturn getter;\n};","// define getter functions for harmony exports\n__webpack_require__.d = (exports, definition) => {\n\tfor(var key in definition) {\n\t\tif(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {\n\t\t\tObject.defineProperty(exports, key, { enumerable: true, get: definition[key] });\n\t\t}\n\t}\n};","__webpack_require__.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';\nimport { PaginatedListRequestParams } from 'flarum/common/states/PaginatedListState';\n\nexport default () => {\n // @ts-ignore\n extend(DiscussionList.prototype, 'requestParams', (params: PaginatedListRequestParams) => {\n (params.include as string[]).push('poll');\n });\n\n extend(Discussion.prototype, 'badges', function (badges) {\n // @ts-ignore\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-poll',\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'];","function asyncGeneratorStep(n, t, e, r, o, a, c) {\n try {\n var i = n[a](c),\n u = i.value;\n } catch (n) {\n return void e(n);\n }\n i.done ? t(u) : Promise.resolve(u).then(r, o);\n}\nfunction _asyncToGenerator(n) {\n return function () {\n var t = this,\n e = arguments;\n return new Promise(function (r, o) {\n var a = n.apply(t, e);\n function _next(n) {\n asyncGeneratorStep(a, r, o, _next, _throw, \"next\", n);\n }\n function _throw(n) {\n asyncGeneratorStep(a, r, o, _next, _throw, \"throw\", n);\n }\n _next(void 0);\n });\n };\n}\nexport { _asyncToGenerator as default };","function _setPrototypeOf(t, e) {\n return _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function (t, e) {\n return t.__proto__ = e, t;\n }, _setPrototypeOf(t, e);\n}\nexport { _setPrototypeOf as default };","import setPrototypeOf from \"./setPrototypeOf.js\";\nfunction _inheritsLoose(t, o) {\n t.prototype = Object.create(o.prototype), t.prototype.constructor = t, setPrototypeOf(t, o);\n}\nexport { _inheritsLoose as default };","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/components/Modal'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/Component'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/components/Button'];","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'];","function _getPrototypeOf(t) {\n return _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function (t) {\n return t.__proto__ || Object.getPrototypeOf(t);\n }, _getPrototypeOf(t);\n}\nexport { _getPrototypeOf as default };","function _isNativeReflectConstruct() {\n try {\n var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {}));\n } catch (t) {}\n return (_isNativeReflectConstruct = function _isNativeReflectConstruct() {\n return !!t;\n })();\n}\nexport { _isNativeReflectConstruct as default };","import getPrototypeOf from \"./getPrototypeOf.js\";\nimport setPrototypeOf from \"./setPrototypeOf.js\";\nimport isNativeFunction from \"./isNativeFunction.js\";\nimport construct from \"./construct.js\";\nfunction _wrapNativeSuper(t) {\n var r = \"function\" == typeof Map ? new Map() : void 0;\n return _wrapNativeSuper = function _wrapNativeSuper(t) {\n if (null === t || !isNativeFunction(t)) return t;\n if (\"function\" != typeof t) throw new TypeError(\"Super expression must either be null or a function\");\n if (void 0 !== r) {\n if (r.has(t)) return r.get(t);\n r.set(t, Wrapper);\n }\n function Wrapper() {\n return construct(t, arguments, getPrototypeOf(this).constructor);\n }\n return Wrapper.prototype = Object.create(t.prototype, {\n constructor: {\n value: Wrapper,\n enumerable: !1,\n writable: !0,\n configurable: !0\n }\n }), setPrototypeOf(Wrapper, t);\n }, _wrapNativeSuper(t);\n}\nexport { _wrapNativeSuper as default };","function _isNativeFunction(t) {\n try {\n return -1 !== Function.toString.call(t).indexOf(\"[native code]\");\n } catch (n) {\n return \"function\" == typeof t;\n }\n}\nexport { _isNativeFunction as default };","import isNativeReflectConstruct from \"./isNativeReflectConstruct.js\";\nimport setPrototypeOf from \"./setPrototypeOf.js\";\nfunction _construct(t, e, r) {\n if (isNativeReflectConstruct()) return Reflect.construct.apply(null, arguments);\n var o = [null];\n o.push.apply(o, e);\n var p = new (t.bind.apply(t, o))();\n return r && setPrototypeOf(p, r.prototype), p;\n}\nexport { _construct as default };","import { NestedStringArray } from '@askvortsov/rich-icu-message-formatter';\n\nexport default class FormError extends Error {\n constructor(props: NestedStringArray | string) {\n super(props + '');\n }\n}\n","import app from 'flarum/forum/app';\nimport Poll from '../models/Poll';\nimport PollOption from '../models/PollOption';\n\nexport default class PollFormState {\n poll: Poll;\n loading: boolean;\n deleting: boolean;\n expandedGroup: string;\n\n static createNewPoll() {\n const poll = app.store.createRecord('polls');\n\n poll.pushAttributes({\n question: '',\n endDate: '',\n publicPoll: false,\n allowMultipleVotes: false,\n hideVotes: false,\n allowChangeVote: false,\n maxVotes: 0,\n });\n\n poll.tempOptions = [app.store.createRecord('poll_options'), app.store.createRecord('poll_options')];\n\n return poll;\n }\n\n constructor(poll: Poll) {\n if (!poll) {\n poll = PollFormState.createNewPoll();\n }\n\n this.loading = false;\n this.deleting = false;\n this.poll = poll;\n this.expandedGroup = 'setup';\n }\n\n isExpanded(groupKey: string) {\n return this.expandedGroup === groupKey;\n }\n\n expand(groupKey: string) {\n this.expandedGroup = groupKey;\n m.redraw();\n }\n\n async save(data: any) {\n this.loading = true;\n m.redraw();\n\n try {\n this.poll = await this.poll.save(data);\n /**\n * Cleanup attributes:\n * For the saving process, we add the options directly to the attributes.\n * As we currently cannot add new PollOptions as relationships.\n */\n delete this.poll!.data!.attributes!.options;\n } finally {\n this.loading = false;\n m.redraw();\n }\n }\n\n async delete() {\n this.loading = true;\n m.redraw();\n\n try {\n await this.poll.delete();\n this.deleting = true;\n } finally {\n this.loading = false;\n m.redraw();\n }\n }\n}\n","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/components/Page'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/components/LoadingIndicator'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/components/LinkButton'];","import Mithril from 'mithril';\nimport app from 'flarum/forum/app';\nimport Component, { ComponentAttrs } from 'flarum/common/Component';\nimport LinkButton from 'flarum/common/components/LinkButton';\nimport Poll from '../models/Poll';\nimport ItemList from 'flarum/common/utils/ItemList';\n\nexport interface ComposePollHeroAttrs extends ComponentAttrs {\n poll: Poll;\n}\n\nexport default class ComposePollHero extends Component {\n poll!: Poll;\n\n oninit(vnode: Mithril.Vnode): void {\n super.oninit(vnode);\n\n this.poll = this.attrs.poll;\n }\n\n view(): Mithril.Children {\n return (\n
\n
\n
\n

{app.translator.trans(`fof-polls.forum.compose.${!!this.poll.id() ? 'edit' : 'add'}_title`)}

\n
{this.controlItems().toArray()}
\n
\n
\n
\n );\n }\n\n controlItems(): ItemList {\n const items = new ItemList();\n\n items.add(\n 'edit',\n \n {app.translator.trans('fof-polls.forum.compose.polls_manager')}\n \n );\n\n if (this.poll.exists) {\n items.add(\n 'view',\n \n {app.translator.trans('fof-polls.forum.compose.polls_preview')}\n \n );\n }\n\n return items;\n }\n}\n","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/helpers/listItems'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/components/SelectDropdown'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['forum/components/IndexPage'];","import type Mithril from 'mithril';\nimport app from 'flarum/forum/app';\nimport Page from 'flarum/common/components/Page';\nimport Poll from '../models/Poll';\nimport LoadingIndicator from 'flarum/common/components/LoadingIndicator';\nimport PollForm from './PollForm';\nimport PollFormState from '../states/PollFormState';\nimport ComposePollHero from './ComposePollHero';\nimport Button from 'flarum/common/components/Button';\nimport listItems from 'flarum/common/helpers/listItems';\nimport ItemList from 'flarum/common/utils/ItemList';\nimport SelectDropdown from 'flarum/common/components/SelectDropdown';\nimport IndexPage from 'flarum/forum/components/IndexPage';\n\nexport default class ComposePollPage extends Page {\n poll: Poll | null | undefined = null;\n\n loading: boolean = false;\n\n oninit(vnode: Mithril.Vnode) {\n super.oninit(vnode);\n\n // prevent users from accessing the page if they can't start global polls or if they are disabled altogether\n if (!app.forum.attribute('globalPollsEnabled') || !app.forum.attribute('canStartGlobalPolls')) {\n m.route.set('/');\n return;\n }\n\n this.bodyClass = 'App--compose-poll';\n\n // Get the `edit` parameter from the URL\n const editId = m.route.param('id');\n\n // either load the poll we're editing or create a new one\n const pollPromise = editId ? this.loadEditingPoll(editId) : Promise.resolve(PollFormState.createNewPoll());\n\n pollPromise.then((poll: Poll | null | undefined) => {\n this.poll = poll;\n\n if (poll?.exists && !poll.canEdit()) {\n m.route.set('/');\n return;\n }\n\n app.history.push('compose-poll', app.translator.trans(`fof-polls.forum.compose.${!!this.poll?.id() ? 'edit' : 'add'}_title`) as string);\n app.setTitle(app.translator.trans(`fof-polls.forum.compose.${!!this.poll?.id() ? 'edit' : 'add'}_title`) as string);\n\n m.redraw();\n });\n }\n\n async loadEditingPoll(editId: string) {\n const alreadyLoaded = app.store.getById('poll', editId);\n\n if (alreadyLoaded) return alreadyLoaded;\n\n this.loading = true;\n\n const poll = await app.store.find('fof/polls', editId);\n\n this.loading = false;\n\n return poll;\n }\n\n view(): Mithril.Children {\n if (this.loading || !this.poll) {\n return ;\n }\n\n return (\n
\n \n
\n
\n \n
\n \n
\n
\n
\n
\n );\n }\n\n async onsubmit(data: Object, state: PollFormState) {\n const isNew = state.poll.id() === undefined;\n await state.save(data);\n\n const alertAttrs = isNew\n ? {\n type: 'success',\n controls: [\n \n m.route.set(\n app.route('fof.polls.compose', {\n id: state.poll.id(),\n })\n )\n }\n >\n {app.translator.trans('fof-polls.forum.compose.continue_editing')}\n ,\n ],\n }\n : {\n type: 'success',\n };\n\n // Show success alert\n const alertId = app.alerts.show(alertAttrs, app.translator.trans('fof-polls.forum.compose.success'));\n\n // Hide alert after 10 seconds\n setTimeout(() => app.alerts.dismiss(alertId), 10000);\n\n if (isNew) {\n m.route.set(app.route('fof.polls.list'));\n }\n }\n\n sidebarItems(): ItemList {\n const items = new ItemList();\n\n items.add(\n 'nav',\n \n {this.navItems().toArray()}\n \n );\n\n return items;\n }\n\n navItems() {\n return IndexPage.prototype.navItems();\n }\n}\n","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/utils/SubtreeRetainer'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/components/Dropdown'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/components/Link'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/helpers/highlight'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['forum/utils/slidable'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/helpers/icon'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/utils/abbreviateNumber'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/components/Tooltip'];","import app from 'flarum/forum/app';\nimport Mithril from 'mithril';\nimport Component, { ComponentAttrs } from 'flarum/common/Component';\nimport PollOptionModel from '../../models/PollOption';\nimport PollState from '../../states/PollState';\nimport Tooltip, { TooltipAttrs } from 'flarum/common/components/Tooltip';\nimport icon from 'flarum/common/helpers/icon';\nimport classList from 'flarum/common/utils/classList';\nimport ItemList from 'flarum/common/utils/ItemList';\nimport Poll from '../../models/Poll';\n\ninterface PollOptionAttrs extends ComponentAttrs {\n option: PollOptionModel;\n name: string;\n state: PollState;\n}\n\nexport default class PollOption extends Component {\n option!: PollOptionModel;\n name!: string;\n state!: PollState;\n hasVoted: boolean = false;\n totalVotes: number = 0;\n votes: number = 0;\n voted: boolean = false;\n poll!: Poll;\n canSeeVoteCount: boolean = false;\n answer!: string;\n\n oninit(vnode: Mithril.Vnode) {\n super.oninit(vnode);\n this.option = this.attrs.option;\n this.name = this.attrs.name;\n this.state = this.attrs.state;\n this.poll = this.state.poll;\n\n // isNaN(null) is false, so we have to check type directly now that API always returns the field\n this.canSeeVoteCount = typeof this.votes === 'number';\n\n this.answer = this.option.answer();\n }\n\n percent(): number {\n return this.totalVotes > 0 ? Math.round((this.votes / this.totalVotes) * 100) : 0;\n }\n\n view(): Mithril.Children {\n // following values can be changed by ui interactions, so we need to update them on every render\n this.hasVoted = this.state.hasVoted();\n this.totalVotes = this.state.overallVoteCount();\n this.votes = this.option.voteCount();\n this.voted = this.state.hasVotedFor(this.option);\n\n const isDisabled = this.state.loadingOptions || (this.hasVoted && !this.poll.canChangeVote());\n const width = this.canSeeVoteCount ? this.percent() : (Number(this.voted) / (this.poll.myVotes()?.length || 1)) * 100;\n\n const bar = (\n \n );\n\n return (\n \n {this.canSeeVoteCount ? (\n \n {bar}\n \n ) : (\n bar\n )}\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: Mithril.Vnode) {\n vnode.attrs.tooltipVisible = false;\n\n // @ts-ignore\n vnode.state.updateVisibility();\n }\n\n optionDisplayItems(): ItemList {\n const items = new ItemList();\n\n items.add(\n 'answer',\n \n {this.answer}\n \n );\n\n this.voted && !this.state.showCheckMarks && items.add('check', icon('fas fa-check-circle', { className: 'PollAnswer-check' }));\n\n this.canSeeVoteCount &&\n items.add('percent', {this.percent()}%);\n\n return items;\n }\n}\n","import type Mithril from 'mithril';\nimport Component, { ComponentAttrs } from 'flarum/common/Component';\nimport PollOption from './PollOption';\nimport PollOptionModel from '../../models/PollOption';\nimport ItemList from 'flarum/common/utils/ItemList';\nimport PollState from '../../states/PollState';\n\ninterface PollOptionsAttrs extends ComponentAttrs {\n options: PollOptionModel[];\n name: String;\n state: PollState;\n}\n\nexport default class PollOptions extends Component {\n view(): Mithril.Children {\n return
{this.pollOptions().toArray()}
;\n }\n\n pollOptions(): ItemList {\n const items = new ItemList();\n\n this.attrs.options.forEach((option: PollOptionModel): void => {\n items.add('option' + option.id(), this.createOptionView(option));\n });\n\n return items;\n }\n\n createOptionView(option: PollOptionModel): Mithril.Children {\n return ;\n }\n}\n","import type Mithril from 'mithril';\nimport Component, { ComponentAttrs } from 'flarum/common/Component';\nimport Poll from 'src/forum/models/Poll';\nimport ItemList from 'flarum/common/utils/ItemList';\n\ninterface PollImageAttrs extends ComponentAttrs {\n poll: Poll;\n}\n\nexport default class PollImage extends Component {\n imageUrl: string | null = null;\n imageAlt: string | null = null;\n\n oninit(vnode: Mithril.Vnode) {\n super.oninit(vnode);\n\n this.imageUrl = this.attrs.poll.imageUrl();\n this.imageAlt = this.attrs.poll.imageAlt();\n }\n\n view(): Mithril.Children {\n if (!this.imageUrl) {\n return;\n }\n\n return
{this.imageItems().toArray()}
;\n }\n\n imageItems(): ItemList {\n const items = new ItemList();\n\n items.add('image', {this.imageAlt);\n\n return items;\n }\n}\n","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'];","import type Mithril from 'mithril';\nimport app from 'flarum/forum/app';\nimport Modal, { IInternalModalAttrs } 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 LoadingIndicator from 'flarum/common/components/LoadingIndicator';\nimport PollModel from '../models/Poll';\nimport PollVote from '../models/PollVote';\nimport User from 'flarum/common/models/User';\nimport PollOption from '../models/PollOption';\n\ninterface ListVotersModalAttrs extends IInternalModalAttrs {\n poll: PollModel;\n onsubmit: (data: object) => Promise;\n}\n\nexport default class ListVotersModal extends Modal {\n oninit(vnode: Mithril.Vnode): void {\n super.oninit(vnode);\n\n this.loading = 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(): string {\n return 'Modal--medium VotesModal';\n }\n\n title(): Mithril.Children {\n return app.translator.trans('fof-polls.forum.votes_modal.title');\n }\n\n content(): Mithril.Children {\n const options = this.attrs.poll.options() as PollOption[];\n return
{this.loading ? : options.map(this.optionContent.bind(this))}
;\n }\n\n optionContent(opt: PollOption): Mithril.Children {\n const votes = (this.attrs.poll.votes() || []).filter((v) => opt.id() === v!.option()!.id()) as PollVote[];\n\n return (\n
\n

{this.optionAnswer(opt)! + ':'}

\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 optionAnswer(opt: PollOption): string {\n return opt.answer();\n }\n\n voteContent(vote: PollVote): Mithril.Children {\n const user = vote.user() as User;\n const attrs = user && { href: app.route.user(user) };\n\n return (\n \n {avatar(user)} {username(user)}\n \n );\n }\n}\n","import app from 'flarum/forum/app';\nimport Poll from '../models/Poll';\nimport LogInModal from 'flarum/forum/components/LogInModal';\nimport PollOption from '../models/PollOption';\nimport PollVote from '../models/PollVote';\nimport ListVotersModal from '../components/ListVotersModal';\nimport { ApiPayloadSingle } from 'flarum/common/Store';\n\nexport default class PollState {\n public poll: Poll;\n protected pendingSubmit: boolean = false;\n protected pendingOptions: Set | null = null;\n public loadingOptions: boolean = false;\n public useSubmitUI: boolean;\n public showCheckMarks: boolean;\n public canSeeVoteCount: boolean;\n\n constructor(poll: Poll) {\n this.poll = poll;\n this.useSubmitUI = !poll?.canChangeVote() && poll?.allowMultipleVotes();\n this.showCheckMarks = !app.session.user || (!poll.hasEnded() && poll.canVote() && (!this.hasVoted() || poll.canChangeVote()));\n this.canSeeVoteCount = typeof poll.voteCount() === 'number';\n this.init();\n }\n\n /**\n * used as en extendable entry point for init customizations\n */\n init(): void {}\n\n isShowResult(): boolean {\n return this.poll.hasEnded() || (this.canSeeVoteCount && !!app.session.user && this.hasVoted());\n }\n\n hasVoted(): boolean {\n return this.poll.myVotes().length > 0;\n }\n\n overallVoteCount(): number {\n return this.poll.voteCount();\n }\n\n hasVotedFor(option: PollOption): boolean {\n return this.pendingOptions ? this.pendingOptions.has(option.id()!) : this.poll.myVotes().some((vote: PollVote) => vote.option() === option);\n }\n\n getMaxVotes(): number {\n const poll = this.poll;\n let maxVotes = poll.allowMultipleVotes() ? poll.maxVotes() : 1;\n if (maxVotes === 0) maxVotes = poll.options().length;\n return maxVotes;\n }\n\n showButton(): boolean {\n return this.useSubmitUI && this.pendingSubmit;\n }\n\n changeVote(option: PollOption, evt: Event): void {\n const target = evt.target as HTMLInputElement;\n\n if (!app.session.user) {\n app.modal.show(LogInModal);\n target.checked = false;\n return;\n }\n\n const optionIds = this.pendingOptions || new Set(this.poll.myVotes().map((v: PollVote) => v.option()!.id()!));\n const isUnvoting = optionIds.delete(option.id()!);\n const allowsMultiple = this.poll.allowMultipleVotes();\n\n if (!allowsMultiple) {\n optionIds.clear();\n }\n\n if (!isUnvoting) {\n optionIds.add(option.id()!);\n }\n\n this.pendingOptions = optionIds.size ? optionIds : null;\n this.pendingSubmit = !!this.pendingOptions;\n\n if (this.useSubmitUI) {\n this.pendingOptions = optionIds.size ? optionIds : null;\n this.pendingSubmit = !!this.pendingOptions;\n m.redraw();\n return;\n }\n\n this.submit(optionIds, null, () => (target.checked = isUnvoting));\n }\n\n hasSelectedOptions(): boolean {\n return this.pendingSubmit;\n }\n\n onsubmit(): Promise {\n return this.submit(this.pendingOptions!, () => {\n this.pendingOptions = null;\n this.pendingSubmit = false;\n });\n }\n\n submit(optionIds: Set, cb: Function | null, onerror: Function | null = null) {\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.poll.id()}/votes`,\n body: {\n data: {\n optionIds: Array.from(optionIds),\n },\n },\n })\n .then((res: ApiPayloadSingle) => {\n app.store.pushPayload(res);\n cb?.();\n })\n .catch((err) => {\n onerror?.(err);\n })\n .finally(() => {\n this.loadingOptions = false;\n this.canSeeVoteCount = typeof this.poll.voteCount() === 'number';\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.poll,\n });\n };\n}\n","import type Mithril from 'mithril';\nimport app from 'flarum/forum/app';\nimport Component, { ComponentAttrs } from 'flarum/common/Component';\nimport Button from 'flarum/common/components/Button';\nimport PollState from '../../states/PollState';\n\ninterface PollSubmitButtonAttrs extends ComponentAttrs {\n state: PollState;\n}\n\nexport default class PollSubmitButton extends Component {\n view(): Mithril.Children {\n const state = this.attrs.state;\n return (\n this.pollButtonSubmit(state, event)}\n disabled={!state.hasSelectedOptions()}\n >\n {app.translator.trans('fof-polls.forum.poll.submit_button')}\n \n );\n }\n\n /**\n * Event handler for submit button being clicked\n */\n\n pollButtonSubmit(state: PollState, event: Event): void {\n state.onsubmit();\n }\n}\n","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/utils/string'];","import Component, { ComponentAttrs } from 'flarum/common/Component';\nimport ItemList from 'flarum/common/utils/ItemList';\nimport Poll from 'src/forum/models/Poll';\nimport Mithril from 'mithril';\n\nexport interface PollTitleAttrs extends ComponentAttrs {\n poll: Poll;\n}\n\nexport default class PollTitle extends Component {\n view() {\n return
{this.pollTitleItems().toArray()}
;\n }\n\n pollTitleItems(): ItemList {\n const items = new ItemList();\n\n items.add('title',

{this.attrs.poll.question()}

);\n\n return items;\n }\n}\n","import Component, { ComponentAttrs } from 'flarum/common/Component';\nimport ItemList from 'flarum/common/utils/ItemList';\nimport Poll from 'src/forum/models/Poll';\nimport Mithril from 'mithril';\n\nexport interface PollSubtitleAttrs extends ComponentAttrs {\n poll: Poll;\n}\n\nexport default class PollSubtitle extends Component {\n view() {\n if (!this.attrs.poll.subtitle()) {\n return;\n }\n\n return
{this.pollSubtitleItems().toArray()}
;\n }\n\n pollSubtitleItems(): ItemList {\n const items = new ItemList();\n\n items.add('subtitle',

{this.attrs.poll.subtitle()}

);\n\n return items;\n }\n}\n","import Mithril from 'mithril';\nimport Component, { ComponentAttrs } from 'flarum/common/Component';\nimport app from 'flarum/forum/app';\nimport PollOptions from './Poll/PollOptions';\nimport PollImage from './Poll/PollImage';\nimport PollModel from '../models/Poll';\nimport PollState from '../states/PollState';\nimport Button from 'flarum/common/components/Button';\nimport ItemList from 'flarum/common/utils/ItemList';\nimport PollControls from '../utils/PollControls';\nimport Dropdown from 'flarum/common/components/Dropdown';\nimport PollSubmitButton from './Poll/PollSubmitButton';\nimport { slug } from 'flarum/common/utils/string';\nimport classList from 'flarum/common/utils/classList';\nimport PollTitle from './Poll/PollTitle';\nimport PollSubtitle from './Poll/PollSubtitle';\n\ninterface PollAttrs extends ComponentAttrs {\n poll: PollModel;\n}\n\nexport default class PollView extends Component {\n state!: PollState;\n\n oninit(vnode: Mithril.Vnode) {\n super.oninit(vnode);\n this.state = new PollState(this.attrs.poll);\n }\n\n oncreate(vnode: Mithril.Vnode) {\n super.oncreate(vnode);\n\n this.preventClose = this.preventClose.bind(this);\n window.addEventListener('beforeunload', this.preventClose);\n }\n\n onremove(vnode: Mithril.Vnode) {\n super.onremove(vnode);\n\n window.removeEventListener('beforeunload', this.preventClose);\n }\n\n view(): Mithril.Children {\n const poll = this.attrs.poll;\n const state = this.state;\n const controls = PollControls.controls(poll, this);\n\n (poll.publicPoll() || poll.canEdit()) &&\n controls.add(\n 'view',\n \n );\n\n return (\n
\n {this.controlsView(controls.toArray())}\n
{this.createMainView().toArray()}
\n
\n );\n }\n\n createMainView(): ItemList {\n const items = new ItemList();\n\n items.add('header',
{this.createPollHeader().toArray()}
);\n items.add('content',
{this.createPollContent().toArray()}
);\n items.add('footer',
{this.createPollFooter().toArray()}
);\n\n return items;\n }\n\n createPollHeader(): ItemList {\n const items = new ItemList();\n const poll = this.attrs.poll;\n\n items.add('title', );\n if (poll.subtitle()) items.add('subtitle', );\n\n return items;\n }\n\n createPollContent(): ItemList {\n const items = new ItemList();\n const poll = this.attrs.poll;\n\n if (poll.imageUrl()) {\n items.add('image', );\n }\n\n items.add('form',
{this.createFormItems().toArray()}
);\n\n return items;\n }\n\n createPollFooter(): ItemList {\n const items = new ItemList();\n const state = this.state;\n\n const infoItems = this.infoItems(state.getMaxVotes());\n\n items.add(\n 'sticky',\n
\n {!infoItems.isEmpty() &&
{infoItems.toArray()}
}\n {state.showButton() && }\n
\n );\n\n return items;\n }\n\n createFormItems(): ItemList {\n const items = new ItemList();\n const poll = this.attrs.poll;\n const state = this.state;\n const questionSlug = slug(poll.question());\n\n items.add(\n 'elements',\n
\n {poll.question()}\n \n
\n );\n\n return items;\n }\n\n controlsView(controls: Mithril.ChildArray): Mithril.Children {\n return (\n !!controls.length && (\n \n {controls}\n \n )\n );\n }\n\n infoItems(maxVotes: number) {\n const items = new ItemList();\n const poll = this.attrs.poll;\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 /**\n * Alert before navigating away using browser's 'beforeunload' event\n */\n preventClose = (e: Event): boolean | void => {\n if (this.state.hasSelectedOptions()) {\n e.preventDefault();\n return true;\n }\n };\n}\n","function _typeof(o) {\n \"@babel/helpers - typeof\";\n\n return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (o) {\n return typeof o;\n } : function (o) {\n return o && \"function\" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? \"symbol\" : typeof o;\n }, _typeof(o);\n}\nexport { _typeof as default };","import _typeof from \"./typeof.js\";\nimport toPrimitive from \"./toPrimitive.js\";\nfunction toPropertyKey(t) {\n var i = toPrimitive(t, \"string\");\n return \"symbol\" == _typeof(i) ? i : i + \"\";\n}\nexport { toPropertyKey as default };","import _typeof from \"./typeof.js\";\nfunction toPrimitive(t, r) {\n if (\"object\" != _typeof(t) || !t) return t;\n var e = t[Symbol.toPrimitive];\n if (void 0 !== e) {\n var i = e.call(t, r || \"default\");\n if (\"object\" != _typeof(i)) return i;\n throw new TypeError(\"@@toPrimitive must return a primitive value.\");\n }\n return (\"string\" === r ? String : Number)(t);\n}\nexport { toPrimitive as default };","import toPropertyKey from \"./toPropertyKey.js\";\nfunction _defineProperties(e, r) {\n for (var t = 0; t < r.length; t++) {\n var o = r[t];\n o.enumerable = o.enumerable || !1, o.configurable = !0, \"value\" in o && (o.writable = !0), Object.defineProperty(e, toPropertyKey(o.key), o);\n }\n}\nfunction _createClass(e, r, t) {\n return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, \"prototype\", {\n writable: !1\n }), e;\n}\nexport { _createClass as default };","import app from 'flarum/forum/app';\nimport Component, { ComponentAttrs } from 'flarum/common/Component';\nimport classList from 'flarum/common/utils/classList';\nimport icon from 'flarum/common/helpers/icon';\nimport ItemList from 'flarum/common/utils/ItemList';\nimport type Mithril from 'mithril';\n\ninterface PollPageHeroAttrs extends ComponentAttrs {\n icon?: string;\n title?: string;\n}\n\nexport default class PollPageHero extends Component {\n oninit(vnode: Mithril.Vnode) {\n super.oninit(vnode);\n }\n\n get classNames(): string {\n return classList({\n PollPageHero: true,\n Hero: true,\n });\n }\n\n get wrapperClasses(): string {\n return classList({\n 'PollPageHero--wrapper': true,\n });\n }\n\n oncreate(vnode: Mithril.Vnode): void {\n super.oncreate(vnode);\n }\n\n get title() {\n return this.attrs.title || app.translator.trans('fof-polls.forum.polls_page.title');\n }\n\n get icon() {\n return this.attrs.icon || 'fas fa-poll';\n }\n\n view() {\n return (\n
\n
\n
\n
{this.items().toArray()}
\n
\n
\n
\n );\n }\n\n items() {\n const items = new ItemList();\n items.add('title',

{[icon(this.icon), ' ', this.title]}

, 50);\n\n return items;\n }\n}\n","import Page, { IPageAttrs } from 'flarum/common/components/Page';\nimport PollListState from '../states/PollListState';\nimport Poll from '../models/Poll';\nimport ItemList from 'flarum/common/utils/ItemList';\nimport type Mithril from 'mithril';\nimport LoadingIndicator from 'flarum/common/components/LoadingIndicator';\nimport IndexPage from 'flarum/forum/components/IndexPage';\nimport listItems from 'flarum/common/helpers/listItems';\nimport app from 'flarum/forum/app';\nimport SelectDropdown from 'flarum/common/components/SelectDropdown';\nimport IndexPageHero from './PollPageHero';\n\nexport abstract class AbstractPollPage extends Page {\n loading: boolean = false;\n poll: Poll | null | undefined = null;\n polls: Poll[] = [];\n\n view(): Mithril.Children {\n return
{this.pageContent().toArray()}
;\n }\n\n pageContent(): ItemList {\n const items = new ItemList();\n\n items.add('hero', this.hero(), 100);\n items.add('main',
{this.mainContent().toArray()}
, 10);\n\n return items;\n }\n\n mainContent(): ItemList {\n const items = new ItemList();\n\n items.add('sidebar', this.sidebar(), 100);\n items.add('content', this.content(), 10);\n\n return items;\n }\n\n content(): Mithril.Children {\n return
{this.contentItems().toArray()}
;\n }\n\n contentItems(): ItemList {\n const items = new ItemList();\n\n if (this.loading) {\n items.add('loading', );\n }\n\n return items;\n }\n\n hero(): Mithril.Children {\n return ;\n }\n\n sidebar(): Mithril.Children {\n return (\n \n );\n }\n\n sidebarItems(): ItemList {\n const items = IndexPage.prototype.sidebarItems();\n\n items.setContent(\n 'nav',\n \n {this.navItems().toArray()}\n \n );\n\n return items;\n }\n\n navItems(): ItemList {\n const items = IndexPage.prototype.navItems();\n\n if (app.initializers.has('flarum-tags')) {\n // remove the tags from the nav items\n items.remove('separator');\n items.remove('moreTags');\n\n // each tag is added using the key \"tag{id}\". We need to remove all of them\n for (const key in items.toObject()) {\n if (key.startsWith('tag') && key !== 'tags') {\n items.remove(key);\n }\n }\n }\n\n return items;\n }\n}\n","import type Mithril from 'mithril';\nimport app from 'flarum/forum/app';\nimport PollModel from '../models/Poll';\nimport PollView from './PollView';\nimport { AbstractPollPage } from './AbstractPollPage';\nimport ItemList from 'flarum/common/utils/ItemList';\n\nexport default class PollViewPage extends AbstractPollPage {\n oninit(vnode: Mithril.Vnode) {\n super.oninit(vnode);\n\n if (!app.forum.attribute('globalPollsEnabled')) {\n m.route.set('/');\n return;\n }\n\n const editId = m.route.param('id');\n this.poll = app.store.getById('poll', editId);\n\n if (!this.poll) {\n this.loading = true;\n\n app.store.find('fof/polls', editId).then((item) => {\n this.poll = item;\n this.loading = false;\n app.setTitle(this.poll.question());\n m.redraw();\n });\n }\n }\n\n contentItems(): ItemList {\n const items = super.contentItems();\n\n if (!this.loading) {\n items.add('poll', );\n }\n\n return items;\n }\n}\n","import type Mithril from 'mithril';\nimport app from 'flarum/forum/app';\nimport Component, { ComponentAttrs } from 'flarum/common/Component';\nimport type { PollListParams } from '../../states/PollListState';\nimport SubtreeRetainer from 'flarum/common/utils/SubtreeRetainer';\nimport classList from 'flarum/common/utils/classList';\nimport Dropdown from 'flarum/common/components/Dropdown';\nimport Link from 'flarum/common/components/Link';\nimport highlight from 'flarum/common/helpers/highlight';\nimport slidable from 'flarum/forum/utils/slidable';\nimport icon from 'flarum/common/helpers/icon';\nimport abbreviateNumber from 'flarum/common/utils/abbreviateNumber';\nimport Poll from '../../models/Poll';\nimport PollControls from '../../utils/PollControls';\nimport ItemList from 'flarum/common/utils/ItemList';\nimport listItems from 'flarum/common/helpers/listItems';\nimport PollViewPage from '../PollViewPage';\n\nexport interface IPollListItemAttrs extends ComponentAttrs {\n poll: Poll;\n params: PollListParams;\n}\n\n/**\n * The `PollListItem` component shows a single poll in the\n * poll list.\n */\nexport default class PollListItem extends Component {\n /**\n * Ensures that the poll will not be redrawn\n * unless new data comes in.\n */\n subtree!: SubtreeRetainer;\n poll!: Poll;\n\n highlightRegExp?: RegExp;\n\n oninit(vnode: Mithril.Vnode) {\n super.oninit(vnode);\n\n this.poll = this.attrs.poll;\n\n this.subtree = new SubtreeRetainer(\n () => this.poll.freshness,\n () => {\n const time = app.session.user && app.session.user.markedAllAsReadAt();\n return time && time.getTime();\n },\n () => this.active()\n );\n }\n\n elementAttrs() {\n return {\n className: classList('PollListItem', {\n active: this.active(),\n 'PollListItem--hidden': this.poll.isHidden(),\n Slidable: 'ontouchstart' in window,\n }),\n };\n }\n\n view() {\n const controls = PollControls.controls(this.poll, this).toArray();\n const attrs = this.elementAttrs();\n\n return (\n
\n {this.controlsView(controls)}\n {this.contentView()}\n {this.slidableUnderneathView()}\n
\n );\n }\n\n controlsView(controls: Mithril.ChildArray): Mithril.Children {\n return (\n !!controls.length && (\n \n {controls}\n \n )\n );\n }\n\n slidableUnderneathView(): Mithril.Children {\n const isUnread = this.poll.isUnread();\n\n return (\n \n {icon('fas fa-check')}\n \n );\n }\n\n contentView(): Mithril.Children {\n // const isUnread = this.poll.isUnread();\n // const isRead = this.poll.isRead();\n\n return (\n //
\n
{this.mainView()}
\n );\n }\n\n mainView(): Mithril.Children {\n return (\n \n

{highlight(this.pollQuestion(this.poll), this.highlightRegExp)}

\n {this.poll.subtitle() &&

{this.pollSubtitle(this.poll)}

}\n
    {listItems(this.infoItems().toArray())}
\n \n );\n }\n\n /**\n * Allow extensions to revise the question string.\n */\n pollQuestion(poll: Poll): string {\n return poll.question();\n }\n\n /**\n * Allow extensions to revise the subtitle string.\n */\n pollSubtitle(poll: Poll): string | null {\n return poll.subtitle();\n }\n\n oncreate(vnode: Mithril.VnodeDOM) {\n super.oncreate(vnode);\n\n // If we're on a touch device, set up the discussion row to be slidable.\n // This allows the user to drag the row to either side of the screen to\n // reveal controls.\n if ('ontouchstart' in window) {\n const slidableInstance = slidable(this.element);\n\n this.$('.PollListItem-controls').on('hidden.bs.dropdown', () => slidableInstance.reset());\n }\n }\n\n onbeforeupdate(vnode: Mithril.VnodeDOM) {\n super.onbeforeupdate(vnode);\n\n return this.subtree.needsRebuild();\n }\n\n /**\n * Determine whether or not the discussion is currently being viewed.\n */\n active() {\n return app.current.matches(PollViewPage, { poll: this.poll });\n }\n\n /**\n * Mark the poll as read.\n */\n markAsRead() {\n if (this.poll.isUnread()) {\n this.poll.save({ lastVotedNumber: this.poll.voteCount() });\n m.redraw();\n }\n }\n\n infoItems(): ItemList {\n const items = new ItemList();\n const active = !this.poll.hasEnded();\n const activeView = this.poll.endDate()\n ? [\n icon('fas fa-clock'),\n ' ',\n active\n ? app.translator.trans('fof-polls.forum.days_remaining', { time: dayjs(this.poll.endDate()).fromNow() })\n : app.translator.trans('fof-polls.forum.poll_ended'),\n ]\n : [icon('fas fa-infinity'), ' ', app.translator.trans('fof-polls.forum.poll_never_ends')];\n\n items.add('active', {activeView});\n\n const voteCount = this.poll.voteCount();\n if (voteCount !== undefined) {\n items.add(\n 'voteCount',\n \n {icon('fas fa-poll fa-fw')}\n {[\n ' ',\n app.translator.trans('fof-polls.forum.polls_count', {\n count: abbreviateNumber(voteCount),\n }),\n ]}\n ,\n 70\n );\n }\n\n return items;\n }\n}\n","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/components/Placeholder'];","import app from 'flarum/forum/app';\nimport Component, { ComponentAttrs } from 'flarum/common/Component';\nimport PollListItem from './PollListItem';\nimport Button from 'flarum/common/components/Button';\nimport LoadingIndicator from 'flarum/common/components/LoadingIndicator';\nimport Placeholder from 'flarum/common/components/Placeholder';\nimport classList from 'flarum/common/utils/classList';\nimport PollListState from '../../states/PollListState';\n\nexport interface PollListAttrs extends ComponentAttrs {\n state: PollListState;\n}\n\n/**\n * The `PollList` component displays a list of polls.\n */\nexport default class PollList extends Component {\n view() {\n const state = this.attrs.state;\n const params = state.getParams();\n const isLoading = state.isInitialLoading() || state.isLoadingNext();\n\n let loading;\n\n if (isLoading) {\n loading = ;\n } else if (state.hasNext()) {\n loading = (\n \n );\n }\n\n if (state.isEmpty()) {\n const text = app.translator.trans('fof-polls.forum.polls_list.empty_text');\n return (\n
\n \n
\n );\n }\n\n return (\n
\n
    \n {state.getPages().map((pg) => {\n return pg.items.map((poll) => (\n
  • \n \n
  • \n ));\n })}\n
\n
{loading}
\n
\n );\n }\n}\n","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/states/PaginatedListState'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/utils/EventEmitter'];","import app from 'flarum/forum/app';\nimport PaginatedListState, { Page, PaginatedListParams, PaginatedListRequestParams } from 'flarum/common/states/PaginatedListState';\nimport Poll from '../models/Poll';\nimport { ApiResponsePlural } from 'flarum/common/Store';\nimport EventEmitter from 'flarum/common/utils/EventEmitter';\n\nexport interface PollListParams extends PaginatedListParams {\n sort?: string;\n}\n\nconst globalEventEmitter = new EventEmitter();\n\nexport default class PollListState

extends PaginatedListState {\n protected extraPolls: Poll[] = [];\n protected eventEmitter: EventEmitter;\n\n constructor(params: P, page: number = 1) {\n super(params, page, 20);\n\n this.eventEmitter = globalEventEmitter.on('poll.deleted', this.deletePoll.bind(this));\n }\n\n get type(): string {\n return 'fof/polls';\n }\n\n requestParams(): PaginatedListRequestParams {\n const params = {\n include: this.params.include || ['options', 'votes'],\n filter: this.params.filter || {},\n sort: this.sortMap()[this.params.sort ?? ''],\n };\n\n if (this.params.q) {\n params.filter.q = this.params.q;\n }\n\n return params;\n }\n\n protected loadPage(page: number = 1): Promise> {\n const preloadedPolls = app.preloadedApiDocument();\n\n if (preloadedPolls) {\n this.initialLoading = false;\n\n return Promise.resolve(preloadedPolls);\n }\n\n return super.loadPage(page);\n }\n\n clear(): void {\n super.clear();\n\n this.extraPolls = [];\n }\n\n /**\n * Get a map of sort keys (which appear in the URL, and are used for\n * translation) to the API sort value that they represent.\n */\n sortMap() {\n const map: any = {};\n\n if (this.params.q) {\n map.relevance = '';\n }\n map.newest = '-createdAt';\n map.oldest = 'createdAt';\n\n return map;\n }\n\n /**\n * In the last request, has the user searched for a poll?\n */\n isSearchResults(): boolean {\n return !!this.params.q;\n }\n\n removePoll(poll: Poll): void {\n this.eventEmitter.emit('poll.deleted', poll);\n }\n\n deletePoll(poll: Poll): void {\n for (const page of this.pages) {\n const index = page.items.indexOf(poll);\n\n if (index !== -1) {\n page.items.splice(index, 1);\n break;\n }\n }\n\n const index = this.extraPolls.indexOf(poll);\n\n if (index !== -1) {\n this.extraPolls.splice(index);\n }\n\n m.redraw();\n }\n\n /**\n * Add a poll to the top of the list.\n */\n addPoll(poll: Poll): void {\n this.removePoll(poll);\n this.extraPolls.unshift(poll);\n\n m.redraw();\n }\n\n protected getAllItems(): Poll[] {\n return this.extraPolls.concat(super.getAllItems());\n }\n\n public getPages(): Page[] {\n const pages = super.getPages();\n\n if (this.extraPolls.length) {\n return [\n {\n number: -1,\n items: this.extraPolls,\n },\n ...pages,\n ];\n }\n\n return pages;\n }\n}\n","import type Mithril from 'mithril';\nimport app from 'flarum/forum/app';\nimport listItems from 'flarum/common/helpers/listItems';\nimport ItemList from 'flarum/common/utils/ItemList';\nimport IndexPage from 'flarum/forum/components/IndexPage';\nimport PollList from './Poll/PollList';\nimport LogInModal from 'flarum/forum/components/LogInModal';\nimport extractText from 'flarum/common/utils/extractText';\nimport PollListState from '../states/PollListState';\nimport Button from 'flarum/common/components/Button';\nimport SelectDropdown from 'flarum/common/components/SelectDropdown';\nimport LoadingIndicator from 'flarum/common/components/LoadingIndicator';\nimport PollView from './PollView';\nimport { AbstractPollPage } from './AbstractPollPage';\n\nexport default class PollsPage extends AbstractPollPage {\n oninit(vnode: Mithril.Vnode) {\n super.oninit(vnode);\n\n if (!app.forum.attribute('globalPollsEnabled')) {\n m.route.set('/');\n return;\n }\n\n this.state = new PollListState({\n sort: m.route.param('sort'),\n filter: m.route.param('filter'),\n });\n\n this.state.refresh();\n\n app.setTitle(extractText(app.translator.trans('fof-polls.forum.page.nav')));\n }\n\n view(): Mithril.Children {\n if (this.loading) {\n return ;\n }\n\n if (this.poll) {\n return (\n

\n
\n \n
\n
\n );\n }\n\n return (\n
\n {super.hero()}\n
\n
\n \n
\n
\n
    {listItems(this.viewItems().toArray())}
\n
    {listItems(this.actionItems().toArray())}
\n
\n \n
\n
\n
\n
\n );\n }\n\n sidebarItems(): ItemList {\n const items = new ItemList();\n const canStartPoll = app.forum.attribute('canStartGlobalPolls');\n\n items.add(\n 'newGlobalPoll',\n {\n this.newPollAction();\n }}\n disabled={!canStartPoll}\n >\n {app.translator.trans(`fof-polls.forum.poll.${canStartPoll ? 'start_poll_button' : 'cannot_start_poll_button'}`)}\n \n );\n\n items.add(\n 'nav',\n \n {this.navItems().toArray()}\n \n );\n\n return items;\n }\n\n actionItems(): ItemList {\n const items = new ItemList();\n\n items.add(\n 'refresh',\n Button.component({\n title: app.translator.trans('fof-polls.forum.page.refresh_tooltip'),\n icon: 'fas fa-sync',\n className: 'Button Button--icon',\n onclick: () => {\n this.state.refresh();\n },\n })\n );\n\n return items;\n }\n\n viewItems() {\n return IndexPage.prototype.viewItems();\n }\n\n navItems() {\n return IndexPage.prototype.navItems();\n }\n\n /**\n * Change to create new poll page\n */\n newPollAction(): void {\n if (!app.session.user) {\n app.modal.show(LogInModal);\n return;\n }\n\n m.route.set(app.route('fof.polls.compose'));\n }\n}\n","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/components/Separator'];","import type Mithril from 'mithril';\nimport app from 'flarum/forum/app';\nimport Poll from '../models/Poll';\nimport Component from 'flarum/common/Component';\nimport ComposePollPage from '../components/ComposePollPage';\nimport PollsPage from '../components/PollsPage';\nimport ItemList from 'flarum/common/utils/ItemList';\nimport Separator from 'flarum/common/components/Separator';\nimport Button from 'flarum/common/components/Button';\n\n/**\n * The `UserControls` utility constructs a list of buttons for a user which\n * perform actions on it.\n */\nexport default {\n /**\n * Get a list of controls for a user.\n */\n controls(poll: Poll, context: Component): ItemList {\n const items = new ItemList();\n\n ['poll', 'moderation', 'destructive'].forEach((section) => {\n const controls = (this[section + 'Controls'](poll, context) as ItemList).toArray();\n if (controls.length) {\n controls.forEach((item) => items.add(item.itemName, item));\n items.add(section + 'Separator', );\n }\n });\n\n return items;\n },\n\n /**\n * Get controls for direct modifcation actions on polls (e.g. vote, view voters).\n */\n pollControls(poll: Poll, context: Component): ItemList {\n const items = new ItemList();\n\n return items;\n },\n\n /**\n * Get controls for a user pertaining to moderation (e.g. suspend, edit).\n */\n moderationControls(poll: Poll, context: Component): ItemList {\n const items = new ItemList();\n\n if (poll.canEdit()) {\n items.add(\n 'edit',\n \n );\n }\n\n return items;\n },\n\n /**\n * Get controls for a user which are destructive (e.g. delete).\n * @protected\n */\n destructiveControls(poll: Poll, context: Component): ItemList {\n const items = new ItemList();\n\n if (poll.canDelete()) {\n items.add(\n 'delete',\n \n );\n }\n\n return items;\n },\n\n /**\n * Delete the poll.\n */\n async deleteAction(poll: Poll): Promise {\n if (!confirm(app.translator.trans(`fof-polls.forum.poll_controls.delete_confirmation`) as string)) {\n return;\n }\n\n return poll\n .delete()\n .then(() => {\n this.showDeletionAlert(poll, 'success');\n if (app.current.matches(ComposePollPage, { id: poll.id() }) || app.current.matches(PollsPage, { id: poll.id() })) {\n app.history.back();\n } else {\n window.location.reload();\n }\n })\n .catch(() => this.showDeletionAlert(poll, 'error'));\n },\n\n /**\n * Show deletion alert of poll\n */\n showDeletionAlert(poll: Poll, type: string): void {\n const message = {\n success: `fof-polls.forum.poll_controls.delete_success_message`,\n error: `fof-polls.forum.poll_controls.delete_error_message`,\n }[type]!;\n\n app.alerts.show({ type }, app.translator.trans(message, { poll: poll }));\n },\n\n /**\n * Edit the poll.\n */\n editAction(poll: Poll): void {\n m.route.set(app.route('fof.polls.compose', { id: poll.id() }));\n },\n};\n","function _extends() {\n return _extends = Object.assign ? Object.assign.bind() : function (n) {\n for (var e = 1; e < arguments.length; e++) {\n var t = arguments[e];\n for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]);\n }\n return n;\n }, _extends.apply(null, arguments);\n}\nexport { _extends as default };","import app from 'flarum/forum/app';\nimport Button, { IButtonAttrs } from 'flarum/common/components/Button';\nimport classList from 'flarum/common/utils/classList';\nimport Mithril from 'mithril';\nimport Poll from '../models/Poll';\nimport PollOption from '../models/PollOption';\n\nexport interface UploadPollImageButtonAttrs extends IButtonAttrs {\n className?: string;\n loading?: boolean;\n name: string;\n onclick: () => void;\n poll?: Poll | null;\n option?: PollOption | null;\n onUpload: (fileName: string | null | undefined) => void;\n}\n\nexport interface PollUploadObject {\n fileUrl: string;\n fileName: string;\n}\n\nexport default class UploadPollImageButton extends Button {\n loading: boolean = false;\n uploadedImageUrl: string | undefined | false = false;\n fileName: string | undefined = undefined;\n $input: JQuery | undefined;\n\n view(vnode: Mithril.Vnode) {\n this.attrs.loading = this.loading;\n this.attrs.className = classList(this.attrs.className, 'Button', 'Button--inverted');\n\n const imageUrl = this.getImageUrl();\n const canUpload = app.forum.attribute('canUploadPollImages');\n\n if (imageUrl) {\n this.attrs.onclick = this.remove.bind(this);\n\n return (\n
\n

\n \"\"\n

\n

\n {super.view({\n ...vnode,\n children: app.translator.trans('fof-polls.forum.upload_image.remove_button'),\n })}\n

\n
\n );\n } else {\n this.attrs.onclick = this.upload.bind(this);\n }\n\n return canUpload && super.view({ ...vnode, poll: undefined, children: app.translator.trans('fof-polls.forum.upload_image.upload_button') });\n }\n\n /**\n * Prompt the user to upload an image.\n */\n upload() {\n if (this.loading) return;\n\n this.$input = $('');\n\n this.$input\n .appendTo('body')\n .hide()\n .trigger('click')\n .on('change', (e) => {\n const body = new FormData();\n body.append(this.attrs.name, $(e.target)[0].files[0]);\n\n this.loading = true;\n m.redraw();\n\n app\n .request({\n method: 'POST',\n url: this.resourceUrl(),\n serialize: (raw) => raw,\n body,\n })\n .then(this.success.bind(this), this.failure.bind(this));\n });\n }\n\n /**\n * Remove the image.\n */\n remove() {\n this.loading = true;\n m.redraw();\n\n let fileName = undefined;\n\n if (!this.attrs.poll?.exists && !this.attrs.option?.exists) {\n fileName = this.fileName;\n }\n\n app\n .request({\n method: 'DELETE',\n url: this.resourceUrl(fileName),\n })\n .then((upload) => {\n if (this.attrs.poll?.exists) {\n this.attrs.poll.pushAttributes({ image: null, imageUrl: null, isImageUpload: false });\n }\n\n if (this.attrs.option?.exists) {\n this.attrs.option.pushAttributes({ imageUrl: false });\n }\n\n return upload;\n })\n .then(this.success.bind(this), this.failure.bind(this));\n }\n\n resourceUrl(fileName: string | undefined = undefined) {\n let url = app.forum.attribute('apiUrl') + '/fof/polls/' + this.attrs.name;\n const poll = this.attrs.poll;\n const option = this.attrs.option;\n\n if (fileName) {\n url += '/name/' + fileName;\n } else {\n if (poll?.exists) url += '/' + poll?.id();\n if (option?.exists) url += '/' + option?.id();\n }\n\n return url;\n }\n\n getImageUrl() {\n if (this.uploadedImageUrl !== false) {\n return this.uploadedImageUrl;\n }\n\n return this.attrs.poll?.imageUrl() || this.attrs.option?.imageUrl();\n }\n\n /**\n * After a successful upload/removal, redraw the page.\n *\n * @param {PollUploadObject} response\n * @protected\n */\n success(response: PollUploadObject | null) {\n this.loading = false;\n this.uploadedImageUrl = response?.fileUrl;\n this.fileName = response?.fileName;\n\n this.attrs.onUpload?.(response?.fileName);\n m.redraw();\n this.$input?.remove();\n }\n\n /**\n * If upload/removal fails, stop loading.\n *\n * @param {object} response\n * @protected\n */\n failure(response: object) {\n this.loading = false;\n m.redraw();\n this.$input?.remove();\n }\n}\n","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/utils/RequestError'];","import Component, { ComponentAttrs } from 'flarum/common/Component';\nimport Mithril from 'mithril';\nimport app from 'flarum/forum/app';\nimport Button from 'flarum/common/components/Button';\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';\nimport FormError from './form/FormError';\nimport PollFormState from '../states/PollFormState';\nimport PollControls from '../utils/PollControls';\nimport PollModel from '../models/Poll';\nimport PollOption from '../models/PollOption';\nimport UploadPollImageButton from './UploadPollImageButton';\nimport Poll from '../models/Poll';\nimport Tooltip from 'flarum/common/components/Tooltip';\nimport RequestError from 'flarum/common/utils/RequestError';\n\ninterface PollFormAttrs extends ComponentAttrs {\n poll: PollModel;\n onsubmit: (data: object, state: PollFormState) => Promise;\n}\n\nexport default class PollForm extends Component {\n protected options: PollOption[] = [];\n protected optionAnswers: Stream[] = [];\n protected optionImageUrls: Stream[] = [];\n protected question: Stream;\n protected subtitle: Stream;\n protected image: Stream;\n protected imageAlt: Stream;\n protected endDate: Stream;\n protected publicPoll: Stream;\n protected allowMultipleVotes: Stream;\n protected hideVotes: Stream;\n protected allowChangeVote: Stream;\n protected maxVotes: Stream;\n protected datepickerMinDate: string = '';\n\n oninit(vnode: Mithril.Vnode): void {\n super.oninit(vnode);\n this.state = new PollFormState(this.attrs.poll);\n\n // state handles poll initialization\n const poll = this.state.poll;\n\n this.options = (poll.tempOptions ?? poll.options()) as PollOption[];\n this.optionAnswers = this.options.map((o) => Stream(o.answer()));\n this.optionImageUrls = this.options.map((o) => Stream(o.imageUrl()));\n\n this.question = Stream(poll.question());\n this.subtitle = Stream(poll.subtitle());\n this.image = Stream(poll.image());\n this.imageAlt = Stream(poll.imageAlt());\n this.endDate = Stream(this.formatDate(poll.endDate()));\n this.publicPoll = Stream(poll.publicPoll());\n this.allowMultipleVotes = Stream(poll.allowMultipleVotes());\n this.hideVotes = Stream(poll.hideVotes());\n this.allowChangeVote = Stream(poll.allowChangeVote());\n this.maxVotes = Stream(poll.maxVotes() || 0);\n\n // Set minimum date for datepicker to current date\n this.datepickerMinDate = this.formatDate() as string;\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 // We know that endDate is set, so we can safely cast the result to string\n this.datepickerMinDate = this.formatDate(poll.endDate()) as string;\n }\n }\n\n view(): Mithril.Children {\n return (\n
\n
{this.fields().toArray()}
\n
\n );\n }\n\n fields(): ItemList {\n const items = new ItemList();\n\n items.add(\n 'question',\n
\n \n\n \n
,\n 100\n );\n\n items.add(\n 'subtitle',\n
\n \n\n \n
,\n 95\n );\n\n const hasImage = this.image();\n\n items.add(\n 'poll_image',\n
\n \n {this.uploadConditional(\n hasImage,\n this.state.poll?.isImageUpload(),\n <>\n

{app.translator.trans('fof-polls.forum.modal.poll_image.help')}

\n \n ,\n ,\n \n )}\n
,\n 90\n );\n\n if (hasImage) {\n items.add(\n 'poll_image_alt',\n
\n \n\n \n\n

{app.translator.trans('fof-polls.forum.modal.poll_image.alt_help_text')}

\n
,\n 90\n );\n }\n\n items.add(\n 'answers',\n
\n \n\n {this.displayOptions().toArray()}\n\n \n
,\n 80\n );\n\n items.add(\n 'date',\n
\n \n\n
\n \n {Button.component({\n className: 'Button PollModal--button Button--icon',\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 \n {this.state.poll.exists && (\n \n {app.translator.trans('fof-polls.forum.modal.delete')}\n \n )}\n
,\n -10\n );\n\n return items;\n }\n\n displayOptions(): ItemList {\n const items = new ItemList();\n const canUpload = app.forum.attribute('canUploadPollImages');\n\n this.options.forEach((option, i) => {\n const imgFunc = this.optionImageUrls[i];\n\n items.add(\n 'option-' + i,\n
\n
\n \n {app.forum.attribute('allowPollOptionImage') && (\n
\n {this.uploadConditional(\n !!imgFunc(),\n option?.isImageUpload(),\n <>\n \n

{app.translator.trans('fof-polls.forum.modal.poll_option_image.help')}

\n \n ,\n\n ,\n\n \n )}\n
\n )}\n
\n {i >= 2\n ? Button.component({\n type: 'button',\n className: 'Button PollModal--button Button--icon',\n icon: 'fas fa-minus',\n onclick: i >= 2 ? this.removeOption.bind(this, i) : '',\n })\n : ''}\n
\n );\n });\n\n return items;\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: number): void {\n this.options.splice(i, 1);\n this.optionAnswers.splice(i, 1);\n this.optionImageUrls.splice(i, 1);\n }\n\n data(): object {\n if (this.question() === '') {\n throw new FormError(app.translator.trans('fof-polls.forum.modal.include_question'));\n }\n\n if (this.options.length < 2) {\n throw new FormError(app.translator.trans('fof-polls.forum.modal.min'));\n }\n\n const pollExists = this.state.poll.exists;\n const options = this.options.map((option, i) => {\n option.pushAttributes({\n answer: this.optionAnswers[i](),\n imageUrl: this.optionImageUrls[i](),\n });\n\n return pollExists ? option.data : option.data.attributes;\n });\n\n return {\n question: this.question(),\n subtitle: this.subtitle(),\n pollImage: this.image(),\n imageAlt: this.imageAlt(),\n endDate: this.dateToTimestamp(this.endDate()) ?? false,\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 async onsubmit(event: Event) {\n event.preventDefault();\n\n try {\n await this.attrs.onsubmit(this.data(), this.state);\n } catch (error) {\n if (error instanceof FormError) {\n app.alerts.show({ type: 'error' }, error.message);\n } else if (error instanceof RequestError) {\n console.error(error);\n app.alerts.show({ type: 'error' }, app.translator.trans('fof-polls.forum.modal.error'));\n }\n }\n }\n\n async delete(): Promise {\n this.state.loading = true;\n try {\n await PollControls.deleteAction(this.state.poll);\n this.state.deleting = true;\n } finally {\n this.state.loading = false;\n m.redraw();\n }\n }\n\n formatDate(date: Date | string | false | undefined | null = undefined, def: Date | false = false): string | false {\n const dayjsDate = dayjs(date);\n\n if (date === false || !dayjsDate.isValid()) return def !== false ? this.formatDate(def) : false;\n\n return dayjsDate.format('YYYY-MM-DDTHH:mm');\n }\n\n dateToTimestamp(date: Date | false): string | null {\n const dayjsDate = dayjs(date);\n\n if (!date || !dayjsDate.isValid()) return null;\n\n return dayjsDate.format();\n }\n\n pollImageUploadSuccess(fileName: string | null | undefined): void {\n this.image(fileName);\n }\n\n pollOptionImageUploadSuccess(index: number, fileName: string | null | undefined): void {\n this.optionImageUrls[index] = Stream(fileName);\n }\n\n uploadConditional(hasImage: boolean, isUpload: boolean, ifCanUpload: JSX.Element, uploadButton: JSX.Element, imageUrlInput: JSX.Element) {\n const canUpload = app.forum.attribute('canUploadPollImages');\n const canUploadNow = this.state.poll?.exists || (app.forum.attribute('canStartPolls') && app.forum.attribute('canStartGlobalPolls'));\n\n // if can upload OR image is already uploaded\n if (canUpload || isUpload) {\n // may not have enough permissions to upload before creating poll\n if (!canUploadNow && !isUpload) {\n return (\n <>\n {imageUrlInput}\n

{app.translator.trans('fof-polls.forum.modal.poll_image.later_help')}

\n \n );\n }\n\n return (\n <>\n {ifCanUpload}\n
\n {!hasImage && imageUrlInput}\n {uploadButton}\n
\n \n );\n }\n\n return imageUrlInput;\n }\n}\n","import type Mithril from 'mithril';\nimport app from 'flarum/forum/app';\nimport Modal, { IInternalModalAttrs } from 'flarum/common/components/Modal';\nimport PollForm from './PollForm';\nimport PollModel from '../models/Poll';\nimport PollFormState from '../states/PollFormState';\n\ninterface CreatePollModalAttrs extends IInternalModalAttrs {\n poll: PollModel;\n onsubmit: (data: object) => Promise;\n}\n\nexport default class CreatePollModal extends Modal {\n title(): Mithril.Children {\n return app.translator.trans('fof-polls.forum.modal.add_title');\n }\n\n className(): string {\n return 'PollDiscussionModal Modal--medium';\n }\n\n content(): Mithril.Children {\n return [\n
\n \n
,\n ];\n }\n\n async onFormSubmit(data: object, state: PollFormState): Promise {\n this.hide();\n await this.attrs.onsubmit(data);\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';\nimport CreatePollModal from './components/CreatePollModal';\nimport Poll from './models/Poll';\nimport PollOption from './models/PollOption';\nimport { ModelAttributes } from 'flarum/common/Model';\nimport PollModelAttributes from './models/PollModelAttributes';\n\nfunction toPoll(data: PollModelAttributes) {\n if (data) {\n const poll = app.store.createRecord('polls');\n\n poll.tempOptions = data.options.map((option: ModelAttributes) => {\n const pollOption = app.store.createRecord('poll_options');\n pollOption.pushAttributes(option);\n return pollOption;\n });\n poll.pushAttributes(data);\n\n return poll;\n }\n return data;\n}\n\nexport const addToComposer = (composer: ComponentClass) => {\n // @ts-ignore\n composer.prototype.addPoll = function () {\n app.modal.show(CreatePollModal, {\n poll: toPoll(this.composer.fields.poll),\n onsubmit: (poll: PollModelAttributes) => (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\n // @ts-ignore\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['forum/components/DiscussionPage'];","import type Mithril from 'mithril';\nimport app from 'flarum/forum/app';\nimport CreatePollModal from './CreatePollModal';\nimport PollFormState from '../states/PollFormState';\n\nexport default class EditPollModal extends CreatePollModal {\n title(): Mithril.Children {\n return app.translator.trans('fof-polls.forum.modal.edit_title');\n }\n\n async onFormSubmit(data: object, state: PollFormState): Promise {\n await state.save(data);\n\n // Show success alert\n const alertId = app.alerts.show(\n {\n type: 'success',\n },\n app.translator.trans('fof-polls.forum.compose.success')\n );\n\n // Hide alert after 10 seconds\n setTimeout(() => app.alerts.dismiss(alertId), 10000);\n }\n}\n","import app from 'flarum/forum/app';\nimport Component, { ComponentAttrs } 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';\nimport Poll from '../models/Poll';\nimport type Mithril from 'mithril';\nimport PollOption from '../models/PollOption';\nimport Post from 'flarum/common/models/Post';\nimport extractText from 'flarum/common/utils/extractText';\nimport PollImage from './Poll/PollImage';\n\nexport interface PostPollAttrs extends ComponentAttrs {\n poll: Poll;\n post?: Post;\n}\n\nexport default class PostPoll extends Component {\n loadingOptions: boolean = false;\n useSubmitUI!: boolean;\n pendingSubmit: boolean = false;\n pendingOptions: any;\n\n oninit(vnode: Mithril.Vnode) {\n super.oninit(vnode);\n\n this.useSubmitUI = !this.attrs.poll?.canChangeVote() && this.attrs.poll?.allowMultipleVotes();\n this.pendingOptions = null;\n }\n\n oncreate(vnode: Mithril.Vnode) {\n super.oncreate(vnode);\n\n this.preventClose = this.preventClose.bind(this);\n window.addEventListener('beforeunload', this.preventClose);\n }\n\n onremove(vnode: Mithril.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
\n

{poll.question()}

\n {poll.subtitle() &&

{poll.subtitle()}

}\n
\n\n
\n {poll.canSeeVoters() && (\n \n
\n
\n\n {!!poll.imageUrl() && }\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: number) {\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: PollOption) {\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() ? {opt.answer()} : null}\n
\n );\n\n return (\n \n {canSeeVoteCount ? (\n \n {bar}\n \n ) : (\n bar\n )}\n
\n );\n }\n\n changeVote(option: PollOption, evt: Event) {\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(extractText(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: Mithril.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","import app from 'flarum/forum/app';\n\nimport { extend } from 'flarum/common/extend';\nimport CommentPost from 'flarum/forum/components/CommentPost';\nimport PollView from './components/PollView';\nimport DiscussionPage from 'flarum/forum/components/DiscussionPage';\nimport Poll from './models/Poll';\nimport PollOption from './models/PollOption';\nimport PostPoll from './components/PostPoll';\n\ninterface PusherPollDto {\n pollId: string;\n pollVoteCount: number;\n options: { [key: string]: number };\n}\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 // @ts-ignore\n if (app.pusher) {\n // @ts-ignore\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: PusherPollDto) => {\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 // @ts-ignore\n if (app.pusher) {\n // @ts-ignore\n app.pusher.then((binding) => {\n binding.channels.main.unbind('updatedPollOptions');\n });\n }\n });\n};\n","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['forum/utils/PostControls'];","import Component, { ComponentAttrs } from 'flarum/common/Component';\nimport Poll from '../models/Poll';\nimport type Mithril from 'mithril';\nimport PollView from './PollView';\n\nexport interface PollShowcaseItemAttrs extends ComponentAttrs {\n poll: Poll;\n}\n\nexport default class PollShowcaseItem extends Component {\n poll!: Poll;\n\n oninit(vnode: Mithril.Vnode) {\n super.oninit(vnode);\n\n this.poll = this.attrs.poll;\n }\n\n view() {\n return (\n
\n \n
\n );\n }\n}\n","import Component, { ComponentAttrs } from 'flarum/common/Component';\nimport PollListState from '../states/PollListState';\nimport type Mithril from 'mithril';\nimport ItemList from 'flarum/common/utils/ItemList';\nimport PollShowcaseItem from './PollShowcaseItem';\nimport Placeholder from 'flarum/common/components/Placeholder';\nimport app from 'flarum/forum/app';\n\nexport interface PollListAttrs extends ComponentAttrs {\n state: PollListState;\n}\n\nexport default class PollShowcase extends Component {\n oninit(vnode: Mithril.Vnode) {\n super.oninit(vnode);\n\n this.attrs.state.refresh();\n }\n\n view(): Mithril.Children {\n return (\n
\n
\n

{app.translator.trans('fof-polls.forum.showcase.active-polls')}

\n {this.showcaseItems().toArray()}\n {this.showcaseItems().toArray().length === 0 && }\n
\n
\n

{app.translator.trans('fof-polls.forum.showcase.ended-polls')}

\n {this.endedItems().toArray()}\n {this.endedItems().toArray().length === 0 && }\n
\n
\n );\n }\n\n showcaseItems(): ItemList {\n const items = new ItemList();\n\n this.attrs.state.getPages().map((page) => {\n page.items.map((poll) => {\n if (!poll.hasEnded()) {\n items.add('poll-active-' + poll.id(), );\n }\n });\n });\n\n return items;\n }\n\n endedItems(): ItemList {\n const items = new ItemList();\n\n this.attrs.state.getPages().map((page) => {\n page.items.map((poll) => {\n if (poll.hasEnded()) {\n items.add('poll-ended-' + poll.id(), );\n }\n });\n });\n\n return items;\n }\n}\n","import app from 'flarum/forum/app';\nimport { IPageAttrs } from 'flarum/common/components/Page';\nimport ItemList from 'flarum/common/utils/ItemList';\nimport Mithril from 'mithril';\nimport PollListState from '../states/PollListState';\nimport extractText from 'flarum/common/utils/extractText';\nimport Button from 'flarum/common/components/Button';\nimport LogInModal from 'flarum/forum/components/LogInModal';\nimport { AbstractPollPage } from './AbstractPollPage';\nimport PollShowcase from './PollShowcase';\n\nexport default class PollsShowcasePage extends AbstractPollPage {\n oninit(vnode: Mithril.Vnode) {\n super.oninit(vnode);\n\n if (!app.forum.attribute('globalPollsEnabled')) {\n m.route.set('/');\n return;\n }\n\n this.state = new PollListState({\n sort: m.route.param('sort'),\n filter: m.route.param('filter'),\n include: this.includeParams(),\n });\n\n this.state.refresh();\n\n app.setTitle(extractText(app.translator.trans('fof-polls.forum.page.nav')));\n }\n\n includeParams(): string[] {\n return ['options', 'votes', 'myVotes', 'myVotes.option'];\n }\n\n contentItems(): ItemList {\n const items = super.contentItems();\n\n if (!this.loading) {\n items.add('poll-showcase', );\n }\n\n return items;\n }\n\n sidebarItems(): ItemList {\n const items = super.sidebarItems();\n const canStartPoll = app.forum.attribute('canStartGlobalPolls');\n\n if (canStartPoll) {\n items.remove('newDiscussion');\n items.add(\n 'newGlobalPoll',\n {\n this.newPollAction();\n }}\n disabled={!canStartPoll}\n >\n {app.translator.trans(`fof-polls.forum.poll.${canStartPoll ? 'start_poll_button' : 'cannot_start_poll_button'}`)}\n ,\n 100\n );\n }\n\n return items;\n }\n\n newPollAction(): void {\n if (!app.session.user) {\n app.modal.show(LogInModal);\n return;\n }\n\n m.route.set(app.route('fof.polls.compose'));\n }\n}\n","import CreatePollModal from './CreatePollModal';\nimport PostPoll from './PostPoll';\nimport EditPollModal from './EditPollModal';\nimport ListVotersModal from './ListVotersModal';\nimport PollForm from './PollForm';\nimport ComposePollHero from './ComposePollHero';\nimport ComposePollPage from './ComposePollPage';\nimport PollsPage from './PollsPage';\nimport PollView from './PollView';\nimport PollViewPage from './PollViewPage';\nimport PollSubmitButton from './Poll/PollSubmitButton';\nimport PollOption from './Poll/PollOption';\nimport PollOptions from './Poll/PollOptions';\nimport PollsShowcasePage from './PollsShowcasePage';\nimport PollShowcase from './PollShowcase';\nimport PollShowcaseItem from './PollShowcaseItem';\nimport { AbstractPollPage } from './AbstractPollPage';\nimport PollTitle from './Poll/PollTitle';\nimport PollSubtitle from './Poll/PollSubtitle';\nimport PollImage from './Poll/PollImage';\nimport PollListItem from './Poll/PollListItem';\nimport PollList from './Poll/PollList';\n\nexport const components = {\n CreatePollModal,\n PostPoll,\n EditPollModal,\n ListVotersModal,\n PollForm,\n ComposePollHero,\n ComposePollPage,\n PollsPage,\n PollView,\n PollViewPage,\n PollSubmitButton,\n PollOption,\n PollOptions,\n PollsShowcasePage,\n PollShowcase,\n PollShowcaseItem,\n AbstractPollPage,\n PollTitle,\n PollSubtitle,\n PollImage,\n PollListItem,\n PollList,\n};\n","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/Model'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/utils/computed'];","import Model from 'flarum/common/Model';\nimport PollOption from './PollOption';\nimport PollVote from './PollVote';\nimport computed from 'flarum/common/utils/computed';\n\nexport default class Poll extends Model {\n public tempOptions: PollOption[] | undefined;\n\n question() {\n return Model.attribute('question').call(this);\n }\n\n subtitle() {\n return Model.attribute('subtitle').call(this);\n }\n\n image() {\n return Model.attribute('image').call(this);\n }\n\n imageUrl() {\n return Model.attribute('imageUrl').call(this);\n }\n\n imageAlt() {\n return Model.attribute('imageAlt').call(this);\n }\n\n isImageUpload() {\n return Model.attribute('isImageUpload').call(this);\n }\n\n hasEnded() {\n return Model.attribute('hasEnded').call(this);\n }\n\n endDate() {\n return Model.attribute('endDate', Model.transformDate).call(this);\n }\n\n publicPoll() {\n return Model.attribute('publicPoll').call(this);\n }\n\n hideVotes() {\n return Model.attribute('hideVotes').call(this);\n }\n\n allowChangeVote() {\n return Model.attribute('allowChangeVote').call(this);\n }\n\n allowMultipleVotes() {\n return Model.attribute('allowMultipleVotes').call(this);\n }\n\n maxVotes() {\n return Model.attribute('maxVotes').call(this);\n }\n\n voteCount() {\n return Model.attribute('voteCount').call(this);\n }\n\n canVote() {\n return Model.attribute('canVote').call(this);\n }\n\n canEdit() {\n return Model.attribute('canEdit').call(this);\n }\n\n canDelete() {\n return Model.attribute('canDelete').call(this);\n }\n\n canSeeVoters() {\n return Model.attribute('canSeeVoters').call(this);\n }\n\n canChangeVote() {\n return Model.attribute('canChangeVote').call(this);\n }\n\n options() {\n const options = Model.hasMany('options').call(this);\n return options ? (options as PollOption[]) : [];\n }\n\n votes() {\n return Model.hasMany('votes').call(this);\n }\n\n myVotes(): PollVote[] {\n const myVotes = Model.hasMany('myVotes').call(this);\n return myVotes ? (myVotes as PollVote[]) : [];\n }\n\n isGlobal() {\n return Model.attribute('isGlobal').call(this);\n }\n\n isHidden() {\n return computed('hiddenAt', (hiddenAt) => !!hiddenAt).call(this);\n }\n\n // TODO: These two don't make sense as of now\n isUnread() {\n return false;\n }\n\n apiEndpoint() {\n /** @ts-ignore */\n return `/fof/polls${this.exists ? `/${this.data.id}` : ''}`;\n }\n}\n","import Model from 'flarum/common/Model';\nimport Poll from './Poll';\nimport PollVote from './PollVote';\n\nexport default class PollOption extends Model {\n answer() {\n return Model.attribute('answer').call(this);\n }\n\n imageUrl() {\n return Model.attribute('imageUrl').call(this);\n }\n\n isImageUpload() {\n return Model.attribute('isImageUpload').call(this);\n }\n\n voteCount() {\n return Model.attribute('voteCount').call(this);\n }\n\n poll() {\n return Model.hasOne('polls').call(this);\n }\n\n votes() {\n return Model.hasMany('votes').call(this);\n }\n\n apiEndpoint() {\n /** @ts-ignore */\n return `/fof/polls/answers${this.exists ? `/${this.data.id}` : ''}`;\n }\n}\n","import Model from 'flarum/common/Model';\nimport Poll from './Poll';\nimport PollOption from './PollOption';\nimport User from 'flarum/common/models/User';\n\nexport default class PollVote extends Model {\n poll() {\n return Model.hasOne('poll').call(this);\n }\n\n option() {\n const result = Model.hasOne('option').call(this);\n return result === false ? null : result;\n }\n\n user() {\n return Model.hasOne('user').call(this);\n }\n\n pollId() {\n return Model.attribute('pollId').call(this);\n }\n\n optionId() {\n return Model.attribute('optionId').call(this);\n }\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","import PollFormState from './PollFormState';\nimport PollListState from './PollListState';\nimport PollState from './PollState';\n\nexport const states = {\n PollFormState,\n PollListState,\n PollState,\n};\n","import PollControls from './PollControls';\n\nexport const utils = {\n PollControls,\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';\nimport PollsPage from './components/PollsPage';\nimport ComposePollPage from './components/ComposePollPage';\nimport PollViewPage from './components/PollViewPage';\nimport PollsShowcasePage from './components/PollsShowcasePage';\n\nexport default [\n new Extend.Routes() //\n .add('fof.polls.showcase', '/polls', PollsShowcasePage)\n .add('fof.polls.list', '/polls/all', PollsPage)\n .add('fof.polls.view', '/polls/view/:id', PollViewPage)\n .add('fof.polls.compose', '/polls/composer', ComposePollPage),\n\n new Extend.Store() //\n .add('polls', Poll)\n .add('poll_options', PollOption)\n .add('poll_votes', PollVote),\n\n new Extend.Model(Post) //\n .hasMany('polls')\n .attribute('canStartPoll'),\n\n new Extend.Model(Forum) //\n .attribute('canStartPolls'),\n\n new Extend.Model(Discussion) //\n .attribute('hasPoll')\n .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';\nimport addNavItem from './addNavItem';\n\nexport * from './components';\nexport * from './models';\nexport * from './states';\nexport * from './utils';\n\napp.initializers.add('fof/polls', () => {\n addDiscussionBadge();\n addComposerItems();\n addPollsToPost();\n addPostControls();\n addNavItem();\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';\nimport Post from 'flarum/common/models/Post';\nimport PollModelAttributes from './models/PollModelAttributes';\n\nexport default () => {\n const createPoll = (post: Post) =>\n app.modal.show(CreatePollModal, {\n onsubmit: (data: PollModelAttributes) =>\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 // @ts-ignore\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 // @ts-ignore\n if (!post.isHidden() && post.canStartPoll()) {\n items.add(\n 'addPoll',\n \n );\n }\n });\n};\n","import app from 'flarum/forum/app';\nimport { extend } from 'flarum/common/extend';\nimport IndexPage from 'flarum/forum/components/IndexPage';\nimport LinkButton from 'flarum/common/components/LinkButton';\n\nexport default function addNavItem() {\n extend(IndexPage.prototype, 'navItems', (items) => {\n if (!app.forum.attribute('globalPollsEnabled')) {\n return;\n }\n\n items.add(\n 'fof-polls-showcase',\n LinkButton.component(\n {\n href: app.route('fof.polls.showcase'),\n icon: 'fas fa-poll',\n },\n app.translator.trans('fof-polls.forum.page.nav')\n ),\n 35\n );\n\n const showAllGlobalPolls = app.forum.attribute('canStartGlobalPolls');\n\n if (showAllGlobalPolls) {\n items.add(\n 'fof-polls-list',\n LinkButton.component(\n {\n href: app.route('fof.polls.list'),\n icon: 'fas fa-list',\n },\n app.translator.trans('fof-polls.forum.page.nav-all')\n ),\n 32\n );\n }\n });\n}\n"],"names":["_typeof","require","_regeneratorRuntime","module","exports","e","__esModule","t","r","Object","prototype","n","hasOwnProperty","o","defineProperty","value","i","Symbol","a","iterator","c","asyncIterator","u","toStringTag","define","enumerable","configurable","writable","wrap","Generator","create","Context","makeInvokeMethod","tryCatch","type","arg","call","h","l","f","s","y","GeneratorFunction","GeneratorFunctionPrototype","p","this","d","getPrototypeOf","v","values","g","defineIteratorMethods","forEach","_invoke","AsyncIterator","invoke","resolve","__await","then","callInvokeWithMethodAndArg","Error","done","method","delegate","maybeInvokeDelegate","sent","_sent","dispatchException","abrupt","TypeError","resultName","next","nextLoc","pushTryEntry","tryLoc","catchLoc","finallyLoc","afterLoc","tryEntries","push","resetTryEntry","completion","reset","isNaN","length","displayName","isGeneratorFunction","constructor","name","mark","setPrototypeOf","__proto__","awrap","async","Promise","keys","reverse","pop","prev","charAt","slice","stop","rval","handle","complete","finish","delegateYield","runtime","regeneratorRuntime","accidentalStrictMode","globalThis","Function","__webpack_module_cache__","__webpack_require__","moduleId","cachedModule","undefined","__webpack_modules__","getter","definition","key","get","obj","prop","flarum","core","compat","asyncGeneratorStep","_asyncToGenerator","arguments","apply","_next","_throw","_setPrototypeOf","bind","_inheritsLoose","_getPrototypeOf","_isNativeReflectConstruct","Boolean","valueOf","Reflect","construct","_wrapNativeSuper","Map","toString","indexOf","isNativeFunction","has","set","Wrapper","isNativeReflectConstruct","FormError","_Error","props","PollFormState","poll","loading","deleting","expandedGroup","createNewPoll","app","createRecord","pushAttributes","question","endDate","publicPoll","allowMultipleVotes","hideVotes","allowChangeVote","maxVotes","tempOptions","_proto","isExpanded","groupKey","expand","m","redraw","save","_save","_callee","data","_context","attributes","options","_x","_delete2","_callee2","_context2","ComposePollHero","_Component","_this","_len","args","Array","_key","concat","oninit","vnode","attrs","view","className","trans","id","controlItems","toArray","items","ItemList","add","LinkButton","icon","itemClassName","href","exists","Component","ComposePollPage","_Page","_this2","attribute","bodyClass","editId","route","param","loadEditingPoll","_this2$poll","_this2$poll2","canEdit","_loadEditingPoll","alreadyLoaded","getById","find","LoadingIndicator","listItems","sidebarItems","PollForm","onsubmit","_onsubmit","state","isNew","alertAttrs","alertId","controls","Button","onclick","show","setTimeout","dismiss","_x2","_x3","SelectDropdown","buttonClassName","accessibleToggleLabel","navItems","IndexPage","Page","PollOption","option","hasVoted","totalVotes","votes","voted","canSeeVoteCount","answer","percent","Math","round","_this$poll$myVotes","overallVoteCount","voteCount","hasVotedFor","isDisabled","loadingOptions","canChangeVote","width","Number","myVotes","bar","style","showCheckMarks","checked","disabled","onchange","changeVote","optionDisplayItems","imageUrl","src","alt","classList","Tooltip","text","count","onremove","hideOptionTooltip","tooltipVisible","updateVisibility","PollOptions","pollOptions","createOptionView","PollImage","imageAlt","imageItems","_this$imageAlt","ListVotersModal","_Modal","include","title","content","map","optionContent","opt","filter","optionAnswer","voteContent","vote","user","Link","avatar","username","Modal","PollState","pendingSubmit","pendingOptions","useSubmitUI","showVoters","hasEnded","canVote","init","isShowResult","some","getMaxVotes","showButton","evt","target","LogInModal","optionIds","Set","isUnvoting","clear","size","submit","hasSelectedOptions","cb","onerror","_this3","url","body","from","res","pushPayload","err","PollSubmitButton","event","pollButtonSubmit","PollTitle","pollTitleItems","PollSubtitle","subtitle","pollSubtitleItems","PollView","preventClose","preventDefault","oncreate","window","addEventListener","removeEventListener","PollControls","controlsView","createMainView","createPollHeader","createPollContent","createPollFooter","createFormItems","infoItems","isEmpty","questionSlug","slug","Dropdown","menuClassName","class","time","dayjs","fromNow","max","toPropertyKey","toPrimitive","String","_defineProperties","_createClass","PollPageHero","wrapperClasses","classNames","Hero","AbstractPollPage","polls","pageContent","hero","mainContent","sidebar","contentItems","IndexPageHero","setContent","remove","toObject","startsWith","PollViewPage","_AbstractPollPage","item","PollListItem","subtree","highlightRegExp","SubtreeRetainer","freshness","markedAllAsReadAt","getTime","active","elementAttrs","isHidden","Slidable","contentView","slidableUnderneathView","isUnread","markAsRead","mainView","highlight","pollQuestion","pollSubtitle","slidableInstance","slidable","element","$","on","onbeforeupdate","needsRebuild","matches","lastVotedNumber","activeView","abbreviateNumber","PollList","params","getParams","isLoading","isInitialLoading","isLoadingNext","hasNext","loadNext","Placeholder","isSearchResults","getPages","pg","globalEventEmitter","EventEmitter","PollListState","_PaginatedListState","page","extraPolls","eventEmitter","deletePoll","requestParams","_this$params$sort","sort","sortMap","q","loadPage","preloadedPolls","initialLoading","relevance","newest","oldest","removePoll","emit","_step","_iterator","_createForOfIteratorHelperLoose","pages","index","splice","addPoll","unshift","getAllItems","number","PaginatedListState","PollsPage","refresh","extractText","viewItems","actionItems","canStartPoll","newPollAction","context","section","itemName","Separator","pollControls","moderationControls","editAction","destructiveControls","canDelete","deleteAction","confirm","showDeletionAlert","back","location","reload","message","success","error","_extends","assign","UploadPollImageButton","_Button","uploadedImageUrl","fileName","$input","getImageUrl","canUpload","children","upload","appendTo","hide","trigger","FormData","append","files","resourceUrl","serialize","raw","failure","_this$attrs$poll","_this$attrs$option","_this3$attrs$poll","_this3$attrs$option","image","isImageUpload","_this$attrs$poll2","_this$attrs$option2","response","_this$attrs$onUpload","_this$attrs","_this$$input","fileUrl","onUpload","_this$$input2","optionAnswers","optionImageUrls","datepickerMinDate","_poll$tempOptions","Stream","formatDate","isAfter","fields","_this$state$poll","bidi","hasImage","uploadConditional","'['","pollImageUploadSuccess","placeholder","required","displayOptions","addOption","min","isBefore","Switch","imgFunc","pollOptionImageUploadSuccess","removeOption","alert","_this$dateToTimestamp","pollExists","pollImage","dateToTimestamp","t0","RequestError","console","date","def","dayjsDate","isValid","format","isUpload","ifCanUpload","uploadButton","imageUrlInput","_this$state$poll2","canUploadNow","CreatePollModal","onFormSubmit","_onFormSubmit","toPoll","pollOption","addToComposer","composer","extend","_this$composer$body","_discussion$canStartP","discussion","canStartPolls","EditPollModal","_CreatePollModal","PostPoll","canSeeVoters","viewOption","_poll$myVotes","_poll$myVotes2","_poll$myVotes3","_poll$myVotes4","showCheckmark","_this$attrs$poll$myVo","_this$attrs$poll$myVo2","post","sync","PollShowcaseItem","PollShowcase","showcaseItems","endedItems","PollsShowcasePage","includeParams","components","Poll","_Model","Model","isGlobal","computed","hiddenAt","apiEndpoint","PollVote","result","pollId","optionId","models","states","utils","Extend","Post","hasMany","Forum","Discussion","createPoll","DiscussionList","badges","hasPoll","Badge","label","DiscussionComposer","ReplyComposer","CommentPost","revealContent","check","checks","_poll$data","_poll$options$map","_poll$options","_poll$myVotes$map","_option$data","_vote$option","JSON","stringify","DiscussionPage","binding","channels","main","changedOptions","unbind","relationships","_post$rawRelationship","rawRelationship","PostControls"],"sourceRoot":""} \ No newline at end of file +{"version":3,"file":"forum.js","mappings":";0BAAA,IAAIA,EAAUC,EAAAA,KAAAA,QACd,SAASC,IACP,aACAC,EAAOC,QAAUF,EAAsB,WACrC,OAAOG,CACT,EAAGF,EAAOC,QAAQE,YAAa,EAAMH,EAAOC,QAAiB,QAAID,EAAOC,QACxE,IAAIG,EACFF,EAAI,CAAC,EACLG,EAAIC,OAAOC,UACXC,EAAIH,EAAEI,eACNC,EAAIJ,OAAOK,gBAAkB,SAAUP,EAAGF,EAAGG,GAC3CD,EAAEF,GAAKG,EAAEO,KACX,EACAC,EAAI,mBAAqBC,OAASA,OAAS,CAAC,EAC5CC,EAAIF,EAAEG,UAAY,aAClBC,EAAIJ,EAAEK,eAAiB,kBACvBC,EAAIN,EAAEO,aAAe,gBACvB,SAASC,EAAOjB,EAAGF,EAAGG,GACpB,OAAOC,OAAOK,eAAeP,EAAGF,EAAG,CACjCU,MAAOP,EACPiB,YAAY,EACZC,cAAc,EACdC,UAAU,IACRpB,EAAEF,EACR,CACA,IACEmB,EAAO,CAAC,EAAG,GACb,CAAE,MAAOjB,GACPiB,EAAS,SAAgBjB,EAAGF,EAAGG,GAC7B,OAAOD,EAAEF,GAAKG,CAChB,CACF,CAC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J2H,QAAS,oCAIdrP,MAAK,SAACiG,GAAS,IAAAggB,EAId,OAF6B,OAA7BA,EAAAvD,EAAKwD,gBAAgB,WAAc,MAAnCD,EAA+B5kB,MAA/B4kB,EAA+B5kB,KAAO,CAAE7C,KAAM,QAASwK,GAAI/C,EAAK+C,OAEzD/C,CACT,GAAE,GACN,GAEJwb,EAAAA,EAAAA,QAAO0E,KAAc,sBAAsB,SAAUhd,EAAOuZ,IAErDA,EAAKrM,YAAcqM,EAAK3H,gBAC3B5R,EAAME,IACJ,UACAhC,EAACkE,IAAM,CAAChC,KAAK,cAAciC,QAAS8Y,EAAW1f,KAAKzF,KAAMujB,IACvDpc,IAAAA,WAAeyC,MAAM,mCAI9B,KCxCA0Y,EAAAA,EAAAA,QAAOvV,KAAAA,UAAqB,YAAY,SAAC/C,GAClC7C,IAAAA,MAAUyD,UAAmB,wBAIlCZ,EAAME,IACJ,qBACAC,IAAAA,UACE,CACEG,KAAMnD,IAAAA,MAAU,sBAChBiD,KAAM,eAERjD,IAAAA,WAAeyC,MAAM,6BAEvB,IAGyBzC,IAAAA,MAAUyD,UAAmB,wBAGtDZ,EAAME,IACJ,iBACAC,IAAAA,UACE,CACEG,KAAMnD,IAAAA,MAAU,kBAChBiD,KAAM,eAERjD,IAAAA,WAAeyC,MAAM,iCAEvB,IAGN,GFnBF","sources":["webpack://@fof/polls/./node_modules/@babel/runtime/helpers/regeneratorRuntime.js","webpack://@fof/polls/./node_modules/@babel/runtime/helpers/typeof.js","webpack://@fof/polls/./node_modules/@babel/runtime/regenerator/index.js","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.tsx","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/asyncToGenerator.js","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/Modal']\"","webpack://@fof/polls/external root \"flarum.core.compat['common/Component']\"","webpack://@fof/polls/external root \"flarum.core.compat['common/components/Button']\"","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/./node_modules/@babel/runtime/helpers/esm/getPrototypeOf.js","webpack://@fof/polls/./node_modules/@babel/runtime/helpers/esm/isNativeReflectConstruct.js","webpack://@fof/polls/./node_modules/@babel/runtime/helpers/esm/wrapNativeSuper.js","webpack://@fof/polls/./node_modules/@babel/runtime/helpers/esm/isNativeFunction.js","webpack://@fof/polls/./node_modules/@babel/runtime/helpers/esm/construct.js","webpack://@fof/polls/./src/forum/components/form/FormError.tsx","webpack://@fof/polls/./src/forum/states/PollFormState.ts","webpack://@fof/polls/external root \"flarum.core.compat['common/components/Page']\"","webpack://@fof/polls/external root \"flarum.core.compat['common/components/LoadingIndicator']\"","webpack://@fof/polls/external root \"flarum.core.compat['common/components/LinkButton']\"","webpack://@fof/polls/./src/forum/components/ComposePollHero.tsx","webpack://@fof/polls/external root \"flarum.core.compat['common/helpers/listItems']\"","webpack://@fof/polls/external root \"flarum.core.compat['common/components/SelectDropdown']\"","webpack://@fof/polls/external root \"flarum.core.compat['forum/components/IndexPage']\"","webpack://@fof/polls/./src/forum/components/ComposePollPage.tsx","webpack://@fof/polls/external root \"flarum.core.compat['common/utils/SubtreeRetainer']\"","webpack://@fof/polls/external root \"flarum.core.compat['common/components/Dropdown']\"","webpack://@fof/polls/external root \"flarum.core.compat['common/components/Link']\"","webpack://@fof/polls/external root \"flarum.core.compat['common/helpers/highlight']\"","webpack://@fof/polls/external root \"flarum.core.compat['forum/utils/slidable']\"","webpack://@fof/polls/external root \"flarum.core.compat['common/helpers/icon']\"","webpack://@fof/polls/external root \"flarum.core.compat['common/utils/abbreviateNumber']\"","webpack://@fof/polls/external root \"flarum.core.compat['common/components/Tooltip']\"","webpack://@fof/polls/./src/forum/components/Poll/PollOption.tsx","webpack://@fof/polls/./src/forum/components/Poll/PollOptions.tsx","webpack://@fof/polls/./src/forum/components/Poll/PollImage.tsx","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/./src/forum/components/ListVotersModal.tsx","webpack://@fof/polls/./src/forum/states/PollState.ts","webpack://@fof/polls/./src/forum/components/Poll/PollSubmitButton.tsx","webpack://@fof/polls/external root \"flarum.core.compat['common/utils/string']\"","webpack://@fof/polls/./src/forum/components/Poll/PollTitle.tsx","webpack://@fof/polls/./src/forum/components/Poll/PollSubtitle.tsx","webpack://@fof/polls/./src/forum/components/PollView.tsx","webpack://@fof/polls/./node_modules/@babel/runtime/helpers/esm/typeof.js","webpack://@fof/polls/./node_modules/@babel/runtime/helpers/esm/toPropertyKey.js","webpack://@fof/polls/./node_modules/@babel/runtime/helpers/esm/toPrimitive.js","webpack://@fof/polls/./node_modules/@babel/runtime/helpers/esm/createClass.js","webpack://@fof/polls/./src/forum/components/PollPageHero.tsx","webpack://@fof/polls/./src/forum/components/AbstractPollPage.tsx","webpack://@fof/polls/./src/forum/components/PollViewPage.tsx","webpack://@fof/polls/./src/forum/components/Poll/PollListItem.tsx","webpack://@fof/polls/external root \"flarum.core.compat['common/components/Placeholder']\"","webpack://@fof/polls/./src/forum/components/Poll/PollList.tsx","webpack://@fof/polls/external root \"flarum.core.compat['common/states/PaginatedListState']\"","webpack://@fof/polls/external root \"flarum.core.compat['common/utils/EventEmitter']\"","webpack://@fof/polls/./src/forum/states/PollListState.ts","webpack://@fof/polls/./src/forum/components/PollsPage.tsx","webpack://@fof/polls/external root \"flarum.core.compat['common/components/Separator']\"","webpack://@fof/polls/./src/forum/utils/PollControls.tsx","webpack://@fof/polls/./node_modules/@babel/runtime/helpers/esm/extends.js","webpack://@fof/polls/./src/forum/components/UploadPollImageButton.tsx","webpack://@fof/polls/external root \"flarum.core.compat['common/utils/RequestError']\"","webpack://@fof/polls/./src/forum/components/PollForm.tsx","webpack://@fof/polls/./src/forum/components/CreatePollModal.tsx","webpack://@fof/polls/./src/forum/addComposerItems.tsx","webpack://@fof/polls/external root \"flarum.core.compat['forum/components/CommentPost']\"","webpack://@fof/polls/external root \"flarum.core.compat['forum/components/DiscussionPage']\"","webpack://@fof/polls/./src/forum/components/EditPollModal.tsx","webpack://@fof/polls/./src/forum/components/PostPoll.tsx","webpack://@fof/polls/./src/forum/addPollsToPost.tsx","webpack://@fof/polls/external root \"flarum.core.compat['forum/utils/PostControls']\"","webpack://@fof/polls/./src/forum/components/PollShowcaseItem.tsx","webpack://@fof/polls/./src/forum/components/PollShowcase.tsx","webpack://@fof/polls/./src/forum/components/PollsShowcasePage.tsx","webpack://@fof/polls/./src/forum/components/index.ts","webpack://@fof/polls/external root \"flarum.core.compat['common/Model']\"","webpack://@fof/polls/external root \"flarum.core.compat['common/utils/computed']\"","webpack://@fof/polls/./src/forum/models/Poll.ts","webpack://@fof/polls/./src/forum/models/PollOption.ts","webpack://@fof/polls/./src/forum/models/PollVote.ts","webpack://@fof/polls/./src/forum/models/index.ts","webpack://@fof/polls/./src/forum/states/index.ts","webpack://@fof/polls/./src/forum/utils/index.ts","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.ts","webpack://@fof/polls/./src/forum/index.ts","webpack://@fof/polls/./src/forum/addPostControls.tsx","webpack://@fof/polls/./src/forum/addNavItem.ts"],"sourcesContent":["var _typeof = require(\"./typeof.js\")[\"default\"];\nfunction _regeneratorRuntime() {\n \"use strict\"; /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */\n module.exports = _regeneratorRuntime = function _regeneratorRuntime() {\n return e;\n }, module.exports.__esModule = true, module.exports[\"default\"] = module.exports;\n var t,\n e = {},\n r = Object.prototype,\n n = r.hasOwnProperty,\n o = Object.defineProperty || function (t, e, r) {\n t[e] = r.value;\n },\n i = \"function\" == typeof Symbol ? Symbol : {},\n a = i.iterator || \"@@iterator\",\n c = i.asyncIterator || \"@@asyncIterator\",\n u = i.toStringTag || \"@@toStringTag\";\n function define(t, e, r) {\n return Object.defineProperty(t, e, {\n value: r,\n enumerable: !0,\n configurable: !0,\n writable: !0\n }), t[e];\n }\n try {\n define({}, \"\");\n } catch (t) {\n define = function define(t, e, r) {\n return t[e] = r;\n };\n }\n function wrap(t, e, r, n) {\n var i = e && e.prototype instanceof Generator ? e : Generator,\n a = Object.create(i.prototype),\n c = new Context(n || []);\n return o(a, \"_invoke\", {\n value: makeInvokeMethod(t, r, c)\n }), a;\n }\n function tryCatch(t, e, r) {\n try {\n return {\n type: \"normal\",\n arg: t.call(e, r)\n };\n } catch (t) {\n return {\n type: \"throw\",\n arg: t\n };\n }\n }\n e.wrap = wrap;\n var h = \"suspendedStart\",\n l = \"suspendedYield\",\n f = \"executing\",\n s = \"completed\",\n y = {};\n function Generator() {}\n function GeneratorFunction() {}\n function GeneratorFunctionPrototype() {}\n var p = {};\n define(p, a, function () {\n return this;\n });\n var d = Object.getPrototypeOf,\n v = d && d(d(values([])));\n v && v !== r && n.call(v, a) && (p = v);\n var g = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(p);\n function defineIteratorMethods(t) {\n [\"next\", \"throw\", \"return\"].forEach(function (e) {\n define(t, e, function (t) {\n return this._invoke(e, t);\n });\n });\n }\n function AsyncIterator(t, e) {\n function invoke(r, o, i, a) {\n var c = tryCatch(t[r], t, o);\n if (\"throw\" !== c.type) {\n var u = c.arg,\n h = u.value;\n return h && \"object\" == _typeof(h) && n.call(h, \"__await\") ? e.resolve(h.__await).then(function (t) {\n invoke(\"next\", t, i, a);\n }, function (t) {\n invoke(\"throw\", t, i, a);\n }) : e.resolve(h).then(function (t) {\n u.value = t, i(u);\n }, function (t) {\n return invoke(\"throw\", t, i, a);\n });\n }\n a(c.arg);\n }\n var r;\n o(this, \"_invoke\", {\n value: function value(t, n) {\n function callInvokeWithMethodAndArg() {\n return new e(function (e, r) {\n invoke(t, n, e, r);\n });\n }\n return r = r ? r.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg();\n }\n });\n }\n function makeInvokeMethod(e, r, n) {\n var o = h;\n return function (i, a) {\n if (o === f) throw Error(\"Generator is already running\");\n if (o === s) {\n if (\"throw\" === i) throw a;\n return {\n value: t,\n done: !0\n };\n }\n for (n.method = i, n.arg = a;;) {\n var c = n.delegate;\n if (c) {\n var u = maybeInvokeDelegate(c, n);\n if (u) {\n if (u === y) continue;\n return u;\n }\n }\n if (\"next\" === n.method) n.sent = n._sent = n.arg;else if (\"throw\" === n.method) {\n if (o === h) throw o = s, n.arg;\n n.dispatchException(n.arg);\n } else \"return\" === n.method && n.abrupt(\"return\", n.arg);\n o = f;\n var p = tryCatch(e, r, n);\n if (\"normal\" === p.type) {\n if (o = n.done ? s : l, p.arg === y) continue;\n return {\n value: p.arg,\n done: n.done\n };\n }\n \"throw\" === p.type && (o = s, n.method = \"throw\", n.arg = p.arg);\n }\n };\n }\n function maybeInvokeDelegate(e, r) {\n var n = r.method,\n o = e.iterator[n];\n if (o === t) return r.delegate = null, \"throw\" === n && e.iterator[\"return\"] && (r.method = \"return\", r.arg = t, maybeInvokeDelegate(e, r), \"throw\" === r.method) || \"return\" !== n && (r.method = \"throw\", r.arg = new TypeError(\"The iterator does not provide a '\" + n + \"' method\")), y;\n var i = tryCatch(o, e.iterator, r.arg);\n if (\"throw\" === i.type) return r.method = \"throw\", r.arg = i.arg, r.delegate = null, y;\n var a = i.arg;\n return a ? a.done ? (r[e.resultName] = a.value, r.next = e.nextLoc, \"return\" !== r.method && (r.method = \"next\", r.arg = t), r.delegate = null, y) : a : (r.method = \"throw\", r.arg = new TypeError(\"iterator result is not an object\"), r.delegate = null, y);\n }\n function pushTryEntry(t) {\n var e = {\n tryLoc: t[0]\n };\n 1 in t && (e.catchLoc = t[1]), 2 in t && (e.finallyLoc = t[2], e.afterLoc = t[3]), this.tryEntries.push(e);\n }\n function resetTryEntry(t) {\n var e = t.completion || {};\n e.type = \"normal\", delete e.arg, t.completion = e;\n }\n function Context(t) {\n this.tryEntries = [{\n tryLoc: \"root\"\n }], t.forEach(pushTryEntry, this), this.reset(!0);\n }\n function values(e) {\n if (e || \"\" === e) {\n var r = e[a];\n if (r) return r.call(e);\n if (\"function\" == typeof e.next) return e;\n if (!isNaN(e.length)) {\n var o = -1,\n i = function next() {\n for (; ++o < e.length;) if (n.call(e, o)) return next.value = e[o], next.done = !1, next;\n return next.value = t, next.done = !0, next;\n };\n return i.next = i;\n }\n }\n throw new TypeError(_typeof(e) + \" is not iterable\");\n }\n return GeneratorFunction.prototype = GeneratorFunctionPrototype, o(g, \"constructor\", {\n value: GeneratorFunctionPrototype,\n configurable: !0\n }), o(GeneratorFunctionPrototype, \"constructor\", {\n value: GeneratorFunction,\n configurable: !0\n }), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, u, \"GeneratorFunction\"), e.isGeneratorFunction = function (t) {\n var e = \"function\" == typeof t && t.constructor;\n return !!e && (e === GeneratorFunction || \"GeneratorFunction\" === (e.displayName || e.name));\n }, e.mark = function (t) {\n return Object.setPrototypeOf ? Object.setPrototypeOf(t, GeneratorFunctionPrototype) : (t.__proto__ = GeneratorFunctionPrototype, define(t, u, \"GeneratorFunction\")), t.prototype = Object.create(g), t;\n }, e.awrap = function (t) {\n return {\n __await: t\n };\n }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, c, function () {\n return this;\n }), e.AsyncIterator = AsyncIterator, e.async = function (t, r, n, o, i) {\n void 0 === i && (i = Promise);\n var a = new AsyncIterator(wrap(t, r, n, o), i);\n return e.isGeneratorFunction(r) ? a : a.next().then(function (t) {\n return t.done ? t.value : a.next();\n });\n }, defineIteratorMethods(g), define(g, u, \"Generator\"), define(g, a, function () {\n return this;\n }), define(g, \"toString\", function () {\n return \"[object Generator]\";\n }), e.keys = function (t) {\n var e = Object(t),\n r = [];\n for (var n in e) r.push(n);\n return r.reverse(), function next() {\n for (; r.length;) {\n var t = r.pop();\n if (t in e) return next.value = t, next.done = !1, next;\n }\n return next.done = !0, next;\n };\n }, e.values = values, Context.prototype = {\n constructor: Context,\n reset: function reset(e) {\n if (this.prev = 0, this.next = 0, this.sent = this._sent = t, this.done = !1, this.delegate = null, this.method = \"next\", this.arg = t, this.tryEntries.forEach(resetTryEntry), !e) for (var r in this) \"t\" === r.charAt(0) && n.call(this, r) && !isNaN(+r.slice(1)) && (this[r] = t);\n },\n stop: function stop() {\n this.done = !0;\n var t = this.tryEntries[0].completion;\n if (\"throw\" === t.type) throw t.arg;\n return this.rval;\n },\n dispatchException: function dispatchException(e) {\n if (this.done) throw e;\n var r = this;\n function handle(n, o) {\n return a.type = \"throw\", a.arg = e, r.next = n, o && (r.method = \"next\", r.arg = t), !!o;\n }\n for (var o = this.tryEntries.length - 1; o >= 0; --o) {\n var i = this.tryEntries[o],\n a = i.completion;\n if (\"root\" === i.tryLoc) return handle(\"end\");\n if (i.tryLoc <= this.prev) {\n var c = n.call(i, \"catchLoc\"),\n u = n.call(i, \"finallyLoc\");\n if (c && u) {\n if (this.prev < i.catchLoc) return handle(i.catchLoc, !0);\n if (this.prev < i.finallyLoc) return handle(i.finallyLoc);\n } else if (c) {\n if (this.prev < i.catchLoc) return handle(i.catchLoc, !0);\n } else {\n if (!u) throw Error(\"try statement without catch or finally\");\n if (this.prev < i.finallyLoc) return handle(i.finallyLoc);\n }\n }\n }\n },\n abrupt: function abrupt(t, e) {\n for (var r = this.tryEntries.length - 1; r >= 0; --r) {\n var o = this.tryEntries[r];\n if (o.tryLoc <= this.prev && n.call(o, \"finallyLoc\") && this.prev < o.finallyLoc) {\n var i = o;\n break;\n }\n }\n i && (\"break\" === t || \"continue\" === t) && i.tryLoc <= e && e <= i.finallyLoc && (i = null);\n var a = i ? i.completion : {};\n return a.type = t, a.arg = e, i ? (this.method = \"next\", this.next = i.finallyLoc, y) : this.complete(a);\n },\n complete: function complete(t, e) {\n if (\"throw\" === t.type) throw t.arg;\n return \"break\" === t.type || \"continue\" === t.type ? this.next = t.arg : \"return\" === t.type ? (this.rval = this.arg = t.arg, this.method = \"return\", this.next = \"end\") : \"normal\" === t.type && e && (this.next = e), y;\n },\n finish: function finish(t) {\n for (var e = this.tryEntries.length - 1; e >= 0; --e) {\n var r = this.tryEntries[e];\n if (r.finallyLoc === t) return this.complete(r.completion, r.afterLoc), resetTryEntry(r), y;\n }\n },\n \"catch\": function _catch(t) {\n for (var e = this.tryEntries.length - 1; e >= 0; --e) {\n var r = this.tryEntries[e];\n if (r.tryLoc === t) {\n var n = r.completion;\n if (\"throw\" === n.type) {\n var o = n.arg;\n resetTryEntry(r);\n }\n return o;\n }\n }\n throw Error(\"illegal catch attempt\");\n },\n delegateYield: function delegateYield(e, r, n) {\n return this.delegate = {\n iterator: values(e),\n resultName: r,\n nextLoc: n\n }, \"next\" === this.method && (this.arg = t), y;\n }\n }, e;\n}\nmodule.exports = _regeneratorRuntime, module.exports.__esModule = true, module.exports[\"default\"] = module.exports;","function _typeof(o) {\n \"@babel/helpers - typeof\";\n\n return (module.exports = _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (o) {\n return typeof o;\n } : function (o) {\n return o && \"function\" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? \"symbol\" : typeof o;\n }, module.exports.__esModule = true, module.exports[\"default\"] = module.exports), _typeof(o);\n}\nmodule.exports = _typeof, module.exports.__esModule = true, module.exports[\"default\"] = module.exports;","// TODO(Babel 8): Remove this file.\n\nvar runtime = require(\"../helpers/regeneratorRuntime\")();\nmodule.exports = runtime;\n\n// Copied from https://github.com/facebook/regenerator/blob/main/packages/runtime/runtime.js#L736=\ntry {\n regeneratorRuntime = runtime;\n} catch (accidentalStrictMode) {\n if (typeof globalThis === \"object\") {\n globalThis.regeneratorRuntime = runtime;\n } else {\n Function(\"r\", \"regeneratorRuntime = r\")(runtime);\n }\n}\n","// The module cache\nvar __webpack_module_cache__ = {};\n\n// The require function\nfunction __webpack_require__(moduleId) {\n\t// Check if module is in cache\n\tvar cachedModule = __webpack_module_cache__[moduleId];\n\tif (cachedModule !== undefined) {\n\t\treturn cachedModule.exports;\n\t}\n\t// Create a new module (and put it into the cache)\n\tvar module = __webpack_module_cache__[moduleId] = {\n\t\t// no module.id needed\n\t\t// no module.loaded needed\n\t\texports: {}\n\t};\n\n\t// Execute the module function\n\t__webpack_modules__[moduleId](module, module.exports, __webpack_require__);\n\n\t// Return the exports of the module\n\treturn module.exports;\n}\n\n","// getDefaultExport function for compatibility with non-harmony modules\n__webpack_require__.n = (module) => {\n\tvar getter = module && module.__esModule ?\n\t\t() => (module['default']) :\n\t\t() => (module);\n\t__webpack_require__.d(getter, { a: getter });\n\treturn getter;\n};","// define getter functions for harmony exports\n__webpack_require__.d = (exports, definition) => {\n\tfor(var key in definition) {\n\t\tif(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {\n\t\t\tObject.defineProperty(exports, key, { enumerable: true, get: definition[key] });\n\t\t}\n\t}\n};","__webpack_require__.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';\nimport { PaginatedListRequestParams } from 'flarum/common/states/PaginatedListState';\n\nexport default () => {\n // @ts-ignore\n extend(DiscussionList.prototype, 'requestParams', (params: PaginatedListRequestParams) => {\n (params.include as string[]).push('poll');\n });\n\n extend(Discussion.prototype, 'badges', function (badges) {\n // @ts-ignore\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-poll',\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'];","function asyncGeneratorStep(n, t, e, r, o, a, c) {\n try {\n var i = n[a](c),\n u = i.value;\n } catch (n) {\n return void e(n);\n }\n i.done ? t(u) : Promise.resolve(u).then(r, o);\n}\nfunction _asyncToGenerator(n) {\n return function () {\n var t = this,\n e = arguments;\n return new Promise(function (r, o) {\n var a = n.apply(t, e);\n function _next(n) {\n asyncGeneratorStep(a, r, o, _next, _throw, \"next\", n);\n }\n function _throw(n) {\n asyncGeneratorStep(a, r, o, _next, _throw, \"throw\", n);\n }\n _next(void 0);\n });\n };\n}\nexport { _asyncToGenerator as default };","function _setPrototypeOf(t, e) {\n return _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function (t, e) {\n return t.__proto__ = e, t;\n }, _setPrototypeOf(t, e);\n}\nexport { _setPrototypeOf as default };","import setPrototypeOf from \"./setPrototypeOf.js\";\nfunction _inheritsLoose(t, o) {\n t.prototype = Object.create(o.prototype), t.prototype.constructor = t, setPrototypeOf(t, o);\n}\nexport { _inheritsLoose as default };","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/components/Modal'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/Component'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/components/Button'];","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'];","function _getPrototypeOf(t) {\n return _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function (t) {\n return t.__proto__ || Object.getPrototypeOf(t);\n }, _getPrototypeOf(t);\n}\nexport { _getPrototypeOf as default };","function _isNativeReflectConstruct() {\n try {\n var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {}));\n } catch (t) {}\n return (_isNativeReflectConstruct = function _isNativeReflectConstruct() {\n return !!t;\n })();\n}\nexport { _isNativeReflectConstruct as default };","import getPrototypeOf from \"./getPrototypeOf.js\";\nimport setPrototypeOf from \"./setPrototypeOf.js\";\nimport isNativeFunction from \"./isNativeFunction.js\";\nimport construct from \"./construct.js\";\nfunction _wrapNativeSuper(t) {\n var r = \"function\" == typeof Map ? new Map() : void 0;\n return _wrapNativeSuper = function _wrapNativeSuper(t) {\n if (null === t || !isNativeFunction(t)) return t;\n if (\"function\" != typeof t) throw new TypeError(\"Super expression must either be null or a function\");\n if (void 0 !== r) {\n if (r.has(t)) return r.get(t);\n r.set(t, Wrapper);\n }\n function Wrapper() {\n return construct(t, arguments, getPrototypeOf(this).constructor);\n }\n return Wrapper.prototype = Object.create(t.prototype, {\n constructor: {\n value: Wrapper,\n enumerable: !1,\n writable: !0,\n configurable: !0\n }\n }), setPrototypeOf(Wrapper, t);\n }, _wrapNativeSuper(t);\n}\nexport { _wrapNativeSuper as default };","function _isNativeFunction(t) {\n try {\n return -1 !== Function.toString.call(t).indexOf(\"[native code]\");\n } catch (n) {\n return \"function\" == typeof t;\n }\n}\nexport { _isNativeFunction as default };","import isNativeReflectConstruct from \"./isNativeReflectConstruct.js\";\nimport setPrototypeOf from \"./setPrototypeOf.js\";\nfunction _construct(t, e, r) {\n if (isNativeReflectConstruct()) return Reflect.construct.apply(null, arguments);\n var o = [null];\n o.push.apply(o, e);\n var p = new (t.bind.apply(t, o))();\n return r && setPrototypeOf(p, r.prototype), p;\n}\nexport { _construct as default };","import { NestedStringArray } from '@askvortsov/rich-icu-message-formatter';\n\nexport default class FormError extends Error {\n constructor(props: NestedStringArray | string) {\n super(props + '');\n }\n}\n","import app from 'flarum/forum/app';\nimport Poll from '../models/Poll';\nimport PollOption from '../models/PollOption';\n\nexport default class PollFormState {\n poll: Poll;\n loading: boolean;\n deleting: boolean;\n expandedGroup: string;\n\n static createNewPoll() {\n const poll = app.store.createRecord('polls');\n\n poll.pushAttributes({\n question: '',\n endDate: '',\n publicPoll: false,\n allowMultipleVotes: false,\n hideVotes: false,\n allowChangeVote: false,\n maxVotes: 0,\n });\n\n poll.tempOptions = [app.store.createRecord('poll_options'), app.store.createRecord('poll_options')];\n\n return poll;\n }\n\n constructor(poll: Poll) {\n if (!poll) {\n poll = PollFormState.createNewPoll();\n }\n\n this.loading = false;\n this.deleting = false;\n this.poll = poll;\n this.expandedGroup = 'setup';\n }\n\n isExpanded(groupKey: string) {\n return this.expandedGroup === groupKey;\n }\n\n expand(groupKey: string) {\n this.expandedGroup = groupKey;\n m.redraw();\n }\n\n async save(data: any) {\n this.loading = true;\n m.redraw();\n\n try {\n this.poll = await this.poll.save(data);\n /**\n * Cleanup attributes:\n * For the saving process, we add the options directly to the attributes.\n * As we currently cannot add new PollOptions as relationships.\n */\n delete this.poll!.data!.attributes!.options;\n } finally {\n this.loading = false;\n m.redraw();\n }\n }\n\n async delete() {\n this.loading = true;\n m.redraw();\n\n try {\n await this.poll.delete();\n this.deleting = true;\n } finally {\n this.loading = false;\n m.redraw();\n }\n }\n}\n","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/components/Page'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/components/LoadingIndicator'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/components/LinkButton'];","import Mithril from 'mithril';\nimport app from 'flarum/forum/app';\nimport Component, { ComponentAttrs } from 'flarum/common/Component';\nimport LinkButton from 'flarum/common/components/LinkButton';\nimport Poll from '../models/Poll';\nimport ItemList from 'flarum/common/utils/ItemList';\n\nexport interface ComposePollHeroAttrs extends ComponentAttrs {\n poll: Poll;\n}\n\nexport default class ComposePollHero extends Component {\n poll!: Poll;\n\n oninit(vnode: Mithril.Vnode): void {\n super.oninit(vnode);\n\n this.poll = this.attrs.poll;\n }\n\n view(): Mithril.Children {\n return (\n
\n
\n
\n

{app.translator.trans(`fof-polls.forum.compose.${!!this.poll.id() ? 'edit' : 'add'}_title`)}

\n
{this.controlItems().toArray()}
\n
\n
\n
\n );\n }\n\n controlItems(): ItemList {\n const items = new ItemList();\n\n items.add(\n 'edit',\n \n {app.translator.trans('fof-polls.forum.compose.polls_manager')}\n \n );\n\n if (this.poll.exists) {\n items.add(\n 'view',\n \n {app.translator.trans('fof-polls.forum.compose.polls_preview')}\n \n );\n }\n\n return items;\n }\n}\n","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/helpers/listItems'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/components/SelectDropdown'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['forum/components/IndexPage'];","import type Mithril from 'mithril';\nimport app from 'flarum/forum/app';\nimport Page from 'flarum/common/components/Page';\nimport Poll from '../models/Poll';\nimport LoadingIndicator from 'flarum/common/components/LoadingIndicator';\nimport PollForm from './PollForm';\nimport PollFormState from '../states/PollFormState';\nimport ComposePollHero from './ComposePollHero';\nimport Button from 'flarum/common/components/Button';\nimport listItems from 'flarum/common/helpers/listItems';\nimport ItemList from 'flarum/common/utils/ItemList';\nimport SelectDropdown from 'flarum/common/components/SelectDropdown';\nimport IndexPage from 'flarum/forum/components/IndexPage';\n\nexport default class ComposePollPage extends Page {\n poll: Poll | null | undefined = null;\n\n loading: boolean = false;\n\n oninit(vnode: Mithril.Vnode) {\n super.oninit(vnode);\n\n // prevent users from accessing the page if they can't start global polls or if they are disabled altogether\n if (!app.forum.attribute('globalPollsEnabled') || !app.forum.attribute('canStartGlobalPolls')) {\n m.route.set('/');\n return;\n }\n\n this.bodyClass = 'App--compose-poll';\n\n // Get the `edit` parameter from the URL\n const editId = m.route.param('id');\n\n // either load the poll we're editing or create a new one\n const pollPromise = editId ? this.loadEditingPoll(editId) : Promise.resolve(PollFormState.createNewPoll());\n\n pollPromise.then((poll: Poll | null | undefined) => {\n this.poll = poll;\n\n if (poll?.exists && !poll.canEdit()) {\n m.route.set('/');\n return;\n }\n\n app.history.push('compose-poll', app.translator.trans(`fof-polls.forum.compose.${!!this.poll?.id() ? 'edit' : 'add'}_title`) as string);\n app.setTitle(app.translator.trans(`fof-polls.forum.compose.${!!this.poll?.id() ? 'edit' : 'add'}_title`) as string);\n\n m.redraw();\n });\n }\n\n async loadEditingPoll(editId: string) {\n const alreadyLoaded = app.store.getById('poll', editId);\n\n if (alreadyLoaded) return alreadyLoaded;\n\n this.loading = true;\n\n const poll = await app.store.find('fof/polls', editId);\n\n this.loading = false;\n\n return poll;\n }\n\n view(): Mithril.Children {\n if (this.loading || !this.poll) {\n return ;\n }\n\n return (\n
\n \n
\n
\n \n
\n \n
\n
\n
\n
\n );\n }\n\n async onsubmit(data: Object, state: PollFormState) {\n const isNew = state.poll.id() === undefined;\n await state.save(data);\n\n const alertAttrs = isNew\n ? {\n type: 'success',\n controls: [\n \n m.route.set(\n app.route('fof.polls.compose', {\n id: state.poll.id(),\n })\n )\n }\n >\n {app.translator.trans('fof-polls.forum.compose.continue_editing')}\n ,\n ],\n }\n : {\n type: 'success',\n };\n\n // Show success alert\n const alertId = app.alerts.show(alertAttrs, app.translator.trans('fof-polls.forum.compose.success'));\n\n // Hide alert after 10 seconds\n setTimeout(() => app.alerts.dismiss(alertId), 10000);\n\n if (isNew) {\n m.route.set(app.route('fof.polls.list'));\n }\n }\n\n sidebarItems(): ItemList {\n const items = new ItemList();\n\n items.add(\n 'nav',\n \n {this.navItems().toArray()}\n \n );\n\n return items;\n }\n\n navItems() {\n return IndexPage.prototype.navItems();\n }\n}\n","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/utils/SubtreeRetainer'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/components/Dropdown'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/components/Link'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/helpers/highlight'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['forum/utils/slidable'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/helpers/icon'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/utils/abbreviateNumber'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/components/Tooltip'];","import app from 'flarum/forum/app';\nimport Mithril from 'mithril';\nimport Component, { ComponentAttrs } from 'flarum/common/Component';\nimport PollOptionModel from '../../models/PollOption';\nimport PollState from '../../states/PollState';\nimport Tooltip, { TooltipAttrs } from 'flarum/common/components/Tooltip';\nimport icon from 'flarum/common/helpers/icon';\nimport classList from 'flarum/common/utils/classList';\nimport ItemList from 'flarum/common/utils/ItemList';\nimport Poll from '../../models/Poll';\n\ninterface PollOptionAttrs extends ComponentAttrs {\n option: PollOptionModel;\n name: string;\n state: PollState;\n}\n\nexport default class PollOption extends Component {\n option!: PollOptionModel;\n name!: string;\n state!: PollState;\n hasVoted: boolean = false;\n totalVotes: number = 0;\n votes: number = 0;\n voted: boolean = false;\n poll!: Poll;\n canSeeVoteCount: boolean = false;\n answer!: string;\n\n oninit(vnode: Mithril.Vnode) {\n super.oninit(vnode);\n this.option = this.attrs.option;\n this.name = this.attrs.name;\n this.state = this.attrs.state;\n this.poll = this.state.poll;\n\n // isNaN(null) is false, so we have to check type directly now that API always returns the field\n this.canSeeVoteCount = typeof this.votes === 'number';\n\n this.answer = this.option.answer();\n }\n\n percent(): number {\n return this.totalVotes > 0 ? Math.round((this.votes / this.totalVotes) * 100) : 0;\n }\n\n view(): Mithril.Children {\n // following values can be changed by ui interactions, so we need to update them on every render\n this.hasVoted = this.state.hasVoted();\n this.totalVotes = this.state.overallVoteCount();\n this.votes = this.option.voteCount();\n this.voted = this.state.hasVotedFor(this.option);\n\n const isDisabled = this.state.loadingOptions || (this.hasVoted && !this.poll.canChangeVote());\n const width = this.canSeeVoteCount ? this.percent() : (Number(this.voted) / (this.poll.myVotes()?.length || 1)) * 100;\n\n const bar = (\n \n );\n\n return (\n \n {this.canSeeVoteCount ? (\n \n {bar}\n \n ) : (\n bar\n )}\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: Mithril.Vnode) {\n vnode.attrs.tooltipVisible = false;\n\n // @ts-ignore\n vnode.state.updateVisibility();\n }\n\n optionDisplayItems(): ItemList {\n const items = new ItemList();\n\n items.add(\n 'answer',\n \n {this.answer}\n \n );\n\n this.voted && !this.state.showCheckMarks && items.add('check', icon('fas fa-check-circle', { className: 'PollAnswer-check' }));\n\n this.canSeeVoteCount &&\n items.add('percent', {this.percent()}%);\n\n return items;\n }\n}\n","import type Mithril from 'mithril';\nimport Component, { ComponentAttrs } from 'flarum/common/Component';\nimport PollOption from './PollOption';\nimport PollOptionModel from '../../models/PollOption';\nimport ItemList from 'flarum/common/utils/ItemList';\nimport PollState from '../../states/PollState';\n\ninterface PollOptionsAttrs extends ComponentAttrs {\n options: PollOptionModel[];\n name: String;\n state: PollState;\n}\n\nexport default class PollOptions extends Component {\n view(): Mithril.Children {\n return
{this.pollOptions().toArray()}
;\n }\n\n pollOptions(): ItemList {\n const items = new ItemList();\n\n this.attrs.options.forEach((option: PollOptionModel): void => {\n items.add('option' + option.id(), this.createOptionView(option));\n });\n\n return items;\n }\n\n createOptionView(option: PollOptionModel): Mithril.Children {\n return ;\n }\n}\n","import type Mithril from 'mithril';\nimport Component, { ComponentAttrs } from 'flarum/common/Component';\nimport Poll from 'src/forum/models/Poll';\nimport ItemList from 'flarum/common/utils/ItemList';\n\ninterface PollImageAttrs extends ComponentAttrs {\n poll: Poll;\n}\n\nexport default class PollImage extends Component {\n imageUrl: string | null = null;\n imageAlt: string | null = null;\n\n oninit(vnode: Mithril.Vnode) {\n super.oninit(vnode);\n\n this.imageUrl = this.attrs.poll.imageUrl();\n this.imageAlt = this.attrs.poll.imageAlt();\n }\n\n view(): Mithril.Children {\n if (!this.imageUrl) {\n return;\n }\n\n return
{this.imageItems().toArray()}
;\n }\n\n imageItems(): ItemList {\n const items = new ItemList();\n\n items.add('image', {this.imageAlt);\n\n return items;\n }\n}\n","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'];","import type Mithril from 'mithril';\nimport app from 'flarum/forum/app';\nimport Modal, { IInternalModalAttrs } 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 LoadingIndicator from 'flarum/common/components/LoadingIndicator';\nimport PollModel from '../models/Poll';\nimport PollVote from '../models/PollVote';\nimport User from 'flarum/common/models/User';\nimport PollOption from '../models/PollOption';\n\ninterface ListVotersModalAttrs extends IInternalModalAttrs {\n poll: PollModel;\n onsubmit: (data: object) => Promise;\n}\n\nexport default class ListVotersModal extends Modal {\n oninit(vnode: Mithril.Vnode): void {\n super.oninit(vnode);\n\n this.loading = 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(): string {\n return 'Modal--medium VotesModal';\n }\n\n title(): Mithril.Children {\n return app.translator.trans('fof-polls.forum.votes_modal.title');\n }\n\n content(): Mithril.Children {\n const options = this.attrs.poll.options() as PollOption[];\n return
{this.loading ? : options.map(this.optionContent.bind(this))}
;\n }\n\n optionContent(opt: PollOption): Mithril.Children {\n const votes = (this.attrs.poll.votes() || []).filter((v) => opt.id() === v!.option()!.id()) as PollVote[];\n\n return (\n
\n

{this.optionAnswer(opt)! + ':'}

\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 optionAnswer(opt: PollOption): string {\n return opt.answer();\n }\n\n voteContent(vote: PollVote): Mithril.Children {\n const user = vote.user() as User;\n const attrs = user && { href: app.route.user(user) };\n\n return (\n \n {avatar(user)} {username(user)}\n \n );\n }\n}\n","import app from 'flarum/forum/app';\nimport Poll from '../models/Poll';\nimport LogInModal from 'flarum/forum/components/LogInModal';\nimport PollOption from '../models/PollOption';\nimport PollVote from '../models/PollVote';\nimport ListVotersModal from '../components/ListVotersModal';\nimport { ApiPayloadSingle } from 'flarum/common/Store';\n\nexport default class PollState {\n public poll: Poll;\n protected pendingSubmit: boolean = false;\n protected pendingOptions: Set | null = null;\n public loadingOptions: boolean = false;\n public useSubmitUI: boolean;\n public showCheckMarks: boolean;\n public canSeeVoteCount: boolean;\n\n constructor(poll: Poll) {\n this.poll = poll;\n this.useSubmitUI = !poll?.canChangeVote() && poll?.allowMultipleVotes();\n this.showCheckMarks = !app.session.user || (!poll.hasEnded() && poll.canVote() && (!this.hasVoted() || poll.canChangeVote()));\n this.canSeeVoteCount = typeof poll.voteCount() === 'number';\n this.init();\n }\n\n /**\n * used as en extendable entry point for init customizations\n */\n init(): void {}\n\n isShowResult(): boolean {\n return this.poll.hasEnded() || (this.canSeeVoteCount && !!app.session.user && this.hasVoted());\n }\n\n hasVoted(): boolean {\n return this.poll.myVotes().length > 0;\n }\n\n overallVoteCount(): number {\n return this.poll.voteCount();\n }\n\n hasVotedFor(option: PollOption): boolean {\n return this.pendingOptions ? this.pendingOptions.has(option.id()!) : this.poll.myVotes().some((vote: PollVote) => vote.option() === option);\n }\n\n getMaxVotes(): number {\n const poll = this.poll;\n let maxVotes = poll.allowMultipleVotes() ? poll.maxVotes() : 1;\n if (maxVotes === 0) maxVotes = poll.options().length;\n return maxVotes;\n }\n\n showButton(): boolean {\n return this.useSubmitUI && this.pendingSubmit;\n }\n\n changeVote(option: PollOption, evt: Event): void {\n const target = evt.target as HTMLInputElement;\n\n if (!app.session.user) {\n app.modal.show(LogInModal);\n target.checked = false;\n return;\n }\n\n const optionIds = this.pendingOptions || new Set(this.poll.myVotes().map((v: PollVote) => v.option()!.id()!));\n const isUnvoting = optionIds.delete(option.id()!);\n const allowsMultiple = this.poll.allowMultipleVotes();\n\n if (!allowsMultiple) {\n optionIds.clear();\n }\n\n if (!isUnvoting) {\n optionIds.add(option.id()!);\n }\n\n this.pendingOptions = optionIds.size ? optionIds : null;\n this.pendingSubmit = !!this.pendingOptions;\n\n if (this.useSubmitUI) {\n this.pendingOptions = optionIds.size ? optionIds : null;\n this.pendingSubmit = !!this.pendingOptions;\n m.redraw();\n return;\n }\n\n this.submit(optionIds, null, () => (target.checked = isUnvoting));\n }\n\n hasSelectedOptions(): boolean {\n return this.pendingSubmit;\n }\n\n onsubmit(): Promise {\n return this.submit(this.pendingOptions!, () => {\n this.pendingOptions = null;\n this.pendingSubmit = false;\n });\n }\n\n submit(optionIds: Set, cb: Function | null, onerror: Function | null = null) {\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.poll.id()}/votes`,\n body: {\n data: {\n optionIds: Array.from(optionIds),\n },\n },\n })\n .then((res: ApiPayloadSingle) => {\n app.store.pushPayload(res);\n cb?.();\n })\n .catch((err) => {\n onerror?.(err);\n })\n .finally(() => {\n this.loadingOptions = false;\n this.canSeeVoteCount = typeof this.poll.voteCount() === 'number';\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.poll,\n });\n };\n}\n","import type Mithril from 'mithril';\nimport app from 'flarum/forum/app';\nimport Component, { ComponentAttrs } from 'flarum/common/Component';\nimport Button from 'flarum/common/components/Button';\nimport PollState from '../../states/PollState';\n\ninterface PollSubmitButtonAttrs extends ComponentAttrs {\n state: PollState;\n}\n\nexport default class PollSubmitButton extends Component {\n view(): Mithril.Children {\n const state = this.attrs.state;\n return (\n this.pollButtonSubmit(state, event)}\n disabled={!state.hasSelectedOptions()}\n >\n {app.translator.trans('fof-polls.forum.poll.submit_button')}\n \n );\n }\n\n /**\n * Event handler for submit button being clicked\n */\n\n pollButtonSubmit(state: PollState, event: Event): void {\n state.onsubmit();\n }\n}\n","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/utils/string'];","import Component, { ComponentAttrs } from 'flarum/common/Component';\nimport ItemList from 'flarum/common/utils/ItemList';\nimport Poll from 'src/forum/models/Poll';\nimport Mithril from 'mithril';\n\nexport interface PollTitleAttrs extends ComponentAttrs {\n poll: Poll;\n}\n\nexport default class PollTitle extends Component {\n view() {\n return
{this.pollTitleItems().toArray()}
;\n }\n\n pollTitleItems(): ItemList {\n const items = new ItemList();\n\n items.add('title',

{this.attrs.poll.question()}

);\n\n return items;\n }\n}\n","import Component, { ComponentAttrs } from 'flarum/common/Component';\nimport ItemList from 'flarum/common/utils/ItemList';\nimport Poll from 'src/forum/models/Poll';\nimport Mithril from 'mithril';\n\nexport interface PollSubtitleAttrs extends ComponentAttrs {\n poll: Poll;\n}\n\nexport default class PollSubtitle extends Component {\n view() {\n if (!this.attrs.poll.subtitle()) {\n return;\n }\n\n return
{this.pollSubtitleItems().toArray()}
;\n }\n\n pollSubtitleItems(): ItemList {\n const items = new ItemList();\n\n items.add('subtitle',

{this.attrs.poll.subtitle()}

);\n\n return items;\n }\n}\n","import Mithril from 'mithril';\nimport Component, { ComponentAttrs } from 'flarum/common/Component';\nimport app from 'flarum/forum/app';\nimport PollOptions from './Poll/PollOptions';\nimport PollImage from './Poll/PollImage';\nimport PollModel from '../models/Poll';\nimport PollState from '../states/PollState';\nimport Button from 'flarum/common/components/Button';\nimport ItemList from 'flarum/common/utils/ItemList';\nimport PollControls from '../utils/PollControls';\nimport Dropdown from 'flarum/common/components/Dropdown';\nimport PollSubmitButton from './Poll/PollSubmitButton';\nimport { slug } from 'flarum/common/utils/string';\nimport classList from 'flarum/common/utils/classList';\nimport PollTitle from './Poll/PollTitle';\nimport PollSubtitle from './Poll/PollSubtitle';\n\ninterface PollAttrs extends ComponentAttrs {\n poll: PollModel;\n}\n\nexport default class PollView extends Component {\n state!: PollState;\n\n oninit(vnode: Mithril.Vnode) {\n super.oninit(vnode);\n this.state = new PollState(this.attrs.poll);\n }\n\n oncreate(vnode: Mithril.Vnode) {\n super.oncreate(vnode);\n\n this.preventClose = this.preventClose.bind(this);\n window.addEventListener('beforeunload', this.preventClose);\n }\n\n onremove(vnode: Mithril.Vnode) {\n super.onremove(vnode);\n\n window.removeEventListener('beforeunload', this.preventClose);\n }\n\n view(): Mithril.Children {\n const poll = this.attrs.poll;\n const state = this.state;\n const controls = PollControls.controls(poll, this);\n\n (poll.publicPoll() || poll.canEdit()) &&\n controls.add(\n 'view',\n \n );\n\n return (\n
\n {this.controlsView(controls.toArray())}\n
{this.createMainView().toArray()}
\n
\n );\n }\n\n createMainView(): ItemList {\n const items = new ItemList();\n\n items.add('header',
{this.createPollHeader().toArray()}
);\n items.add('content',
{this.createPollContent().toArray()}
);\n items.add('footer',
{this.createPollFooter().toArray()}
);\n\n return items;\n }\n\n createPollHeader(): ItemList {\n const items = new ItemList();\n const poll = this.attrs.poll;\n\n items.add('title', );\n if (poll.subtitle()) items.add('subtitle', );\n\n return items;\n }\n\n createPollContent(): ItemList {\n const items = new ItemList();\n const poll = this.attrs.poll;\n\n if (poll.imageUrl()) {\n items.add('image', );\n }\n\n items.add('form',
{this.createFormItems().toArray()}
);\n\n return items;\n }\n\n createPollFooter(): ItemList {\n const items = new ItemList();\n const state = this.state;\n\n const infoItems = this.infoItems(state.getMaxVotes());\n\n items.add(\n 'sticky',\n
\n {!infoItems.isEmpty() &&
{infoItems.toArray()}
}\n {state.showButton() && }\n
\n );\n\n return items;\n }\n\n createFormItems(): ItemList {\n const items = new ItemList();\n const poll = this.attrs.poll;\n const state = this.state;\n const questionSlug = slug(poll.question());\n\n items.add(\n 'elements',\n
\n {poll.question()}\n \n
\n );\n\n return items;\n }\n\n controlsView(controls: Mithril.ChildArray): Mithril.Children {\n return (\n !!controls.length && (\n \n {controls}\n \n )\n );\n }\n\n infoItems(maxVotes: number) {\n const items = new ItemList();\n const poll = this.attrs.poll;\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 /**\n * Alert before navigating away using browser's 'beforeunload' event\n */\n preventClose = (e: Event): boolean | void => {\n if (this.state.hasSelectedOptions()) {\n e.preventDefault();\n return true;\n }\n };\n}\n","function _typeof(o) {\n \"@babel/helpers - typeof\";\n\n return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (o) {\n return typeof o;\n } : function (o) {\n return o && \"function\" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? \"symbol\" : typeof o;\n }, _typeof(o);\n}\nexport { _typeof as default };","import _typeof from \"./typeof.js\";\nimport toPrimitive from \"./toPrimitive.js\";\nfunction toPropertyKey(t) {\n var i = toPrimitive(t, \"string\");\n return \"symbol\" == _typeof(i) ? i : i + \"\";\n}\nexport { toPropertyKey as default };","import _typeof from \"./typeof.js\";\nfunction toPrimitive(t, r) {\n if (\"object\" != _typeof(t) || !t) return t;\n var e = t[Symbol.toPrimitive];\n if (void 0 !== e) {\n var i = e.call(t, r || \"default\");\n if (\"object\" != _typeof(i)) return i;\n throw new TypeError(\"@@toPrimitive must return a primitive value.\");\n }\n return (\"string\" === r ? String : Number)(t);\n}\nexport { toPrimitive as default };","import toPropertyKey from \"./toPropertyKey.js\";\nfunction _defineProperties(e, r) {\n for (var t = 0; t < r.length; t++) {\n var o = r[t];\n o.enumerable = o.enumerable || !1, o.configurable = !0, \"value\" in o && (o.writable = !0), Object.defineProperty(e, toPropertyKey(o.key), o);\n }\n}\nfunction _createClass(e, r, t) {\n return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, \"prototype\", {\n writable: !1\n }), e;\n}\nexport { _createClass as default };","import app from 'flarum/forum/app';\nimport Component, { ComponentAttrs } from 'flarum/common/Component';\nimport classList from 'flarum/common/utils/classList';\nimport icon from 'flarum/common/helpers/icon';\nimport ItemList from 'flarum/common/utils/ItemList';\nimport type Mithril from 'mithril';\n\ninterface PollPageHeroAttrs extends ComponentAttrs {\n icon?: string;\n title?: string;\n}\n\nexport default class PollPageHero extends Component {\n oninit(vnode: Mithril.Vnode) {\n super.oninit(vnode);\n }\n\n get classNames(): string {\n return classList({\n PollPageHero: true,\n Hero: true,\n });\n }\n\n get wrapperClasses(): string {\n return classList({\n 'PollPageHero--wrapper': true,\n });\n }\n\n oncreate(vnode: Mithril.Vnode): void {\n super.oncreate(vnode);\n }\n\n get title() {\n return this.attrs.title || app.translator.trans('fof-polls.forum.polls_page.title');\n }\n\n get icon() {\n return this.attrs.icon || 'fas fa-poll';\n }\n\n view() {\n return (\n
\n
\n
\n
{this.items().toArray()}
\n
\n
\n
\n );\n }\n\n items() {\n const items = new ItemList();\n items.add('title',

{[icon(this.icon), ' ', this.title]}

, 50);\n\n return items;\n }\n}\n","import Page, { IPageAttrs } from 'flarum/common/components/Page';\nimport PollListState from '../states/PollListState';\nimport Poll from '../models/Poll';\nimport ItemList from 'flarum/common/utils/ItemList';\nimport type Mithril from 'mithril';\nimport LoadingIndicator from 'flarum/common/components/LoadingIndicator';\nimport IndexPage from 'flarum/forum/components/IndexPage';\nimport listItems from 'flarum/common/helpers/listItems';\nimport app from 'flarum/forum/app';\nimport SelectDropdown from 'flarum/common/components/SelectDropdown';\nimport IndexPageHero from './PollPageHero';\n\nexport abstract class AbstractPollPage extends Page {\n loading: boolean = false;\n poll: Poll | null | undefined = null;\n polls: Poll[] = [];\n\n view(): Mithril.Children {\n return
{this.pageContent().toArray()}
;\n }\n\n pageContent(): ItemList {\n const items = new ItemList();\n\n items.add('hero', this.hero(), 100);\n items.add('main',
{this.mainContent().toArray()}
, 10);\n\n return items;\n }\n\n mainContent(): ItemList {\n const items = new ItemList();\n\n items.add('sidebar', this.sidebar(), 100);\n items.add('content', this.content(), 10);\n\n return items;\n }\n\n content(): Mithril.Children {\n return
{this.contentItems().toArray()}
;\n }\n\n contentItems(): ItemList {\n const items = new ItemList();\n\n if (this.loading) {\n items.add('loading', );\n }\n\n return items;\n }\n\n hero(): Mithril.Children {\n return ;\n }\n\n sidebar(): Mithril.Children {\n return (\n \n );\n }\n\n sidebarItems(): ItemList {\n const items = IndexPage.prototype.sidebarItems();\n\n items.setContent(\n 'nav',\n \n {this.navItems().toArray()}\n \n );\n\n return items;\n }\n\n navItems(): ItemList {\n const items = IndexPage.prototype.navItems();\n\n if (app.initializers.has('flarum-tags')) {\n // remove the tags from the nav items\n items.remove('separator');\n items.remove('moreTags');\n\n // each tag is added using the key \"tag{id}\". We need to remove all of them\n for (const key in items.toObject()) {\n if (key.startsWith('tag') && key !== 'tags') {\n items.remove(key);\n }\n }\n }\n\n return items;\n }\n}\n","import type Mithril from 'mithril';\nimport app from 'flarum/forum/app';\nimport PollModel from '../models/Poll';\nimport PollView from './PollView';\nimport { AbstractPollPage } from './AbstractPollPage';\nimport ItemList from 'flarum/common/utils/ItemList';\n\nexport default class PollViewPage extends AbstractPollPage {\n oninit(vnode: Mithril.Vnode) {\n super.oninit(vnode);\n\n if (!app.forum.attribute('globalPollsEnabled')) {\n m.route.set('/');\n return;\n }\n\n const editId = m.route.param('id');\n this.poll = app.store.getById('poll', editId);\n\n if (!this.poll) {\n this.loading = true;\n\n app.store.find('fof/polls', editId).then((item) => {\n this.poll = item;\n this.loading = false;\n app.setTitle(this.poll.question());\n m.redraw();\n });\n }\n }\n\n contentItems(): ItemList {\n const items = super.contentItems();\n\n if (!this.loading) {\n items.add('poll', );\n }\n\n return items;\n }\n}\n","import type Mithril from 'mithril';\nimport app from 'flarum/forum/app';\nimport Component, { ComponentAttrs } from 'flarum/common/Component';\nimport type { PollListParams } from '../../states/PollListState';\nimport SubtreeRetainer from 'flarum/common/utils/SubtreeRetainer';\nimport classList from 'flarum/common/utils/classList';\nimport Dropdown from 'flarum/common/components/Dropdown';\nimport Link from 'flarum/common/components/Link';\nimport highlight from 'flarum/common/helpers/highlight';\nimport slidable from 'flarum/forum/utils/slidable';\nimport icon from 'flarum/common/helpers/icon';\nimport abbreviateNumber from 'flarum/common/utils/abbreviateNumber';\nimport Poll from '../../models/Poll';\nimport PollControls from '../../utils/PollControls';\nimport ItemList from 'flarum/common/utils/ItemList';\nimport listItems from 'flarum/common/helpers/listItems';\nimport PollViewPage from '../PollViewPage';\n\nexport interface IPollListItemAttrs extends ComponentAttrs {\n poll: Poll;\n params: PollListParams;\n}\n\n/**\n * The `PollListItem` component shows a single poll in the\n * poll list.\n */\nexport default class PollListItem extends Component {\n /**\n * Ensures that the poll will not be redrawn\n * unless new data comes in.\n */\n subtree!: SubtreeRetainer;\n poll!: Poll;\n\n highlightRegExp?: RegExp;\n\n oninit(vnode: Mithril.Vnode) {\n super.oninit(vnode);\n\n this.poll = this.attrs.poll;\n\n this.subtree = new SubtreeRetainer(\n () => this.poll.freshness,\n () => {\n const time = app.session.user && app.session.user.markedAllAsReadAt();\n return time && time.getTime();\n },\n () => this.active()\n );\n }\n\n elementAttrs() {\n return {\n className: classList('PollListItem', {\n active: this.active(),\n 'PollListItem--hidden': this.poll.isHidden(),\n Slidable: 'ontouchstart' in window,\n }),\n };\n }\n\n view() {\n const controls = PollControls.controls(this.poll, this).toArray();\n const attrs = this.elementAttrs();\n\n return (\n
\n {this.controlsView(controls)}\n {this.contentView()}\n {this.slidableUnderneathView()}\n
\n );\n }\n\n controlsView(controls: Mithril.ChildArray): Mithril.Children {\n return (\n !!controls.length && (\n \n {controls}\n \n )\n );\n }\n\n slidableUnderneathView(): Mithril.Children {\n const isUnread = this.poll.isUnread();\n\n return (\n \n {icon('fas fa-check')}\n \n );\n }\n\n contentView(): Mithril.Children {\n // const isUnread = this.poll.isUnread();\n // const isRead = this.poll.isRead();\n\n return (\n //
\n
{this.mainView()}
\n );\n }\n\n mainView(): Mithril.Children {\n return (\n \n

{highlight(this.pollQuestion(this.poll), this.highlightRegExp)}

\n {this.poll.subtitle() &&

{this.pollSubtitle(this.poll)}

}\n
    {listItems(this.infoItems().toArray())}
\n \n );\n }\n\n /**\n * Allow extensions to revise the question string.\n */\n pollQuestion(poll: Poll): string {\n return poll.question();\n }\n\n /**\n * Allow extensions to revise the subtitle string.\n */\n pollSubtitle(poll: Poll): string | null {\n return poll.subtitle();\n }\n\n oncreate(vnode: Mithril.VnodeDOM) {\n super.oncreate(vnode);\n\n // If we're on a touch device, set up the discussion row to be slidable.\n // This allows the user to drag the row to either side of the screen to\n // reveal controls.\n if ('ontouchstart' in window) {\n const slidableInstance = slidable(this.element);\n\n this.$('.PollListItem-controls').on('hidden.bs.dropdown', () => slidableInstance.reset());\n }\n }\n\n onbeforeupdate(vnode: Mithril.VnodeDOM) {\n super.onbeforeupdate(vnode);\n\n return this.subtree.needsRebuild();\n }\n\n /**\n * Determine whether or not the discussion is currently being viewed.\n */\n active() {\n return app.current.matches(PollViewPage, { poll: this.poll });\n }\n\n /**\n * Mark the poll as read.\n */\n markAsRead() {\n if (this.poll.isUnread()) {\n this.poll.save({ lastVotedNumber: this.poll.voteCount() });\n m.redraw();\n }\n }\n\n infoItems(): ItemList {\n const items = new ItemList();\n const active = !this.poll.hasEnded();\n const activeView = this.poll.endDate()\n ? [\n icon('fas fa-clock'),\n ' ',\n active\n ? app.translator.trans('fof-polls.forum.days_remaining', { time: dayjs(this.poll.endDate()).fromNow() })\n : app.translator.trans('fof-polls.forum.poll_ended'),\n ]\n : [icon('fas fa-infinity'), ' ', app.translator.trans('fof-polls.forum.poll_never_ends')];\n\n items.add('active', {activeView});\n\n const voteCount = this.poll.voteCount();\n if (voteCount !== undefined) {\n items.add(\n 'voteCount',\n \n {icon('fas fa-poll fa-fw')}\n {[\n ' ',\n app.translator.trans('fof-polls.forum.polls_count', {\n count: abbreviateNumber(voteCount),\n }),\n ]}\n ,\n 70\n );\n }\n\n return items;\n }\n}\n","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/components/Placeholder'];","import app from 'flarum/forum/app';\nimport Component, { ComponentAttrs } from 'flarum/common/Component';\nimport PollListItem from './PollListItem';\nimport Button from 'flarum/common/components/Button';\nimport LoadingIndicator from 'flarum/common/components/LoadingIndicator';\nimport Placeholder from 'flarum/common/components/Placeholder';\nimport classList from 'flarum/common/utils/classList';\nimport PollListState from '../../states/PollListState';\n\nexport interface PollListAttrs extends ComponentAttrs {\n state: PollListState;\n}\n\n/**\n * The `PollList` component displays a list of polls.\n */\nexport default class PollList extends Component {\n view() {\n const state = this.attrs.state;\n const params = state.getParams();\n const isLoading = state.isInitialLoading() || state.isLoadingNext();\n\n let loading;\n\n if (isLoading) {\n loading = ;\n } else if (state.hasNext()) {\n loading = (\n \n );\n }\n\n if (state.isEmpty()) {\n const text = app.translator.trans('fof-polls.forum.polls_list.empty_text');\n return (\n
\n \n
\n );\n }\n\n return (\n
\n
    \n {state.getPages().map((pg) => {\n return pg.items.map((poll) => (\n
  • \n \n
  • \n ));\n })}\n
\n
{loading}
\n
\n );\n }\n}\n","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/states/PaginatedListState'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/utils/EventEmitter'];","import app from 'flarum/forum/app';\nimport PaginatedListState, { Page, PaginatedListParams, PaginatedListRequestParams } from 'flarum/common/states/PaginatedListState';\nimport Poll from '../models/Poll';\nimport { ApiResponsePlural } from 'flarum/common/Store';\nimport EventEmitter from 'flarum/common/utils/EventEmitter';\n\nexport interface PollListParams extends PaginatedListParams {\n sort?: string;\n}\n\nconst globalEventEmitter = new EventEmitter();\n\nexport default class PollListState

extends PaginatedListState {\n protected extraPolls: Poll[] = [];\n protected eventEmitter: EventEmitter;\n\n constructor(params: P, page: number = 1) {\n super(params, page, 20);\n\n this.eventEmitter = globalEventEmitter.on('poll.deleted', this.deletePoll.bind(this));\n }\n\n get type(): string {\n return 'fof/polls';\n }\n\n requestParams(): PaginatedListRequestParams {\n const params = {\n include: this.requestIncludes(),\n filter: this.params.filter || {},\n sort: this.sortMap()[this.params.sort ?? ''],\n };\n\n if (this.params.q) {\n params.filter.q = this.params.q;\n }\n\n return params;\n }\n\n includes(): string[] {\n return ['options', 'votes'];\n }\n\n private requestIncludes(): string {\n const standard = this.includes();\n\n // merge the standard includes with the custom includes\n const merged = [...standard, ...(this.params.include || [])];\n\n // return as a comma separated string\n return merged.join(',');\n }\n\n protected loadPage(page: number = 1): Promise> {\n const preloadedPolls = app.preloadedApiDocument();\n\n if (preloadedPolls) {\n this.initialLoading = false;\n\n return Promise.resolve(preloadedPolls);\n }\n\n return super.loadPage(page);\n }\n\n clear(): void {\n super.clear();\n\n this.extraPolls = [];\n }\n\n /**\n * Get a map of sort keys (which appear in the URL, and are used for\n * translation) to the API sort value that they represent.\n */\n sortMap() {\n const map: any = {};\n\n if (this.params.q) {\n map.relevance = '';\n }\n map.newest = '-createdAt';\n map.oldest = 'createdAt';\n\n return map;\n }\n\n /**\n * In the last request, has the user searched for a poll?\n */\n isSearchResults(): boolean {\n return !!this.params.q;\n }\n\n removePoll(poll: Poll): void {\n this.eventEmitter.emit('poll.deleted', poll);\n }\n\n deletePoll(poll: Poll): void {\n for (const page of this.pages) {\n const index = page.items.indexOf(poll);\n\n if (index !== -1) {\n page.items.splice(index, 1);\n break;\n }\n }\n\n const index = this.extraPolls.indexOf(poll);\n\n if (index !== -1) {\n this.extraPolls.splice(index);\n }\n\n m.redraw();\n }\n\n /**\n * Add a poll to the top of the list.\n */\n addPoll(poll: Poll): void {\n this.removePoll(poll);\n this.extraPolls.unshift(poll);\n\n m.redraw();\n }\n\n protected getAllItems(): Poll[] {\n return this.extraPolls.concat(super.getAllItems());\n }\n\n public getPages(): Page[] {\n const pages = super.getPages();\n\n if (this.extraPolls.length) {\n return [\n {\n number: -1,\n items: this.extraPolls,\n },\n ...pages,\n ];\n }\n\n return pages;\n }\n}\n","import type Mithril from 'mithril';\nimport app from 'flarum/forum/app';\nimport listItems from 'flarum/common/helpers/listItems';\nimport ItemList from 'flarum/common/utils/ItemList';\nimport IndexPage from 'flarum/forum/components/IndexPage';\nimport PollList from './Poll/PollList';\nimport LogInModal from 'flarum/forum/components/LogInModal';\nimport extractText from 'flarum/common/utils/extractText';\nimport PollListState from '../states/PollListState';\nimport Button from 'flarum/common/components/Button';\nimport SelectDropdown from 'flarum/common/components/SelectDropdown';\nimport LoadingIndicator from 'flarum/common/components/LoadingIndicator';\nimport PollView from './PollView';\nimport { AbstractPollPage } from './AbstractPollPage';\n\nexport default class PollsPage extends AbstractPollPage {\n oninit(vnode: Mithril.Vnode) {\n super.oninit(vnode);\n\n if (!app.forum.attribute('globalPollsEnabled')) {\n m.route.set('/');\n return;\n }\n\n this.state = new PollListState({\n sort: m.route.param('sort'),\n filter: m.route.param('filter'),\n });\n\n this.state.refresh();\n\n app.setTitle(extractText(app.translator.trans('fof-polls.forum.page.nav')));\n }\n\n view(): Mithril.Children {\n if (this.loading) {\n return ;\n }\n\n if (this.poll) {\n return (\n

\n
\n \n
\n
\n );\n }\n\n return (\n
\n {super.hero()}\n
\n
\n \n
\n
\n
    {listItems(this.viewItems().toArray())}
\n
    {listItems(this.actionItems().toArray())}
\n
\n \n
\n
\n
\n
\n );\n }\n\n sidebarItems(): ItemList {\n const items = new ItemList();\n const canStartPoll = app.forum.attribute('canStartGlobalPolls');\n\n items.add(\n 'newGlobalPoll',\n {\n this.newPollAction();\n }}\n disabled={!canStartPoll}\n >\n {app.translator.trans(`fof-polls.forum.poll.${canStartPoll ? 'start_poll_button' : 'cannot_start_poll_button'}`)}\n \n );\n\n items.add(\n 'nav',\n \n {this.navItems().toArray()}\n \n );\n\n return items;\n }\n\n actionItems(): ItemList {\n const items = new ItemList();\n\n items.add(\n 'refresh',\n Button.component({\n title: app.translator.trans('fof-polls.forum.page.refresh_tooltip'),\n icon: 'fas fa-sync',\n className: 'Button Button--icon',\n onclick: () => {\n this.state.refresh();\n },\n })\n );\n\n return items;\n }\n\n viewItems() {\n return IndexPage.prototype.viewItems();\n }\n\n navItems() {\n return IndexPage.prototype.navItems();\n }\n\n /**\n * Change to create new poll page\n */\n newPollAction(): void {\n if (!app.session.user) {\n app.modal.show(LogInModal);\n return;\n }\n\n m.route.set(app.route('fof.polls.compose'));\n }\n}\n","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/components/Separator'];","import type Mithril from 'mithril';\nimport app from 'flarum/forum/app';\nimport Poll from '../models/Poll';\nimport Component from 'flarum/common/Component';\nimport ComposePollPage from '../components/ComposePollPage';\nimport PollsPage from '../components/PollsPage';\nimport ItemList from 'flarum/common/utils/ItemList';\nimport Separator from 'flarum/common/components/Separator';\nimport Button from 'flarum/common/components/Button';\n\n/**\n * The `UserControls` utility constructs a list of buttons for a user which\n * perform actions on it.\n */\nexport default {\n /**\n * Get a list of controls for a user.\n */\n controls(poll: Poll, context: Component): ItemList {\n const items = new ItemList();\n\n ['poll', 'moderation', 'destructive'].forEach((section) => {\n const controls = (this[section + 'Controls'](poll, context) as ItemList).toArray();\n if (controls.length) {\n controls.forEach((item) => items.add(item.itemName, item));\n items.add(section + 'Separator', );\n }\n });\n\n return items;\n },\n\n /**\n * Get controls for direct modifcation actions on polls (e.g. vote, view voters).\n */\n pollControls(poll: Poll, context: Component): ItemList {\n const items = new ItemList();\n\n return items;\n },\n\n /**\n * Get controls for a user pertaining to moderation (e.g. suspend, edit).\n */\n moderationControls(poll: Poll, context: Component): ItemList {\n const items = new ItemList();\n\n if (poll.canEdit()) {\n items.add(\n 'edit',\n \n );\n }\n\n return items;\n },\n\n /**\n * Get controls for a user which are destructive (e.g. delete).\n * @protected\n */\n destructiveControls(poll: Poll, context: Component): ItemList {\n const items = new ItemList();\n\n if (poll.canDelete()) {\n items.add(\n 'delete',\n \n );\n }\n\n return items;\n },\n\n /**\n * Delete the poll.\n */\n async deleteAction(poll: Poll): Promise {\n if (!confirm(app.translator.trans(`fof-polls.forum.poll_controls.delete_confirmation`) as string)) {\n return;\n }\n\n return poll\n .delete()\n .then(() => {\n this.showDeletionAlert(poll, 'success');\n if (app.current.matches(ComposePollPage, { id: poll.id() }) || app.current.matches(PollsPage, { id: poll.id() })) {\n app.history.back();\n } else {\n window.location.reload();\n }\n })\n .catch(() => this.showDeletionAlert(poll, 'error'));\n },\n\n /**\n * Show deletion alert of poll\n */\n showDeletionAlert(poll: Poll, type: string): void {\n const message = {\n success: `fof-polls.forum.poll_controls.delete_success_message`,\n error: `fof-polls.forum.poll_controls.delete_error_message`,\n }[type]!;\n\n app.alerts.show({ type }, app.translator.trans(message, { poll: poll }));\n },\n\n /**\n * Edit the poll.\n */\n editAction(poll: Poll): void {\n m.route.set(app.route('fof.polls.compose', { id: poll.id() }));\n },\n};\n","function _extends() {\n return _extends = Object.assign ? Object.assign.bind() : function (n) {\n for (var e = 1; e < arguments.length; e++) {\n var t = arguments[e];\n for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]);\n }\n return n;\n }, _extends.apply(null, arguments);\n}\nexport { _extends as default };","import app from 'flarum/forum/app';\nimport Button, { IButtonAttrs } from 'flarum/common/components/Button';\nimport classList from 'flarum/common/utils/classList';\nimport Mithril from 'mithril';\nimport Poll from '../models/Poll';\nimport PollOption from '../models/PollOption';\n\nexport interface UploadPollImageButtonAttrs extends IButtonAttrs {\n className?: string;\n loading?: boolean;\n name: string;\n onclick: () => void;\n poll?: Poll | null;\n option?: PollOption | null;\n onUpload: (fileName: string | null | undefined) => void;\n}\n\nexport interface PollUploadObject {\n fileUrl: string;\n fileName: string;\n}\n\nexport default class UploadPollImageButton extends Button {\n loading: boolean = false;\n uploadedImageUrl: string | undefined | false = false;\n fileName: string | undefined = undefined;\n $input: JQuery | undefined;\n\n view(vnode: Mithril.Vnode) {\n this.attrs.loading = this.loading;\n this.attrs.className = classList(this.attrs.className, 'Button', 'Button--inverted');\n\n const imageUrl = this.getImageUrl();\n const canUpload = app.forum.attribute('canUploadPollImages');\n\n if (imageUrl) {\n this.attrs.onclick = this.remove.bind(this);\n\n return (\n
\n

\n \"\"\n

\n

\n {super.view({\n ...vnode,\n children: app.translator.trans('fof-polls.forum.upload_image.remove_button'),\n })}\n

\n
\n );\n } else {\n this.attrs.onclick = this.upload.bind(this);\n }\n\n return canUpload && super.view({ ...vnode, poll: undefined, children: app.translator.trans('fof-polls.forum.upload_image.upload_button') });\n }\n\n /**\n * Prompt the user to upload an image.\n */\n upload() {\n if (this.loading) return;\n\n this.$input = $('');\n\n this.$input\n .appendTo('body')\n .hide()\n .trigger('click')\n .on('change', (e) => {\n const body = new FormData();\n body.append(this.attrs.name, $(e.target)[0].files[0]);\n\n this.loading = true;\n m.redraw();\n\n app\n .request({\n method: 'POST',\n url: this.resourceUrl(),\n serialize: (raw) => raw,\n body,\n })\n .then(this.success.bind(this), this.failure.bind(this));\n });\n }\n\n /**\n * Remove the image.\n */\n remove() {\n this.loading = true;\n m.redraw();\n\n let fileName = undefined;\n\n if (!this.attrs.poll?.exists && !this.attrs.option?.exists) {\n fileName = this.fileName;\n }\n\n app\n .request({\n method: 'DELETE',\n url: this.resourceUrl(fileName),\n })\n .then((upload) => {\n if (this.attrs.poll?.exists) {\n this.attrs.poll.pushAttributes({ image: null, imageUrl: null, isImageUpload: false });\n }\n\n if (this.attrs.option?.exists) {\n this.attrs.option.pushAttributes({ imageUrl: false });\n }\n\n return upload;\n })\n .then(this.success.bind(this), this.failure.bind(this));\n }\n\n resourceUrl(fileName: string | undefined = undefined) {\n let url = app.forum.attribute('apiUrl') + '/fof/polls/' + this.attrs.name;\n const poll = this.attrs.poll;\n const option = this.attrs.option;\n\n if (fileName) {\n url += '/name/' + fileName;\n } else {\n if (poll?.exists) url += '/' + poll?.id();\n if (option?.exists) url += '/' + option?.id();\n }\n\n return url;\n }\n\n getImageUrl() {\n if (this.uploadedImageUrl !== false) {\n return this.uploadedImageUrl;\n }\n\n return this.attrs.poll?.imageUrl() || this.attrs.option?.imageUrl();\n }\n\n /**\n * After a successful upload/removal, redraw the page.\n *\n * @param {PollUploadObject} response\n * @protected\n */\n success(response: PollUploadObject | null) {\n this.loading = false;\n this.uploadedImageUrl = response?.fileUrl;\n this.fileName = response?.fileName;\n\n this.attrs.onUpload?.(response?.fileName);\n m.redraw();\n this.$input?.remove();\n }\n\n /**\n * If upload/removal fails, stop loading.\n *\n * @param {object} response\n * @protected\n */\n failure(response: object) {\n this.loading = false;\n m.redraw();\n this.$input?.remove();\n }\n}\n","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/utils/RequestError'];","import Component, { ComponentAttrs } from 'flarum/common/Component';\nimport Mithril from 'mithril';\nimport app from 'flarum/forum/app';\nimport Button from 'flarum/common/components/Button';\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';\nimport FormError from './form/FormError';\nimport PollFormState from '../states/PollFormState';\nimport PollControls from '../utils/PollControls';\nimport PollModel from '../models/Poll';\nimport PollOption from '../models/PollOption';\nimport UploadPollImageButton from './UploadPollImageButton';\nimport Poll from '../models/Poll';\nimport Tooltip from 'flarum/common/components/Tooltip';\nimport RequestError from 'flarum/common/utils/RequestError';\n\ninterface PollFormAttrs extends ComponentAttrs {\n poll: PollModel;\n onsubmit: (data: object, state: PollFormState) => Promise;\n}\n\nexport default class PollForm extends Component {\n protected options: PollOption[] = [];\n protected optionAnswers: Stream[] = [];\n protected optionImageUrls: Stream[] = [];\n protected question: Stream;\n protected subtitle: Stream;\n protected image: Stream;\n protected imageAlt: Stream;\n protected endDate: Stream;\n protected publicPoll: Stream;\n protected allowMultipleVotes: Stream;\n protected hideVotes: Stream;\n protected allowChangeVote: Stream;\n protected maxVotes: Stream;\n protected datepickerMinDate: string = '';\n\n oninit(vnode: Mithril.Vnode): void {\n super.oninit(vnode);\n this.state = new PollFormState(this.attrs.poll);\n\n // state handles poll initialization\n const poll = this.state.poll;\n\n this.options = (poll.tempOptions ?? poll.options()) as PollOption[];\n this.optionAnswers = this.options.map((o) => Stream(o.answer()));\n this.optionImageUrls = this.options.map((o) => Stream(o.imageUrl()));\n\n this.question = Stream(poll.question());\n this.subtitle = Stream(poll.subtitle());\n this.image = Stream(poll.image());\n this.imageAlt = Stream(poll.imageAlt());\n this.endDate = Stream(this.formatDate(poll.endDate()));\n this.publicPoll = Stream(poll.publicPoll());\n this.allowMultipleVotes = Stream(poll.allowMultipleVotes());\n this.hideVotes = Stream(poll.hideVotes());\n this.allowChangeVote = Stream(poll.allowChangeVote());\n this.maxVotes = Stream(poll.maxVotes() || 0);\n\n // Set minimum date for datepicker to current date\n this.datepickerMinDate = this.formatDate() as string;\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 // We know that endDate is set, so we can safely cast the result to string\n this.datepickerMinDate = this.formatDate(poll.endDate()) as string;\n }\n }\n\n view(): Mithril.Children {\n return (\n
\n
{this.fields().toArray()}
\n
\n );\n }\n\n fields(): ItemList {\n const items = new ItemList();\n\n items.add(\n 'question',\n
\n \n\n \n
,\n 100\n );\n\n items.add(\n 'subtitle',\n
\n \n\n \n
,\n 95\n );\n\n const hasImage = this.image();\n\n items.add(\n 'poll_image',\n
\n \n {this.uploadConditional(\n hasImage,\n this.state.poll?.isImageUpload(),\n <>\n

{app.translator.trans('fof-polls.forum.modal.poll_image.help')}

\n \n ,\n ,\n \n )}\n
,\n 90\n );\n\n if (hasImage) {\n items.add(\n 'poll_image_alt',\n
\n \n\n \n\n

{app.translator.trans('fof-polls.forum.modal.poll_image.alt_help_text')}

\n
,\n 90\n );\n }\n\n items.add(\n 'answers',\n
\n \n\n {this.displayOptions().toArray()}\n\n \n
,\n 80\n );\n\n items.add(\n 'date',\n
\n \n\n
\n \n {Button.component({\n className: 'Button PollModal--button Button--icon',\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 \n {this.state.poll.exists && (\n \n {app.translator.trans('fof-polls.forum.modal.delete')}\n \n )}\n
,\n -10\n );\n\n return items;\n }\n\n displayOptions(): ItemList {\n const items = new ItemList();\n const canUpload = app.forum.attribute('canUploadPollImages');\n\n this.options.forEach((option, i) => {\n const imgFunc = this.optionImageUrls[i];\n\n items.add(\n 'option-' + i,\n
\n
\n \n {app.forum.attribute('allowPollOptionImage') && (\n
\n {this.uploadConditional(\n !!imgFunc(),\n option?.isImageUpload(),\n <>\n \n

{app.translator.trans('fof-polls.forum.modal.poll_option_image.help')}

\n \n ,\n\n ,\n\n \n )}\n
\n )}\n
\n {i >= 2\n ? Button.component({\n type: 'button',\n className: 'Button PollModal--button Button--icon',\n icon: 'fas fa-minus',\n onclick: i >= 2 ? this.removeOption.bind(this, i) : '',\n })\n : ''}\n
\n );\n });\n\n return items;\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: number): void {\n this.options.splice(i, 1);\n this.optionAnswers.splice(i, 1);\n this.optionImageUrls.splice(i, 1);\n }\n\n data(): object {\n if (this.question() === '') {\n throw new FormError(app.translator.trans('fof-polls.forum.modal.include_question'));\n }\n\n if (this.options.length < 2) {\n throw new FormError(app.translator.trans('fof-polls.forum.modal.min'));\n }\n\n const pollExists = this.state.poll.exists;\n const options = this.options.map((option, i) => {\n option.pushAttributes({\n answer: this.optionAnswers[i](),\n imageUrl: this.optionImageUrls[i](),\n });\n\n return pollExists ? option.data : option.data.attributes;\n });\n\n return {\n question: this.question(),\n subtitle: this.subtitle(),\n pollImage: this.image(),\n imageAlt: this.imageAlt(),\n endDate: this.dateToTimestamp(this.endDate()) ?? false,\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 async onsubmit(event: Event) {\n event.preventDefault();\n\n try {\n await this.attrs.onsubmit(this.data(), this.state);\n } catch (error) {\n if (error instanceof FormError) {\n app.alerts.show({ type: 'error' }, error.message);\n } else if (error instanceof RequestError) {\n console.error(error);\n app.alerts.show({ type: 'error' }, app.translator.trans('fof-polls.forum.modal.error'));\n }\n }\n }\n\n async delete(): Promise {\n this.state.loading = true;\n try {\n await PollControls.deleteAction(this.state.poll);\n this.state.deleting = true;\n } finally {\n this.state.loading = false;\n m.redraw();\n }\n }\n\n formatDate(date: Date | string | false | undefined | null = undefined, def: Date | false = false): string | false {\n const dayjsDate = dayjs(date);\n\n if (date === false || !dayjsDate.isValid()) return def !== false ? this.formatDate(def) : false;\n\n return dayjsDate.format('YYYY-MM-DDTHH:mm');\n }\n\n dateToTimestamp(date: Date | false): string | null {\n const dayjsDate = dayjs(date);\n\n if (!date || !dayjsDate.isValid()) return null;\n\n return dayjsDate.format();\n }\n\n pollImageUploadSuccess(fileName: string | null | undefined): void {\n this.image(fileName);\n }\n\n pollOptionImageUploadSuccess(index: number, fileName: string | null | undefined): void {\n this.optionImageUrls[index] = Stream(fileName);\n }\n\n uploadConditional(hasImage: boolean, isUpload: boolean, ifCanUpload: JSX.Element, uploadButton: JSX.Element, imageUrlInput: JSX.Element) {\n const canUpload = app.forum.attribute('canUploadPollImages');\n const canUploadNow = this.state.poll?.exists || (app.forum.attribute('canStartPolls') && app.forum.attribute('canStartGlobalPolls'));\n\n // if can upload OR image is already uploaded\n if (canUpload || isUpload) {\n // may not have enough permissions to upload before creating poll\n if (!canUploadNow && !isUpload) {\n return (\n <>\n {imageUrlInput}\n

{app.translator.trans('fof-polls.forum.modal.poll_image.later_help')}

\n \n );\n }\n\n return (\n <>\n {ifCanUpload}\n
\n {!hasImage && imageUrlInput}\n {uploadButton}\n
\n \n );\n }\n\n return imageUrlInput;\n }\n}\n","import type Mithril from 'mithril';\nimport app from 'flarum/forum/app';\nimport Modal, { IInternalModalAttrs } from 'flarum/common/components/Modal';\nimport PollForm from './PollForm';\nimport PollModel from '../models/Poll';\nimport PollFormState from '../states/PollFormState';\n\ninterface CreatePollModalAttrs extends IInternalModalAttrs {\n poll: PollModel;\n onsubmit: (data: object) => Promise;\n}\n\nexport default class CreatePollModal extends Modal {\n title(): Mithril.Children {\n return app.translator.trans('fof-polls.forum.modal.add_title');\n }\n\n className(): string {\n return 'PollDiscussionModal Modal--medium';\n }\n\n content(): Mithril.Children {\n return [\n
\n \n
,\n ];\n }\n\n async onFormSubmit(data: object, state: PollFormState): Promise {\n this.hide();\n await this.attrs.onsubmit(data);\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';\nimport CreatePollModal from './components/CreatePollModal';\nimport Poll from './models/Poll';\nimport PollOption from './models/PollOption';\nimport { ModelAttributes } from 'flarum/common/Model';\nimport PollModelAttributes from './models/PollModelAttributes';\n\nfunction toPoll(data: PollModelAttributes) {\n if (data) {\n const poll = app.store.createRecord('polls');\n\n poll.tempOptions = data.options.map((option: ModelAttributes) => {\n const pollOption = app.store.createRecord('poll_options');\n pollOption.pushAttributes(option);\n return pollOption;\n });\n poll.pushAttributes(data);\n\n return poll;\n }\n return data;\n}\n\nexport const addToComposer = (composer: ComponentClass) => {\n // @ts-ignore\n composer.prototype.addPoll = function () {\n app.modal.show(CreatePollModal, {\n poll: toPoll(this.composer.fields.poll),\n onsubmit: (poll: PollModelAttributes) => (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\n // @ts-ignore\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['forum/components/DiscussionPage'];","import type Mithril from 'mithril';\nimport app from 'flarum/forum/app';\nimport CreatePollModal from './CreatePollModal';\nimport PollFormState from '../states/PollFormState';\n\nexport default class EditPollModal extends CreatePollModal {\n title(): Mithril.Children {\n return app.translator.trans('fof-polls.forum.modal.edit_title');\n }\n\n async onFormSubmit(data: object, state: PollFormState): Promise {\n await state.save(data);\n\n // Show success alert\n const alertId = app.alerts.show(\n {\n type: 'success',\n },\n app.translator.trans('fof-polls.forum.compose.success')\n );\n\n // Hide alert after 10 seconds\n setTimeout(() => app.alerts.dismiss(alertId), 10000);\n }\n}\n","import app from 'flarum/forum/app';\nimport Component, { ComponentAttrs } 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';\nimport Poll from '../models/Poll';\nimport type Mithril from 'mithril';\nimport PollOption from '../models/PollOption';\nimport Post from 'flarum/common/models/Post';\nimport extractText from 'flarum/common/utils/extractText';\nimport PollImage from './Poll/PollImage';\n\nexport interface PostPollAttrs extends ComponentAttrs {\n poll: Poll;\n post?: Post;\n}\n\nexport default class PostPoll extends Component {\n loadingOptions: boolean = false;\n useSubmitUI!: boolean;\n pendingSubmit: boolean = false;\n pendingOptions: any;\n\n oninit(vnode: Mithril.Vnode) {\n super.oninit(vnode);\n\n this.useSubmitUI = !this.attrs.poll?.canChangeVote() && this.attrs.poll?.allowMultipleVotes();\n this.pendingOptions = null;\n }\n\n oncreate(vnode: Mithril.Vnode) {\n super.oncreate(vnode);\n\n this.preventClose = this.preventClose.bind(this);\n window.addEventListener('beforeunload', this.preventClose);\n }\n\n onremove(vnode: Mithril.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
\n

{poll.question()}

\n {poll.subtitle() &&

{poll.subtitle()}

}\n
\n\n
\n {poll.canSeeVoters() && (\n \n
\n
\n\n {!!poll.imageUrl() && }\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: number) {\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: PollOption) {\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() ? {opt.answer()} : null}\n
\n );\n\n return (\n \n {canSeeVoteCount ? (\n \n {bar}\n \n ) : (\n bar\n )}\n
\n );\n }\n\n changeVote(option: PollOption, evt: Event) {\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(extractText(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: Mithril.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","import app from 'flarum/forum/app';\n\nimport { extend } from 'flarum/common/extend';\nimport CommentPost from 'flarum/forum/components/CommentPost';\nimport PollView from './components/PollView';\nimport DiscussionPage from 'flarum/forum/components/DiscussionPage';\nimport Poll from './models/Poll';\nimport PollOption from './models/PollOption';\nimport PostPoll from './components/PostPoll';\n\ninterface PusherPollDto {\n pollId: string;\n pollVoteCount: number;\n options: { [key: string]: number };\n}\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 // @ts-ignore\n if (app.pusher) {\n // @ts-ignore\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: PusherPollDto) => {\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 // @ts-ignore\n if (app.pusher) {\n // @ts-ignore\n app.pusher.then((binding) => {\n binding.channels.main.unbind('updatedPollOptions');\n });\n }\n });\n};\n","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['forum/utils/PostControls'];","import Component, { ComponentAttrs } from 'flarum/common/Component';\nimport Poll from '../models/Poll';\nimport type Mithril from 'mithril';\nimport PollView from './PollView';\n\nexport interface PollShowcaseItemAttrs extends ComponentAttrs {\n poll: Poll;\n}\n\nexport default class PollShowcaseItem extends Component {\n poll!: Poll;\n\n oninit(vnode: Mithril.Vnode) {\n super.oninit(vnode);\n\n this.poll = this.attrs.poll;\n }\n\n view() {\n return (\n
\n \n
\n );\n }\n}\n","import Component, { ComponentAttrs } from 'flarum/common/Component';\nimport PollListState from '../states/PollListState';\nimport type Mithril from 'mithril';\nimport ItemList from 'flarum/common/utils/ItemList';\nimport PollShowcaseItem from './PollShowcaseItem';\nimport Placeholder from 'flarum/common/components/Placeholder';\nimport app from 'flarum/forum/app';\n\nexport interface PollListAttrs extends ComponentAttrs {\n state: PollListState;\n}\n\nexport default class PollShowcase extends Component {\n oninit(vnode: Mithril.Vnode) {\n super.oninit(vnode);\n\n this.attrs.state.refresh();\n }\n\n view(): Mithril.Children {\n return (\n
\n
\n

{app.translator.trans('fof-polls.forum.showcase.active-polls')}

\n {this.showcaseItems().toArray()}\n {this.showcaseItems().toArray().length === 0 && }\n
\n
\n

{app.translator.trans('fof-polls.forum.showcase.ended-polls')}

\n {this.endedItems().toArray()}\n {this.endedItems().toArray().length === 0 && }\n
\n
\n );\n }\n\n showcaseItems(): ItemList {\n const items = new ItemList();\n\n this.attrs.state.getPages().map((page) => {\n page.items.map((poll) => {\n if (!poll.hasEnded()) {\n items.add('poll-active-' + poll.id(), );\n }\n });\n });\n\n return items;\n }\n\n endedItems(): ItemList {\n const items = new ItemList();\n\n this.attrs.state.getPages().map((page) => {\n page.items.map((poll) => {\n if (poll.hasEnded()) {\n items.add('poll-ended-' + poll.id(), );\n }\n });\n });\n\n return items;\n }\n}\n","import app from 'flarum/forum/app';\nimport { IPageAttrs } from 'flarum/common/components/Page';\nimport ItemList from 'flarum/common/utils/ItemList';\nimport Mithril from 'mithril';\nimport PollListState from '../states/PollListState';\nimport extractText from 'flarum/common/utils/extractText';\nimport Button from 'flarum/common/components/Button';\nimport LogInModal from 'flarum/forum/components/LogInModal';\nimport { AbstractPollPage } from './AbstractPollPage';\nimport PollShowcase from './PollShowcase';\n\nexport default class PollsShowcasePage extends AbstractPollPage {\n oninit(vnode: Mithril.Vnode) {\n super.oninit(vnode);\n\n if (!app.forum.attribute('globalPollsEnabled')) {\n m.route.set('/');\n return;\n }\n\n this.state = new PollListState({\n sort: m.route.param('sort'),\n filter: m.route.param('filter'),\n include: this.includeParams(),\n });\n\n this.state.refresh();\n\n app.setTitle(extractText(app.translator.trans('fof-polls.forum.page.nav')));\n }\n\n includeParams(): string[] {\n return ['options', 'votes', 'myVotes', 'myVotes.option'];\n }\n\n contentItems(): ItemList {\n const items = super.contentItems();\n\n if (!this.loading) {\n items.add('poll-showcase', );\n }\n\n return items;\n }\n\n sidebarItems(): ItemList {\n const items = super.sidebarItems();\n const canStartPoll = app.forum.attribute('canStartGlobalPolls');\n\n if (canStartPoll) {\n items.remove('newDiscussion');\n items.add(\n 'newGlobalPoll',\n {\n this.newPollAction();\n }}\n disabled={!canStartPoll}\n >\n {app.translator.trans(`fof-polls.forum.poll.${canStartPoll ? 'start_poll_button' : 'cannot_start_poll_button'}`)}\n ,\n 100\n );\n }\n\n return items;\n }\n\n newPollAction(): void {\n if (!app.session.user) {\n app.modal.show(LogInModal);\n return;\n }\n\n m.route.set(app.route('fof.polls.compose'));\n }\n}\n","import CreatePollModal from './CreatePollModal';\nimport PostPoll from './PostPoll';\nimport EditPollModal from './EditPollModal';\nimport ListVotersModal from './ListVotersModal';\nimport PollForm from './PollForm';\nimport ComposePollHero from './ComposePollHero';\nimport ComposePollPage from './ComposePollPage';\nimport PollsPage from './PollsPage';\nimport PollView from './PollView';\nimport PollViewPage from './PollViewPage';\nimport PollSubmitButton from './Poll/PollSubmitButton';\nimport PollOption from './Poll/PollOption';\nimport PollOptions from './Poll/PollOptions';\nimport PollsShowcasePage from './PollsShowcasePage';\nimport PollShowcase from './PollShowcase';\nimport PollShowcaseItem from './PollShowcaseItem';\nimport { AbstractPollPage } from './AbstractPollPage';\nimport PollTitle from './Poll/PollTitle';\nimport PollSubtitle from './Poll/PollSubtitle';\nimport PollImage from './Poll/PollImage';\nimport PollListItem from './Poll/PollListItem';\nimport PollList from './Poll/PollList';\n\nexport const components = {\n CreatePollModal,\n PostPoll,\n EditPollModal,\n ListVotersModal,\n PollForm,\n ComposePollHero,\n ComposePollPage,\n PollsPage,\n PollView,\n PollViewPage,\n PollSubmitButton,\n PollOption,\n PollOptions,\n PollsShowcasePage,\n PollShowcase,\n PollShowcaseItem,\n AbstractPollPage,\n PollTitle,\n PollSubtitle,\n PollImage,\n PollListItem,\n PollList,\n};\n","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/Model'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/utils/computed'];","import Model from 'flarum/common/Model';\nimport PollOption from './PollOption';\nimport PollVote from './PollVote';\nimport computed from 'flarum/common/utils/computed';\n\nexport default class Poll extends Model {\n public tempOptions: PollOption[] | undefined;\n\n question() {\n return Model.attribute('question').call(this);\n }\n\n subtitle() {\n return Model.attribute('subtitle').call(this);\n }\n\n image() {\n return Model.attribute('image').call(this);\n }\n\n imageUrl() {\n return Model.attribute('imageUrl').call(this);\n }\n\n imageAlt() {\n return Model.attribute('imageAlt').call(this);\n }\n\n isImageUpload() {\n return Model.attribute('isImageUpload').call(this);\n }\n\n hasEnded() {\n return Model.attribute('hasEnded').call(this);\n }\n\n endDate() {\n return Model.attribute('endDate', Model.transformDate).call(this);\n }\n\n publicPoll() {\n return Model.attribute('publicPoll').call(this);\n }\n\n hideVotes() {\n return Model.attribute('hideVotes').call(this);\n }\n\n allowChangeVote() {\n return Model.attribute('allowChangeVote').call(this);\n }\n\n allowMultipleVotes() {\n return Model.attribute('allowMultipleVotes').call(this);\n }\n\n maxVotes() {\n return Model.attribute('maxVotes').call(this);\n }\n\n voteCount() {\n return Model.attribute('voteCount').call(this);\n }\n\n canVote() {\n return Model.attribute('canVote').call(this);\n }\n\n canEdit() {\n return Model.attribute('canEdit').call(this);\n }\n\n canDelete() {\n return Model.attribute('canDelete').call(this);\n }\n\n canSeeVoters() {\n return Model.attribute('canSeeVoters').call(this);\n }\n\n canChangeVote() {\n return Model.attribute('canChangeVote').call(this);\n }\n\n options() {\n const options = Model.hasMany('options').call(this);\n return options ? (options as PollOption[]) : [];\n }\n\n votes() {\n return Model.hasMany('votes').call(this);\n }\n\n myVotes(): PollVote[] {\n const myVotes = Model.hasMany('myVotes').call(this);\n return myVotes ? (myVotes as PollVote[]) : [];\n }\n\n isGlobal() {\n return Model.attribute('isGlobal').call(this);\n }\n\n isHidden() {\n return computed('hiddenAt', (hiddenAt) => !!hiddenAt).call(this);\n }\n\n // TODO: These two don't make sense as of now\n isUnread() {\n return false;\n }\n\n apiEndpoint() {\n /** @ts-ignore */\n return `/fof/polls${this.exists ? `/${this.data.id}` : ''}`;\n }\n}\n","import Model from 'flarum/common/Model';\nimport Poll from './Poll';\nimport PollVote from './PollVote';\n\nexport default class PollOption extends Model {\n answer() {\n return Model.attribute('answer').call(this);\n }\n\n imageUrl() {\n return Model.attribute('imageUrl').call(this);\n }\n\n isImageUpload() {\n return Model.attribute('isImageUpload').call(this);\n }\n\n voteCount() {\n return Model.attribute('voteCount').call(this);\n }\n\n poll() {\n return Model.hasOne('polls').call(this);\n }\n\n votes() {\n return Model.hasMany('votes').call(this);\n }\n\n apiEndpoint() {\n /** @ts-ignore */\n return `/fof/polls/answers${this.exists ? `/${this.data.id}` : ''}`;\n }\n}\n","import Model from 'flarum/common/Model';\nimport Poll from './Poll';\nimport PollOption from './PollOption';\nimport User from 'flarum/common/models/User';\n\nexport default class PollVote extends Model {\n poll() {\n return Model.hasOne('poll').call(this);\n }\n\n option() {\n const result = Model.hasOne('option').call(this);\n return result === false ? null : result;\n }\n\n user() {\n return Model.hasOne('user').call(this);\n }\n\n pollId() {\n return Model.attribute('pollId').call(this);\n }\n\n optionId() {\n return Model.attribute('optionId').call(this);\n }\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","import PollFormState from './PollFormState';\nimport PollListState from './PollListState';\nimport PollState from './PollState';\n\nexport const states = {\n PollFormState,\n PollListState,\n PollState,\n};\n","import PollControls from './PollControls';\n\nexport const utils = {\n PollControls,\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';\nimport PollsPage from './components/PollsPage';\nimport ComposePollPage from './components/ComposePollPage';\nimport PollViewPage from './components/PollViewPage';\nimport PollsShowcasePage from './components/PollsShowcasePage';\n\nexport default [\n new Extend.Routes() //\n .add('fof.polls.showcase', '/polls', PollsShowcasePage)\n .add('fof.polls.list', '/polls/all', PollsPage)\n .add('fof.polls.view', '/polls/view/:id', PollViewPage)\n .add('fof.polls.compose', '/polls/composer', ComposePollPage),\n\n new Extend.Store() //\n .add('polls', Poll)\n .add('poll_options', PollOption)\n .add('poll_votes', PollVote),\n\n new Extend.Model(Post) //\n .hasMany('polls')\n .attribute('canStartPoll'),\n\n new Extend.Model(Forum) //\n .attribute('canStartPolls'),\n\n new Extend.Model(Discussion) //\n .attribute('hasPoll')\n .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';\nimport addNavItem from './addNavItem';\n\nexport * from './components';\nexport * from './models';\nexport * from './states';\nexport * from './utils';\n\napp.initializers.add('fof/polls', () => {\n addDiscussionBadge();\n addComposerItems();\n addPollsToPost();\n addPostControls();\n addNavItem();\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';\nimport Post from 'flarum/common/models/Post';\nimport PollModelAttributes from './models/PollModelAttributes';\n\nexport default () => {\n const createPoll = (post: Post) =>\n app.modal.show(CreatePollModal, {\n onsubmit: (data: PollModelAttributes) =>\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 // @ts-ignore\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 // @ts-ignore\n if (!post.isHidden() && post.canStartPoll()) {\n items.add(\n 'addPoll',\n \n );\n }\n });\n};\n","import app from 'flarum/forum/app';\nimport { extend } from 'flarum/common/extend';\nimport IndexPage from 'flarum/forum/components/IndexPage';\nimport LinkButton from 'flarum/common/components/LinkButton';\n\nexport default function addNavItem() {\n extend(IndexPage.prototype, 'navItems', (items) => {\n if (!app.forum.attribute('globalPollsEnabled')) {\n return;\n }\n\n items.add(\n 'fof-polls-showcase',\n LinkButton.component(\n {\n href: app.route('fof.polls.showcase'),\n icon: 'fas fa-poll',\n },\n app.translator.trans('fof-polls.forum.page.nav')\n ),\n 35\n );\n\n const showAllGlobalPolls = app.forum.attribute('canStartGlobalPolls');\n\n if (showAllGlobalPolls) {\n items.add(\n 'fof-polls-list',\n LinkButton.component(\n {\n href: app.route('fof.polls.list'),\n icon: 'fas fa-list',\n },\n app.translator.trans('fof-polls.forum.page.nav-all')\n ),\n 32\n );\n }\n });\n}\n"],"names":["_typeof","require","_regeneratorRuntime","module","exports","e","__esModule","t","r","Object","prototype","n","hasOwnProperty","o","defineProperty","value","i","Symbol","a","iterator","c","asyncIterator","u","toStringTag","define","enumerable","configurable","writable","wrap","Generator","create","Context","makeInvokeMethod","tryCatch","type","arg","call","h","l","f","s","y","GeneratorFunction","GeneratorFunctionPrototype","p","this","d","getPrototypeOf","v","values","g","defineIteratorMethods","forEach","_invoke","AsyncIterator","invoke","resolve","__await","then","callInvokeWithMethodAndArg","Error","done","method","delegate","maybeInvokeDelegate","sent","_sent","dispatchException","abrupt","TypeError","resultName","next","nextLoc","pushTryEntry","tryLoc","catchLoc","finallyLoc","afterLoc","tryEntries","push","resetTryEntry","completion","reset","isNaN","length","displayName","isGeneratorFunction","constructor","name","mark","setPrototypeOf","__proto__","awrap","async","Promise","keys","reverse","pop","prev","charAt","slice","stop","rval","handle","complete","finish","delegateYield","runtime","regeneratorRuntime","accidentalStrictMode","globalThis","Function","__webpack_module_cache__","__webpack_require__","moduleId","cachedModule","undefined","__webpack_modules__","getter","definition","key","get","obj","prop","flarum","core","compat","asyncGeneratorStep","_asyncToGenerator","arguments","apply","_next","_throw","_setPrototypeOf","bind","_inheritsLoose","_getPrototypeOf","_isNativeReflectConstruct","Boolean","valueOf","Reflect","construct","_wrapNativeSuper","Map","toString","indexOf","isNativeFunction","has","set","Wrapper","isNativeReflectConstruct","FormError","_Error","props","PollFormState","poll","loading","deleting","expandedGroup","createNewPoll","app","createRecord","pushAttributes","question","endDate","publicPoll","allowMultipleVotes","hideVotes","allowChangeVote","maxVotes","tempOptions","_proto","isExpanded","groupKey","expand","m","redraw","save","_save","_callee","data","_context","attributes","options","_x","_delete2","_callee2","_context2","ComposePollHero","_Component","_this","_len","args","Array","_key","concat","oninit","vnode","attrs","view","className","trans","id","controlItems","toArray","items","ItemList","add","LinkButton","icon","itemClassName","href","exists","Component","ComposePollPage","_Page","_this2","attribute","bodyClass","editId","route","param","loadEditingPoll","_this2$poll","_this2$poll2","canEdit","_loadEditingPoll","alreadyLoaded","getById","find","LoadingIndicator","listItems","sidebarItems","PollForm","onsubmit","_onsubmit","state","isNew","alertAttrs","alertId","controls","Button","onclick","show","setTimeout","dismiss","_x2","_x3","SelectDropdown","buttonClassName","accessibleToggleLabel","navItems","IndexPage","Page","PollOption","option","hasVoted","totalVotes","votes","voted","canSeeVoteCount","answer","percent","Math","round","_this$poll$myVotes","overallVoteCount","voteCount","hasVotedFor","isDisabled","loadingOptions","canChangeVote","width","Number","myVotes","bar","style","showCheckMarks","checked","disabled","onchange","changeVote","optionDisplayItems","imageUrl","src","alt","classList","Tooltip","text","count","onremove","hideOptionTooltip","tooltipVisible","updateVisibility","PollOptions","pollOptions","createOptionView","PollImage","imageAlt","imageItems","_this$imageAlt","ListVotersModal","_Modal","include","title","content","map","optionContent","opt","filter","optionAnswer","voteContent","vote","user","Link","avatar","username","Modal","PollState","pendingSubmit","pendingOptions","useSubmitUI","showVoters","hasEnded","canVote","init","isShowResult","some","getMaxVotes","showButton","evt","target","LogInModal","optionIds","Set","isUnvoting","clear","size","submit","hasSelectedOptions","cb","onerror","_this3","url","body","from","res","pushPayload","err","PollSubmitButton","event","pollButtonSubmit","PollTitle","pollTitleItems","PollSubtitle","subtitle","pollSubtitleItems","PollView","preventClose","preventDefault","oncreate","window","addEventListener","removeEventListener","PollControls","controlsView","createMainView","createPollHeader","createPollContent","createPollFooter","createFormItems","infoItems","isEmpty","questionSlug","slug","Dropdown","menuClassName","class","time","dayjs","fromNow","max","toPropertyKey","toPrimitive","String","_defineProperties","_createClass","PollPageHero","wrapperClasses","classNames","Hero","AbstractPollPage","polls","pageContent","hero","mainContent","sidebar","contentItems","IndexPageHero","setContent","remove","toObject","startsWith","PollViewPage","_AbstractPollPage","item","PollListItem","subtree","highlightRegExp","SubtreeRetainer","freshness","markedAllAsReadAt","getTime","active","elementAttrs","isHidden","Slidable","contentView","slidableUnderneathView","isUnread","markAsRead","mainView","highlight","pollQuestion","pollSubtitle","slidableInstance","slidable","element","$","on","onbeforeupdate","needsRebuild","matches","lastVotedNumber","activeView","abbreviateNumber","PollList","params","getParams","isLoading","isInitialLoading","isLoadingNext","hasNext","loadNext","Placeholder","isSearchResults","getPages","pg","globalEventEmitter","EventEmitter","PollListState","_PaginatedListState","page","extraPolls","eventEmitter","deletePoll","requestParams","_this$params$sort","requestIncludes","sort","sortMap","q","includes","standard","join","loadPage","preloadedPolls","initialLoading","relevance","newest","oldest","removePoll","emit","_step","_iterator","_createForOfIteratorHelperLoose","pages","index","splice","addPoll","unshift","getAllItems","number","PaginatedListState","PollsPage","refresh","extractText","viewItems","actionItems","canStartPoll","newPollAction","context","section","itemName","Separator","pollControls","moderationControls","editAction","destructiveControls","canDelete","deleteAction","confirm","showDeletionAlert","back","location","reload","message","success","error","_extends","assign","UploadPollImageButton","_Button","uploadedImageUrl","fileName","$input","getImageUrl","canUpload","children","upload","appendTo","hide","trigger","FormData","append","files","resourceUrl","serialize","raw","failure","_this$attrs$poll","_this$attrs$option","_this3$attrs$poll","_this3$attrs$option","image","isImageUpload","_this$attrs$poll2","_this$attrs$option2","response","_this$attrs$onUpload","_this$attrs","_this$$input","fileUrl","onUpload","_this$$input2","optionAnswers","optionImageUrls","datepickerMinDate","_poll$tempOptions","Stream","formatDate","isAfter","fields","_this$state$poll","bidi","hasImage","uploadConditional","'['","pollImageUploadSuccess","placeholder","required","displayOptions","addOption","min","isBefore","Switch","imgFunc","pollOptionImageUploadSuccess","removeOption","alert","_this$dateToTimestamp","pollExists","pollImage","dateToTimestamp","t0","RequestError","console","date","def","dayjsDate","isValid","format","isUpload","ifCanUpload","uploadButton","imageUrlInput","_this$state$poll2","canUploadNow","CreatePollModal","onFormSubmit","_onFormSubmit","toPoll","pollOption","addToComposer","composer","extend","_this$composer$body","_discussion$canStartP","discussion","canStartPolls","EditPollModal","_CreatePollModal","PostPoll","canSeeVoters","viewOption","_poll$myVotes","_poll$myVotes2","_poll$myVotes3","_poll$myVotes4","showCheckmark","_this$attrs$poll$myVo","_this$attrs$poll$myVo2","post","sync","PollShowcaseItem","PollShowcase","showcaseItems","endedItems","PollsShowcasePage","includeParams","components","Poll","_Model","Model","isGlobal","computed","hiddenAt","apiEndpoint","PollVote","result","pollId","optionId","models","states","utils","Extend","Post","hasMany","Forum","Discussion","createPoll","DiscussionList","badges","hasPoll","Badge","label","DiscussionComposer","ReplyComposer","CommentPost","revealContent","check","checks","_poll$data","_poll$options$map","_poll$options","_poll$myVotes$map","_option$data","_vote$option","JSON","stringify","DiscussionPage","binding","channels","main","changedOptions","unbind","relationships","_post$rawRelationship","rawRelationship","PostControls"],"sourceRoot":""} \ No newline at end of file