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