diff --git a/js/dist/forum.js b/js/dist/forum.js index f34c599..ef66d1e 100644 --- a/js/dist/forum.js +++ b/js/dist/forum.js @@ -1,2 +1,2 @@ -(()=>{var t={555:function(t){t.exports=function(){"use strict";var t=6e4,e=36e5,n="millisecond",s="second",r="minute",i="hour",a="day",o="week",u="month",c="quarter",l="year",d="date",f="Invalid Date",m=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,h=/\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,p={name:"en",weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_")},v=function(t,e,n){var s=String(t);return!s||s.length>=e?t:""+Array(e+1-s.length).join(n)+t},$={s:v,z:function(t){var e=-t.utcOffset(),n=Math.abs(e),s=Math.floor(n/60),r=n%60;return(e<=0?"+":"-")+v(s,2,"0")+":"+v(r,2,"0")},m:function t(e,n){if(e.date(){var e=t&&t.__esModule?()=>t.default:()=>t;return n.d(e,{a:e}),e},n.d=(t,e)=>{for(var s in e)n.o(e,s)&&!n.o(t,s)&&Object.defineProperty(t,s,{enumerable:!0,get:e[s]})},n.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),n.r=t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})};var s={};(()=>{"use strict";n.r(s);const t=flarum.core.compat.extend,e=flarum.core.compat.app;var r=n.n(e);const i=flarum.core.compat["utils/UserControls"];var a=n.n(i);const o=flarum.core.compat["components/Button"];var u=n.n(o);const c=flarum.core.compat["components/Badge"];var l=n.n(c);const d=flarum.core.compat.Model;var f=n.n(d);const h=flarum.core.compat["models/User"];var p=n.n(h);function v(t,e){return v=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t},v(t,e)}function $(t,e){t.prototype=Object.create(e.prototype),t.prototype.constructor=t,v(t,e)}const g=flarum.core.compat["forum/app"];var y=n.n(g);const M=flarum.core.compat["components/Modal"];var _=n.n(M);const S=flarum.core.compat["utils/Stream"];var b=n.n(S);const D=flarum.core.compat["utils/withAttr"];var w=n.n(D);const O=flarum.core.compat["common/utils/ItemList"];var T=n.n(O),x=n(555),U=n.n(x),N=n(911),k=n.n(N);function C(t){return U().utc(t).isSame(U().utc("2038-01-01"))}U().extend(k());var Y=function(t){function e(){return t.apply(this,arguments)||this}$(e,t);var n=e.prototype;return n.oninit=function(e){t.prototype.oninit.call(this,e);var n=this.attrs.user.suspendedUntil(),s=this.attrs.user.suspendReason(),r=this.attrs.user.suspendMessage(),i=null;new Date>n&&(n=null),n&&(i=9999===n.getFullYear()?"indefinitely":"limited"),this.status=b()(i),this.reason=b()(s),this.message=b()(r),this.daysRemaining=b()("limited"===i&&1-dayjs().diff(n,"days"))},n.className=function(){return"SuspendUserModal Modal--medium"},n.title=function(){return y().translator.trans("flarum-suspend.forum.suspend_user.title",{user:this.attrs.user})},n.content=function(){return m("div",{className:"Modal-body"},m("div",{className:"Form"},m("div",{className:"Form-group"},m("label",null,y().translator.trans("flarum-suspend.forum.suspend_user.status_heading")),m("div",null,this.formItems().toArray())),m("div",{className:"Form-group"},m(u(),{className:"Button Button--primary",loading:this.loading,type:"submit"},y().translator.trans("flarum-suspend.forum.suspend_user.submit_button")))))},n.radioItems=function(){var t=this,e=new(T());return e.add("not-suspended",m("label",{className:"checkbox"},m("input",{type:"radio",name:"status",checked:!this.status(),value:"",onclick:w()("value",this.status)}),y().translator.trans("flarum-suspend.forum.suspend_user.not_suspended_label")),100),e.add("indefinitely",m("label",{className:"checkbox"},m("input",{type:"radio",name:"status",checked:"indefinitely"===this.status(),value:"indefinitely",onclick:w()("value",this.status)}),y().translator.trans("flarum-suspend.forum.suspend_user.indefinitely_label")),90),e.add("time-suspension",m("label",{className:"checkbox SuspendUserModal-days"},m("input",{type:"radio",name:"status",checked:"limited"===this.status(),value:"limited",onclick:function(e){t.status(e.target.value),m.redraw.sync(),t.$(".SuspendUserModal-days-input input").select(),e.redraw=!1}}),y().translator.trans("flarum-suspend.forum.suspend_user.limited_time_label"),"limited"===this.status()&&m("div",{className:"SuspendUserModal-days-input"},m("input",{type:"number",min:"0",value:this.daysRemaining(),oninput:w()("value",this.daysRemaining),className:"FormControl"}),y().translator.trans("flarum-suspend.forum.suspend_user.limited_time_days_text"))),80),e},n.formItems=function(){var t=new(T());return t.add("radioItems",m("div",{className:"Form-group"},this.radioItems().toArray()),100),t.add("reason",m("div",{className:"Form-group"},m("label",null,y().translator.trans("flarum-suspend.forum.suspend_user.reason"),m("textarea",{className:"FormControl",bidi:this.reason,placeholder:y().translator.trans("flarum-suspend.forum.suspend_user.placeholder_optional"),rows:"2"}))),90),t.add("message",m("div",{className:"Form-group"},m("label",null,y().translator.trans("flarum-suspend.forum.suspend_user.display_message"),m("textarea",{className:"FormControl",bidi:this.message,placeholder:y().translator.trans("flarum-suspend.forum.suspend_user.placeholder_optional"),rows:"2"}))),80),t},n.onsubmit=function(t){var e=this;t.preventDefault(),this.loading=!0;var n=null;switch(this.status()){case"indefinitely":n=new Date("2038-01-01");break;case"limited":n=dayjs().add(this.daysRemaining(),"days").toDate()}this.attrs.user.save({suspendedUntil:n,suspendReason:this.reason(),suspendMessage:this.message()}).then((function(){return e.hide()}),this.loaded.bind(this))},e}(_());const I=flarum.core.compat["components/Notification"];var F=n.n(I),H=function(t){function e(){return t.apply(this,arguments)||this}$(e,t);var n=e.prototype;return n.icon=function(){return"fas fa-ban"},n.href=function(){return y().route.user(this.attrs.notification.subject())},n.content=function(){var t=this.attrs.notification,e=t.content(),n=dayjs(e).from(t.createdAt(),!0);return C(e)?y().translator.trans("flarum-suspend.forum.notifications.user_suspended_indefinite_text"):y().translator.trans("flarum-suspend.forum.notifications.user_suspended_text",{timeReadable:n})},e}(F()),j=function(t){function e(){return t.apply(this,arguments)||this}$(e,t);var n=e.prototype;return n.icon=function(){return"fas fa-ban"},n.href=function(){return y().route.user(this.attrs.notification.subject())},n.content=function(){return this.attrs.notification,y().translator.trans("flarum-suspend.forum.notifications.user_unsuspended_text")},e}(F());const A=flarum.core.compat["common/components/Modal"];var L=n.n(A);const W=flarum.core.compat["common/components/Button"];var B=n.n(W);const R=flarum.core.compat["common/helpers/fullTime"];var z=n.n(R),P=function(t){function e(){return t.apply(this,arguments)||this}$(e,t);var n=e.prototype;return n.oninit=function(e){t.prototype.oninit.call(this,e),this.message=this.attrs.message,this.until=this.attrs.until},n.className=function(){return"SuspensionInfoModal Modal"},n.title=function(){return y().translator.trans("flarum-suspend.forum.suspension_info.title")},n.content=function(){var t=C(new Date(this.until))?y().translator.trans("flarum-suspend.forum.suspension_info.indefinite"):y().translator.trans("flarum-suspend.forum.suspension_info.limited",{date:z()(this.until)});return m("div",{className:"Modal-body"},m("div",{className:"Form Form--centered"},m("p",{className:"helpText"},this.message),m("p",{className:"helpText"},t),m("div",{className:"Form-group"},m(B(),{className:"Button Button--primary Button--block",onclick:this.hide.bind(this)},y().translator.trans("flarum-suspend.forum.suspension_info.dismiss_button")))))},n.hide=function(){localStorage.setItem("flarum-suspend.acknowledge-suspension",this.attrs.until.getTime()),this.attrs.state.close()},e}(L());function Z(){return setTimeout((function(){if(y().session.user){var t=y().session.user.suspendMessage(),e=y().session.user.suspendedUntil(),n=localStorage.getItem("flarum-suspend.acknowledge-suspension")===(null==e?void 0:e.getTime().toString());t&&!n?y().modal.show(P,{message:t,until:e}):!e&&localStorage.getItem("flarum-suspend.acknowledge-suspension")&&localStorage.removeItem("flarum-suspend.acknowledge-suspension")}}),0)}const J={"suspend/components/suspendUserModal":Y,"suspend/components/suspensionInfoModal":P,"suspend/components/UserSuspendedNotification":H,"suspend/components/UserUnsuspendedNotification":j,"suspend/checkForSuspension":Z},V=flarum.core;r().initializers.add("flarum-suspend",(function(){r().notificationComponents.userSuspended=H,r().notificationComponents.userUnsuspended=j,p().prototype.canSuspend=f().attribute("canSuspend"),p().prototype.suspendedUntil=f().attribute("suspendedUntil",f().transformDate),p().prototype.suspendReason=f().attribute("suspendReason"),p().prototype.suspendMessage=f().attribute("suspendMessage"),(0,t.extend)(a(),"moderationControls",(function(t,e){e.canSuspend()&&t.add("suspend",u().component({icon:"fas fa-ban",onclick:function(){return r().modal.show(Y,{user:e})}},r().translator.trans("flarum-suspend.forum.user_controls.suspend_button")))})),(0,t.extend)(p().prototype,"badges",(function(t){var e=this.suspendedUntil();new Date{var t={757:function(t){t.exports=function(){"use strict";var t=6e4,e=36e5,n="millisecond",s="second",r="minute",i="hour",a="day",o="week",u="month",c="quarter",l="year",d="date",f="Invalid Date",m=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,h=/\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,p={name:"en",weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_")},v=function(t,e,n){var s=String(t);return!s||s.length>=e?t:""+Array(e+1-s.length).join(n)+t},$={s:v,z:function(t){var e=-t.utcOffset(),n=Math.abs(e),s=Math.floor(n/60),r=n%60;return(e<=0?"+":"-")+v(s,2,"0")+":"+v(r,2,"0")},m:function t(e,n){if(e.date(){var e=t&&t.__esModule?()=>t.default:()=>t;return n.d(e,{a:e}),e},n.d=(t,e)=>{for(var s in e)n.o(e,s)&&!n.o(t,s)&&Object.defineProperty(t,s,{enumerable:!0,get:e[s]})},n.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),n.r=t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})};var s={};(()=>{"use strict";n.r(s);const t=flarum.core.compat.extend,e=flarum.core.compat.app;var r=n.n(e);const i=flarum.core.compat["utils/UserControls"];var a=n.n(i);const o=flarum.core.compat["components/Button"];var u=n.n(o);const c=flarum.core.compat["components/Badge"];var l=n.n(c);const d=flarum.core.compat.Model;var f=n.n(d);const h=flarum.core.compat["models/User"];var p=n.n(h);function v(t,e){return v=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t},v(t,e)}function $(t,e){t.prototype=Object.create(e.prototype),t.prototype.constructor=t,v(t,e)}const g=flarum.core.compat["forum/app"];var y=n.n(g);const M=flarum.core.compat["components/Modal"];var _=n.n(M);const S=flarum.core.compat["utils/Stream"];var b=n.n(S);const D=flarum.core.compat["utils/withAttr"];var w=n.n(D);const O=flarum.core.compat["common/utils/ItemList"];var T=n.n(O),x=n(757),U=n.n(x),N=n(221),k=n.n(N);function C(t){return U().utc(t).isSame(U().utc("2038-01-01"))}U().extend(k());var Y=function(t){function e(){return t.apply(this,arguments)||this}$(e,t);var n=e.prototype;return n.oninit=function(e){t.prototype.oninit.call(this,e);var n=this.attrs.user.suspendedUntil(),s=this.attrs.user.suspendReason(),r=this.attrs.user.suspendMessage(),i=null;new Date>n&&(n=null),n&&(i=9999===n.getFullYear()?"indefinitely":"limited"),this.status=b()(i),this.reason=b()(s),this.message=b()(r),this.daysRemaining=b()("limited"===i&&1-dayjs().diff(n,"days"))},n.className=function(){return"SuspendUserModal Modal--medium"},n.title=function(){return y().translator.trans("flarum-suspend.forum.suspend_user.title",{user:this.attrs.user})},n.content=function(){return m("div",{className:"Modal-body"},m("div",{className:"Form"},m("div",{className:"Form-group"},m("label",null,y().translator.trans("flarum-suspend.forum.suspend_user.status_heading")),m("div",null,this.formItems().toArray())),m("div",{className:"Form-group"},m(u(),{className:"Button Button--primary",loading:this.loading,type:"submit"},y().translator.trans("flarum-suspend.forum.suspend_user.submit_button")))))},n.radioItems=function(){var t=this,e=new(T());return e.add("not-suspended",m("label",{className:"checkbox"},m("input",{type:"radio",name:"status",checked:!this.status(),value:"",onclick:w()("value",this.status)}),y().translator.trans("flarum-suspend.forum.suspend_user.not_suspended_label")),100),e.add("indefinitely",m("label",{className:"checkbox"},m("input",{type:"radio",name:"status",checked:"indefinitely"===this.status(),value:"indefinitely",onclick:w()("value",this.status)}),y().translator.trans("flarum-suspend.forum.suspend_user.indefinitely_label")),90),e.add("time-suspension",m("label",{className:"checkbox SuspendUserModal-days"},m("input",{type:"radio",name:"status",checked:"limited"===this.status(),value:"limited",onclick:function(e){t.status(e.target.value),m.redraw.sync(),t.$(".SuspendUserModal-days-input input").select(),e.redraw=!1}}),y().translator.trans("flarum-suspend.forum.suspend_user.limited_time_label"),"limited"===this.status()&&m("div",{className:"SuspendUserModal-days-input"},m("input",{type:"number",min:"0",value:this.daysRemaining(),oninput:w()("value",this.daysRemaining),className:"FormControl"}),y().translator.trans("flarum-suspend.forum.suspend_user.limited_time_days_text"))),80),e},n.formItems=function(){var t=new(T());return t.add("radioItems",m("div",{className:"Form-group"},this.radioItems().toArray()),100),t.add("reason",m("div",{className:"Form-group"},m("label",null,y().translator.trans("flarum-suspend.forum.suspend_user.reason"),m("textarea",{className:"FormControl",bidi:this.reason,placeholder:y().translator.trans("flarum-suspend.forum.suspend_user.placeholder_optional"),rows:"2"}))),90),t.add("message",m("div",{className:"Form-group"},m("label",null,y().translator.trans("flarum-suspend.forum.suspend_user.display_message"),m("textarea",{className:"FormControl",bidi:this.message,placeholder:y().translator.trans("flarum-suspend.forum.suspend_user.placeholder_optional"),rows:"2"}))),80),t},n.onsubmit=function(t){var e=this;t.preventDefault(),this.loading=!0;var n=null;switch(this.status()){case"indefinitely":n=new Date("2038-01-01");break;case"limited":n=dayjs().add(this.daysRemaining(),"days").toDate()}this.attrs.user.save({suspendedUntil:n,suspendReason:this.reason(),suspendMessage:this.message()}).then((function(){return e.hide()}),this.loaded.bind(this))},e}(_());const I=flarum.core.compat["components/Notification"];var F=n.n(I),H=function(t){function e(){return t.apply(this,arguments)||this}$(e,t);var n=e.prototype;return n.icon=function(){return"fas fa-ban"},n.href=function(){return y().route.user(this.attrs.notification.subject())},n.content=function(){var t=this.attrs.notification,e=t.content(),n=dayjs(e).from(t.createdAt(),!0);return C(e)?y().translator.trans("flarum-suspend.forum.notifications.user_suspended_indefinite_text"):y().translator.trans("flarum-suspend.forum.notifications.user_suspended_text",{timeReadable:n})},e}(F()),j=function(t){function e(){return t.apply(this,arguments)||this}$(e,t);var n=e.prototype;return n.icon=function(){return"fas fa-ban"},n.href=function(){return y().route.user(this.attrs.notification.subject())},n.content=function(){return this.attrs.notification,y().translator.trans("flarum-suspend.forum.notifications.user_unsuspended_text")},e}(F());const A=flarum.core.compat["common/components/Modal"];var L=n.n(A);const W=flarum.core.compat["common/components/Button"];var B=n.n(W);const R=flarum.core.compat["common/helpers/fullTime"];var z=n.n(R),P=function(t){function e(){return t.apply(this,arguments)||this}$(e,t);var n=e.prototype;return n.oninit=function(e){t.prototype.oninit.call(this,e),this.message=this.attrs.message,this.until=this.attrs.until},n.className=function(){return"SuspensionInfoModal Modal"},n.title=function(){return y().translator.trans("flarum-suspend.forum.suspension_info.title")},n.content=function(){var t=C(new Date(this.until))?y().translator.trans("flarum-suspend.forum.suspension_info.indefinite"):y().translator.trans("flarum-suspend.forum.suspension_info.limited",{date:z()(this.until)});return m("div",{className:"Modal-body"},m("div",{className:"Form Form--centered"},m("p",{className:"helpText"},this.message),m("p",{className:"helpText"},t),m("div",{className:"Form-group"},m(B(),{className:"Button Button--primary Button--block",onclick:this.hide.bind(this)},y().translator.trans("flarum-suspend.forum.suspension_info.dismiss_button")))))},n.hide=function(){localStorage.setItem("flarum-suspend.acknowledge-suspension",this.attrs.until.getTime()),this.attrs.state.close()},e}(L());function Z(){return setTimeout((function(){if(y().session.user){var t=y().session.user.suspendMessage(),e=y().session.user.suspendedUntil(),n=localStorage.getItem("flarum-suspend.acknowledge-suspension")===(null==e?void 0:e.getTime().toString());t&&!n?y().modal.show(P,{message:t,until:e}):!e&&localStorage.getItem("flarum-suspend.acknowledge-suspension")&&localStorage.removeItem("flarum-suspend.acknowledge-suspension")}}),0)}const J={"suspend/components/suspendUserModal":Y,"suspend/components/suspensionInfoModal":P,"suspend/components/UserSuspendedNotification":H,"suspend/components/UserUnsuspendedNotification":j,"suspend/checkForSuspension":Z},V=flarum.core;r().initializers.add("flarum-suspend",(function(){r().notificationComponents.userSuspended=H,r().notificationComponents.userUnsuspended=j,p().prototype.canSuspend=f().attribute("canSuspend"),p().prototype.suspendedUntil=f().attribute("suspendedUntil",f().transformDate),p().prototype.suspendReason=f().attribute("suspendReason"),p().prototype.suspendMessage=f().attribute("suspendMessage"),(0,t.extend)(a(),"moderationControls",(function(t,e){e.canSuspend()&&t.add("suspend",u().component({icon:"fas fa-ban",onclick:function(){return r().modal.show(Y,{user:e})}},r().translator.trans("flarum-suspend.forum.user_controls.suspend_button")))})),(0,t.extend)(p().prototype,"badges",(function(t){var e=this.suspendedUntil();new Date=e?t:\"\"+Array(e+1-r.length).join(n)+t},g={s:m,z:function(t){var e=-t.utcOffset(),n=Math.abs(e),r=Math.floor(n/60),i=n%60;return(e<=0?\"+\":\"-\")+m(r,2,\"0\")+\":\"+m(i,2,\"0\")},m:function t(e,n){if(e.date() {\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['extend'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['app'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['utils/UserControls'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['components/Button'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['components/Badge'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['Model'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['models/User'];","export default function _setPrototypeOf(o, p) {\n _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) {\n o.__proto__ = p;\n return o;\n };\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['forum/app'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['components/Modal'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['utils/Stream'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['utils/withAttr'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/utils/ItemList'];","import dayjs from 'dayjs';\nimport utc from 'dayjs/plugin/utc';\n\ndayjs.extend(utc);\n\nexport function getPermanentSuspensionDate(): Date {\n return new Date('2038-01-01');\n}\n\nexport function isPermanentSuspensionDate(date: Date): boolean {\n return dayjs.utc(date).isSame(dayjs.utc('2038-01-01'));\n}\n\nexport function localStorageKey(): string {\n return 'flarum-suspend.acknowledge-suspension';\n}\n","import app from 'flarum/forum/app';\nimport Modal from 'flarum/components/Modal';\nimport Button from 'flarum/components/Button';\n\nimport Stream from 'flarum/utils/Stream';\nimport withAttr from 'flarum/utils/withAttr';\nimport ItemList from 'flarum/common/utils/ItemList';\nimport { getPermanentSuspensionDate } from '../helpers/suspensionHelper';\n\nexport default class SuspendUserModal extends Modal {\n oninit(vnode) {\n super.oninit(vnode);\n\n let until = this.attrs.user.suspendedUntil();\n const reason = this.attrs.user.suspendReason();\n const message = this.attrs.user.suspendMessage();\n let status = null;\n\n if (new Date() > until) until = null;\n\n if (until) {\n if (until.getFullYear() === 9999) status = 'indefinitely';\n else status = 'limited';\n }\n\n this.status = Stream(status);\n this.reason = Stream(reason);\n this.message = Stream(message);\n this.daysRemaining = Stream(status === 'limited' && -dayjs().diff(until, 'days') + 1);\n }\n\n className() {\n return 'SuspendUserModal Modal--medium';\n }\n\n title() {\n return app.translator.trans('flarum-suspend.forum.suspend_user.title', { user: this.attrs.user });\n }\n\n content() {\n return (\n
\n
\n
\n \n
{this.formItems().toArray()}
\n
\n\n
\n \n
\n
\n
\n );\n }\n\n radioItems() {\n const items = new ItemList();\n\n items.add(\n 'not-suspended',\n ,\n 100\n );\n\n items.add(\n 'indefinitely',\n ,\n 90\n );\n\n items.add(\n 'time-suspension',\n ,\n 80\n );\n\n return items;\n }\n\n formItems() {\n const items = new ItemList();\n\n items.add('radioItems',
{this.radioItems().toArray()}
, 100);\n\n items.add(\n 'reason',\n
\n \n
,\n 90\n );\n\n items.add(\n 'message',\n
\n \n
,\n 80\n );\n\n return items;\n }\n\n onsubmit(e) {\n e.preventDefault();\n\n this.loading = true;\n\n let suspendedUntil = null;\n switch (this.status()) {\n case 'indefinitely':\n suspendedUntil = getPermanentSuspensionDate();\n break;\n\n case 'limited':\n suspendedUntil = dayjs().add(this.daysRemaining(), 'days').toDate();\n break;\n\n default:\n // no default\n }\n\n this.attrs.user\n .save({ suspendedUntil, suspendReason: this.reason(), suspendMessage: this.message() })\n .then(() => this.hide(), this.loaded.bind(this));\n }\n}\n","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['components/Notification'];","import app from 'flarum/forum/app';\nimport Notification from 'flarum/components/Notification';\nimport { isPermanentSuspensionDate } from '../helpers/suspensionHelper';\n\nexport default class UserSuspendedNotification extends Notification {\n icon() {\n return 'fas fa-ban';\n }\n\n href() {\n return app.route.user(this.attrs.notification.subject());\n }\n\n content() {\n const notification = this.attrs.notification;\n const suspendedUntil = notification.content();\n const timeReadable = dayjs(suspendedUntil).from(notification.createdAt(), true);\n\n return isPermanentSuspensionDate(suspendedUntil)\n ? app.translator.trans('flarum-suspend.forum.notifications.user_suspended_indefinite_text')\n : app.translator.trans('flarum-suspend.forum.notifications.user_suspended_text', {\n timeReadable,\n });\n }\n}\n","import app from 'flarum/forum/app';\nimport Notification from 'flarum/components/Notification';\n\nexport default class UserUnsuspendedNotification extends Notification {\n icon() {\n return 'fas fa-ban';\n }\n\n href() {\n return app.route.user(this.attrs.notification.subject());\n }\n\n content() {\n const notification = this.attrs.notification;\n\n return app.translator.trans('flarum-suspend.forum.notifications.user_unsuspended_text');\n }\n}\n","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/components/Modal'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/components/Button'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/helpers/fullTime'];","import app from 'flarum/forum/app';\nimport Modal from 'flarum/common/components/Modal';\nimport Button from 'flarum/common/components/Button';\nimport fullTime from 'flarum/common/helpers/fullTime';\nimport { isPermanentSuspensionDate, localStorageKey } from '../helpers/suspensionHelper';\n\nexport default class SuspensionInfoModal extends Modal {\n oninit(vnode) {\n super.oninit(vnode);\n\n this.message = this.attrs.message;\n this.until = this.attrs.until;\n }\n\n className() {\n return 'SuspensionInfoModal Modal';\n }\n\n title() {\n return app.translator.trans('flarum-suspend.forum.suspension_info.title');\n }\n\n content() {\n const timespan = isPermanentSuspensionDate(new Date(this.until))\n ? app.translator.trans('flarum-suspend.forum.suspension_info.indefinite')\n : app.translator.trans('flarum-suspend.forum.suspension_info.limited', { date: fullTime(this.until) });\n\n return (\n
\n
\n

{this.message}

\n

{timespan}

\n\n
\n \n
\n
\n
\n );\n }\n\n hide() {\n localStorage.setItem(localStorageKey(), this.attrs.until.getTime());\n this.attrs.state.close();\n }\n}\n","import app from 'flarum/forum/app';\nimport SuspensionInfoModal from './components/SuspensionInfoModal';\nimport { localStorageKey } from './helpers/suspensionHelper';\n\nexport default function () {\n return setTimeout(() => {\n if (app.session.user) {\n const message = app.session.user.suspendMessage();\n const until = app.session.user.suspendedUntil();\n const alreadyDisplayed = localStorage.getItem(localStorageKey()) === until?.getTime().toString();\n\n if (message && !alreadyDisplayed) {\n app.modal.show(SuspensionInfoModal, { message, until });\n } else if (!until && localStorage.getItem(localStorageKey())) {\n localStorage.removeItem(localStorageKey());\n }\n }\n }, 0);\n}\n","import SuspendUserModal from './components/SuspendUserModal';\nimport SuspensionInfoModal from './components/SuspensionInfoModal';\nimport UserSuspendedNotification from './components/UserSuspendedNotification';\nimport UserUnsuspendedNotification from './components/UserUnsuspendedNotification';\nimport checkForSuspension from './checkForSuspension';\n\nexport default {\n 'suspend/components/suspendUserModal': SuspendUserModal,\n 'suspend/components/suspensionInfoModal': SuspensionInfoModal,\n 'suspend/components/UserSuspendedNotification': UserSuspendedNotification,\n 'suspend/components/UserUnsuspendedNotification': UserUnsuspendedNotification,\n 'suspend/checkForSuspension': checkForSuspension,\n};\n","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core;","import { extend } from 'flarum/extend';\nimport app from 'flarum/app';\nimport UserControls from 'flarum/utils/UserControls';\nimport Button from 'flarum/components/Button';\nimport Badge from 'flarum/components/Badge';\nimport Model from 'flarum/Model';\nimport User from 'flarum/models/User';\n\nimport SuspendUserModal from './components/SuspendUserModal';\nimport UserSuspendedNotification from './components/UserSuspendedNotification';\nimport UserUnsuspendedNotification from './components/UserUnsuspendedNotification';\nimport checkForSuspension from './checkForSuspension';\n\napp.initializers.add('flarum-suspend', () => {\n app.notificationComponents.userSuspended = UserSuspendedNotification;\n app.notificationComponents.userUnsuspended = UserUnsuspendedNotification;\n\n User.prototype.canSuspend = Model.attribute('canSuspend');\n User.prototype.suspendedUntil = Model.attribute('suspendedUntil', Model.transformDate);\n User.prototype.suspendReason = Model.attribute('suspendReason');\n User.prototype.suspendMessage = Model.attribute('suspendMessage');\n\n extend(UserControls, 'moderationControls', (items, user) => {\n if (user.canSuspend()) {\n items.add(\n 'suspend',\n Button.component(\n {\n icon: 'fas fa-ban',\n onclick: () => app.modal.show(SuspendUserModal, { user }),\n },\n app.translator.trans('flarum-suspend.forum.user_controls.suspend_button')\n )\n );\n }\n });\n\n extend(User.prototype, 'badges', function (items) {\n const until = this.suspendedUntil();\n\n if (new Date() < until) {\n items.add(\n 'suspended',\n Badge.component({\n icon: 'fas fa-ban',\n type: 'suspended',\n label: app.translator.trans('flarum-suspend.forum.user_badge.suspended_tooltip'),\n })\n );\n }\n });\n\n checkForSuspension();\n});\n\n// Expose compat API\nimport suspendCompat from './compat';\nimport { compat } from '@flarum/core/forum';\n\nObject.assign(compat, suspendCompat);\n"],"names":["module","exports","e","n","r","i","s","u","a","o","f","h","c","d","$","l","y","M","name","weekdays","split","months","m","t","String","length","Array","join","g","z","utcOffset","Math","abs","floor","date","year","month","clone","add","ceil","p","w","D","ms","Q","toLowerCase","replace","v","_","S","args","arguments","O","locale","$L","utc","$u","x","$x","$offset","this","parse","prototype","$d","Date","NaN","test","match","substring","UTC","init","$y","getFullYear","$M","getMonth","$D","getDate","$W","getDay","$H","getHours","$m","getMinutes","$s","getSeconds","$ms","getMilliseconds","$utils","isValid","toString","isSame","startOf","endOf","isAfter","isBefore","$g","set","unix","valueOf","getTime","toDate","apply","slice","$locale","weekStart","$set","min","daysInMonth","get","Number","round","subtract","format","invalidDate","substr","meridiem","YY","YYYY","MM","MMM","monthsShort","MMMM","DD","dd","weekdaysMin","ddd","weekdaysShort","dddd","H","HH","hh","A","mm","ss","SSS","Z","getTimezoneOffset","diff","toJSON","toISOString","toUTCString","b","forEach","extend","$i","isDayjs","en","Ls","local","call","getUTCFullYear","getUTCMonth","getUTCDate","getUTCDay","getUTCHours","getUTCMinutes","getUTCSeconds","getUTCMilliseconds","$localOffset","isUTC","__webpack_module_cache__","__webpack_require__","moduleId","cachedModule","undefined","__webpack_modules__","getter","__esModule","definition","key","Object","defineProperty","enumerable","obj","prop","hasOwnProperty","Symbol","toStringTag","value","flarum","core","compat","_setPrototypeOf","setPrototypeOf","__proto__","_inheritsLoose","subClass","superClass","create","constructor","isPermanentSuspensionDate","dayjs","SuspendUserModal","oninit","vnode","until","attrs","user","suspendedUntil","reason","suspendReason","message","suspendMessage","status","Stream","daysRemaining","className","title","app","content","formItems","toArray","loading","type","radioItems","items","ItemList","checked","onclick","withAttr","target","redraw","sync","select","oninput","bidi","placeholder","rows","onsubmit","preventDefault","save","then","hide","loaded","bind","Modal","UserSuspendedNotification","icon","href","notification","subject","timeReadable","from","createdAt","Notification","UserUnsuspendedNotification","SuspensionInfoModal","timespan","fullTime","localStorage","setItem","state","close","setTimeout","alreadyDisplayed","getItem","removeItem","checkForSuspension","User","Model","UserControls","canSuspend","Button","Badge","label","assign","suspendCompat"],"sourceRoot":""} \ No newline at end of file +{"version":3,"file":"forum.js","mappings":"6BAAoEA,EAAOC,QAAmI,WAAW,aAAa,IAAUC,EAAE,IAAIC,EAAE,KAAKC,EAAE,cAAcC,EAAE,SAASC,EAAE,SAASC,EAAE,OAAOC,EAAE,MAAMC,EAAE,OAAOC,EAAE,QAAQC,EAAE,UAAUC,EAAE,OAAOC,EAAE,OAAOC,EAAE,eAAeC,EAAE,6FAA6FC,EAAE,sFAAsFC,EAAE,CAACC,KAAK,KAAKC,SAAS,2DAA2DC,MAAM,KAAKC,OAAO,wFAAwFD,MAAM,MAAME,EAAE,SAASC,EAAErB,EAAEC,GAAG,IAAIC,EAAEoB,OAAOD,GAAG,OAAOnB,GAAGA,EAAEqB,QAAQvB,EAAEqB,E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AOpF,EAAAA,OAAQqF,I","sources":["webpack://@flarum/suspend/../../../node_modules/dayjs/dayjs.min.js","webpack://@flarum/suspend/../../../node_modules/dayjs/plugin/utc.js","webpack://@flarum/suspend/webpack/bootstrap","webpack://@flarum/suspend/webpack/runtime/compat get default export","webpack://@flarum/suspend/webpack/runtime/define property getters","webpack://@flarum/suspend/webpack/runtime/hasOwnProperty shorthand","webpack://@flarum/suspend/webpack/runtime/make namespace object","webpack://@flarum/suspend/external root \"flarum.core.compat['extend']\"","webpack://@flarum/suspend/external root \"flarum.core.compat['app']\"","webpack://@flarum/suspend/external root \"flarum.core.compat['utils/UserControls']\"","webpack://@flarum/suspend/external root \"flarum.core.compat['components/Button']\"","webpack://@flarum/suspend/external root \"flarum.core.compat['components/Badge']\"","webpack://@flarum/suspend/external root \"flarum.core.compat['Model']\"","webpack://@flarum/suspend/external root \"flarum.core.compat['models/User']\"","webpack://@flarum/suspend/../../../node_modules/@babel/runtime/helpers/esm/setPrototypeOf.js","webpack://@flarum/suspend/../../../node_modules/@babel/runtime/helpers/esm/inheritsLoose.js","webpack://@flarum/suspend/external root \"flarum.core.compat['forum/app']\"","webpack://@flarum/suspend/external root \"flarum.core.compat['components/Modal']\"","webpack://@flarum/suspend/external root \"flarum.core.compat['utils/Stream']\"","webpack://@flarum/suspend/external root \"flarum.core.compat['utils/withAttr']\"","webpack://@flarum/suspend/external root \"flarum.core.compat['common/utils/ItemList']\"","webpack://@flarum/suspend/./src/forum/helpers/suspensionHelper.ts","webpack://@flarum/suspend/./src/forum/components/SuspendUserModal.js","webpack://@flarum/suspend/external root \"flarum.core.compat['components/Notification']\"","webpack://@flarum/suspend/./src/forum/components/UserSuspendedNotification.js","webpack://@flarum/suspend/./src/forum/components/UserUnsuspendedNotification.js","webpack://@flarum/suspend/external root \"flarum.core.compat['common/components/Modal']\"","webpack://@flarum/suspend/external root \"flarum.core.compat['common/components/Button']\"","webpack://@flarum/suspend/external root \"flarum.core.compat['common/helpers/fullTime']\"","webpack://@flarum/suspend/./src/forum/components/SuspensionInfoModal.js","webpack://@flarum/suspend/./src/forum/checkForSuspension.js","webpack://@flarum/suspend/./src/forum/compat.js","webpack://@flarum/suspend/external assign \"flarum.core\"","webpack://@flarum/suspend/./src/forum/index.js"],"sourcesContent":["!function(t,e){\"object\"==typeof exports&&\"undefined\"!=typeof module?module.exports=e():\"function\"==typeof define&&define.amd?define(e):(t=\"undefined\"!=typeof globalThis?globalThis:t||self).dayjs=e()}(this,(function(){\"use strict\";var t=1e3,e=6e4,n=36e5,r=\"millisecond\",i=\"second\",s=\"minute\",u=\"hour\",a=\"day\",o=\"week\",f=\"month\",h=\"quarter\",c=\"year\",d=\"date\",$=\"Invalid Date\",l=/^(\\d{4})[-/]?(\\d{1,2})?[-/]?(\\d{0,2})[Tt\\s]*(\\d{1,2})?:?(\\d{1,2})?:?(\\d{1,2})?[.:]?(\\d+)?$/,y=/\\[([^\\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,M={name:\"en\",weekdays:\"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday\".split(\"_\"),months:\"January_February_March_April_May_June_July_August_September_October_November_December\".split(\"_\")},m=function(t,e,n){var r=String(t);return!r||r.length>=e?t:\"\"+Array(e+1-r.length).join(n)+t},g={s:m,z:function(t){var e=-t.utcOffset(),n=Math.abs(e),r=Math.floor(n/60),i=n%60;return(e<=0?\"+\":\"-\")+m(r,2,\"0\")+\":\"+m(i,2,\"0\")},m:function t(e,n){if(e.date() {\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['extend'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['app'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['utils/UserControls'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['components/Button'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['components/Badge'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['Model'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['models/User'];","export default function _setPrototypeOf(o, p) {\n _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) {\n o.__proto__ = p;\n return o;\n };\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['forum/app'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['components/Modal'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['utils/Stream'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['utils/withAttr'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/utils/ItemList'];","import dayjs from 'dayjs';\nimport utc from 'dayjs/plugin/utc';\n\ndayjs.extend(utc);\n\nexport function getPermanentSuspensionDate(): Date {\n return new Date('2038-01-01');\n}\n\nexport function isPermanentSuspensionDate(date: Date): boolean {\n return dayjs.utc(date).isSame(dayjs.utc('2038-01-01'));\n}\n\nexport function localStorageKey(): string {\n return 'flarum-suspend.acknowledge-suspension';\n}\n","import app from 'flarum/forum/app';\nimport Modal from 'flarum/components/Modal';\nimport Button from 'flarum/components/Button';\n\nimport Stream from 'flarum/utils/Stream';\nimport withAttr from 'flarum/utils/withAttr';\nimport ItemList from 'flarum/common/utils/ItemList';\nimport { getPermanentSuspensionDate } from '../helpers/suspensionHelper';\n\nexport default class SuspendUserModal extends Modal {\n oninit(vnode) {\n super.oninit(vnode);\n\n let until = this.attrs.user.suspendedUntil();\n const reason = this.attrs.user.suspendReason();\n const message = this.attrs.user.suspendMessage();\n let status = null;\n\n if (new Date() > until) until = null;\n\n if (until) {\n if (until.getFullYear() === 9999) status = 'indefinitely';\n else status = 'limited';\n }\n\n this.status = Stream(status);\n this.reason = Stream(reason);\n this.message = Stream(message);\n this.daysRemaining = Stream(status === 'limited' && -dayjs().diff(until, 'days') + 1);\n }\n\n className() {\n return 'SuspendUserModal Modal--medium';\n }\n\n title() {\n return app.translator.trans('flarum-suspend.forum.suspend_user.title', { user: this.attrs.user });\n }\n\n content() {\n return (\n
\n
\n
\n \n
{this.formItems().toArray()}
\n
\n\n
\n \n
\n
\n
\n );\n }\n\n radioItems() {\n const items = new ItemList();\n\n items.add(\n 'not-suspended',\n ,\n 100\n );\n\n items.add(\n 'indefinitely',\n ,\n 90\n );\n\n items.add(\n 'time-suspension',\n ,\n 80\n );\n\n return items;\n }\n\n formItems() {\n const items = new ItemList();\n\n items.add('radioItems',
{this.radioItems().toArray()}
, 100);\n\n items.add(\n 'reason',\n
\n \n
,\n 90\n );\n\n items.add(\n 'message',\n
\n \n
,\n 80\n );\n\n return items;\n }\n\n onsubmit(e) {\n e.preventDefault();\n\n this.loading = true;\n\n let suspendedUntil = null;\n switch (this.status()) {\n case 'indefinitely':\n suspendedUntil = getPermanentSuspensionDate();\n break;\n\n case 'limited':\n suspendedUntil = dayjs().add(this.daysRemaining(), 'days').toDate();\n break;\n\n default:\n // no default\n }\n\n this.attrs.user\n .save({ suspendedUntil, suspendReason: this.reason(), suspendMessage: this.message() })\n .then(() => this.hide(), this.loaded.bind(this));\n }\n}\n","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['components/Notification'];","import app from 'flarum/forum/app';\nimport Notification from 'flarum/components/Notification';\nimport { isPermanentSuspensionDate } from '../helpers/suspensionHelper';\n\nexport default class UserSuspendedNotification extends Notification {\n icon() {\n return 'fas fa-ban';\n }\n\n href() {\n return app.route.user(this.attrs.notification.subject());\n }\n\n content() {\n const notification = this.attrs.notification;\n const suspendedUntil = notification.content();\n const timeReadable = dayjs(suspendedUntil).from(notification.createdAt(), true);\n\n return isPermanentSuspensionDate(suspendedUntil)\n ? app.translator.trans('flarum-suspend.forum.notifications.user_suspended_indefinite_text')\n : app.translator.trans('flarum-suspend.forum.notifications.user_suspended_text', {\n timeReadable,\n });\n }\n}\n","import app from 'flarum/forum/app';\nimport Notification from 'flarum/components/Notification';\n\nexport default class UserUnsuspendedNotification extends Notification {\n icon() {\n return 'fas fa-ban';\n }\n\n href() {\n return app.route.user(this.attrs.notification.subject());\n }\n\n content() {\n const notification = this.attrs.notification;\n\n return app.translator.trans('flarum-suspend.forum.notifications.user_unsuspended_text');\n }\n}\n","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/components/Modal'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/components/Button'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/helpers/fullTime'];","import app from 'flarum/forum/app';\nimport Modal from 'flarum/common/components/Modal';\nimport Button from 'flarum/common/components/Button';\nimport fullTime from 'flarum/common/helpers/fullTime';\nimport { isPermanentSuspensionDate, localStorageKey } from '../helpers/suspensionHelper';\n\nexport default class SuspensionInfoModal extends Modal {\n oninit(vnode) {\n super.oninit(vnode);\n\n this.message = this.attrs.message;\n this.until = this.attrs.until;\n }\n\n className() {\n return 'SuspensionInfoModal Modal';\n }\n\n title() {\n return app.translator.trans('flarum-suspend.forum.suspension_info.title');\n }\n\n content() {\n const timespan = isPermanentSuspensionDate(new Date(this.until))\n ? app.translator.trans('flarum-suspend.forum.suspension_info.indefinite')\n : app.translator.trans('flarum-suspend.forum.suspension_info.limited', { date: fullTime(this.until) });\n\n return (\n
\n
\n

{this.message}

\n

{timespan}

\n\n
\n \n
\n
\n
\n );\n }\n\n hide() {\n localStorage.setItem(localStorageKey(), this.attrs.until.getTime());\n this.attrs.state.close();\n }\n}\n","import app from 'flarum/forum/app';\nimport SuspensionInfoModal from './components/SuspensionInfoModal';\nimport { localStorageKey } from './helpers/suspensionHelper';\n\nexport default function () {\n return setTimeout(() => {\n if (app.session.user) {\n const message = app.session.user.suspendMessage();\n const until = app.session.user.suspendedUntil();\n const alreadyDisplayed = localStorage.getItem(localStorageKey()) === until?.getTime().toString();\n\n if (message && !alreadyDisplayed) {\n app.modal.show(SuspensionInfoModal, { message, until });\n } else if (!until && localStorage.getItem(localStorageKey())) {\n localStorage.removeItem(localStorageKey());\n }\n }\n }, 0);\n}\n","import SuspendUserModal from './components/SuspendUserModal';\nimport SuspensionInfoModal from './components/SuspensionInfoModal';\nimport UserSuspendedNotification from './components/UserSuspendedNotification';\nimport UserUnsuspendedNotification from './components/UserUnsuspendedNotification';\nimport checkForSuspension from './checkForSuspension';\n\nexport default {\n 'suspend/components/suspendUserModal': SuspendUserModal,\n 'suspend/components/suspensionInfoModal': SuspensionInfoModal,\n 'suspend/components/UserSuspendedNotification': UserSuspendedNotification,\n 'suspend/components/UserUnsuspendedNotification': UserUnsuspendedNotification,\n 'suspend/checkForSuspension': checkForSuspension,\n};\n","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core;","import { extend } from 'flarum/extend';\nimport app from 'flarum/app';\nimport UserControls from 'flarum/utils/UserControls';\nimport Button from 'flarum/components/Button';\nimport Badge from 'flarum/components/Badge';\nimport Model from 'flarum/Model';\nimport User from 'flarum/models/User';\n\nimport SuspendUserModal from './components/SuspendUserModal';\nimport UserSuspendedNotification from './components/UserSuspendedNotification';\nimport UserUnsuspendedNotification from './components/UserUnsuspendedNotification';\nimport checkForSuspension from './checkForSuspension';\n\napp.initializers.add('flarum-suspend', () => {\n app.notificationComponents.userSuspended = UserSuspendedNotification;\n app.notificationComponents.userUnsuspended = UserUnsuspendedNotification;\n\n User.prototype.canSuspend = Model.attribute('canSuspend');\n User.prototype.suspendedUntil = Model.attribute('suspendedUntil', Model.transformDate);\n User.prototype.suspendReason = Model.attribute('suspendReason');\n User.prototype.suspendMessage = Model.attribute('suspendMessage');\n\n extend(UserControls, 'moderationControls', (items, user) => {\n if (user.canSuspend()) {\n items.add(\n 'suspend',\n Button.component(\n {\n icon: 'fas fa-ban',\n onclick: () => app.modal.show(SuspendUserModal, { user }),\n },\n app.translator.trans('flarum-suspend.forum.user_controls.suspend_button')\n )\n );\n }\n });\n\n extend(User.prototype, 'badges', function (items) {\n const until = this.suspendedUntil();\n\n if (new Date() < until) {\n items.add(\n 'suspended',\n Badge.component({\n icon: 'fas fa-ban',\n type: 'suspended',\n label: app.translator.trans('flarum-suspend.forum.user_badge.suspended_tooltip'),\n })\n );\n }\n });\n\n checkForSuspension();\n});\n\n// Expose compat API\nimport suspendCompat from './compat';\nimport { compat } from '@flarum/core/forum';\n\nObject.assign(compat, suspendCompat);\n"],"names":["module","exports","e","n","r","i","s","u","a","o","f","h","c","d","$","l","y","M","name","weekdays","split","months","m","t","String","length","Array","join","g","z","utcOffset","Math","abs","floor","date","year","month","clone","add","ceil","p","w","D","ms","Q","toLowerCase","replace","v","_","S","args","arguments","O","locale","$L","utc","$u","x","$x","$offset","this","parse","prototype","$d","Date","NaN","test","match","substring","UTC","init","$y","getFullYear","$M","getMonth","$D","getDate","$W","getDay","$H","getHours","$m","getMinutes","$s","getSeconds","$ms","getMilliseconds","$utils","isValid","toString","isSame","startOf","endOf","isAfter","isBefore","$g","set","unix","valueOf","getTime","toDate","apply","slice","$locale","weekStart","$set","min","daysInMonth","get","Number","round","subtract","format","invalidDate","substr","meridiem","YY","YYYY","MM","MMM","monthsShort","MMMM","DD","dd","weekdaysMin","ddd","weekdaysShort","dddd","H","HH","hh","A","mm","ss","SSS","Z","getTimezoneOffset","diff","toJSON","toISOString","toUTCString","b","forEach","extend","$i","isDayjs","en","Ls","local","call","getUTCFullYear","getUTCMonth","getUTCDate","getUTCDay","getUTCHours","getUTCMinutes","getUTCSeconds","getUTCMilliseconds","$localOffset","isUTC","__webpack_module_cache__","__webpack_require__","moduleId","cachedModule","undefined","__webpack_modules__","getter","__esModule","definition","key","Object","defineProperty","enumerable","obj","prop","hasOwnProperty","Symbol","toStringTag","value","flarum","core","compat","_setPrototypeOf","setPrototypeOf","__proto__","_inheritsLoose","subClass","superClass","create","constructor","isPermanentSuspensionDate","dayjs","SuspendUserModal","oninit","vnode","until","attrs","user","suspendedUntil","reason","suspendReason","message","suspendMessage","status","Stream","daysRemaining","className","title","app","content","formItems","toArray","loading","type","radioItems","items","ItemList","checked","onclick","withAttr","target","redraw","sync","select","oninput","bidi","placeholder","rows","onsubmit","preventDefault","save","then","hide","loaded","bind","Modal","UserSuspendedNotification","icon","href","notification","subject","timeReadable","from","createdAt","Notification","UserUnsuspendedNotification","SuspensionInfoModal","timespan","fullTime","localStorage","setItem","state","close","setTimeout","alreadyDisplayed","getItem","removeItem","checkForSuspension","User","Model","UserControls","canSuspend","Button","Badge","label","assign","suspendCompat"],"sourceRoot":""} \ No newline at end of file