1import{W as b,r as u,j as s}from"./app-D34TVwyI.js";import{p as g}from"./Profile-logo-D1jZRJI0.js";/* empty css */import{U as v}from"./UserHeader-DPUDGXAj.js";import _ from"./ManagerSideBar-BhZJsluj.js";import{A as y}from"./AdminFooter-C4q9JCeX.js";import{E as i,a as d}from"./eye-DOLIFmK3.js";import"./Logo-DfFocTjf.js";import"./index-D6OXyEVj.js";/* empty css */import"./Image-CMWwdYzD.js";const H=({user:n,flash:j})=>{const{data:t,setData:o,post:h,processing:m,errors:r,reset:w}=b({current_password:"",new_password:"",new_password_confirmation:""}),[p,c]=u.useState(j.success||""),[a,f]=u.useState({current:!1,new:!1,confirm:!1}),l=e=>{f(x=>({...x,[e]:!x[e]}))},N=e=>{e.preventDefault(),h(route("manager.updatePassword"),{preserveScroll:!0,onSuccess:()=>{c("Password updated successfully!"),w()},onError:()=>{c("")}})};return s.jsxs("div",{className:"page-wrapper",children:[s.jsx("header",{children:s.jsx(v,{})}),s.jsx("main",{className:"main-box",children:s.jsxs("div",{className:"container my-5",children:[s.jsx("div",{className:"border-0 shadow card",children:s.jsxs("div",{className:"text-center card-body",children:[s.jsx("h1",{children:s.jsxs("b",{children:["Hi ",n.name,"!"]})}),s.jsx("h4",{children:s.jsx("b",{children:"Welcome to Your Profile"})}),s.jsx("img",{src:n.avatar?`/storage/${n.avatar}`:g,alt:"Avatar",className:"profile-avatar"})]})}),s.jsxs("div",{className:"mt-4 row",children:[s.jsx("div",{className:"col-md-3",children:s.jsx(_,{})}),s.jsx("div",{className:"col-md-9",children:s.jsx("div",{className:"border-0 shadow card",children:s.jsxs("div",{className:"card-body profile-details",children:[s.jsx("h5",{className:"text-center",children:s.jsx("b",{children:"Change Password"})}),p&&s.jsxs("div",{className:"alert alert-success alert-dismissible fade show d-flex justify-content-between align-items-center",role:"alert",children:[p,s.jsx("button",{type:"button",className:"btn-close",onClick:()=>c(""),"aria-label":"Close"})]}),s.jsxs("form",{onSubmit:N,children:[s.jsxs("div",{className:"mb-3",children:[s.jsx("label",{className:"form-label",children:"Current Password"}),s.jsxs("div",{className:"input-group",children:[s.jsx("input",{type:a.current?"text":"password",className:"form-control",value:t.current_password,onChange:e=>o("current_password",e.target.value),required:!0}),s.jsx("span",{className:"input-group-text",onClick:()=>l("current"),style:{cursor:"pointer"},children:a.current?s.jsx(i,{}):s.jsx(d,{})})]}),r.current_password&&s.jsx("div",{className:"text-danger",children:r.current_password})]}),s.jsxs("div",{className:"mb-3",children:[s.jsx("label",{className:"form-label",children:"New Password"}),s.jsxs("div",{className:"input-group",children:[s.jsx("input",{type:a.new?"text":"password",className:"form-control",value:t.new_password,onChange:e=>o("new_password",e.target.value),required:!0}),s.jsx("span",{className:"input-group-text",onClick:()=>l("new"),style:{cursor:"pointer"},children:a.new?s.jsx(i,{}):s.jsx(d,{})})]}),r.new_password&&s.jsx("div",{className:"text-danger",children:r.new_password})]}),s.jsxs("div",{className:"mb-3",children:[s.jsx("label",{className:"form-label",children:"Confirm New Password"}),s.jsxs("div",{className:"input-group",children:[s.jsx("input",{type:a.confirm?"text":"password",className:"form-control",value:t.new_password_confirmation,onChange:e=>o("new_password_confirmation",e.target.value),required:!0}),s.jsx("span",{className:"input-group-text",onClick:()=>l("confirm"),style:{cursor:"pointer"},children:a.confirm?s.jsx(i,{}):s.jsx(d,{})})]}),r.new_password_confirmation&&s.jsx("div",{className:"text-danger",children:r.new_password_confirmation})]}),s.jsxs("div",{className:"text-end",children:[s.jsx("button",{type:"button",className:"btn btn-secondaryy me-2",children:"Cancel"}),s.jsx("button",{type:"submit",className:"btn btn-blue",disabled:m,children:m?"Updating...":"Change Password"})]})]})]})})})]})]})}),s.jsx("footer",{children:s.jsx(y,{})})]})};export{H as default};
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.