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