From 60c955f3af35748e03929bca4df329f14b30ec98 Mon Sep 17 00:00:00 2001 From: flarum-bot Date: Sat, 17 Nov 2018 08:37:11 +0000 Subject: [PATCH] Bundled output for commit 339255f4fdab2d21342eb0522585b9f3ec97f481 [skip ci] --- extensions/flags/js/dist/admin.js | 2 +- extensions/flags/js/dist/admin.js.map | 2 +- extensions/flags/js/dist/forum.js | 2 +- extensions/flags/js/dist/forum.js.map | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/extensions/flags/js/dist/admin.js b/extensions/flags/js/dist/admin.js index f356bd0af..086c20ed2 100644 --- a/extensions/flags/js/dist/admin.js +++ b/extensions/flags/js/dist/admin.js @@ -1,2 +1,2 @@ -module.exports=function(t){var e={};function n(r){if(e[r])return e[r].exports;var o=e[r]={i:r,l:!1,exports:{}};return t[r].call(o.exports,o,o.exports,n),o.l=!0,o.exports}return n.m=t,n.c=e,n.d=function(t,e,r){n.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:r})},n.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},n.t=function(t,e){if(1&e&&(t=n(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var o in t)n.d(r,o,function(e){return t[e]}.bind(null,o));return r},n.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return n.d(e,"a",e),e},n.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},n.p="",n(n.s=22)}({0:function(t,e){t.exports=flarum.core.compat.app},1:function(t,e,n){"use strict";function r(t,e){t.prototype=Object.create(e.prototype),t.prototype.constructor=t,t.__proto__=e}n.d(e,"a",function(){return r})},2:function(t,e){t.exports=flarum.core.compat.extend},20:function(t,e){t.exports=flarum.core.compat["components/SettingsModal"]},22:function(t,e,n){"use strict";n.r(e);var r=n(2),o=n(0),a=n.n(o),s=n(8),i=n.n(s),l=n(1),u=n(20),f=function(t){function e(){return t.apply(this,arguments)||this}Object(l.a)(e,t);var n=e.prototype;return n.className=function(){return"FlagsSettingsModal Modal--small"},n.title=function(){return app.translator.trans("flarum-flags.admin.settings.title")},n.form=function(){return[m("div",{className:"Form-group"},m("label",null,app.translator.trans("flarum-flags.admin.settings.guidelines_url_label")),m("input",{className:"FormControl",bidi:this.setting("flarum-flags.guidelines_url")}))]},e}(n.n(u).a),c={"flags/components/FlagsSettingsModal":f},p=n(6);a.a.initializers.add("flarum-flags",function(){a.a.extensionSettings["flarum-flags"]=function(){return a.a.modal.show(new f)},Object(r.extend)(i.a.prototype,"moderateItems",function(t){t.add("viewFlags",{icon:"fas fa-flag",label:a.a.translator.trans("flarum-flags.admin.permissions.view_flags_label"),permission:"discussion.viewFlags"},65)}),Object(r.extend)(i.a.prototype,"replyItems",function(t){t.add("flagPosts",{icon:"fas fa-flag",label:a.a.translator.trans("flarum-flags.admin.permissions.flag_posts_label"),permission:"discussion.flagPosts"},70)})}),Object.assign(p.compat,c)},6:function(t,e){t.exports=flarum.core},8:function(t,e){t.exports=flarum.core.compat["components/PermissionGrid"]}}); +module.exports=function(t){var n={};function e(r){if(n[r])return n[r].exports;var o=n[r]={i:r,l:!1,exports:{}};return t[r].call(o.exports,o,o.exports,e),o.l=!0,o.exports}return e.m=t,e.c=n,e.d=function(t,n,r){e.o(t,n)||Object.defineProperty(t,n,{enumerable:!0,get:r})},e.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},e.t=function(t,n){if(1&n&&(t=e(t)),8&n)return t;if(4&n&&"object"==typeof t&&t&&t.__esModule)return t;var r=Object.create(null);if(e.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:t}),2&n&&"string"!=typeof t)for(var o in t)e.d(r,o,function(n){return t[n]}.bind(null,o));return r},e.n=function(t){var n=t&&t.__esModule?function(){return t.default}:function(){return t};return e.d(n,"a",n),n},e.o=function(t,n){return Object.prototype.hasOwnProperty.call(t,n)},e.p="",e(e.s=23)}([function(t,n){t.exports=flarum.core.compat.app},function(t,n,e){"use strict";function r(t,n){t.prototype=Object.create(n.prototype),t.prototype.constructor=t,t.__proto__=n}e.d(n,"a",function(){return r})},function(t,n){t.exports=flarum.core.compat.extend},,function(t,n,e){"use strict";function r(){return(r=Object.assign||function(t){for(var n=1;n\n \n \n \n ];\n }\n}\n","import FlagsSettingsModal from './components/FlagsSettingsModal';\n\nexport default {\n 'flags/components/FlagsSettingsModal': FlagsSettingsModal,\n};\n","import { extend } from 'flarum/extend';\nimport app from 'flarum/app';\nimport PermissionGrid from 'flarum/components/PermissionGrid';\n\nimport FlagsSettingsModal from './components/FlagsSettingsModal';\n\napp.initializers.add('flarum-flags', () => {\n app.extensionSettings['flarum-flags'] = () => app.modal.show(new FlagsSettingsModal());\n\n extend(PermissionGrid.prototype, 'moderateItems', items => {\n items.add('viewFlags', {\n icon: 'fas fa-flag',\n label: app.translator.trans('flarum-flags.admin.permissions.view_flags_label'),\n permission: 'discussion.viewFlags'\n }, 65);\n });\n\n extend(PermissionGrid.prototype, 'replyItems', items => {\n items.add('flagPosts', {\n icon: 'fas fa-flag',\n label: app.translator.trans('flarum-flags.admin.permissions.flag_posts_label'),\n permission: 'discussion.flagPosts'\n }, 70);\n });\n});\n\n// Expose compat API\nimport flagsCompat from './compat';\nimport { compat } from '@flarum/core/admin';\n\nObject.assign(compat, flagsCompat);\n","module.exports = flarum.core;","module.exports = flarum.core.compat['components/PermissionGrid'];"],"sourceRoot":""} \ No newline at end of file +{"version":3,"sources":["webpack://@flarum/flags/webpack/bootstrap","webpack://@flarum/flags/external \"flarum.core.compat['app']\"","webpack://@flarum/flags/./node_modules/@babel/runtime/helpers/esm/inheritsLoose.js","webpack://@flarum/flags/external \"flarum.core.compat['extend']\"","webpack://@flarum/flags/./node_modules/@babel/runtime/helpers/esm/extends.js","webpack://@flarum/flags/external \"flarum.core\"","webpack://@flarum/flags/external \"flarum.core.compat['components/PermissionGrid']\"","webpack://@flarum/flags/external \"flarum.core.compat['components/SettingsModal']\"","webpack://@flarum/flags/./src/admin/components/FlagsSettingsModal.js","webpack://@flarum/flags/./src/admin/compat.js","webpack://@flarum/flags/./src/admin/index.js"],"names":["installedModules","__webpack_require__","moduleId","exports","module","i","l","modules","call","m","c","d","name","getter","o","Object","defineProperty","enumerable","get","r","Symbol","toStringTag","value","t","mode","__esModule","ns","create","key","bind","n","object","property","prototype","hasOwnProperty","p","s","flarum","core","compat","_inheritsLoose","subClass","superClass","constructor","__proto__","__webpack_exports__","_extends","assign","target","arguments","length","source","apply","this","FlagsSettingsModal","className","title","app","translator","trans","form","bidi","setting","SettingsModal","flags/components/FlagsSettingsModal","initializers","add","extensionSettings","modal","show","extend","PermissionGrid","items","icon","label","permission","esm_extends","flagsCompat"],"mappings":"2BACA,IAAAA,KAGA,SAAAC,EAAAC,GAGA,GAAAF,EAAAE,GACA,OAAAF,EAAAE,GAAAC,QAGA,IAAAC,EAAAJ,EAAAE,IACAG,EAAAH,EACAI,GAAA,EACAH,YAUA,OANAI,EAAAL,GAAAM,KAAAJ,EAAAD,QAAAC,IAAAD,QAAAF,GAGAG,EAAAE,GAAA,EAGAF,EAAAD,QA0DA,OArDAF,EAAAQ,EAAAF,EAGAN,EAAAS,EAAAV,EAGAC,EAAAU,EAAA,SAAAR,EAAAS,EAAAC,GACAZ,EAAAa,EAAAX,EAAAS,IACAG,OAAAC,eAAAb,EAAAS,GAA0CK,YAAA,EAAAC,IAAAL,KAK1CZ,EAAAkB,EAAA,SAAAhB,GACA,oBAAAiB,eAAAC,aACAN,OAAAC,eAAAb,EAAAiB,OAAAC,aAAwDC,MAAA,WAExDP,OAAAC,eAAAb,EAAA,cAAiDmB,OAAA,KAQjDrB,EAAAsB,EAAA,SAAAD,EAAAE,GAEA,GAD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A1C,EAAAD,QAAAkC,OAAAC,qBCAAlC,EAAAD,QAAAkC,OAAAC,KAAAC,OAAA,uDCAAnC,EAAAD,QAAAkC,OAAAC,KAAAC,OAAA,mICEqBe,4GACnBC,qBACE,MAAO,qCAGTC,iBACE,OAAOC,IAAIC,WAAWC,MAAM,wCAG9BC,gBACE,OACEnD,EAAA,OAAK8C,UAAU,cACb9C,EAAA,aAAQgD,IAAIC,WAAWC,MAAM,qDAC7BlD,EAAA,SAAO8C,UAAU,cAAcM,KAAMR,KAAKS,QAAQ,8CAbVC,GCAjCxB,GACbyB,sCAAuCV,UCGzCG,IAAIQ,aAAaC,IAAI,eAAgB,WACnCT,IAAIU,kBAAkB,gBAAkB,kBAAMV,IAAIW,MAAMC,KAAK,IAAIf,IAEjEgB,iBAAOC,IAAetC,UAAW,gBAAiB,SAAAuC,GAChDA,EAAMN,IAAI,aACRO,KAAM,cACNC,MAAOjB,IAAIC,WAAWC,MAAM,mDAC5BgB,WAAY,wBACX,MAGLL,iBAAOC,IAAetC,UAAW,aAAc,SAAAuC,GAC7CA,EAAMN,IAAI,aACRO,KAAM,cACNC,MAAOjB,IAAIC,WAAWC,MAAM,mDAC5BgB,WAAY,wBACX,QAQP5D,OAAA6D,EAAA,EAAA7D,CAAcwB,SAAQsC","file":"admin.js","sourcesContent":[" \t// The module cache\n \tvar installedModules = {};\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId]) {\n \t\t\treturn installedModules[moduleId].exports;\n \t\t}\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\ti: moduleId,\n \t\t\tl: false,\n \t\t\texports: {}\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.l = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// define getter function for harmony exports\n \t__webpack_require__.d = function(exports, name, getter) {\n \t\tif(!__webpack_require__.o(exports, name)) {\n \t\t\tObject.defineProperty(exports, name, { enumerable: true, get: getter });\n \t\t}\n \t};\n\n \t// define __esModule on exports\n \t__webpack_require__.r = function(exports) {\n \t\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n \t\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n \t\t}\n \t\tObject.defineProperty(exports, '__esModule', { value: true });\n \t};\n\n \t// create a fake namespace object\n \t// mode & 1: value is a module id, require it\n \t// mode & 2: merge all properties of value into the ns\n \t// mode & 4: return value when already ns object\n \t// mode & 8|1: behave like require\n \t__webpack_require__.t = function(value, mode) {\n \t\tif(mode & 1) value = __webpack_require__(value);\n \t\tif(mode & 8) return value;\n \t\tif((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;\n \t\tvar ns = Object.create(null);\n \t\t__webpack_require__.r(ns);\n \t\tObject.defineProperty(ns, 'default', { enumerable: true, value: value });\n \t\tif(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));\n \t\treturn ns;\n \t};\n\n \t// getDefaultExport function for compatibility with non-harmony modules\n \t__webpack_require__.n = function(module) {\n \t\tvar getter = module && module.__esModule ?\n \t\t\tfunction getDefault() { return module['default']; } :\n \t\t\tfunction getModuleExports() { return module; };\n \t\t__webpack_require__.d(getter, 'a', getter);\n \t\treturn getter;\n \t};\n\n \t// Object.prototype.hasOwnProperty.call\n \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"\";\n\n\n \t// Load entry module and return exports\n \treturn __webpack_require__(__webpack_require__.s = 23);\n","module.exports = flarum.core.compat['app'];","export default function _inheritsLoose(subClass, superClass) {\n subClass.prototype = Object.create(superClass.prototype);\n subClass.prototype.constructor = subClass;\n subClass.__proto__ = superClass;\n}","module.exports = flarum.core.compat['extend'];","export default function _extends() {\n _extends = Object.assign || function (target) {\n for (var i = 1; i < arguments.length; i++) {\n var source = arguments[i];\n\n for (var key in source) {\n if (Object.prototype.hasOwnProperty.call(source, key)) {\n target[key] = source[key];\n }\n }\n }\n\n return target;\n };\n\n return _extends.apply(this, arguments);\n}","module.exports = flarum.core;","module.exports = flarum.core.compat['components/PermissionGrid'];","module.exports = flarum.core.compat['components/SettingsModal'];","import SettingsModal from 'flarum/components/SettingsModal';\n\nexport default class FlagsSettingsModal extends SettingsModal {\n className() {\n return 'FlagsSettingsModal Modal--small';\n }\n\n title() {\n return app.translator.trans('flarum-flags.admin.settings.title');\n }\n\n form() {\n return [\n
\n \n \n
\n ];\n }\n}\n","import FlagsSettingsModal from './components/FlagsSettingsModal';\n\nexport default {\n 'flags/components/FlagsSettingsModal': FlagsSettingsModal,\n};\n","import { extend } from 'flarum/extend';\nimport app from 'flarum/app';\nimport PermissionGrid from 'flarum/components/PermissionGrid';\n\nimport FlagsSettingsModal from './components/FlagsSettingsModal';\n\napp.initializers.add('flarum-flags', () => {\n app.extensionSettings['flarum-flags'] = () => app.modal.show(new FlagsSettingsModal());\n\n extend(PermissionGrid.prototype, 'moderateItems', items => {\n items.add('viewFlags', {\n icon: 'fas fa-flag',\n label: app.translator.trans('flarum-flags.admin.permissions.view_flags_label'),\n permission: 'discussion.viewFlags'\n }, 65);\n });\n\n extend(PermissionGrid.prototype, 'replyItems', items => {\n items.add('flagPosts', {\n icon: 'fas fa-flag',\n label: app.translator.trans('flarum-flags.admin.permissions.flag_posts_label'),\n permission: 'discussion.flagPosts'\n }, 70);\n });\n});\n\n// Expose compat API\nimport flagsCompat from './compat';\nimport { compat } from '@flarum/core/admin';\n\nObject.assign(compat, flagsCompat);\n"],"sourceRoot":""} \ No newline at end of file diff --git a/extensions/flags/js/dist/forum.js b/extensions/flags/js/dist/forum.js index d0d98437b..e47674113 100644 --- a/extensions/flags/js/dist/forum.js +++ b/extensions/flags/js/dist/forum.js @@ -1,2 +1,2 @@ -module.exports=function(t){var a={};function o(e){if(a[e])return a[e].exports;var n=a[e]={i:e,l:!1,exports:{}};return t[e].call(n.exports,n,n.exports,o),n.l=!0,n.exports}return o.m=t,o.c=a,o.d=function(t,a,e){o.o(t,a)||Object.defineProperty(t,a,{enumerable:!0,get:e})},o.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},o.t=function(t,a){if(1&a&&(t=o(t)),8&a)return t;if(4&a&&"object"==typeof t&&t&&t.__esModule)return t;var e=Object.create(null);if(o.r(e),Object.defineProperty(e,"default",{enumerable:!0,value:t}),2&a&&"string"!=typeof t)for(var n in t)o.d(e,n,function(a){return t[a]}.bind(null,n));return e},o.n=function(t){var a=t&&t.__esModule?function(){return t.default}:function(){return t};return o.d(a,"a",a),a},o.o=function(t,a){return Object.prototype.hasOwnProperty.call(t,a)},o.p="",o(o.s=21)}([function(t,a){t.exports=flarum.core.compat.app},function(t,a,o){"use strict";function e(t,a){t.prototype=Object.create(a.prototype),t.prototype.constructor=t,t.__proto__=a}o.d(a,"a",function(){return e})},function(t,a){t.exports=flarum.core.compat.extend},function(t,a){t.exports=flarum.core.compat.Model},function(t,a){t.exports=flarum.core.compat["components/Button"]},function(t,a){t.exports=flarum.core.compat["components/Post"]},function(t,a){t.exports=flarum.core},function(t,a){t.exports=flarum.core.compat["utils/PostControls"]},,function(t,a){t.exports=flarum.core.compat["components/Page"]},function(t,a){t.exports=flarum.core.compat.Component},function(t,a){t.exports=flarum.core.compat["components/LoadingIndicator"]},function(t,a){t.exports=flarum.core.compat["helpers/avatar"]},function(t,a){t.exports=flarum.core.compat["helpers/username"]},function(t,a){t.exports=flarum.core.compat["helpers/icon"]},function(t,a){t.exports=flarum.core.compat["helpers/humanTime"]},function(t,a){t.exports=flarum.core.compat["components/Modal"]},function(t,a){t.exports=flarum.core.compat["components/HeaderSecondary"]},function(t,a){t.exports=flarum.core.compat["components/NotificationsDropdown"]},function(t,a){t.exports=flarum.core.compat["utils/ItemList"]},,function(t,a,o){"use strict";o.r(a);var e=o(0),n=o.n(e),s=o(3),r=o.n(s),i=o(1),l=function(t){function a(){return t.apply(this,arguments)||this}return Object(i.a)(a,t),a}(r.a);Object.assign(l.prototype,{type:r.a.attribute("type"),reason:r.a.attribute("reason"),reasonDetail:r.a.attribute("reasonDetail"),createdAt:r.a.attribute("createdAt",r.a.transformDate),post:r.a.hasOne("post"),user:r.a.hasOne("user")});var c=l,p=o(9),u=o.n(p),f=o(10),g=o.n(f),d=o(11),h=o.n(d),b=o(12),v=o.n(b),y=o(13),_=o.n(y),x=o(14),N=o.n(x),F=o(15),w=o.n(F),O=function(t){function a(){return t.apply(this,arguments)||this}Object(i.a)(a,t);var o=a.prototype;return o.init=function(){this.loading=!1},o.view=function(){var t=app.cache.flags||[];return m("div",{className:"NotificationList FlagList"},m("div",{className:"NotificationList-header"},m("h4",{className:"App-titleControl App-titleControl--text"},app.translator.trans("flarum-flags.forum.flagged_posts.title"))),m("div",{className:"NotificationList-content"},m("ul",{className:"NotificationGroup-content"},t.length?t.map(function(t){var a=t.post();return m("li",null,m("a",{href:app.route.post(a),className:"Notification Flag",config:function(t,o){m.route.apply(this,arguments),o||$(t).on("click",function(){return app.cache.flagIndex=a})}},v()(a.user()),N()("fas fa-flag",{className:"Notification-icon"}),m("span",{className:"Notification-content"},app.translator.trans("flarum-flags.forum.flagged_posts.item_text",{username:_()(a.user()),em:m("em",null),discussion:a.discussion().title()})),w()(t.createdAt()),m("div",{className:"Notification-excerpt"},a.contentPlain())))}):this.loading?h.a.component({className:"LoadingIndicator--block"}):m("div",{className:"NotificationList-empty"},app.translator.trans("flarum-flags.forum.flagged_posts.empty_text")))))},o.load=function(){var t=this;app.cache.flags&&!app.session.user.attribute("newFlagCount")||(this.loading=!0,m.redraw(),app.store.find("flags").then(function(t){app.session.user.pushAttributes({newFlagCount:0}),app.cache.flags=t.sort(function(t,a){return a.createdAt()-t.createdAt()})}).catch(function(){}).then(function(){t.loading=!1,m.redraw()}))},a}(g.a),k=function(t){function a(){return t.apply(this,arguments)||this}Object(i.a)(a,t);var o=a.prototype;return o.init=function(){t.prototype.init.call(this),app.history.push("flags"),this.list=new O,this.list.load(),this.bodyClass="App--flags"},o.view=function(){return m("div",{className:"FlagsPage"},this.list.render())},a}(u.a),P=o(2),j=o(7),A=o.n(j),C=o(4),D=o.n(C),M=o(16),B=function(t){function a(){return t.apply(this,arguments)||this}Object(i.a)(a,t);var o=a.prototype;return o.init=function(){t.prototype.init.call(this),this.success=!1,this.reason=m.prop(""),this.reasonDetail=m.prop("")},o.className=function(){return"FlagPostModal Modal--small"},o.title=function(){return app.translator.trans("flarum-flags.forum.flag_post.title")},o.content=function(){if(this.success)return m("div",{className:"Modal-body"},m("div",{className:"Form Form--centered"},m("p",{className:"helpText"},app.translator.trans("flarum-flags.forum.flag_post.confirmation_message")),m("div",{className:"Form-group"},m(D.a,{className:"Button Button--primary Button--block",onclick:this.hide.bind(this)},app.translator.trans("flarum-flags.forum.flag_post.dismiss_button")))));var t=app.forum.attribute("guidelinesUrl");return m("div",{className:"Modal-body"},m("div",{className:"Form Form--centered"},m("div",{className:"Form-group"},m("div",null,m("label",{className:"checkbox"},m("input",{type:"radio",name:"reason",checked:"off_topic"===this.reason(),value:"off_topic",onclick:m.withAttr("value",this.reason)}),m("strong",null,app.translator.trans("flarum-flags.forum.flag_post.reason_off_topic_label")),app.translator.trans("flarum-flags.forum.flag_post.reason_off_topic_text")),m("label",{className:"checkbox"},m("input",{type:"radio",name:"reason",checked:"inappropriate"===this.reason(),value:"inappropriate",onclick:m.withAttr("value",this.reason)}),m("strong",null,app.translator.trans("flarum-flags.forum.flag_post.reason_inappropriate_label")),app.translator.trans("flarum-flags.forum.flag_post.reason_inappropriate_text",{a:t?m("a",{href:t,target:"_blank"}):void 0})),m("label",{className:"checkbox"},m("input",{type:"radio",name:"reason",checked:"spam"===this.reason(),value:"spam",onclick:m.withAttr("value",this.reason)}),m("strong",null,app.translator.trans("flarum-flags.forum.flag_post.reason_spam_label")),app.translator.trans("flarum-flags.forum.flag_post.reason_spam_text")),m("label",{className:"checkbox"},m("input",{type:"radio",name:"reason",checked:"other"===this.reason(),value:"other",onclick:m.withAttr("value",this.reason)}),m("strong",null,app.translator.trans("flarum-flags.forum.flag_post.reason_other_label")),"other"===this.reason()?m("textarea",{className:"FormControl",value:this.reasonDetail(),oninput:m.withAttr("value",this.reasonDetail)}):""))),m("div",{className:"Form-group"},m(D.a,{className:"Button Button--primary Button--block",type:"submit",loading:this.loading,disabled:!this.reason()},app.translator.trans("flarum-flags.forum.flag_post.submit_button")))))},o.onsubmit=function(t){var a=this;t.preventDefault(),this.loading=!0,app.store.createRecord("flags").save({reason:"other"===this.reason()?null:this.reason(),reasonDetail:this.reasonDetail(),relationships:{user:app.session.user,post:this.props.post}}).then(function(){return a.success=!0}).catch(function(){}).then(this.loaded.bind(this))},a}(o.n(M).a),L=function(){Object(P.extend)(A.a,"userControls",function(t,a){!a.isHidden()&&"comment"===a.contentType()&&a.canFlag()&&a.user()!==n.a.session.user&&t.add("flag",m(D.a,{icon:"fas fa-flag",onclick:function(){return n.a.modal.show(new B({post:a}))}},n.a.translator.trans("flarum-flags.forum.post_controls.flag_button")))})},I=o(17),T=o.n(I),S=o(18),E=function(t){function a(){return t.apply(this,arguments)||this}Object(i.a)(a,t),a.initProps=function(a){a.label=a.label||app.translator.trans("flarum-flags.forum.flagged_posts.tooltip"),a.icon=a.icon||"fas fa-flag",t.initProps.call(this,a)};var o=a.prototype;return o.init=function(){t.prototype.init.call(this),this.list=new O},o.goToRoute=function(){m.route(app.route("flags"))},o.getUnreadCount=function(){return app.cache.flags?app.cache.flags.length:app.forum.attribute("flagCount")},o.getNewCount=function(){return app.session.user.attribute("newFlagCount")},a}(o.n(S).a),R=function(){Object(P.extend)(T.a.prototype,"items",function(t){n.a.forum.attribute("canViewFlags")&&t.add("flags",m(E,null),15)})},H=o(5),U=o.n(H),G=o(19),q=o.n(G),z=function(){Object(P.extend)(U.a.prototype,"attrs",function(t){this.props.post.flags().length&&(t.className+=" Post--flagged")}),U.a.prototype.dismissFlag=function(t){var a=this.props.post;return delete a.data.relationships.flags,this.subtree.invalidate(),n.a.cache.flags&&n.a.cache.flags.some(function(t,o){if(t.post()===a){if(n.a.cache.flags.splice(o,1),n.a.cache.flagIndex===a){var e=n.a.cache.flags[o];if(e||(e=n.a.cache.flags[0]),e){var s=e.post();n.a.cache.flagIndex=s,m.route(n.a.route.post(s))}}return!0}}),n.a.request({url:n.a.forum.attribute("apiUrl")+a.apiEndpoint()+"/flags",method:"DELETE",data:t})},U.a.prototype.flagActionItems=function(){var t=this,a=new q.a,o=A.a.destructiveControls(this.props.post);return Object.keys(o.items).forEach(function(a){var e=o.get(a).props;e.className="Button",Object(P.extend)(e,"onclick",function(){return t.dismissFlag()})}),a.add("controls",m("div",{className:"ButtonGroup"},o.toArray())),a.add("dismiss",m(D.a,{className:"Button",icon:"far fa-eye-slash",onclick:this.dismissFlag.bind(this)},n.a.translator.trans("flarum-flags.forum.post.dismiss_flag_button")),-100),a},Object(P.extend)(U.a.prototype,"content",function(t){var a=this,o=this.props.post,e=o.flags();e.length&&(o.isHidden()&&(this.revealContent=!0),t.unshift(m("div",{className:"Post-flagged"},m("div",{className:"Post-flagged-flags"},e.map(function(t){return m("div",{className:"Post-flagged-flag"},a.flagReason(t))})),m("div",{className:"Post-flagged-actions"},this.flagActionItems().toArray()))))}),U.a.prototype.flagReason=function(t){if("user"===t.type()){var a=t.user(),o=t.reason(),e=t.reasonDetail();return[n.a.translator.trans(o?"flarum-flags.forum.post.flagged_by_with_reason_text":"flarum-flags.forum.post.flagged_by_text",{user:a,reason:o}),e?m("span",{className:"Post-flagged-detail"},e):""]}}},V={"flags/addFlagsToPosts":z,"flags/addFlagControl":L,"flags/addFlagsDropdown":R,"flags/models/Flag":c,"flags/components/FlagList":O,"flags/components/FlagPostModal":B,"flags/components/FlagsPage":k,"flags/components/FlagsDropdown":E},J=o(6);n.a.initializers.add("flarum-flags",function(){n.a.store.models.posts.prototype.flags=r.a.hasMany("flags"),n.a.store.models.posts.prototype.canFlag=r.a.attribute("canFlag"),n.a.store.models.flags=c,n.a.routes.flags={path:"/flags",component:m(k,null)},L(),R(),z()}),Object.assign(J.compat,V)}]); +module.exports=function(t){var a={};function o(e){if(a[e])return a[e].exports;var n=a[e]={i:e,l:!1,exports:{}};return t[e].call(n.exports,n,n.exports,o),n.l=!0,n.exports}return o.m=t,o.c=a,o.d=function(t,a,e){o.o(t,a)||Object.defineProperty(t,a,{enumerable:!0,get:e})},o.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},o.t=function(t,a){if(1&a&&(t=o(t)),8&a)return t;if(4&a&&"object"==typeof t&&t&&t.__esModule)return t;var e=Object.create(null);if(o.r(e),Object.defineProperty(e,"default",{enumerable:!0,value:t}),2&a&&"string"!=typeof t)for(var n in t)o.d(e,n,function(a){return t[a]}.bind(null,n));return e},o.n=function(t){var a=t&&t.__esModule?function(){return t.default}:function(){return t};return o.d(a,"a",a),a},o.o=function(t,a){return Object.prototype.hasOwnProperty.call(t,a)},o.p="",o(o.s=22)}([function(t,a){t.exports=flarum.core.compat.app},function(t,a,o){"use strict";function e(t,a){t.prototype=Object.create(a.prototype),t.prototype.constructor=t,t.__proto__=a}o.d(a,"a",function(){return e})},function(t,a){t.exports=flarum.core.compat.extend},function(t,a){t.exports=flarum.core.compat.Model},function(t,a,o){"use strict";function e(){return(e=Object.assign||function(t){for(var a=1;a\n
\n

{app.translator.trans('flarum-flags.forum.flagged_posts.title')}

\n
\n
\n \n
\n \n );\n }\n\n /**\n * Load flags into the application's cache if they haven't already\n * been loaded.\n */\n load() {\n if (app.cache.flags && !app.session.user.attribute('newFlagCount')) {\n return;\n }\n\n this.loading = true;\n m.redraw();\n\n app.store.find('flags')\n .then(flags => {\n app.session.user.pushAttributes({newFlagCount: 0});\n app.cache.flags = flags.sort((a, b) => b.createdAt() - a.createdAt());\n })\n .catch(() => {})\n .then(() => {\n this.loading = false;\n m.redraw();\n });\n }\n}\n","import Page from 'flarum/components/Page';\n\nimport FlagList from './FlagList';\n\n/**\n * The `FlagsPage` component shows the flags list. It is only\n * used on mobile devices where the flags dropdown is within the drawer.\n */\nexport default class FlagsPage extends Page {\n init() {\n super.init();\n\n app.history.push('flags');\n\n this.list = new FlagList();\n this.list.load();\n\n this.bodyClass = 'App--flags';\n }\n\n view() {\n return
{this.list.render()}
;\n }\n}\n","import Modal from 'flarum/components/Modal';\nimport Button from 'flarum/components/Button';\n\nexport default class FlagPostModal extends Modal {\n init() {\n super.init();\n\n this.success = false;\n\n this.reason = m.prop('');\n this.reasonDetail = m.prop('');\n }\n\n className() {\n return 'FlagPostModal Modal--small';\n }\n\n title() {\n return app.translator.trans('flarum-flags.forum.flag_post.title');\n }\n\n content() {\n if (this.success) {\n return (\n
\n
\n

{app.translator.trans('flarum-flags.forum.flag_post.confirmation_message')}

\n
\n \n
\n
\n
\n );\n }\n\n const guidelinesUrl = app.forum.attribute('guidelinesUrl');\n\n return (\n
\n
\n
\n
\n \n\n \n\n \n\n \n
\n
\n\n
\n \n {app.translator.trans('flarum-flags.forum.flag_post.submit_button')}\n \n
\n
\n
\n );\n }\n\n onsubmit(e) {\n e.preventDefault();\n\n this.loading = true;\n\n app.store.createRecord('flags').save({\n reason: this.reason() === 'other' ? null : this.reason(),\n reasonDetail: this.reasonDetail(),\n relationships: {\n user: app.session.user,\n post: this.props.post\n }\n })\n .then(() => this.success = true)\n .catch(() => {})\n .then(this.loaded.bind(this));\n }\n}\n","import { extend } from 'flarum/extend';\nimport app from 'flarum/app';\nimport PostControls from 'flarum/utils/PostControls';\nimport Button from 'flarum/components/Button';\n\nimport FlagPostModal from './components/FlagPostModal';\n\nexport default function() {\n extend(PostControls, 'userControls', function(items, post) {\n if (post.isHidden() || post.contentType() !== 'comment' || !post.canFlag() || post.user() === app.session.user) return;\n\n items.add('flag',\n \n );\n });\n}\n","import NotificationsDropdown from 'flarum/components/NotificationsDropdown';\n\nimport FlagList from './FlagList';\n\nexport default class FlagsDropdown extends NotificationsDropdown {\n static initProps(props) {\n props.label = props.label || app.translator.trans('flarum-flags.forum.flagged_posts.tooltip');\n props.icon = props.icon || 'fas fa-flag';\n\n super.initProps(props);\n }\n\n init() {\n super.init();\n\n this.list = new FlagList();\n }\n\n goToRoute() {\n m.route(app.route('flags'));\n }\n\n getUnreadCount() {\n return app.cache.flags ? app.cache.flags.length : app.forum.attribute('flagCount');\n }\n\n getNewCount() {\n return app.session.user.attribute('newFlagCount');\n }\n}\n","import { extend } from 'flarum/extend';\nimport app from 'flarum/app';\nimport HeaderSecondary from 'flarum/components/HeaderSecondary';\nimport FlagsDropdown from './components/FlagsDropdown';\n\nexport default function() {\n extend(HeaderSecondary.prototype, 'items', function(items) {\n if (app.forum.attribute('canViewFlags')) {\n items.add('flags', , 15);\n }\n });\n}\n","import { extend } from 'flarum/extend';\nimport app from 'flarum/app';\nimport Post from 'flarum/components/Post';\nimport Button from 'flarum/components/Button';\nimport ItemList from 'flarum/utils/ItemList';\nimport PostControls from 'flarum/utils/PostControls';\n\nexport default function() {\n extend(Post.prototype, 'attrs', function(attrs) {\n if (this.props.post.flags().length) {\n attrs.className += ' Post--flagged';\n }\n });\n\n Post.prototype.dismissFlag = function(data) {\n const post = this.props.post;\n\n delete post.data.relationships.flags;\n\n this.subtree.invalidate();\n\n if (app.cache.flags) {\n app.cache.flags.some((flag, i) => {\n if (flag.post() === post) {\n app.cache.flags.splice(i, 1);\n\n if (app.cache.flagIndex === post) {\n let next = app.cache.flags[i];\n\n if (!next) next = app.cache.flags[0];\n\n if (next) {\n const nextPost = next.post();\n app.cache.flagIndex = nextPost;\n m.route(app.route.post(nextPost));\n }\n }\n\n return true;\n }\n });\n }\n\n return app.request({\n url: app.forum.attribute('apiUrl') + post.apiEndpoint() + '/flags',\n method: 'DELETE',\n data\n });\n };\n\n Post.prototype.flagActionItems = function() {\n const items = new ItemList();\n\n const controls = PostControls.destructiveControls(this.props.post);\n\n Object.keys(controls.items).forEach(k => {\n const props = controls.get(k).props;\n\n props.className = 'Button';\n\n extend(props, 'onclick', () => this.dismissFlag());\n });\n\n items.add('controls', (\n
\n {controls.toArray()}\n
\n ));\n\n items.add('dismiss', (\n \n ), -100);\n\n return items;\n };\n\n extend(Post.prototype, 'content', function(vdom) {\n const post = this.props.post;\n const flags = post.flags();\n\n if (!flags.length) return;\n\n if (post.isHidden()) this.revealContent = true;\n\n vdom.unshift(\n
\n
\n {flags.map(flag =>\n
\n {this.flagReason(flag)}\n
\n )}\n
\n
\n {this.flagActionItems().toArray()}\n
\n
\n );\n });\n\n Post.prototype.flagReason = function(flag) {\n if (flag.type() === 'user') {\n const user = flag.user();\n const reason = flag.reason();\n const detail = flag.reasonDetail();\n\n return [\n app.translator.trans(reason ? 'flarum-flags.forum.post.flagged_by_with_reason_text' : 'flarum-flags.forum.post.flagged_by_text', {user, reason}),\n detail ? {detail} : ''\n ];\n }\n };\n}\n","import addFlagsToPosts from './addFlagsToPosts';\nimport addFlagControl from './addFlagControl';\nimport addFlagsDropdown from './addFlagsDropdown';\nimport Flag from './models/Flag';\nimport FlagList from './components/FlagList';\nimport FlagPostModal from './components/FlagPostModal';\nimport FlagsPage from './components/FlagsPage';\nimport FlagsDropdown from './components/FlagsDropdown';\n\nexport default {\n 'flags/addFlagsToPosts': addFlagsToPosts,\n 'flags/addFlagControl': addFlagControl,\n 'flags/addFlagsDropdown': addFlagsDropdown,\n 'flags/models/Flag': Flag,\n 'flags/components/FlagList': FlagList,\n 'flags/components/FlagPostModal': FlagPostModal,\n 'flags/components/FlagsPage': FlagsPage,\n 'flags/components/FlagsDropdown': FlagsDropdown,\n};\n","import app from 'flarum/app';\nimport Model from 'flarum/Model';\n\nimport Flag from './models/Flag';\nimport FlagsPage from './components/FlagsPage';\nimport addFlagControl from './addFlagControl';\nimport addFlagsDropdown from './addFlagsDropdown';\nimport addFlagsToPosts from './addFlagsToPosts';\n\napp.initializers.add('flarum-flags', () => {\n app.store.models.posts.prototype.flags = Model.hasMany('flags');\n app.store.models.posts.prototype.canFlag = Model.attribute('canFlag');\n\n app.store.models.flags = Flag;\n\n app.routes.flags = {path: '/flags', component: };\n\n addFlagControl();\n addFlagsDropdown();\n addFlagsToPosts();\n});\n\n// Expose compat API\nimport flagsCompat from './compat';\nimport { compat } from '@flarum/core/forum';\n\nObject.assign(compat, flagsCompat);\n"],"sourceRoot":""} \ No newline at end of file +{"version":3,"sources":["webpack://@flarum/flags/webpack/bootstrap","webpack://@flarum/flags/external \"flarum.core.compat['app']\"","webpack://@flarum/flags/./node_modules/@babel/runtime/helpers/esm/inheritsLoose.js","webpack://@flarum/flags/external \"flarum.core.compat['extend']\"","webpack://@flarum/flags/external \"flarum.core.compat['Model']\"","webpack://@flarum/flags/./node_modules/@babel/runtime/helpers/esm/extends.js","webpack://@flarum/flags/external \"flarum.core.compat['components/Button']\"","webpack://@flarum/flags/external \"flarum.core.compat['components/Post']\"","webpack://@flarum/flags/external \"flarum.core\"","webpack://@flarum/flags/external \"flarum.core.compat['utils/PostControls']\"","webpack://@flarum/flags/external \"flarum.core.compat['components/Page']\"","webpack://@flarum/flags/external \"flarum.core.compat['Component']\"","webpack://@flarum/flags/external \"flarum.core.compat['components/LoadingIndicator']\"","webpack://@flarum/flags/external \"flarum.core.compat['helpers/avatar']\"","webpack://@flarum/flags/external \"flarum.core.compat['helpers/username']\"","webpack://@flarum/flags/external \"flarum.core.compat['helpers/icon']\"","webpack://@flarum/flags/external \"flarum.core.compat['helpers/humanTime']\"","webpack://@flarum/flags/external \"flarum.core.compat['components/Modal']\"","webpack://@flarum/flags/external \"flarum.core.compat['components/HeaderSecondary']\"","webpack://@flarum/flags/external \"flarum.core.compat['components/NotificationsDropdown']\"","webpack://@flarum/flags/external \"flarum.core.compat['utils/ItemList']\"","webpack://@flarum/flags/./src/forum/models/Flag.js","webpack://@flarum/flags/./src/forum/components/FlagList.js","webpack://@flarum/flags/./src/forum/components/FlagsPage.js","webpack://@flarum/flags/./src/forum/components/FlagPostModal.js","webpack://@flarum/flags/./src/forum/addFlagControl.js","webpack://@flarum/flags/./src/forum/components/FlagsDropdown.js","webpack://@flarum/flags/./src/forum/addFlagsDropdown.js","webpack://@flarum/flags/./src/forum/addFlagsToPosts.js","webpack://@flarum/flags/./src/forum/compat.js","webpack://@flarum/flags/./src/forum/index.js"],"names":["installedModules","__webpack_require__","moduleId","exports","module","i","l","modules","call","m","c","d","name","getter","o","Object","defineProperty","enumerable","get","r","Symbol","toStringTag","value","t","mode","__esModule","ns","create","key","bind","n","object","property","prototype","hasOwnProperty","p","s","flarum","core","compat","_inheritsLoose","subClass","superClass","constructor","__proto__","__webpack_exports__","_extends","assign","target","arguments","length","source","apply","this","Flag","Model","esm_extends","type","attribute","reason","reasonDetail","createdAt","transformDate","post","hasOne","user","FlagList","init","loading","view","flags","app","cache","className","translator","trans","map","flag","href","route","config","element","isInitialized","$","on","flagIndex","avatar","icon","username","em","discussion","title","humanTime","contentPlain","LoadingIndicator","component","load","_this","session","redraw","store","find","then","pushAttributes","newFlagCount","sort","a","b","catch","Component","FlagsPage","_Page","history","push","list","bodyClass","render","Page","FlagPostModal","_Modal","success","prop","content","Button_default","onclick","hide","guidelinesUrl","forum","checked","withAttr","undefined","oninput","disabled","onsubmit","e","preventDefault","createRecord","save","relationships","props","loaded","Modal","addFlagControl","extend","PostControls","items","isHidden","contentType","canFlag","add","modal","show","FlagsDropdown","initProps","label","_NotificationsDropdow","goToRoute","getUnreadCount","getNewCount","NotificationsDropdown","addFlagsDropdown","HeaderSecondary","FlagsDropdown_FlagsDropdown","addFlagsToPosts","Post","attrs","dismissFlag","data","subtree","invalidate","some","splice","next","nextPost","request","url","apiEndpoint","method","flagActionItems","ItemList","controls","destructiveControls","keys","forEach","k","toArray","vdom","_this2","revealContent","unshift","flagReason","detail","flags/addFlagsToPosts","flags/addFlagControl","flags/addFlagsDropdown","flags/models/Flag","flags/components/FlagList","flags/components/FlagPostModal","flags/components/FlagsPage","flags/components/FlagsDropdown","initializers","models","posts","hasMany","routes","path","FlagsPage_FlagsPage","flagsCompat"],"mappings":"2BACA,IAAAA,KAGA,SAAAC,EAAAC,GAGA,GAAAF,EAAAE,GACA,OAAAF,EAAAE,GAAAC,QAGA,IAAAC,EAAAJ,EAAAE,IACAG,EAAAH,EACAI,GAAA,EACAH,YAUA,OANAI,EAAAL,GAAAM,KAAAJ,EAAAD,QAAAC,IAAAD,QAAAF,GAGAG,EAAAE,GAAA,EAGAF,EAAAD,QA0DA,OArDAF,EAAAQ,EAAAF,EAGAN,EAAAS,EAAAV,EAGAC,EAAAU,EAAA,SAAAR,EAAAS,EAAAC,GACAZ,EAAAa,EAAAX,EAAAS,IACAG,OAAAC,eAAAb,EAAAS,GAA0CK,YAAA,EAAAC,IAAAL,KAK1CZ,EAAAkB,EAAA,SAAAhB,GACA,oBAAAiB,eAAAC,aACAN,OAAAC,eAAAb,EAAAiB,OAAAC,aAAwDC,MAAA,WAExDP,OAAAC,eAAAb,EAAA,cAAiDmB,OAAA,KAQjDrB,EAAAsB,EAAA,SAAAD,EAAAE,GAEA,GADA,EAAAA,IAAAF,EAAArB,EAAAqB,IACA,EAAAE,EAAA,OAAAF,EACA,KAAAE,GAAA,iBAAAF,QAAAG,WAAA,OAAAH,EACA,IAAAI,EAAAX,OAAAY,OAAA,MAGA,GAFA1B,EAAAkB,EAAAO,GACAX,OAAAC,eAAAU,EAAA,WAAyCT,YAAA,EAAAK,UACzC,EAAAE,GAAA,iBAAAF,EAAA,QAAAM,KAAAN,EAAArB,EAAAU,EAAAe,EAAAE,EAAA,SAAAA,GAAgH,OAAAN,EAAAM,IAAqBC,KAAA,KAAA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WACxIoI,EAAStL,EAAA,QAAMgE,UAAU,uBAAuBsH,GAAiB,OCrG1DxJ,GACbyJ,wBAAyB7B,EACzB8B,uBAAwBnD,EACxBoD,yBAA0BlC,EAC1BmC,oBAAqB7I,EACrB8I,4BAA6BlI,EAC7BmI,iCAAkC/E,EAClCgF,6BAA8BxF,EAC9ByF,iCAAkC/C,UCRpCjF,IAAIiI,aAAanD,IAAI,eAAgB,WACnC9E,IAAI6B,MAAMqG,OAAOC,MAAMzK,UAAUqC,MAAQf,IAAMoJ,QAAQ,SACvDpI,IAAI6B,MAAMqG,OAAOC,MAAMzK,UAAUmH,QAAU7F,IAAMG,UAAU,WAE3Da,IAAI6B,MAAMqG,OAAOnI,MAAQhB,EAEzBiB,IAAIqI,OAAOtI,OAASuI,KAAM,SAAU9G,UAAWtF,EAACqM,EAAD,OAE/ChE,IACAkB,IACAG,MAOFpJ,OAAAyC,EAAA,EAAAzC,CAAcwB,SAAQwK","file":"forum.js","sourcesContent":[" \t// The module cache\n \tvar installedModules = {};\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId]) {\n \t\t\treturn installedModules[moduleId].exports;\n \t\t}\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\ti: moduleId,\n \t\t\tl: false,\n \t\t\texports: {}\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.l = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// define getter function for harmony exports\n \t__webpack_require__.d = function(exports, name, getter) {\n \t\tif(!__webpack_require__.o(exports, name)) {\n \t\t\tObject.defineProperty(exports, name, { enumerable: true, get: getter });\n \t\t}\n \t};\n\n \t// define __esModule on exports\n \t__webpack_require__.r = function(exports) {\n \t\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n \t\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n \t\t}\n \t\tObject.defineProperty(exports, '__esModule', { value: true });\n \t};\n\n \t// create a fake namespace object\n \t// mode & 1: value is a module id, require it\n \t// mode & 2: merge all properties of value into the ns\n \t// mode & 4: return value when already ns object\n \t// mode & 8|1: behave like require\n \t__webpack_require__.t = function(value, mode) {\n \t\tif(mode & 1) value = __webpack_require__(value);\n \t\tif(mode & 8) return value;\n \t\tif((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;\n \t\tvar ns = Object.create(null);\n \t\t__webpack_require__.r(ns);\n \t\tObject.defineProperty(ns, 'default', { enumerable: true, value: value });\n \t\tif(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));\n \t\treturn ns;\n \t};\n\n \t// getDefaultExport function for compatibility with non-harmony modules\n \t__webpack_require__.n = function(module) {\n \t\tvar getter = module && module.__esModule ?\n \t\t\tfunction getDefault() { return module['default']; } :\n \t\t\tfunction getModuleExports() { return module; };\n \t\t__webpack_require__.d(getter, 'a', getter);\n \t\treturn getter;\n \t};\n\n \t// Object.prototype.hasOwnProperty.call\n \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"\";\n\n\n \t// Load entry module and return exports\n \treturn __webpack_require__(__webpack_require__.s = 22);\n","module.exports = flarum.core.compat['app'];","export default function _inheritsLoose(subClass, superClass) {\n subClass.prototype = Object.create(superClass.prototype);\n subClass.prototype.constructor = subClass;\n subClass.__proto__ = superClass;\n}","module.exports = flarum.core.compat['extend'];","module.exports = flarum.core.compat['Model'];","export default function _extends() {\n _extends = Object.assign || function (target) {\n for (var i = 1; i < arguments.length; i++) {\n var source = arguments[i];\n\n for (var key in source) {\n if (Object.prototype.hasOwnProperty.call(source, key)) {\n target[key] = source[key];\n }\n }\n }\n\n return target;\n };\n\n return _extends.apply(this, arguments);\n}","module.exports = flarum.core.compat['components/Button'];","module.exports = flarum.core.compat['components/Post'];","module.exports = flarum.core;","module.exports = flarum.core.compat['utils/PostControls'];","module.exports = flarum.core.compat['components/Page'];","module.exports = flarum.core.compat['Component'];","module.exports = flarum.core.compat['components/LoadingIndicator'];","module.exports = flarum.core.compat['helpers/avatar'];","module.exports = flarum.core.compat['helpers/username'];","module.exports = flarum.core.compat['helpers/icon'];","module.exports = flarum.core.compat['helpers/humanTime'];","module.exports = flarum.core.compat['components/Modal'];","module.exports = flarum.core.compat['components/HeaderSecondary'];","module.exports = flarum.core.compat['components/NotificationsDropdown'];","module.exports = flarum.core.compat['utils/ItemList'];","import Model from 'flarum/Model';\n\nclass Flag extends Model {}\n\nObject.assign(Flag.prototype, {\n type: Model.attribute('type'),\n reason: Model.attribute('reason'),\n reasonDetail: Model.attribute('reasonDetail'),\n createdAt: Model.attribute('createdAt', Model.transformDate),\n\n post: Model.hasOne('post'),\n user: Model.hasOne('user')\n});\n\nexport default Flag;\n","import Component from 'flarum/Component';\nimport LoadingIndicator from 'flarum/components/LoadingIndicator';\nimport avatar from 'flarum/helpers/avatar';\nimport username from 'flarum/helpers/username';\nimport icon from 'flarum/helpers/icon';\nimport humanTime from 'flarum/helpers/humanTime';\n\nexport default class FlagList extends Component {\n init() {\n /**\n * Whether or not the notifications are loading.\n *\n * @type {Boolean}\n */\n this.loading = false;\n }\n\n view() {\n const flags = app.cache.flags || [];\n\n return (\n
\n
\n

