import{d as F,i as V,r as n,c as w,w as k,a as q,o as x,b as E,u as c,e as $,n as h,j,_ as B}from"./index-BPhyrT9l.js";const C=F({__name:"update-folder-name-dialog",props:{name:{}},emits:["select","validate","close","confirm"],setup(m,{emit:p}){const s=m,t=p,{$tr:o}=V(j),d=n(),a=n({oldName:s.name,newName:s.name}),u=n(!1),r=w(()=>{var e;return((e=d.value)==null?void 0:e.isDirty)&&u.value});function f(e){return!!e||o("validation.text.required")}function v(e){return e!==a.value.oldName||o("validation.text.equality")}function N(e){u.value=e}function y(){a.value.newName&&r.value&&(t("select",a.value),t("confirm"))}function _(){t("select",a.value)}return k(()=>r.value,e=>{t("validate",e)},{immediate:!0}),(e,l)=>(x(),q("div",{class:h(e.$style.updateFolderName)},[E(c($),{ref_key:"inp",ref:d,modelValue:a.value.newName,"onUpdate:modelValue":[l[0]||(l[0]=i=>a.value.newName=i),_],autofocus:!0,rules:[f,v],placeholder:c(o)("update.folder.name.input.placeholder"),onEscape:l[1]||(l[1]=i=>t("close")),onEnter:y,"onUpdate:valid":N},null,8,["modelValue","rules","placeholder"])],2))}}),U="_updateFolderName_nyrls_1",b={updateFolderName:U},g={$style:b},M=B(C,[["__cssModules",g]]);export{M as default};
