pleroma/priv/static/adminfe/static/js/chunk-06de.ff4586ab.js
2020-02-11 10:24:38 -06:00

2 lines
33 KiB
JavaScript

(window.webpackJsonp=window.webpackJsonp||[]).push([["chunk-06de"],{"/Z02":function(e,t,s){},"53Av":function(e,t,s){"use strict";var r=s("lOBV");s.n(r).a},"6eCR":function(e,t,s){"use strict";var r=s("Jdpf");s.n(r).a},"9/5/":function(e,t,s){(function(t){var s="Expected a function",r=NaN,n="[object Symbol]",i=/^\s+|\s+$/g,a=/^[-+]0x[0-9a-f]+$/i,o=/^0b[01]+$/i,u=/^0o[0-7]+$/i,c=parseInt,l="object"==typeof t&&t&&t.Object===Object&&t,d="object"==typeof self&&self&&self.Object===Object&&self,p=l||d||Function("return this")(),v=Object.prototype.toString,f=Math.max,m=Math.min,_=function(){return p.Date.now()};function h(e){var t=typeof e;return!!e&&("object"==t||"function"==t)}function g(e){if("number"==typeof e)return e;if(function(e){return"symbol"==typeof e||function(e){return!!e&&"object"==typeof e}(e)&&v.call(e)==n}(e))return r;if(h(e)){var t="function"==typeof e.valueOf?e.valueOf():e;e=h(t)?t+"":t}if("string"!=typeof e)return 0===e?e:+e;e=e.replace(i,"");var s=o.test(e);return s||u.test(e)?c(e.slice(2),s?2:8):a.test(e)?r:+e}e.exports=function(e,t,r){var n,i,a,o,u,c,l=0,d=!1,p=!1,v=!0;if("function"!=typeof e)throw new TypeError(s);function w(t){var s=n,r=i;return n=i=void 0,l=t,o=e.apply(r,s)}function $(e){var s=e-c;return void 0===c||s>=t||s<0||p&&e-l>=a}function b(){var e=_();if($(e))return k(e);u=setTimeout(b,function(e){var s=t-(e-c);return p?m(s,a-(e-l)):s}(e))}function k(e){return u=void 0,v&&n?w(e):(n=i=void 0,o)}function U(){var e=_(),s=$(e);if(n=arguments,i=this,c=e,s){if(void 0===u)return function(e){return l=e,u=setTimeout(b,t),d?w(e):o}(c);if(p)return u=setTimeout(b,t),w(c)}return void 0===u&&(u=setTimeout(b,t)),o}return t=g(t)||0,h(r)&&(d=!!r.leading,a=(p="maxWait"in r)?f(g(r.maxWait)||0,t):a,v="trailing"in r?!!r.trailing:v),U.cancel=function(){void 0!==u&&clearTimeout(u),l=0,n=c=i=u=void 0},U.flush=function(){return void 0===u?o:k(_())},U}}).call(this,s("yLpj"))},DMFV:function(e,t,s){},DPTh:function(e,t,s){"use strict";var r=s("vg5t");s.n(r).a},DVld:function(e,t,s){"use strict";var r=s("/Z02");s.n(r).a},Jdpf:function(e,t,s){},"O/DJ":function(e,t,s){"use strict";var r=s("DMFV");s.n(r).a},RGjw:function(e,t,s){"use strict";s.r(t);var r=s("o0o1"),n=s.n(r),i=s("yXPU"),a=s.n(i),o=s("9/5/"),u=s.n(o),c=s("ZhIB"),l=s.n(c),d=s("lSNA"),p=s.n(d),v=s("MVZn"),f=s.n(v),m={data:function(){return{value:[]}},computed:{isDesktop:function(){return"desktop"===this.$store.state.app.device}},methods:{removeOppositeFilters:function(){var e=Object.keys(this.$store.state.users.filters).length,t=this.$data.value.slice(),s=t.indexOf("local"),r=t.indexOf("external"),n=t.indexOf("active"),i=t.indexOf("deactivated");if(t.length===e)return[];if(s>-1&&r>-1){var a=s>r?r:s;t.splice(a,1)}else if(n>-1&&i>-1){var o=n>i?i:n;t.splice(o,1)}return t},toggleFilters:function(){this.$data.value=this.removeOppositeFilters();var e=this.$data.value.reduce(function(e,t){return f()({},e,p()({},t,!0))},{});this.$store.dispatch("ToggleUsersFilter",e)}}},_=(s("DVld"),s("KHd+")),h=Object(_.a)(m,function(){var e=this,t=e.$createElement,s=e._self._c||t;return s("el-select",{staticClass:"select-field",attrs:{clearable:e.isDesktop,placeholder:e.$t("usersFilter.inputPlaceholder"),multiple:""},on:{change:e.toggleFilters},model:{value:e.value,callback:function(t){e.value=t},expression:"value"}},[s("el-option-group",{attrs:{label:e.$t("usersFilter.byUserType")}},[s("el-option",{attrs:{value:"local"}},[e._v(e._s(e.$t("usersFilter.local")))]),e._v(" "),s("el-option",{attrs:{value:"external"}},[e._v(e._s(e.$t("usersFilter.external")))])],1),e._v(" "),s("el-option-group",{attrs:{label:e.$t("usersFilter.byStatus")}},[s("el-option",{attrs:{value:"active"}},[e._v(e._s(e.$t("usersFilter.active")))]),e._v(" "),s("el-option",{attrs:{value:"deactivated"}},[e._v(e._s(e.$t("usersFilter.deactivated")))])],1)],1)},[],!1,null,"71bc6b38",null);h.options.__file="UsersFilter.vue";var g=h.exports,w=s("i7Kn"),$={name:"NewAccountDialog",props:{dialogFormVisible:{type:Boolean,default:function(){return!1}}},data:function(){return{newUserForm:{nickname:"",email:"",password:""},rules:{nickname:[{validator:this.validateUsername,trigger:"blur"}],email:[{validator:this.validateEmail,trigger:"blur"}],password:[{validator:this.validatePassword,trigger:"blur"}]}}},computed:{isDesktop:function(){return"desktop"===this.$store.state.app.device},isVisible:{get:function(){return this.$props.dialogFormVisible},set:function(){this.closeDialogWindow()}},getLabelWidth:function(){return this.isDesktop?"120px":"85px"}},methods:{closeDialogWindow:function(){this.$emit("closeWindow")},resetForm:function(){var e=this;this.$nextTick(function(){e.$refs.newUserForm.resetFields()})},submitForm:function(e){var t=this;this.$refs[e].validate(function(e){if(!e)return t.$message({type:"error",message:t.$t("users.submitFormError")}),!1;t.$emit("createNewAccount",t.$data.newUserForm)})},validateEmail:function(e,t,s){return""===t?s(new Error(this.$t("users.emptyEmailError"))):this.validEmail(t)?s():s(new Error(this.$t("users.invalidEmailError")))},validatePassword:function(e,t,s){return""===t?s(new Error(this.$t("users.emptyPasswordError"))):s()},validateUsername:function(e,t,s){return""===t?s(new Error(this.$t("users.emptyNicknameError"))):this.validNickname(t)?s():s(new Error(this.$t("users.invalidNicknameError")))},validEmail:function(e){return/^[a-zA-Z0-9.!#$%&'*+\/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/.test(e)},validNickname:function(e){return/^[a-zA-Z\d]+$/.test(e)}}},b=(s("DPTh"),Object(_.a)($,function(){var e=this,t=e.$createElement,s=e._self._c||t;return s("el-dialog",{attrs:{visible:e.isVisible,"show-close":!1,title:e.$t("users.createAccount"),"custom-class":"create-user-dialog"},on:{"update:visible":function(t){e.isVisible=t},open:e.resetForm}},[s("el-form",{ref:"newUserForm",attrs:{model:e.newUserForm,rules:e.rules,"label-width":e.getLabelWidth,"status-icon":""}},[s("el-form-item",{staticClass:"create-account-form-item",attrs:{label:e.$t("users.username"),prop:"nickname"}},[s("el-input",{attrs:{name:"nickname",autofocus:""},model:{value:e.newUserForm.nickname,callback:function(t){e.$set(e.newUserForm,"nickname",t)},expression:"newUserForm.nickname"}})],1),e._v(" "),s("el-form-item",{staticClass:"create-account-form-item",attrs:{label:e.$t("users.email"),prop:"email"}},[s("el-input",{attrs:{name:"email",type:"email"},model:{value:e.newUserForm.email,callback:function(t){e.$set(e.newUserForm,"email",t)},expression:"newUserForm.email"}})],1),e._v(" "),s("el-form-item",{staticClass:"create-account-form-item-without-margin",attrs:{label:e.$t("users.password"),prop:"password"}},[s("el-input",{attrs:{type:"password",name:"password",autocomplete:"off"},model:{value:e.newUserForm.password,callback:function(t){e.$set(e.newUserForm,"password",t)},expression:"newUserForm.password"}})],1)],1),e._v(" "),s("span",{attrs:{slot:"footer"},slot:"footer"},[s("el-button",{on:{click:e.closeDialogWindow}},[e._v(e._s(e.$t("users.cancel")))]),e._v(" "),s("el-button",{attrs:{type:"primary"},on:{click:function(t){return e.submitForm("newUserForm")}}},[e._v(e._s(e.$t("users.create")))])],1)],1)},[],!1,null,null,null));b.options.__file="NewAccountDialog.vue";var k={name:"Users",components:{NewAccountDialog:b.exports,ModerationDropdown:s("tPM3").a,MultipleUsersMenu:w.a,UsersFilter:g},data:function(){return{search:"",selectedUsers:[],createAccountDialogOpen:!1,resetPasswordDialogOpen:!1}},computed:{loading:function(){return this.$store.state.users.loading},normalizedUsersCount:function(){return l()(this.$store.state.users.totalUsersCount).format("0a")},users:function(){return this.$store.state.users.fetchedUsers},usersCount:function(){return this.$store.state.users.totalUsersCount},pageSize:function(){return this.$store.state.users.pageSize},passwordResetLink:function(){return this.$store.state.users.passwordResetToken.link},passwordResetToken:function(){return this.$store.state.users.passwordResetToken.token},currentPage:function(){return this.$store.state.users.currentPage},isDesktop:function(){return"desktop"===this.$store.state.app.device},isMobile:function(){return"mobile"===this.$store.state.app.device},width:function(){return!!this.isMobile&&55}},created:function(){var e=this;this.handleDebounceSearchInput=u()(function(t){e.$store.dispatch("SearchUsers",{query:t,page:1})},500)},mounted:function(){this.$store.dispatch("FetchUsers",{page:1})},methods:{activationIcon:function(e){return e?"el-icon-error":"el-icon-success"},clearSelection:function(){this.$refs.usersTable.clearSelection()},closeResetPasswordDialog:function(){this.resetPasswordDialogOpen=!1,this.$store.dispatch("RemovePasswordToken")},createNewAccount:function(){var e=a()(n.a.mark(function e(t){return n.a.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.$store.dispatch("CreateNewAccount",t);case 2:this.createAccountDialogOpen=!1;case 3:case"end":return e.stop()}},e,this)}));return function(t){return e.apply(this,arguments)}}(),getFirstLetter:function(e){return e.charAt(0).toUpperCase()},handlePageChange:function(e){var t=this.$store.state.users.searchQuery;""===t?this.$store.dispatch("FetchUsers",{page:e}):this.$store.dispatch("SearchUsers",{query:t,page:e})},handleSelectionChange:function(e){this.$data.selectedUsers=e},openResetPasswordDialog:function(){this.resetPasswordDialogOpen=!0},showDeactivatedButton:function(e){return this.$store.state.user.id!==e}}},U=(s("6eCR"),Object(_.a)(k,function(){var e=this,t=e.$createElement,s=e._self._c||t;return s("div",{staticClass:"users-container"},[s("h1",[e._v("\n "+e._s(e.$t("users.users"))+"\n "),s("span",{staticClass:"user-count"},[e._v("("+e._s(e.normalizedUsersCount)+")")])]),e._v(" "),s("div",{staticClass:"filter-container"},[s("users-filter"),e._v(" "),s("el-input",{staticClass:"search",attrs:{placeholder:e.$t("users.search")},on:{input:e.handleDebounceSearchInput},model:{value:e.search,callback:function(t){e.search=t},expression:"search"}})],1),e._v(" "),s("div",{staticClass:"actions-container"},[s("el-button",{staticClass:"actions-button",on:{click:function(t){e.createAccountDialogOpen=!0}}},[s("span",{staticClass:"create-account"},[s("i",{staticClass:"el-icon-plus"}),e._v("\n "+e._s(e.$t("users.createAccount"))+"\n ")])]),e._v(" "),s("multiple-users-menu",{attrs:{"selected-users":e.selectedUsers},on:{"apply-action":e.clearSelection}})],1),e._v(" "),s("new-account-dialog",{attrs:{"dialog-form-visible":e.createAccountDialogOpen},on:{createNewAccount:e.createNewAccount,closeWindow:function(t){e.createAccountDialogOpen=!1}}}),e._v(" "),s("el-table",{directives:[{name:"loading",rawName:"v-loading",value:e.loading,expression:"loading"}],ref:"usersTable",staticStyle:{width:"100%"},attrs:{data:e.users,"row-key":"id"},on:{"selection-change":e.handleSelectionChange}},[e.isDesktop?s("el-table-column",{attrs:{type:"selection","reserve-selection":"",width:"44",align:"center"}}):e._e(),e._v(" "),s("el-table-column",{attrs:{"min-width":e.width,label:e.$t("users.id"),prop:"id"}}),e._v(" "),s("el-table-column",{attrs:{label:e.$t("users.name"),prop:"nickname"},scopedSlots:e._u([{key:"default",fn:function(t){return[s("router-link",{attrs:{to:{name:"UsersShow",params:{id:t.row.id}}}},[e._v(e._s(t.row.nickname))]),e._v(" "),e.isDesktop?s("el-tag",{attrs:{type:"info",size:"mini"}},[s("span",[e._v(e._s(t.row.local?e.$t("users.local"):e.$t("users.external")))])]):e._e()]}}])}),e._v(" "),s("el-table-column",{attrs:{"min-width":e.width,label:e.$t("users.status")},scopedSlots:e._u([{key:"default",fn:function(t){return[s("el-tag",{attrs:{type:t.row.deactivated?"danger":"success"}},[e.isDesktop?s("span",[e._v(e._s(t.row.deactivated?e.$t("users.deactivated"):e.$t("users.active")))]):s("i",{class:e.activationIcon(t.row.deactivated)})]),e._v(" "),t.row.roles.admin?s("el-tag",[s("span",[e._v(e._s(e.isDesktop?e.$t("users.admin"):e.getFirstLetter(e.$t("users.admin"))))])]):e._e(),e._v(" "),t.row.roles.moderator?s("el-tag",[s("span",[e._v(e._s(e.isDesktop?e.$t("users.moderator"):e.getFirstLetter(e.$t("users.moderator"))))])]):e._e(),e._v(" "),s("el-tooltip",{attrs:{content:e.$t("users.unconfirmedEmail"),effect:"dark"}},[t.row.confirmation_pending?s("el-tag",{attrs:{type:"info"}},[e._v("\n "+e._s(e.isDesktop?e.$t("users.unconfirmed"):e.getFirstLetter(e.$t("users.unconfirmed")))+"\n ")]):e._e()],1)]}}])}),e._v(" "),s("el-table-column",{attrs:{label:e.$t("users.actions"),fixed:"right"},scopedSlots:e._u([{key:"default",fn:function(t){return[s("moderation-dropdown",{attrs:{user:t.row,page:"users"},on:{"open-reset-token-dialog":e.openResetPasswordDialog}})]}}])})],1),e._v(" "),s("el-dialog",{directives:[{name:"loading",rawName:"v-loading",value:e.loading,expression:"loading"}],attrs:{visible:e.resetPasswordDialogOpen,title:e.$t("users.passwordResetTokenCreated"),"custom-class":"password-reset-token-dialog"},on:{"update:visible":function(t){e.resetPasswordDialogOpen=t},close:e.closeResetPasswordDialog}},[s("div",[s("p",{staticClass:"password-reset-token"},[e._v("Password reset token was generated: "+e._s(e.passwordResetToken))]),e._v(" "),s("p",[e._v("You can also use this link to reset password:\n "),s("a",{staticClass:"reset-password-link",attrs:{href:e.passwordResetLink,target:"_blank"}},[e._v(e._s(e.passwordResetLink))])])])]),e._v(" "),e.loading?e._e():s("div",{staticClass:"pagination"},[s("el-pagination",{attrs:{total:e.usersCount,"current-page":e.currentPage,"page-size":e.pageSize,background:"",layout:"prev, pager, next"},on:{"current-change":e.handlePageChange}})],1)],1)},[],!1,null,null,null));U.options.__file="index.vue";t.default=U.exports},i7Kn:function(e,t,s){"use strict";var r=s("o0o1"),n=s.n(r),i=s("yXPU"),a=s.n(i),o={props:{selectedUsers:{type:Array,default:function(){return[]}}},computed:{showDropdownForMultipleUsers:function(){return this.$props.selectedUsers.length>0},isDesktop:function(){return"desktop"===this.$store.state.app.device}},methods:{mappers:function(){var e=this,t=function(){var t=a()(n.a.mark(function t(s,r){return n.a.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,r(s);case 2:e.$emit("apply-action");case 3:case"end":return t.stop()}},t)}));return function(e,s){return t.apply(this,arguments)}}();return{grantRight:function(s){return function(){var r=function(){var t=a()(n.a.mark(function t(r){return n.a.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,e.$store.dispatch("AddRight",{users:r,right:s});case 2:return t.abrupt("return",t.sent);case 3:case"end":return t.stop()}},t)}));return function(e){return t.apply(this,arguments)}}(),i=e.selectedUsers.filter(function(t){return t.local&&!t.roles[s]&&e.$store.state.user.id!==t.id});t(i,r)}},revokeRight:function(s){return function(){var r=function(){var t=a()(n.a.mark(function t(r){return n.a.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,e.$store.dispatch("DeleteRight",{users:r,right:s});case 2:return t.abrupt("return",t.sent);case 3:case"end":return t.stop()}},t)}));return function(e){return t.apply(this,arguments)}}(),i=e.selectedUsers.filter(function(t){return t.local&&t.roles[s]&&e.$store.state.user.id!==t.id});t(i,r)}},activate:function(){var s=e.selectedUsers.filter(function(t){return t.deactivated&&e.$store.state.user.id!==t.id});t(s,function(){var t=a()(n.a.mark(function t(s){return n.a.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,e.$store.dispatch("ActivateUsers",{users:s});case 2:return t.abrupt("return",t.sent);case 3:case"end":return t.stop()}},t)}));return function(e){return t.apply(this,arguments)}}())},deactivate:function(){var s=e.selectedUsers.filter(function(t){return!t.deactivated&&e.$store.state.user.id!==t.id});t(s,function(){var t=a()(n.a.mark(function t(s){return n.a.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,e.$store.dispatch("DeactivateUsers",{users:s});case 2:return t.abrupt("return",t.sent);case 3:case"end":return t.stop()}},t)}));return function(e){return t.apply(this,arguments)}}())},remove:function(){var s=e.selectedUsers.filter(function(t){return e.$store.state.user.id!==t.id});t(s,function(){var t=a()(n.a.mark(function t(s){return n.a.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,e.$store.dispatch("DeleteUsers",{users:s});case 2:return t.abrupt("return",t.sent);case 3:case"end":return t.stop()}},t)}));return function(e){return t.apply(this,arguments)}}())},addTag:function(s){return function(){var r=e.selectedUsers.filter(function(e){return"disable_remote_subscription"===s||"disable_any_subscription"===s?e.local&&!e.tags.includes(s):!e.tags.includes(s)});t(r,function(){var t=a()(n.a.mark(function t(r){return n.a.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,e.$store.dispatch("AddTag",{users:r,tag:s});case 2:return t.abrupt("return",t.sent);case 3:case"end":return t.stop()}},t)}));return function(e){return t.apply(this,arguments)}}())}},removeTag:function(s){return a()(n.a.mark(function r(){var i;return n.a.wrap(function(r){for(;;)switch(r.prev=r.next){case 0:i=e.selectedUsers.filter(function(e){return"disable_remote_subscription"===s||"disable_any_subscription"===s?e.local&&e.tags.includes(s):e.tags.includes(s)}),t(i,function(){var t=a()(n.a.mark(function t(r){return n.a.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,e.$store.dispatch("RemoveTag",{users:r,tag:s});case 2:return t.abrupt("return",t.sent);case 3:case"end":return t.stop()}},t)}));return function(e){return t.apply(this,arguments)}}());case 3:case"end":return r.stop()}},r)}))},requirePasswordReset:function(){var s=e.selectedUsers.filter(function(e){return e.local});t(s,function(){var t=a()(n.a.mark(function t(s){return n.a.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,e.$store.dispatch("RequirePasswordReset",s);case 2:return t.abrupt("return",t.sent);case 3:case"end":return t.stop()}},t)}));return function(e){return t.apply(this,arguments)}}())},confirmAccounts:function(){var s=e.selectedUsers.filter(function(e){return e.local&&e.confirmation_pending});t(s,function(){var t=a()(n.a.mark(function t(s){return n.a.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,e.$store.dispatch("ConfirmUsersEmail",{users:s});case 2:return t.abrupt("return",t.sent);case 3:case"end":return t.stop()}},t)}));return function(e){return t.apply(this,arguments)}}())},resendConfirmation:function(){var s=e.selectedUsers.filter(function(e){return e.local&&e.confirmation_pending});t(s,function(){var t=a()(n.a.mark(function t(s){return n.a.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,e.$store.dispatch("ResendConfirmationEmail",s);case 2:return t.abrupt("return",t.sent);case 3:case"end":return t.stop()}},t)}));return function(e){return t.apply(this,arguments)}}())}}},grantRightToMultipleUsers:function(e){var t=this.mappers().grantRight;this.confirmMessage(this.$t("users.grantRightConfirmation",{right:e}),t(e))},revokeRightFromMultipleUsers:function(e){var t=this.mappers().revokeRight;this.confirmMessage(this.$t("users.revokeRightConfirmation",{right:e}),t(e))},activateMultipleUsers:function(){var e=this.mappers().activate;this.confirmMessage(this.$t("users.activateMultipleUsersConfirmation"),e)},deactivateMultipleUsers:function(){var e=this.mappers().deactivate;this.confirmMessage(this.$t("users.deactivateMultipleUsersConfirmation"),e)},deleteMultipleUsers:function(){var e=this.mappers().remove;this.confirmMessage(this.$t("users.deleteMultipleUsersConfirmation"),e)},requirePasswordReset:function(){if(this.$store.state.user.nodeInfo.metadata.mailerEnabled){var e=this.mappers().requirePasswordReset;this.confirmMessage(this.$t("users.requirePasswordResetConfirmation"),e)}else this.$alert(this.$t("users.mailerMustBeEnabled"),"Error",{type:"error"})},addTagForMultipleUsers:function(e){var t=this.mappers().addTag;this.confirmMessage(this.$t("users.addTagForMultipleUsersConfirmation"),t(e))},removeTagFromMultipleUsers:function(e){var t=this.mappers().removeTag;this.confirmMessage(this.$t("users.removeTagFromMultipleUsersConfirmation"),t(e))},confirmAccountsForMultipleUsers:function(){var e=this.mappers().confirmAccounts;this.confirmMessage(this.$t("users.confirmAccountsConfirmation"),e)},resendConfirmationForMultipleUsers:function(){var e=this.mappers().resendConfirmation;this.confirmMessage(this.$t("users.resendEmailConfirmation"),e)},confirmMessage:function(e,t){var s=this;this.$confirm(e,{confirmButtonText:this.$t("users.ok"),cancelButtonText:this.$t("users.cancel"),type:"warning"}).then(function(){t()}).catch(function(){s.$message({type:"info",message:s.$t("users.canceled")})})}}},u=(s("O/DJ"),s("KHd+")),c=Object(u.a)(o,function(){var e=this,t=e.$createElement,s=e._self._c||t;return s("el-dropdown",{attrs:{size:"small",trigger:"click",placement:"bottom-start"}},[e.isDesktop?s("el-button",{staticClass:"actions-button"},[s("span",{staticClass:"actions-button-container"},[s("span",[s("i",{staticClass:"el-icon-edit"}),e._v("\n "+e._s(e.$t("users.moderateUsers"))+"\n ")]),e._v(" "),s("i",{staticClass:"el-icon-arrow-down el-icon--right"})])]):e._e(),e._v(" "),e.showDropdownForMultipleUsers?s("el-dropdown-menu",{attrs:{slot:"dropdown"},slot:"dropdown"},[s("el-dropdown-item",{nativeOn:{click:function(t){return e.grantRightToMultipleUsers("admin")}}},[e._v("\n "+e._s(e.$t("users.grantAdmin"))+"\n ")]),e._v(" "),s("el-dropdown-item",{nativeOn:{click:function(t){return e.revokeRightFromMultipleUsers("admin")}}},[e._v("\n "+e._s(e.$t("users.revokeAdmin"))+"\n ")]),e._v(" "),s("el-dropdown-item",{nativeOn:{click:function(t){return e.grantRightToMultipleUsers("moderator")}}},[e._v("\n "+e._s(e.$t("users.grantModerator"))+"\n ")]),e._v(" "),s("el-dropdown-item",{nativeOn:{click:function(t){return e.revokeRightFromMultipleUsers("moderator")}}},[e._v("\n "+e._s(e.$t("users.revokeModerator"))+"\n ")]),e._v(" "),s("el-dropdown-item",{attrs:{divided:""},nativeOn:{click:function(t){return e.confirmAccountsForMultipleUsers(t)}}},[e._v("\n "+e._s(e.$t("users.confirmAccounts"))+"\n ")]),e._v(" "),s("el-dropdown-item",{nativeOn:{click:function(t){return e.resendConfirmationForMultipleUsers(t)}}},[e._v("\n "+e._s(e.$t("users.resendConfirmation"))+"\n ")]),e._v(" "),s("el-dropdown-item",{attrs:{divided:""},nativeOn:{click:function(t){return e.activateMultipleUsers(t)}}},[e._v("\n "+e._s(e.$t("users.activateAccounts"))+"\n ")]),e._v(" "),s("el-dropdown-item",{nativeOn:{click:function(t){return e.deactivateMultipleUsers(t)}}},[e._v("\n "+e._s(e.$t("users.deactivateAccounts"))+"\n ")]),e._v(" "),s("el-dropdown-item",{nativeOn:{click:function(t){return e.deleteMultipleUsers(t)}}},[e._v("\n "+e._s(e.$t("users.deleteAccounts"))+"\n ")]),e._v(" "),s("el-dropdown-item",{nativeOn:{click:function(t){return e.requirePasswordReset(t)}}},[e._v("\n "+e._s(e.$t("users.requirePasswordReset"))+"\n ")]),e._v(" "),s("el-dropdown-item",{staticClass:"no-hover",attrs:{divided:""}},[s("div",{staticClass:"tag-container"},[s("span",{staticClass:"tag-text"},[e._v(e._s(e.$t("users.forceNsfw")))]),e._v(" "),s("el-button-group",{staticClass:"tag-button-group"},[s("el-button",{attrs:{size:"mini"},nativeOn:{click:function(t){return e.addTagForMultipleUsers("force_nsfw")}}},[e._v("\n "+e._s(e.$t("users.apply"))+"\n ")]),e._v(" "),s("el-button",{attrs:{size:"mini"},nativeOn:{click:function(t){return e.removeTagFromMultipleUsers("force_nsfw")}}},[e._v("\n "+e._s(e.$t("users.remove"))+"\n ")])],1)],1)]),e._v(" "),s("el-dropdown-item",{staticClass:"no-hover"},[s("div",{staticClass:"tag-container"},[s("span",{staticClass:"tag-text"},[e._v(e._s(e.$t("users.stripMedia")))]),e._v(" "),s("el-button-group",{staticClass:"tag-button-group"},[s("el-button",{attrs:{size:"mini"},nativeOn:{click:function(t){return e.addTagForMultipleUsers("strip_media")}}},[e._v("\n "+e._s(e.$t("users.apply"))+"\n ")]),e._v(" "),s("el-button",{attrs:{size:"mini"},nativeOn:{click:function(t){return e.removeTagFromMultipleUsers("strip_media")}}},[e._v("\n "+e._s(e.$t("users.remove"))+"\n ")])],1)],1)]),e._v(" "),s("el-dropdown-item",{staticClass:"no-hover"},[s("div",{staticClass:"tag-container"},[s("span",{staticClass:"tag-text"},[e._v(e._s(e.$t("users.forceUnlisted")))]),e._v(" "),s("el-button-group",{staticClass:"tag-button-group"},[s("el-button",{attrs:{size:"mini"},nativeOn:{click:function(t){return e.addTagForMultipleUsers("force_unlisted")}}},[e._v("\n "+e._s(e.$t("users.apply"))+"\n ")]),e._v(" "),s("el-button",{attrs:{size:"mini"},nativeOn:{click:function(t){return e.removeTagFromMultipleUsers("force_unlisted")}}},[e._v("\n "+e._s(e.$t("users.remove"))+"\n ")])],1)],1)]),e._v(" "),s("el-dropdown-item",{staticClass:"no-hover"},[s("div",{staticClass:"tag-container"},[s("span",{staticClass:"tag-text"},[e._v(e._s(e.$t("users.sandbox")))]),e._v(" "),s("el-button-group",{staticClass:"tag-button-group"},[s("el-button",{attrs:{size:"mini"},nativeOn:{click:function(t){return e.addTagForMultipleUsers("sandbox")}}},[e._v("\n "+e._s(e.$t("users.apply"))+"\n ")]),e._v(" "),s("el-button",{attrs:{size:"mini"},nativeOn:{click:function(t){return e.removeTagFromMultipleUsers("sandbox")}}},[e._v("\n "+e._s(e.$t("users.remove"))+"\n ")])],1)],1)]),e._v(" "),s("el-dropdown-item",{staticClass:"no-hover"},[s("div",{staticClass:"tag-container"},[s("span",{staticClass:"tag-text"},[e._v(e._s(e.$t("users.disableRemoteSubscriptionForMultiple")))]),e._v(" "),s("el-button-group",{staticClass:"tag-button-group"},[s("el-button",{attrs:{size:"mini"},nativeOn:{click:function(t){return e.addTagForMultipleUsers("disable_remote_subscription")}}},[e._v("\n "+e._s(e.$t("users.apply"))+"\n ")]),e._v(" "),s("el-button",{attrs:{size:"mini"},nativeOn:{click:function(t){return e.removeTagFromMultipleUsers("disable_remote_subscription")}}},[e._v("\n "+e._s(e.$t("users.remove"))+"\n ")])],1)],1)]),e._v(" "),s("el-dropdown-item",{staticClass:"no-hover"},[s("div",{staticClass:"tag-container"},[s("span",{staticClass:"tag-text"},[e._v(e._s(e.$t("users.disableAnySubscriptionForMultiple")))]),e._v(" "),s("el-button-group",{staticClass:"tag-button-group"},[s("el-button",{attrs:{size:"mini"},nativeOn:{click:function(t){return e.addTagForMultipleUsers("disable_any_subscription")}}},[e._v("\n "+e._s(e.$t("users.apply"))+"\n ")]),e._v(" "),s("el-button",{attrs:{size:"mini"},nativeOn:{click:function(t){return e.removeTagFromMultipleUsers("disable_any_subscription")}}},[e._v("\n "+e._s(e.$t("users.remove"))+"\n ")])],1)],1)])],1):s("el-dropdown-menu",{attrs:{slot:"dropdown"},slot:"dropdown"},[s("el-dropdown-item",[e._v("\n "+e._s(e.$t("users.selectUsers"))+"\n ")])],1)],1)},[],!1,null,"3850612b",null);c.options.__file="MultipleUsersMenu.vue";t.a=c.exports},lOBV:function(e,t,s){},tPM3:function(e,t,s){"use strict";var r={name:"ModerationDropdown",props:{user:{type:Object,default:function(){return{}}},page:{type:String,default:"users"}},computed:{isDesktop:function(){return"desktop"===this.$store.state.app.device}},methods:{getPasswordResetToken:function(e){this.$emit("open-reset-token-dialog"),this.$store.dispatch("GetPasswordResetToken",e)},handleConfirmationResend:function(e){this.$store.dispatch("ResendConfirmationEmail",[e])},handleDeletion:function(e){this.$store.dispatch("DeleteUsers",{users:[e],_userId:e.id})},handleEmailConfirmation:function(e){this.$store.dispatch("ConfirmUsersEmail",{users:[e],_userId:e.id})},requirePasswordReset:function(e){this.$store.state.user.nodeInfo.metadata.mailerEnabled?this.$store.dispatch("RequirePasswordReset",[e]):this.$alert(this.$t("users.mailerMustBeEnabled"),"Error",{type:"error"})},showAdminAction:function(e){var t=e.local,s=e.id;return t&&this.showDeactivatedButton(s)},showDeactivatedButton:function(e){return this.$store.state.user.id!==e},toggleActivation:function(e){e.deactivated?this.$store.dispatch("ActivateUsers",{users:[e],_userId:e.id}):this.$store.dispatch("DeactivateUsers",{users:[e],_userId:e.id})},toggleTag:function(e,t){e.tags.includes(t)?this.$store.dispatch("RemoveTag",{users:[e],tag:t,_userId:e.id}):this.$store.dispatch("AddTag",{users:[e],tag:t,_userId:e.id})},toggleUserRight:function(e,t){e.roles[t]?this.$store.dispatch("DeleteRight",{users:[e],right:t,_userId:e.id}):this.$store.dispatch("AddRight",{users:[e],right:t,_userId:e.id})}}},n=(s("53Av"),s("KHd+")),i=Object(n.a)(r,function(){var e=this,t=e.$createElement,s=e._self._c||t;return s("el-dropdown",{attrs:{"hide-on-click":!1,size:"small",trigger:"click"}},[s("div",["users"===e.page?s("span",{staticClass:"el-dropdown-link"},[e._v("\n "+e._s(e.$t("users.moderation"))+"\n "),e.isDesktop?s("i",{staticClass:"el-icon-arrow-down el-icon--right"}):e._e()]):e._e(),e._v(" "),"userPage"===e.page?s("el-button",{staticClass:"moderate-user-button"},[s("span",{staticClass:"moderate-user-button-container"},[s("span",[s("i",{staticClass:"el-icon-edit"}),e._v("\n "+e._s(e.$t("users.moderateUser"))+"\n ")]),e._v(" "),s("i",{staticClass:"el-icon-arrow-down el-icon--right"})])]):e._e()],1),e._v(" "),s("el-dropdown-menu",{attrs:{slot:"dropdown"},slot:"dropdown"},[e.showAdminAction(e.user)?s("el-dropdown-item",{nativeOn:{click:function(t){return e.toggleUserRight(e.user,"admin")}}},[e._v("\n "+e._s(e.user.roles.admin?e.$t("users.revokeAdmin"):e.$t("users.grantAdmin"))+"\n ")]):e._e(),e._v(" "),e.showAdminAction(e.user)?s("el-dropdown-item",{nativeOn:{click:function(t){return e.toggleUserRight(e.user,"moderator")}}},[e._v("\n "+e._s(e.user.roles.moderator?e.$t("users.revokeModerator"):e.$t("users.grantModerator"))+"\n ")]):e._e(),e._v(" "),e.showDeactivatedButton(e.user.id)?s("el-dropdown-item",{attrs:{divided:e.showAdminAction(e.user)},nativeOn:{click:function(t){return e.toggleActivation(e.user)}}},[e._v("\n "+e._s(e.user.deactivated?e.$t("users.activateAccount"):e.$t("users.deactivateAccount"))+"\n ")]):e._e(),e._v(" "),e.showDeactivatedButton(e.user.id)?s("el-dropdown-item",{nativeOn:{click:function(t){return e.handleDeletion(e.user)}}},[e._v("\n "+e._s(e.$t("users.deleteAccount"))+"\n ")]):e._e(),e._v(" "),e.user.local&&e.user.confirmation_pending?s("el-dropdown-item",{attrs:{divided:""},nativeOn:{click:function(t){return e.handleEmailConfirmation(e.user)}}},[e._v("\n "+e._s(e.$t("users.confirmAccount"))+"\n ")]):e._e(),e._v(" "),e.user.local&&e.user.confirmation_pending?s("el-dropdown-item",{nativeOn:{click:function(t){return e.handleConfirmationResend(e.user)}}},[e._v("\n "+e._s(e.$t("users.resendConfirmation"))+"\n ")]):e._e(),e._v(" "),s("el-dropdown-item",{class:{"active-tag":e.user.tags.includes("force_nsfw")},attrs:{divided:e.showAdminAction(e.user)},nativeOn:{click:function(t){return e.toggleTag(e.user,"force_nsfw")}}},[e._v("\n "+e._s(e.$t("users.forceNsfw"))+"\n "),e.user.tags.includes("force_nsfw")?s("i",{staticClass:"el-icon-check"}):e._e()]),e._v(" "),s("el-dropdown-item",{class:{"active-tag":e.user.tags.includes("strip_media")},nativeOn:{click:function(t){return e.toggleTag(e.user,"strip_media")}}},[e._v("\n "+e._s(e.$t("users.stripMedia"))+"\n "),e.user.tags.includes("strip_media")?s("i",{staticClass:"el-icon-check"}):e._e()]),e._v(" "),s("el-dropdown-item",{class:{"active-tag":e.user.tags.includes("force_unlisted")},nativeOn:{click:function(t){return e.toggleTag(e.user,"force_unlisted")}}},[e._v("\n "+e._s(e.$t("users.forceUnlisted"))+"\n "),e.user.tags.includes("force_unlisted")?s("i",{staticClass:"el-icon-check"}):e._e()]),e._v(" "),s("el-dropdown-item",{class:{"active-tag":e.user.tags.includes("sandbox")},nativeOn:{click:function(t){return e.toggleTag(e.user,"sandbox")}}},[e._v("\n "+e._s(e.$t("users.sandbox"))+"\n "),e.user.tags.includes("sandbox")?s("i",{staticClass:"el-icon-check"}):e._e()]),e._v(" "),e.user.local?s("el-dropdown-item",{class:{"active-tag":e.user.tags.includes("disable_remote_subscription")},nativeOn:{click:function(t){return e.toggleTag(e.user,"disable_remote_subscription")}}},[e._v("\n "+e._s(e.$t("users.disableRemoteSubscription"))+"\n "),e.user.tags.includes("disable_remote_subscription")?s("i",{staticClass:"el-icon-check"}):e._e()]):e._e(),e._v(" "),e.user.local?s("el-dropdown-item",{class:{"active-tag":e.user.tags.includes("disable_any_subscription")},nativeOn:{click:function(t){return e.toggleTag(e.user,"disable_any_subscription")}}},[e._v("\n "+e._s(e.$t("users.disableAnySubscription"))+"\n "),e.user.tags.includes("disable_any_subscription")?s("i",{staticClass:"el-icon-check"}):e._e()]):e._e(),e._v(" "),e.user.local?s("el-dropdown-item",{attrs:{divided:""},nativeOn:{click:function(t){return e.getPasswordResetToken(e.user.nickname)}}},[e._v("\n "+e._s(e.$t("users.getPasswordResetToken"))+"\n ")]):e._e(),e._v(" "),e.user.local?s("el-dropdown-item",{nativeOn:{click:function(t){return e.requirePasswordReset(e.user)}}},[e._v("\n "+e._s(e.$t("users.requirePasswordReset"))+"\n ")]):e._e()],1)],1)},[],!1,null,null,null);i.options.__file="ModerationDropdown.vue";t.a=i.exports},vg5t:function(e,t,s){}}]);
//# sourceMappingURL=chunk-06de.ff4586ab.js.map