(window.webpackJsonp=window.webpackJsonp||[]).push([[4],{314:function(n,i,t){"use strict";t.r(i);var e=t(321),a=t.n(e),d=t(319),s=t.n(d),o=t(38),c=t(322),l=t.n(c),r=t(323),u=t.n(r),m=t(332),p=t.n(m),v=t(320),A={name:"Admins",components:{Actions:l.a,ActionButton:u.a,Avatar:p.a},directives:{ClickOutside:a.a},data:function(){return{admins:[],newAdditionalAdminInputField:"",isAdmin:!1,isLoading:!0,isAdding:!1,isSavingChanges:!1}},mounted:function(){var n=this;this.isAdmin=OC.isUserAdmin();var i=Object(v.generateUrl)("/apps/privacy/api/admins");s.a.get(i).then((function(i){o.default.set(n,"admins",i.data),n.isLoading=!1}))},methods:{openNewAdmin:function(){var n=this;setTimeout((function(){n.isAdding=!0}),0)},closeNewAdmin:function(){this.isAdding=!1,this.newAdditionalAdminInputField=""},addAdditionalAdmin:function(){var n=this;console.warn(this.newAdditionalAdminInputField);var i=Object(v.generateUrl)("/apps/privacy/api/admins");this.isSavingChanges=!0,s.a.post(i,{name:this.newAdditionalAdminInputField}).then((function(i){n.admins.push(i.data),n.isSavingChanges=!1,n.isAdding=!1,n.newAdditionalAdminInputField=""}))},deleteAdditionalAdmin:function(n){var i=this,t=Object(v.generateUrl)("/apps/privacy/api/admins/{id}",{id:n.id});s.a.delete(t).then((function(t){var e=i.admins.indexOf(n);i.admins.splice(e,1)}))}}},f=t(318),h=Object(f.a)(A,(function(){var n=this,i=n.$createElement,t=n._self._c||i;return t("div",{staticClass:"who-has-access"},[t("span",{staticClass:"icon icon-loading",class:{hidden:!n.isLoading}}),n._v(" "),n._l(n.admins,(function(i){return t("div",{key:i.id,staticClass:"admin-avatar-container"},[t("Avatar",{attrs:{user:i.internal?i.id:null,"display-name":i.displayname,size:64,"is-no-user":!i.internal}}),n._v(" "),i.internal?n._e():t("Actions",[t("ActionButton",{attrs:{icon:"icon-close"},on:{click:function(t){return n.deleteAdditionalAdmin(i)}}},[n._v("\n\t\t\t\t"+n._s(n.t("privacy","Remove external admin"))+"\n\t\t\t")])],1)],1)})),n._v(" "),n.isAdmin?t("div",[n.isAdding?n._e():t("Actions",{staticClass:"addAdditionalAdmin"},[t("ActionButton",{attrs:{icon:"icon-add"},on:{click:n.openNewAdmin}},[n._v("\n\t\t\t\t"+n._s(n.t("privacy","Add external admin"))+"\n\t\t\t")])],1),n._v(" "),n.isAdding?t("form",{directives:[{name:"click-outside",rawName:"v-click-outside",value:n.closeNewAdmin,expression:"closeNewAdmin"}],staticClass:"addAdditionalAdminFormContainer",on:{submit:function(i){return i.preventDefault(),n.addAdditionalAdmin(i)}}},[t("input",{directives:[{name:"model",rawName:"v-model",value:n.newAdditionalAdminInputField,expression:"newAdditionalAdminInputField"}],attrs:{type:"text",maxlength:"64",autocomplete:"new-password",autocorrect:"off",autocapitalize:"off",spellcheck:"false",placeholder:n.additionalAdminPlaceholderLabel},domProps:{value:n.newAdditionalAdminInputField},on:{input:function(i){i.target.composing||(n.newAdditionalAdminInputField=i.target.value)}}}),n._v(" "),t("input",{staticClass:"icon-confirm",attrs:{type:"submit",value:""}})]):n._e()],1):n._e()],2)}),[],!1,null,null,null);i.default=h.exports},321:function(n,i){function t(n){return"function"==typeof n.value||(console.warn("[Vue-click-outside:] provided expression",n.expression,"is not a function."),!1)}function e(n){return void 0!==n.componentInstance&&n.componentInstance.$isServer}n.exports={bind:function(n,i,a){function d(i){if(a.context){var t=i.path||i.composedPath&&i.composedPath();t&&t.length>0&&t.unshift(i.target),n.contains(i.target)||function(n,i){if(!n||!i)return!1;for(var t=0,e=i.length;t<e;t++)try{if(n.contains(i[t]))return!0;if(i[t].contains(n))return!1}catch(n){return!1}return!1}(a.context.popupItem,t)||n.__vueClickOutside__.callback(i)}}t(i)&&(n.__vueClickOutside__={handler:d,callback:i.value},!e(a)&&document.addEventListener("click",d))},update:function(n,i){t(i)&&(n.__vueClickOutside__.callback=i.value)},unbind:function(n,i,t){!e(t)&&document.removeEventListener("click",n.__vueClickOutside__.handler),delete n.__vueClickOutside__}}}}]);
//# sourceMappingURL=privacy.4.774dd8905ff149791df4.js.map