From 2806eb7546124b695074dab1cd8349d5ab71da07 Mon Sep 17 00:00:00 2001 From: IanM Date: Wed, 27 Mar 2024 21:51:34 +0000 Subject: [PATCH] build js --- js/dist/admin.js | 168 +- js/dist/admin.js.map | 2 +- js/dist/forum.js | 5497 +----------------------------------------- js/dist/forum.js.map | 2 +- 4 files changed, 5 insertions(+), 5664 deletions(-) diff --git a/js/dist/admin.js b/js/dist/admin.js index 9080c8a0..d0bae3d1 100644 --- a/js/dist/admin.js +++ b/js/dist/admin.js @@ -1,168 +1,2 @@ -/******/ (() => { // webpackBootstrap -/******/ // runtime can't be in strict mode because a global variable is assign and maybe created. -/******/ var __webpack_modules__ = ({ - -/***/ "./src/admin/index.ts": -/*!****************************!*\ - !*** ./src/admin/index.ts ***! - \****************************/ -/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony import */ var flarum_admin_app__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! flarum/admin/app */ "flarum/admin/app"); -/* harmony import */ var flarum_admin_app__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(flarum_admin_app__WEBPACK_IMPORTED_MODULE_0__); - -flarum_admin_app__WEBPACK_IMPORTED_MODULE_0___default().initializers.add('fof/polls', function () { - flarum_admin_app__WEBPACK_IMPORTED_MODULE_0___default().extensionData["for"]('fof-polls').registerSetting({ - setting: 'fof-polls.allowOptionImage', - type: 'switch', - label: flarum_admin_app__WEBPACK_IMPORTED_MODULE_0___default().translator.trans('fof-polls.admin.settings.allow_option_image') - }).registerSetting({ - setting: 'fof-polls.optionsColorBlend', - type: 'switch', - label: flarum_admin_app__WEBPACK_IMPORTED_MODULE_0___default().translator.trans('fof-polls.admin.settings.options_color_blend'), - help: flarum_admin_app__WEBPACK_IMPORTED_MODULE_0___default().translator.trans('fof-polls.admin.settings.options_color_blend_help') - }).registerSetting({ - setting: 'fof-polls.maxOptions', - type: 'number', - label: flarum_admin_app__WEBPACK_IMPORTED_MODULE_0___default().translator.trans('fof-polls.admin.settings.max_options'), - min: 2 - }).registerSetting({ - setting: 'fof-polls.enableGlobalPolls', - type: 'boolean', - label: flarum_admin_app__WEBPACK_IMPORTED_MODULE_0___default().translator.trans('fof-polls.admin.settings.enable_global_polls'), - help: flarum_admin_app__WEBPACK_IMPORTED_MODULE_0___default().translator.trans('fof-polls.admin.settings.enable_global_polls_help') - }).registerPermission({ - icon: 'fas fa-poll', - label: flarum_admin_app__WEBPACK_IMPORTED_MODULE_0___default().translator.trans('fof-polls.admin.permissions.view_results_without_voting'), - permission: 'discussion.polls.viewResultsWithoutVoting', - allowGuest: true - }, 'view').registerPermission({ - icon: 'fas fa-poll', - label: flarum_admin_app__WEBPACK_IMPORTED_MODULE_0___default().translator.trans('fof-polls.admin.permissions.start'), - permission: 'discussion.polls.start' - }, 'start').registerPermission({ - icon: 'fas fa-poll', - label: flarum_admin_app__WEBPACK_IMPORTED_MODULE_0___default().translator.trans('fof-polls.admin.permissions.start_global'), - permission: 'startGlobalPoll' - }, 'start').registerPermission({ - icon: 'fas fa-pencil-alt', - label: flarum_admin_app__WEBPACK_IMPORTED_MODULE_0___default().translator.trans('fof-polls.admin.permissions.self_edit'), - permission: 'polls.selfEdit' - }, 'start').registerPermission({ - icon: 'fas fa-pencil-alt', - label: flarum_admin_app__WEBPACK_IMPORTED_MODULE_0___default().translator.trans('fof-polls.admin.permissions.self_post_edit'), - permission: 'polls.selfPostEdit' - }, 'start').registerPermission({ - icon: 'fas fa-poll', - label: flarum_admin_app__WEBPACK_IMPORTED_MODULE_0___default().translator.trans('fof-polls.admin.permissions.vote'), - permission: 'discussion.polls.vote' - }, 'reply').registerPermission({ - icon: 'fas fa-poll', - label: flarum_admin_app__WEBPACK_IMPORTED_MODULE_0___default().translator.trans('fof-polls.admin.permissions.change_vote'), - permission: 'polls.changeVote' - }, 'reply').registerPermission({ - icon: 'fas fa-pencil-alt', - label: flarum_admin_app__WEBPACK_IMPORTED_MODULE_0___default().translator.trans('fof-polls.admin.permissions.moderate'), - permission: 'discussion.polls.moderate' - }, 'moderate'); -}); - -/***/ }), - -/***/ "flarum/admin/app": -/*!**************************************************!*\ - !*** external "flarum.core.compat['admin/app']" ***! - \**************************************************/ -/***/ ((module) => { - -"use strict"; -module.exports = flarum.core.compat['admin/app']; - -/***/ }) - -/******/ }); -/************************************************************************/ -/******/ // The module cache -/******/ var __webpack_module_cache__ = {}; -/******/ -/******/ // The require function -/******/ function __webpack_require__(moduleId) { -/******/ // Check if module is in cache -/******/ var cachedModule = __webpack_module_cache__[moduleId]; -/******/ if (cachedModule !== undefined) { -/******/ return cachedModule.exports; -/******/ } -/******/ // Create a new module (and put it into the cache) -/******/ var module = __webpack_module_cache__[moduleId] = { -/******/ // no module.id needed -/******/ // no module.loaded needed -/******/ exports: {} -/******/ }; -/******/ -/******/ // Execute the module function -/******/ __webpack_modules__[moduleId](module, module.exports, __webpack_require__); -/******/ -/******/ // Return the exports of the module -/******/ return module.exports; -/******/ } -/******/ -/************************************************************************/ -/******/ /* webpack/runtime/compat get default export */ -/******/ (() => { -/******/ // getDefaultExport function for compatibility with non-harmony modules -/******/ __webpack_require__.n = (module) => { -/******/ var getter = module && module.__esModule ? -/******/ () => (module['default']) : -/******/ () => (module); -/******/ __webpack_require__.d(getter, { a: getter }); -/******/ return getter; -/******/ }; -/******/ })(); -/******/ -/******/ /* webpack/runtime/define property getters */ -/******/ (() => { -/******/ // define getter functions for harmony exports -/******/ __webpack_require__.d = (exports, definition) => { -/******/ for(var key in definition) { -/******/ if(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) { -/******/ Object.defineProperty(exports, key, { enumerable: true, get: definition[key] }); -/******/ } -/******/ } -/******/ }; -/******/ })(); -/******/ -/******/ /* webpack/runtime/hasOwnProperty shorthand */ -/******/ (() => { -/******/ __webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop)) -/******/ })(); -/******/ -/******/ /* webpack/runtime/make namespace object */ -/******/ (() => { -/******/ // define __esModule on exports -/******/ __webpack_require__.r = (exports) => { -/******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) { -/******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); -/******/ } -/******/ Object.defineProperty(exports, '__esModule', { value: true }); -/******/ }; -/******/ })(); -/******/ -/************************************************************************/ -var __webpack_exports__ = {}; -// This entry need to be wrapped in an IIFE because it need to be in strict mode. -(() => { -"use strict"; -/*!******************!*\ - !*** ./admin.ts ***! - \******************/ -__webpack_require__.r(__webpack_exports__); -/* harmony import */ var _src_admin__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./src/admin */ "./src/admin/index.ts"); - -})(); - -module.exports = __webpack_exports__; -/******/ })() -; +(()=>{var s={n:t=>{var e=t&&t.__esModule?()=>t.default:()=>t;return s.d(e,{a:e}),e},d:(t,e)=>{for(var o in e)s.o(e,o)&&!s.o(t,o)&&Object.defineProperty(t,o,{enumerable:!0,get:e[o]})},o:(s,t)=>Object.prototype.hasOwnProperty.call(s,t),r:s=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(s,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(s,"__esModule",{value:!0})}},t={};(()=>{"use strict";s.r(t);const e=flarum.core.compat["admin/app"];var o=s.n(e);o().initializers.add("fof/polls",(function(){o().extensionData.for("fof-polls").registerSetting({setting:"fof-polls.allowOptionImage",type:"switch",label:o().translator.trans("fof-polls.admin.settings.allow_option_image")}).registerSetting({setting:"fof-polls.optionsColorBlend",type:"switch",label:o().translator.trans("fof-polls.admin.settings.options_color_blend"),help:o().translator.trans("fof-polls.admin.settings.options_color_blend_help")}).registerSetting({setting:"fof-polls.maxOptions",type:"number",label:o().translator.trans("fof-polls.admin.settings.max_options"),min:2}).registerSetting({setting:"fof-polls.enableGlobalPolls",type:"boolean",label:o().translator.trans("fof-polls.admin.settings.enable_global_polls"),help:o().translator.trans("fof-polls.admin.settings.enable_global_polls_help")}).registerSetting({setting:"fof-polls.image_height",type:"number",label:o().translator.trans("fof-polls.admin.settings.image_height")}).registerSetting({setting:"fof-polls.image_width",type:"number",label:o().translator.trans("fof-polls.admin.settings.image_width")}).registerPermission({icon:"fas fa-poll",label:o().translator.trans("fof-polls.admin.permissions.view_results_without_voting"),permission:"discussion.polls.viewResultsWithoutVoting",allowGuest:!0},"view").registerPermission({icon:"fas fa-poll",label:o().translator.trans("fof-polls.admin.permissions.start"),permission:"discussion.polls.start"},"start").registerPermission({icon:"fas fa-poll",label:o().translator.trans("fof-polls.admin.permissions.start_global"),permission:"startGlobalPoll"},"start").registerPermission({icon:"fas fa-pencil-alt",label:o().translator.trans("fof-polls.admin.permissions.self_edit"),permission:"polls.selfEdit"},"start").registerPermission({icon:"fas fa-pencil-alt",label:o().translator.trans("fof-polls.admin.permissions.self_post_edit"),permission:"polls.selfPostEdit"},"start").registerPermission({icon:"fas fa-poll",label:o().translator.trans("fof-polls.admin.permissions.vote"),permission:"discussion.polls.vote"},"reply").registerPermission({icon:"fas fa-poll",label:o().translator.trans("fof-polls.admin.permissions.change_vote"),permission:"polls.changeVote"},"reply").registerPermission({icon:"fas fa-pencil-alt",label:o().translator.trans("fof-polls.admin.permissions.moderate"),permission:"discussion.polls.moderate"},"moderate")}))})(),module.exports=t})(); //# sourceMappingURL=admin.js.map \ No newline at end of file diff --git a/js/dist/admin.js.map b/js/dist/admin.js.map index 60677d75..a63b2479 100644 --- a/js/dist/admin.js.map +++ b/js/dist/admin.js.map @@ -1 +1 @@ -{"version":3,"file":"admin.js","mappings":";;;;;;;;;;;;;;AAAmC;AAEnCA,oEAAgB,CAACE,GAAG,CAAC,WAAW,EAAE,YAAM;EACtCF,qEAAiB,OACX,CAAC,WAAW,CAAC,CAChBI,eAAe,CAAC;IACfC,OAAO,EAAE,4BAA4B;IACrCC,IAAI,EAAE,QAAQ;IACdC,KAAK,EAAEP,kEAAc,CAACS,KAAK,CAAC,6CAA6C;EAC3E,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ACjB;IACEC,IAAI,EAAE,mBAAmB;IACzBN,KAAK,EAAEP,kEAAc,CAACS,KAAK,CAAC,4CAA4C,CAAC;IACzEK,UAAU,EAAE;EACd,CAAC,EACD,OACF,CAAC,CACAF,kBAAkB,CACjB;IACEC,IAAI,EAAE,aAAa;IACnBN,KAAK,EAAEP,kEAAc,CAACS,KAAK,CAAC,kCAAkC,CAAC;IAC/DK,UAAU,EAAE;EACd,CAAC,EACD,OACF,CAAC,CACAF,kBAAkB,CACjB;IACEC,IAAI,EAAE,aAAa;IACnBN,KAAK,EAAEP,kEAAc,CAACS,KAAK,CAAC,yCAAyC,CAAC;IACtEK,UAAU,EAAE;EACd,CAAC,EACD,OACF,CAAC,CACAF,kBAAkB,CACjB;IACEC,IAAI,EAAE,mBAAmB;IACzBN,KAAK,EAAEP,kEAAc,CAACS,KAAK,CAAC,sCAAsC,CAAC;IACnEK,UAAU,EAAE;EACd,CAAC,EACD,UACF,CAAC;AACL,CAAC,CAAC;;;;;;;;;;;AC7FF;;;;;;UCAA;UACA;;UAEA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;;UAEA;UACA;;UAEA;UACA;UACA;;;;;WCtBA;WACA;WACA;WACA;WACA;WACA,iCAAiC,WAAW;WAC5C;WACA;;;;;WCPA;WACA;WACA;WACA;WACA,yCAAyC,wCAAwC;WACjF;WACA;WACA;;;;;WCPA;;;;;WCAA;WACA;WACA;WACA,uDAAuD,iBAAiB;WACxE;WACA,gDAAgD,aAAa;WAC7D","sources":["webpack://@fof/polls/./src/admin/index.ts","webpack://@fof/polls/external root \"flarum.core.compat['admin/app']\"","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/./admin.ts"],"sourcesContent":["import app from 'flarum/admin/app';\n\napp.initializers.add('fof/polls', () => {\n app.extensionData\n .for('fof-polls')\n .registerSetting({\n setting: 'fof-polls.allowOptionImage',\n type: 'switch',\n label: app.translator.trans('fof-polls.admin.settings.allow_option_image'),\n })\n .registerSetting({\n setting: 'fof-polls.optionsColorBlend',\n type: 'switch',\n label: app.translator.trans('fof-polls.admin.settings.options_color_blend'),\n help: app.translator.trans('fof-polls.admin.settings.options_color_blend_help'),\n })\n .registerSetting({\n setting: 'fof-polls.maxOptions',\n type: 'number',\n label: app.translator.trans('fof-polls.admin.settings.max_options'),\n min: 2,\n })\n .registerSetting({\n setting: 'fof-polls.enableGlobalPolls',\n type: 'boolean',\n label: app.translator.trans('fof-polls.admin.settings.enable_global_polls'),\n help: app.translator.trans('fof-polls.admin.settings.enable_global_polls_help'),\n })\n .registerPermission(\n {\n icon: 'fas fa-poll',\n label: app.translator.trans('fof-polls.admin.permissions.view_results_without_voting'),\n permission: 'discussion.polls.viewResultsWithoutVoting',\n allowGuest: true,\n },\n 'view'\n )\n .registerPermission(\n {\n icon: 'fas fa-poll',\n label: app.translator.trans('fof-polls.admin.permissions.start'),\n permission: 'discussion.polls.start',\n },\n 'start'\n )\n .registerPermission(\n {\n icon: 'fas fa-poll',\n label: app.translator.trans('fof-polls.admin.permissions.start_global'),\n permission: 'startGlobalPoll',\n },\n 'start'\n )\n .registerPermission(\n {\n icon: 'fas fa-pencil-alt',\n label: app.translator.trans('fof-polls.admin.permissions.self_edit'),\n permission: 'polls.selfEdit',\n },\n 'start'\n )\n .registerPermission(\n {\n icon: 'fas fa-pencil-alt',\n label: app.translator.trans('fof-polls.admin.permissions.self_post_edit'),\n permission: 'polls.selfPostEdit',\n },\n 'start'\n )\n .registerPermission(\n {\n icon: 'fas fa-poll',\n label: app.translator.trans('fof-polls.admin.permissions.vote'),\n permission: 'discussion.polls.vote',\n },\n 'reply'\n )\n .registerPermission(\n {\n icon: 'fas fa-poll',\n label: app.translator.trans('fof-polls.admin.permissions.change_vote'),\n permission: 'polls.changeVote',\n },\n 'reply'\n )\n .registerPermission(\n {\n icon: 'fas fa-pencil-alt',\n label: app.translator.trans('fof-polls.admin.permissions.moderate'),\n permission: 'discussion.polls.moderate',\n },\n 'moderate'\n );\n});\n","module.exports = flarum.core.compat['admin/app'];","// 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};","export * from './src/admin';\n"],"names":["app","initializers","add","extensionData","registerSetting","setting","type","label","translator","trans","help","min","registerPermission","icon","permission","allowGuest"],"sourceRoot":""} \ No newline at end of file +{"version":3,"file":"admin.js","mappings":"MACA,IAAIA,EAAsB,CCA1BA,EAAyBC,IACxB,IA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OL,IAAAA,WAAeM,MAAM,2DAC5BK,WAAY,4CACZC,YAAY,GAEd,QAEDH,mBACC,CACEC,KAAM,cACNL,MAAOL,IAAAA,WAAeM,MAAM,qCAC5BK,WAAY,0BAEd,SAEDF,mBACC,CACEC,KAAM,cACNL,MAAOL,IAAAA,WAAeM,MAAM,4CAC5BK,WAAY,mBAEd,SAEDF,mBACC,CACEC,KAAM,oBACNL,MAAOL,IAAAA,WAAeM,MAAM,yCAC5BK,WAAY,kBAEd,SAEDF,mBACC,CACEC,KAAM,oBACNL,MAAOL,IAAAA,WAAeM,MAAM,8CAC5BK,WAAY,sBAEd,SAEDF,mBACC,CACEC,KAAM,cACNL,MAAOL,IAAAA,WAAeM,MAAM,oCAC5BK,WAAY,yBAEd,SAEDF,mBACC,CACEC,KAAM,cACNL,MAAOL,IAAAA,WAAeM,MAAM,2CAC5BK,WAAY,oBAEd,SAEDF,mBACC,CACEC,KAAM,oBACNL,MAAOL,IAAAA,WAAeM,MAAM,wCAC5BK,WAAY,6BAEd,WAEN,G","sources":["webpack://@fof/polls/webpack/bootstrap","webpack://@fof/polls/webpack/runtime/compat get default export","webpack://@fof/polls/webpack/runtime/define property getters","webpack://@fof/polls/webpack/runtime/hasOwnProperty shorthand","webpack://@fof/polls/webpack/runtime/make namespace object","webpack://@fof/polls/external root \"flarum.core.compat['admin/app']\"","webpack://@fof/polls/./src/admin/index.ts"],"sourcesContent":["// The require scope\nvar __webpack_require__ = {};\n\n","// getDefaultExport function for compatibility with non-harmony modules\n__webpack_require__.n = (module) => {\n\tvar getter = module && module.__esModule ?\n\t\t() => (module['default']) :\n\t\t() => (module);\n\t__webpack_require__.d(getter, { a: getter });\n\treturn getter;\n};","// define getter functions for harmony exports\n__webpack_require__.d = (exports, definition) => {\n\tfor(var key in definition) {\n\t\tif(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {\n\t\t\tObject.defineProperty(exports, key, { enumerable: true, get: definition[key] });\n\t\t}\n\t}\n};","__webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))","// define __esModule on exports\n__webpack_require__.r = (exports) => {\n\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n\t}\n\tObject.defineProperty(exports, '__esModule', { value: true });\n};","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['admin/app'];","import app from 'flarum/admin/app';\n\napp.initializers.add('fof/polls', () => {\n app.extensionData\n .for('fof-polls')\n .registerSetting({\n setting: 'fof-polls.allowOptionImage',\n type: 'switch',\n label: app.translator.trans('fof-polls.admin.settings.allow_option_image'),\n })\n .registerSetting({\n setting: 'fof-polls.optionsColorBlend',\n type: 'switch',\n label: app.translator.trans('fof-polls.admin.settings.options_color_blend'),\n help: app.translator.trans('fof-polls.admin.settings.options_color_blend_help'),\n })\n .registerSetting({\n setting: 'fof-polls.maxOptions',\n type: 'number',\n label: app.translator.trans('fof-polls.admin.settings.max_options'),\n min: 2,\n })\n .registerSetting({\n setting: 'fof-polls.enableGlobalPolls',\n type: 'boolean',\n label: app.translator.trans('fof-polls.admin.settings.enable_global_polls'),\n help: app.translator.trans('fof-polls.admin.settings.enable_global_polls_help'),\n })\n .registerSetting({\n setting: 'fof-polls.image_height',\n type: 'number',\n label: app.translator.trans('fof-polls.admin.settings.image_height'),\n })\n .registerSetting({\n setting: 'fof-polls.image_width',\n type: 'number',\n label: app.translator.trans('fof-polls.admin.settings.image_width'),\n })\n .registerPermission(\n {\n icon: 'fas fa-poll',\n label: app.translator.trans('fof-polls.admin.permissions.view_results_without_voting'),\n permission: 'discussion.polls.viewResultsWithoutVoting',\n allowGuest: true,\n },\n 'view'\n )\n .registerPermission(\n {\n icon: 'fas fa-poll',\n label: app.translator.trans('fof-polls.admin.permissions.start'),\n permission: 'discussion.polls.start',\n },\n 'start'\n )\n .registerPermission(\n {\n icon: 'fas fa-poll',\n label: app.translator.trans('fof-polls.admin.permissions.start_global'),\n permission: 'startGlobalPoll',\n },\n 'start'\n )\n .registerPermission(\n {\n icon: 'fas fa-pencil-alt',\n label: app.translator.trans('fof-polls.admin.permissions.self_edit'),\n permission: 'polls.selfEdit',\n },\n 'start'\n )\n .registerPermission(\n {\n icon: 'fas fa-pencil-alt',\n label: app.translator.trans('fof-polls.admin.permissions.self_post_edit'),\n permission: 'polls.selfPostEdit',\n },\n 'start'\n )\n .registerPermission(\n {\n icon: 'fas fa-poll',\n label: app.translator.trans('fof-polls.admin.permissions.vote'),\n permission: 'discussion.polls.vote',\n },\n 'reply'\n )\n .registerPermission(\n {\n icon: 'fas fa-poll',\n label: app.translator.trans('fof-polls.admin.permissions.change_vote'),\n permission: 'polls.changeVote',\n },\n 'reply'\n )\n .registerPermission(\n {\n icon: 'fas fa-pencil-alt',\n label: app.translator.trans('fof-polls.admin.permissions.moderate'),\n permission: 'discussion.polls.moderate',\n },\n 'moderate'\n );\n});\n"],"names":["__webpack_require__","module","getter","__esModule","d","a","exports","definition","key","o","Object","defineProperty","enumerable","get","obj","prop","prototype","hasOwnProperty","call","Symbol","toStringTag","value","flarum","core","compat","app","add","registerSetting","setting","type","label","trans","help","min","registerPermission","icon","permission","allowGuest"],"sourceRoot":""} \ No newline at end of file diff --git a/js/dist/forum.js b/js/dist/forum.js index fe77aea5..cd685ef7 100644 --- a/js/dist/forum.js +++ b/js/dist/forum.js @@ -1,5496 +1,3 @@ -/******/ (() => { // webpackBootstrap -/******/ var __webpack_modules__ = ({ - -/***/ "./src/forum/addComposerItems.tsx": -/*!****************************************!*\ - !*** ./src/forum/addComposerItems.tsx ***! - \****************************************/ -/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export */ __webpack_require__.d(__webpack_exports__, { -/* harmony export */ addToComposer: () => (/* binding */ addToComposer), -/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) -/* harmony export */ }); -/* harmony import */ var flarum_forum_app__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! flarum/forum/app */ "flarum/forum/app"); -/* harmony import */ var flarum_forum_app__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(flarum_forum_app__WEBPACK_IMPORTED_MODULE_0__); -/* harmony import */ var flarum_common_extend__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! flarum/common/extend */ "flarum/common/extend"); -/* harmony import */ var flarum_common_extend__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(flarum_common_extend__WEBPACK_IMPORTED_MODULE_1__); -/* harmony import */ var flarum_common_utils_classList__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! flarum/common/utils/classList */ "flarum/common/utils/classList"); -/* harmony import */ var flarum_common_utils_classList__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(flarum_common_utils_classList__WEBPACK_IMPORTED_MODULE_2__); -/* harmony import */ var flarum_forum_components_DiscussionComposer__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! flarum/forum/components/DiscussionComposer */ "flarum/forum/components/DiscussionComposer"); -/* harmony import */ var flarum_forum_components_DiscussionComposer__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(flarum_forum_components_DiscussionComposer__WEBPACK_IMPORTED_MODULE_3__); -/* harmony import */ var flarum_forum_components_ReplyComposer__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! flarum/forum/components/ReplyComposer */ "flarum/forum/components/ReplyComposer"); -/* harmony import */ var flarum_forum_components_ReplyComposer__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(flarum_forum_components_ReplyComposer__WEBPACK_IMPORTED_MODULE_4__); -/* harmony import */ var _components_CreatePollModal__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./components/CreatePollModal */ "./src/forum/components/CreatePollModal.tsx"); - - - - - - -function toPoll(data) { - if (data) { - var poll = flarum_forum_app__WEBPACK_IMPORTED_MODULE_0___default().store.createRecord('polls'); - poll.tempOptions = data.options.map(function (option) { - var pollOption = flarum_forum_app__WEBPACK_IMPORTED_MODULE_0___default().store.createRecord('poll_options'); - pollOption.pushAttributes(option); - return pollOption; - }); - poll.pushAttributes(data); - return poll; - } - return data; -} -var addToComposer = function addToComposer(composer) { - // @ts-ignore - composer.prototype.addPoll = function () { - var _this = this; - flarum_forum_app__WEBPACK_IMPORTED_MODULE_0___default().modal.show(_components_CreatePollModal__WEBPACK_IMPORTED_MODULE_5__["default"], { - poll: toPoll(this.composer.fields.poll), - onsubmit: function onsubmit(poll) { - return _this.composer.fields.poll = poll; - } - }); - }; - - // Add button to DiscussionComposer header - (0,flarum_common_extend__WEBPACK_IMPORTED_MODULE_1__.extend)(composer.prototype, 'headerItems', function (items) { - var _this$composer$body, _discussion$canStartP; - var discussion = (_this$composer$body = this.composer.body) == null || (_this$composer$body = _this$composer$body.attrs) == null ? void 0 : _this$composer$body.discussion; - - // @ts-ignore - var canStartPoll = (_discussion$canStartP = discussion == null ? void 0 : discussion.canStartPoll()) != null ? _discussion$canStartP : flarum_forum_app__WEBPACK_IMPORTED_MODULE_0___default().forum.canStartPolls(); - if (canStartPoll) { - items.add('polls', m("a", { - className: "ComposerBody-poll", - onclick: this.addPoll.bind(this) - }, m("span", { - className: flarum_common_utils_classList__WEBPACK_IMPORTED_MODULE_2___default()('PollLabel', !this.composer.fields.poll && 'none') - }, flarum_forum_app__WEBPACK_IMPORTED_MODULE_0___default().translator.trans("fof-polls.forum.composer_discussion." + (this.composer.fields.poll ? 'edit' : 'add') + "_poll"))), 1); - } - }); - (0,flarum_common_extend__WEBPACK_IMPORTED_MODULE_1__.extend)(composer.prototype, 'data', function (data) { - if (this.composer.fields.poll) { - data.poll = this.composer.fields.poll; - } - }); -}; -/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (function () { - addToComposer((flarum_forum_components_DiscussionComposer__WEBPACK_IMPORTED_MODULE_3___default())); - addToComposer((flarum_forum_components_ReplyComposer__WEBPACK_IMPORTED_MODULE_4___default())); -}); - -/***/ }), - -/***/ "./src/forum/addDiscussionBadge.tsx": -/*!******************************************!*\ - !*** ./src/forum/addDiscussionBadge.tsx ***! - \******************************************/ -/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export */ __webpack_require__.d(__webpack_exports__, { -/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) -/* harmony export */ }); -/* harmony import */ var flarum_forum_app__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! flarum/forum/app */ "flarum/forum/app"); -/* harmony import */ var flarum_forum_app__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(flarum_forum_app__WEBPACK_IMPORTED_MODULE_0__); -/* harmony import */ var flarum_common_extend__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! flarum/common/extend */ "flarum/common/extend"); -/* harmony import */ var flarum_common_extend__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(flarum_common_extend__WEBPACK_IMPORTED_MODULE_1__); -/* harmony import */ var flarum_common_components_Badge__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! flarum/common/components/Badge */ "flarum/common/components/Badge"); -/* harmony import */ var flarum_common_components_Badge__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(flarum_common_components_Badge__WEBPACK_IMPORTED_MODULE_2__); -/* harmony import */ var flarum_forum_components_DiscussionList__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! flarum/forum/components/DiscussionList */ "flarum/forum/components/DiscussionList"); -/* harmony import */ var flarum_forum_components_DiscussionList__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(flarum_forum_components_DiscussionList__WEBPACK_IMPORTED_MODULE_3__); -/* harmony import */ var flarum_common_models_Discussion__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! flarum/common/models/Discussion */ "flarum/common/models/Discussion"); -/* harmony import */ var flarum_common_models_Discussion__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(flarum_common_models_Discussion__WEBPACK_IMPORTED_MODULE_4__); - - - - - -/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (function () { - // @ts-ignore - (0,flarum_common_extend__WEBPACK_IMPORTED_MODULE_1__.extend)((flarum_forum_components_DiscussionList__WEBPACK_IMPORTED_MODULE_3___default().prototype), 'requestParams', function (params) { - params.include.push('poll'); - }); - (0,flarum_common_extend__WEBPACK_IMPORTED_MODULE_1__.extend)((flarum_common_models_Discussion__WEBPACK_IMPORTED_MODULE_4___default().prototype), 'badges', function (badges) { - // @ts-ignore - if (this.hasPoll()) { - badges.add('poll', flarum_common_components_Badge__WEBPACK_IMPORTED_MODULE_2___default().component({ - type: 'poll', - label: flarum_forum_app__WEBPACK_IMPORTED_MODULE_0___default().translator.trans('fof-polls.forum.tooltip.badge'), - icon: 'fas fa-poll' - }), 5); - } - }); -}); - -/***/ }), - -/***/ "./src/forum/addNavItem.ts": -/*!*********************************!*\ - !*** ./src/forum/addNavItem.ts ***! - \*********************************/ -/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export */ __webpack_require__.d(__webpack_exports__, { -/* harmony export */ "default": () => (/* binding */ addNavItem) -/* harmony export */ }); -/* harmony import */ var flarum_forum_app__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! flarum/forum/app */ "flarum/forum/app"); -/* harmony import */ var flarum_forum_app__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(flarum_forum_app__WEBPACK_IMPORTED_MODULE_0__); -/* harmony import */ var flarum_common_extend__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! flarum/common/extend */ "flarum/common/extend"); -/* harmony import */ var flarum_common_extend__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(flarum_common_extend__WEBPACK_IMPORTED_MODULE_1__); -/* harmony import */ var flarum_forum_components_IndexPage__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! flarum/forum/components/IndexPage */ "flarum/forum/components/IndexPage"); -/* harmony import */ var flarum_forum_components_IndexPage__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(flarum_forum_components_IndexPage__WEBPACK_IMPORTED_MODULE_2__); -/* harmony import */ var flarum_common_components_LinkButton__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! flarum/common/components/LinkButton */ "flarum/common/components/LinkButton"); -/* harmony import */ var flarum_common_components_LinkButton__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(flarum_common_components_LinkButton__WEBPACK_IMPORTED_MODULE_3__); - - - - -function addNavItem() { - (0,flarum_common_extend__WEBPACK_IMPORTED_MODULE_1__.extend)((flarum_forum_components_IndexPage__WEBPACK_IMPORTED_MODULE_2___default().prototype), 'navItems', function (items) { - if (!flarum_forum_app__WEBPACK_IMPORTED_MODULE_0___default().forum.attribute('globalPollsEnabled')) { - return; - } - items.add('fof-polls-showcase', flarum_common_components_LinkButton__WEBPACK_IMPORTED_MODULE_3___default().component({ - href: flarum_forum_app__WEBPACK_IMPORTED_MODULE_0___default().route('fof.polls.showcase'), - icon: 'fas fa-poll' - }, flarum_forum_app__WEBPACK_IMPORTED_MODULE_0___default().translator.trans('fof-polls.forum.page.nav')), 35); - var showAllGlobalPolls = flarum_forum_app__WEBPACK_IMPORTED_MODULE_0___default().forum.attribute('canStartGlobalPolls'); - if (showAllGlobalPolls) { - items.add('fof-polls-list', flarum_common_components_LinkButton__WEBPACK_IMPORTED_MODULE_3___default().component({ - href: flarum_forum_app__WEBPACK_IMPORTED_MODULE_0___default().route('fof.polls.list'), - icon: 'fas fa-list' - }, flarum_forum_app__WEBPACK_IMPORTED_MODULE_0___default().translator.trans('fof-polls.forum.page.nav-all')), 32); - } - }); -} - -/***/ }), - -/***/ "./src/forum/addPollsToPost.tsx": -/*!**************************************!*\ - !*** ./src/forum/addPollsToPost.tsx ***! - \**************************************/ -/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export */ __webpack_require__.d(__webpack_exports__, { -/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) -/* harmony export */ }); -/* harmony import */ var flarum_forum_app__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! flarum/forum/app */ "flarum/forum/app"); -/* harmony import */ var flarum_forum_app__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(flarum_forum_app__WEBPACK_IMPORTED_MODULE_0__); -/* harmony import */ var flarum_common_extend__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! flarum/common/extend */ "flarum/common/extend"); -/* harmony import */ var flarum_common_extend__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(flarum_common_extend__WEBPACK_IMPORTED_MODULE_1__); -/* harmony import */ var flarum_forum_components_CommentPost__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! flarum/forum/components/CommentPost */ "flarum/forum/components/CommentPost"); -/* harmony import */ var flarum_forum_components_CommentPost__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(flarum_forum_components_CommentPost__WEBPACK_IMPORTED_MODULE_2__); -/* harmony import */ var _components_PollView__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./components/PollView */ "./src/forum/components/PollView.tsx"); -/* harmony import */ var flarum_forum_components_DiscussionPage__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! flarum/forum/components/DiscussionPage */ "flarum/forum/components/DiscussionPage"); -/* harmony import */ var flarum_forum_components_DiscussionPage__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(flarum_forum_components_DiscussionPage__WEBPACK_IMPORTED_MODULE_4__); -function _createForOfIteratorHelperLoose(o, allowArrayLike) { var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"]; if (it) return (it = it.call(o)).next.bind(it); if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") { if (it) o = it; var i = 0; return function () { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } -function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); } -function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; } - - - - - -/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (function () { - (0,flarum_common_extend__WEBPACK_IMPORTED_MODULE_1__.extend)((flarum_forum_components_CommentPost__WEBPACK_IMPORTED_MODULE_2___default().prototype), 'content', function (content) { - var post = this.attrs.post; - if ((!post.isHidden() || this.revealContent) && post.polls()) { - for (var _iterator = _createForOfIteratorHelperLoose(post.polls()), _step; !(_step = _iterator()).done;) { - var poll = _step.value; - if (poll) { - content.push(m(_components_PollView__WEBPACK_IMPORTED_MODULE_3__["default"], { - poll: poll - })); - } - } - } - }); - (0,flarum_common_extend__WEBPACK_IMPORTED_MODULE_1__.extend)((flarum_forum_components_CommentPost__WEBPACK_IMPORTED_MODULE_2___default().prototype), 'oninit', function () { - var _this = this; - this.subtree.check(function () { - var polls = _this.attrs.post.polls(); - var checks = polls == null || polls.map == null ? void 0 : polls.map(function (poll) { - var _poll$data, _poll$options$map, _poll$options, _poll$myVotes$map, _poll$myVotes; - return poll && [(_poll$data = poll.data) == null ? void 0 : _poll$data.attributes, (_poll$options$map = (_poll$options = poll.options()).map) == null ? void 0 : _poll$options$map.call(_poll$options, function (option) { - var _option$data; - return option == null || (_option$data = option.data) == null ? void 0 : _option$data.attributes; - }), (_poll$myVotes$map = (_poll$myVotes = poll.myVotes()).map) == null ? void 0 : _poll$myVotes$map.call(_poll$myVotes, function (vote) { - var _vote$option; - return (_vote$option = vote.option()) == null ? void 0 : _vote$option.id(); - })]; - }); - return JSON.stringify(checks); - }); - }); - (0,flarum_common_extend__WEBPACK_IMPORTED_MODULE_1__.extend)((flarum_forum_components_DiscussionPage__WEBPACK_IMPORTED_MODULE_4___default().prototype), 'oncreate', function () { - // @ts-ignore - if ((flarum_forum_app__WEBPACK_IMPORTED_MODULE_0___default().pusher)) { - // @ts-ignore - flarum_forum_app__WEBPACK_IMPORTED_MODULE_0___default().pusher.then(function (binding) { - // We will listen for updates to all polls and options - // Even if that model is not in the current discussion, it doesn't really matter - binding.channels.main.bind('updatedPollOptions', function (data) { - var poll = flarum_forum_app__WEBPACK_IMPORTED_MODULE_0___default().store.getById('polls', data['pollId']); - if (poll) { - poll.pushAttributes({ - voteCount: data['pollVoteCount'] - }); - - // Not redrawing here, as the option below should trigger the redraw already - } - var changedOptions = data['options']; - for (var optionId in changedOptions) { - var option = flarum_forum_app__WEBPACK_IMPORTED_MODULE_0___default().store.getById('poll_options', optionId); - if (option && option.voteCount() !== undefined) { - option.pushAttributes({ - voteCount: changedOptions[optionId] - }); - } - } - m.redraw(); - }); - }); - } - }); - (0,flarum_common_extend__WEBPACK_IMPORTED_MODULE_1__.extend)((flarum_forum_components_DiscussionPage__WEBPACK_IMPORTED_MODULE_4___default().prototype), 'onremove', function () { - // @ts-ignore - if ((flarum_forum_app__WEBPACK_IMPORTED_MODULE_0___default().pusher)) { - // @ts-ignore - flarum_forum_app__WEBPACK_IMPORTED_MODULE_0___default().pusher.then(function (binding) { - binding.channels.main.unbind('updatedPollOptions'); - }); - } - }); -}); - -/***/ }), - -/***/ "./src/forum/addPostControls.tsx": -/*!***************************************!*\ - !*** ./src/forum/addPostControls.tsx ***! - \***************************************/ -/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export */ __webpack_require__.d(__webpack_exports__, { -/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) -/* harmony export */ }); -/* harmony import */ var _babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/esm/extends */ "./node_modules/@babel/runtime/helpers/esm/extends.js"); -/* harmony import */ var flarum_forum_app__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! flarum/forum/app */ "flarum/forum/app"); -/* harmony import */ var flarum_forum_app__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(flarum_forum_app__WEBPACK_IMPORTED_MODULE_1__); -/* harmony import */ var flarum_common_extend__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! flarum/common/extend */ "flarum/common/extend"); -/* harmony import */ var flarum_common_extend__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(flarum_common_extend__WEBPACK_IMPORTED_MODULE_2__); -/* harmony import */ var flarum_forum_utils_PostControls__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! flarum/forum/utils/PostControls */ "flarum/forum/utils/PostControls"); -/* harmony import */ var flarum_forum_utils_PostControls__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(flarum_forum_utils_PostControls__WEBPACK_IMPORTED_MODULE_3__); -/* harmony import */ var _components_CreatePollModal__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./components/CreatePollModal */ "./src/forum/components/CreatePollModal.tsx"); -/* harmony import */ var flarum_common_components_Button__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! flarum/common/components/Button */ "flarum/common/components/Button"); -/* harmony import */ var flarum_common_components_Button__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(flarum_common_components_Button__WEBPACK_IMPORTED_MODULE_5__); - - - - - - -/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (function () { - var createPoll = function createPoll(post) { - return flarum_forum_app__WEBPACK_IMPORTED_MODULE_1___default().modal.show(_components_CreatePollModal__WEBPACK_IMPORTED_MODULE_4__["default"], { - onsubmit: function onsubmit(data) { - return flarum_forum_app__WEBPACK_IMPORTED_MODULE_1___default().store.createRecord('polls').save((0,_babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__["default"])({}, data, { - relationships: { - post: post - } - }), { - data: { - include: 'options,myVotes,myVotes.option' - } - }).then(function (poll) { - var _post$rawRelationship; - // @ts-ignore - (_post$rawRelationship = post.rawRelationship('polls')) == null || _post$rawRelationship.push == null || _post$rawRelationship.push({ - type: 'polls', - id: poll.id() - }); - return poll; - }); - } - }); - }; - (0,flarum_common_extend__WEBPACK_IMPORTED_MODULE_2__.extend)((flarum_forum_utils_PostControls__WEBPACK_IMPORTED_MODULE_3___default()), 'moderationControls', function (items, post) { - // @ts-ignore - if (!post.isHidden() && post.canStartPoll()) { - items.add('addPoll', m((flarum_common_components_Button__WEBPACK_IMPORTED_MODULE_5___default()), { - icon: "fas fa-poll", - onclick: createPoll.bind(this, post) - }, flarum_forum_app__WEBPACK_IMPORTED_MODULE_1___default().translator.trans('fof-polls.forum.moderation.add'))); - } - }); -}); - -/***/ }), - -/***/ "./src/forum/components/AbstractPollPage.tsx": -/*!***************************************************!*\ - !*** ./src/forum/components/AbstractPollPage.tsx ***! - \***************************************************/ -/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export */ __webpack_require__.d(__webpack_exports__, { -/* harmony export */ AbstractPollPage: () => (/* binding */ AbstractPollPage) -/* harmony export */ }); -/* harmony import */ var _babel_runtime_helpers_esm_inheritsLoose__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/esm/inheritsLoose */ "./node_modules/@babel/runtime/helpers/esm/inheritsLoose.js"); -/* harmony import */ var flarum_common_components_Page__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! flarum/common/components/Page */ "flarum/common/components/Page"); -/* harmony import */ var flarum_common_components_Page__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(flarum_common_components_Page__WEBPACK_IMPORTED_MODULE_1__); -/* harmony import */ var flarum_common_utils_ItemList__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! flarum/common/utils/ItemList */ "flarum/common/utils/ItemList"); -/* harmony import */ var flarum_common_utils_ItemList__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(flarum_common_utils_ItemList__WEBPACK_IMPORTED_MODULE_2__); -/* harmony import */ var flarum_common_components_LoadingIndicator__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! flarum/common/components/LoadingIndicator */ "flarum/common/components/LoadingIndicator"); -/* harmony import */ var flarum_common_components_LoadingIndicator__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(flarum_common_components_LoadingIndicator__WEBPACK_IMPORTED_MODULE_3__); -/* harmony import */ var flarum_forum_components_IndexPage__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! flarum/forum/components/IndexPage */ "flarum/forum/components/IndexPage"); -/* harmony import */ var flarum_forum_components_IndexPage__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(flarum_forum_components_IndexPage__WEBPACK_IMPORTED_MODULE_4__); -/* harmony import */ var flarum_common_helpers_listItems__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! flarum/common/helpers/listItems */ "flarum/common/helpers/listItems"); -/* harmony import */ var flarum_common_helpers_listItems__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(flarum_common_helpers_listItems__WEBPACK_IMPORTED_MODULE_5__); -/* harmony import */ var flarum_forum_app__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! flarum/forum/app */ "flarum/forum/app"); -/* harmony import */ var flarum_forum_app__WEBPACK_IMPORTED_MODULE_6___default = /*#__PURE__*/__webpack_require__.n(flarum_forum_app__WEBPACK_IMPORTED_MODULE_6__); -/* harmony import */ var flarum_common_components_SelectDropdown__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! flarum/common/components/SelectDropdown */ "flarum/common/components/SelectDropdown"); -/* harmony import */ var flarum_common_components_SelectDropdown__WEBPACK_IMPORTED_MODULE_7___default = /*#__PURE__*/__webpack_require__.n(flarum_common_components_SelectDropdown__WEBPACK_IMPORTED_MODULE_7__); - - - - - - - - -var AbstractPollPage = /*#__PURE__*/function (_Page) { - (0,_babel_runtime_helpers_esm_inheritsLoose__WEBPACK_IMPORTED_MODULE_0__["default"])(AbstractPollPage, _Page); - function AbstractPollPage() { - var _this; - for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) { - args[_key] = arguments[_key]; - } - _this = _Page.call.apply(_Page, [this].concat(args)) || this; - _this.loading = false; - _this.poll = null; - _this.polls = []; - return _this; - } - var _proto = AbstractPollPage.prototype; - _proto.view = function view() { - return m("div", { - className: "PollsPage" - }, this.pageContent().toArray()); - }; - _proto.pageContent = function pageContent() { - var items = new (flarum_common_utils_ItemList__WEBPACK_IMPORTED_MODULE_2___default())(); - items.add('hero', this.hero(), 100); - items.add('main', m("div", { - className: "container" - }, this.mainContent().toArray()), 10); - return items; - }; - _proto.mainContent = function mainContent() { - var items = new (flarum_common_utils_ItemList__WEBPACK_IMPORTED_MODULE_2___default())(); - items.add('sidebar', this.sidebar(), 100); - items.add('content', this.content(), 10); - return items; - }; - _proto.content = function content() { - return m("div", { - className: "PollsPage-content sideNavOffset" - }, this.contentItems().toArray()); - }; - _proto.contentItems = function contentItems() { - var items = new (flarum_common_utils_ItemList__WEBPACK_IMPORTED_MODULE_2___default())(); - if (this.loading) { - items.add('loading', m((flarum_common_components_LoadingIndicator__WEBPACK_IMPORTED_MODULE_3___default()), null)); - } - return items; - }; - _proto.hero = function hero() { - return flarum_forum_components_IndexPage__WEBPACK_IMPORTED_MODULE_4___default().prototype.hero(); - }; - _proto.sidebar = function sidebar() { - return m("nav", { - className: "PollsPage-nav IndexPage-nav sideNav" - }, m("ul", null, flarum_common_helpers_listItems__WEBPACK_IMPORTED_MODULE_5___default()(this.sidebarItems().toArray()))); - }; - _proto.sidebarItems = function sidebarItems() { - var items = flarum_forum_components_IndexPage__WEBPACK_IMPORTED_MODULE_4___default().prototype.sidebarItems(); - items.setContent('nav', m((flarum_common_components_SelectDropdown__WEBPACK_IMPORTED_MODULE_7___default()), { - buttonClassName: "Button", - className: "App-titleControl", - accessibleToggleLabel: flarum_forum_app__WEBPACK_IMPORTED_MODULE_6___default().translator.trans('core.forum.index.toggle_sidenav_dropdown_accessible_label') - }, this.navItems().toArray())); - return items; - }; - _proto.navItems = function navItems() { - var items = flarum_forum_components_IndexPage__WEBPACK_IMPORTED_MODULE_4___default().prototype.navItems(); - if (flarum_forum_app__WEBPACK_IMPORTED_MODULE_6___default().initializers.has('flarum-tags')) { - // remove the tags from the nav items - items.remove('separator'); - items.remove('moreTags'); - - // each tag is added using the key "tag{id}". We need to remove all of them - for (var key in items.toObject()) { - if (key.startsWith('tag') && key !== 'tags') { - items.remove(key); - } - } - } - return items; - }; - return AbstractPollPage; -}((flarum_common_components_Page__WEBPACK_IMPORTED_MODULE_1___default())); - -/***/ }), - -/***/ "./src/forum/components/ComposePollHero.tsx": -/*!**************************************************!*\ - !*** ./src/forum/components/ComposePollHero.tsx ***! - \**************************************************/ -/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export */ __webpack_require__.d(__webpack_exports__, { -/* harmony export */ "default": () => (/* binding */ ComposePollHero) -/* harmony export */ }); -/* harmony import */ var _babel_runtime_helpers_esm_inheritsLoose__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/esm/inheritsLoose */ "./node_modules/@babel/runtime/helpers/esm/inheritsLoose.js"); -/* harmony import */ var flarum_forum_app__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! flarum/forum/app */ "flarum/forum/app"); -/* harmony import */ var flarum_forum_app__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(flarum_forum_app__WEBPACK_IMPORTED_MODULE_1__); -/* harmony import */ var flarum_common_Component__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! flarum/common/Component */ "flarum/common/Component"); -/* harmony import */ var flarum_common_Component__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(flarum_common_Component__WEBPACK_IMPORTED_MODULE_2__); -/* harmony import */ var flarum_common_components_LinkButton__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! flarum/common/components/LinkButton */ "flarum/common/components/LinkButton"); -/* harmony import */ var flarum_common_components_LinkButton__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(flarum_common_components_LinkButton__WEBPACK_IMPORTED_MODULE_3__); -/* harmony import */ var flarum_common_utils_ItemList__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! flarum/common/utils/ItemList */ "flarum/common/utils/ItemList"); -/* harmony import */ var flarum_common_utils_ItemList__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(flarum_common_utils_ItemList__WEBPACK_IMPORTED_MODULE_4__); - - - - - -var ComposePollHero = /*#__PURE__*/function (_Component) { - (0,_babel_runtime_helpers_esm_inheritsLoose__WEBPACK_IMPORTED_MODULE_0__["default"])(ComposePollHero, _Component); - function ComposePollHero() { - var _this; - for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) { - args[_key] = arguments[_key]; - } - _this = _Component.call.apply(_Component, [this].concat(args)) || this; - _this.poll = void 0; - return _this; - } - var _proto = ComposePollHero.prototype; - _proto.oninit = function oninit(vnode) { - _Component.prototype.oninit.call(this, vnode); - this.poll = this.attrs.poll; - }; - _proto.view = function view() { - return m("div", { - className: "ComposePollHero Hero" - }, m("div", { - className: "container" - }, m("div", { - className: "containerNarrow" - }, m("h2", { - className: "Hero-title" - }, flarum_forum_app__WEBPACK_IMPORTED_MODULE_1___default().translator.trans("fof-polls.forum.compose." + (!!this.poll.id() ? 'edit' : 'add') + "_title")), m("div", { - className: "ComposePollHero-controls" - }, this.controlItems().toArray())))); - }; - _proto.controlItems = function controlItems() { - var items = new (flarum_common_utils_ItemList__WEBPACK_IMPORTED_MODULE_4___default())(); - items.add('edit', m((flarum_common_components_LinkButton__WEBPACK_IMPORTED_MODULE_3___default()), { - icon: "far fa-edit", - className: "Button Button--secondary GlobalPollListLink", - itemClassName: "App-primaryControl", - href: flarum_forum_app__WEBPACK_IMPORTED_MODULE_1___default().route('fof.polls.list') - }, flarum_forum_app__WEBPACK_IMPORTED_MODULE_1___default().translator.trans('fof-polls.forum.compose.polls_manager'))); - if (this.poll.exists) { - items.add('view', m((flarum_common_components_LinkButton__WEBPACK_IMPORTED_MODULE_3___default()), { - icon: "far fa-arrow-up-right-from-square", - className: "Button Button--secondary PollPreviewLink", - itemClassName: "App-primaryControl", - href: flarum_forum_app__WEBPACK_IMPORTED_MODULE_1___default().route('fof.polls.view', { - id: this.poll.id() - }) - }, flarum_forum_app__WEBPACK_IMPORTED_MODULE_1___default().translator.trans('fof-polls.forum.compose.polls_preview'))); - } - return items; - }; - return ComposePollHero; -}((flarum_common_Component__WEBPACK_IMPORTED_MODULE_2___default())); - - -/***/ }), - -/***/ "./src/forum/components/ComposePollPage.tsx": -/*!**************************************************!*\ - !*** ./src/forum/components/ComposePollPage.tsx ***! - \**************************************************/ -/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export */ __webpack_require__.d(__webpack_exports__, { -/* harmony export */ "default": () => (/* binding */ ComposePollPage) -/* harmony export */ }); -/* harmony import */ var _babel_runtime_helpers_esm_asyncToGenerator__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/esm/asyncToGenerator */ "./node_modules/@babel/runtime/helpers/esm/asyncToGenerator.js"); -/* harmony import */ var _babel_runtime_helpers_esm_inheritsLoose__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/esm/inheritsLoose */ "./node_modules/@babel/runtime/helpers/esm/inheritsLoose.js"); -/* harmony import */ var _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @babel/runtime/regenerator */ "./node_modules/@babel/runtime/regenerator/index.js"); -/* harmony import */ var _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_2__); -/* harmony import */ var flarum_forum_app__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! flarum/forum/app */ "flarum/forum/app"); -/* harmony import */ var flarum_forum_app__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(flarum_forum_app__WEBPACK_IMPORTED_MODULE_3__); -/* harmony import */ var flarum_common_components_Page__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! flarum/common/components/Page */ "flarum/common/components/Page"); -/* harmony import */ var flarum_common_components_Page__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(flarum_common_components_Page__WEBPACK_IMPORTED_MODULE_4__); -/* harmony import */ var flarum_common_components_LoadingIndicator__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! flarum/common/components/LoadingIndicator */ "flarum/common/components/LoadingIndicator"); -/* harmony import */ var flarum_common_components_LoadingIndicator__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(flarum_common_components_LoadingIndicator__WEBPACK_IMPORTED_MODULE_5__); -/* harmony import */ var _PollForm__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./PollForm */ "./src/forum/components/PollForm.tsx"); -/* harmony import */ var _states_PollFormState__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../states/PollFormState */ "./src/forum/states/PollFormState.ts"); -/* harmony import */ var _ComposePollHero__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./ComposePollHero */ "./src/forum/components/ComposePollHero.tsx"); -/* harmony import */ var flarum_common_components_Button__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! flarum/common/components/Button */ "flarum/common/components/Button"); -/* harmony import */ var flarum_common_components_Button__WEBPACK_IMPORTED_MODULE_9___default = /*#__PURE__*/__webpack_require__.n(flarum_common_components_Button__WEBPACK_IMPORTED_MODULE_9__); -/* harmony import */ var flarum_common_helpers_listItems__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! flarum/common/helpers/listItems */ "flarum/common/helpers/listItems"); -/* harmony import */ var flarum_common_helpers_listItems__WEBPACK_IMPORTED_MODULE_10___default = /*#__PURE__*/__webpack_require__.n(flarum_common_helpers_listItems__WEBPACK_IMPORTED_MODULE_10__); -/* harmony import */ var flarum_common_utils_ItemList__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! flarum/common/utils/ItemList */ "flarum/common/utils/ItemList"); -/* harmony import */ var flarum_common_utils_ItemList__WEBPACK_IMPORTED_MODULE_11___default = /*#__PURE__*/__webpack_require__.n(flarum_common_utils_ItemList__WEBPACK_IMPORTED_MODULE_11__); -/* harmony import */ var flarum_common_components_SelectDropdown__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! flarum/common/components/SelectDropdown */ "flarum/common/components/SelectDropdown"); -/* harmony import */ var flarum_common_components_SelectDropdown__WEBPACK_IMPORTED_MODULE_12___default = /*#__PURE__*/__webpack_require__.n(flarum_common_components_SelectDropdown__WEBPACK_IMPORTED_MODULE_12__); -/* harmony import */ var flarum_forum_components_IndexPage__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! flarum/forum/components/IndexPage */ "flarum/forum/components/IndexPage"); -/* harmony import */ var flarum_forum_components_IndexPage__WEBPACK_IMPORTED_MODULE_13___default = /*#__PURE__*/__webpack_require__.n(flarum_forum_components_IndexPage__WEBPACK_IMPORTED_MODULE_13__); - - - - - - - - - - - - - - -var ComposePollPage = /*#__PURE__*/function (_Page) { - (0,_babel_runtime_helpers_esm_inheritsLoose__WEBPACK_IMPORTED_MODULE_1__["default"])(ComposePollPage, _Page); - function ComposePollPage() { - var _this; - for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) { - args[_key] = arguments[_key]; - } - _this = _Page.call.apply(_Page, [this].concat(args)) || this; - _this.poll = null; - _this.loading = false; - return _this; - } - var _proto = ComposePollPage.prototype; - _proto.oninit = function oninit(vnode) { - var _this2 = this, - _this$poll, - _this$poll2; - _Page.prototype.oninit.call(this, vnode); - if (!flarum_forum_app__WEBPACK_IMPORTED_MODULE_3___default().forum.attribute('globalPollsEnabled')) { - m.route.set('/'); - return; - } - - // Get the `edit` parameter from the URL - var editId = m.route.param('id'); - if (editId) { - this.poll = flarum_forum_app__WEBPACK_IMPORTED_MODULE_3___default().store.getById('poll', editId); - if (!this.poll) { - this.loading = true; - flarum_forum_app__WEBPACK_IMPORTED_MODULE_3___default().store.find('fof/polls', editId).then(function (item) { - var _this2$poll; - _this2.poll = item; - _this2.loading = false; - flarum_forum_app__WEBPACK_IMPORTED_MODULE_3___default().setTitle(flarum_forum_app__WEBPACK_IMPORTED_MODULE_3___default().translator.trans("fof-polls.forum.compose." + (!!((_this2$poll = _this2.poll) != null && _this2$poll.id()) ? 'edit' : 'add') + "_title")); - m.redraw(); - }); - } - } else { - this.poll = _states_PollFormState__WEBPACK_IMPORTED_MODULE_7__["default"].createNewPoll(); - } - flarum_forum_app__WEBPACK_IMPORTED_MODULE_3___default().history.push('compose-poll', flarum_forum_app__WEBPACK_IMPORTED_MODULE_3___default().translator.trans("fof-polls.forum.compose." + (!!((_this$poll = this.poll) != null && _this$poll.id()) ? 'edit' : 'add') + "_title")); - this.bodyClass = 'App--compose-poll'; - flarum_forum_app__WEBPACK_IMPORTED_MODULE_3___default().setTitle(flarum_forum_app__WEBPACK_IMPORTED_MODULE_3___default().translator.trans("fof-polls.forum.compose." + (!!((_this$poll2 = this.poll) != null && _this$poll2.id()) ? 'edit' : 'add') + "_title")); - }; - _proto.view = function view() { - // prevent users from accessing the page if they can't start global polls - if (!flarum_forum_app__WEBPACK_IMPORTED_MODULE_3___default().forum.attribute('canStartGlobalPolls')) { - m.route.set('/'); - return; - } - if (this.loading) { - return m((flarum_common_components_LoadingIndicator__WEBPACK_IMPORTED_MODULE_5___default()), null); - } - return m("div", { - className: "ComposePollPage" - }, m(_ComposePollHero__WEBPACK_IMPORTED_MODULE_8__["default"], { - poll: this.poll - }), m("div", { - className: "container" - }, m("div", { - className: "sideNavContainer" - }, m("nav", { - className: "PollsPage-nav sideNav" - }, m("ul", null, flarum_common_helpers_listItems__WEBPACK_IMPORTED_MODULE_10___default()(this.sidebarItems().toArray()))), m("div", { - className: "sideNavOffset" - }, m(_PollForm__WEBPACK_IMPORTED_MODULE_6__["default"], { - poll: this.poll, - onsubmit: this.onsubmit.bind(this) - }))))); - }; - _proto.onsubmit = /*#__PURE__*/function () { - var _onsubmit = (0,_babel_runtime_helpers_esm_asyncToGenerator__WEBPACK_IMPORTED_MODULE_0__["default"])( /*#__PURE__*/_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_2___default().mark(function _callee(data, state) { - var isNew, alertAttrs, alertId; - return _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_2___default().wrap(function _callee$(_context) { - while (1) switch (_context.prev = _context.next) { - case 0: - isNew = state.poll.id() === undefined; - _context.next = 3; - return state.save(data); - case 3: - alertAttrs = isNew ? { - type: 'success', - controls: [m((flarum_common_components_Button__WEBPACK_IMPORTED_MODULE_9___default()), { - className: "Button Button--link", - onclick: function onclick() { - return m.route.set(flarum_forum_app__WEBPACK_IMPORTED_MODULE_3___default().route('fof.polls.compose', { - id: state.poll.id() - })); - } - }, flarum_forum_app__WEBPACK_IMPORTED_MODULE_3___default().translator.trans('fof-polls.forum.compose.continue_editing'))] - } : { - type: 'success' - }; // Show success alert - alertId = flarum_forum_app__WEBPACK_IMPORTED_MODULE_3___default().alerts.show(alertAttrs, flarum_forum_app__WEBPACK_IMPORTED_MODULE_3___default().translator.trans('fof-polls.forum.compose.success')); // Hide alert after 10 seconds - setTimeout(function () { - return flarum_forum_app__WEBPACK_IMPORTED_MODULE_3___default().alerts.dismiss(alertId); - }, 10000); - if (isNew) { - m.route.set(flarum_forum_app__WEBPACK_IMPORTED_MODULE_3___default().route('fof.polls.list')); - } - case 7: - case "end": - return _context.stop(); - } - }, _callee); - })); - function onsubmit(_x, _x2) { - return _onsubmit.apply(this, arguments); - } - return onsubmit; - }(); - _proto.sidebarItems = function sidebarItems() { - var items = new (flarum_common_utils_ItemList__WEBPACK_IMPORTED_MODULE_11___default())(); - items.add('nav', m((flarum_common_components_SelectDropdown__WEBPACK_IMPORTED_MODULE_12___default()), { - buttonClassName: "Button", - className: "App-titleControl", - accessibleToggleLabel: flarum_forum_app__WEBPACK_IMPORTED_MODULE_3___default().translator.trans('core.forum.index.toggle_sidenav_dropdown_accessible_label') - }, this.navItems().toArray())); - return items; - }; - _proto.navItems = function navItems() { - return flarum_forum_components_IndexPage__WEBPACK_IMPORTED_MODULE_13___default().prototype.navItems(); - }; - return ComposePollPage; -}((flarum_common_components_Page__WEBPACK_IMPORTED_MODULE_4___default())); - - -/***/ }), - -/***/ "./src/forum/components/CreatePollModal.tsx": -/*!**************************************************!*\ - !*** ./src/forum/components/CreatePollModal.tsx ***! - \**************************************************/ -/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export */ __webpack_require__.d(__webpack_exports__, { -/* harmony export */ "default": () => (/* binding */ CreatePollModal) -/* harmony export */ }); -/* harmony import */ var _babel_runtime_helpers_esm_asyncToGenerator__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/esm/asyncToGenerator */ "./node_modules/@babel/runtime/helpers/esm/asyncToGenerator.js"); -/* harmony import */ var _babel_runtime_helpers_esm_inheritsLoose__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/esm/inheritsLoose */ "./node_modules/@babel/runtime/helpers/esm/inheritsLoose.js"); -/* harmony import */ var _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @babel/runtime/regenerator */ "./node_modules/@babel/runtime/regenerator/index.js"); -/* harmony import */ var _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_2__); -/* harmony import */ var flarum_forum_app__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! flarum/forum/app */ "flarum/forum/app"); -/* harmony import */ var flarum_forum_app__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(flarum_forum_app__WEBPACK_IMPORTED_MODULE_3__); -/* harmony import */ var flarum_common_components_Modal__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! flarum/common/components/Modal */ "flarum/common/components/Modal"); -/* harmony import */ var flarum_common_components_Modal__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(flarum_common_components_Modal__WEBPACK_IMPORTED_MODULE_4__); -/* harmony import */ var _PollForm__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./PollForm */ "./src/forum/components/PollForm.tsx"); - - - - - - -var CreatePollModal = /*#__PURE__*/function (_Modal) { - (0,_babel_runtime_helpers_esm_inheritsLoose__WEBPACK_IMPORTED_MODULE_1__["default"])(CreatePollModal, _Modal); - function CreatePollModal() { - return _Modal.apply(this, arguments) || this; - } - var _proto = CreatePollModal.prototype; - _proto.title = function title() { - return flarum_forum_app__WEBPACK_IMPORTED_MODULE_3___default().translator.trans('fof-polls.forum.modal.add_title'); - }; - _proto.className = function className() { - return 'PollDiscussionModal Modal--medium'; - }; - _proto.content = function content() { - return [m("div", { - className: "Modal-body" - }, m(_PollForm__WEBPACK_IMPORTED_MODULE_5__["default"], { - poll: this.attrs.poll, - onsubmit: this.onFormSubmit.bind(this) - }))]; - }; - _proto.onFormSubmit = /*#__PURE__*/function () { - var _onFormSubmit = (0,_babel_runtime_helpers_esm_asyncToGenerator__WEBPACK_IMPORTED_MODULE_0__["default"])( /*#__PURE__*/_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_2___default().mark(function _callee(data, state) { - return _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_2___default().wrap(function _callee$(_context) { - while (1) switch (_context.prev = _context.next) { - case 0: - this.hide(); - _context.next = 3; - return this.attrs.onsubmit(data); - case 3: - case "end": - return _context.stop(); - } - }, _callee, this); - })); - function onFormSubmit(_x, _x2) { - return _onFormSubmit.apply(this, arguments); - } - return onFormSubmit; - }(); - return CreatePollModal; -}((flarum_common_components_Modal__WEBPACK_IMPORTED_MODULE_4___default())); - - -/***/ }), - -/***/ "./src/forum/components/EditPollModal.tsx": -/*!************************************************!*\ - !*** ./src/forum/components/EditPollModal.tsx ***! - \************************************************/ -/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export */ __webpack_require__.d(__webpack_exports__, { -/* harmony export */ "default": () => (/* binding */ EditPollModal) -/* harmony export */ }); -/* harmony import */ var _babel_runtime_helpers_esm_asyncToGenerator__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/esm/asyncToGenerator */ "./node_modules/@babel/runtime/helpers/esm/asyncToGenerator.js"); -/* harmony import */ var _babel_runtime_helpers_esm_inheritsLoose__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/esm/inheritsLoose */ "./node_modules/@babel/runtime/helpers/esm/inheritsLoose.js"); -/* harmony import */ var _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @babel/runtime/regenerator */ "./node_modules/@babel/runtime/regenerator/index.js"); -/* harmony import */ var _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_2__); -/* harmony import */ var flarum_forum_app__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! flarum/forum/app */ "flarum/forum/app"); -/* harmony import */ var flarum_forum_app__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(flarum_forum_app__WEBPACK_IMPORTED_MODULE_3__); -/* harmony import */ var _CreatePollModal__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./CreatePollModal */ "./src/forum/components/CreatePollModal.tsx"); - - - - - -var EditPollModal = /*#__PURE__*/function (_CreatePollModal) { - (0,_babel_runtime_helpers_esm_inheritsLoose__WEBPACK_IMPORTED_MODULE_1__["default"])(EditPollModal, _CreatePollModal); - function EditPollModal() { - return _CreatePollModal.apply(this, arguments) || this; - } - var _proto = EditPollModal.prototype; - _proto.title = function title() { - return flarum_forum_app__WEBPACK_IMPORTED_MODULE_3___default().translator.trans('fof-polls.forum.modal.edit_title'); - }; - _proto.onFormSubmit = /*#__PURE__*/function () { - var _onFormSubmit = (0,_babel_runtime_helpers_esm_asyncToGenerator__WEBPACK_IMPORTED_MODULE_0__["default"])( /*#__PURE__*/_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_2___default().mark(function _callee(data, state) { - var alertId; - return _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_2___default().wrap(function _callee$(_context) { - while (1) switch (_context.prev = _context.next) { - case 0: - _context.next = 2; - return state.save(data); - case 2: - // Show success alert - alertId = flarum_forum_app__WEBPACK_IMPORTED_MODULE_3___default().alerts.show({ - type: 'success' - }, flarum_forum_app__WEBPACK_IMPORTED_MODULE_3___default().translator.trans('fof-polls.forum.compose.success')); // Hide alert after 10 seconds - setTimeout(function () { - return flarum_forum_app__WEBPACK_IMPORTED_MODULE_3___default().alerts.dismiss(alertId); - }, 10000); - case 4: - case "end": - return _context.stop(); - } - }, _callee); - })); - function onFormSubmit(_x, _x2) { - return _onFormSubmit.apply(this, arguments); - } - return onFormSubmit; - }(); - return EditPollModal; -}(_CreatePollModal__WEBPACK_IMPORTED_MODULE_4__["default"]); - - -/***/ }), - -/***/ "./src/forum/components/ListVotersModal.tsx": -/*!**************************************************!*\ - !*** ./src/forum/components/ListVotersModal.tsx ***! - \**************************************************/ -/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export */ __webpack_require__.d(__webpack_exports__, { -/* harmony export */ "default": () => (/* binding */ ListVotersModal) -/* harmony export */ }); -/* harmony import */ var _babel_runtime_helpers_esm_inheritsLoose__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/esm/inheritsLoose */ "./node_modules/@babel/runtime/helpers/esm/inheritsLoose.js"); -/* harmony import */ var flarum_forum_app__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! flarum/forum/app */ "flarum/forum/app"); -/* harmony import */ var flarum_forum_app__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(flarum_forum_app__WEBPACK_IMPORTED_MODULE_1__); -/* harmony import */ var flarum_common_components_Modal__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! flarum/common/components/Modal */ "flarum/common/components/Modal"); -/* harmony import */ var flarum_common_components_Modal__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(flarum_common_components_Modal__WEBPACK_IMPORTED_MODULE_2__); -/* harmony import */ var flarum_common_helpers_avatar__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! flarum/common/helpers/avatar */ "flarum/common/helpers/avatar"); -/* harmony import */ var flarum_common_helpers_avatar__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(flarum_common_helpers_avatar__WEBPACK_IMPORTED_MODULE_3__); -/* harmony import */ var flarum_common_helpers_username__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! flarum/common/helpers/username */ "flarum/common/helpers/username"); -/* harmony import */ var flarum_common_helpers_username__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(flarum_common_helpers_username__WEBPACK_IMPORTED_MODULE_4__); -/* harmony import */ var flarum_common_components_Link__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! flarum/common/components/Link */ "flarum/common/components/Link"); -/* harmony import */ var flarum_common_components_Link__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(flarum_common_components_Link__WEBPACK_IMPORTED_MODULE_5__); -/* harmony import */ var flarum_common_components_LoadingIndicator__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! flarum/common/components/LoadingIndicator */ "flarum/common/components/LoadingIndicator"); -/* harmony import */ var flarum_common_components_LoadingIndicator__WEBPACK_IMPORTED_MODULE_6___default = /*#__PURE__*/__webpack_require__.n(flarum_common_components_LoadingIndicator__WEBPACK_IMPORTED_MODULE_6__); - - - - - - - -var ListVotersModal = /*#__PURE__*/function (_Modal) { - (0,_babel_runtime_helpers_esm_inheritsLoose__WEBPACK_IMPORTED_MODULE_0__["default"])(ListVotersModal, _Modal); - function ListVotersModal() { - return _Modal.apply(this, arguments) || this; - } - var _proto = ListVotersModal.prototype; - _proto.oninit = function oninit(vnode) { - var _this = this; - _Modal.prototype.oninit.call(this, vnode); - this.loading = true; - flarum_forum_app__WEBPACK_IMPORTED_MODULE_1___default().store.find('fof/polls', this.attrs.poll.id(), { - include: 'votes,votes.user,votes.option' - }).then(function () { - return _this.loading = false; - })["finally"](function () { - return m.redraw(); - }); - }; - _proto.className = function className() { - return 'Modal--medium VotesModal'; - }; - _proto.title = function title() { - return flarum_forum_app__WEBPACK_IMPORTED_MODULE_1___default().translator.trans('fof-polls.forum.votes_modal.title'); - }; - _proto.content = function content() { - var options = this.attrs.poll.options(); - return m("div", { - className: "Modal-body" - }, this.loading ? m((flarum_common_components_LoadingIndicator__WEBPACK_IMPORTED_MODULE_6___default()), null) : options.map(this.optionContent.bind(this))); - }; - _proto.optionContent = function optionContent(opt) { - var votes = (this.attrs.poll.votes() || []).filter(function (v) { - return opt.id() === v.option().id(); - }); - return m("div", { - className: "VotesModal-option" - }, m("h2", null, opt.answer() + ':'), votes.length ? m("div", { - className: "VotesModal-list" - }, votes.map(this.voteContent.bind(this))) : m("h4", null, flarum_forum_app__WEBPACK_IMPORTED_MODULE_1___default().translator.trans('fof-polls.forum.modal.no_voters'))); - }; - _proto.voteContent = function voteContent(vote) { - var user = vote.user(); - var attrs = user && { - href: flarum_forum_app__WEBPACK_IMPORTED_MODULE_1___default().route.user(user) - }; - return m((flarum_common_components_Link__WEBPACK_IMPORTED_MODULE_5___default()), attrs, flarum_common_helpers_avatar__WEBPACK_IMPORTED_MODULE_3___default()(user), " ", flarum_common_helpers_username__WEBPACK_IMPORTED_MODULE_4___default()(user)); - }; - return ListVotersModal; -}((flarum_common_components_Modal__WEBPACK_IMPORTED_MODULE_2___default())); - - -/***/ }), - -/***/ "./src/forum/components/Poll/PollImage.tsx": -/*!*************************************************!*\ - !*** ./src/forum/components/Poll/PollImage.tsx ***! - \*************************************************/ -/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export */ __webpack_require__.d(__webpack_exports__, { -/* harmony export */ "default": () => (/* binding */ PollImage) -/* harmony export */ }); -/* harmony import */ var _babel_runtime_helpers_esm_inheritsLoose__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/esm/inheritsLoose */ "./node_modules/@babel/runtime/helpers/esm/inheritsLoose.js"); -/* harmony import */ var flarum_common_Component__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! flarum/common/Component */ "flarum/common/Component"); -/* harmony import */ var flarum_common_Component__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(flarum_common_Component__WEBPACK_IMPORTED_MODULE_1__); -/* harmony import */ var flarum_common_utils_ItemList__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! flarum/common/utils/ItemList */ "flarum/common/utils/ItemList"); -/* harmony import */ var flarum_common_utils_ItemList__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(flarum_common_utils_ItemList__WEBPACK_IMPORTED_MODULE_2__); - - - -var PollImage = /*#__PURE__*/function (_Component) { - (0,_babel_runtime_helpers_esm_inheritsLoose__WEBPACK_IMPORTED_MODULE_0__["default"])(PollImage, _Component); - function PollImage() { - var _this; - for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) { - args[_key] = arguments[_key]; - } - _this = _Component.call.apply(_Component, [this].concat(args)) || this; - _this.imageUrl = null; - _this.imageAlt = null; - return _this; - } - var _proto = PollImage.prototype; - _proto.oninit = function oninit(vnode) { - _Component.prototype.oninit.call(this, vnode); - this.imageUrl = this.attrs.poll.imageUrl(); - this.imageAlt = this.attrs.poll.imageAlt(); - }; - _proto.view = function view() { - if (!this.imageUrl) { - return; - } - return m("div", { - className: "PollImage" - }, this.imageItems().toArray()); - }; - _proto.imageItems = function imageItems() { - var _this$imageAlt; - var items = new (flarum_common_utils_ItemList__WEBPACK_IMPORTED_MODULE_2___default())(); - items.add('image', m("img", { - src: this.imageUrl, - alt: (_this$imageAlt = this.imageAlt) != null ? _this$imageAlt : '', - className: "PollImage-image", - loading: "lazy" - })); - return items; - }; - return PollImage; -}((flarum_common_Component__WEBPACK_IMPORTED_MODULE_1___default())); - - -/***/ }), - -/***/ "./src/forum/components/Poll/PollList.tsx": -/*!************************************************!*\ - !*** ./src/forum/components/Poll/PollList.tsx ***! - \************************************************/ -/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export */ __webpack_require__.d(__webpack_exports__, { -/* harmony export */ "default": () => (/* binding */ PollList) -/* harmony export */ }); -/* harmony import */ var _babel_runtime_helpers_esm_inheritsLoose__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/esm/inheritsLoose */ "./node_modules/@babel/runtime/helpers/esm/inheritsLoose.js"); -/* harmony import */ var flarum_forum_app__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! flarum/forum/app */ "flarum/forum/app"); -/* harmony import */ var flarum_forum_app__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(flarum_forum_app__WEBPACK_IMPORTED_MODULE_1__); -/* harmony import */ var flarum_common_Component__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! flarum/common/Component */ "flarum/common/Component"); -/* harmony import */ var flarum_common_Component__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(flarum_common_Component__WEBPACK_IMPORTED_MODULE_2__); -/* harmony import */ var _PollListItem__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./PollListItem */ "./src/forum/components/Poll/PollListItem.tsx"); -/* harmony import */ var flarum_common_components_Button__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! flarum/common/components/Button */ "flarum/common/components/Button"); -/* harmony import */ var flarum_common_components_Button__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(flarum_common_components_Button__WEBPACK_IMPORTED_MODULE_4__); -/* harmony import */ var flarum_common_components_LoadingIndicator__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! flarum/common/components/LoadingIndicator */ "flarum/common/components/LoadingIndicator"); -/* harmony import */ var flarum_common_components_LoadingIndicator__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(flarum_common_components_LoadingIndicator__WEBPACK_IMPORTED_MODULE_5__); -/* harmony import */ var flarum_common_components_Placeholder__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! flarum/common/components/Placeholder */ "flarum/common/components/Placeholder"); -/* harmony import */ var flarum_common_components_Placeholder__WEBPACK_IMPORTED_MODULE_6___default = /*#__PURE__*/__webpack_require__.n(flarum_common_components_Placeholder__WEBPACK_IMPORTED_MODULE_6__); -/* harmony import */ var flarum_common_utils_classList__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! flarum/common/utils/classList */ "flarum/common/utils/classList"); -/* harmony import */ var flarum_common_utils_classList__WEBPACK_IMPORTED_MODULE_7___default = /*#__PURE__*/__webpack_require__.n(flarum_common_utils_classList__WEBPACK_IMPORTED_MODULE_7__); - - - - - - - - -/** - * The `PollList` component displays a list of polls. - */ -var PollList = /*#__PURE__*/function (_Component) { - (0,_babel_runtime_helpers_esm_inheritsLoose__WEBPACK_IMPORTED_MODULE_0__["default"])(PollList, _Component); - function PollList() { - return _Component.apply(this, arguments) || this; - } - var _proto = PollList.prototype; - _proto.view = function view() { - var state = this.attrs.state; - var params = state.getParams(); - var isLoading = state.isInitialLoading() || state.isLoadingNext(); - var loading; - if (isLoading) { - loading = m((flarum_common_components_LoadingIndicator__WEBPACK_IMPORTED_MODULE_5___default()), null); - } else if (state.hasNext()) { - loading = m((flarum_common_components_Button__WEBPACK_IMPORTED_MODULE_4___default()), { - className: "Button", - onclick: state.loadNext.bind(state) - }, flarum_forum_app__WEBPACK_IMPORTED_MODULE_1___default().translator.trans('fof-polls.forum.polls_list.load_more_button')); - } - if (state.isEmpty()) { - var text = flarum_forum_app__WEBPACK_IMPORTED_MODULE_1___default().translator.trans('fof-polls.forum.polls_list.empty_text'); - return m("div", { - className: "PollList" - }, m((flarum_common_components_Placeholder__WEBPACK_IMPORTED_MODULE_6___default()), { - text: text - })); - } - return m("div", { - className: flarum_common_utils_classList__WEBPACK_IMPORTED_MODULE_7___default()('PollList', { - 'PollList--searchResults': state.isSearchResults() - }) - }, m("ul", { - "aria-busy": isLoading, - className: "PollList-polls" - }, state.getPages().map(function (pg) { - return pg.items.map(function (poll) { - return m("li", { - key: poll.id(), - "data-id": poll.id() - }, m(_PollListItem__WEBPACK_IMPORTED_MODULE_3__["default"], { - poll: poll, - params: params - })); - }); - })), m("div", { - className: "PollList-loadMore" - }, loading)); - }; - return PollList; -}((flarum_common_Component__WEBPACK_IMPORTED_MODULE_2___default())); - - -/***/ }), - -/***/ "./src/forum/components/Poll/PollListItem.tsx": -/*!****************************************************!*\ - !*** ./src/forum/components/Poll/PollListItem.tsx ***! - \****************************************************/ -/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export */ __webpack_require__.d(__webpack_exports__, { -/* harmony export */ "default": () => (/* binding */ PollListItem) -/* harmony export */ }); -/* harmony import */ var _babel_runtime_helpers_esm_inheritsLoose__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/esm/inheritsLoose */ "./node_modules/@babel/runtime/helpers/esm/inheritsLoose.js"); -/* harmony import */ var flarum_forum_app__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! flarum/forum/app */ "flarum/forum/app"); -/* harmony import */ var flarum_forum_app__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(flarum_forum_app__WEBPACK_IMPORTED_MODULE_1__); -/* harmony import */ var flarum_common_Component__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! flarum/common/Component */ "flarum/common/Component"); -/* harmony import */ var flarum_common_Component__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(flarum_common_Component__WEBPACK_IMPORTED_MODULE_2__); -/* harmony import */ var flarum_common_utils_SubtreeRetainer__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! flarum/common/utils/SubtreeRetainer */ "flarum/common/utils/SubtreeRetainer"); -/* harmony import */ var flarum_common_utils_SubtreeRetainer__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(flarum_common_utils_SubtreeRetainer__WEBPACK_IMPORTED_MODULE_3__); -/* harmony import */ var flarum_common_utils_classList__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! flarum/common/utils/classList */ "flarum/common/utils/classList"); -/* harmony import */ var flarum_common_utils_classList__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(flarum_common_utils_classList__WEBPACK_IMPORTED_MODULE_4__); -/* harmony import */ var flarum_common_components_Dropdown__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! flarum/common/components/Dropdown */ "flarum/common/components/Dropdown"); -/* harmony import */ var flarum_common_components_Dropdown__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(flarum_common_components_Dropdown__WEBPACK_IMPORTED_MODULE_5__); -/* harmony import */ var flarum_common_components_Link__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! flarum/common/components/Link */ "flarum/common/components/Link"); -/* harmony import */ var flarum_common_components_Link__WEBPACK_IMPORTED_MODULE_6___default = /*#__PURE__*/__webpack_require__.n(flarum_common_components_Link__WEBPACK_IMPORTED_MODULE_6__); -/* harmony import */ var flarum_common_helpers_highlight__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! flarum/common/helpers/highlight */ "flarum/common/helpers/highlight"); -/* harmony import */ var flarum_common_helpers_highlight__WEBPACK_IMPORTED_MODULE_7___default = /*#__PURE__*/__webpack_require__.n(flarum_common_helpers_highlight__WEBPACK_IMPORTED_MODULE_7__); -/* harmony import */ var flarum_forum_utils_slidable__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! flarum/forum/utils/slidable */ "flarum/forum/utils/slidable"); -/* harmony import */ var flarum_forum_utils_slidable__WEBPACK_IMPORTED_MODULE_8___default = /*#__PURE__*/__webpack_require__.n(flarum_forum_utils_slidable__WEBPACK_IMPORTED_MODULE_8__); -/* harmony import */ var flarum_common_helpers_icon__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! flarum/common/helpers/icon */ "flarum/common/helpers/icon"); -/* harmony import */ var flarum_common_helpers_icon__WEBPACK_IMPORTED_MODULE_9___default = /*#__PURE__*/__webpack_require__.n(flarum_common_helpers_icon__WEBPACK_IMPORTED_MODULE_9__); -/* harmony import */ var flarum_common_utils_abbreviateNumber__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! flarum/common/utils/abbreviateNumber */ "flarum/common/utils/abbreviateNumber"); -/* harmony import */ var flarum_common_utils_abbreviateNumber__WEBPACK_IMPORTED_MODULE_10___default = /*#__PURE__*/__webpack_require__.n(flarum_common_utils_abbreviateNumber__WEBPACK_IMPORTED_MODULE_10__); -/* harmony import */ var _utils_PollControls__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ../../utils/PollControls */ "./src/forum/utils/PollControls.tsx"); -/* harmony import */ var flarum_common_utils_ItemList__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! flarum/common/utils/ItemList */ "flarum/common/utils/ItemList"); -/* harmony import */ var flarum_common_utils_ItemList__WEBPACK_IMPORTED_MODULE_12___default = /*#__PURE__*/__webpack_require__.n(flarum_common_utils_ItemList__WEBPACK_IMPORTED_MODULE_12__); -/* harmony import */ var flarum_common_helpers_listItems__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! flarum/common/helpers/listItems */ "flarum/common/helpers/listItems"); -/* harmony import */ var flarum_common_helpers_listItems__WEBPACK_IMPORTED_MODULE_13___default = /*#__PURE__*/__webpack_require__.n(flarum_common_helpers_listItems__WEBPACK_IMPORTED_MODULE_13__); -/* harmony import */ var _PollViewPage__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! ../PollViewPage */ "./src/forum/components/PollViewPage.tsx"); - - - - - - - - - - - - - - - -/** - * The `PollListItem` component shows a single poll in the - * poll list. - */ -var PollListItem = /*#__PURE__*/function (_Component) { - (0,_babel_runtime_helpers_esm_inheritsLoose__WEBPACK_IMPORTED_MODULE_0__["default"])(PollListItem, _Component); - function PollListItem() { - var _this; - for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) { - args[_key] = arguments[_key]; - } - _this = _Component.call.apply(_Component, [this].concat(args)) || this; - /** - * Ensures that the poll will not be redrawn - * unless new data comes in. - */ - _this.subtree = void 0; - _this.poll = void 0; - _this.highlightRegExp = void 0; - return _this; - } - var _proto = PollListItem.prototype; - _proto.oninit = function oninit(vnode) { - var _this2 = this; - _Component.prototype.oninit.call(this, vnode); - this.poll = this.attrs.poll; - this.subtree = new (flarum_common_utils_SubtreeRetainer__WEBPACK_IMPORTED_MODULE_3___default())(function () { - return _this2.poll.freshness; - }, function () { - var time = (flarum_forum_app__WEBPACK_IMPORTED_MODULE_1___default().session).user && flarum_forum_app__WEBPACK_IMPORTED_MODULE_1___default().session.user.markedAllAsReadAt(); - return time && time.getTime(); - }, function () { - return _this2.active(); - }); - }; - _proto.elementAttrs = function elementAttrs() { - return { - className: flarum_common_utils_classList__WEBPACK_IMPORTED_MODULE_4___default()('PollListItem', { - active: this.active(), - 'PollListItem--hidden': this.poll.isHidden(), - Slidable: 'ontouchstart' in window - }) - }; - }; - _proto.view = function view() { - var controls = _utils_PollControls__WEBPACK_IMPORTED_MODULE_11__["default"].controls(this.poll, this).toArray(); - var attrs = this.elementAttrs(); - return m("div", attrs, this.controlsView(controls), this.contentView(), this.slidableUnderneathView()); - }; - _proto.controlsView = function controlsView(controls) { - return !!controls.length && m((flarum_common_components_Dropdown__WEBPACK_IMPORTED_MODULE_5___default()), { - icon: "fas fa-ellipsis-v", - className: "PollListItem-controls", - menuClassName: "Dropdown-menu--right", - buttonClassName: "Button Button--icon Button--flat", - accessibleToggleLabel: flarum_forum_app__WEBPACK_IMPORTED_MODULE_1___default().translator.trans('fof-polls.forum.poll_controls.toggle_dropdown_accessible_label') - }, controls); - }; - _proto.slidableUnderneathView = function slidableUnderneathView() { - var isUnread = this.poll.isUnread(); - return m("span", { - className: flarum_common_utils_classList__WEBPACK_IMPORTED_MODULE_4___default()('Slidable-underneath Slidable-underneath--left Slidable-underneath--elastic', { - disabled: !isUnread - }), - onclick: this.markAsRead.bind(this) - }, flarum_common_helpers_icon__WEBPACK_IMPORTED_MODULE_9___default()('fas fa-check')); - }; - _proto.contentView = function contentView() { - // const isUnread = this.poll.isUnread(); - // const isRead = this.poll.isRead(); - - return ( - //
- m("div", { - className: flarum_common_utils_classList__WEBPACK_IMPORTED_MODULE_4___default()('PollListItem-content') - }, this.mainView()) - ); - }; - _proto.mainView = function mainView() { - return m((flarum_common_components_Link__WEBPACK_IMPORTED_MODULE_6___default()), { - href: flarum_forum_app__WEBPACK_IMPORTED_MODULE_1___default().route('fof.polls.view', { - id: this.poll.id() - }), - className: "PollListItem-main" - }, m("h2", { - className: "PollListItem-title" - }, flarum_common_helpers_highlight__WEBPACK_IMPORTED_MODULE_7___default()(this.poll.question(), this.highlightRegExp)), this.poll.subtitle() && m("p", { - className: "PollListItem-subtitle helpText" - }, this.poll.subtitle()), m("ul", { - className: "PollListItem-info" - }, flarum_common_helpers_listItems__WEBPACK_IMPORTED_MODULE_13___default()(this.infoItems().toArray()))); - } - - // infoView() { - // return ( - //
- // {this.poll.subtitle() &&

{this.poll.subtitle()}

} - //
    {listItems(this.infoItems().toArray())}
- //
- // ); - // } - ; - _proto.oncreate = function oncreate(vnode) { - _Component.prototype.oncreate.call(this, vnode); - - // If we're on a touch device, set up the discussion row to be slidable. - // This allows the user to drag the row to either side of the screen to - // reveal controls. - if ('ontouchstart' in window) { - var slidableInstance = flarum_forum_utils_slidable__WEBPACK_IMPORTED_MODULE_8___default()(this.element); - this.$('.PollListItem-controls').on('hidden.bs.dropdown', function () { - return slidableInstance.reset(); - }); - } - }; - _proto.onbeforeupdate = function onbeforeupdate(vnode) { - _Component.prototype.onbeforeupdate.call(this, vnode); - return this.subtree.needsRebuild(); - } - - /** - * Determine whether or not the discussion is currently being viewed. - */; - _proto.active = function active() { - return flarum_forum_app__WEBPACK_IMPORTED_MODULE_1___default().current.matches(_PollViewPage__WEBPACK_IMPORTED_MODULE_14__["default"], { - poll: this.poll - }); - } - - /** - * Mark the poll as read. - */; - _proto.markAsRead = function markAsRead() { - if (this.poll.isUnread()) { - this.poll.save({ - lastVotedNumber: this.poll.voteCount() - }); - m.redraw(); - } - }; - _proto.infoItems = function infoItems() { - var items = new (flarum_common_utils_ItemList__WEBPACK_IMPORTED_MODULE_12___default())(); - var active = !this.poll.hasEnded(); - var activeView = this.poll.endDate() ? [flarum_common_helpers_icon__WEBPACK_IMPORTED_MODULE_9___default()('fas fa-clock'), ' ', active ? flarum_forum_app__WEBPACK_IMPORTED_MODULE_1___default().translator.trans('fof-polls.forum.days_remaining', { - time: dayjs(this.poll.endDate()).fromNow() - }) : flarum_forum_app__WEBPACK_IMPORTED_MODULE_1___default().translator.trans('fof-polls.forum.poll_ended')] : [flarum_common_helpers_icon__WEBPACK_IMPORTED_MODULE_9___default()('fas fa-infinity'), ' ', flarum_forum_app__WEBPACK_IMPORTED_MODULE_1___default().translator.trans('fof-polls.forum.poll_never_ends')]; - items.add('active', m("span", { - className: flarum_common_utils_classList__WEBPACK_IMPORTED_MODULE_4___default()('PollListItem-endStatus', { - active: active - }) - }, activeView)); - var voteCount = this.poll.voteCount(); - if (voteCount !== undefined) { - items.add('voteCount', m("span", null, flarum_common_helpers_icon__WEBPACK_IMPORTED_MODULE_9___default()('fas fa-poll fa-fw'), [' ', flarum_forum_app__WEBPACK_IMPORTED_MODULE_1___default().translator.trans('fof-polls.forum.polls_count', { - count: flarum_common_utils_abbreviateNumber__WEBPACK_IMPORTED_MODULE_10___default()(voteCount) - })]), 70); - } - return items; - }; - return PollListItem; -}((flarum_common_Component__WEBPACK_IMPORTED_MODULE_2___default())); - - -/***/ }), - -/***/ "./src/forum/components/Poll/PollOption.tsx": -/*!**************************************************!*\ - !*** ./src/forum/components/Poll/PollOption.tsx ***! - \**************************************************/ -/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export */ __webpack_require__.d(__webpack_exports__, { -/* harmony export */ "default": () => (/* binding */ PollOption) -/* harmony export */ }); -/* harmony import */ var _babel_runtime_helpers_esm_inheritsLoose__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/esm/inheritsLoose */ "./node_modules/@babel/runtime/helpers/esm/inheritsLoose.js"); -/* harmony import */ var flarum_forum_app__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! flarum/forum/app */ "flarum/forum/app"); -/* harmony import */ var flarum_forum_app__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(flarum_forum_app__WEBPACK_IMPORTED_MODULE_1__); -/* harmony import */ var flarum_common_Component__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! flarum/common/Component */ "flarum/common/Component"); -/* harmony import */ var flarum_common_Component__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(flarum_common_Component__WEBPACK_IMPORTED_MODULE_2__); -/* harmony import */ var flarum_common_components_Tooltip__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! flarum/common/components/Tooltip */ "flarum/common/components/Tooltip"); -/* harmony import */ var flarum_common_components_Tooltip__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(flarum_common_components_Tooltip__WEBPACK_IMPORTED_MODULE_3__); -/* harmony import */ var flarum_common_helpers_icon__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! flarum/common/helpers/icon */ "flarum/common/helpers/icon"); -/* harmony import */ var flarum_common_helpers_icon__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(flarum_common_helpers_icon__WEBPACK_IMPORTED_MODULE_4__); -/* harmony import */ var flarum_common_utils_classList__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! flarum/common/utils/classList */ "flarum/common/utils/classList"); -/* harmony import */ var flarum_common_utils_classList__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(flarum_common_utils_classList__WEBPACK_IMPORTED_MODULE_5__); -/* harmony import */ var flarum_common_utils_ItemList__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! flarum/common/utils/ItemList */ "flarum/common/utils/ItemList"); -/* harmony import */ var flarum_common_utils_ItemList__WEBPACK_IMPORTED_MODULE_6___default = /*#__PURE__*/__webpack_require__.n(flarum_common_utils_ItemList__WEBPACK_IMPORTED_MODULE_6__); - - - - - - - -var PollOption = /*#__PURE__*/function (_Component) { - (0,_babel_runtime_helpers_esm_inheritsLoose__WEBPACK_IMPORTED_MODULE_0__["default"])(PollOption, _Component); - function PollOption() { - var _this; - for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) { - args[_key] = arguments[_key]; - } - _this = _Component.call.apply(_Component, [this].concat(args)) || this; - _this.option = void 0; - _this.name = void 0; - _this.state = void 0; - _this.hasVoted = false; - _this.totalVotes = 0; - _this.votes = 0; - _this.voted = false; - _this.poll = void 0; - _this.canSeeVoteCount = false; - _this.answer = void 0; - return _this; - } - var _proto = PollOption.prototype; - _proto.oninit = function oninit(vnode) { - _Component.prototype.oninit.call(this, vnode); - this.option = this.attrs.option; - this.name = this.attrs.name; - this.state = this.attrs.state; - this.hasVoted = this.state.hasVoted(); - this.totalVotes = this.state.overallVoteCount(); - this.votes = this.option.voteCount(); - this.voted = this.state.hasVotedFor(this.option); - this.poll = this.state.poll; - - // isNaN(null) is false, so we have to check type directly now that API always returns the field - this.canSeeVoteCount = typeof this.votes === 'number'; - this.answer = this.option.answer(); - }; - _proto.percent = function percent() { - return this.totalVotes > 0 ? Math.round(this.votes / this.totalVotes * 100) : 0; - }; - _proto.view = function view() { - var _this$poll$myVotes; - var isDisabled = this.state.loadingOptions || this.hasVoted && !this.poll.canChangeVote(); - var width = this.canSeeVoteCount ? this.percent() : Number(this.voted) / (((_this$poll$myVotes = this.poll.myVotes()) == null ? void 0 : _this$poll$myVotes.length) || 1) * 100; - var bar = m("div", { - className: "PollBar", - "data-selected": !!this.voted, - style: "--poll-option-width: " + width + "%" - }, this.state.showCheckMarks && m("label", { - className: "PollAnswer-checkbox checkbox" - }, m("input", { - onchange: this.state.changeVote.bind(this.state, this.option), - type: "checkbox", - checked: this.voted, - disabled: isDisabled - }), 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() - }) : null); - return m("div", { - className: flarum_common_utils_classList__WEBPACK_IMPORTED_MODULE_5___default()('PollOption', this.hasVoted && 'PollVoted', this.option.imageUrl() && 'PollOption-hasImage'), - "data-id": this.option.id() - }, this.canSeeVoteCount ? m((flarum_common_components_Tooltip__WEBPACK_IMPORTED_MODULE_3___default()), { - text: flarum_forum_app__WEBPACK_IMPORTED_MODULE_1___default().translator.trans('fof-polls.forum.tooltip.votes', { - count: this.votes - }), - onremove: this.hideOptionTooltip - }, bar) : bar); - } - - /** - * Attempting to use the `tooltipVisible` attr on the Tooltip component set to 'false' when no vote count - * caused the tooltip to break on click. This is a workaround to hide the tooltip when no vote count is available, - * called on 'onremove' of the Tooltip component. It doesn't always work as intended either, but it does the job. - */; - _proto.hideOptionTooltip = function hideOptionTooltip(vnode) { - vnode.attrs.tooltipVisible = false; - - // @ts-ignore - vnode.state.updateVisibility(); - }; - _proto.optionDisplayItems = function optionDisplayItems() { - var items = new (flarum_common_utils_ItemList__WEBPACK_IMPORTED_MODULE_6___default())(); - items.add('answer', m("span", { - className: "PollAnswer-text-answer" - }, this.answer)); - this.voted && !this.state.showCheckMarks && items.add('check', flarum_common_helpers_icon__WEBPACK_IMPORTED_MODULE_4___default()('fas fa-check-circle', { - className: 'PollAnswer-check' - })); - this.canSeeVoteCount && items.add('percent', m("span", { - className: flarum_common_utils_classList__WEBPACK_IMPORTED_MODULE_5___default()('PollPercent', this.percent() !== 100 && 'PollPercent--option') - }, this.percent(), "%")); - return items; - }; - return PollOption; -}((flarum_common_Component__WEBPACK_IMPORTED_MODULE_2___default())); - - -/***/ }), - -/***/ "./src/forum/components/Poll/PollOptions.tsx": -/*!***************************************************!*\ - !*** ./src/forum/components/Poll/PollOptions.tsx ***! - \***************************************************/ -/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export */ __webpack_require__.d(__webpack_exports__, { -/* harmony export */ "default": () => (/* binding */ PollOptions) -/* harmony export */ }); -/* harmony import */ var _babel_runtime_helpers_esm_inheritsLoose__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/esm/inheritsLoose */ "./node_modules/@babel/runtime/helpers/esm/inheritsLoose.js"); -/* harmony import */ var flarum_common_Component__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! flarum/common/Component */ "flarum/common/Component"); -/* harmony import */ var flarum_common_Component__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(flarum_common_Component__WEBPACK_IMPORTED_MODULE_1__); -/* harmony import */ var _PollOption__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./PollOption */ "./src/forum/components/Poll/PollOption.tsx"); -/* harmony import */ var flarum_common_utils_ItemList__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! flarum/common/utils/ItemList */ "flarum/common/utils/ItemList"); -/* harmony import */ var flarum_common_utils_ItemList__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(flarum_common_utils_ItemList__WEBPACK_IMPORTED_MODULE_3__); - - - - -var PollOptions = /*#__PURE__*/function (_Component) { - (0,_babel_runtime_helpers_esm_inheritsLoose__WEBPACK_IMPORTED_MODULE_0__["default"])(PollOptions, _Component); - function PollOptions() { - return _Component.apply(this, arguments) || this; - } - var _proto = PollOptions.prototype; - _proto.view = function view() { - return m("div", { - className: "Poll-options list-layout" - }, this.pollOptions().toArray()); - }; - _proto.pollOptions = function pollOptions() { - var _this = this; - var items = new (flarum_common_utils_ItemList__WEBPACK_IMPORTED_MODULE_3___default())(); - this.attrs.options.forEach(function (option) { - items.add('option' + option.id(), _this.createOptionView(option)); - }); - return items; - }; - _proto.createOptionView = function createOptionView(option) { - return m(_PollOption__WEBPACK_IMPORTED_MODULE_2__["default"], { - name: this.attrs.name, - option: option, - state: this.attrs.state - }); - }; - return PollOptions; -}((flarum_common_Component__WEBPACK_IMPORTED_MODULE_1___default())); - - -/***/ }), - -/***/ "./src/forum/components/Poll/PollSubmitButton.tsx": -/*!********************************************************!*\ - !*** ./src/forum/components/Poll/PollSubmitButton.tsx ***! - \********************************************************/ -/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export */ __webpack_require__.d(__webpack_exports__, { -/* harmony export */ "default": () => (/* binding */ PollSubmitButton) -/* harmony export */ }); -/* harmony import */ var _babel_runtime_helpers_esm_inheritsLoose__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/esm/inheritsLoose */ "./node_modules/@babel/runtime/helpers/esm/inheritsLoose.js"); -/* harmony import */ var flarum_forum_app__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! flarum/forum/app */ "flarum/forum/app"); -/* harmony import */ var flarum_forum_app__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(flarum_forum_app__WEBPACK_IMPORTED_MODULE_1__); -/* harmony import */ var flarum_common_Component__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! flarum/common/Component */ "flarum/common/Component"); -/* harmony import */ var flarum_common_Component__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(flarum_common_Component__WEBPACK_IMPORTED_MODULE_2__); -/* harmony import */ var flarum_common_components_Button__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! flarum/common/components/Button */ "flarum/common/components/Button"); -/* harmony import */ var flarum_common_components_Button__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(flarum_common_components_Button__WEBPACK_IMPORTED_MODULE_3__); - - - - -var PollSubmitButton = /*#__PURE__*/function (_Component) { - (0,_babel_runtime_helpers_esm_inheritsLoose__WEBPACK_IMPORTED_MODULE_0__["default"])(PollSubmitButton, _Component); - function PollSubmitButton() { - return _Component.apply(this, arguments) || this; - } - var _proto = PollSubmitButton.prototype; - _proto.view = function view() { - var _this = this; - var state = this.attrs.state; - return m((flarum_common_components_Button__WEBPACK_IMPORTED_MODULE_3___default()), { - className: "Button Button--primary Poll-submit", - loading: state.loadingOptions, - onclick: function onclick(event) { - return _this.pollButtonSubmit(state, event); - }, - disabled: !state.hasSelectedOptions() - }, flarum_forum_app__WEBPACK_IMPORTED_MODULE_1___default().translator.trans('fof-polls.forum.poll.submit_button')); - } - - /** - * Event handler for submit button being clicked - */; - _proto.pollButtonSubmit = function pollButtonSubmit(state, event) { - state.onsubmit(); - }; - return PollSubmitButton; -}((flarum_common_Component__WEBPACK_IMPORTED_MODULE_2___default())); - - -/***/ }), - -/***/ "./src/forum/components/Poll/PollSubtitle.tsx": -/*!****************************************************!*\ - !*** ./src/forum/components/Poll/PollSubtitle.tsx ***! - \****************************************************/ -/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export */ __webpack_require__.d(__webpack_exports__, { -/* harmony export */ "default": () => (/* binding */ PollSubtitle) -/* harmony export */ }); -/* harmony import */ var _babel_runtime_helpers_esm_inheritsLoose__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/esm/inheritsLoose */ "./node_modules/@babel/runtime/helpers/esm/inheritsLoose.js"); -/* harmony import */ var flarum_common_Component__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! flarum/common/Component */ "flarum/common/Component"); -/* harmony import */ var flarum_common_Component__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(flarum_common_Component__WEBPACK_IMPORTED_MODULE_1__); -/* harmony import */ var flarum_common_utils_ItemList__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! flarum/common/utils/ItemList */ "flarum/common/utils/ItemList"); -/* harmony import */ var flarum_common_utils_ItemList__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(flarum_common_utils_ItemList__WEBPACK_IMPORTED_MODULE_2__); - - - -var PollSubtitle = /*#__PURE__*/function (_Component) { - (0,_babel_runtime_helpers_esm_inheritsLoose__WEBPACK_IMPORTED_MODULE_0__["default"])(PollSubtitle, _Component); - function PollSubtitle() { - return _Component.apply(this, arguments) || this; - } - var _proto = PollSubtitle.prototype; - _proto.view = function view() { - if (!this.attrs.poll.subtitle()) { - return; - } - return m("div", { - className: "Poll-subtitle-component" - }, this.pollSubtitleItems().toArray()); - }; - _proto.pollSubtitleItems = function pollSubtitleItems() { - var items = new (flarum_common_utils_ItemList__WEBPACK_IMPORTED_MODULE_2___default())(); - items.add('subtitle', m("p", { - className: "Poll-subtitle" - }, this.attrs.poll.subtitle())); - return items; - }; - return PollSubtitle; -}((flarum_common_Component__WEBPACK_IMPORTED_MODULE_1___default())); - - -/***/ }), - -/***/ "./src/forum/components/Poll/PollTitle.tsx": -/*!*************************************************!*\ - !*** ./src/forum/components/Poll/PollTitle.tsx ***! - \*************************************************/ -/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export */ __webpack_require__.d(__webpack_exports__, { -/* harmony export */ "default": () => (/* binding */ PollTitle) -/* harmony export */ }); -/* harmony import */ var _babel_runtime_helpers_esm_inheritsLoose__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/esm/inheritsLoose */ "./node_modules/@babel/runtime/helpers/esm/inheritsLoose.js"); -/* harmony import */ var flarum_common_Component__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! flarum/common/Component */ "flarum/common/Component"); -/* harmony import */ var flarum_common_Component__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(flarum_common_Component__WEBPACK_IMPORTED_MODULE_1__); -/* harmony import */ var flarum_common_utils_ItemList__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! flarum/common/utils/ItemList */ "flarum/common/utils/ItemList"); -/* harmony import */ var flarum_common_utils_ItemList__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(flarum_common_utils_ItemList__WEBPACK_IMPORTED_MODULE_2__); - - - -var PollTitle = /*#__PURE__*/function (_Component) { - (0,_babel_runtime_helpers_esm_inheritsLoose__WEBPACK_IMPORTED_MODULE_0__["default"])(PollTitle, _Component); - function PollTitle() { - return _Component.apply(this, arguments) || this; - } - var _proto = PollTitle.prototype; - _proto.view = function view() { - return m("div", { - className: "Poll-title-component" - }, this.pollTitleItems().toArray()); - }; - _proto.pollTitleItems = function pollTitleItems() { - var items = new (flarum_common_utils_ItemList__WEBPACK_IMPORTED_MODULE_2___default())(); - items.add('title', m("h2", { - className: "Poll-title" - }, this.attrs.poll.question())); - return items; - }; - return PollTitle; -}((flarum_common_Component__WEBPACK_IMPORTED_MODULE_1___default())); - - -/***/ }), - -/***/ "./src/forum/components/PollForm.tsx": -/*!*******************************************!*\ - !*** ./src/forum/components/PollForm.tsx ***! - \*******************************************/ -/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export */ __webpack_require__.d(__webpack_exports__, { -/* harmony export */ "default": () => (/* binding */ PollForm) -/* harmony export */ }); -/* harmony import */ var _babel_runtime_helpers_esm_asyncToGenerator__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/esm/asyncToGenerator */ "./node_modules/@babel/runtime/helpers/esm/asyncToGenerator.js"); -/* harmony import */ var _babel_runtime_helpers_esm_inheritsLoose__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/esm/inheritsLoose */ "./node_modules/@babel/runtime/helpers/esm/inheritsLoose.js"); -/* harmony import */ var _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @babel/runtime/regenerator */ "./node_modules/@babel/runtime/regenerator/index.js"); -/* harmony import */ var _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_2__); -/* harmony import */ var flarum_common_Component__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! flarum/common/Component */ "flarum/common/Component"); -/* harmony import */ var flarum_common_Component__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(flarum_common_Component__WEBPACK_IMPORTED_MODULE_3__); -/* harmony import */ var flarum_forum_app__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! flarum/forum/app */ "flarum/forum/app"); -/* harmony import */ var flarum_forum_app__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(flarum_forum_app__WEBPACK_IMPORTED_MODULE_4__); -/* harmony import */ var flarum_common_components_Button__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! flarum/common/components/Button */ "flarum/common/components/Button"); -/* harmony import */ var flarum_common_components_Button__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(flarum_common_components_Button__WEBPACK_IMPORTED_MODULE_5__); -/* harmony import */ var flarum_common_components_Switch__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! flarum/common/components/Switch */ "flarum/common/components/Switch"); -/* harmony import */ var flarum_common_components_Switch__WEBPACK_IMPORTED_MODULE_6___default = /*#__PURE__*/__webpack_require__.n(flarum_common_components_Switch__WEBPACK_IMPORTED_MODULE_6__); -/* harmony import */ var flarum_common_utils_ItemList__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! flarum/common/utils/ItemList */ "flarum/common/utils/ItemList"); -/* harmony import */ var flarum_common_utils_ItemList__WEBPACK_IMPORTED_MODULE_7___default = /*#__PURE__*/__webpack_require__.n(flarum_common_utils_ItemList__WEBPACK_IMPORTED_MODULE_7__); -/* harmony import */ var flarum_common_utils_Stream__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! flarum/common/utils/Stream */ "flarum/common/utils/Stream"); -/* harmony import */ var flarum_common_utils_Stream__WEBPACK_IMPORTED_MODULE_8___default = /*#__PURE__*/__webpack_require__.n(flarum_common_utils_Stream__WEBPACK_IMPORTED_MODULE_8__); -/* harmony import */ var flarum_common_utils_extractText__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! flarum/common/utils/extractText */ "flarum/common/utils/extractText"); -/* harmony import */ var flarum_common_utils_extractText__WEBPACK_IMPORTED_MODULE_9___default = /*#__PURE__*/__webpack_require__.n(flarum_common_utils_extractText__WEBPACK_IMPORTED_MODULE_9__); -/* harmony import */ var _form_FormError__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ./form/FormError */ "./src/forum/components/form/FormError.tsx"); -/* harmony import */ var _states_PollFormState__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ../states/PollFormState */ "./src/forum/states/PollFormState.ts"); -/* harmony import */ var _utils_PollControls__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ../utils/PollControls */ "./src/forum/utils/PollControls.tsx"); -/* harmony import */ var _UploadPollImageButton__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! ./UploadPollImageButton */ "./src/forum/components/UploadPollImageButton.tsx"); -/* harmony import */ var flarum_common_components_Tooltip__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! flarum/common/components/Tooltip */ "flarum/common/components/Tooltip"); -/* harmony import */ var flarum_common_components_Tooltip__WEBPACK_IMPORTED_MODULE_14___default = /*#__PURE__*/__webpack_require__.n(flarum_common_components_Tooltip__WEBPACK_IMPORTED_MODULE_14__); - - - - - - - - - - - - - - - -var PollForm = /*#__PURE__*/function (_Component) { - (0,_babel_runtime_helpers_esm_inheritsLoose__WEBPACK_IMPORTED_MODULE_1__["default"])(PollForm, _Component); - function PollForm() { - var _this; - for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) { - args[_key] = arguments[_key]; - } - _this = _Component.call.apply(_Component, [this].concat(args)) || this; - _this.options = []; - _this.optionAnswers = []; - _this.optionImageUrls = []; - _this.question = void 0; - _this.subtitle = void 0; - _this.image = void 0; - _this.imageAlt = void 0; - _this.endDate = void 0; - _this.publicPoll = void 0; - _this.allowMultipleVotes = void 0; - _this.hideVotes = void 0; - _this.allowChangeVote = void 0; - _this.maxVotes = void 0; - _this.datepickerMinDate = ''; - return _this; - } - var _proto = PollForm.prototype; - _proto.oninit = function oninit(vnode) { - var _poll$tempOptions; - _Component.prototype.oninit.call(this, vnode); - this.state = new _states_PollFormState__WEBPACK_IMPORTED_MODULE_11__["default"](this.attrs.poll); - - // state handles poll initialization - var poll = this.state.poll; - this.options = (_poll$tempOptions = poll.tempOptions) != null ? _poll$tempOptions : poll.options(); - this.optionAnswers = this.options.map(function (o) { - return flarum_common_utils_Stream__WEBPACK_IMPORTED_MODULE_8___default()(o.answer()); - }); - this.optionImageUrls = this.options.map(function (o) { - return flarum_common_utils_Stream__WEBPACK_IMPORTED_MODULE_8___default()(o.imageUrl()); - }); - this.question = flarum_common_utils_Stream__WEBPACK_IMPORTED_MODULE_8___default()(poll.question()); - this.subtitle = flarum_common_utils_Stream__WEBPACK_IMPORTED_MODULE_8___default()(poll.subtitle()); - this.image = flarum_common_utils_Stream__WEBPACK_IMPORTED_MODULE_8___default()(poll.image()); - this.imageAlt = flarum_common_utils_Stream__WEBPACK_IMPORTED_MODULE_8___default()(poll.imageAlt()); - this.endDate = flarum_common_utils_Stream__WEBPACK_IMPORTED_MODULE_8___default()(this.formatDate(poll.endDate())); - this.publicPoll = flarum_common_utils_Stream__WEBPACK_IMPORTED_MODULE_8___default()(poll.publicPoll()); - this.allowMultipleVotes = flarum_common_utils_Stream__WEBPACK_IMPORTED_MODULE_8___default()(poll.allowMultipleVotes()); - this.hideVotes = flarum_common_utils_Stream__WEBPACK_IMPORTED_MODULE_8___default()(poll.hideVotes()); - this.allowChangeVote = flarum_common_utils_Stream__WEBPACK_IMPORTED_MODULE_8___default()(poll.allowChangeVote()); - this.maxVotes = flarum_common_utils_Stream__WEBPACK_IMPORTED_MODULE_8___default()(poll.maxVotes() || 0); - - // Set minimum date for datepicker to current date - this.datepickerMinDate = this.formatDate(); - - // Replace minimum of 'today' for poll end date only if the poll is not already closed - if (this.endDate() && dayjs(poll.endDate).isAfter(dayjs())) { - // We know that endDate is set, so we can safely cast the result to string - this.datepickerMinDate = this.formatDate(poll.endDate()); - } - }; - _proto.view = function view() { - return m("form", { - onsubmit: this.onsubmit.bind(this) - }, m("div", { - className: "PollDiscussionModal-form" - }, this.fields().toArray())); - }; - _proto.fields = function fields() { - var items = new (flarum_common_utils_ItemList__WEBPACK_IMPORTED_MODULE_7___default())(); - items.add('question', m("div", { - className: "Form-group" - }, m("label", { - className: "label" - }, flarum_forum_app__WEBPACK_IMPORTED_MODULE_4___default().translator.trans('fof-polls.forum.modal.question_placeholder')), m("input", { - type: "text", - name: "question", - className: "FormControl", - bidi: this.question - })), 100); - items.add('subtitle', m("div", { - className: "Form-group" - }, m("label", { - className: "label" - }, flarum_forum_app__WEBPACK_IMPORTED_MODULE_4___default().translator.trans('fof-polls.forum.modal.subtitle_placeholder')), m("input", { - type: "text", - name: "subtitle", - className: "FormControl", - bidi: this.subtitle - })), 95); - items.add('poll_image', m("div", { - className: "Form-group" - }, m("label", { - className: "label" - }, flarum_forum_app__WEBPACK_IMPORTED_MODULE_4___default().translator.trans('fof-polls.forum.modal.poll_image.label')), m("p", { - className: "helpText" - }, flarum_forum_app__WEBPACK_IMPORTED_MODULE_4___default().translator.trans('fof-polls.forum.modal.poll_image.help')), m(_UploadPollImageButton__WEBPACK_IMPORTED_MODULE_13__["default"], { - name: "pollImage", - poll: this.state.poll, - onUpload: this.pollImageUploadSuccess.bind(this) - }), m("input", { - type: "hidden", - name: "pollImage", - value: this.image() - })), 90); - if (this.image()) { - items.add('poll_image_alt', m("div", { - className: "Form-group" - }, m("label", { - className: "label" - }, flarum_forum_app__WEBPACK_IMPORTED_MODULE_4___default().translator.trans('fof-polls.forum.modal.poll_image.alt_label')), m("input", { - type: "text", - required: true, - name: "imageAlt", - className: "FormControl", - bidi: this.imageAlt - }), m("p", { - className: "helpText" - }, flarum_forum_app__WEBPACK_IMPORTED_MODULE_4___default().translator.trans('fof-polls.forum.modal.poll_image.alt_help_text'))), 90); - } - items.add('answers', m("div", { - className: "PollModal--answers Form-group" - }, m("label", { - className: "label PollModal--answers-title" - }, m("span", null, flarum_forum_app__WEBPACK_IMPORTED_MODULE_4___default().translator.trans('fof-polls.forum.modal.options_label'))), this.displayOptions(), m((flarum_common_components_Tooltip__WEBPACK_IMPORTED_MODULE_14___default()), { - text: flarum_forum_app__WEBPACK_IMPORTED_MODULE_4___default().translator.trans('fof-polls.forum.modal.tooltip.options.add-button') - }, m((flarum_common_components_Button__WEBPACK_IMPORTED_MODULE_5___default()), { - className: "Button PollModal--button Button--icon PollModal--add-button", - icon: "fas fa-plus", - onclick: this.addOption.bind(this) - }))), 80); - items.add('date', m("div", { - className: "Form-group" - }, m("label", { - className: "label" - }, flarum_forum_app__WEBPACK_IMPORTED_MODULE_4___default().translator.trans('fof-polls.forum.modal.date_placeholder')), m("div", { - className: "PollModal--date" - }, m("input", { - className: "FormControl", - type: "datetime-local", - name: "date", - bidi: this.endDate, - min: this.datepickerMinDate, - max: this.formatDate('2038') - }), flarum_common_components_Button__WEBPACK_IMPORTED_MODULE_5___default().component({ - className: 'Button PollModal--button Button--icon', - icon: 'fas fa-times', - onclick: this.endDate.bind(this, null) - })), this.endDate() && m("p", { - className: "helpText" - }, m("i", { - "class": "icon fas fa-clock" - }), "\xA0", dayjs(this.endDate()).isBefore(dayjs()) ? flarum_forum_app__WEBPACK_IMPORTED_MODULE_4___default().translator.trans('fof-polls.forum.poll_ended') : flarum_forum_app__WEBPACK_IMPORTED_MODULE_4___default().translator.trans('fof-polls.forum.days_remaining', { - time: dayjs(this.endDate()).fromNow() - }))), 40); - items.add('public', m("div", { - className: "Form-group" - }, flarum_common_components_Switch__WEBPACK_IMPORTED_MODULE_6___default().component({ - state: this.publicPoll() || false, - onchange: this.publicPoll - }, flarum_forum_app__WEBPACK_IMPORTED_MODULE_4___default().translator.trans('fof-polls.forum.modal.public_poll_label'))), 20); - items.add('hide-votes', m("div", { - className: "Form-group" - }, m((flarum_common_components_Switch__WEBPACK_IMPORTED_MODULE_6___default()), { - state: this.endDate() && this.hideVotes(), - onchange: this.hideVotes, - disabled: !this.endDate() - }, flarum_forum_app__WEBPACK_IMPORTED_MODULE_4___default().translator.trans('fof-polls.forum.modal.hide_votes_label'))), 20); - items.add('allow-change-vote', m("div", { - className: "Form-group" - }, m((flarum_common_components_Switch__WEBPACK_IMPORTED_MODULE_6___default()), { - state: this.allowChangeVote(), - onchange: this.allowChangeVote - }, flarum_forum_app__WEBPACK_IMPORTED_MODULE_4___default().translator.trans('fof-polls.forum.modal.allow_change_vote_label'))), 20); - items.add('allow-multiple-votes', m("div", { - className: "Form-group" - }, flarum_common_components_Switch__WEBPACK_IMPORTED_MODULE_6___default().component({ - state: this.allowMultipleVotes() || false, - onchange: this.allowMultipleVotes - }, flarum_forum_app__WEBPACK_IMPORTED_MODULE_4___default().translator.trans('fof-polls.forum.modal.allow_multiple_votes_label'))), 15); - if (this.allowMultipleVotes()) { - items.add('max-votes', m("div", { - className: "Form-group" - }, m("label", { - className: "label" - }, flarum_forum_app__WEBPACK_IMPORTED_MODULE_4___default().translator.trans('fof-polls.forum.modal.max_votes_label')), m("input", { - type: "number", - min: "0", - max: this.options.length, - name: "maxVotes", - className: "FormControl", - bidi: this.maxVotes - }), m("p", { - className: "helpText" - }, flarum_forum_app__WEBPACK_IMPORTED_MODULE_4___default().translator.trans('fof-polls.forum.modal.max_votes_help'))), 15); - } - items.add('submit', m("div", { - className: "Form-group" - }, m((flarum_common_components_Button__WEBPACK_IMPORTED_MODULE_5___default()), { - type: "submit", - className: "Button Button--primary PollModal-SubmitButton", - icon: "fas fa-save", - loading: this.state.loading - }, flarum_forum_app__WEBPACK_IMPORTED_MODULE_4___default().translator.trans('fof-polls.forum.modal.submit')), this.state.poll.exists && m((flarum_common_components_Button__WEBPACK_IMPORTED_MODULE_5___default()), { - className: "Button Button--secondary PollModal-deleteButton", - icon: "fas fa-trash-alt", - loading: this.state.deleting, - onclick: this["delete"].bind(this) - }, flarum_forum_app__WEBPACK_IMPORTED_MODULE_4___default().translator.trans('fof-polls.forum.modal.delete'))), -10); - return items; - }; - _proto.displayOptions = function displayOptions() { - var _this2 = this; - return Object.keys(this.options).map(function (option, i) { - return m("div", { - className: "Form-group" - }, m("fieldset", { - className: "Poll-answer-input" - }, m("input", { - className: "FormControl", - type: "text", - name: 'answer' + (i + 1), - bidi: _this2.optionAnswers[i], - placeholder: flarum_forum_app__WEBPACK_IMPORTED_MODULE_4___default().translator.trans('fof-polls.forum.modal.option_placeholder') + ' #' + (i + 1) - }), flarum_forum_app__WEBPACK_IMPORTED_MODULE_4___default().forum.attribute('allowPollOptionImage') ? m("input", { - className: "FormControl", - type: "text", - name: 'answerImage' + (i + 1), - bidi: _this2.optionImageUrls[i], - placeholder: flarum_forum_app__WEBPACK_IMPORTED_MODULE_4___default().translator.trans('fof-polls.forum.modal.image_option_placeholder') + ' #' + (i + 1) - }) : null), i >= 2 ? flarum_common_components_Button__WEBPACK_IMPORTED_MODULE_5___default().component({ - type: 'button', - className: 'Button PollModal--button Button--icon', - icon: 'fas fa-minus', - onclick: i >= 2 ? _this2.removeOption.bind(_this2, i) : '' - }) : ''); - }); - }; - _proto.addOption = function addOption() { - var max = Math.max(flarum_forum_app__WEBPACK_IMPORTED_MODULE_4___default().forum.attribute('pollMaxOptions'), 2); - if (this.options.length < max) { - this.options.push(flarum_forum_app__WEBPACK_IMPORTED_MODULE_4___default().store.createRecord('poll_options')); - this.optionAnswers.push(flarum_common_utils_Stream__WEBPACK_IMPORTED_MODULE_8___default()('')); - this.optionImageUrls.push(flarum_common_utils_Stream__WEBPACK_IMPORTED_MODULE_8___default()('')); - } else { - alert(flarum_common_utils_extractText__WEBPACK_IMPORTED_MODULE_9___default()(flarum_forum_app__WEBPACK_IMPORTED_MODULE_4___default().translator.trans('fof-polls.forum.modal.max', { - max: max - }))); - } - }; - _proto.removeOption = function removeOption(i) { - this.options.splice(i, 1); - this.optionAnswers.splice(i, 1); - this.optionImageUrls.splice(i, 1); - }; - _proto.data = function data() { - var _this3 = this, - _this$dateToTimestamp; - if (this.question() === '') { - throw new _form_FormError__WEBPACK_IMPORTED_MODULE_10__["default"](flarum_forum_app__WEBPACK_IMPORTED_MODULE_4___default().translator.trans('fof-polls.forum.modal.include_question')); - } - if (this.options.length < 2) { - throw new _form_FormError__WEBPACK_IMPORTED_MODULE_10__["default"](flarum_forum_app__WEBPACK_IMPORTED_MODULE_4___default().translator.trans('fof-polls.forum.modal.min')); - } - var pollExists = this.state.poll.exists; - var options = this.options.map(function (option, i) { - option.pushAttributes({ - answer: _this3.optionAnswers[i](), - imageUrl: _this3.optionImageUrls[i]() - }); - return pollExists ? option.data : option.data.attributes; - }); - return { - question: this.question(), - subtitle: this.subtitle(), - pollImage: this.image(), - imageAlt: this.imageAlt(), - endDate: (_this$dateToTimestamp = this.dateToTimestamp(this.endDate())) != null ? _this$dateToTimestamp : false, - publicPoll: this.publicPoll(), - hideVotes: this.hideVotes(), - allowChangeVote: this.allowChangeVote(), - allowMultipleVotes: this.allowMultipleVotes(), - maxVotes: this.maxVotes(), - options: options - }; - }; - _proto.onsubmit = /*#__PURE__*/function () { - var _onsubmit = (0,_babel_runtime_helpers_esm_asyncToGenerator__WEBPACK_IMPORTED_MODULE_0__["default"])( /*#__PURE__*/_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_2___default().mark(function _callee(event) { - return _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_2___default().wrap(function _callee$(_context) { - while (1) switch (_context.prev = _context.next) { - case 0: - event.preventDefault(); - _context.prev = 1; - _context.next = 4; - return this.attrs.onsubmit(this.data(), this.state); - case 4: - _context.next = 9; - break; - case 6: - _context.prev = 6; - _context.t0 = _context["catch"](1); - if (_context.t0 instanceof _form_FormError__WEBPACK_IMPORTED_MODULE_10__["default"]) { - flarum_forum_app__WEBPACK_IMPORTED_MODULE_4___default().alerts.show({ - type: 'error' - }, _context.t0.message); - } else { - console.error(_context.t0); - // Show error alert - flarum_forum_app__WEBPACK_IMPORTED_MODULE_4___default().alerts.show({ - type: 'error' - }, flarum_forum_app__WEBPACK_IMPORTED_MODULE_4___default().translator.trans('fof-polls.forum.modal.error')); - } - case 9: - case "end": - return _context.stop(); - } - }, _callee, this, [[1, 6]]); - })); - function onsubmit(_x) { - return _onsubmit.apply(this, arguments); - } - return onsubmit; - }(); - _proto["delete"] = /*#__PURE__*/function () { - var _delete2 = (0,_babel_runtime_helpers_esm_asyncToGenerator__WEBPACK_IMPORTED_MODULE_0__["default"])( /*#__PURE__*/_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_2___default().mark(function _callee2() { - return _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_2___default().wrap(function _callee2$(_context2) { - while (1) switch (_context2.prev = _context2.next) { - case 0: - this.state.loading = true; - _context2.prev = 1; - _context2.next = 4; - return _utils_PollControls__WEBPACK_IMPORTED_MODULE_12__["default"].deleteAction(this.state.poll); - case 4: - this.state.deleting = true; - case 5: - _context2.prev = 5; - this.state.loading = false; - m.redraw(); - return _context2.finish(5); - case 9: - case "end": - return _context2.stop(); - } - }, _callee2, this, [[1,, 5, 9]]); - })); - function _delete() { - return _delete2.apply(this, arguments); - } - return _delete; - }(); - _proto.formatDate = function formatDate(date, def) { - if (date === void 0) { - date = undefined; - } - if (def === void 0) { - def = false; - } - var dayjsDate = dayjs(date); - if (date === false || !dayjsDate.isValid()) return def !== false ? this.formatDate(def) : false; - return dayjsDate.format('YYYY-MM-DDTHH:mm'); - }; - _proto.dateToTimestamp = function dateToTimestamp(date) { - var dayjsDate = dayjs(date); - if (!date || !dayjsDate.isValid()) return null; - return dayjsDate.format(); - }; - _proto.pollImageUploadSuccess = function pollImageUploadSuccess(fileName) { - this.image(fileName); - }; - return PollForm; -}((flarum_common_Component__WEBPACK_IMPORTED_MODULE_3___default())); - - -/***/ }), - -/***/ "./src/forum/components/PollShowcase.tsx": -/*!***********************************************!*\ - !*** ./src/forum/components/PollShowcase.tsx ***! - \***********************************************/ -/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export */ __webpack_require__.d(__webpack_exports__, { -/* harmony export */ "default": () => (/* binding */ PollShowcase) -/* harmony export */ }); -/* harmony import */ var _babel_runtime_helpers_esm_inheritsLoose__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/esm/inheritsLoose */ "./node_modules/@babel/runtime/helpers/esm/inheritsLoose.js"); -/* harmony import */ var flarum_common_Component__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! flarum/common/Component */ "flarum/common/Component"); -/* harmony import */ var flarum_common_Component__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(flarum_common_Component__WEBPACK_IMPORTED_MODULE_1__); -/* harmony import */ var flarum_common_utils_ItemList__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! flarum/common/utils/ItemList */ "flarum/common/utils/ItemList"); -/* harmony import */ var flarum_common_utils_ItemList__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(flarum_common_utils_ItemList__WEBPACK_IMPORTED_MODULE_2__); -/* harmony import */ var _PollShowcaseItem__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./PollShowcaseItem */ "./src/forum/components/PollShowcaseItem.tsx"); -/* harmony import */ var flarum_common_components_Placeholder__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! flarum/common/components/Placeholder */ "flarum/common/components/Placeholder"); -/* harmony import */ var flarum_common_components_Placeholder__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(flarum_common_components_Placeholder__WEBPACK_IMPORTED_MODULE_4__); -/* harmony import */ var flarum_forum_app__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! flarum/forum/app */ "flarum/forum/app"); -/* harmony import */ var flarum_forum_app__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(flarum_forum_app__WEBPACK_IMPORTED_MODULE_5__); - - - - - - -var PollShowcase = /*#__PURE__*/function (_Component) { - (0,_babel_runtime_helpers_esm_inheritsLoose__WEBPACK_IMPORTED_MODULE_0__["default"])(PollShowcase, _Component); - function PollShowcase() { - return _Component.apply(this, arguments) || this; - } - var _proto = PollShowcase.prototype; - _proto.oninit = function oninit(vnode) { - _Component.prototype.oninit.call(this, vnode); - this.attrs.state.refresh(); - }; - _proto.view = function view() { - return m("div", { - className: "PollShowcase" - }, m("div", { - className: "PollShowcase-featured" - }, m("h3", null, flarum_forum_app__WEBPACK_IMPORTED_MODULE_5___default().translator.trans('fof-polls.forum.showcase.active-polls')), this.showcaseItems().toArray(), this.showcaseItems().toArray().length === 0 && m((flarum_common_components_Placeholder__WEBPACK_IMPORTED_MODULE_4___default()), { - text: flarum_forum_app__WEBPACK_IMPORTED_MODULE_5___default().translator.trans('fof-polls.forum.showcase.no-active-polls') - })), m("div", { - className: "PollShowcase-ended" - }, m("h3", null, flarum_forum_app__WEBPACK_IMPORTED_MODULE_5___default().translator.trans('fof-polls.forum.showcase.ended-polls')), this.endedItems().toArray(), this.endedItems().toArray().length === 0 && m((flarum_common_components_Placeholder__WEBPACK_IMPORTED_MODULE_4___default()), { - text: flarum_forum_app__WEBPACK_IMPORTED_MODULE_5___default().translator.trans('fof-polls.forum.showcase.no-recent-polls') - }))); - }; - _proto.showcaseItems = function showcaseItems() { - var items = new (flarum_common_utils_ItemList__WEBPACK_IMPORTED_MODULE_2___default())(); - this.attrs.state.getPages().map(function (page) { - page.items.map(function (poll) { - if (!poll.hasEnded()) { - items.add('poll-active-' + poll.id(), m(_PollShowcaseItem__WEBPACK_IMPORTED_MODULE_3__["default"], { - poll: poll - })); - } - }); - }); - return items; - }; - _proto.endedItems = function endedItems() { - var items = new (flarum_common_utils_ItemList__WEBPACK_IMPORTED_MODULE_2___default())(); - this.attrs.state.getPages().map(function (page) { - page.items.map(function (poll) { - if (poll.hasEnded()) { - items.add('poll-ended-' + poll.id(), m(_PollShowcaseItem__WEBPACK_IMPORTED_MODULE_3__["default"], { - poll: poll - })); - } - }); - }); - return items; - }; - return PollShowcase; -}((flarum_common_Component__WEBPACK_IMPORTED_MODULE_1___default())); - - -/***/ }), - -/***/ "./src/forum/components/PollShowcaseItem.tsx": -/*!***************************************************!*\ - !*** ./src/forum/components/PollShowcaseItem.tsx ***! - \***************************************************/ -/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export */ __webpack_require__.d(__webpack_exports__, { -/* harmony export */ "default": () => (/* binding */ PollShowcaseItem) -/* harmony export */ }); -/* harmony import */ var _babel_runtime_helpers_esm_inheritsLoose__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/esm/inheritsLoose */ "./node_modules/@babel/runtime/helpers/esm/inheritsLoose.js"); -/* harmony import */ var flarum_common_Component__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! flarum/common/Component */ "flarum/common/Component"); -/* harmony import */ var flarum_common_Component__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(flarum_common_Component__WEBPACK_IMPORTED_MODULE_1__); -/* harmony import */ var _PollView__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./PollView */ "./src/forum/components/PollView.tsx"); - - - -var PollShowcaseItem = /*#__PURE__*/function (_Component) { - (0,_babel_runtime_helpers_esm_inheritsLoose__WEBPACK_IMPORTED_MODULE_0__["default"])(PollShowcaseItem, _Component); - function PollShowcaseItem() { - var _this; - for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) { - args[_key] = arguments[_key]; - } - _this = _Component.call.apply(_Component, [this].concat(args)) || this; - _this.poll = void 0; - return _this; - } - var _proto = PollShowcaseItem.prototype; - _proto.oninit = function oninit(vnode) { - _Component.prototype.oninit.call(this, vnode); - this.poll = this.attrs.poll; - }; - _proto.view = function view() { - return m("div", { - className: "PollShowcase--item" - }, m(_PollView__WEBPACK_IMPORTED_MODULE_2__["default"], { - poll: this.poll - })); - }; - return PollShowcaseItem; -}((flarum_common_Component__WEBPACK_IMPORTED_MODULE_1___default())); - - -/***/ }), - -/***/ "./src/forum/components/PollView.tsx": -/*!*******************************************!*\ - !*** ./src/forum/components/PollView.tsx ***! - \*******************************************/ -/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export */ __webpack_require__.d(__webpack_exports__, { -/* harmony export */ "default": () => (/* binding */ PollView) -/* harmony export */ }); -/* harmony import */ var _babel_runtime_helpers_esm_inheritsLoose__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/esm/inheritsLoose */ "./node_modules/@babel/runtime/helpers/esm/inheritsLoose.js"); -/* harmony import */ var flarum_common_Component__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! flarum/common/Component */ "flarum/common/Component"); -/* harmony import */ var flarum_common_Component__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(flarum_common_Component__WEBPACK_IMPORTED_MODULE_1__); -/* harmony import */ var flarum_forum_app__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! flarum/forum/app */ "flarum/forum/app"); -/* harmony import */ var flarum_forum_app__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(flarum_forum_app__WEBPACK_IMPORTED_MODULE_2__); -/* harmony import */ var _Poll_PollOptions__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./Poll/PollOptions */ "./src/forum/components/Poll/PollOptions.tsx"); -/* harmony import */ var _Poll_PollImage__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./Poll/PollImage */ "./src/forum/components/Poll/PollImage.tsx"); -/* harmony import */ var _states_PollState__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../states/PollState */ "./src/forum/states/PollState.ts"); -/* harmony import */ var flarum_common_components_Button__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! flarum/common/components/Button */ "flarum/common/components/Button"); -/* harmony import */ var flarum_common_components_Button__WEBPACK_IMPORTED_MODULE_6___default = /*#__PURE__*/__webpack_require__.n(flarum_common_components_Button__WEBPACK_IMPORTED_MODULE_6__); -/* harmony import */ var flarum_common_utils_ItemList__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! flarum/common/utils/ItemList */ "flarum/common/utils/ItemList"); -/* harmony import */ var flarum_common_utils_ItemList__WEBPACK_IMPORTED_MODULE_7___default = /*#__PURE__*/__webpack_require__.n(flarum_common_utils_ItemList__WEBPACK_IMPORTED_MODULE_7__); -/* harmony import */ var _utils_PollControls__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ../utils/PollControls */ "./src/forum/utils/PollControls.tsx"); -/* harmony import */ var flarum_common_components_Dropdown__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! flarum/common/components/Dropdown */ "flarum/common/components/Dropdown"); -/* harmony import */ var flarum_common_components_Dropdown__WEBPACK_IMPORTED_MODULE_9___default = /*#__PURE__*/__webpack_require__.n(flarum_common_components_Dropdown__WEBPACK_IMPORTED_MODULE_9__); -/* harmony import */ var _Poll_PollSubmitButton__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ./Poll/PollSubmitButton */ "./src/forum/components/Poll/PollSubmitButton.tsx"); -/* harmony import */ var flarum_common_utils_string__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! flarum/common/utils/string */ "flarum/common/utils/string"); -/* harmony import */ var flarum_common_utils_string__WEBPACK_IMPORTED_MODULE_11___default = /*#__PURE__*/__webpack_require__.n(flarum_common_utils_string__WEBPACK_IMPORTED_MODULE_11__); -/* harmony import */ var flarum_common_utils_classList__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! flarum/common/utils/classList */ "flarum/common/utils/classList"); -/* harmony import */ var flarum_common_utils_classList__WEBPACK_IMPORTED_MODULE_12___default = /*#__PURE__*/__webpack_require__.n(flarum_common_utils_classList__WEBPACK_IMPORTED_MODULE_12__); -/* harmony import */ var _Poll_PollTitle__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! ./Poll/PollTitle */ "./src/forum/components/Poll/PollTitle.tsx"); -/* harmony import */ var _Poll_PollSubtitle__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! ./Poll/PollSubtitle */ "./src/forum/components/Poll/PollSubtitle.tsx"); - - - - - - - - - - - - - - - -var PollView = /*#__PURE__*/function (_Component) { - (0,_babel_runtime_helpers_esm_inheritsLoose__WEBPACK_IMPORTED_MODULE_0__["default"])(PollView, _Component); - function PollView() { - var _this; - for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) { - args[_key] = arguments[_key]; - } - _this = _Component.call.apply(_Component, [this].concat(args)) || this; - _this.state = void 0; - /** - * Alert before navigating away using browser's 'beforeunload' event - */ - _this.preventClose = function (e) { - if (_this.state.hasSelectedOptions()) { - e.preventDefault(); - return true; - } - }; - return _this; - } - var _proto = PollView.prototype; - _proto.oninit = function oninit(vnode) { - _Component.prototype.oninit.call(this, vnode); - this.state = new _states_PollState__WEBPACK_IMPORTED_MODULE_5__["default"](this.attrs.poll); - }; - _proto.oncreate = function oncreate(vnode) { - _Component.prototype.oncreate.call(this, vnode); - this.preventClose = this.preventClose.bind(this); - window.addEventListener('beforeunload', this.preventClose); - }; - _proto.onremove = function onremove(vnode) { - _Component.prototype.onremove.call(this, vnode); - window.removeEventListener('beforeunload', this.preventClose); - }; - _proto.view = function view() { - var poll = this.attrs.poll; - var state = this.state; - var controls = _utils_PollControls__WEBPACK_IMPORTED_MODULE_8__["default"].controls(poll, this); - (poll.publicPoll() || poll.canEdit()) && controls.add('view', m((flarum_common_components_Button__WEBPACK_IMPORTED_MODULE_6___default()), { - onclick: state.showVoters, - icon: "fas fa-poll" - }, flarum_forum_app__WEBPACK_IMPORTED_MODULE_2___default().translator.trans('fof-polls.forum.public_poll'))); - return m("div", { - className: flarum_common_utils_classList__WEBPACK_IMPORTED_MODULE_12___default()('Poll', poll.imageUrl() && 'Poll--image'), - "data-id": poll.id() - }, this.controlsView(controls.toArray()), m("div", { - className: "Poll-wrapper" - }, this.createMainView().toArray())); - }; - _proto.createMainView = function createMainView() { - var items = new (flarum_common_utils_ItemList__WEBPACK_IMPORTED_MODULE_7___default())(); - var poll = this.attrs.poll; - items.add('header', m("div", { - className: "Poll-header" - }, this.createPollHeader().toArray())); - items.add('content', m("div", { - className: "Poll-content" - }, this.createPollContent().toArray())); - items.add('footer', m("div", { - className: "Poll-footer" - }, this.createPollFooter().toArray())); - return items; - }; - _proto.createPollHeader = function createPollHeader() { - var items = new (flarum_common_utils_ItemList__WEBPACK_IMPORTED_MODULE_7___default())(); - var poll = this.attrs.poll; - items.add('title', m(_Poll_PollTitle__WEBPACK_IMPORTED_MODULE_13__["default"], { - poll: poll - })); - if (poll.subtitle()) items.add('subtitle', m(_Poll_PollSubtitle__WEBPACK_IMPORTED_MODULE_14__["default"], { - poll: poll - })); - return items; - }; - _proto.createPollContent = function createPollContent() { - var items = new (flarum_common_utils_ItemList__WEBPACK_IMPORTED_MODULE_7___default())(); - var poll = this.attrs.poll; - if (poll.imageUrl()) { - items.add('image', m(_Poll_PollImage__WEBPACK_IMPORTED_MODULE_4__["default"], { - poll: poll - })); - } - items.add('form', m("form", { - className: "Poll-form" - }, this.createFormItems().toArray())); - return items; - }; - _proto.createPollFooter = function createPollFooter() { - var items = new (flarum_common_utils_ItemList__WEBPACK_IMPORTED_MODULE_7___default())(); - var state = this.state; - var infoItems = this.infoItems(state.getMaxVotes()); - items.add('sticky', m("div", { - className: "Poll-sticky" - }, !infoItems.isEmpty() && m("div", { - className: "helpText PollInfoText" - }, infoItems.toArray()), state.showButton() && m(_Poll_PollSubmitButton__WEBPACK_IMPORTED_MODULE_10__["default"], { - state: state - }))); - return items; - }; - _proto.createFormItems = function createFormItems() { - var items = new (flarum_common_utils_ItemList__WEBPACK_IMPORTED_MODULE_7___default())(); - var poll = this.attrs.poll; - var state = this.state; - var questionSlug = (0,flarum_common_utils_string__WEBPACK_IMPORTED_MODULE_11__.slug)(poll.question()); - items.add('elements', m("fieldset", null, m("legend", { - className: "sr-only" - }, poll.question()), m(_Poll_PollOptions__WEBPACK_IMPORTED_MODULE_3__["default"], { - name: questionSlug, - options: poll.options(), - state: state - }))); - return items; - }; - _proto.controlsView = function controlsView(controls) { - return !!controls.length && m((flarum_common_components_Dropdown__WEBPACK_IMPORTED_MODULE_9___default()), { - icon: "fas fa-ellipsis-v", - className: "PollListItem-controls", - menuClassName: "Dropdown-menu--right", - buttonClassName: "Button Button--icon Button--flat", - accessibleToggleLabel: flarum_forum_app__WEBPACK_IMPORTED_MODULE_2___default().translator.trans('fof-polls.forum.poll_controls.toggle_dropdown_accessible_label') - }, controls); - }; - _proto.infoItems = function infoItems(maxVotes) { - var items = new (flarum_common_utils_ItemList__WEBPACK_IMPORTED_MODULE_7___default())(); - var poll = this.attrs.poll; - if ((flarum_forum_app__WEBPACK_IMPORTED_MODULE_2___default().session).user && !poll.canVote() && !poll.hasEnded()) { - items.add('no-permission', m("span", null, m("i", { - className: "icon fas fa-times-circle fa-fw" - }), flarum_forum_app__WEBPACK_IMPORTED_MODULE_2___default().translator.trans('fof-polls.forum.no_permission'))); - } - if (poll.endDate()) { - items.add('end-date', m("span", null, m("i", { - "class": "icon fas fa-clock fa-fw" - }), poll.hasEnded() ? flarum_forum_app__WEBPACK_IMPORTED_MODULE_2___default().translator.trans('fof-polls.forum.poll_ended') : flarum_forum_app__WEBPACK_IMPORTED_MODULE_2___default().translator.trans('fof-polls.forum.days_remaining', { - time: dayjs(poll.endDate()).fromNow() - }))); - } - if (poll.canVote()) { - items.add('max-votes', m("span", null, m("i", { - className: "icon fas fa-poll fa-fw" - }), flarum_forum_app__WEBPACK_IMPORTED_MODULE_2___default().translator.trans('fof-polls.forum.max_votes_allowed', { - max: maxVotes - }))); - if (!poll.canChangeVote()) { - items.add('cannot-change-vote', m("span", null, m("i", { - className: "icon fas fa-" + (this.state.hasVoted() ? 'times' : 'exclamation') + "-circle fa-fw" - }), flarum_forum_app__WEBPACK_IMPORTED_MODULE_2___default().translator.trans('fof-polls.forum.poll.cannot_change_vote'))); - } - } - return items; - }; - return PollView; -}((flarum_common_Component__WEBPACK_IMPORTED_MODULE_1___default())); - - -/***/ }), - -/***/ "./src/forum/components/PollViewPage.tsx": -/*!***********************************************!*\ - !*** ./src/forum/components/PollViewPage.tsx ***! - \***********************************************/ -/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export */ __webpack_require__.d(__webpack_exports__, { -/* harmony export */ "default": () => (/* binding */ PollViewPage) -/* harmony export */ }); -/* harmony import */ var _babel_runtime_helpers_esm_inheritsLoose__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/esm/inheritsLoose */ "./node_modules/@babel/runtime/helpers/esm/inheritsLoose.js"); -/* harmony import */ var flarum_forum_app__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! flarum/forum/app */ "flarum/forum/app"); -/* harmony import */ var flarum_forum_app__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(flarum_forum_app__WEBPACK_IMPORTED_MODULE_1__); -/* harmony import */ var _PollView__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./PollView */ "./src/forum/components/PollView.tsx"); -/* harmony import */ var _AbstractPollPage__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./AbstractPollPage */ "./src/forum/components/AbstractPollPage.tsx"); - - - - -var PollViewPage = /*#__PURE__*/function (_AbstractPollPage) { - (0,_babel_runtime_helpers_esm_inheritsLoose__WEBPACK_IMPORTED_MODULE_0__["default"])(PollViewPage, _AbstractPollPage); - function PollViewPage() { - return _AbstractPollPage.apply(this, arguments) || this; - } - var _proto = PollViewPage.prototype; - _proto.oninit = function oninit(vnode) { - var _this = this; - _AbstractPollPage.prototype.oninit.call(this, vnode); - if (!flarum_forum_app__WEBPACK_IMPORTED_MODULE_1___default().forum.attribute('globalPollsEnabled')) { - m.route.set('/'); - return; - } - var editId = m.route.param('id'); - this.poll = flarum_forum_app__WEBPACK_IMPORTED_MODULE_1___default().store.getById('poll', editId); - if (!this.poll) { - this.loading = true; - flarum_forum_app__WEBPACK_IMPORTED_MODULE_1___default().store.find('fof/polls', editId).then(function (item) { - _this.poll = item; - _this.loading = false; - flarum_forum_app__WEBPACK_IMPORTED_MODULE_1___default().setTitle(_this.poll.question()); - m.redraw(); - }); - } - }; - _proto.contentItems = function contentItems() { - var items = _AbstractPollPage.prototype.contentItems.call(this); - if (!this.loading) { - items.add('poll', m(_PollView__WEBPACK_IMPORTED_MODULE_2__["default"], { - poll: this.poll - })); - } - return items; - }; - return PollViewPage; -}(_AbstractPollPage__WEBPACK_IMPORTED_MODULE_3__.AbstractPollPage); - - -/***/ }), - -/***/ "./src/forum/components/PollsPage.tsx": -/*!********************************************!*\ - !*** ./src/forum/components/PollsPage.tsx ***! - \********************************************/ -/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export */ __webpack_require__.d(__webpack_exports__, { -/* harmony export */ "default": () => (/* binding */ PollsPage) -/* harmony export */ }); -/* harmony import */ var _babel_runtime_helpers_esm_inheritsLoose__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/esm/inheritsLoose */ "./node_modules/@babel/runtime/helpers/esm/inheritsLoose.js"); -/* harmony import */ var flarum_forum_app__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! flarum/forum/app */ "flarum/forum/app"); -/* harmony import */ var flarum_forum_app__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(flarum_forum_app__WEBPACK_IMPORTED_MODULE_1__); -/* harmony import */ var flarum_common_helpers_listItems__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! flarum/common/helpers/listItems */ "flarum/common/helpers/listItems"); -/* harmony import */ var flarum_common_helpers_listItems__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(flarum_common_helpers_listItems__WEBPACK_IMPORTED_MODULE_2__); -/* harmony import */ var flarum_common_utils_ItemList__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! flarum/common/utils/ItemList */ "flarum/common/utils/ItemList"); -/* harmony import */ var flarum_common_utils_ItemList__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(flarum_common_utils_ItemList__WEBPACK_IMPORTED_MODULE_3__); -/* harmony import */ var flarum_forum_components_IndexPage__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! flarum/forum/components/IndexPage */ "flarum/forum/components/IndexPage"); -/* harmony import */ var flarum_forum_components_IndexPage__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(flarum_forum_components_IndexPage__WEBPACK_IMPORTED_MODULE_4__); -/* harmony import */ var _Poll_PollList__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./Poll/PollList */ "./src/forum/components/Poll/PollList.tsx"); -/* harmony import */ var flarum_forum_components_LogInModal__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! flarum/forum/components/LogInModal */ "flarum/forum/components/LogInModal"); -/* harmony import */ var flarum_forum_components_LogInModal__WEBPACK_IMPORTED_MODULE_6___default = /*#__PURE__*/__webpack_require__.n(flarum_forum_components_LogInModal__WEBPACK_IMPORTED_MODULE_6__); -/* harmony import */ var flarum_common_utils_extractText__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! flarum/common/utils/extractText */ "flarum/common/utils/extractText"); -/* harmony import */ var flarum_common_utils_extractText__WEBPACK_IMPORTED_MODULE_7___default = /*#__PURE__*/__webpack_require__.n(flarum_common_utils_extractText__WEBPACK_IMPORTED_MODULE_7__); -/* harmony import */ var _states_PollListState__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ../states/PollListState */ "./src/forum/states/PollListState.ts"); -/* harmony import */ var flarum_common_components_Button__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! flarum/common/components/Button */ "flarum/common/components/Button"); -/* harmony import */ var flarum_common_components_Button__WEBPACK_IMPORTED_MODULE_9___default = /*#__PURE__*/__webpack_require__.n(flarum_common_components_Button__WEBPACK_IMPORTED_MODULE_9__); -/* harmony import */ var flarum_common_components_SelectDropdown__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! flarum/common/components/SelectDropdown */ "flarum/common/components/SelectDropdown"); -/* harmony import */ var flarum_common_components_SelectDropdown__WEBPACK_IMPORTED_MODULE_10___default = /*#__PURE__*/__webpack_require__.n(flarum_common_components_SelectDropdown__WEBPACK_IMPORTED_MODULE_10__); -/* harmony import */ var flarum_common_components_LoadingIndicator__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! flarum/common/components/LoadingIndicator */ "flarum/common/components/LoadingIndicator"); -/* harmony import */ var flarum_common_components_LoadingIndicator__WEBPACK_IMPORTED_MODULE_11___default = /*#__PURE__*/__webpack_require__.n(flarum_common_components_LoadingIndicator__WEBPACK_IMPORTED_MODULE_11__); -/* harmony import */ var _PollView__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ./PollView */ "./src/forum/components/PollView.tsx"); -/* harmony import */ var _AbstractPollPage__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! ./AbstractPollPage */ "./src/forum/components/AbstractPollPage.tsx"); - - - - - - - - - - - - - - -var PollsPage = /*#__PURE__*/function (_AbstractPollPage) { - (0,_babel_runtime_helpers_esm_inheritsLoose__WEBPACK_IMPORTED_MODULE_0__["default"])(PollsPage, _AbstractPollPage); - function PollsPage() { - return _AbstractPollPage.apply(this, arguments) || this; - } - var _proto = PollsPage.prototype; - _proto.oninit = function oninit(vnode) { - _AbstractPollPage.prototype.oninit.call(this, vnode); - if (!flarum_forum_app__WEBPACK_IMPORTED_MODULE_1___default().forum.attribute('globalPollsEnabled')) { - m.route.set('/'); - return; - } - this.state = new _states_PollListState__WEBPACK_IMPORTED_MODULE_8__["default"]({ - sort: m.route.param('sort'), - filter: m.route.param('filter') - }); - this.state.refresh(); - flarum_forum_app__WEBPACK_IMPORTED_MODULE_1___default().setTitle(flarum_common_utils_extractText__WEBPACK_IMPORTED_MODULE_7___default()(flarum_forum_app__WEBPACK_IMPORTED_MODULE_1___default().translator.trans('fof-polls.forum.page.nav'))); - }; - _proto.view = function view() { - if (this.loading) { - return m((flarum_common_components_LoadingIndicator__WEBPACK_IMPORTED_MODULE_11___default()), null); - } - if (this.poll) { - return m("div", { - className: "PollsListPage" - }, m("div", { - className: "container" - }, m(_PollView__WEBPACK_IMPORTED_MODULE_12__["default"], { - poll: this.poll - }))); - } - return m("div", { - className: "PollsListPage" - }, _AbstractPollPage.prototype.hero.call(this), m("div", { - className: "container" - }, m("div", { - className: "sideNavContainer" - }, m("nav", { - className: "PollsListPage-nav sideNav" - }, m("ul", null, flarum_common_helpers_listItems__WEBPACK_IMPORTED_MODULE_2___default()(this.sidebarItems().toArray()))), m("div", { - className: "PollsPage-results sideNavOffset" - }, m("div", { - className: "IndexPage-toolbar" - }, m("ul", { - className: "IndexPage-toolbar-view" - }, flarum_common_helpers_listItems__WEBPACK_IMPORTED_MODULE_2___default()(this.viewItems().toArray())), m("ul", { - className: "IndexPage-toolbar-action" - }, flarum_common_helpers_listItems__WEBPACK_IMPORTED_MODULE_2___default()(this.actionItems().toArray()))), m(_Poll_PollList__WEBPACK_IMPORTED_MODULE_5__["default"], { - state: this.state - }))))); - }; - _proto.sidebarItems = function sidebarItems() { - var _this = this; - var items = new (flarum_common_utils_ItemList__WEBPACK_IMPORTED_MODULE_3___default())(); - var canStartPoll = flarum_forum_app__WEBPACK_IMPORTED_MODULE_1___default().forum.attribute('canStartGlobalPolls'); - items.add('newGlobalPoll', m((flarum_common_components_Button__WEBPACK_IMPORTED_MODULE_9___default()), { - icon: "fas fa-edit", - className: "Button Button--primary App-primaryControl PollsPage-newPoll", - itemClassName: "App-primaryControl", - onclick: function onclick() { - _this.newPollAction(); - }, - disabled: !canStartPoll - }, flarum_forum_app__WEBPACK_IMPORTED_MODULE_1___default().translator.trans("fof-polls.forum.poll." + (canStartPoll ? 'start_poll_button' : 'cannot_start_poll_button')))); - items.add('nav', m((flarum_common_components_SelectDropdown__WEBPACK_IMPORTED_MODULE_10___default()), { - buttonClassName: "Button", - className: "App-titleControl", - accessibleToggleLabel: flarum_forum_app__WEBPACK_IMPORTED_MODULE_1___default().translator.trans('core.forum.index.toggle_sidenav_dropdown_accessible_label') - }, this.navItems().toArray())); - return items; - }; - _proto.actionItems = function actionItems() { - var _this2 = this; - var items = new (flarum_common_utils_ItemList__WEBPACK_IMPORTED_MODULE_3___default())(); - items.add('refresh', flarum_common_components_Button__WEBPACK_IMPORTED_MODULE_9___default().component({ - title: flarum_forum_app__WEBPACK_IMPORTED_MODULE_1___default().translator.trans('fof-polls.forum.page.refresh_tooltip'), - icon: 'fas fa-sync', - className: 'Button Button--icon', - onclick: function onclick() { - _this2.state.refresh(); - } - })); - return items; - }; - _proto.viewItems = function viewItems() { - return flarum_forum_components_IndexPage__WEBPACK_IMPORTED_MODULE_4___default().prototype.viewItems(); - }; - _proto.navItems = function navItems() { - return flarum_forum_components_IndexPage__WEBPACK_IMPORTED_MODULE_4___default().prototype.navItems(); - } - - /** - * Change to create new poll page - */; - _proto.newPollAction = function newPollAction() { - if (!(flarum_forum_app__WEBPACK_IMPORTED_MODULE_1___default().session).user) { - flarum_forum_app__WEBPACK_IMPORTED_MODULE_1___default().modal.show((flarum_forum_components_LogInModal__WEBPACK_IMPORTED_MODULE_6___default())); - return; - } - m.route.set(flarum_forum_app__WEBPACK_IMPORTED_MODULE_1___default().route('fof.polls.compose')); - }; - return PollsPage; -}(_AbstractPollPage__WEBPACK_IMPORTED_MODULE_13__.AbstractPollPage); - - -/***/ }), - -/***/ "./src/forum/components/PollsShowcasePage.tsx": -/*!****************************************************!*\ - !*** ./src/forum/components/PollsShowcasePage.tsx ***! - \****************************************************/ -/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export */ __webpack_require__.d(__webpack_exports__, { -/* harmony export */ "default": () => (/* binding */ PollsShowcasePage) -/* harmony export */ }); -/* harmony import */ var _babel_runtime_helpers_esm_inheritsLoose__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/esm/inheritsLoose */ "./node_modules/@babel/runtime/helpers/esm/inheritsLoose.js"); -/* harmony import */ var flarum_forum_app__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! flarum/forum/app */ "flarum/forum/app"); -/* harmony import */ var flarum_forum_app__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(flarum_forum_app__WEBPACK_IMPORTED_MODULE_1__); -/* harmony import */ var _states_PollListState__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../states/PollListState */ "./src/forum/states/PollListState.ts"); -/* harmony import */ var flarum_common_utils_extractText__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! flarum/common/utils/extractText */ "flarum/common/utils/extractText"); -/* harmony import */ var flarum_common_utils_extractText__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(flarum_common_utils_extractText__WEBPACK_IMPORTED_MODULE_3__); -/* harmony import */ var flarum_common_components_Button__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! flarum/common/components/Button */ "flarum/common/components/Button"); -/* harmony import */ var flarum_common_components_Button__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(flarum_common_components_Button__WEBPACK_IMPORTED_MODULE_4__); -/* harmony import */ var flarum_forum_components_LogInModal__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! flarum/forum/components/LogInModal */ "flarum/forum/components/LogInModal"); -/* harmony import */ var flarum_forum_components_LogInModal__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(flarum_forum_components_LogInModal__WEBPACK_IMPORTED_MODULE_5__); -/* harmony import */ var _AbstractPollPage__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./AbstractPollPage */ "./src/forum/components/AbstractPollPage.tsx"); -/* harmony import */ var _PollShowcase__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./PollShowcase */ "./src/forum/components/PollShowcase.tsx"); - - - - - - - - -var PollsShowcasePage = /*#__PURE__*/function (_AbstractPollPage) { - (0,_babel_runtime_helpers_esm_inheritsLoose__WEBPACK_IMPORTED_MODULE_0__["default"])(PollsShowcasePage, _AbstractPollPage); - function PollsShowcasePage() { - return _AbstractPollPage.apply(this, arguments) || this; - } - var _proto = PollsShowcasePage.prototype; - _proto.oninit = function oninit(vnode) { - _AbstractPollPage.prototype.oninit.call(this, vnode); - if (!flarum_forum_app__WEBPACK_IMPORTED_MODULE_1___default().forum.attribute('globalPollsEnabled')) { - m.route.set('/'); - return; - } - this.state = new _states_PollListState__WEBPACK_IMPORTED_MODULE_2__["default"]({ - sort: m.route.param('sort'), - filter: m.route.param('filter'), - include: this.includeParams() - }); - this.state.refresh(); - flarum_forum_app__WEBPACK_IMPORTED_MODULE_1___default().setTitle(flarum_common_utils_extractText__WEBPACK_IMPORTED_MODULE_3___default()(flarum_forum_app__WEBPACK_IMPORTED_MODULE_1___default().translator.trans('fof-polls.forum.page.nav'))); - }; - _proto.includeParams = function includeParams() { - return ['options', 'votes', 'myVotes', 'myVotes.option']; - }; - _proto.contentItems = function contentItems() { - var items = _AbstractPollPage.prototype.contentItems.call(this); - if (!this.loading) { - items.add('poll-showcase', m(_PollShowcase__WEBPACK_IMPORTED_MODULE_7__["default"], { - state: this.state - })); - } - return items; - }; - _proto.sidebarItems = function sidebarItems() { - var _this = this; - var items = _AbstractPollPage.prototype.sidebarItems.call(this); - var canStartPoll = flarum_forum_app__WEBPACK_IMPORTED_MODULE_1___default().forum.attribute('canStartGlobalPolls'); - if (canStartPoll) { - items.remove('newDiscussion'); - items.add('newGlobalPoll', m((flarum_common_components_Button__WEBPACK_IMPORTED_MODULE_4___default()), { - icon: "fas fa-edit", - className: "Button Button--primary App-primaryControl PollsPage-newPoll", - itemClassName: "App-primaryControl", - onclick: function onclick() { - _this.newPollAction(); - }, - disabled: !canStartPoll - }, flarum_forum_app__WEBPACK_IMPORTED_MODULE_1___default().translator.trans("fof-polls.forum.poll." + (canStartPoll ? 'start_poll_button' : 'cannot_start_poll_button'))), 100); - } - return items; - }; - _proto.newPollAction = function newPollAction() { - if (!(flarum_forum_app__WEBPACK_IMPORTED_MODULE_1___default().session).user) { - flarum_forum_app__WEBPACK_IMPORTED_MODULE_1___default().modal.show((flarum_forum_components_LogInModal__WEBPACK_IMPORTED_MODULE_5___default())); - return; - } - m.route.set(flarum_forum_app__WEBPACK_IMPORTED_MODULE_1___default().route('fof.polls.compose')); - }; - return PollsShowcasePage; -}(_AbstractPollPage__WEBPACK_IMPORTED_MODULE_6__.AbstractPollPage); - - -/***/ }), - -/***/ "./src/forum/components/PostPoll.tsx": -/*!*******************************************!*\ - !*** ./src/forum/components/PostPoll.tsx ***! - \*******************************************/ -/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export */ __webpack_require__.d(__webpack_exports__, { -/* harmony export */ "default": () => (/* binding */ PostPoll) -/* harmony export */ }); -/* harmony import */ var _babel_runtime_helpers_esm_inheritsLoose__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/esm/inheritsLoose */ "./node_modules/@babel/runtime/helpers/esm/inheritsLoose.js"); -/* harmony import */ var flarum_forum_app__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! flarum/forum/app */ "flarum/forum/app"); -/* harmony import */ var flarum_forum_app__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(flarum_forum_app__WEBPACK_IMPORTED_MODULE_1__); -/* harmony import */ var flarum_common_Component__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! flarum/common/Component */ "flarum/common/Component"); -/* harmony import */ var flarum_common_Component__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(flarum_common_Component__WEBPACK_IMPORTED_MODULE_2__); -/* harmony import */ var flarum_common_components_Button__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! flarum/common/components/Button */ "flarum/common/components/Button"); -/* harmony import */ var flarum_common_components_Button__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(flarum_common_components_Button__WEBPACK_IMPORTED_MODULE_3__); -/* harmony import */ var flarum_forum_components_LogInModal__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! flarum/forum/components/LogInModal */ "flarum/forum/components/LogInModal"); -/* harmony import */ var flarum_forum_components_LogInModal__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(flarum_forum_components_LogInModal__WEBPACK_IMPORTED_MODULE_4__); -/* harmony import */ var _ListVotersModal__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./ListVotersModal */ "./src/forum/components/ListVotersModal.tsx"); -/* harmony import */ var flarum_common_utils_classList__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! flarum/common/utils/classList */ "flarum/common/utils/classList"); -/* harmony import */ var flarum_common_utils_classList__WEBPACK_IMPORTED_MODULE_6___default = /*#__PURE__*/__webpack_require__.n(flarum_common_utils_classList__WEBPACK_IMPORTED_MODULE_6__); -/* harmony import */ var flarum_common_utils_ItemList__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! flarum/common/utils/ItemList */ "flarum/common/utils/ItemList"); -/* harmony import */ var flarum_common_utils_ItemList__WEBPACK_IMPORTED_MODULE_7___default = /*#__PURE__*/__webpack_require__.n(flarum_common_utils_ItemList__WEBPACK_IMPORTED_MODULE_7__); -/* harmony import */ var flarum_common_components_Tooltip__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! flarum/common/components/Tooltip */ "flarum/common/components/Tooltip"); -/* harmony import */ var flarum_common_components_Tooltip__WEBPACK_IMPORTED_MODULE_8___default = /*#__PURE__*/__webpack_require__.n(flarum_common_components_Tooltip__WEBPACK_IMPORTED_MODULE_8__); -/* harmony import */ var flarum_common_helpers_icon__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! flarum/common/helpers/icon */ "flarum/common/helpers/icon"); -/* harmony import */ var flarum_common_helpers_icon__WEBPACK_IMPORTED_MODULE_9___default = /*#__PURE__*/__webpack_require__.n(flarum_common_helpers_icon__WEBPACK_IMPORTED_MODULE_9__); -/* harmony import */ var _EditPollModal__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ./EditPollModal */ "./src/forum/components/EditPollModal.tsx"); -/* harmony import */ var flarum_common_utils_extractText__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! flarum/common/utils/extractText */ "flarum/common/utils/extractText"); -/* harmony import */ var flarum_common_utils_extractText__WEBPACK_IMPORTED_MODULE_11___default = /*#__PURE__*/__webpack_require__.n(flarum_common_utils_extractText__WEBPACK_IMPORTED_MODULE_11__); - - - - - - - - - - - - -var PostPoll = /*#__PURE__*/function (_Component) { - (0,_babel_runtime_helpers_esm_inheritsLoose__WEBPACK_IMPORTED_MODULE_0__["default"])(PostPoll, _Component); - function PostPoll() { - var _this; - for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) { - args[_key] = arguments[_key]; - } - _this = _Component.call.apply(_Component, [this].concat(args)) || this; - _this.loadingOptions = false; - _this.useSubmitUI = void 0; - _this.pendingSubmit = false; - _this.pendingOptions = void 0; - return _this; - } - var _proto = PostPoll.prototype; - _proto.oninit = function oninit(vnode) { - var _this$attrs$poll, _this$attrs$poll2; - _Component.prototype.oninit.call(this, vnode); - this.useSubmitUI = !((_this$attrs$poll = this.attrs.poll) != null && _this$attrs$poll.canChangeVote()) && ((_this$attrs$poll2 = this.attrs.poll) == null ? void 0 : _this$attrs$poll2.allowMultipleVotes()); - this.pendingOptions = null; - }; - _proto.oncreate = function oncreate(vnode) { - _Component.prototype.oncreate.call(this, vnode); - this.preventClose = this.preventClose.bind(this); - window.addEventListener('beforeunload', this.preventClose); - }; - _proto.onremove = function onremove(vnode) { - _Component.prototype.onremove.call(this, vnode); - window.removeEventListener('beforeunload', this.preventClose); - }; - _proto.view = function view() { - var poll = this.attrs.poll; - var options = poll.options() || []; - var maxVotes = poll.allowMultipleVotes() ? poll.maxVotes() : 1; - if (maxVotes === 0) maxVotes = options.length; - var infoItems = this.infoItems(maxVotes); - return m("div", { - className: "Post-poll", - "data-id": poll.id() - }, m("div", { - className: "PollHeading" - }, m("div", { - className: "PollHeading-title-container" - }, m("h3", { - className: "PollHeading-title" - }, poll.question()), poll.subtitle() && m("p", { - className: "helpText PollHeading-subtitle" - }, poll.subtitle())), m("div", { - className: "PollHeading-actions" - }, poll.canSeeVoters() && m((flarum_common_components_Tooltip__WEBPACK_IMPORTED_MODULE_8___default()), { - text: flarum_forum_app__WEBPACK_IMPORTED_MODULE_1___default().translator.trans('fof-polls.forum.public_poll') - }, m((flarum_common_components_Button__WEBPACK_IMPORTED_MODULE_3___default()), { - className: "Button PollHeading-voters", - onclick: this.showVoters.bind(this), - icon: "fas fa-poll" - })), poll.canEdit() && m((flarum_common_components_Tooltip__WEBPACK_IMPORTED_MODULE_8___default()), { - text: flarum_forum_app__WEBPACK_IMPORTED_MODULE_1___default().translator.trans('fof-polls.forum.moderation.edit') - }, m((flarum_common_components_Button__WEBPACK_IMPORTED_MODULE_3___default()), { - className: "Button PollHeading-edit", - onclick: flarum_forum_app__WEBPACK_IMPORTED_MODULE_1___default().modal.show.bind((flarum_forum_app__WEBPACK_IMPORTED_MODULE_1___default().modal), _EditPollModal__WEBPACK_IMPORTED_MODULE_10__["default"], { - poll: poll - }), - icon: "fas fa-pen" - })), poll.canDelete() && m((flarum_common_components_Tooltip__WEBPACK_IMPORTED_MODULE_8___default()), { - text: flarum_forum_app__WEBPACK_IMPORTED_MODULE_1___default().translator.trans('fof-polls.forum.moderation.delete') - }, m((flarum_common_components_Button__WEBPACK_IMPORTED_MODULE_3___default()), { - className: "Button PollHeading-delete", - onclick: this.deletePoll.bind(this), - icon: "fas fa-trash" - })))), m("div", null, m("div", { - className: "PollOptions" - }, options.map(this.viewOption.bind(this))), m("div", { - className: "Poll-sticky" - }, !infoItems.isEmpty() && m("div", { - className: "helpText PollInfoText" - }, infoItems.toArray()), this.useSubmitUI && this.pendingSubmit && m((flarum_common_components_Button__WEBPACK_IMPORTED_MODULE_3___default()), { - className: "Button Button--primary Poll-submit", - loading: this.loadingOptions, - onclick: this.onsubmit.bind(this) - }, flarum_forum_app__WEBPACK_IMPORTED_MODULE_1___default().translator.trans('fof-polls.forum.poll.submit_button'))))); - }; - _proto.infoItems = function infoItems(maxVotes) { - var _poll$myVotes; - var items = new (flarum_common_utils_ItemList__WEBPACK_IMPORTED_MODULE_7___default())(); - var poll = this.attrs.poll; - var hasVoted = ((_poll$myVotes = poll.myVotes()) == null ? void 0 : _poll$myVotes.length) > 0; - if ((flarum_forum_app__WEBPACK_IMPORTED_MODULE_1___default().session).user && !poll.canVote() && !poll.hasEnded()) { - items.add('no-permission', m("span", null, m("i", { - className: "icon fas fa-times-circle fa-fw" - }), flarum_forum_app__WEBPACK_IMPORTED_MODULE_1___default().translator.trans('fof-polls.forum.no_permission'))); - } - if (poll.endDate()) { - items.add('end-date', m("span", null, m("i", { - "class": "icon fas fa-clock fa-fw" - }), poll.hasEnded() ? flarum_forum_app__WEBPACK_IMPORTED_MODULE_1___default().translator.trans('fof-polls.forum.poll_ended') : flarum_forum_app__WEBPACK_IMPORTED_MODULE_1___default().translator.trans('fof-polls.forum.days_remaining', { - time: dayjs(poll.endDate()).fromNow() - }))); - } - if (poll.canVote()) { - items.add('max-votes', m("span", null, m("i", { - className: "icon fas fa-poll fa-fw" - }), flarum_forum_app__WEBPACK_IMPORTED_MODULE_1___default().translator.trans('fof-polls.forum.max_votes_allowed', { - max: maxVotes - }))); - if (!poll.canChangeVote()) { - items.add('cannot-change-vote', m("span", null, m("i", { - className: "icon fas fa-" + (hasVoted ? 'times' : 'exclamation') + "-circle fa-fw" - }), flarum_forum_app__WEBPACK_IMPORTED_MODULE_1___default().translator.trans('fof-polls.forum.poll.cannot_change_vote'))); - } - } - return items; - }; - _proto.viewOption = function viewOption(opt) { - var _poll$myVotes2, _poll$myVotes3, _poll$myVotes4; - var poll = this.attrs.poll; - var hasVoted = ((_poll$myVotes2 = poll.myVotes()) == null ? void 0 : _poll$myVotes2.length) > 0; - var totalVotes = poll.voteCount(); - var voted = this.pendingOptions ? this.pendingOptions.has(opt.id()) : (_poll$myVotes3 = poll.myVotes()) == null || _poll$myVotes3.some == null ? void 0 : _poll$myVotes3.some(function (vote) { - return vote.option() === opt; - }); - var votes = opt.voteCount(); - var percent = totalVotes > 0 ? Math.round(votes / totalVotes * 100) : 0; - - // isNaN(null) is false, so we have to check type directly now that API always returns the field - var canSeeVoteCount = typeof votes === 'number'; - var isDisabled = this.loadingOptions || hasVoted && !poll.canChangeVote(); - var width = canSeeVoteCount ? percent : Number(voted) / (((_poll$myVotes4 = poll.myVotes()) == null ? void 0 : _poll$myVotes4.length) || 1) * 100; - var showCheckmark = !(flarum_forum_app__WEBPACK_IMPORTED_MODULE_1___default().session).user || !poll.hasEnded() && poll.canVote() && (!hasVoted || poll.canChangeVote()); - var bar = m("div", { - className: "PollBar", - "data-selected": !!voted, - style: "--poll-option-width: " + width + "%" - }, showCheckmark && m("label", { - className: "PollAnswer-checkbox checkbox" - }, m("input", { - onchange: this.changeVote.bind(this, opt), - type: "checkbox", - checked: voted, - disabled: isDisabled - }), m("span", { - className: "checkmark" - })), m("div", { - className: "PollAnswer-text" - }, m("span", { - className: "PollAnswer-text-answer" - }, opt.answer()), voted && !showCheckmark && flarum_common_helpers_icon__WEBPACK_IMPORTED_MODULE_9___default()('fas fa-check-circle', { - className: 'PollAnswer-check' - }), canSeeVoteCount && m("span", { - className: flarum_common_utils_classList__WEBPACK_IMPORTED_MODULE_6___default()('PollPercent', percent !== 100 && 'PollPercent--option') - }, percent, "%")), opt.imageUrl() ? m("img", { - className: "PollAnswer-image", - src: opt.imageUrl(), - alt: opt.answer() - }) : null); - return m("div", { - className: flarum_common_utils_classList__WEBPACK_IMPORTED_MODULE_6___default()('PollOption', hasVoted && 'PollVoted', poll.hasEnded() && 'PollEnded', opt.imageUrl() && 'PollOption-hasImage'), - "data-id": opt.id() - }, canSeeVoteCount ? m((flarum_common_components_Tooltip__WEBPACK_IMPORTED_MODULE_8___default()), { - text: flarum_forum_app__WEBPACK_IMPORTED_MODULE_1___default().translator.trans('fof-polls.forum.tooltip.votes', { - count: votes - }), - onremove: this.hideOptionTooltip - }, bar) : bar); - }; - _proto.changeVote = function changeVote(option, evt) { - var _this$attrs$poll$myVo, _this$attrs$poll$myVo2; - if (!(flarum_forum_app__WEBPACK_IMPORTED_MODULE_1___default().session).user) { - flarum_forum_app__WEBPACK_IMPORTED_MODULE_1___default().modal.show((flarum_forum_components_LogInModal__WEBPACK_IMPORTED_MODULE_4___default())); - evt.target.checked = false; - return; - } - var optionIds = this.pendingOptions || new Set((_this$attrs$poll$myVo = (_this$attrs$poll$myVo2 = this.attrs.poll.myVotes()).map) == null ? void 0 : _this$attrs$poll$myVo.call(_this$attrs$poll$myVo2, function (v) { - return v.option().id(); - })); - var isUnvoting = optionIds["delete"](option.id()); - var allowsMultiple = this.attrs.poll.allowMultipleVotes(); - if (!allowsMultiple) { - optionIds.clear(); - } - if (!isUnvoting) { - optionIds.add(option.id()); - } - if (this.useSubmitUI) { - this.pendingOptions = optionIds.size ? optionIds : null; - this.pendingSubmit = !!this.pendingOptions; - return; - } - return this.submit(optionIds, null, function () { - return evt.target.checked = isUnvoting; - }); - }; - _proto.onsubmit = function onsubmit() { - var _this2 = this; - return this.submit(this.pendingOptions, function () { - _this2.pendingOptions = null; - _this2.pendingSubmit = false; - }); - }; - _proto.submit = function submit(optionIds, cb, onerror) { - var _this3 = this; - this.loadingOptions = true; - m.redraw(); - return flarum_forum_app__WEBPACK_IMPORTED_MODULE_1___default().request({ - method: 'PATCH', - url: flarum_forum_app__WEBPACK_IMPORTED_MODULE_1___default().forum.attribute('apiUrl') + "/fof/polls/" + this.attrs.poll.id() + "/votes", - body: { - data: { - optionIds: Array.from(optionIds) - } - } - }).then(function (res) { - flarum_forum_app__WEBPACK_IMPORTED_MODULE_1___default().store.pushPayload(res); - cb == null || cb(); - })["catch"](function (err) { - onerror == null || onerror(err); - })["finally"](function () { - _this3.loadingOptions = false; - m.redraw(); - }); - }; - _proto.showVoters = function showVoters() { - // Load all the votes only when opening the votes list - flarum_forum_app__WEBPACK_IMPORTED_MODULE_1___default().modal.show(_ListVotersModal__WEBPACK_IMPORTED_MODULE_5__["default"], { - poll: this.attrs.poll, - post: this.attrs.post - }); - }; - _proto.deletePoll = function deletePoll() { - if (confirm(flarum_common_utils_extractText__WEBPACK_IMPORTED_MODULE_11___default()(flarum_forum_app__WEBPACK_IMPORTED_MODULE_1___default().translator.trans('fof-polls.forum.moderation.delete_confirm')))) { - this.attrs.poll["delete"]().then(function () { - m.redraw.sync(); - }); - } - } - - /** - * Attempting to use the `tooltipVisible` attr on the Tooltip component set to 'false' when no vote count - * caused the tooltip to break on click. This is a workaround to hide the tooltip when no vote count is available, - * called on 'onremove' of the Tooltip component. It doesn't always work as intended either, but it does the job. - */; - _proto.hideOptionTooltip = function hideOptionTooltip(vnode) { - vnode.attrs.tooltipVisible = false; - vnode.state.updateVisibility(); - } - - /** - * Alert before navigating away using browser's 'beforeunload' event - */; - _proto.preventClose = function preventClose(e) { - if (this.pendingOptions) { - e.preventDefault(); - return true; - } - }; - return PostPoll; -}((flarum_common_Component__WEBPACK_IMPORTED_MODULE_2___default())); - - -/***/ }), - -/***/ "./src/forum/components/UploadPollImageButton.tsx": -/*!********************************************************!*\ - !*** ./src/forum/components/UploadPollImageButton.tsx ***! - \********************************************************/ -/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export */ __webpack_require__.d(__webpack_exports__, { -/* harmony export */ "default": () => (/* binding */ UploadPollImageButton) -/* harmony export */ }); -/* harmony import */ var _babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/esm/extends */ "./node_modules/@babel/runtime/helpers/esm/extends.js"); -/* harmony import */ var _babel_runtime_helpers_esm_inheritsLoose__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/esm/inheritsLoose */ "./node_modules/@babel/runtime/helpers/esm/inheritsLoose.js"); -/* harmony import */ var flarum_forum_app__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! flarum/forum/app */ "flarum/forum/app"); -/* harmony import */ var flarum_forum_app__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(flarum_forum_app__WEBPACK_IMPORTED_MODULE_2__); -/* harmony import */ var flarum_common_components_Button__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! flarum/common/components/Button */ "flarum/common/components/Button"); -/* harmony import */ var flarum_common_components_Button__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(flarum_common_components_Button__WEBPACK_IMPORTED_MODULE_3__); -/* harmony import */ var flarum_common_utils_classList__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! flarum/common/utils/classList */ "flarum/common/utils/classList"); -/* harmony import */ var flarum_common_utils_classList__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(flarum_common_utils_classList__WEBPACK_IMPORTED_MODULE_4__); - - - - - -var UploadPollImageButton = /*#__PURE__*/function (_Button) { - (0,_babel_runtime_helpers_esm_inheritsLoose__WEBPACK_IMPORTED_MODULE_1__["default"])(UploadPollImageButton, _Button); - function UploadPollImageButton() { - var _this; - for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) { - args[_key] = arguments[_key]; - } - _this = _Button.call.apply(_Button, [this].concat(args)) || this; - _this.loading = false; - _this.uploadedImageUrl = undefined; - _this.fileName = undefined; - return _this; - } - var _proto = UploadPollImageButton.prototype; - _proto.view = function view(vnode) { - var _this$attrs$poll; - this.attrs.loading = this.loading; - this.attrs.className = flarum_common_utils_classList__WEBPACK_IMPORTED_MODULE_4___default()(this.attrs.className, 'Button'); - if ((_this$attrs$poll = this.attrs.poll) != null && _this$attrs$poll.imageUrl() || this.uploadedImageUrl) { - var _this$attrs$poll2; - var imageUrl = this.uploadedImageUrl || ((_this$attrs$poll2 = this.attrs.poll) == null ? void 0 : _this$attrs$poll2.imageUrl()); - this.attrs.onclick = this.remove.bind(this); - return m("div", null, m("p", null, m("img", { - src: imageUrl, - alt: "" - })), m("p", null, _Button.prototype.view.call(this, (0,_babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__["default"])({}, vnode, { - children: flarum_forum_app__WEBPACK_IMPORTED_MODULE_2___default().translator.trans('fof-polls.forum.upload_image.remove_button') - })))); - } else { - this.attrs.onclick = this.upload.bind(this); - } - return _Button.prototype.view.call(this, (0,_babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__["default"])({}, vnode, { - children: flarum_forum_app__WEBPACK_IMPORTED_MODULE_2___default().translator.trans('fof-polls.forum.upload_image.upload_button') - })); - } - - /** - * Prompt the user to upload an image. - */; - _proto.upload = function upload() { - var _this2 = this; - if (this.loading) return; - var $input = $(''); - $input.appendTo('body').hide().trigger('click').on('change', function (e) { - var body = new FormData(); - body.append(_this2.attrs.name, $(e.target)[0].files[0]); - _this2.loading = true; - m.redraw(); - flarum_forum_app__WEBPACK_IMPORTED_MODULE_2___default().request({ - method: 'POST', - url: _this2.resourceUrl(), - serialize: function serialize(raw) { - return raw; - }, - body: body - }).then(_this2.success.bind(_this2), _this2.failure.bind(_this2)); - }); - } - - /** - * Remove the image. - */; - _proto.remove = function remove() { - this.loading = true; - m.redraw(); - flarum_forum_app__WEBPACK_IMPORTED_MODULE_2___default().request({ - method: 'DELETE', - url: this.resourceUrl() - }).then(this.success.bind(this), this.failure.bind(this)); - }; - _proto.resourceUrl = function resourceUrl() { - var url = flarum_forum_app__WEBPACK_IMPORTED_MODULE_2___default().forum.attribute('apiUrl') + '/fof/polls/' + this.attrs.name; - var poll = this.attrs.poll; - if (poll != null && poll.exists) url += '/' + (poll == null ? void 0 : poll.id()); - return url; - } - - /** - * After a successful upload/removal, redraw the page. - * - * @param {PollUploadObject} response - * @protected - */; - _proto.success = function success(response) { - var _this$attrs$onUpload, _this$attrs; - this.loading = false; - this.uploadedImageUrl = response == null ? void 0 : response.fileUrl; - this.fileName = response == null ? void 0 : response.fileName; - (_this$attrs$onUpload = (_this$attrs = this.attrs).onUpload) == null || _this$attrs$onUpload.call(_this$attrs, response == null ? void 0 : response.fileName); - m.redraw(); - } - - /** - * If upload/removal fails, stop loading. - * - * @param {object} response - * @protected - */; - _proto.failure = function failure(response) { - this.loading = false; - m.redraw(); - }; - return UploadPollImageButton; -}((flarum_common_components_Button__WEBPACK_IMPORTED_MODULE_3___default())); - - -/***/ }), - -/***/ "./src/forum/components/form/FormError.tsx": -/*!*************************************************!*\ - !*** ./src/forum/components/form/FormError.tsx ***! - \*************************************************/ -/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export */ __webpack_require__.d(__webpack_exports__, { -/* harmony export */ "default": () => (/* binding */ FormError) -/* harmony export */ }); -/* harmony import */ var _babel_runtime_helpers_esm_inheritsLoose__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/esm/inheritsLoose */ "./node_modules/@babel/runtime/helpers/esm/inheritsLoose.js"); -/* harmony import */ var _babel_runtime_helpers_esm_wrapNativeSuper__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/esm/wrapNativeSuper */ "./node_modules/@babel/runtime/helpers/esm/wrapNativeSuper.js"); - - -var FormError = /*#__PURE__*/function (_Error) { - (0,_babel_runtime_helpers_esm_inheritsLoose__WEBPACK_IMPORTED_MODULE_0__["default"])(FormError, _Error); - function FormError(props) { - return _Error.call(this, props + '') || this; - } - return FormError; -}( /*#__PURE__*/(0,_babel_runtime_helpers_esm_wrapNativeSuper__WEBPACK_IMPORTED_MODULE_1__["default"])(Error)); - - -/***/ }), - -/***/ "./src/forum/components/index.ts": -/*!***************************************!*\ - !*** ./src/forum/components/index.ts ***! - \***************************************/ -/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export */ __webpack_require__.d(__webpack_exports__, { -/* harmony export */ components: () => (/* binding */ components) -/* harmony export */ }); -/* harmony import */ var _CreatePollModal__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./CreatePollModal */ "./src/forum/components/CreatePollModal.tsx"); -/* harmony import */ var _PostPoll__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./PostPoll */ "./src/forum/components/PostPoll.tsx"); -/* harmony import */ var _EditPollModal__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./EditPollModal */ "./src/forum/components/EditPollModal.tsx"); -/* harmony import */ var _ListVotersModal__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./ListVotersModal */ "./src/forum/components/ListVotersModal.tsx"); -/* harmony import */ var _PollForm__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./PollForm */ "./src/forum/components/PollForm.tsx"); -/* harmony import */ var _ComposePollHero__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./ComposePollHero */ "./src/forum/components/ComposePollHero.tsx"); -/* harmony import */ var _ComposePollPage__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./ComposePollPage */ "./src/forum/components/ComposePollPage.tsx"); -/* harmony import */ var _PollsPage__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./PollsPage */ "./src/forum/components/PollsPage.tsx"); -/* harmony import */ var _PollView__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./PollView */ "./src/forum/components/PollView.tsx"); -/* harmony import */ var _PollViewPage__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./PollViewPage */ "./src/forum/components/PollViewPage.tsx"); -/* harmony import */ var _Poll_PollSubmitButton__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ./Poll/PollSubmitButton */ "./src/forum/components/Poll/PollSubmitButton.tsx"); -/* harmony import */ var _Poll_PollOption__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ./Poll/PollOption */ "./src/forum/components/Poll/PollOption.tsx"); -/* harmony import */ var _Poll_PollOptions__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ./Poll/PollOptions */ "./src/forum/components/Poll/PollOptions.tsx"); -/* harmony import */ var _PollsShowcasePage__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! ./PollsShowcasePage */ "./src/forum/components/PollsShowcasePage.tsx"); -/* harmony import */ var _PollShowcase__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! ./PollShowcase */ "./src/forum/components/PollShowcase.tsx"); -/* harmony import */ var _PollShowcaseItem__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(/*! ./PollShowcaseItem */ "./src/forum/components/PollShowcaseItem.tsx"); -/* harmony import */ var _AbstractPollPage__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(/*! ./AbstractPollPage */ "./src/forum/components/AbstractPollPage.tsx"); -/* harmony import */ var _Poll_PollTitle__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(/*! ./Poll/PollTitle */ "./src/forum/components/Poll/PollTitle.tsx"); -/* harmony import */ var _Poll_PollSubtitle__WEBPACK_IMPORTED_MODULE_18__ = __webpack_require__(/*! ./Poll/PollSubtitle */ "./src/forum/components/Poll/PollSubtitle.tsx"); -/* harmony import */ var _Poll_PollImage__WEBPACK_IMPORTED_MODULE_19__ = __webpack_require__(/*! ./Poll/PollImage */ "./src/forum/components/Poll/PollImage.tsx"); - - - - - - - - - - - - - - - - - - - - -var components = { - CreatePollModal: _CreatePollModal__WEBPACK_IMPORTED_MODULE_0__["default"], - PostPoll: _PostPoll__WEBPACK_IMPORTED_MODULE_1__["default"], - EditPollModal: _EditPollModal__WEBPACK_IMPORTED_MODULE_2__["default"], - ListVotersModal: _ListVotersModal__WEBPACK_IMPORTED_MODULE_3__["default"], - PollForm: _PollForm__WEBPACK_IMPORTED_MODULE_4__["default"], - ComposePollHero: _ComposePollHero__WEBPACK_IMPORTED_MODULE_5__["default"], - ComposePollPage: _ComposePollPage__WEBPACK_IMPORTED_MODULE_6__["default"], - PollsPage: _PollsPage__WEBPACK_IMPORTED_MODULE_7__["default"], - PollView: _PollView__WEBPACK_IMPORTED_MODULE_8__["default"], - PollViewPage: _PollViewPage__WEBPACK_IMPORTED_MODULE_9__["default"], - PollSubmitButton: _Poll_PollSubmitButton__WEBPACK_IMPORTED_MODULE_10__["default"], - PollOption: _Poll_PollOption__WEBPACK_IMPORTED_MODULE_11__["default"], - PollOptions: _Poll_PollOptions__WEBPACK_IMPORTED_MODULE_12__["default"], - PollsShowcasePage: _PollsShowcasePage__WEBPACK_IMPORTED_MODULE_13__["default"], - PollShowcase: _PollShowcase__WEBPACK_IMPORTED_MODULE_14__["default"], - PollShowcaseItem: _PollShowcaseItem__WEBPACK_IMPORTED_MODULE_15__["default"], - AbstractPollPage: _AbstractPollPage__WEBPACK_IMPORTED_MODULE_16__.AbstractPollPage, - PollTitle: _Poll_PollTitle__WEBPACK_IMPORTED_MODULE_17__["default"], - PollSubtitle: _Poll_PollSubtitle__WEBPACK_IMPORTED_MODULE_18__["default"], - PollImage: _Poll_PollImage__WEBPACK_IMPORTED_MODULE_19__["default"] -}; - -/***/ }), - -/***/ "./src/forum/extend.ts": -/*!*****************************!*\ - !*** ./src/forum/extend.ts ***! - \*****************************/ -/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export */ __webpack_require__.d(__webpack_exports__, { -/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) -/* harmony export */ }); -/* harmony import */ var flarum_common_extenders__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! flarum/common/extenders */ "flarum/common/extenders"); -/* harmony import */ var flarum_common_extenders__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(flarum_common_extenders__WEBPACK_IMPORTED_MODULE_0__); -/* harmony import */ var flarum_common_models_Post__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! flarum/common/models/Post */ "flarum/common/models/Post"); -/* harmony import */ var flarum_common_models_Post__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(flarum_common_models_Post__WEBPACK_IMPORTED_MODULE_1__); -/* harmony import */ var flarum_common_models_Forum__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! flarum/common/models/Forum */ "flarum/common/models/Forum"); -/* harmony import */ var flarum_common_models_Forum__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(flarum_common_models_Forum__WEBPACK_IMPORTED_MODULE_2__); -/* harmony import */ var flarum_common_models_Discussion__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! flarum/common/models/Discussion */ "flarum/common/models/Discussion"); -/* harmony import */ var flarum_common_models_Discussion__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(flarum_common_models_Discussion__WEBPACK_IMPORTED_MODULE_3__); -/* harmony import */ var _models_Poll__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./models/Poll */ "./src/forum/models/Poll.ts"); -/* harmony import */ var _models_PollOption__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./models/PollOption */ "./src/forum/models/PollOption.ts"); -/* harmony import */ var _models_PollVote__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./models/PollVote */ "./src/forum/models/PollVote.ts"); -/* harmony import */ var _components_PollsPage__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./components/PollsPage */ "./src/forum/components/PollsPage.tsx"); -/* harmony import */ var _components_ComposePollPage__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./components/ComposePollPage */ "./src/forum/components/ComposePollPage.tsx"); -/* harmony import */ var _components_PollViewPage__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./components/PollViewPage */ "./src/forum/components/PollViewPage.tsx"); -/* harmony import */ var _components_PollsShowcasePage__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ./components/PollsShowcasePage */ "./src/forum/components/PollsShowcasePage.tsx"); - - - - - - - - - - - -/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ([new (flarum_common_extenders__WEBPACK_IMPORTED_MODULE_0___default().Routes)() // -.add('fof.polls.showcase', '/polls', _components_PollsShowcasePage__WEBPACK_IMPORTED_MODULE_10__["default"]).add('fof.polls.list', '/polls/all', _components_PollsPage__WEBPACK_IMPORTED_MODULE_7__["default"]).add('fof.polls.view', '/polls/view/:id', _components_PollViewPage__WEBPACK_IMPORTED_MODULE_9__["default"]).add('fof.polls.compose', '/polls/composer', _components_ComposePollPage__WEBPACK_IMPORTED_MODULE_8__["default"]), new (flarum_common_extenders__WEBPACK_IMPORTED_MODULE_0___default().Store)() // -.add('polls', _models_Poll__WEBPACK_IMPORTED_MODULE_4__["default"]).add('poll_options', _models_PollOption__WEBPACK_IMPORTED_MODULE_5__["default"]).add('poll_votes', _models_PollVote__WEBPACK_IMPORTED_MODULE_6__["default"]), new (flarum_common_extenders__WEBPACK_IMPORTED_MODULE_0___default().Model)((flarum_common_models_Post__WEBPACK_IMPORTED_MODULE_1___default())) // -.hasMany('polls').attribute('canStartPoll'), new (flarum_common_extenders__WEBPACK_IMPORTED_MODULE_0___default().Model)((flarum_common_models_Forum__WEBPACK_IMPORTED_MODULE_2___default())) // -.attribute('canStartPolls'), new (flarum_common_extenders__WEBPACK_IMPORTED_MODULE_0___default().Model)((flarum_common_models_Discussion__WEBPACK_IMPORTED_MODULE_3___default())) // -.attribute('hasPoll').attribute('canStartPoll')]); - -/***/ }), - -/***/ "./src/forum/index.ts": -/*!****************************!*\ - !*** ./src/forum/index.ts ***! - \****************************/ -/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export */ __webpack_require__.d(__webpack_exports__, { -/* harmony export */ components: () => (/* reexport safe */ _components__WEBPACK_IMPORTED_MODULE_6__.components), -/* harmony export */ extend: () => (/* reexport safe */ _extend__WEBPACK_IMPORTED_MODULE_10__["default"]), -/* harmony export */ models: () => (/* reexport safe */ _models__WEBPACK_IMPORTED_MODULE_7__.models), -/* harmony export */ states: () => (/* reexport safe */ _states__WEBPACK_IMPORTED_MODULE_8__.states), -/* harmony export */ utils: () => (/* reexport safe */ _utils__WEBPACK_IMPORTED_MODULE_9__.utils) -/* harmony export */ }); -/* harmony import */ var flarum_forum_app__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! flarum/forum/app */ "flarum/forum/app"); -/* harmony import */ var flarum_forum_app__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(flarum_forum_app__WEBPACK_IMPORTED_MODULE_0__); -/* harmony import */ var _addDiscussionBadge__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./addDiscussionBadge */ "./src/forum/addDiscussionBadge.tsx"); -/* harmony import */ var _addComposerItems__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./addComposerItems */ "./src/forum/addComposerItems.tsx"); -/* harmony import */ var _addPollsToPost__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./addPollsToPost */ "./src/forum/addPollsToPost.tsx"); -/* harmony import */ var _addPostControls__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./addPostControls */ "./src/forum/addPostControls.tsx"); -/* harmony import */ var _addNavItem__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./addNavItem */ "./src/forum/addNavItem.ts"); -/* harmony import */ var _components__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./components */ "./src/forum/components/index.ts"); -/* harmony import */ var _models__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./models */ "./src/forum/models/index.ts"); -/* harmony import */ var _states__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./states */ "./src/forum/states/index.ts"); -/* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./utils */ "./src/forum/utils/index.ts"); -/* harmony import */ var _extend__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ./extend */ "./src/forum/extend.ts"); - - - - - - - - - - -flarum_forum_app__WEBPACK_IMPORTED_MODULE_0___default().initializers.add('fof/polls', function () { - (0,_addDiscussionBadge__WEBPACK_IMPORTED_MODULE_1__["default"])(); - (0,_addComposerItems__WEBPACK_IMPORTED_MODULE_2__["default"])(); - (0,_addPollsToPost__WEBPACK_IMPORTED_MODULE_3__["default"])(); - (0,_addPostControls__WEBPACK_IMPORTED_MODULE_4__["default"])(); - (0,_addNavItem__WEBPACK_IMPORTED_MODULE_5__["default"])(); -}); - - -/***/ }), - -/***/ "./src/forum/models/Poll.ts": -/*!**********************************!*\ - !*** ./src/forum/models/Poll.ts ***! - \**********************************/ -/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export */ __webpack_require__.d(__webpack_exports__, { -/* harmony export */ "default": () => (/* binding */ Poll) -/* harmony export */ }); -/* harmony import */ var _babel_runtime_helpers_esm_inheritsLoose__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/esm/inheritsLoose */ "./node_modules/@babel/runtime/helpers/esm/inheritsLoose.js"); -/* harmony import */ var flarum_common_Model__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! flarum/common/Model */ "flarum/common/Model"); -/* harmony import */ var flarum_common_Model__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(flarum_common_Model__WEBPACK_IMPORTED_MODULE_1__); -/* harmony import */ var flarum_common_utils_computed__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! flarum/common/utils/computed */ "flarum/common/utils/computed"); -/* harmony import */ var flarum_common_utils_computed__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(flarum_common_utils_computed__WEBPACK_IMPORTED_MODULE_2__); - - - -var Poll = /*#__PURE__*/function (_Model) { - (0,_babel_runtime_helpers_esm_inheritsLoose__WEBPACK_IMPORTED_MODULE_0__["default"])(Poll, _Model); - function Poll() { - var _this; - for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) { - args[_key] = arguments[_key]; - } - _this = _Model.call.apply(_Model, [this].concat(args)) || this; - _this.tempOptions = void 0; - return _this; - } - var _proto = Poll.prototype; - _proto.question = function question() { - return flarum_common_Model__WEBPACK_IMPORTED_MODULE_1___default().attribute('question').call(this); - }; - _proto.subtitle = function subtitle() { - return flarum_common_Model__WEBPACK_IMPORTED_MODULE_1___default().attribute('subtitle').call(this); - }; - _proto.image = function image() { - return flarum_common_Model__WEBPACK_IMPORTED_MODULE_1___default().attribute('image').call(this); - }; - _proto.imageUrl = function imageUrl() { - return flarum_common_Model__WEBPACK_IMPORTED_MODULE_1___default().attribute('imageUrl').call(this); - }; - _proto.imageAlt = function imageAlt() { - return flarum_common_Model__WEBPACK_IMPORTED_MODULE_1___default().attribute('imageAlt').call(this); - }; - _proto.hasEnded = function hasEnded() { - return flarum_common_Model__WEBPACK_IMPORTED_MODULE_1___default().attribute('hasEnded').call(this); - }; - _proto.endDate = function endDate() { - return flarum_common_Model__WEBPACK_IMPORTED_MODULE_1___default().attribute('endDate', (flarum_common_Model__WEBPACK_IMPORTED_MODULE_1___default().transformDate)).call(this); - }; - _proto.publicPoll = function publicPoll() { - return flarum_common_Model__WEBPACK_IMPORTED_MODULE_1___default().attribute('publicPoll').call(this); - }; - _proto.hideVotes = function hideVotes() { - return flarum_common_Model__WEBPACK_IMPORTED_MODULE_1___default().attribute('hideVotes').call(this); - }; - _proto.allowChangeVote = function allowChangeVote() { - return flarum_common_Model__WEBPACK_IMPORTED_MODULE_1___default().attribute('allowChangeVote').call(this); - }; - _proto.allowMultipleVotes = function allowMultipleVotes() { - return flarum_common_Model__WEBPACK_IMPORTED_MODULE_1___default().attribute('allowMultipleVotes').call(this); - }; - _proto.maxVotes = function maxVotes() { - return flarum_common_Model__WEBPACK_IMPORTED_MODULE_1___default().attribute('maxVotes').call(this); - }; - _proto.voteCount = function voteCount() { - return flarum_common_Model__WEBPACK_IMPORTED_MODULE_1___default().attribute('voteCount').call(this); - }; - _proto.canVote = function canVote() { - return flarum_common_Model__WEBPACK_IMPORTED_MODULE_1___default().attribute('canVote').call(this); - }; - _proto.canEdit = function canEdit() { - return flarum_common_Model__WEBPACK_IMPORTED_MODULE_1___default().attribute('canEdit').call(this); - }; - _proto.canDelete = function canDelete() { - return flarum_common_Model__WEBPACK_IMPORTED_MODULE_1___default().attribute('canDelete').call(this); - }; - _proto.canSeeVoters = function canSeeVoters() { - return flarum_common_Model__WEBPACK_IMPORTED_MODULE_1___default().attribute('canSeeVoters').call(this); - }; - _proto.canChangeVote = function canChangeVote() { - return flarum_common_Model__WEBPACK_IMPORTED_MODULE_1___default().attribute('canChangeVote').call(this); - }; - _proto.options = function options() { - var options = flarum_common_Model__WEBPACK_IMPORTED_MODULE_1___default().hasMany('options').call(this); - return options ? options : []; - }; - _proto.votes = function votes() { - return flarum_common_Model__WEBPACK_IMPORTED_MODULE_1___default().hasMany('votes').call(this); - }; - _proto.myVotes = function myVotes() { - var myVotes = flarum_common_Model__WEBPACK_IMPORTED_MODULE_1___default().hasMany('myVotes').call(this); - return myVotes ? myVotes : []; - }; - _proto.isGlobal = function isGlobal() { - return flarum_common_Model__WEBPACK_IMPORTED_MODULE_1___default().attribute('isGlobal').call(this); - }; - _proto.isHidden = function isHidden() { - return flarum_common_utils_computed__WEBPACK_IMPORTED_MODULE_2___default()('hiddenAt', function (hiddenAt) { - return !!hiddenAt; - }).call(this); - } - - // TODO: These two don't make sense as of now - ; - _proto.isUnread = function isUnread() { - return false; - }; - _proto.apiEndpoint = function apiEndpoint() { - /** @ts-ignore */ - return "/fof/polls" + (this.exists ? "/" + this.data.id : ''); - }; - return Poll; -}((flarum_common_Model__WEBPACK_IMPORTED_MODULE_1___default())); - - -/***/ }), - -/***/ "./src/forum/models/PollOption.ts": -/*!****************************************!*\ - !*** ./src/forum/models/PollOption.ts ***! - \****************************************/ -/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export */ __webpack_require__.d(__webpack_exports__, { -/* harmony export */ "default": () => (/* binding */ PollOption) -/* harmony export */ }); -/* harmony import */ var _babel_runtime_helpers_esm_inheritsLoose__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/esm/inheritsLoose */ "./node_modules/@babel/runtime/helpers/esm/inheritsLoose.js"); -/* harmony import */ var flarum_common_Model__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! flarum/common/Model */ "flarum/common/Model"); -/* harmony import */ var flarum_common_Model__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(flarum_common_Model__WEBPACK_IMPORTED_MODULE_1__); - - -var PollOption = /*#__PURE__*/function (_Model) { - (0,_babel_runtime_helpers_esm_inheritsLoose__WEBPACK_IMPORTED_MODULE_0__["default"])(PollOption, _Model); - function PollOption() { - return _Model.apply(this, arguments) || this; - } - var _proto = PollOption.prototype; - _proto.answer = function answer() { - return flarum_common_Model__WEBPACK_IMPORTED_MODULE_1___default().attribute('answer').call(this); - }; - _proto.imageUrl = function imageUrl() { - return flarum_common_Model__WEBPACK_IMPORTED_MODULE_1___default().attribute('imageUrl').call(this); - }; - _proto.voteCount = function voteCount() { - return flarum_common_Model__WEBPACK_IMPORTED_MODULE_1___default().attribute('voteCount').call(this); - }; - _proto.poll = function poll() { - return flarum_common_Model__WEBPACK_IMPORTED_MODULE_1___default().hasOne('polls').call(this); - }; - _proto.votes = function votes() { - return flarum_common_Model__WEBPACK_IMPORTED_MODULE_1___default().hasMany('votes').call(this); - }; - _proto.apiEndpoint = function apiEndpoint() { - /** @ts-ignore */ - return "/fof/polls/answers" + (this.exists ? "/" + this.data.id : ''); - }; - return PollOption; -}((flarum_common_Model__WEBPACK_IMPORTED_MODULE_1___default())); - - -/***/ }), - -/***/ "./src/forum/models/PollVote.ts": -/*!**************************************!*\ - !*** ./src/forum/models/PollVote.ts ***! - \**************************************/ -/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export */ __webpack_require__.d(__webpack_exports__, { -/* harmony export */ "default": () => (/* binding */ PollVote) -/* harmony export */ }); -/* harmony import */ var _babel_runtime_helpers_esm_inheritsLoose__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/esm/inheritsLoose */ "./node_modules/@babel/runtime/helpers/esm/inheritsLoose.js"); -/* harmony import */ var flarum_common_Model__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! flarum/common/Model */ "flarum/common/Model"); -/* harmony import */ var flarum_common_Model__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(flarum_common_Model__WEBPACK_IMPORTED_MODULE_1__); - - -var PollVote = /*#__PURE__*/function (_Model) { - (0,_babel_runtime_helpers_esm_inheritsLoose__WEBPACK_IMPORTED_MODULE_0__["default"])(PollVote, _Model); - function PollVote() { - return _Model.apply(this, arguments) || this; - } - var _proto = PollVote.prototype; - _proto.poll = function poll() { - return flarum_common_Model__WEBPACK_IMPORTED_MODULE_1___default().hasOne('poll').call(this); - }; - _proto.option = function option() { - var result = flarum_common_Model__WEBPACK_IMPORTED_MODULE_1___default().hasOne('option').call(this); - return result === false ? null : result; - }; - _proto.user = function user() { - return flarum_common_Model__WEBPACK_IMPORTED_MODULE_1___default().hasOne('user').call(this); - }; - _proto.pollId = function pollId() { - return flarum_common_Model__WEBPACK_IMPORTED_MODULE_1___default().attribute('pollId').call(this); - }; - _proto.optionId = function optionId() { - return flarum_common_Model__WEBPACK_IMPORTED_MODULE_1___default().attribute('optionId').call(this); - }; - _proto.apiEndpoint = function apiEndpoint() { - return "/fof/polls/" + this.pollId() + "/vote"; - }; - return PollVote; -}((flarum_common_Model__WEBPACK_IMPORTED_MODULE_1___default())); - - -/***/ }), - -/***/ "./src/forum/models/index.ts": -/*!***********************************!*\ - !*** ./src/forum/models/index.ts ***! - \***********************************/ -/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export */ __webpack_require__.d(__webpack_exports__, { -/* harmony export */ models: () => (/* binding */ models) -/* harmony export */ }); -/* harmony import */ var _Poll__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./Poll */ "./src/forum/models/Poll.ts"); -/* harmony import */ var _PollOption__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./PollOption */ "./src/forum/models/PollOption.ts"); -/* harmony import */ var _PollVote__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./PollVote */ "./src/forum/models/PollVote.ts"); - - - -var models = { - Poll: _Poll__WEBPACK_IMPORTED_MODULE_0__["default"], - PollOption: _PollOption__WEBPACK_IMPORTED_MODULE_1__["default"], - PollVote: _PollVote__WEBPACK_IMPORTED_MODULE_2__["default"] -}; - -/***/ }), - -/***/ "./src/forum/states/PollFormState.ts": -/*!*******************************************!*\ - !*** ./src/forum/states/PollFormState.ts ***! - \*******************************************/ -/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export */ __webpack_require__.d(__webpack_exports__, { -/* harmony export */ "default": () => (/* binding */ PollFormState) -/* harmony export */ }); -/* harmony import */ var _babel_runtime_helpers_esm_asyncToGenerator__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/esm/asyncToGenerator */ "./node_modules/@babel/runtime/helpers/esm/asyncToGenerator.js"); -/* harmony import */ var _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/regenerator */ "./node_modules/@babel/runtime/regenerator/index.js"); -/* harmony import */ var _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_1__); -/* harmony import */ var flarum_forum_app__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! flarum/forum/app */ "flarum/forum/app"); -/* harmony import */ var flarum_forum_app__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(flarum_forum_app__WEBPACK_IMPORTED_MODULE_2__); - - - -var PollFormState = /*#__PURE__*/function () { - PollFormState.createNewPoll = function createNewPoll() { - var poll = flarum_forum_app__WEBPACK_IMPORTED_MODULE_2___default().store.createRecord('polls'); - poll.pushAttributes({ - question: '', - endDate: '', - publicPoll: false, - allowMultipleVotes: false, - hideVotes: false, - allowChangeVote: false, - maxVotes: 0 - }); - poll.tempOptions = [flarum_forum_app__WEBPACK_IMPORTED_MODULE_2___default().store.createRecord('poll_options'), flarum_forum_app__WEBPACK_IMPORTED_MODULE_2___default().store.createRecord('poll_options')]; - return poll; - }; - function PollFormState(poll) { - this.poll = void 0; - this.loading = void 0; - this.deleting = void 0; - this.expandedGroup = void 0; - if (!poll) { - poll = PollFormState.createNewPoll(); - } - this.loading = false; - this.deleting = false; - this.poll = poll; - this.expandedGroup = 'setup'; - } - var _proto = PollFormState.prototype; - _proto.isExpanded = function isExpanded(groupKey) { - return this.expandedGroup === groupKey; - }; - _proto.expand = function expand(groupKey) { - this.expandedGroup = groupKey; - m.redraw(); - }; - _proto.save = /*#__PURE__*/function () { - var _save = (0,_babel_runtime_helpers_esm_asyncToGenerator__WEBPACK_IMPORTED_MODULE_0__["default"])( /*#__PURE__*/_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_1___default().mark(function _callee(data) { - return _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_1___default().wrap(function _callee$(_context) { - while (1) switch (_context.prev = _context.next) { - case 0: - this.loading = true; - m.redraw(); - _context.prev = 2; - _context.next = 5; - return this.poll.save(data); - case 5: - this.poll = _context.sent; - /** - * Cleanup attributes: - * For the saving process, we add the options directly to the attributes. - * As we currently cannot add new PollOptions as relationships. - */ - delete this.poll.data.attributes.options; - case 7: - _context.prev = 7; - this.loading = false; - m.redraw(); - return _context.finish(7); - case 11: - case "end": - return _context.stop(); - } - }, _callee, this, [[2,, 7, 11]]); - })); - function save(_x) { - return _save.apply(this, arguments); - } - return save; - }(); - _proto["delete"] = /*#__PURE__*/function () { - var _delete2 = (0,_babel_runtime_helpers_esm_asyncToGenerator__WEBPACK_IMPORTED_MODULE_0__["default"])( /*#__PURE__*/_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_1___default().mark(function _callee2() { - return _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_1___default().wrap(function _callee2$(_context2) { - while (1) switch (_context2.prev = _context2.next) { - case 0: - this.loading = true; - m.redraw(); - _context2.prev = 2; - _context2.next = 5; - return this.poll["delete"](); - case 5: - this.deleting = true; - case 6: - _context2.prev = 6; - this.loading = false; - m.redraw(); - return _context2.finish(6); - case 10: - case "end": - return _context2.stop(); - } - }, _callee2, this, [[2,, 6, 10]]); - })); - function _delete() { - return _delete2.apply(this, arguments); - } - return _delete; - }(); - return PollFormState; -}(); - - -/***/ }), - -/***/ "./src/forum/states/PollListState.ts": -/*!*******************************************!*\ - !*** ./src/forum/states/PollListState.ts ***! - \*******************************************/ -/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export */ __webpack_require__.d(__webpack_exports__, { -/* harmony export */ "default": () => (/* binding */ PollListState) -/* harmony export */ }); -/* harmony import */ var _babel_runtime_helpers_esm_createClass__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/esm/createClass */ "./node_modules/@babel/runtime/helpers/esm/createClass.js"); -/* harmony import */ var _babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/esm/assertThisInitialized */ "./node_modules/@babel/runtime/helpers/esm/assertThisInitialized.js"); -/* harmony import */ var _babel_runtime_helpers_esm_inheritsLoose__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @babel/runtime/helpers/esm/inheritsLoose */ "./node_modules/@babel/runtime/helpers/esm/inheritsLoose.js"); -/* harmony import */ var flarum_forum_app__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! flarum/forum/app */ "flarum/forum/app"); -/* harmony import */ var flarum_forum_app__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(flarum_forum_app__WEBPACK_IMPORTED_MODULE_3__); -/* harmony import */ var flarum_common_states_PaginatedListState__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! flarum/common/states/PaginatedListState */ "flarum/common/states/PaginatedListState"); -/* harmony import */ var flarum_common_states_PaginatedListState__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(flarum_common_states_PaginatedListState__WEBPACK_IMPORTED_MODULE_4__); -/* harmony import */ var flarum_common_utils_EventEmitter__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! flarum/common/utils/EventEmitter */ "flarum/common/utils/EventEmitter"); -/* harmony import */ var flarum_common_utils_EventEmitter__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(flarum_common_utils_EventEmitter__WEBPACK_IMPORTED_MODULE_5__); - - - -function _createForOfIteratorHelperLoose(o, allowArrayLike) { var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"]; if (it) return (it = it.call(o)).next.bind(it); if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") { if (it) o = it; var i = 0; return function () { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } -function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); } -function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; } - - - -var globalEventEmitter = new (flarum_common_utils_EventEmitter__WEBPACK_IMPORTED_MODULE_5___default())(); -var PollListState = /*#__PURE__*/function (_PaginatedListState) { - (0,_babel_runtime_helpers_esm_inheritsLoose__WEBPACK_IMPORTED_MODULE_2__["default"])(PollListState, _PaginatedListState); - function PollListState(params, page) { - var _this; - if (page === void 0) { - page = 1; - } - _this = _PaginatedListState.call(this, params, page, 20) || this; - _this.extraPolls = []; - _this.eventEmitter = void 0; - _this.eventEmitter = globalEventEmitter.on('poll.deleted', _this.deletePoll.bind((0,_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_1__["default"])(_this))); - return _this; - } - var _proto = PollListState.prototype; - _proto.requestParams = function requestParams() { - var _this$params$sort; - var params = { - include: this.params.include || ['options', 'votes'], - filter: this.params.filter || {}, - sort: this.sortMap()[(_this$params$sort = this.params.sort) != null ? _this$params$sort : ''] - }; - if (this.params.q) { - params.filter.q = this.params.q; - } - return params; - }; - _proto.loadPage = function loadPage(page) { - if (page === void 0) { - page = 1; - } - var preloadedPolls = flarum_forum_app__WEBPACK_IMPORTED_MODULE_3___default().preloadedApiDocument(); - if (preloadedPolls) { - this.initialLoading = false; - return Promise.resolve(preloadedPolls); - } - return _PaginatedListState.prototype.loadPage.call(this, page); - }; - _proto.clear = function clear() { - _PaginatedListState.prototype.clear.call(this); - this.extraPolls = []; - } - - /** - * Get a map of sort keys (which appear in the URL, and are used for - * translation) to the API sort value that they represent. - */; - _proto.sortMap = function sortMap() { - var map = {}; - if (this.params.q) { - map.relevance = ''; - } - map.newest = '-createdAt'; - map.oldest = 'createdAt'; - return map; - } - - /** - * In the last request, has the user searched for a poll? - */; - _proto.isSearchResults = function isSearchResults() { - return !!this.params.q; - }; - _proto.removePoll = function removePoll(poll) { - this.eventEmitter.emit('poll.deleted', poll); - }; - _proto.deletePoll = function deletePoll(poll) { - for (var _iterator = _createForOfIteratorHelperLoose(this.pages), _step; !(_step = _iterator()).done;) { - var page = _step.value; - var _index = page.items.indexOf(poll); - if (_index !== -1) { - page.items.splice(_index, 1); - break; - } - } - var index = this.extraPolls.indexOf(poll); - if (index !== -1) { - this.extraPolls.splice(index); - } - m.redraw(); - } - - /** - * Add a poll to the top of the list. - */; - _proto.addPoll = function addPoll(poll) { - this.removePoll(poll); - this.extraPolls.unshift(poll); - m.redraw(); - }; - _proto.getAllItems = function getAllItems() { - return this.extraPolls.concat(_PaginatedListState.prototype.getAllItems.call(this)); - }; - _proto.getPages = function getPages() { - var pages = _PaginatedListState.prototype.getPages.call(this); - if (this.extraPolls.length) { - return [{ - number: -1, - items: this.extraPolls - }].concat(pages); - } - return pages; - }; - (0,_babel_runtime_helpers_esm_createClass__WEBPACK_IMPORTED_MODULE_0__["default"])(PollListState, [{ - key: "type", - get: function get() { - return 'fof/polls'; - } - }]); - return PollListState; -}((flarum_common_states_PaginatedListState__WEBPACK_IMPORTED_MODULE_4___default())); - - -/***/ }), - -/***/ "./src/forum/states/PollState.ts": -/*!***************************************!*\ - !*** ./src/forum/states/PollState.ts ***! - \***************************************/ -/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export */ __webpack_require__.d(__webpack_exports__, { -/* harmony export */ "default": () => (/* binding */ PollState) -/* harmony export */ }); -/* harmony import */ var flarum_forum_app__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! flarum/forum/app */ "flarum/forum/app"); -/* harmony import */ var flarum_forum_app__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(flarum_forum_app__WEBPACK_IMPORTED_MODULE_0__); -/* harmony import */ var flarum_forum_components_LogInModal__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! flarum/forum/components/LogInModal */ "flarum/forum/components/LogInModal"); -/* harmony import */ var flarum_forum_components_LogInModal__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(flarum_forum_components_LogInModal__WEBPACK_IMPORTED_MODULE_1__); -/* harmony import */ var _components_ListVotersModal__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../components/ListVotersModal */ "./src/forum/components/ListVotersModal.tsx"); - - - -var PollState = /*#__PURE__*/function () { - function PollState(poll) { - var _this = this; - this.poll = void 0; - this.pendingSubmit = false; - this.pendingOptions = null; - this.loadingOptions = false; - this.useSubmitUI = void 0; - this.showCheckMarks = void 0; - this.canSeeVoteCount = void 0; - this.showVoters = function () { - // Load all the votes only when opening the votes list - flarum_forum_app__WEBPACK_IMPORTED_MODULE_0___default().modal.show(_components_ListVotersModal__WEBPACK_IMPORTED_MODULE_2__["default"], { - poll: _this.poll - }); - }; - this.poll = poll; - this.useSubmitUI = !(poll != null && poll.canChangeVote()) && (poll == null ? void 0 : poll.allowMultipleVotes()); - this.showCheckMarks = !(flarum_forum_app__WEBPACK_IMPORTED_MODULE_0___default().session).user || !poll.hasEnded() && poll.canVote() && (!this.hasVoted() || poll.canChangeVote()); - this.canSeeVoteCount = typeof poll.voteCount() === 'number'; - this.init(); - } - - /** - * used as en extendable entry point for init customizations - */ - var _proto = PollState.prototype; - _proto.init = function init() {}; - _proto.isShowResult = function isShowResult() { - return this.poll.hasEnded() || this.canSeeVoteCount && !!(flarum_forum_app__WEBPACK_IMPORTED_MODULE_0___default().session).user && this.hasVoted(); - }; - _proto.hasVoted = function hasVoted() { - return this.poll.myVotes().length > 0; - }; - _proto.overallVoteCount = function overallVoteCount() { - return this.poll.voteCount(); - }; - _proto.hasVotedFor = function hasVotedFor(option) { - return this.pendingOptions ? this.pendingOptions.has(option.id()) : this.poll.myVotes().some(function (vote) { - return vote.option() === option; - }); - }; - _proto.getMaxVotes = function getMaxVotes() { - var poll = this.poll; - var maxVotes = poll.allowMultipleVotes() ? poll.maxVotes() : 1; - if (maxVotes === 0) maxVotes = poll.options().length; - return maxVotes; - }; - _proto.showButton = function showButton() { - return this.useSubmitUI && this.pendingSubmit; - }; - _proto.changeVote = function changeVote(option, evt) { - var target = evt.target; - if (!(flarum_forum_app__WEBPACK_IMPORTED_MODULE_0___default().session).user) { - flarum_forum_app__WEBPACK_IMPORTED_MODULE_0___default().modal.show((flarum_forum_components_LogInModal__WEBPACK_IMPORTED_MODULE_1___default())); - target.checked = false; - return; - } - var optionIds = this.pendingOptions || new Set(this.poll.myVotes().map(function (v) { - return v.option().id(); - })); - var isUnvoting = optionIds["delete"](option.id()); - var allowsMultiple = this.poll.allowMultipleVotes(); - if (!allowsMultiple) { - optionIds.clear(); - } - if (!isUnvoting) { - optionIds.add(option.id()); - } - this.pendingOptions = optionIds.size ? optionIds : null; - this.pendingSubmit = !!this.pendingOptions; - if (this.useSubmitUI) { - this.pendingOptions = optionIds.size ? optionIds : null; - this.pendingSubmit = !!this.pendingOptions; - m.redraw(); - return; - } - this.submit(optionIds, null, function () { - return target.checked = isUnvoting; - }); - }; - _proto.hasSelectedOptions = function hasSelectedOptions() { - return this.pendingSubmit; - }; - _proto.onsubmit = function onsubmit() { - var _this2 = this; - return this.submit(this.pendingOptions, function () { - _this2.pendingOptions = null; - _this2.pendingSubmit = false; - }); - }; - _proto.submit = function submit(optionIds, cb, onerror) { - var _this3 = this; - if (onerror === void 0) { - onerror = null; - } - this.loadingOptions = true; - m.redraw(); - return flarum_forum_app__WEBPACK_IMPORTED_MODULE_0___default().request({ - method: 'PATCH', - url: flarum_forum_app__WEBPACK_IMPORTED_MODULE_0___default().forum.attribute('apiUrl') + "/fof/polls/" + this.poll.id() + "/votes", - body: { - data: { - optionIds: Array.from(optionIds) - } - } - }).then(function (res) { - flarum_forum_app__WEBPACK_IMPORTED_MODULE_0___default().store.pushPayload(res); - cb == null || cb(); - })["catch"](function (err) { - onerror == null || onerror(err); - })["finally"](function () { - _this3.loadingOptions = false; - _this3.canSeeVoteCount = typeof _this3.poll.voteCount() === 'number'; - m.redraw(); - }); - }; - return PollState; -}(); - - -/***/ }), - -/***/ "./src/forum/states/index.ts": -/*!***********************************!*\ - !*** ./src/forum/states/index.ts ***! - \***********************************/ -/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export */ __webpack_require__.d(__webpack_exports__, { -/* harmony export */ states: () => (/* binding */ states) -/* harmony export */ }); -/* harmony import */ var _PollFormState__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./PollFormState */ "./src/forum/states/PollFormState.ts"); -/* harmony import */ var _PollListState__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./PollListState */ "./src/forum/states/PollListState.ts"); -/* harmony import */ var _PollState__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./PollState */ "./src/forum/states/PollState.ts"); - - - -var states = { - PollFormState: _PollFormState__WEBPACK_IMPORTED_MODULE_0__["default"], - PollListState: _PollListState__WEBPACK_IMPORTED_MODULE_1__["default"], - PollState: _PollState__WEBPACK_IMPORTED_MODULE_2__["default"] -}; - -/***/ }), - -/***/ "./src/forum/utils/PollControls.tsx": -/*!******************************************!*\ - !*** ./src/forum/utils/PollControls.tsx ***! - \******************************************/ -/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export */ __webpack_require__.d(__webpack_exports__, { -/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) -/* harmony export */ }); -/* harmony import */ var _babel_runtime_helpers_esm_asyncToGenerator__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/esm/asyncToGenerator */ "./node_modules/@babel/runtime/helpers/esm/asyncToGenerator.js"); -/* harmony import */ var _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/regenerator */ "./node_modules/@babel/runtime/regenerator/index.js"); -/* harmony import */ var _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_1__); -/* harmony import */ var flarum_forum_app__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! flarum/forum/app */ "flarum/forum/app"); -/* harmony import */ var flarum_forum_app__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(flarum_forum_app__WEBPACK_IMPORTED_MODULE_2__); -/* harmony import */ var _components_ComposePollPage__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../components/ComposePollPage */ "./src/forum/components/ComposePollPage.tsx"); -/* harmony import */ var _components_PollsPage__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../components/PollsPage */ "./src/forum/components/PollsPage.tsx"); -/* harmony import */ var flarum_common_utils_ItemList__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! flarum/common/utils/ItemList */ "flarum/common/utils/ItemList"); -/* harmony import */ var flarum_common_utils_ItemList__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(flarum_common_utils_ItemList__WEBPACK_IMPORTED_MODULE_5__); -/* harmony import */ var flarum_common_components_Separator__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! flarum/common/components/Separator */ "flarum/common/components/Separator"); -/* harmony import */ var flarum_common_components_Separator__WEBPACK_IMPORTED_MODULE_6___default = /*#__PURE__*/__webpack_require__.n(flarum_common_components_Separator__WEBPACK_IMPORTED_MODULE_6__); -/* harmony import */ var flarum_common_components_Button__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! flarum/common/components/Button */ "flarum/common/components/Button"); -/* harmony import */ var flarum_common_components_Button__WEBPACK_IMPORTED_MODULE_7___default = /*#__PURE__*/__webpack_require__.n(flarum_common_components_Button__WEBPACK_IMPORTED_MODULE_7__); - - - - - - - - - -/** - * The `UserControls` utility constructs a list of buttons for a user which - * perform actions on it. - */ -/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ({ - /** - * Get a list of controls for a user. - */ - controls: function controls(poll, context) { - var _this = this; - var items = new (flarum_common_utils_ItemList__WEBPACK_IMPORTED_MODULE_5___default())(); - ['poll', 'moderation', 'destructive'].forEach(function (section) { - var controls = _this[section + 'Controls'](poll, context).toArray(); - if (controls.length) { - controls.forEach(function (item) { - return items.add(item.itemName, item); - }); - items.add(section + 'Separator', m((flarum_common_components_Separator__WEBPACK_IMPORTED_MODULE_6___default()), null)); - } - }); - return items; - }, - /** - * Get controls for direct modifcation actions on polls (e.g. vote, view voters). - */ - pollControls: function pollControls(poll, context) { - var items = new (flarum_common_utils_ItemList__WEBPACK_IMPORTED_MODULE_5___default())(); - return items; - }, - /** - * Get controls for a user pertaining to moderation (e.g. suspend, edit). - */ - moderationControls: function moderationControls(poll, context) { - var items = new (flarum_common_utils_ItemList__WEBPACK_IMPORTED_MODULE_5___default())(); - if (poll.canEdit()) { - items.add('edit', m((flarum_common_components_Button__WEBPACK_IMPORTED_MODULE_7___default()), { - icon: "fas fa-pencil-alt", - onclick: this.editAction.bind(this, poll) - }, flarum_forum_app__WEBPACK_IMPORTED_MODULE_2___default().translator.trans("fof-polls.forum.poll_controls.edit_label"))); - } - return items; - }, - /** - * Get controls for a user which are destructive (e.g. delete). - * @protected - */ - destructiveControls: function destructiveControls(poll, context) { - var items = new (flarum_common_utils_ItemList__WEBPACK_IMPORTED_MODULE_5___default())(); - if (poll.canDelete()) { - items.add('delete', m((flarum_common_components_Button__WEBPACK_IMPORTED_MODULE_7___default()), { - icon: "far fa-trash-alt", - onclick: this.deleteAction.bind(this, poll) - }, flarum_forum_app__WEBPACK_IMPORTED_MODULE_2___default().translator.trans("fof-polls.forum.poll_controls.delete_label"))); - } - return items; - }, - /** - * Delete the poll. - */ - deleteAction: function deleteAction(poll) { - var _this2 = this; - return (0,_babel_runtime_helpers_esm_asyncToGenerator__WEBPACK_IMPORTED_MODULE_0__["default"])( /*#__PURE__*/_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_1___default().mark(function _callee() { - return _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_1___default().wrap(function _callee$(_context) { - while (1) switch (_context.prev = _context.next) { - case 0: - if (confirm(flarum_forum_app__WEBPACK_IMPORTED_MODULE_2___default().translator.trans("fof-polls.forum.poll_controls.delete_confirmation"))) { - _context.next = 2; - break; - } - return _context.abrupt("return"); - case 2: - return _context.abrupt("return", poll["delete"]().then(function () { - _this2.showDeletionAlert(poll, 'success'); - if (flarum_forum_app__WEBPACK_IMPORTED_MODULE_2___default().current.matches(_components_ComposePollPage__WEBPACK_IMPORTED_MODULE_3__["default"], { - id: poll.id() - }) || flarum_forum_app__WEBPACK_IMPORTED_MODULE_2___default().current.matches(_components_PollsPage__WEBPACK_IMPORTED_MODULE_4__["default"], { - id: poll.id() - })) { - flarum_forum_app__WEBPACK_IMPORTED_MODULE_2___default().history.back(); - } else { - window.location.reload(); - } - })["catch"](function () { - return _this2.showDeletionAlert(poll, 'error'); - })); - case 3: - case "end": - return _context.stop(); - } - }, _callee); - }))(); - }, - /** - * Show deletion alert of poll - */ - showDeletionAlert: function showDeletionAlert(poll, type) { - var message = { - success: "fof-polls.forum.poll_controls.delete_success_message", - error: "fof-polls.forum.poll_controls.delete_error_message" - }[type]; - flarum_forum_app__WEBPACK_IMPORTED_MODULE_2___default().alerts.show({ - type: type - }, flarum_forum_app__WEBPACK_IMPORTED_MODULE_2___default().translator.trans(message, { - poll: poll - })); - }, - /** - * Edit the poll. - */ - editAction: function editAction(poll) { - m.route.set(flarum_forum_app__WEBPACK_IMPORTED_MODULE_2___default().route('fof.polls.compose', { - id: poll.id() - })); - } -}); - -/***/ }), - -/***/ "./src/forum/utils/index.ts": -/*!**********************************!*\ - !*** ./src/forum/utils/index.ts ***! - \**********************************/ -/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export */ __webpack_require__.d(__webpack_exports__, { -/* harmony export */ utils: () => (/* binding */ utils) -/* harmony export */ }); -/* harmony import */ var _PollControls__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./PollControls */ "./src/forum/utils/PollControls.tsx"); - -var utils = { - PollControls: _PollControls__WEBPACK_IMPORTED_MODULE_0__["default"] -}; - -/***/ }), - -/***/ "flarum/common/Component": -/*!*********************************************************!*\ - !*** external "flarum.core.compat['common/Component']" ***! - \*********************************************************/ -/***/ ((module) => { - -"use strict"; -module.exports = flarum.core.compat['common/Component']; - -/***/ }), - -/***/ "flarum/common/Model": -/*!*****************************************************!*\ - !*** external "flarum.core.compat['common/Model']" ***! - \*****************************************************/ -/***/ ((module) => { - -"use strict"; -module.exports = flarum.core.compat['common/Model']; - -/***/ }), - -/***/ "flarum/common/components/Badge": -/*!****************************************************************!*\ - !*** external "flarum.core.compat['common/components/Badge']" ***! - \****************************************************************/ -/***/ ((module) => { - -"use strict"; -module.exports = flarum.core.compat['common/components/Badge']; - -/***/ }), - -/***/ "flarum/common/components/Button": -/*!*****************************************************************!*\ - !*** external "flarum.core.compat['common/components/Button']" ***! - \*****************************************************************/ -/***/ ((module) => { - -"use strict"; -module.exports = flarum.core.compat['common/components/Button']; - -/***/ }), - -/***/ "flarum/common/components/Dropdown": -/*!*******************************************************************!*\ - !*** external "flarum.core.compat['common/components/Dropdown']" ***! - \*******************************************************************/ -/***/ ((module) => { - -"use strict"; -module.exports = flarum.core.compat['common/components/Dropdown']; - -/***/ }), - -/***/ "flarum/common/components/Link": -/*!***************************************************************!*\ - !*** external "flarum.core.compat['common/components/Link']" ***! - \***************************************************************/ -/***/ ((module) => { - -"use strict"; -module.exports = flarum.core.compat['common/components/Link']; - -/***/ }), - -/***/ "flarum/common/components/LinkButton": -/*!*********************************************************************!*\ - !*** external "flarum.core.compat['common/components/LinkButton']" ***! - \*********************************************************************/ -/***/ ((module) => { - -"use strict"; -module.exports = flarum.core.compat['common/components/LinkButton']; - -/***/ }), - -/***/ "flarum/common/components/LoadingIndicator": -/*!***************************************************************************!*\ - !*** external "flarum.core.compat['common/components/LoadingIndicator']" ***! - \***************************************************************************/ -/***/ ((module) => { - -"use strict"; -module.exports = flarum.core.compat['common/components/LoadingIndicator']; - -/***/ }), - -/***/ "flarum/common/components/Modal": -/*!****************************************************************!*\ - !*** external "flarum.core.compat['common/components/Modal']" ***! - \****************************************************************/ -/***/ ((module) => { - -"use strict"; -module.exports = flarum.core.compat['common/components/Modal']; - -/***/ }), - -/***/ "flarum/common/components/Page": -/*!***************************************************************!*\ - !*** external "flarum.core.compat['common/components/Page']" ***! - \***************************************************************/ -/***/ ((module) => { - -"use strict"; -module.exports = flarum.core.compat['common/components/Page']; - -/***/ }), - -/***/ "flarum/common/components/Placeholder": -/*!**********************************************************************!*\ - !*** external "flarum.core.compat['common/components/Placeholder']" ***! - \**********************************************************************/ -/***/ ((module) => { - -"use strict"; -module.exports = flarum.core.compat['common/components/Placeholder']; - -/***/ }), - -/***/ "flarum/common/components/SelectDropdown": -/*!*************************************************************************!*\ - !*** external "flarum.core.compat['common/components/SelectDropdown']" ***! - \*************************************************************************/ -/***/ ((module) => { - -"use strict"; -module.exports = flarum.core.compat['common/components/SelectDropdown']; - -/***/ }), - -/***/ "flarum/common/components/Separator": -/*!********************************************************************!*\ - !*** external "flarum.core.compat['common/components/Separator']" ***! - \********************************************************************/ -/***/ ((module) => { - -"use strict"; -module.exports = flarum.core.compat['common/components/Separator']; - -/***/ }), - -/***/ "flarum/common/components/Switch": -/*!*****************************************************************!*\ - !*** external "flarum.core.compat['common/components/Switch']" ***! - \*****************************************************************/ -/***/ ((module) => { - -"use strict"; -module.exports = flarum.core.compat['common/components/Switch']; - -/***/ }), - -/***/ "flarum/common/components/Tooltip": -/*!******************************************************************!*\ - !*** external "flarum.core.compat['common/components/Tooltip']" ***! - \******************************************************************/ -/***/ ((module) => { - -"use strict"; -module.exports = flarum.core.compat['common/components/Tooltip']; - -/***/ }), - -/***/ "flarum/common/extend": -/*!******************************************************!*\ - !*** external "flarum.core.compat['common/extend']" ***! - \******************************************************/ -/***/ ((module) => { - -"use strict"; -module.exports = flarum.core.compat['common/extend']; - -/***/ }), - -/***/ "flarum/common/extenders": -/*!*********************************************************!*\ - !*** external "flarum.core.compat['common/extenders']" ***! - \*********************************************************/ -/***/ ((module) => { - -"use strict"; -module.exports = flarum.core.compat['common/extenders']; - -/***/ }), - -/***/ "flarum/common/helpers/avatar": -/*!**************************************************************!*\ - !*** external "flarum.core.compat['common/helpers/avatar']" ***! - \**************************************************************/ -/***/ ((module) => { - -"use strict"; -module.exports = flarum.core.compat['common/helpers/avatar']; - -/***/ }), - -/***/ "flarum/common/helpers/highlight": -/*!*****************************************************************!*\ - !*** external "flarum.core.compat['common/helpers/highlight']" ***! - \*****************************************************************/ -/***/ ((module) => { - -"use strict"; -module.exports = flarum.core.compat['common/helpers/highlight']; - -/***/ }), - -/***/ "flarum/common/helpers/icon": -/*!************************************************************!*\ - !*** external "flarum.core.compat['common/helpers/icon']" ***! - \************************************************************/ -/***/ ((module) => { - -"use strict"; -module.exports = flarum.core.compat['common/helpers/icon']; - -/***/ }), - -/***/ "flarum/common/helpers/listItems": -/*!*****************************************************************!*\ - !*** external "flarum.core.compat['common/helpers/listItems']" ***! - \*****************************************************************/ -/***/ ((module) => { - -"use strict"; -module.exports = flarum.core.compat['common/helpers/listItems']; - -/***/ }), - -/***/ "flarum/common/helpers/username": -/*!****************************************************************!*\ - !*** external "flarum.core.compat['common/helpers/username']" ***! - \****************************************************************/ -/***/ ((module) => { - -"use strict"; -module.exports = flarum.core.compat['common/helpers/username']; - -/***/ }), - -/***/ "flarum/common/models/Discussion": -/*!*****************************************************************!*\ - !*** external "flarum.core.compat['common/models/Discussion']" ***! - \*****************************************************************/ -/***/ ((module) => { - -"use strict"; -module.exports = flarum.core.compat['common/models/Discussion']; - -/***/ }), - -/***/ "flarum/common/models/Forum": -/*!************************************************************!*\ - !*** external "flarum.core.compat['common/models/Forum']" ***! - \************************************************************/ -/***/ ((module) => { - -"use strict"; -module.exports = flarum.core.compat['common/models/Forum']; - -/***/ }), - -/***/ "flarum/common/models/Post": -/*!***********************************************************!*\ - !*** external "flarum.core.compat['common/models/Post']" ***! - \***********************************************************/ -/***/ ((module) => { - -"use strict"; -module.exports = flarum.core.compat['common/models/Post']; - -/***/ }), - -/***/ "flarum/common/states/PaginatedListState": -/*!*************************************************************************!*\ - !*** external "flarum.core.compat['common/states/PaginatedListState']" ***! - \*************************************************************************/ -/***/ ((module) => { - -"use strict"; -module.exports = flarum.core.compat['common/states/PaginatedListState']; - -/***/ }), - -/***/ "flarum/common/utils/EventEmitter": -/*!******************************************************************!*\ - !*** external "flarum.core.compat['common/utils/EventEmitter']" ***! - \******************************************************************/ -/***/ ((module) => { - -"use strict"; -module.exports = flarum.core.compat['common/utils/EventEmitter']; - -/***/ }), - -/***/ "flarum/common/utils/ItemList": -/*!**************************************************************!*\ - !*** external "flarum.core.compat['common/utils/ItemList']" ***! - \**************************************************************/ -/***/ ((module) => { - -"use strict"; -module.exports = flarum.core.compat['common/utils/ItemList']; - -/***/ }), - -/***/ "flarum/common/utils/Stream": -/*!************************************************************!*\ - !*** external "flarum.core.compat['common/utils/Stream']" ***! - \************************************************************/ -/***/ ((module) => { - -"use strict"; -module.exports = flarum.core.compat['common/utils/Stream']; - -/***/ }), - -/***/ "flarum/common/utils/SubtreeRetainer": -/*!*********************************************************************!*\ - !*** external "flarum.core.compat['common/utils/SubtreeRetainer']" ***! - \*********************************************************************/ -/***/ ((module) => { - -"use strict"; -module.exports = flarum.core.compat['common/utils/SubtreeRetainer']; - -/***/ }), - -/***/ "flarum/common/utils/abbreviateNumber": -/*!**********************************************************************!*\ - !*** external "flarum.core.compat['common/utils/abbreviateNumber']" ***! - \**********************************************************************/ -/***/ ((module) => { - -"use strict"; -module.exports = flarum.core.compat['common/utils/abbreviateNumber']; - -/***/ }), - -/***/ "flarum/common/utils/classList": -/*!***************************************************************!*\ - !*** external "flarum.core.compat['common/utils/classList']" ***! - \***************************************************************/ -/***/ ((module) => { - -"use strict"; -module.exports = flarum.core.compat['common/utils/classList']; - -/***/ }), - -/***/ "flarum/common/utils/computed": -/*!**************************************************************!*\ - !*** external "flarum.core.compat['common/utils/computed']" ***! - \**************************************************************/ -/***/ ((module) => { - -"use strict"; -module.exports = flarum.core.compat['common/utils/computed']; - -/***/ }), - -/***/ "flarum/common/utils/extractText": -/*!*****************************************************************!*\ - !*** external "flarum.core.compat['common/utils/extractText']" ***! - \*****************************************************************/ -/***/ ((module) => { - -"use strict"; -module.exports = flarum.core.compat['common/utils/extractText']; - -/***/ }), - -/***/ "flarum/common/utils/string": -/*!************************************************************!*\ - !*** external "flarum.core.compat['common/utils/string']" ***! - \************************************************************/ -/***/ ((module) => { - -"use strict"; -module.exports = flarum.core.compat['common/utils/string']; - -/***/ }), - -/***/ "flarum/forum/app": -/*!**************************************************!*\ - !*** external "flarum.core.compat['forum/app']" ***! - \**************************************************/ -/***/ ((module) => { - -"use strict"; -module.exports = flarum.core.compat['forum/app']; - -/***/ }), - -/***/ "flarum/forum/components/CommentPost": -/*!*********************************************************************!*\ - !*** external "flarum.core.compat['forum/components/CommentPost']" ***! - \*********************************************************************/ -/***/ ((module) => { - -"use strict"; -module.exports = flarum.core.compat['forum/components/CommentPost']; - -/***/ }), - -/***/ "flarum/forum/components/DiscussionComposer": -/*!****************************************************************************!*\ - !*** external "flarum.core.compat['forum/components/DiscussionComposer']" ***! - \****************************************************************************/ -/***/ ((module) => { - -"use strict"; -module.exports = flarum.core.compat['forum/components/DiscussionComposer']; - -/***/ }), - -/***/ "flarum/forum/components/DiscussionList": -/*!************************************************************************!*\ - !*** external "flarum.core.compat['forum/components/DiscussionList']" ***! - \************************************************************************/ -/***/ ((module) => { - -"use strict"; -module.exports = flarum.core.compat['forum/components/DiscussionList']; - -/***/ }), - -/***/ "flarum/forum/components/DiscussionPage": -/*!************************************************************************!*\ - !*** external "flarum.core.compat['forum/components/DiscussionPage']" ***! - \************************************************************************/ -/***/ ((module) => { - -"use strict"; -module.exports = flarum.core.compat['forum/components/DiscussionPage']; - -/***/ }), - -/***/ "flarum/forum/components/IndexPage": -/*!*******************************************************************!*\ - !*** external "flarum.core.compat['forum/components/IndexPage']" ***! - \*******************************************************************/ -/***/ ((module) => { - -"use strict"; -module.exports = flarum.core.compat['forum/components/IndexPage']; - -/***/ }), - -/***/ "flarum/forum/components/LogInModal": -/*!********************************************************************!*\ - !*** external "flarum.core.compat['forum/components/LogInModal']" ***! - \********************************************************************/ -/***/ ((module) => { - -"use strict"; -module.exports = flarum.core.compat['forum/components/LogInModal']; - -/***/ }), - -/***/ "flarum/forum/components/ReplyComposer": -/*!***********************************************************************!*\ - !*** external "flarum.core.compat['forum/components/ReplyComposer']" ***! - \***********************************************************************/ -/***/ ((module) => { - -"use strict"; -module.exports = flarum.core.compat['forum/components/ReplyComposer']; - -/***/ }), - -/***/ "flarum/forum/utils/PostControls": -/*!*****************************************************************!*\ - !*** external "flarum.core.compat['forum/utils/PostControls']" ***! - \*****************************************************************/ -/***/ ((module) => { - -"use strict"; -module.exports = flarum.core.compat['forum/utils/PostControls']; - -/***/ }), - -/***/ "flarum/forum/utils/slidable": -/*!*************************************************************!*\ - !*** external "flarum.core.compat['forum/utils/slidable']" ***! - \*************************************************************/ -/***/ ((module) => { - -"use strict"; -module.exports = flarum.core.compat['forum/utils/slidable']; - -/***/ }), - -/***/ "./node_modules/@babel/runtime/helpers/regeneratorRuntime.js": -/*!*******************************************************************!*\ - !*** ./node_modules/@babel/runtime/helpers/regeneratorRuntime.js ***! - \*******************************************************************/ -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { - -var _typeof = (__webpack_require__(/*! ./typeof.js */ "./node_modules/@babel/runtime/helpers/typeof.js")["default"]); -function _regeneratorRuntime() { - "use strict"; - - /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */ - module.exports = _regeneratorRuntime = function _regeneratorRuntime() { - return e; - }, module.exports.__esModule = true, module.exports["default"] = module.exports; - var t, - e = {}, - r = Object.prototype, - n = r.hasOwnProperty, - o = Object.defineProperty || function (t, e, r) { - t[e] = r.value; - }, - i = "function" == typeof Symbol ? Symbol : {}, - a = i.iterator || "@@iterator", - c = i.asyncIterator || "@@asyncIterator", - u = i.toStringTag || "@@toStringTag"; - function define(t, e, r) { - return Object.defineProperty(t, e, { - value: r, - enumerable: !0, - configurable: !0, - writable: !0 - }), t[e]; - } - try { - define({}, ""); - } catch (t) { - define = function define(t, e, r) { - return t[e] = r; - }; - } - function wrap(t, e, r, n) { - var i = e && e.prototype instanceof Generator ? e : Generator, - a = Object.create(i.prototype), - c = new Context(n || []); - return o(a, "_invoke", { - value: makeInvokeMethod(t, r, c) - }), a; - } - function tryCatch(t, e, r) { - try { - return { - type: "normal", - arg: t.call(e, r) - }; - } catch (t) { - return { - type: "throw", - arg: t - }; - } - } - e.wrap = wrap; - var h = "suspendedStart", - l = "suspendedYield", - f = "executing", - s = "completed", - y = {}; - function Generator() {} - function GeneratorFunction() {} - function GeneratorFunctionPrototype() {} - var p = {}; - define(p, a, function () { - return this; - }); - var d = Object.getPrototypeOf, - v = d && d(d(values([]))); - v && v !== r && n.call(v, a) && (p = v); - var g = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(p); - function defineIteratorMethods(t) { - ["next", "throw", "return"].forEach(function (e) { - define(t, e, function (t) { - return this._invoke(e, t); - }); - }); - } - function AsyncIterator(t, e) { - function invoke(r, o, i, a) { - var c = tryCatch(t[r], t, o); - if ("throw" !== c.type) { - var u = c.arg, - h = u.value; - return h && "object" == _typeof(h) && n.call(h, "__await") ? e.resolve(h.__await).then(function (t) { - invoke("next", t, i, a); - }, function (t) { - invoke("throw", t, i, a); - }) : e.resolve(h).then(function (t) { - u.value = t, i(u); - }, function (t) { - return invoke("throw", t, i, a); - }); - } - a(c.arg); - } - var r; - o(this, "_invoke", { - value: function value(t, n) { - function callInvokeWithMethodAndArg() { - return new e(function (e, r) { - invoke(t, n, e, r); - }); - } - return r = r ? r.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg(); - } - }); - } - function makeInvokeMethod(e, r, n) { - var o = h; - return function (i, a) { - if (o === f) throw new Error("Generator is already running"); - if (o === s) { - if ("throw" === i) throw a; - return { - value: t, - done: !0 - }; - } - for (n.method = i, n.arg = a;;) { - var c = n.delegate; - if (c) { - var u = maybeInvokeDelegate(c, n); - if (u) { - if (u === y) continue; - return u; - } - } - if ("next" === n.method) n.sent = n._sent = n.arg;else if ("throw" === n.method) { - if (o === h) throw o = s, n.arg; - n.dispatchException(n.arg); - } else "return" === n.method && n.abrupt("return", n.arg); - o = f; - var p = tryCatch(e, r, n); - if ("normal" === p.type) { - if (o = n.done ? s : l, p.arg === y) continue; - return { - value: p.arg, - done: n.done - }; - } - "throw" === p.type && (o = s, n.method = "throw", n.arg = p.arg); - } - }; - } - function maybeInvokeDelegate(e, r) { - var n = r.method, - o = e.iterator[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; - var i = tryCatch(o, e.iterator, r.arg); - if ("throw" === i.type) return r.method = "throw", r.arg = i.arg, r.delegate = null, y; - var a = i.arg; - 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); - } - function pushTryEntry(t) { - var e = { - tryLoc: t[0] - }; - 1 in t && (e.catchLoc = t[1]), 2 in t && (e.finallyLoc = t[2], e.afterLoc = t[3]), this.tryEntries.push(e); - } - function resetTryEntry(t) { - var e = t.completion || {}; - e.type = "normal", delete e.arg, t.completion = e; - } - function Context(t) { - this.tryEntries = [{ - tryLoc: "root" - }], t.forEach(pushTryEntry, this), this.reset(!0); - } - function values(e) { - if (e || "" === e) { - var r = e[a]; - if (r) return r.call(e); - if ("function" == typeof e.next) return e; - if (!isNaN(e.length)) { - var o = -1, - i = function next() { - for (; ++o < e.length;) if (n.call(e, o)) return next.value = e[o], next.done = !1, next; - return next.value = t, next.done = !0, next; - }; - return i.next = i; - } - } - throw new TypeError(_typeof(e) + " is not iterable"); - } - return GeneratorFunction.prototype = GeneratorFunctionPrototype, o(g, "constructor", { - value: GeneratorFunctionPrototype, - configurable: !0 - }), o(GeneratorFunctionPrototype, "constructor", { - value: GeneratorFunction, - configurable: !0 - }), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, u, "GeneratorFunction"), e.isGeneratorFunction = function (t) { - var e = "function" == typeof t && t.constructor; - return !!e && (e === GeneratorFunction || "GeneratorFunction" === (e.displayName || e.name)); - }, e.mark = function (t) { - return Object.setPrototypeOf ? Object.setPrototypeOf(t, GeneratorFunctionPrototype) : (t.__proto__ = GeneratorFunctionPrototype, define(t, u, "GeneratorFunction")), t.prototype = Object.create(g), t; - }, e.awrap = function (t) { - return { - __await: t - }; - }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, c, function () { - return this; - }), e.AsyncIterator = AsyncIterator, e.async = function (t, r, n, o, i) { - void 0 === i && (i = Promise); - var a = new AsyncIterator(wrap(t, r, n, o), i); - return e.isGeneratorFunction(r) ? a : a.next().then(function (t) { - return t.done ? t.value : a.next(); - }); - }, defineIteratorMethods(g), define(g, u, "Generator"), define(g, a, function () { - return this; - }), define(g, "toString", function () { - return "[object Generator]"; - }), e.keys = function (t) { - var e = Object(t), - r = []; - for (var n in e) r.push(n); - return r.reverse(), function next() { - for (; r.length;) { - var t = r.pop(); - if (t in e) return next.value = t, next.done = !1, next; - } - return next.done = !0, next; - }; - }, e.values = values, Context.prototype = { - constructor: Context, - reset: function reset(e) { - 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); - }, - stop: function stop() { - this.done = !0; - var t = this.tryEntries[0].completion; - if ("throw" === t.type) throw t.arg; - return this.rval; - }, - dispatchException: function dispatchException(e) { - if (this.done) throw e; - var r = this; - function handle(n, o) { - return a.type = "throw", a.arg = e, r.next = n, o && (r.method = "next", r.arg = t), !!o; - } - for (var o = this.tryEntries.length - 1; o >= 0; --o) { - var i = this.tryEntries[o], - a = i.completion; - if ("root" === i.tryLoc) return handle("end"); - if (i.tryLoc <= this.prev) { - var c = n.call(i, "catchLoc"), - u = n.call(i, "finallyLoc"); - if (c && u) { - if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); - if (this.prev < i.finallyLoc) return handle(i.finallyLoc); - } else if (c) { - if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); - } else { - if (!u) throw new Error("try statement without catch or finally"); - if (this.prev < i.finallyLoc) return handle(i.finallyLoc); - } - } - } - }, - abrupt: function abrupt(t, e) { - for (var r = this.tryEntries.length - 1; r >= 0; --r) { - var o = this.tryEntries[r]; - if (o.tryLoc <= this.prev && n.call(o, "finallyLoc") && this.prev < o.finallyLoc) { - var i = o; - break; - } - } - i && ("break" === t || "continue" === t) && i.tryLoc <= e && e <= i.finallyLoc && (i = null); - var a = i ? i.completion : {}; - return a.type = t, a.arg = e, i ? (this.method = "next", this.next = i.finallyLoc, y) : this.complete(a); - }, - complete: function complete(t, e) { - if ("throw" === t.type) throw t.arg; - 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; - }, - finish: function finish(t) { - for (var e = this.tryEntries.length - 1; e >= 0; --e) { - var r = this.tryEntries[e]; - if (r.finallyLoc === t) return this.complete(r.completion, r.afterLoc), resetTryEntry(r), y; - } - }, - "catch": function _catch(t) { - for (var e = this.tryEntries.length - 1; e >= 0; --e) { - var r = this.tryEntries[e]; - if (r.tryLoc === t) { - var n = r.completion; - if ("throw" === n.type) { - var o = n.arg; - resetTryEntry(r); - } - return o; - } - } - throw new Error("illegal catch attempt"); - }, - delegateYield: function delegateYield(e, r, n) { - return this.delegate = { - iterator: values(e), - resultName: r, - nextLoc: n - }, "next" === this.method && (this.arg = t), y; - } - }, e; -} -module.exports = _regeneratorRuntime, module.exports.__esModule = true, module.exports["default"] = module.exports; - -/***/ }), - -/***/ "./node_modules/@babel/runtime/helpers/typeof.js": -/*!*******************************************************!*\ - !*** ./node_modules/@babel/runtime/helpers/typeof.js ***! - \*******************************************************/ -/***/ ((module) => { - -function _typeof(o) { - "@babel/helpers - typeof"; - - return (module.exports = _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { - return typeof o; - } : function (o) { - return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; - }, module.exports.__esModule = true, module.exports["default"] = module.exports), _typeof(o); -} -module.exports = _typeof, module.exports.__esModule = true, module.exports["default"] = module.exports; - -/***/ }), - -/***/ "./node_modules/@babel/runtime/regenerator/index.js": -/*!**********************************************************!*\ - !*** ./node_modules/@babel/runtime/regenerator/index.js ***! - \**********************************************************/ -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { - -// TODO(Babel 8): Remove this file. - -var runtime = __webpack_require__(/*! ../helpers/regeneratorRuntime */ "./node_modules/@babel/runtime/helpers/regeneratorRuntime.js")(); -module.exports = runtime; - -// Copied from https://github.com/facebook/regenerator/blob/main/packages/runtime/runtime.js#L736= -try { - regeneratorRuntime = runtime; -} catch (accidentalStrictMode) { - if (typeof globalThis === "object") { - globalThis.regeneratorRuntime = runtime; - } else { - Function("r", "regeneratorRuntime = r")(runtime); - } -} - -/***/ }), - -/***/ "./node_modules/@babel/runtime/helpers/esm/assertThisInitialized.js": -/*!**************************************************************************!*\ - !*** ./node_modules/@babel/runtime/helpers/esm/assertThisInitialized.js ***! - \**************************************************************************/ -/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export */ __webpack_require__.d(__webpack_exports__, { -/* harmony export */ "default": () => (/* binding */ _assertThisInitialized) -/* harmony export */ }); -function _assertThisInitialized(self) { - if (self === void 0) { - throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); - } - return self; -} - -/***/ }), - -/***/ "./node_modules/@babel/runtime/helpers/esm/asyncToGenerator.js": -/*!*********************************************************************!*\ - !*** ./node_modules/@babel/runtime/helpers/esm/asyncToGenerator.js ***! - \*********************************************************************/ -/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export */ __webpack_require__.d(__webpack_exports__, { -/* harmony export */ "default": () => (/* binding */ _asyncToGenerator) -/* harmony export */ }); -function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { - try { - var info = gen[key](arg); - var value = info.value; - } catch (error) { - reject(error); - return; - } - if (info.done) { - resolve(value); - } else { - Promise.resolve(value).then(_next, _throw); - } -} -function _asyncToGenerator(fn) { - return function () { - var self = this, - args = arguments; - return new Promise(function (resolve, reject) { - var gen = fn.apply(self, args); - function _next(value) { - asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value); - } - function _throw(err) { - asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err); - } - _next(undefined); - }); - }; -} - -/***/ }), - -/***/ "./node_modules/@babel/runtime/helpers/esm/construct.js": -/*!**************************************************************!*\ - !*** ./node_modules/@babel/runtime/helpers/esm/construct.js ***! - \**************************************************************/ -/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export */ __webpack_require__.d(__webpack_exports__, { -/* harmony export */ "default": () => (/* binding */ _construct) -/* harmony export */ }); -/* harmony import */ var _setPrototypeOf_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./setPrototypeOf.js */ "./node_modules/@babel/runtime/helpers/esm/setPrototypeOf.js"); -/* harmony import */ var _isNativeReflectConstruct_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./isNativeReflectConstruct.js */ "./node_modules/@babel/runtime/helpers/esm/isNativeReflectConstruct.js"); - - -function _construct(t, e, r) { - if ((0,_isNativeReflectConstruct_js__WEBPACK_IMPORTED_MODULE_1__["default"])()) return Reflect.construct.apply(null, arguments); - var o = [null]; - o.push.apply(o, e); - var p = new (t.bind.apply(t, o))(); - return r && (0,_setPrototypeOf_js__WEBPACK_IMPORTED_MODULE_0__["default"])(p, r.prototype), p; -} - -/***/ }), - -/***/ "./node_modules/@babel/runtime/helpers/esm/createClass.js": -/*!****************************************************************!*\ - !*** ./node_modules/@babel/runtime/helpers/esm/createClass.js ***! - \****************************************************************/ -/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export */ __webpack_require__.d(__webpack_exports__, { -/* harmony export */ "default": () => (/* binding */ _createClass) -/* harmony export */ }); -/* harmony import */ var _toPropertyKey_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./toPropertyKey.js */ "./node_modules/@babel/runtime/helpers/esm/toPropertyKey.js"); - -function _defineProperties(target, props) { - for (var i = 0; i < props.length; i++) { - var descriptor = props[i]; - descriptor.enumerable = descriptor.enumerable || false; - descriptor.configurable = true; - if ("value" in descriptor) descriptor.writable = true; - Object.defineProperty(target, (0,_toPropertyKey_js__WEBPACK_IMPORTED_MODULE_0__["default"])(descriptor.key), descriptor); - } -} -function _createClass(Constructor, protoProps, staticProps) { - if (protoProps) _defineProperties(Constructor.prototype, protoProps); - if (staticProps) _defineProperties(Constructor, staticProps); - Object.defineProperty(Constructor, "prototype", { - writable: false - }); - return Constructor; -} - -/***/ }), - -/***/ "./node_modules/@babel/runtime/helpers/esm/extends.js": -/*!************************************************************!*\ - !*** ./node_modules/@babel/runtime/helpers/esm/extends.js ***! - \************************************************************/ -/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export */ __webpack_require__.d(__webpack_exports__, { -/* harmony export */ "default": () => (/* binding */ _extends) -/* harmony export */ }); -function _extends() { - _extends = Object.assign ? Object.assign.bind() : function (target) { - for (var i = 1; i < arguments.length; i++) { - var source = arguments[i]; - for (var key in source) { - if (Object.prototype.hasOwnProperty.call(source, key)) { - target[key] = source[key]; - } - } - } - return target; - }; - return _extends.apply(this, arguments); -} - -/***/ }), - -/***/ "./node_modules/@babel/runtime/helpers/esm/getPrototypeOf.js": -/*!*******************************************************************!*\ - !*** ./node_modules/@babel/runtime/helpers/esm/getPrototypeOf.js ***! - \*******************************************************************/ -/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export */ __webpack_require__.d(__webpack_exports__, { -/* harmony export */ "default": () => (/* binding */ _getPrototypeOf) -/* harmony export */ }); -function _getPrototypeOf(o) { - _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { - return o.__proto__ || Object.getPrototypeOf(o); - }; - return _getPrototypeOf(o); -} - -/***/ }), - -/***/ "./node_modules/@babel/runtime/helpers/esm/inheritsLoose.js": -/*!******************************************************************!*\ - !*** ./node_modules/@babel/runtime/helpers/esm/inheritsLoose.js ***! - \******************************************************************/ -/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export */ __webpack_require__.d(__webpack_exports__, { -/* harmony export */ "default": () => (/* binding */ _inheritsLoose) -/* harmony export */ }); -/* harmony import */ var _setPrototypeOf_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./setPrototypeOf.js */ "./node_modules/@babel/runtime/helpers/esm/setPrototypeOf.js"); - -function _inheritsLoose(subClass, superClass) { - subClass.prototype = Object.create(superClass.prototype); - subClass.prototype.constructor = subClass; - (0,_setPrototypeOf_js__WEBPACK_IMPORTED_MODULE_0__["default"])(subClass, superClass); -} - -/***/ }), - -/***/ "./node_modules/@babel/runtime/helpers/esm/isNativeFunction.js": -/*!*********************************************************************!*\ - !*** ./node_modules/@babel/runtime/helpers/esm/isNativeFunction.js ***! - \*********************************************************************/ -/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export */ __webpack_require__.d(__webpack_exports__, { -/* harmony export */ "default": () => (/* binding */ _isNativeFunction) -/* harmony export */ }); -function _isNativeFunction(fn) { - try { - return Function.toString.call(fn).indexOf("[native code]") !== -1; - } catch (e) { - return typeof fn === "function"; - } -} - -/***/ }), - -/***/ "./node_modules/@babel/runtime/helpers/esm/isNativeReflectConstruct.js": -/*!*****************************************************************************!*\ - !*** ./node_modules/@babel/runtime/helpers/esm/isNativeReflectConstruct.js ***! - \*****************************************************************************/ -/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export */ __webpack_require__.d(__webpack_exports__, { -/* harmony export */ "default": () => (/* binding */ _isNativeReflectConstruct) -/* harmony export */ }); -function _isNativeReflectConstruct() { - try { - var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); - } catch (t) {} - return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { - return !!t; - })(); -} - -/***/ }), - -/***/ "./node_modules/@babel/runtime/helpers/esm/setPrototypeOf.js": -/*!*******************************************************************!*\ - !*** ./node_modules/@babel/runtime/helpers/esm/setPrototypeOf.js ***! - \*******************************************************************/ -/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export */ __webpack_require__.d(__webpack_exports__, { -/* harmony export */ "default": () => (/* binding */ _setPrototypeOf) -/* harmony export */ }); -function _setPrototypeOf(o, p) { - _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { - o.__proto__ = p; - return o; - }; - return _setPrototypeOf(o, p); -} - -/***/ }), - -/***/ "./node_modules/@babel/runtime/helpers/esm/toPrimitive.js": -/*!****************************************************************!*\ - !*** ./node_modules/@babel/runtime/helpers/esm/toPrimitive.js ***! - \****************************************************************/ -/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export */ __webpack_require__.d(__webpack_exports__, { -/* harmony export */ "default": () => (/* binding */ toPrimitive) -/* harmony export */ }); -/* harmony import */ var _typeof_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./typeof.js */ "./node_modules/@babel/runtime/helpers/esm/typeof.js"); - -function toPrimitive(t, r) { - if ("object" != (0,_typeof_js__WEBPACK_IMPORTED_MODULE_0__["default"])(t) || !t) return t; - var e = t[Symbol.toPrimitive]; - if (void 0 !== e) { - var i = e.call(t, r || "default"); - if ("object" != (0,_typeof_js__WEBPACK_IMPORTED_MODULE_0__["default"])(i)) return i; - throw new TypeError("@@toPrimitive must return a primitive value."); - } - return ("string" === r ? String : Number)(t); -} - -/***/ }), - -/***/ "./node_modules/@babel/runtime/helpers/esm/toPropertyKey.js": -/*!******************************************************************!*\ - !*** ./node_modules/@babel/runtime/helpers/esm/toPropertyKey.js ***! - \******************************************************************/ -/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export */ __webpack_require__.d(__webpack_exports__, { -/* harmony export */ "default": () => (/* binding */ toPropertyKey) -/* harmony export */ }); -/* harmony import */ var _typeof_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./typeof.js */ "./node_modules/@babel/runtime/helpers/esm/typeof.js"); -/* harmony import */ var _toPrimitive_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./toPrimitive.js */ "./node_modules/@babel/runtime/helpers/esm/toPrimitive.js"); - - -function toPropertyKey(t) { - var i = (0,_toPrimitive_js__WEBPACK_IMPORTED_MODULE_1__["default"])(t, "string"); - return "symbol" == (0,_typeof_js__WEBPACK_IMPORTED_MODULE_0__["default"])(i) ? i : String(i); -} - -/***/ }), - -/***/ "./node_modules/@babel/runtime/helpers/esm/typeof.js": -/*!***********************************************************!*\ - !*** ./node_modules/@babel/runtime/helpers/esm/typeof.js ***! - \***********************************************************/ -/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export */ __webpack_require__.d(__webpack_exports__, { -/* harmony export */ "default": () => (/* binding */ _typeof) -/* harmony export */ }); -function _typeof(o) { - "@babel/helpers - typeof"; - - return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { - return typeof o; - } : function (o) { - return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; - }, _typeof(o); -} - -/***/ }), - -/***/ "./node_modules/@babel/runtime/helpers/esm/wrapNativeSuper.js": -/*!********************************************************************!*\ - !*** ./node_modules/@babel/runtime/helpers/esm/wrapNativeSuper.js ***! - \********************************************************************/ -/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export */ __webpack_require__.d(__webpack_exports__, { -/* harmony export */ "default": () => (/* binding */ _wrapNativeSuper) -/* harmony export */ }); -/* harmony import */ var _getPrototypeOf_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./getPrototypeOf.js */ "./node_modules/@babel/runtime/helpers/esm/getPrototypeOf.js"); -/* harmony import */ var _setPrototypeOf_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./setPrototypeOf.js */ "./node_modules/@babel/runtime/helpers/esm/setPrototypeOf.js"); -/* harmony import */ var _isNativeFunction_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./isNativeFunction.js */ "./node_modules/@babel/runtime/helpers/esm/isNativeFunction.js"); -/* harmony import */ var _construct_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./construct.js */ "./node_modules/@babel/runtime/helpers/esm/construct.js"); - - - - -function _wrapNativeSuper(Class) { - var _cache = typeof Map === "function" ? new Map() : undefined; - _wrapNativeSuper = function _wrapNativeSuper(Class) { - if (Class === null || !(0,_isNativeFunction_js__WEBPACK_IMPORTED_MODULE_2__["default"])(Class)) return Class; - if (typeof Class !== "function") { - throw new TypeError("Super expression must either be null or a function"); - } - if (typeof _cache !== "undefined") { - if (_cache.has(Class)) return _cache.get(Class); - _cache.set(Class, Wrapper); - } - function Wrapper() { - return (0,_construct_js__WEBPACK_IMPORTED_MODULE_3__["default"])(Class, arguments, (0,_getPrototypeOf_js__WEBPACK_IMPORTED_MODULE_0__["default"])(this).constructor); - } - Wrapper.prototype = Object.create(Class.prototype, { - constructor: { - value: Wrapper, - enumerable: false, - writable: true, - configurable: true - } - }); - return (0,_setPrototypeOf_js__WEBPACK_IMPORTED_MODULE_1__["default"])(Wrapper, Class); - }; - return _wrapNativeSuper(Class); -} - -/***/ }) - -/******/ }); -/************************************************************************/ -/******/ // The module cache -/******/ var __webpack_module_cache__ = {}; -/******/ -/******/ // The require function -/******/ function __webpack_require__(moduleId) { -/******/ // Check if module is in cache -/******/ var cachedModule = __webpack_module_cache__[moduleId]; -/******/ if (cachedModule !== undefined) { -/******/ return cachedModule.exports; -/******/ } -/******/ // Create a new module (and put it into the cache) -/******/ var module = __webpack_module_cache__[moduleId] = { -/******/ // no module.id needed -/******/ // no module.loaded needed -/******/ exports: {} -/******/ }; -/******/ -/******/ // Execute the module function -/******/ __webpack_modules__[moduleId](module, module.exports, __webpack_require__); -/******/ -/******/ // Return the exports of the module -/******/ return module.exports; -/******/ } -/******/ -/************************************************************************/ -/******/ /* webpack/runtime/compat get default export */ -/******/ (() => { -/******/ // getDefaultExport function for compatibility with non-harmony modules -/******/ __webpack_require__.n = (module) => { -/******/ var getter = module && module.__esModule ? -/******/ () => (module['default']) : -/******/ () => (module); -/******/ __webpack_require__.d(getter, { a: getter }); -/******/ return getter; -/******/ }; -/******/ })(); -/******/ -/******/ /* webpack/runtime/define property getters */ -/******/ (() => { -/******/ // define getter functions for harmony exports -/******/ __webpack_require__.d = (exports, definition) => { -/******/ for(var key in definition) { -/******/ if(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) { -/******/ Object.defineProperty(exports, key, { enumerable: true, get: definition[key] }); -/******/ } -/******/ } -/******/ }; -/******/ })(); -/******/ -/******/ /* webpack/runtime/hasOwnProperty shorthand */ -/******/ (() => { -/******/ __webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop)) -/******/ })(); -/******/ -/******/ /* webpack/runtime/make namespace object */ -/******/ (() => { -/******/ // define __esModule on exports -/******/ __webpack_require__.r = (exports) => { -/******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) { -/******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); -/******/ } -/******/ Object.defineProperty(exports, '__esModule', { value: true }); -/******/ }; -/******/ })(); -/******/ -/************************************************************************/ -var __webpack_exports__ = {}; -// This entry need to be wrapped in an IIFE because it need to be in strict mode. -(() => { -"use strict"; -/*!******************!*\ - !*** ./forum.ts ***! - \******************/ -__webpack_require__.r(__webpack_exports__); -/* harmony export */ __webpack_require__.d(__webpack_exports__, { -/* harmony export */ components: () => (/* reexport safe */ _src_forum__WEBPACK_IMPORTED_MODULE_0__.components), -/* harmony export */ extend: () => (/* reexport safe */ _src_forum__WEBPACK_IMPORTED_MODULE_0__.extend), -/* harmony export */ models: () => (/* reexport safe */ _src_forum__WEBPACK_IMPORTED_MODULE_0__.models), -/* harmony export */ states: () => (/* reexport safe */ _src_forum__WEBPACK_IMPORTED_MODULE_0__.states), -/* harmony export */ utils: () => (/* reexport safe */ _src_forum__WEBPACK_IMPORTED_MODULE_0__.utils) -/* harmony export */ }); -/* harmony import */ var _src_forum__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./src/forum */ "./src/forum/index.ts"); - -})(); - -module.exports = __webpack_exports__; -/******/ })() -; +/*! 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 E(n||[]);return s(a,"_invoke",{value:O(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 A=N.prototype=w.prototype=Object.create(x);function I(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 O(t,e,n){var r=h;return function(a,l){if(r===g)throw new 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=S(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 S(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,S(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 M(t){var o=t.completion||{};o.type="normal",delete o.arg,t.completion=o}function E(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),M(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;M(e)}return r}}throw new 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:()=>wo,extend:()=>Bo,models:()=>Co,states:()=>Oo,utils:()=>So});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 A=flarum.core.compat["common/Component"];var I=e.n(A);const C=flarum.core.compat["common/components/Button"];var O=e.n(C);const S=flarum.core.compat["common/components/Switch"];var k=e.n(S);const M=flarum.core.compat["common/utils/ItemList"];var E=e.n(M);const L=flarum.core.compat["common/utils/Stream"];var D=e.n(L);const U=flarum.core.compat["common/utils/extractText"];var B=e.n(U);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)),R=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 H=flarum.core.compat["common/components/Page"];var G=e.n(H);const z=flarum.core.compat["common/components/LoadingIndicator"];var Y=e.n(z);const J=flarum.core.compat["common/components/LinkButton"];var W=e.n(J),K=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,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("div",{className:"PollBar","data-selected":!!this.voted,style:"--poll-option-width: "+n+"%"},this.state.showCheckMarks&&m("label",{className:"PollAnswer-checkbox checkbox"},m("input",{onchange:this.state.changeVote.bind(this.state,this.option),type:"checkbox",checked:this.voted,disabled:e}),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()}):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(E());return t.add("answer",m("span",{className:"PollAnswer-text-answer"},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}(I()),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(E());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}(I()),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(O(),{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}(I());const Mt=flarum.core.compat["common/utils/string"];var Et=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(E());return t.add("title",m("h2",{className:"Poll-title"},this.attrs.poll.question())),t},o}(I()),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(E());return t.add("subtitle",m("p",{className:"Poll-subtitle"},this.attrs.poll.subtitle())),t},o}(I()),Dt=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=new 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()},a.addPoll=function(t){this.removePoll(t),this.extraPolls.unshift(t),m.redraw()},a.getAllItems=function(){return this.extraPolls.concat(t.prototype.getAllItems.call(this))},a.getPages=function(){var o=t.prototype.getPages.call(this);return this.extraPolls.length?[{number:-1,items:this.extraPolls}].concat(o):o},n=e,(r=[{key:"type",get:function(){return"fof/polls"}}])&&Gt(n.prototype,r),Object.defineProperty(n,"prototype",{writable:!1}),e}(Yt()),Qt=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 Kt({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(Dt,{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(qt,{state:this.state})))))},n.sidebarItems=function(){var t=this,e=new(E()),n=o().forum.attribute("canStartGlobalPolls");return e.add("newGlobalPoll",m(O(),{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(E());return e.add("refresh",O().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}(Ut);const Xt=flarum.core.compat["common/components/Separator"];var Zt=e.n(Xt);const to={controls:function(t,o){var e=this,n=new(E());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(Zt(),null)))})),n},pollControls:function(t,o){return new(E())},moderationControls:function(t,e){var n=new(E());return t.canEdit()&&n.add("edit",m(O(),{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(E());return t.canDelete()&&n.add("delete",m(O(),{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(Qt,{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 oo(){return oo=Object.assign?Object.assign.bind():function(t){for(var o=1;o').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(){this.loading=!0,m.redraw(),o().request({method:"DELETE",url:this.resourceUrl()}).then(this.success.bind(this),this.failure.bind(this))},n.resourceUrl=function(){var t=o().forum.attribute("apiUrl")+"/fof/polls/"+this.attrs.name,e=this.attrs.poll,n=this.attrs.option;return null!=e&&e.exists&&(t+="/"+(null==e?void 0:e.id())),null!=n&&n.exists&&(t+="/"+(null==n?void 0:n.id())),t},n.success=function(t){var o,e;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()},n.failure=function(t){this.loading=!1,m.redraw()},e}(O()),no=function(t){function e(){for(var o,e=arguments.length,n=new Array(e),r=0;r=2?O().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.lengtht.length)&&(o=t.length);for(var e=0,n=new Array(o);e0;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 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()}):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(Ot,{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}(I()),go=function(t){function o(){for(var o,e=arguments.length,n=new Array(e),r=0;r=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(Dt,{poll:r}))}})),(0,r.extend)(io().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)(co().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)(co().prototype,"onremove",(function(){o().pusher&&o().pusher.then((function(t){t.channels.main.unbind("updatedPollOptions")}))})),t=function(t){return o().modal.show(ro,{onsubmit:function(e){return o().store.createRecord("polls").save(oo({},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)(fo(),"moderationControls",(function(e,n){!n.isHidden()&&n.canStartPoll()&&e.add("addPoll",m(O(),{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",W().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",W().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 5e4f727a..396aba7d 100644 --- a/js/dist/forum.js.map +++ b/js/dist/forum.js.map @@ -1 +1 @@ -{"version":3,"file":"forum.js","mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAAmC;AAEW;AACQ;AACsB;AACV;AACP;AAM3D,SAASM,MAAMA,CAACC,IAAyB,EAAE;EACzC,IAAIA,IAAI,EAAE;IACR,IAAMC,IAAI,GAAGR,6DAAS,CAACU,YAAY,CAAO,OAAO,CAAC;IAElDF,IAAI,CAACG,WAAW,GAAGJ,IAAI,CAACK,OAAO,CAACC,GAAG,CAAC,UAACC,MAAuB,EAAK;MAC/D,IAAMC,UAAU,GAAGf,6DAAS,CAACU,YAAY,CAAa,cAAc,C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;WACA,iCAAiC,WAAW;WAC5C;WACA;;;;;WCPA;WACA;WACA;WACA;WACA,yCAAyC,wCAAwC;WACjF;WACA;WACA;;;;;WCPA;;;;;WCAA;WACA;WACA;WACA,uDAAuD,iBAAiB;WACxE;WACA,gDAAgD,aAAa;WAC7D","sources":["webpack://@fof/polls/./src/forum/addComposerItems.tsx","webpack://@fof/polls/./src/forum/addDiscussionBadge.tsx","webpack://@fof/polls/./src/forum/addNavItem.ts","webpack://@fof/polls/./src/forum/addPollsToPost.tsx","webpack://@fof/polls/./src/forum/addPostControls.tsx","webpack://@fof/polls/./src/forum/components/AbstractPollPage.tsx","webpack://@fof/polls/./src/forum/components/ComposePollHero.tsx","webpack://@fof/polls/./src/forum/components/ComposePollPage.tsx","webpack://@fof/polls/./src/forum/components/CreatePollModal.tsx","webpack://@fof/polls/./src/forum/components/EditPollModal.tsx","webpack://@fof/polls/./src/forum/components/ListVotersModal.tsx","webpack://@fof/polls/./src/forum/components/Poll/PollImage.tsx","webpack://@fof/polls/./src/forum/components/Poll/PollList.tsx","webpack://@fof/polls/./src/forum/components/Poll/PollListItem.tsx","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/PollSubmitButton.tsx","webpack://@fof/polls/./src/forum/components/Poll/PollSubtitle.tsx","webpack://@fof/polls/./src/forum/components/Poll/PollTitle.tsx","webpack://@fof/polls/./src/forum/components/PollForm.tsx","webpack://@fof/polls/./src/forum/components/PollShowcase.tsx","webpack://@fof/polls/./src/forum/components/PollShowcaseItem.tsx","webpack://@fof/polls/./src/forum/components/PollView.tsx","webpack://@fof/polls/./src/forum/components/PollViewPage.tsx","webpack://@fof/polls/./src/forum/components/PollsPage.tsx","webpack://@fof/polls/./src/forum/components/PollsShowcasePage.tsx","webpack://@fof/polls/./src/forum/components/PostPoll.tsx","webpack://@fof/polls/./src/forum/components/UploadPollImageButton.tsx","webpack://@fof/polls/./src/forum/components/form/FormError.tsx","webpack://@fof/polls/./src/forum/components/index.ts","webpack://@fof/polls/./src/forum/extend.ts","webpack://@fof/polls/./src/forum/index.ts","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/PollFormState.ts","webpack://@fof/polls/./src/forum/states/PollListState.ts","webpack://@fof/polls/./src/forum/states/PollState.ts","webpack://@fof/polls/./src/forum/states/index.ts","webpack://@fof/polls/./src/forum/utils/PollControls.tsx","webpack://@fof/polls/./src/forum/utils/index.ts","webpack://@fof/polls/external root \"flarum.core.compat['common/Component']\"","webpack://@fof/polls/external root \"flarum.core.compat['common/Model']\"","webpack://@fof/polls/external root \"flarum.core.compat['common/components/Badge']\"","webpack://@fof/polls/external root \"flarum.core.compat['common/components/Button']\"","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/components/LinkButton']\"","webpack://@fof/polls/external root \"flarum.core.compat['common/components/LoadingIndicator']\"","webpack://@fof/polls/external root \"flarum.core.compat['common/components/Modal']\"","webpack://@fof/polls/external root \"flarum.core.compat['common/components/Page']\"","webpack://@fof/polls/external root \"flarum.core.compat['common/components/Placeholder']\"","webpack://@fof/polls/external root \"flarum.core.compat['common/components/SelectDropdown']\"","webpack://@fof/polls/external root \"flarum.core.compat['common/components/Separator']\"","webpack://@fof/polls/external root \"flarum.core.compat['common/components/Switch']\"","webpack://@fof/polls/external root \"flarum.core.compat['common/components/Tooltip']\"","webpack://@fof/polls/external root \"flarum.core.compat['common/extend']\"","webpack://@fof/polls/external root \"flarum.core.compat['common/extenders']\"","webpack://@fof/polls/external root \"flarum.core.compat['common/helpers/avatar']\"","webpack://@fof/polls/external root \"flarum.core.compat['common/helpers/highlight']\"","webpack://@fof/polls/external root \"flarum.core.compat['common/helpers/icon']\"","webpack://@fof/polls/external root \"flarum.core.compat['common/helpers/listItems']\"","webpack://@fof/polls/external root \"flarum.core.compat['common/helpers/username']\"","webpack://@fof/polls/external root \"flarum.core.compat['common/models/Discussion']\"","webpack://@fof/polls/external root \"flarum.core.compat['common/models/Forum']\"","webpack://@fof/polls/external root \"flarum.core.compat['common/models/Post']\"","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/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/SubtreeRetainer']\"","webpack://@fof/polls/external root \"flarum.core.compat['common/utils/abbreviateNumber']\"","webpack://@fof/polls/external root \"flarum.core.compat['common/utils/classList']\"","webpack://@fof/polls/external root \"flarum.core.compat['common/utils/computed']\"","webpack://@fof/polls/external root \"flarum.core.compat['common/utils/extractText']\"","webpack://@fof/polls/external root \"flarum.core.compat['common/utils/string']\"","webpack://@fof/polls/external root \"flarum.core.compat['forum/app']\"","webpack://@fof/polls/external root \"flarum.core.compat['forum/components/CommentPost']\"","webpack://@fof/polls/external root \"flarum.core.compat['forum/components/DiscussionComposer']\"","webpack://@fof/polls/external root \"flarum.core.compat['forum/components/DiscussionList']\"","webpack://@fof/polls/external root \"flarum.core.compat['forum/components/DiscussionPage']\"","webpack://@fof/polls/external root \"flarum.core.compat['forum/components/IndexPage']\"","webpack://@fof/polls/external root \"flarum.core.compat['forum/components/LogInModal']\"","webpack://@fof/polls/external root \"flarum.core.compat['forum/components/ReplyComposer']\"","webpack://@fof/polls/external root \"flarum.core.compat['forum/utils/PostControls']\"","webpack://@fof/polls/external root \"flarum.core.compat['forum/utils/slidable']\"","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/./node_modules/@babel/runtime/helpers/esm/assertThisInitialized.js","webpack://@fof/polls/./node_modules/@babel/runtime/helpers/esm/asyncToGenerator.js","webpack://@fof/polls/./node_modules/@babel/runtime/helpers/esm/construct.js","webpack://@fof/polls/./node_modules/@babel/runtime/helpers/esm/createClass.js","webpack://@fof/polls/./node_modules/@babel/runtime/helpers/esm/extends.js","webpack://@fof/polls/./node_modules/@babel/runtime/helpers/esm/getPrototypeOf.js","webpack://@fof/polls/./node_modules/@babel/runtime/helpers/esm/inheritsLoose.js","webpack://@fof/polls/./node_modules/@babel/runtime/helpers/esm/isNativeFunction.js","webpack://@fof/polls/./node_modules/@babel/runtime/helpers/esm/isNativeReflectConstruct.js","webpack://@fof/polls/./node_modules/@babel/runtime/helpers/esm/setPrototypeOf.js","webpack://@fof/polls/./node_modules/@babel/runtime/helpers/esm/toPrimitive.js","webpack://@fof/polls/./node_modules/@babel/runtime/helpers/esm/toPropertyKey.js","webpack://@fof/polls/./node_modules/@babel/runtime/helpers/esm/typeof.js","webpack://@fof/polls/./node_modules/@babel/runtime/helpers/esm/wrapNativeSuper.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/./forum.ts"],"sourcesContent":["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","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","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","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 Post from 'flarum/common/models/Post';\nimport PollOption from './models/PollOption';\n\ninterface PollPost extends Post {\n polls: () => Poll[];\n}\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 as PollPost;\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 as PollPost).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","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 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';\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 IndexPage.prototype.hero();\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 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","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 if (!app.forum.attribute('globalPollsEnabled')) {\n m.route.set('/');\n return;\n }\n\n // Get the `edit` parameter from the URL\n const editId = m.route.param('id');\n if (editId) {\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(app.translator.trans(`fof-polls.forum.compose.${!!this.poll?.id() ? 'edit' : 'add'}_title`) as string);\n m.redraw();\n });\n }\n } else {\n this.poll = PollFormState.createNewPoll();\n }\n\n app.history.push('compose-poll', app.translator.trans(`fof-polls.forum.compose.${!!this.poll?.id() ? 'edit' : 'add'}_title`) as string);\n this.bodyClass = 'App--compose-poll';\n app.setTitle(app.translator.trans(`fof-polls.forum.compose.${!!this.poll?.id() ? 'edit' : 'add'}_title`) as string);\n }\n\n view(): Mithril.Children {\n // prevent users from accessing the page if they can't start global polls\n if (!app.forum.attribute('canStartGlobalPolls')) {\n m.route.set('/');\n return;\n }\n\n if (this.loading) {\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","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 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 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

{opt.answer()! + ':'}

\n\n {votes.length ? (\n
{votes.map(this.voteContent.bind(this))}
\n ) : (\n

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

\n )}\n
\n );\n }\n\n voteContent(vote: 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 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","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","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.poll.question(), this.highlightRegExp)}

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

{this.poll.subtitle()}

}\n
    {listItems(this.infoItems().toArray())}
\n \n );\n }\n\n // infoView() {\n // return (\n //
\n // {this.poll.subtitle() &&

{this.poll.subtitle()}

}\n //
    {listItems(this.infoItems().toArray())}
\n //
\n // );\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","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\n this.option = this.attrs.option;\n this.name = this.attrs.name;\n this.state = this.attrs.state;\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 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 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 {this.state.showCheckMarks && (\n \n )}\n\n
{this.optionDisplayItems().toArray()}
\n\n {this.option.imageUrl() ? {this.option.answer()} : null}\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('answer', {this.answer});\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 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","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 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 type 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';\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 items.add(\n 'poll_image',\n
\n \n

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

\n \n \n
,\n 90\n );\n\n if (this.image()) {\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()}\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() {\n return Object.keys(this.options).map((option, i) => (\n
\n
\n \n {app.forum.attribute('allowPollOptionImage') ? (\n \n ) : null}\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 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 {\n console.error(error);\n // Show error alert\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","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 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 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 const poll = this.attrs.poll;\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","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 listItems from 'flarum/common/helpers/listItems';\nimport ItemList from 'flarum/common/utils/ItemList';\nimport Page, { IPageAttrs } from 'flarum/common/components/Page';\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 PollModel from '../models/Poll';\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","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 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';\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
\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';\nimport Button, { IButtonAttrs } from 'flarum/common/components/Button';\nimport classList from 'flarum/common/utils/classList';\nimport type Mithril from 'mithril';\nimport Poll from '../models/Poll';\n\nexport interface UploadPollImageButtonAttrs extends IButtonAttrs {\n className?: string;\n loading?: boolean;\n name: string;\n onclick: () => void;\n poll?: Poll | 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 = undefined;\n fileName: string | undefined = undefined;\n\n view(vnode: Mithril.Vnode) {\n this.attrs.loading = this.loading;\n this.attrs.className = classList(this.attrs.className, 'Button');\n\n if (this.attrs.poll?.imageUrl() || this.uploadedImageUrl) {\n const imageUrl = this.uploadedImageUrl || this.attrs.poll?.imageUrl();\n this.attrs.onclick = this.remove.bind(this);\n\n return (\n
\n

\n \"\"\n

\n

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

\n
\n );\n } else {\n this.attrs.onclick = this.upload.bind(this);\n }\n\n return super.view({ ...vnode, 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 const $input = $('');\n\n $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 app\n .request({\n method: 'DELETE',\n url: this.resourceUrl(),\n })\n .then(this.success.bind(this), this.failure.bind(this));\n }\n\n resourceUrl() {\n let url = app.forum.attribute('apiUrl') + '/fof/polls/' + this.attrs.name;\n const poll = this.attrs.poll;\n\n if (poll?.exists) url += '/' + poll?.id();\n\n return url;\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 }\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 }\n}\n","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 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';\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};\n","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 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 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 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 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","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 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 PollFormState from './PollFormState';\nimport PollListState from './PollListState';\nimport PollState from './PollState';\n\nexport const states = {\n PollFormState,\n PollListState,\n PollState,\n};\n","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","import PollControls from './PollControls';\n\nexport const utils = {\n PollControls,\n};\n","module.exports = flarum.core.compat['common/Component'];","module.exports = flarum.core.compat['common/Model'];","module.exports = flarum.core.compat['common/components/Badge'];","module.exports = flarum.core.compat['common/components/Button'];","module.exports = flarum.core.compat['common/components/Dropdown'];","module.exports = flarum.core.compat['common/components/Link'];","module.exports = flarum.core.compat['common/components/LinkButton'];","module.exports = flarum.core.compat['common/components/LoadingIndicator'];","module.exports = flarum.core.compat['common/components/Modal'];","module.exports = flarum.core.compat['common/components/Page'];","module.exports = flarum.core.compat['common/components/Placeholder'];","module.exports = flarum.core.compat['common/components/SelectDropdown'];","module.exports = flarum.core.compat['common/components/Separator'];","module.exports = flarum.core.compat['common/components/Switch'];","module.exports = flarum.core.compat['common/components/Tooltip'];","module.exports = flarum.core.compat['common/extend'];","module.exports = flarum.core.compat['common/extenders'];","module.exports = flarum.core.compat['common/helpers/avatar'];","module.exports = flarum.core.compat['common/helpers/highlight'];","module.exports = flarum.core.compat['common/helpers/icon'];","module.exports = flarum.core.compat['common/helpers/listItems'];","module.exports = flarum.core.compat['common/helpers/username'];","module.exports = flarum.core.compat['common/models/Discussion'];","module.exports = flarum.core.compat['common/models/Forum'];","module.exports = flarum.core.compat['common/models/Post'];","module.exports = flarum.core.compat['common/states/PaginatedListState'];","module.exports = flarum.core.compat['common/utils/EventEmitter'];","module.exports = flarum.core.compat['common/utils/ItemList'];","module.exports = flarum.core.compat['common/utils/Stream'];","module.exports = flarum.core.compat['common/utils/SubtreeRetainer'];","module.exports = flarum.core.compat['common/utils/abbreviateNumber'];","module.exports = flarum.core.compat['common/utils/classList'];","module.exports = flarum.core.compat['common/utils/computed'];","module.exports = flarum.core.compat['common/utils/extractText'];","module.exports = flarum.core.compat['common/utils/string'];","module.exports = flarum.core.compat['forum/app'];","module.exports = flarum.core.compat['forum/components/CommentPost'];","module.exports = flarum.core.compat['forum/components/DiscussionComposer'];","module.exports = flarum.core.compat['forum/components/DiscussionList'];","module.exports = flarum.core.compat['forum/components/DiscussionPage'];","module.exports = flarum.core.compat['forum/components/IndexPage'];","module.exports = flarum.core.compat['forum/components/LogInModal'];","module.exports = flarum.core.compat['forum/components/ReplyComposer'];","module.exports = flarum.core.compat['forum/utils/PostControls'];","module.exports = flarum.core.compat['forum/utils/slidable'];","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 new 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 new 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 new 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","export default function _assertThisInitialized(self) {\n if (self === void 0) {\n throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\");\n }\n return self;\n}","function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) {\n try {\n var info = gen[key](arg);\n var value = info.value;\n } catch (error) {\n reject(error);\n return;\n }\n if (info.done) {\n resolve(value);\n } else {\n Promise.resolve(value).then(_next, _throw);\n }\n}\nexport default function _asyncToGenerator(fn) {\n return function () {\n var self = this,\n args = arguments;\n return new Promise(function (resolve, reject) {\n var gen = fn.apply(self, args);\n function _next(value) {\n asyncGeneratorStep(gen, resolve, reject, _next, _throw, \"next\", value);\n }\n function _throw(err) {\n asyncGeneratorStep(gen, resolve, reject, _next, _throw, \"throw\", err);\n }\n _next(undefined);\n });\n };\n}","import setPrototypeOf from \"./setPrototypeOf.js\";\nimport isNativeReflectConstruct from \"./isNativeReflectConstruct.js\";\nexport default function _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}","import toPropertyKey from \"./toPropertyKey.js\";\nfunction _defineProperties(target, props) {\n for (var i = 0; i < props.length; i++) {\n var descriptor = props[i];\n descriptor.enumerable = descriptor.enumerable || false;\n descriptor.configurable = true;\n if (\"value\" in descriptor) descriptor.writable = true;\n Object.defineProperty(target, toPropertyKey(descriptor.key), descriptor);\n }\n}\nexport default function _createClass(Constructor, protoProps, staticProps) {\n if (protoProps) _defineProperties(Constructor.prototype, protoProps);\n if (staticProps) _defineProperties(Constructor, staticProps);\n Object.defineProperty(Constructor, \"prototype\", {\n writable: false\n });\n return Constructor;\n}","export default function _extends() {\n _extends = Object.assign ? Object.assign.bind() : function (target) {\n for (var i = 1; i < arguments.length; i++) {\n var source = arguments[i];\n for (var key in source) {\n if (Object.prototype.hasOwnProperty.call(source, key)) {\n target[key] = source[key];\n }\n }\n }\n return target;\n };\n return _extends.apply(this, arguments);\n}","export default function _getPrototypeOf(o) {\n _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) {\n return o.__proto__ || Object.getPrototypeOf(o);\n };\n return _getPrototypeOf(o);\n}","import setPrototypeOf from \"./setPrototypeOf.js\";\nexport default function _inheritsLoose(subClass, superClass) {\n subClass.prototype = Object.create(superClass.prototype);\n subClass.prototype.constructor = subClass;\n setPrototypeOf(subClass, superClass);\n}","export default function _isNativeFunction(fn) {\n try {\n return Function.toString.call(fn).indexOf(\"[native code]\") !== -1;\n } catch (e) {\n return typeof fn === \"function\";\n }\n}","export 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}","export default function _setPrototypeOf(o, p) {\n _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) {\n o.__proto__ = p;\n return o;\n };\n return _setPrototypeOf(o, p);\n}","import _typeof from \"./typeof.js\";\nexport default function 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}","import _typeof from \"./typeof.js\";\nimport toPrimitive from \"./toPrimitive.js\";\nexport default function toPropertyKey(t) {\n var i = toPrimitive(t, \"string\");\n return \"symbol\" == _typeof(i) ? i : String(i);\n}","export default 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}","import getPrototypeOf from \"./getPrototypeOf.js\";\nimport setPrototypeOf from \"./setPrototypeOf.js\";\nimport isNativeFunction from \"./isNativeFunction.js\";\nimport construct from \"./construct.js\";\nexport default function _wrapNativeSuper(Class) {\n var _cache = typeof Map === \"function\" ? new Map() : undefined;\n _wrapNativeSuper = function _wrapNativeSuper(Class) {\n if (Class === null || !isNativeFunction(Class)) return Class;\n if (typeof Class !== \"function\") {\n throw new TypeError(\"Super expression must either be null or a function\");\n }\n if (typeof _cache !== \"undefined\") {\n if (_cache.has(Class)) return _cache.get(Class);\n _cache.set(Class, Wrapper);\n }\n function Wrapper() {\n return construct(Class, arguments, getPrototypeOf(this).constructor);\n }\n Wrapper.prototype = Object.create(Class.prototype, {\n constructor: {\n value: Wrapper,\n enumerable: false,\n writable: true,\n configurable: true\n }\n });\n return setPrototypeOf(Wrapper, Class);\n };\n return _wrapNativeSuper(Class);\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};","export * from './src/forum';\n"],"names":["app","extend","classList","DiscussionComposer","ReplyComposer","CreatePollModal","toPoll","data","poll","store","createRecord","tempOptions","options","map","option","pollOption","pushAttributes","addToComposer","composer","prototype","addPoll","_this","modal","show","fields","onsubmit","items","_this$composer$body","_discussion$canStartP","discussion","body","attrs","canStartPoll","forum","canStartPolls","add","m","className","onclick","bind","translator","trans","Badge","DiscussionList","Discussion","params","include","push","badges","hasPoll","component","type","label","icon","IndexPage","LinkButton","addNavItem","attribute","href","route","showAllGlobalPolls","CommentPost","PollView","DiscussionPage","content","post","isHidden","revealContent","polls","_iterator","_createForOfIteratorHelperLoose","_step","done","value","subtree","check","checks","_poll$data","_poll$options$map","_poll$options","_poll$myVotes$map","_poll$myVotes","attributes","call","_option$data","myVotes","vote","_vote$option","id","JSON","stringify","pusher","then","binding","channels","main","getById","voteCount","changedOptions","optionId","undefined","redraw","unbind","PostControls","Button","createPoll","save","_extends","relationships","_post$rawRelationship","rawRelationship","Page","ItemList","LoadingIndicator","listItems","SelectDropdown","AbstractPollPage","_Page","_inheritsLoose","_len","arguments","length","args","Array","_key","apply","concat","loading","_proto","view","pageContent","toArray","hero","mainContent","sidebar","contentItems","sidebarItems","setContent","buttonClassName","accessibleToggleLabel","navItems","initializers","has","remove","key","toObject","startsWith","Component","ComposePollHero","_Component","oninit","vnode","controlItems","itemClassName","exists","default","PollForm","PollFormState","ComposePollPage","_this2","_this$poll","_this$poll2","set","editId","param","find","item","_this2$poll","setTitle","createNewPoll","history","bodyClass","_onsubmit","_asyncToGenerator","_regeneratorRuntime","mark","_callee","state","isNew","alertAttrs","alertId","wrap","_callee$","_context","prev","next","controls","alerts","setTimeout","dismiss","stop","_x","_x2","Modal","_Modal","title","onFormSubmit","_onFormSubmit","hide","EditPollModal","_CreatePollModal","avatar","username","Link","ListVotersModal","optionContent","opt","votes","filter","v","answer","voteContent","user","PollImage","imageUrl","imageAlt","imageItems","_this$imageAlt","src","alt","PollListItem","Placeholder","PollList","getParams","isLoading","isInitialLoading","isLoadingNext","hasNext","loadNext","isEmpty","text","isSearchResults","getPages","pg","SubtreeRetainer","Dropdown","highlight","slidable","abbreviateNumber","PollControls","PollViewPage","highlightRegExp","freshness","time","session","markedAllAsReadAt","getTime","active","elementAttrs","Slidable","window","controlsView","contentView","slidableUnderneathView","menuClassName","isUnread","disabled","markAsRead","mainView","question","subtitle","infoItems","oncreate","slidableInstance","element","$","on","reset","onbeforeupdate","needsRebuild","current","matches","lastVotedNumber","hasEnded","activeView","endDate","dayjs","fromNow","count","Tooltip","PollOption","name","hasVoted","totalVotes","voted","canSeeVoteCount","overallVoteCount","hasVotedFor","percent","Math","round","_this$poll$myVotes","isDisabled","loadingOptions","canChangeVote","width","Number","bar","style","showCheckMarks","onchange","changeVote","checked","optionDisplayItems","onremove","hideOptionTooltip","tooltipVisible","updateVisibility","PollOptions","pollOptions","forEach","createOptionView","PollSubmitButton","event","pollButtonSubmit","hasSelectedOptions","PollSubtitle","pollSubtitleItems","PollTitle","pollTitleItems","Switch","Stream","extractText","FormError","UploadPollImageButton","optionAnswers","optionImageUrls","image","publicPoll","allowMultipleVotes","hideVotes","allowChangeVote","maxVotes","datepickerMinDate","_poll$tempOptions","o","formatDate","isAfter","bidi","onUpload","pollImageUploadSuccess","required","displayOptions","addOption","min","max","isBefore","deleting","Object","keys","i","placeholder","removeOption","alert","splice","_this3","_this$dateToTimestamp","pollExists","pollImage","dateToTimestamp","preventDefault","t0","message","console","error","_delete2","_callee2","_callee2$","_context2","deleteAction","finish","_delete","date","def","dayjsDate","isValid","format","fileName","PollShowcaseItem","PollShowcase","refresh","showcaseItems","endedItems","page","PollState","slug","preventClose","e","addEventListener","removeEventListener","canEdit","showVoters","createMainView","createPollHeader","createPollContent","createPollFooter","createFormItems","getMaxVotes","showButton","questionSlug","canVote","_AbstractPollPage","LogInModal","PollListState","PollsPage","sort","viewItems","actionItems","newPollAction","PollsShowcasePage","includeParams","PostPoll","useSubmitUI","pendingSubmit","pendingOptions","_this$attrs$poll","_this$attrs$poll2","canSeeVoters","canDelete","deletePoll","viewOption","_poll$myVotes2","_poll$myVotes3","_poll$myVotes4","some","showCheckmark","evt","_this$attrs$poll$myVo","_this$attrs$poll$myVo2","target","optionIds","Set","isUnvoting","allowsMultiple","clear","size","submit","cb","onerror","request","method","url","from","res","pushPayload","err","confirm","sync","_Button","uploadedImageUrl","children","upload","$input","appendTo","trigger","FormData","append","files","resourceUrl","serialize","raw","success","failure","response","_this$attrs$onUpload","_this$attrs","fileUrl","_Error","props","_wrapNativeSuper","Error","components","Extend","Post","Forum","Poll","PollVote","Routes","Store","Model","hasMany","addDiscussionBadge","addComposerItems","addPollsToPost","addPostControls","computed","_Model","transformDate","isGlobal","hiddenAt","apiEndpoint","hasOne","result","pollId","models","expandedGroup","isExpanded","groupKey","expand","_save","sent","PaginatedListState","EventEmitter","globalEventEmitter","_PaginatedListState","extraPolls","eventEmitter","_assertThisInitialized","requestParams","_this$params$sort","sortMap","q","loadPage","preloadedPolls","preloadedApiDocument","initialLoading","Promise","resolve","relevance","newest","oldest","removePoll","emit","pages","index","indexOf","unshift","getAllItems","number","_createClass","get","init","isShowResult","states","Separator","context","section","itemName","pollControls","moderationControls","editAction","destructiveControls","abrupt","showDeletionAlert","back","location","reload","utils","_typeof","require","module","exports","__esModule","t","r","n","hasOwnProperty","defineProperty","Symbol","a","iterator","c","asyncIterator","u","toStringTag","define","enumerable","configurable","writable","Generator","create","Context","makeInvokeMethod","tryCatch","arg","h","l","f","s","y","GeneratorFunction","GeneratorFunctionPrototype","p","d","getPrototypeOf","values","g","defineIteratorMethods","_invoke","AsyncIterator","invoke","__await","callInvokeWithMethodAndArg","delegate","maybeInvokeDelegate","_sent","dispatchException","TypeError","resultName","nextLoc","pushTryEntry","tryLoc","catchLoc","finallyLoc","afterLoc","tryEntries","resetTryEntry","completion","isNaN","displayName","isGeneratorFunction","constructor","setPrototypeOf","__proto__","awrap","async","reverse","pop","charAt","slice","rval","handle","complete","_catch","delegateYield","runtime","regeneratorRuntime","accidentalStrictMode","globalThis","Function","self","ReferenceError","asyncGeneratorStep","gen","reject","_next","_throw","info","fn","isNativeReflectConstruct","_construct","Reflect","construct","toPropertyKey","_defineProperties","descriptor","Constructor","protoProps","staticProps","assign","source","_getPrototypeOf","subClass","superClass","_isNativeFunction","toString","_isNativeReflectConstruct","Boolean","valueOf","_setPrototypeOf","toPrimitive","String","isNativeFunction","Class","_cache","Map","Wrapper"],"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,EAAO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OuX,IAErDA,EAAKpL,YAAcoL,EAAKvG,gBAC3BhR,EAAME,IACJ,UACA/B,EAAC+D,IAAM,CAAC9B,KAAK,cAAc+B,QAASgX,EAAW7d,KAAKjG,KAAMkiB,IACvDna,IAAAA,WAAewC,MAAM,mCAI9B,KCxCA0W,EAAAA,EAAAA,QAAO1T,KAAAA,UAAqB,YAAY,SAAC5C,GAClC5C,IAAAA,MAAU0D,UAAmB,wBAIlCd,EAAME,IACJ,qBACAC,IAAAA,UACE,CACEG,KAAMlD,IAAAA,MAAU,sBAChBgD,KAAM,eAERhD,IAAAA,WAAewC,MAAM,6BAEvB,IAGyBxC,IAAAA,MAAU0D,UAAmB,wBAGtDd,EAAME,IACJ,iBACAC,IAAAA,UACE,CACEG,KAAMlD,IAAAA,MAAU,kBAChBgD,KAAM,eAERhD,IAAAA,WAAewC,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/./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/./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/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/./node_modules/@babel/runtime/helpers/esm/assertThisInitialized.js","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/./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/addPollsToPost.tsx","webpack://@fof/polls/external root \"flarum.core.compat['forum/utils/PostControls']\"","webpack://@fof/polls/./src/forum/components/EditPollModal.tsx","webpack://@fof/polls/./src/forum/components/PostPoll.tsx","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 new 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 new 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 new 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(gen, resolve, reject, _next, _throw, key, arg) {\n try {\n var info = gen[key](arg);\n var value = info.value;\n } catch (error) {\n reject(error);\n return;\n }\n if (info.done) {\n resolve(value);\n } else {\n Promise.resolve(value).then(_next, _throw);\n }\n}\nexport default function _asyncToGenerator(fn) {\n return function () {\n var self = this,\n args = arguments;\n return new Promise(function (resolve, reject) {\n var gen = fn.apply(self, args);\n function _next(value) {\n asyncGeneratorStep(gen, resolve, reject, _next, _throw, \"next\", value);\n }\n function _throw(err) {\n asyncGeneratorStep(gen, resolve, reject, _next, _throw, \"throw\", err);\n }\n _next(undefined);\n });\n };\n}","export default function _setPrototypeOf(o, p) {\n _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) {\n o.__proto__ = p;\n return o;\n };\n return _setPrototypeOf(o, p);\n}","import setPrototypeOf from \"./setPrototypeOf.js\";\nexport default function _inheritsLoose(subClass, superClass) {\n subClass.prototype = Object.create(superClass.prototype);\n subClass.prototype.constructor = subClass;\n setPrototypeOf(subClass, superClass);\n}","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/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'];","export default function _getPrototypeOf(o) {\n _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) {\n return o.__proto__ || Object.getPrototypeOf(o);\n };\n return _getPrototypeOf(o);\n}","export 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}","import getPrototypeOf from \"./getPrototypeOf.js\";\nimport setPrototypeOf from \"./setPrototypeOf.js\";\nimport isNativeFunction from \"./isNativeFunction.js\";\nimport construct from \"./construct.js\";\nexport default function _wrapNativeSuper(Class) {\n var _cache = typeof Map === \"function\" ? new Map() : undefined;\n _wrapNativeSuper = function _wrapNativeSuper(Class) {\n if (Class === null || !isNativeFunction(Class)) return Class;\n if (typeof Class !== \"function\") {\n throw new TypeError(\"Super expression must either be null or a function\");\n }\n if (typeof _cache !== \"undefined\") {\n if (_cache.has(Class)) return _cache.get(Class);\n _cache.set(Class, Wrapper);\n }\n function Wrapper() {\n return construct(Class, arguments, getPrototypeOf(this).constructor);\n }\n Wrapper.prototype = Object.create(Class.prototype, {\n constructor: {\n value: Wrapper,\n enumerable: false,\n writable: true,\n configurable: true\n }\n });\n return setPrototypeOf(Wrapper, Class);\n };\n return _wrapNativeSuper(Class);\n}","export default function _isNativeFunction(fn) {\n try {\n return Function.toString.call(fn).indexOf(\"[native code]\") !== -1;\n } catch (e) {\n return typeof fn === \"function\";\n }\n}","import setPrototypeOf from \"./setPrototypeOf.js\";\nimport isNativeReflectConstruct from \"./isNativeReflectConstruct.js\";\nexport default function _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}","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 if (!app.forum.attribute('globalPollsEnabled')) {\n m.route.set('/');\n return;\n }\n\n // Get the `edit` parameter from the URL\n const editId = m.route.param('id');\n if (editId) {\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(app.translator.trans(`fof-polls.forum.compose.${!!this.poll?.id() ? 'edit' : 'add'}_title`) as string);\n m.redraw();\n });\n }\n } else {\n this.poll = PollFormState.createNewPoll();\n }\n\n app.history.push('compose-poll', app.translator.trans(`fof-polls.forum.compose.${!!this.poll?.id() ? 'edit' : 'add'}_title`) as string);\n this.bodyClass = 'App--compose-poll';\n app.setTitle(app.translator.trans(`fof-polls.forum.compose.${!!this.poll?.id() ? 'edit' : 'add'}_title`) as string);\n }\n\n view(): Mithril.Children {\n // prevent users from accessing the page if they can't start global polls\n if (!app.forum.attribute('canStartGlobalPolls')) {\n m.route.set('/');\n return;\n }\n\n if (this.loading) {\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\n this.option = this.attrs.option;\n this.name = this.attrs.name;\n this.state = this.attrs.state;\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 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 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 {this.state.showCheckMarks && (\n \n )}\n\n
{this.optionDisplayItems().toArray()}
\n\n {this.option.imageUrl() ? {this.option.answer()} : null}\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('answer', {this.answer});\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

{opt.answer()! + ':'}

\n\n {votes.length ? (\n
{votes.map(this.voteContent.bind(this))}
\n ) : (\n

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

\n )}\n
\n );\n }\n\n voteContent(vote: 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 const poll = this.attrs.poll;\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","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';\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 IndexPage.prototype.hero();\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.poll.question(), this.highlightRegExp)}

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

{this.poll.subtitle()}

}\n
    {listItems(this.infoItems().toArray())}
\n \n );\n }\n\n // infoView() {\n // return (\n //
\n // {this.poll.subtitle() &&

{this.poll.subtitle()}

}\n //
    {listItems(this.infoItems().toArray())}
\n //
\n // );\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","export default 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}","import _typeof from \"./typeof.js\";\nimport toPrimitive from \"./toPrimitive.js\";\nexport default function toPropertyKey(t) {\n var i = toPrimitive(t, \"string\");\n return \"symbol\" == _typeof(i) ? i : String(i);\n}","import _typeof from \"./typeof.js\";\nexport default function 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}","import toPropertyKey from \"./toPropertyKey.js\";\nfunction _defineProperties(target, props) {\n for (var i = 0; i < props.length; i++) {\n var descriptor = props[i];\n descriptor.enumerable = descriptor.enumerable || false;\n descriptor.configurable = true;\n if (\"value\" in descriptor) descriptor.writable = true;\n Object.defineProperty(target, toPropertyKey(descriptor.key), descriptor);\n }\n}\nexport default function _createClass(Constructor, protoProps, staticProps) {\n if (protoProps) _defineProperties(Constructor.prototype, protoProps);\n if (staticProps) _defineProperties(Constructor, staticProps);\n Object.defineProperty(Constructor, \"prototype\", {\n writable: false\n });\n return Constructor;\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","export default function _assertThisInitialized(self) {\n if (self === void 0) {\n throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\");\n }\n return self;\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 Page, { IPageAttrs } from 'flarum/common/components/Page';\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 PollModel from '../models/Poll';\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","export default function _extends() {\n _extends = Object.assign ? Object.assign.bind() : function (target) {\n for (var i = 1; i < arguments.length; i++) {\n var source = arguments[i];\n for (var key in source) {\n if (Object.prototype.hasOwnProperty.call(source, key)) {\n target[key] = source[key];\n }\n }\n }\n return target;\n };\n return _extends.apply(this, arguments);\n}","import app from 'flarum/forum/app';\nimport Button, { IButtonAttrs } from 'flarum/common/components/Button';\nimport classList from 'flarum/common/utils/classList';\nimport type 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 = undefined;\n fileName: string | undefined = undefined;\n\n view(vnode: Mithril.Vnode) {\n this.attrs.loading = this.loading;\n this.attrs.className = classList(this.attrs.className, 'Button');\n\n if (this.attrs.poll?.imageUrl() || this.attrs.option?.imageUrl() || this.uploadedImageUrl) {\n const imageUrl = this.uploadedImageUrl || this.attrs.poll?.imageUrl() || this.attrs.option?.imageUrl() || '';\n this.attrs.onclick = this.remove.bind(this);\n\n return (\n
\n

\n \"\"\n

\n

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

\n
\n );\n } else {\n this.attrs.onclick = this.upload.bind(this);\n }\n\n return super.view({ ...vnode, 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 const $input = $('');\n\n $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 app\n .request({\n method: 'DELETE',\n url: this.resourceUrl(),\n })\n .then(this.success.bind(this), this.failure.bind(this));\n }\n\n resourceUrl() {\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 (poll?.exists) url += '/' + poll?.id();\n if (option?.exists) url += '/' + option?.id();\n\n return url;\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 }\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 }\n}\n","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';\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 items.add(\n 'poll_image',\n
\n \n

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

\n \n \n
,\n 90\n );\n\n if (this.image()) {\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\n this.options.forEach((option, i) => {\n items.add(\n 'option-' + i,\n
\n
\n \n {app.forum.attribute('allowPollOptionImage') && (\n
\n {/* */}\n \n

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

\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 {\n console.error(error);\n // Show error alert\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","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 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 Post from 'flarum/common/models/Post';\nimport PollOption from './models/PollOption';\n\ninterface PollPost extends Post {\n polls: () => Poll[];\n}\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 as PollPost;\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 as PollPost).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 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';\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
\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 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';\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};\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 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 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","gen","reject","_next","_throw","info","error","_asyncToGenerator","fn","self","args","arguments","apply","err","_setPrototypeOf","bind","_inheritsLoose","subClass","superClass","_getPrototypeOf","_isNativeReflectConstruct","Boolean","valueOf","Reflect","construct","_wrapNativeSuper","Class","_cache","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","Array","_key","concat","oninit","vnode","attrs","view","className","trans","id","controlItems","toArray","items","ItemList","add","LinkButton","icon","itemClassName","href","exists","Component","ComposePollPage","_Page","_this$poll","_this$poll2","_this2","attribute","editId","route","param","getById","find","item","_this2$poll","bodyClass","LoadingIndicator","listItems","sidebarItems","PollForm","onsubmit","_onsubmit","state","isNew","alertAttrs","alertId","controls","Button","onclick","show","setTimeout","dismiss","_x2","SelectDropdown","buttonClassName","accessibleToggleLabel","navItems","IndexPage","Page","PollOption","option","hasVoted","totalVotes","votes","voted","canSeeVoteCount","answer","overallVoteCount","voteCount","hasVotedFor","percent","Math","round","_this$poll$myVotes","isDisabled","loadingOptions","canChangeVote","width","Number","myVotes","bar","style","showCheckMarks","onchange","changeVote","checked","disabled","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","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","PollSubmitButton","event","pollButtonSubmit","PollTitle","pollTitleItems","PollSubtitle","subtitle","pollSubtitleItems","PollView","preventClose","preventDefault","oncreate","window","addEventListener","removeEventListener","PollControls","canEdit","controlsView","createMainView","createPollHeader","createPollContent","createPollFooter","createFormItems","infoItems","isEmpty","questionSlug","slug","Dropdown","menuClassName","class","time","dayjs","fromNow","max","AbstractPollPage","polls","pageContent","hero","mainContent","sidebar","contentItems","setContent","remove","toObject","startsWith","PollViewPage","_AbstractPollPage","PollListItem","subtree","highlightRegExp","SubtreeRetainer","freshness","markedAllAsReadAt","getTime","active","elementAttrs","isHidden","Slidable","contentView","slidableUnderneathView","isUnread","markAsRead","mainView","highlight","slidableInstance","slidable","element","$","on","onbeforeupdate","needsRebuild","matches","lastVotedNumber","activeView","abbreviateNumber","PollList","params","getParams","isLoading","isInitialLoading","isLoadingNext","hasNext","loadNext","Placeholder","isSearchResults","getPages","pg","toPropertyKey","toPrimitive","String","_defineProperties","descriptor","globalEventEmitter","EventEmitter","PollListState","_PaginatedListState","page","extraPolls","eventEmitter","deletePoll","ReferenceError","_assertThisInitialized","Constructor","protoProps","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","_extends","assign","source","UploadPollImageButton","_Button","uploadedImageUrl","fileName","_this$attrs$poll","_this$attrs$option","_this$attrs$poll2","_this$attrs$option2","children","upload","appendTo","hide","trigger","FormData","append","files","resourceUrl","serialize","raw","failure","response","_this$attrs$onUpload","_this$attrs","fileUrl","onUpload","optionAnswers","optionImageUrls","image","datepickerMinDate","_poll$tempOptions","Stream","formatDate","isAfter","fields","bidi","pollImageUploadSuccess","required","displayOptions","addOption","min","isBefore","Switch","placeholder","pollOptionImageUploadSuccess","removeOption","alert","_this$dateToTimestamp","pollExists","pollImage","dateToTimestamp","t0","console","date","def","dayjsDate","isValid","format","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