import{r as w,x as j,j as s,Q as v}from"./app-BBZbvTSO.js";import{I as p}from"./input-error-Bz7f2c6i.js";import{A as _}from"./app-layout-DgXit_SB.js";import{S as y}from"./layout-CZOI4-_w.js";import{H as N}from"./heading-small-CjA8Z0WM.js";import{B as C}from"./button-CZmOQP7j.js";import{I as i}from"./input-dmj4QjAp.js";import{L as n}from"./label-BPDCCRHl.js";import{z as S}from"./transition-BejWKDY2.js";/* empty css            */import"./utils-YhN_nlHn.js";import"./index-C0VDnRYN.js";import"./index-CbDI-tXU.js";import"./Combination-9YgcTppv.js";import"./index-13DH8-b5.js";import"./index-C1VwruLz.js";import"./tooltip-CRkL5R4V.js";import"./index-hDbW6ayQ.js";import"./floating-ui.dom-DtF1XweH.js";import"./index-AiAmtg3H.js";import"./dropdown-menu-DkvU_mzU.js";import"./index-IvSACaye.js";import"./index-BosTFUDi.js";import"./index-Dbn6AP0q.js";import"./settings-1sj5BLwD.js";import"./app-logo-icon-BZsH9yGo.js";import"./index-BnKWxTXF.js";import"./image-BEhzBCM8.js";import"./globe-DRyUQWUz.js";import"./users-DU0sA3Q7.js";import"./layout-grid-CF44vN4j.js";import"./chevron-right-fDICdnKB.js";import"./heading-D7WRqD78.js";import"./separator-BzKY_P4f.js";const b=[{title:"Password settings",href:"/settings/password"}];function is(){const d=w.useRef(null),m=w.useRef(null),{data:o,setData:e,errors:t,put:f,reset:a,processing:x,recentlySuccessful:h}=j({current_password:"",password:"",password_confirmation:""}),g=r=>{r.preventDefault(),f(route("password.update"),{preserveScroll:!0,onSuccess:()=>a(),onError:c=>{var l,u;c.password&&(a("password","password_confirmation"),(l=d.current)==null||l.focus()),c.current_password&&(a("current_password"),(u=m.current)==null||u.focus())}})};return s.jsxs(_,{breadcrumbs:b,children:[s.jsx(v,{title:"Profile settings"}),s.jsx(y,{children:s.jsxs("div",{className:"space-y-6",children:[s.jsx(N,{title:"Update password",description:"Ensure your account is using a long, random password to stay secure"}),s.jsxs("form",{onSubmit:g,className:"space-y-6",children:[s.jsxs("div",{className:"grid gap-2",children:[s.jsx(n,{htmlFor:"current_password",children:"Current password"}),s.jsx(i,{id:"current_password",ref:m,value:o.current_password,onChange:r=>e("current_password",r.target.value),type:"password",className:"mt-1 block w-full",autoComplete:"current-password",placeholder:"Current password"}),s.jsx(p,{message:t.current_password})]}),s.jsxs("div",{className:"grid gap-2",children:[s.jsx(n,{htmlFor:"password",children:"New password"}),s.jsx(i,{id:"password",ref:d,value:o.password,onChange:r=>e("password",r.target.value),type:"password",className:"mt-1 block w-full",autoComplete:"new-password",placeholder:"New password"}),s.jsx(p,{message:t.password})]}),s.jsxs("div",{className:"grid gap-2",children:[s.jsx(n,{htmlFor:"password_confirmation",children:"Confirm password"}),s.jsx(i,{id:"password_confirmation",value:o.password_confirmation,onChange:r=>e("password_confirmation",r.target.value),type:"password",className:"mt-1 block w-full",autoComplete:"new-password",placeholder:"Confirm password"}),s.jsx(p,{message:t.password_confirmation})]}),s.jsxs("div",{className:"flex items-center gap-4",children:[s.jsx(C,{disabled:x,children:"Save password"}),s.jsx(S,{show:h,enter:"transition ease-in-out",enterFrom:"opacity-0",leave:"transition ease-in-out",leaveTo:"opacity-0",children:s.jsx("p",{className:"text-sm text-neutral-600",children:"Saved"})})]})]})]})})]})}export{is as default};