{app.translator.trans('flarum-flags.forum.flagged_posts.title')}

\n
\n
\n
\n );\n }\n\n /**\n * Load flags into the application's cache if they haven't already\n * been loaded.\n */\n load() {\n if (app.cache.flags && !app.session.user.attribute('newFlagCount')) {\n return;\n }\n\n this.loading = true;\n m.redraw();\n\n app.store.find('flags')\n .then(flags => {\n app.session.user.pushAttributes({newFlagCount: 0});\n app.cache.flags = flags.sort((a, b) => b.createdAt() - a.createdAt());\n })\n .catch(() => {})\n .then(() => {\n this.loading = false;\n m.redraw();\n });\n }\n}\n","import Page from 'flarum/components/Page';\n\nimport FlagList from './FlagList';\n\n/**\n * The `FlagsPage` component shows the flags list. It is only\n * used on mobile devices where the flags dropdown is within the drawer.\n */\nexport default class FlagsPage extends Page {\n init() {\n super.init();\n\n app.history.push('flags');\n\n this.list = new FlagList();\n this.list.load();\n\n this.bodyClass = 'App--flags';\n }\n\n view() {\n return
{this.list.render()}
;\n }\n}\n","import Modal from 'flarum/components/Modal';\nimport Button from 'flarum/components/Button';\n\nexport default class FlagPostModal extends Modal {\n init() {\n super.init();\n\n this.success = false;\n\n this.reason = m.prop('');\n this.reasonDetail = m.prop('');\n }\n\n className() {\n return 'FlagPostModal Modal--small';\n }\n\n title() {\n return app.translator.trans('flarum-flags.forum.flag_post.title');\n }\n\n content() {\n if (this.success) {\n return (\n
\n
\n

{app.translator.trans('flarum-flags.forum.flag_post.confirmation_message')}

\n
\n \n
\n
\n
\n );\n }\n\n const guidelinesUrl = app.forum.attribute('guidelinesUrl');\n\n return (\n
\n
\n
\n
\n \n\n \n\n \n\n \n
\n
\n\n
\n \n {app.translator.trans('flarum-flags.forum.flag_post.submit_button')}\n \n
\n
\n
\n );\n }\n\n onsubmit(e) {\n e.preventDefault();\n\n this.loading = true;\n\n app.store.createRecord('flags').save({\n reason: this.reason() === 'other' ? null : this.reason(),\n reasonDetail: this.reasonDetail(),\n relationships: {\n user: app.session.user,\n post: this.props.post\n }\n })\n .then(() => this.success = true)\n .catch(() => {})\n .then(this.loaded.bind(this));\n }\n}\n","import { extend } from 'flarum/extend';\nimport app from 'flarum/app';\nimport PostControls from 'flarum/utils/PostControls';\nimport Button from 'flarum/components/Button';\n\nimport FlagPostModal from './components/FlagPostModal';\n\nexport default function() {\n extend(PostControls, 'userControls', function(items, post) {\n if (post.isHidden() || post.contentType() !== 'comment' || !post.canFlag() || post.user() === app.session.user) return;\n\n items.add('flag',\n \n );\n });\n}\n","import NotificationsDropdown from 'flarum/components/NotificationsDropdown';\n\nimport FlagList from './FlagList';\n\nexport default class FlagsDropdown extends NotificationsDropdown {\n static initProps(props) {\n props.label = props.label || app.translator.trans('flarum-flags.forum.flagged_posts.tooltip');\n props.icon = props.icon || 'fas fa-flag';\n\n super.initProps(props);\n }\n\n init() {\n super.init();\n\n this.list = new FlagList();\n }\n\n goToRoute() {\n m.route(app.route('flags'));\n }\n\n getUnreadCount() {\n return app.cache.flags ? app.cache.flags.length : app.forum.attribute('flagCount');\n }\n\n getNewCount() {\n return app.session.user.attribute('newFlagCount');\n }\n}\n","import { extend } from 'flarum/extend';\nimport app from 'flarum/app';\nimport HeaderSecondary from 'flarum/components/HeaderSecondary';\nimport FlagsDropdown from './components/FlagsDropdown';\n\nexport default function() {\n extend(HeaderSecondary.prototype, 'items', function(items) {\n if (app.forum.attribute('canViewFlags')) {\n items.add('flags', , 15);\n }\n });\n}\n","import { extend } from 'flarum/extend';\nimport app from 'flarum/app';\nimport Post from 'flarum/components/Post';\nimport Button from 'flarum/components/Button';\nimport ItemList from 'flarum/utils/ItemList';\nimport PostControls from 'flarum/utils/PostControls';\n\nexport default function() {\n extend(Post.prototype, 'attrs', function(attrs) {\n if (this.props.post.flags().length) {\n attrs.className += ' Post--flagged';\n }\n });\n\n Post.prototype.dismissFlag = function(data) {\n const post = this.props.post;\n\n delete post.data.relationships.flags;\n\n this.subtree.invalidate();\n\n if (app.cache.flags) {\n app.cache.flags.some((flag, i) => {\n if (flag.post() === post) {\n app.cache.flags.splice(i, 1);\n\n if (app.cache.flagIndex === post) {\n let next = app.cache.flags[i];\n\n if (!next) next = app.cache.flags[0];\n\n if (next) {\n const nextPost = next.post();\n app.cache.flagIndex = nextPost;\n m.route(app.route.post(nextPost));\n }\n }\n\n return true;\n }\n });\n }\n\n return app.request({\n url: app.forum.attribute('apiUrl') + post.apiEndpoint() + '/flags',\n method: 'DELETE',\n data\n });\n };\n\n Post.prototype.flagActionItems = function() {\n const items = new ItemList();\n\n const controls = PostControls.destructiveControls(this.props.post);\n\n Object.keys(controls.items).forEach(k => {\n const props = controls.get(k).props;\n\n props.className = 'Button';\n\n extend(props, 'onclick', () => this.dismissFlag());\n });\n\n items.add('controls', (\n
\n {controls.toArray()}\n
\n ));\n\n items.add('dismiss', (\n \n ), -100);\n\n return items;\n };\n\n extend(Post.prototype, 'content', function(vdom) {\n const post = this.props.post;\n const flags = post.flags();\n\n if (!flags.length) return;\n\n if (post.isHidden()) this.revealContent = true;\n\n vdom.unshift(\n
\n
\n {flags.map(flag =>\n
\n {this.flagReason(flag)}\n
\n )}\n
\n
\n {this.flagActionItems().toArray()}\n
\n
\n );\n });\n\n Post.prototype.flagReason = function(flag) {\n if (flag.type() === 'user') {\n const user = flag.user();\n const reason = flag.reason();\n const detail = flag.reasonDetail();\n\n return [\n app.translator.trans(reason ? 'flarum-flags.forum.post.flagged_by_with_reason_text' : 'flarum-flags.forum.post.flagged_by_text', {user, reason}),\n detail ? {detail} : ''\n ];\n }\n };\n}\n","import addFlagsToPosts from './addFlagsToPosts';\nimport addFlagControl from './addFlagControl';\nimport addFlagsDropdown from './addFlagsDropdown';\nimport Flag from './models/Flag';\nimport FlagList from './components/FlagList';\nimport FlagPostModal from './components/FlagPostModal';\nimport FlagsPage from './components/FlagsPage';\nimport FlagsDropdown from './components/FlagsDropdown';\n\nexport default {\n 'flags/addFlagsToPosts': addFlagsToPosts,\n 'flags/addFlagControl': addFlagControl,\n 'flags/addFlagsDropdown': addFlagsDropdown,\n 'flags/models/Flag': Flag,\n 'flags/components/FlagList': FlagList,\n 'flags/components/FlagPostModal': FlagPostModal,\n 'flags/components/FlagsPage': FlagsPage,\n 'flags/components/FlagsDropdown': FlagsDropdown,\n};\n","import app from 'flarum/app';\nimport Model from 'flarum/Model';\n\nimport Flag from './models/Flag';\nimport FlagsPage from './components/FlagsPage';\nimport addFlagControl from './addFlagControl';\nimport addFlagsDropdown from './addFlagsDropdown';\nimport addFlagsToPosts from './addFlagsToPosts';\n\napp.initializers.add('flarum-flags', () => {\n app.store.models.posts.prototype.flags = Model.hasMany('flags');\n app.store.models.posts.prototype.canFlag = Model.attribute('canFlag');\n\n app.store.models.flags = Flag;\n\n app.routes.flags = {path: '/flags', component: };\n\n addFlagControl();\n addFlagsDropdown();\n addFlagsToPosts();\n});\n\n// Expose compat API\nimport flagsCompat from './compat';\nimport { compat } from '@flarum/core/forum';\n\nObject.assign(compat, flagsCompat);\n"],"sourceRoot":""} \ No newline at end of file