import{i as g,d as _,T as V,c as v,w as e,o as y,g as l,t as d,u as o,a as p,b as r,n as P}from"./app-WJL2kJBE.js";import{_ as b}from"./ActionMessage-CbAgcH97.js";import{_ as k}from"./Button-B1uOz4tP.js";import{_ as S}from"./FormSection-VZbtMXdy.js";import{_ as c}from"./Input-C4-VG2dv.js";import{_ as u}from"./InputError-idDGfizs.js";import{_ as m}from"./Label-CBaaVbfI.js";import"./SectionTitle-DsJypKOL.js";const $={class:"col-span-6 sm:col-span-4"},I={class:"col-span-6 sm:col-span-4"},U={class:"col-span-6 sm:col-span-4"},q={__name:"UpdatePasswordForm",setup(x){const{t:n}=g({}),i=_(null),w=_(null),s=V({current_password:"",password:"",password_confirmation:""}),f=()=>{s.put(route("user-password.update"),{errorBag:"updatePassword",preserveScroll:!0,onSuccess:()=>s.reset(),onError:()=>{s.errors.password&&(s.reset("password","password_confirmation"),i.value.focus()),s.errors.current_password&&(s.reset("current_password"),w.value.focus())}})};return(B,a)=>(y(),v(S,{onSubmitted:f},{title:e(()=>[l(d(o(n)("Update Password")),1)]),description:e(()=>[l(d(o(n)("Ensure your account is using a long, random password to stay secure.")),1)]),form:e(()=>[p("div",$,[r(m,{for:"current_password",value:"Current Password"}),r(c,{id:"current_password",ref_key:"currentPasswordInput",ref:w,modelValue:o(s).current_password,"onUpdate:modelValue":a[0]||(a[0]=t=>o(s).current_password=t),type:"password",class:"mt-1 block w-full",autocomplete:"current-password"},null,8,["modelValue"]),r(u,{message:o(s).errors.current_password,class:"mt-2"},null,8,["message"])]),p("div",I,[r(m,{for:"password",value:"New Password"}),r(c,{id:"password",ref_key:"passwordInput",ref:i,modelValue:o(s).password,"onUpdate:modelValue":a[1]||(a[1]=t=>o(s).password=t),type:"password",class:"mt-1 block w-full",autocomplete:"new-password"},null,8,["modelValue"]),r(u,{message:o(s).errors.password,class:"mt-2"},null,8,["message"])]),p("div",U,[r(m,{for:"password_confirmation",value:"Confirm Password"}),r(c,{id:"password_confirmation",modelValue:o(s).password_confirmation,"onUpdate:modelValue":a[2]||(a[2]=t=>o(s).password_confirmation=t),type:"password",class:"mt-1 block w-full",autocomplete:"new-password"},null,8,["modelValue"]),r(u,{message:o(s).errors.password_confirmation,class:"mt-2"},null,8,["message"])])]),actions:e(()=>[r(b,{on:o(s).recentlySuccessful,class:"mr-3"},{default:e(()=>[l(d(o(n)("Saved.")),1)]),_:1},8,["on"]),r(k,{class:P({"opacity-25":o(s).processing}),disabled:o(s).processing},{default:e(()=>[l(d(o(n)("Save")),1)]),_:1},8,["class","disabled"])]),_:1}))}};export{q as default};
