"use strict";(globalThis["webpackChunkaurora_corporate_mobile_ui"]||=[]).push([[9449],{15541(e,a,l){l.r(a),l.d(a,{default:()=>b});var o=l(61758),t=l(58790),i=l(29104);function s(e,a,l,s,r,n){const d=(0,o.g2)("AppDialogInput"),c=(0,o.g2)("ButtonDialog"),u=(0,o.g2)("AppDialog");return(0,o.uX)(),(0,o.Wv)(u,{"data-test-id":"files-create-folder-dialog",modelValue:r.openDialog,"onUpdate:modelValue":a[1]||(a[1]=e=>r.openDialog=e),close:n.cancelDialog},{title:(0,o.k6)(()=>[(0,o.Lk)("div",null,[(0,o.Lk)("span",null,(0,t.v_)(e.$t("MAILWEBCLIENT.ACTION_ADD_NEW_FOLDER")),1)])]),content:(0,o.k6)(()=>[(0,o.bF)(d,{"data-test-id":"files-create-folder-name",class:"q-mx-lg",modelValue:r.folderName,"onUpdate:modelValue":a[0]||(a[0]=e=>r.folderName=e),autofocus:"",outlined:"",onKeyup:(0,i.jR)((0,i.D$)(n.createFolder,["stop"]),["enter"])},null,8,["modelValue","onKeyup"])]),actions:(0,o.k6)(()=>[(0,o.bF)(c,{"data-test-id":"files-create-folder-submit",class:"q-ma-sm",saving:r.saving,disabled:n.submitDisabled,action:n.createFolder,label:e.$t("COREWEBCLIENT.ACTION_CREATE")},null,8,["saving","disabled","action","label"])]),_:1},8,["modelValue","close"])}var r=l(15679),n=l(65210),d=l(93320),c=l(35625),u=l(99107),g=l(9090),p=l(38176),m=l(4971);const f={name:"CreateFolderDialog",components:{AppDialogInput:u.A,ButtonDialog:g.A,AppDialog:c.A},props:{dialog:{type:Boolean,default:!1}},data(){return{folderName:"",openDialog:!1,saving:!1,blockedAfterError:!1}},computed:{submitDisabled(){return this.blockedAfterError||!(0,m.pp)(this.folderName)}},watch:{dialog(e){this.openDialog=e,e&&(this.folderName="",this.saving=!1,this.blockedAfterError=!1)},folderName(){this.blockedAfterError&&(this.blockedAfterError=!1)}},methods:{...(0,r.i0)(n.useFilesStore,["asyncCreateFolder","asyncGetFiles"]),async createFolder(){if(!this.saving&&!this.submitDisabled)if((0,m.pp)(this.folderName)){this.saving=!0;const e=await this.asyncCreateFolder({name:this.folderName});this.saving=!1,e?(this.$emit("closeDialog"),await this.asyncGetFiles()):this.blockedAfterError=!0}else p.A.showError(d.i18n.global.tc("FILESWEBCLIENT.ERROR_INVALID_FOLDER_NAME"))},cancelDialog(){this.$emit("closeDialog")}}};var h=l(12807);const D=(0,h.A)(f,[["render",s]]),b=D}}]);