import{n as e}from"./chunk-QTnfLwEv.js";import{C as t,D as n,E as r,L as i,W as a,Y as o,Z as s,_ as c,a as l,et as u,k as d,s as f,w as p,x as m}from"./app-DlClqDLk.js";import{t as h}from"./i18n-BVQ5D34c.js";import{n as g,t as _}from"./TextInput-D7zhx-Hf.js";import{t as v}from"./InputLabel-C2hoQBug.js";import{t as y}from"./PrimaryButton-D619up01.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=d({__name:`UpdatePasswordForm`,setup(e){let d=o(null),w=o(null),T=l({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`),d.value?.focus()),T.errors.current_password&&(T.reset(`current_password`),w.value?.focus())}})};return(e,o)=>(i(),p(`section`,null,[m(`header`,null,[m(`h2`,b,u(s(h)(`Update Password`)),1),m(`p`,x,u(s(h)(`Ensure your account is using a long, random password to stay secure.`)),1)]),m(`form`,{onSubmit:c(E,[`prevent`]),class:`mt-6 space-y-6`},[m(`div`,null,[n(v,{for:`current_password`,value:s(h)(`Current Password`)},null,8,[`value`]),n(_,{id:`current_password`,ref_key:`currentPasswordInput`,ref:w,modelValue:s(T).current_password,"onUpdate:modelValue":o[0]||=e=>s(T).current_password=e,type:`password`,class:`mt-1 block w-full`,autocomplete:`current-password`},null,8,[`modelValue`]),n(g,{message:s(T).errors.current_password,class:`mt-2`},null,8,[`message`])]),m(`div`,null,[n(v,{for:`password`,value:s(h)(`New Password`)},null,8,[`value`]),n(_,{id:`password`,ref_key:`passwordInput`,ref:d,modelValue:s(T).password,"onUpdate:modelValue":o[1]||=e=>s(T).password=e,type:`password`,class:`mt-1 block w-full`,autocomplete:`new-password`},null,8,[`modelValue`]),n(g,{message:s(T).errors.password,class:`mt-2`},null,8,[`message`])]),m(`div`,null,[n(v,{for:`password_confirmation`,value:s(h)(`Confirm Password`)},null,8,[`value`]),n(_,{id:`password_confirmation`,modelValue:s(T).password_confirmation,"onUpdate:modelValue":o[2]||=e=>s(T).password_confirmation=e,type:`password`,class:`mt-1 block w-full`,autocomplete:`new-password`},null,8,[`modelValue`]),n(g,{message:s(T).errors.password_confirmation,class:`mt-2`},null,8,[`message`])]),m(`div`,S,[n(y,{disabled:s(T).processing},{default:a(()=>[r(u(s(h)(`Save`)),1)]),_:1},8,[`disabled`]),n(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:a(()=>[s(T).recentlySuccessful?(i(),p(`p`,C,u(s(h)(`Saved.`)),1)):t(``,!0)]),_:1})])],32)]))}}),T=e({default:()=>E}),E=w;export{T as n,E as t};