import{d as f,x as w,r as m,j as _,_ as g,o as v,c as b,a as e,l as o,n as a,y as I,q as l,T as y,B as S,J as L}from"./app-DZcRemIr.js";import{I as V}from"./InputError-CdOWCVDe.js";import{A as P}from"./AppLayout-O17sF3e2.js";import{H as x,S as B}from"./Layout-mLgnxqwV.js";import{B as E}from"./index-CA0zsXLm.js";import{I as H}from"./Input-C686KDpn.js";import{L as C}from"./Label-DFdxTKen.js";import"./AppSidebarLayout-DzMma2g7.js";import"./SiifIconBC3-DYQKLzWx.js";const k=f({__name:"Password",setup(c,{expose:r}){r();const i=[{title:"Password settings",href:"/settings/password"}],s=m(null),d=m(null),t=w({current_password:"",password:"",password_confirmation:""}),p={breadcrumbItems:i,passwordInput:s,currentPasswordInput:d,form:t,updatePassword:()=>{t.put(route("password.update"),{preserveScroll:!0,onSuccess:()=>t.reset(),onError:u=>{u.password&&(t.reset("password","password_confirmation"),s.value instanceof HTMLInputElement&&s.value.focus()),u.current_password&&(t.reset("current_password"),d.value instanceof HTMLInputElement&&d.value.focus())}})},InputError:V,AppLayout:P,SettingsLayout:B,get Head(){return _},HeadingSmall:x,get Button(){return E},get Input(){return H},get Label(){return C}};return Object.defineProperty(p,"__isScriptSetup",{enumerable:!1,value:!0}),p}}),N={class:"space-y-6"},T={class:"grid gap-2"},U={class:"grid gap-2"},j={class:"grid gap-2"},A={class:"flex items-center gap-4"},M={class:"text-sm text-neutral-600"};function h(c,r,i,s,d,t){return v(),b(s.AppLayout,{breadcrumbs:s.breadcrumbItems},{default:e(()=>[o(s.Head,{title:"Password settings"}),o(s.SettingsLayout,null,{default:e(()=>[a("div",N,[o(s.HeadingSmall,{title:"Update password",description:"Ensure your account is using a long, random password to stay secure"}),a("form",{onSubmit:I(s.updatePassword,["prevent"]),class:"space-y-6"},[a("div",T,[o(s.Label,{for:"current_password"},{default:e(()=>[...r[3]||(r[3]=[l("Current password",-1)])]),_:1}),o(s.Input,{id:"current_password",ref:"currentPasswordInput",modelValue:s.form.current_password,"onUpdate:modelValue":r[0]||(r[0]=n=>s.form.current_password=n),type:"password",class:"mt-1 block w-full",autocomplete:"current-password",placeholder:"Current password"},null,8,["modelValue"]),o(s.InputError,{message:s.form.errors.current_password},null,8,["message"])]),a("div",U,[o(s.Label,{for:"password"},{default:e(()=>[...r[4]||(r[4]=[l("New password",-1)])]),_:1}),o(s.Input,{id:"password",ref:"passwordInput",modelValue:s.form.password,"onUpdate:modelValue":r[1]||(r[1]=n=>s.form.password=n),type:"password",class:"mt-1 block w-full",autocomplete:"new-password",placeholder:"New password"},null,8,["modelValue"]),o(s.InputError,{message:s.form.errors.password},null,8,["message"])]),a("div",j,[o(s.Label,{for:"password_confirmation"},{default:e(()=>[...r[5]||(r[5]=[l("Confirm password",-1)])]),_:1}),o(s.Input,{id:"password_confirmation",modelValue:s.form.password_confirmation,"onUpdate:modelValue":r[2]||(r[2]=n=>s.form.password_confirmation=n),type:"password",class:"mt-1 block w-full",autocomplete:"new-password",placeholder:"Confirm password"},null,8,["modelValue"]),o(s.InputError,{message:s.form.errors.password_confirmation},null,8,["message"])]),a("div",A,[o(s.Button,{disabled:s.form.processing},{default:e(()=>[...r[6]||(r[6]=[l("Save password",-1)])]),_:1},8,["disabled"]),o(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",persisted:""},{default:e(()=>[S(a("p",M,"Saved.",512),[[L,s.form.recentlySuccessful]])]),_:1})])],32)])]),_:1})]),_:1})}const R=g(k,[["render",h],["__file","/var/www/resources/js/pages/settings/Password.vue"]]);export{R as default};
