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