import{d as F,i as V,r as n,c as w,w as E,a as k,o as q,b as x,u as c,E as $,n as h,z,_ as B}from"./index-DSRztm3-.js";const U=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(z),d=n(),a=n({oldName:s.name,newName:s.name}),u=n(!1),r=w(()=>d.value?.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 E(()=>r.value,e=>{t("validate",e)},{immediate:!0}),(e,l)=>(q(),k("div",{class:h(e.$style.updateFolderName)},[x(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))}}),b="_updateFolderName_nyrls_1",g={updateFolderName:b},C={$style:g},M=B(U,[["__cssModules",C]]);export{M as default};
