"use strict";(globalThis["webpackChunkadmin_panel_vue_webclient"]=globalThis["webpackChunkadmin_panel_vue_webclient"]||[]).push([[902],{3902:(t,o,l)=>{l.r(o),l.d(o,{default:()=>D});var a=l(1758),e=l(8790),s=l(9104);const n={class:"q-pa-lg"},i={class:"row q-mb-md"},u={class:"col text-h5"},c={class:"row"},r={class:"col-5"},A={class:"row q-mt-sm q-mb-lg"},L={class:"col-10"},d={key:0,class:"row"},h={class:"col-5"},E={class:"row q-mt-md"},g={class:"col-2 q-mt-sm"},w={class:"col-5"},_={class:"q-pt-md text-right"};function m(t,o,l,m,I,N){const T=(0,a.g2)("q-checkbox"),b=(0,a.g2)("q-item-label"),y=(0,a.g2)("q-select"),v=(0,a.g2)("q-card-section"),p=(0,a.g2)("q-card"),B=(0,a.g2)("q-btn"),O=(0,a.g2)("q-linear-progress"),S=(0,a.g2)("q-inner-loading"),C=(0,a.g2)("q-scroll-area"),M=(0,a.gN)("t");return(0,a.uX)(),(0,a.Wv)(C,{class:"full-height full-width"},{default:(0,a.k6)((()=>[(0,a.Lk)("div",n,[(0,a.Lk)("div",i,[(0,a.Lk)("div",u,(0,e.v_)(t.$t("MAILWEBCLIENT.HEADING_SETTINGS_TAB")),1)]),(0,a.bF)(p,{flat:"",bordered:"",class:"card-edit-settings"},{default:(0,a.k6)((()=>[(0,a.bF)(v,null,{default:(0,a.k6)((()=>[(0,a.Lk)("div",c,[(0,a.Lk)("div",r,[(0,a.bF)(T,{dense:"",modelValue:I.autocreateMailAccountOnNewUserFirstLogin,"onUpdate:modelValue":o[0]||(o[0]=t=>I.autocreateMailAccountOnNewUserFirstLogin=t),label:t.$t("MAILWEBCLIENT.LABEL_ALLOW_AUTO_PROVISIONING_NEW_USERS")},null,8,["modelValue","label"])])]),(0,a.Lk)("div",A,[(0,a.Lk)("div",L,[(0,a.bF)(b,{caption:"",innerHTML:t.$t("MAILWEBCLIENT.LABEL_HINT_ALLOW_AUTO_PROVISIONING_NEW_USERS_HTML")},null,8,["innerHTML"])])]),I.allowMultiAccounts?((0,a.uX)(),(0,a.CE)("div",d,[(0,a.Lk)("div",h,[(0,a.bF)(T,{dense:"",modelValue:I.allowAddAccounts,"onUpdate:modelValue":o[1]||(o[1]=t=>I.allowAddAccounts=t),label:t.$t("MAILWEBCLIENT.LABEL_ALLOW_USERS_ADD_MAILBOXES")},null,8,["modelValue","label"])])])):(0,a.Q3)("",!0),(0,a.bo)((0,a.Lk)("div",E,[(0,a.bo)((0,a.Lk)("div",g,null,512),[[M,"MAILWEBCLIENT.LABEL_DEFAULT_LAYOUT"]]),(0,a.Lk)("div",w,[(0,a.bF)(y,{outlined:"",dense:"","bg-color":"white",modelValue:I.horizontalLayoutByDefault,"onUpdate:modelValue":o[2]||(o[2]=t=>I.horizontalLayoutByDefault=t),"emit-value":"","map-options":"",options:I.layoutOptions},null,8,["modelValue","options"])])],512),[[s.aG,I.allowHorizontalLayout]])])),_:1})])),_:1}),(0,a.Lk)("div",_,[(0,a.bF)(B,{unelevated:"","no-caps":"",dense:"",class:"q-px-sm",ripple:!1,color:"primary",onClick:N.save,label:t.$t("COREWEBCLIENT.ACTION_SAVE")},null,8,["onClick","label"])])]),(0,a.bF)(S,{style:{"justify-content":"flex-start"},showing:I.saving},{default:(0,a.k6)((()=>[(0,a.bF)(O,{query:""})])),_:1},8,["showing"])])),_:1})}var I=l(6720),N=l(8176),T=l(9134),b=l(6198);const y={name:"MailAdminSettings",data(){return{autocreateMailAccountOnNewUserFirstLogin:!0,allowMultiAccounts:!1,allowAddAccounts:!1,allowHorizontalLayout:!1,horizontalLayoutByDefault:!1,layoutOptions:[{label:this.$t("MAILWEBCLIENT.LABEL_VERT_SPLIT_LAYOUT"),value:!1},{label:this.$t("MAILWEBCLIENT.LABEL_HORIZ_SPLIT_LAYOUT"),value:!0}],saving:!1}},beforeRouteLeave(t,o,l){this.$root.doBeforeRouteLeave(t,o,l)},mounted(){this.saving=!1,this.populate()},methods:{populate(){const t=b.A.getEditableByAdmin();this.autocreateMailAccountOnNewUserFirstLogin=t.autocreateMailAccountOnNewUserFirstLogin,this.allowMultiAccounts=t.allowMultiAccounts,this.allowAddAccounts=t.allowAddAccounts,this.allowHorizontalLayout=t.allowHorizontalLayout,this.horizontalLayoutByDefault=t.horizontalLayoutByDefault},hasChanges(){const t=b.A.getEditableByAdmin();return this.autocreateMailAccountOnNewUserFirstLogin!==t.autocreateMailAccountOnNewUserFirstLogin||this.allowAddAccounts!==t.allowAddAccounts||this.allowHorizontalLayout!==t.allowHorizontalLayout||this.horizontalLayoutByDefault!==t.horizontalLayoutByDefault},revertChanges(){this.populate()},save(){if(!this.saving){this.saving=!0;const t={AutocreateMailAccountOnNewUserFirstLogin:this.autocreateMailAccountOnNewUserFirstLogin,AllowAddAccounts:this.allowAddAccounts,HorizontalLayoutByDefault:this.horizontalLayoutByDefault};T.A.sendRequest({moduleName:"Mail",methodName:"UpdateSettings",parameters:t}).then((o=>{this.saving=!1,!0===o?(b.A.saveEditableByAdmin({autocreateMailAccountOnNewUserFirstLogin:t.AutocreateMailAccountOnNewUserFirstLogin,allowAddAccounts:t.AllowAddAccounts,horizontalLayoutByDefault:t.HorizontalLayoutByDefault}),this.populate(),N.A.showReport(this.$t("COREWEBCLIENT.REPORT_SETTINGS_UPDATE_SUCCESS"))):N.A.showError(this.$t("COREWEBCLIENT.ERROR_SAVING_SETTINGS_FAILED"))}),(t=>{this.saving=!1,N.A.showError(I.A.getTextFromResponse(t,this.$t("COREWEBCLIENT.ERROR_SAVING_SETTINGS_FAILED")))}))}}}};var v=l(2807),p=l(8958),B=l(3316),O=l(4189),S=l(7022),C=l(3796),M=l(2606),U=l(6384),f=l(9035),k=l(5859),F=l(8582),R=l.n(F);const q=(0,v.A)(y,[["render",m]]),D=q;R()(y,"components",{QScrollArea:p.A,QCard:B.A,QCardSection:O.A,QCheckbox:S.A,QItemLabel:C.A,QSelect:M.A,QBtn:U.A,QInnerLoading:f.A,QLinearProgress:k.A})}}]);