import{r as c,u as _,a as i,f as o,b as e,d as a,e as m,q as g,s as v,o as w,E as y,g as V}from"./app-DtilF0jd.js";import{_ as n,b as l,a as u}from"./InputError-CGryjV6E.js";import{P as x}from"./PrimaryButton-8n0N1KDV.js";import"./_plugin-vue_export-helper-DlAUqK2U.js";const k={class:"flex items-center gap-4"},b={key:0,class:"text-sm text-green-600 dark:text-green-400"},U={__name:"UpdatePasswordForm",setup(C){const d=c(null),p=c(null),s=_({current_password:"",password:"",password_confirmation:""}),f=()=>{s.put(route("password.update"),{preserveScroll:!0,onSuccess:()=>s.reset(),onError:()=>{s.errors.password&&(s.reset("password","password_confirmation"),d.value.focus()),s.errors.current_password&&(s.reset("current_password"),p.value.focus())}})};return(P,r)=>(w(),i("section",null,[r[4]||(r[4]=o("header",null,[o("p",{class:"text-sm text-gray-600 dark:text-gray-400"}," Asegúrate de usar una contraseña larga y aleatoria para mantener tu cuenta segura. ")],-1)),o("form",{onSubmit:V(f,["prevent"]),class:"mt-6 space-y-6"},[o("div",null,[e(n,{for:"current_password",value:"Contraseña Actual"}),e(l,{id:"current_password",ref_key:"currentPasswordInput",ref:p,modelValue:a(s).current_password,"onUpdate:modelValue":r[0]||(r[0]=t=>a(s).current_password=t),type:"password",class:"mt-1 block w-full",autocomplete:"current-password"},null,8,["modelValue"]),e(u,{message:a(s).errors.current_password,class:"mt-2"},null,8,["message"])]),o("div",null,[e(n,{for:"password",value:"Nueva Contraseña"}),e(l,{id:"password",ref_key:"passwordInput",ref:d,modelValue:a(s).password,"onUpdate:modelValue":r[1]||(r[1]=t=>a(s).password=t),type:"password",class:"mt-1 block w-full",autocomplete:"new-password"},null,8,["modelValue"]),e(u,{message:a(s).errors.password,class:"mt-2"},null,8,["message"])]),o("div",null,[e(n,{for:"password_confirmation",value:"Confirmar Contraseña"}),e(l,{id:"password_confirmation",modelValue:a(s).password_confirmation,"onUpdate:modelValue":r[2]||(r[2]=t=>a(s).password_confirmation=t),type:"password",class:"mt-1 block w-full",autocomplete:"new-password"},null,8,["modelValue"]),e(u,{message:a(s).errors.password_confirmation,class:"mt-2"},null,8,["message"])]),o("div",k,[e(x,{disabled:a(s).processing},{default:m(()=>[...r[3]||(r[3]=[g("Guardar",-1)])]),_:1},8,["disabled"]),e(y,{"enter-active-class":"transition ease-in-out","enter-from-class":"opacity-0","leave-active-class":"transition ease-in-out","leave-to-class":"opacity-0"},{default:m(()=>[a(s).recentlySuccessful?(w(),i("p",b," Contraseña actualizada. ")):v("",!0)]),_:1})])],32)]))}};export{U as default};
