import{c as v,i as f,A as N,H as r,w as _,f as w,g as R,h as x,l as m,as as D,n as V,_ as k}from"./en-BH2p-VLM.js";import{F as $,P as y}from"./main-BHmLaavD.js";const C=v({__name:"chat-rename-dialog",props:{chatName:{}},emits:["select","validate"],setup(d,{emit:u}){const{chatsNameMaxLength:o}=y,{$tr:s}=f(N),c=d,l=u,a=r({oldName:c.chatName,newName:c.chatName}),i=r(!1);function h(e){return!!e||s("validation.text.required")}function p(e){return $(e)<o||s("validation.text.length",{length:o.toString()})}function g(){l("select",a.value)}return l("select",a.value),_(()=>i.value,e=>l("validate",e),{immediate:!0}),(e,t)=>(w(),R("div",{class:V(e.$style.chatRenameDialog)},[x(m(D),{modelValue:a.value.newName,"onUpdate:modelValue":t[0]||(t[0]=n=>a.value.newName=n),rules:[h,p],placeholder:m(s)("chat.rename.dialog.input.placeholder"),onChange:g,"onUpdate:valid":t[1]||(t[1]=n=>i.value=n)},null,8,["modelValue","rules","placeholder"])],2))}}),M="_chatRenameDialog_ovbsh_1",q={chatRenameDialog:M},z={$style:q},L=k(C,[["__cssModules",z]]);export{L as default};
