import{X as g,s as l,y as x,o as c,c as i,d as o,a as e,u as a,w as u,T as V,C as b,b as k,e as C}from"./app-I4K73wff.js";import{_ as d}from"./InputError-H3v_qTU0.js";import{_ as p}from"./InputLabel-kIOW7zCm.js";import{_ as h}from"./PrimaryButton-nm2-bJVd.js";import{_ as m}from"./TextInput-QqzhSxrA.js";const N=o("header",null,[o("h2",{class:"text-lg font-medium text-gray-900"},"Actualizar contraseña"),o("p",{class:"mt-1 text-sm text-gray-600"}," Asegúrese de que la cuenta utilice una contraseña larga y aleatoria para mantenerse segura. ")],-1),S={class:"flex items-center gap-4"},$={key:0,class:"text-sm text-gray-600"},U={__name:"UpdatePasswordForm",props:{user:{type:Object,default:()=>({})}},setup(f){const w=g("$swal"),n=l(null),_=l(null),v=f.user,s=x({password:"",password_confirmation:""}),y=()=>{s.put(route("password.updateuser",v.id),{preserveScroll:!0,onSuccess:()=>{s.reset(),w({title:"Contraseña actualizada",text:"El usuario se ha actualizado exitosamente",icon:"success"})},onError:()=>{s.errors.password&&(s.reset("password","password_confirmation"),n.value.focus()),s.errors.current_password&&(s.reset("current_password"),_.value.focus())}})};return(T,r)=>(c(),i("section",null,[N,o("form",{onSubmit:b(y,["prevent"]),class:"mt-6 space-y-6"},[o("div",null,[e(p,{for:"password",value:"Nueva contraseña"}),e(m,{id:"password",ref_key:"passwordInput",ref:n,modelValue:a(s).password,"onUpdate:modelValue":r[0]||(r[0]=t=>a(s).password=t),type:"password",class:"mt-1 block w-full",autocomplete:"new-password"},null,8,["modelValue"]),e(d,{message:a(s).errors.password,class:"mt-2"},null,8,["message"])]),o("div",null,[e(p,{for:"password_confirmation",value:"Confirmar Contraseña"}),e(m,{id:"password_confirmation",modelValue:a(s).password_confirmation,"onUpdate:modelValue":r[1]||(r[1]=t=>a(s).password_confirmation=t),type:"password",class:"mt-1 block w-full",autocomplete:"new-password"},null,8,["modelValue"]),e(d,{message:a(s).errors.password_confirmation,class:"mt-2"},null,8,["message"])]),o("div",S,[e(h,{disabled:a(s).processing},{default:u(()=>[k("Actualizar contraseña")]),_:1},8,["disabled"]),e(V,{"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:u(()=>[a(s).recentlySuccessful?(c(),i("p",$,"Saved.")):C("",!0)]),_:1})])],32)]))}};export{U as default};
