import{n as e}from"./chunk-QTnfLwEv.js";import{$ as t,C as n,D as r,E as i,I as a,J as o,O as s,U as c,X as l,_ as u,a as d,s as f,w as p,x as m}from"./app-CF_tOhgx.js";import{t as h}from"./i18n-DQ8qjn2c.js";import{n as g,t as _}from"./TextInput-BWL2S2Ld.js";import{t as v}from"./InputLabel-DzHsxXl5.js";import{t as y}from"./PrimaryButton-DuMDFm8O.js";var b={class:`text-lg font-medium text-gray-900 dark:text-gray-100`},x={class:`mt-1 text-sm text-gray-600 dark:text-gray-400`},S={class:`flex items-center gap-4`},C={key:0,class:`text-sm text-gray-600 dark:text-gray-400`},w=s({__name:`UpdatePasswordForm`,setup(e){let s=o(null),w=o(null),T=d({current_password:``,password:``,password_confirmation:``}),E=()=>{T.put(route(`password.update`),{preserveScroll:!0,onSuccess:()=>{T.reset()},onError:()=>{T.errors.password&&(T.reset(`password`,`password_confirmation`),s.value?.focus()),T.errors.current_password&&(T.reset(`current_password`),w.value?.focus())}})};return(e,o)=>(a(),p(`section`,null,[m(`header`,null,[m(`h2`,b,t(l(h)(`Update Password`)),1),m(`p`,x,t(l(h)(`Ensure your account is using a long, random password to stay secure.`)),1)]),m(`form`,{onSubmit:u(E,[`prevent`]),class:`mt-6 space-y-6`},[m(`div`,null,[r(v,{for:`current_password`,value:l(h)(`Current Password`)},null,8,[`value`]),r(_,{id:`current_password`,ref_key:`currentPasswordInput`,ref:w,modelValue:l(T).current_password,"onUpdate:modelValue":o[0]||=e=>l(T).current_password=e,type:`password`,class:`mt-1 block w-full`,autocomplete:`current-password`},null,8,[`modelValue`]),r(g,{message:l(T).errors.current_password,class:`mt-2`},null,8,[`message`])]),m(`div`,null,[r(v,{for:`password`,value:l(h)(`New Password`)},null,8,[`value`]),r(_,{id:`password`,ref_key:`passwordInput`,ref:s,modelValue:l(T).password,"onUpdate:modelValue":o[1]||=e=>l(T).password=e,type:`password`,class:`mt-1 block w-full`,autocomplete:`new-password`},null,8,[`modelValue`]),r(g,{message:l(T).errors.password,class:`mt-2`},null,8,[`message`])]),m(`div`,null,[r(v,{for:`password_confirmation`,value:l(h)(`Confirm Password`)},null,8,[`value`]),r(_,{id:`password_confirmation`,modelValue:l(T).password_confirmation,"onUpdate:modelValue":o[2]||=e=>l(T).password_confirmation=e,type:`password`,class:`mt-1 block w-full`,autocomplete:`new-password`},null,8,[`modelValue`]),r(g,{message:l(T).errors.password_confirmation,class:`mt-2`},null,8,[`message`])]),m(`div`,S,[r(y,{disabled:l(T).processing},{default:c(()=>[i(t(l(h)(`Save`)),1)]),_:1},8,[`disabled`]),r(f,{"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:c(()=>[l(T).recentlySuccessful?(a(),p(`p`,C,t(l(h)(`Saved.`)),1)):n(``,!0)]),_:1})])],32)]))}}),T=e({default:()=>E}),E=w;export{T as n,E as t};