import{W as p,j as s}from"./BulkImageUpload-DGPbX05r.js";import{U as w}from"./User-DMCQU0ZG.js";import{U as x}from"./UserMenu-BCHgG7Y0.js";import j from"./Path-BGQq4Hlj.js";import{I as o}from"./Input-CR3dcIBA.js";import{S as N}from"./sweetalert2.all-CGGHY7K6.js";import"./bootstrap.esm-e_F80uXB.js";const C=l=>{const{data:e,setData:c,post:i,processing:n,errors:a,clearErrors:m,reset:t}=p({oldpassword:"",password:"",password_confirmation:""}),d=r=>{c(r.target.name,r.target.type==="checkbox"?r.target.checked:r.target.value),m(r.target.name)},h=r=>{r.preventDefault(),i(route("change-password"),{onSuccess:()=>{t(),N.fire("Password Change Sucessfully !","","success")}})};return s.jsxs(w,{children:[s.jsx(j,{title:"User Settings"}),s.jsx("div",{className:"container-fluid user-container",children:s.jsx("div",{className:"container",children:s.jsxs("div",{className:"row",children:[s.jsx("div",{className:"col-md-3",children:s.jsx(x,{user:l.auth.user})}),s.jsx("div",{className:"col-md-9",children:s.jsx("div",{className:"row",children:s.jsx("div",{className:"col-md-8 mx-auto",children:s.jsxs("div",{className:"card side-card",children:[s.jsx("div",{className:"card-header",children:"Change User Password"}),s.jsx("div",{className:"card-body",children:s.jsxs("form",{className:"p-4",onSubmit:h,id:"catform",children:[s.jsxs("div",{className:"form-row  row",children:[s.jsxs("div",{className:"col-sm-4",children:[s.jsx("label",{htmlFor:"",children:"Old Password"}),s.jsx("span",{className:"spcol",children:":"})]}),s.jsxs("div",{className:"col-sm-8 sticky",children:[s.jsx(o,{type:"password",className:a.oldpassword&&"inerror",name:"oldpassword",value:e.oldpassword,placeholder:"Enter Old Password",handleChange:d}),a.oldpassword&&s.jsx("div",{className:"smart-valid",children:a.oldpassword})]})]}),s.jsxs("div",{className:"form-row  row",children:[s.jsxs("div",{className:"col-sm-4",children:[s.jsx("label",{htmlFor:"",children:"New Password"}),s.jsx("span",{className:"spcol",children:":"})]}),s.jsxs("div",{className:"col-sm-8 sticky",children:[s.jsx(o,{type:"password",className:a.password&&"inerror",name:"password",value:e.password,placeholder:"Enter New Password",handleChange:d}),a.password&&s.jsx("div",{className:"smart-valid",children:a.password})]})]}),s.jsxs("div",{className:"form-row  row",children:[s.jsxs("div",{className:"col-sm-4",children:[s.jsx("label",{htmlFor:"",children:"Confirm Password"}),s.jsx("span",{className:"spcol",children:":"})]}),s.jsxs("div",{className:"col-sm-8 sticky",children:[s.jsx(o,{type:"password",className:a.password_confirmation&&"inerror",name:"password_confirmation",value:e.password_confirmation,placeholder:"Enter Confirm Password",handleChange:d}),a.password_confirmation&&s.jsx("div",{className:"smart-valid",children:a.password_confirmation})]})]}),s.jsxs("div",{className:"form-row row mb-0",children:[s.jsx("div",{className:"col-sm-4"}),s.jsx("div",{className:"col-sm-8 text-end",children:s.jsx("button",{disabled:n,className:"btn  btn-primary",children:"Change Password"})})]})]})})]})})})})]})})})]})};export{C as default};
