1import{u as oe,j as e,H as t,l as ce,b as G,g as de,G as Y,I as me,J as xe,K as pe}from"./index-BsiHeWVV.js";import{r as o}from"./vendor-react-BgdDxSAT.js";import{T as v}from"./Tooltip-3Sg7UP4O.js";import{a9 as he,U as H,R as ge,aa as u,t as w,p as J,a4 as be,h as ue,m as K,K as Q,x as fe,i as ye,V as je,k as Ne,B as ve,ab as we}from"./vendor-icons-XzJPSL7j.js";const f=["manager","sales","account"],C={manager:{bg:"bg-primary-50",text:"text-primary-700",border:"border-primary-200",dot:"bg-primary-500"},sales:{bg:"bg-emerald-50",text:"text-emerald-700",border:"border-emerald-200",dot:"bg-emerald-500"},account:{bg:"bg-amber-50",text:"text-amber-700",border:"border-amber-200",dot:"bg-amber-500"},admin:{bg:"bg-red-50",text:"text-red-700",border:"border-red-200",dot:"bg-red-500"}},W=["from-primary-500 to-primary-700","from-emerald-500 to-teal-700","from-amber-500 to-amber-700","from-orange-500 to-red-600","from-primary-600 to-orange-700","from-pink-500 to-rose-700","from-cyan-500 to-sky-700"],Ae=()=>{const{user:m}=oe(),[c,y]=o.useState([]),[h,F]=o.useState([]),[k,M]=o.useState(!0),[j,n]=o.useState(""),[X,_]=o.useState(!1),[i,z]=o.useState(null),[A,x]=o.useState(!1),[N,P]=o.useState(""),[p,S]=o.useState("all"),[B,E]=o.useState(!1),[a,d]=o.useState({firstName:"",lastName:"",email:"",phone:"",password:"",role:"sales",branch_id:""}),$=m?.role==="admin"||m?.role==="manager",D=async()=>{try{const s=await ce(),r=Array.isArray(s)?s:s?.data||[];return F(r),r}catch{return F([]),[]}},g=async()=>{try{M(!0),n("");const s=G(),r=s?.uuid||s?.id||de();if(!r){const q=h.length?h:await D();if(q.length===0){y([]);return}const V=[];for(const L of q)try{const R=await Y(L.uuid||L.id),ne=Array.isArray(R)?R:R?.data||[];V.push(...ne.map(ie=>({...ie,_branchName:L.name})))}catch{}y(V);return}const l=await Y(r),U=Array.isArray(l)?l:l?.data||[];y(U)}catch(s){n(s.message||"Could not load employees"),y([])}finally{M(!1)}};o.useEffect(()=>{$&&(D(),g())},[$]);const I=o.useMemo(()=>c.filter(s=>{const r=N.toLowerCase(),l=!r||(s.username||"").toLowerCase().includes(r)||(s.name||"").toLowerCase().includes(r)||(s.email||"").toLowerCase().includes(r)||(s.first_name||"").toLowerCase().includes(r)||(s.last_name||"").toLowerCase().includes(r),U=p==="all"||s.role===p;return l&&U}),[c,N,p]),O=o.useMemo(()=>{const s=c.length,r={};return f.forEach(l=>{r[l]=0}),c.forEach(l=>{r[l.role]!==void 0&&r[l.role]++}),{total:s,byRole:r}},[c]),Z=s=>{if(s.first_name&&s.last_name)return(s.first_name[0]+s.last_name[0]).toUpperCase();if(s.name&&s.name.includes(" ")){const r=s.name.split(" ");return(r[0][0]+r[r.length-1][0]).toUpperCase()}return(s.name||s.username||s.email||"?")[0].toUpperCase()},ee=s=>s.first_name&&s.last_name?`${s.first_name} ${s.last_name}`:s.name||s.username||s.email||"Unknown",se=s=>{const r=typeof s.id=="string"?s.id.charCodeAt(0)+s.id.charCodeAt(s.id.length-1):s.id||0;return W[r%W.length]},re=s=>{if(!s)return"â";try{return new Date(s).toLocaleDateString(void 0,{year:"numeric",month:"short",day:"numeric"})}catch{return s}},T=()=>{z(null);const s=G();d({firstName:"",lastName:"",email:"",phone:"",password:"",role:"sales",branch_id:s?.uuid||s?.id||h[0]?.uuid||h[0]?.id||""}),_(!0),E(!1),n("")},ae=s=>{z(s),d({firstName:s.first_name||"",lastName:s.last_name||"",email:s.email||"",phone:s.phone||"",password:"",role:s.role||"sales",branch_id:s.branch_id||""}),_(!0),E(!1),n("")},b=()=>{_(!1),z(null),n("")},te=async s=>{if(s.preventDefault(),n(""),i){if(!a.firstName.trim()||!a.lastName.trim()){n("First and last name are required");return}if(a.password&&a.password.length<4){n("Password must be at least 4 characters");return}try{x(!0);const r={firstName:a.firstName.trim(),lastName:a.lastName.trim(),role:a.role};a.email&&(r.email=a.email),a.phone&&(r.phone=a.phone),a.password&&(r.password=a.password),a.branch_id&&(r.branch_id=a.branch_id),await xe(i.id,r),b(),g()}catch(r){n(r.message||"Could not update employee")}finally{x(!1)}}else{if(!a.firstName.trim()||!a.lastName.trim()){n("First and last name are required");return}if(!a.email.trim()){n("Email is required");return}if(!a.password){n("Password is required");return}if(a.password.length<4){n("Password must be at least 4 characters");return}if(!a.branch_id){n("Please select a branch");return}try{x(!0),await pe({firstName:a.firstName.trim(),lastName:a.lastName.trim(),email:a.email.trim(),phone:a.phone||void 0,password:a.password,role:a.role,branch_id:a.branch_id,organization_id:m?.organization_id||m?.organization?.id||""}),b(),g()}catch(r){n(r.message||"Could not create employee")}finally{x(!1)}}},le=async s=>{if(s.id===m?.id){n("You cannot delete your own account");return}const r=`${s.first_name||""} ${s.last_name||""}`.trim()||s.email;if(window.confirm(`Delete employee "${r}"? This cannot be undone.`)){n("");try{x(!0),await me(s.id),g()}catch(l){n(l.message||"Could not delete employee")}finally{x(!1)}}};return $?e.jsxs("div",{className:"min-h-full bg-gray-50",children:[e.jsx("div",{className:"bg-white border-b border-gray-200",children:e.jsx("div",{className:"px-4 py-2 sm:px-5 lg:px-6",children:e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{className:"flex min-w-0 items-center gap-2",children:[e.jsx("div",{className:"flex h-7 w-7 shrink-0 items-center justify-center rounded-lg bg-primary-500 text-white",children:e.jsx(t,{icon:H,size:15,strokeWidth:2})}),e.jsxs("div",{children:[e.jsx("h1",{className:"text-base font-bold tracking-tight text-gray-900",children:"Employee Management"}),e.jsx("p",{className:"hidden text-[11px] text-gray-500 sm:block",children:"Manage your team members and their roles"})]})]}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(v,{text:"Reload employee list from the server",children:e.jsx("button",{type:"button",onClick:g,className:"flex h-8 w-8 items-center justify-center rounded-lg border border-gray-200 p-0 text-gray-500 transition-colors hover:bg-gray-50 hover:text-gray-700",children:e.jsx(t,{icon:ge,size:15,className:k?"animate-spin":""})})}),e.jsx(v,{text:"Add a new employee to this branch",children:e.jsxs("button",{type:"button",onClick:T,className:"flex h-8 items-center gap-1.5 rounded-lg bg-primary-500 px-3 text-xs text-white shadow-sm transition-all hover:bg-primary-600 sm:px-4",children:[e.jsx(t,{icon:u,size:15}),e.jsx("span",{className:"hidden font-medium sm:inline",children:"Add Employee"}),e.jsx("span",{className:"font-medium sm:hidden",children:"Add"})]})})]})]})})}),e.jsxs("div",{className:"space-y-2.5 px-4 py-2.5 sm:px-5 lg:px-6",children:[!k&&c.length>0&&e.jsxs("div",{className:"grid grid-cols-2 gap-2 sm:grid-cols-4",children:[e.jsxs("div",{className:"rounded-lg border border-gray-200 bg-white p-2.5",children:[e.jsxs("div",{className:"mb-0.5 flex items-center gap-1.5",children:[e.jsx(t,{icon:H,size:16,className:"text-gray-400"}),e.jsx("span",{className:"text-xs font-medium text-gray-500 uppercase tracking-wider",children:"Total"})]}),e.jsx("p",{className:"text-lg font-bold text-gray-900",children:O.total})]}),f.map(s=>{const r=C[s];return e.jsxs("button",{onClick:()=>S(l=>l===s?"all":s),className:`rounded-lg border p-2.5 text-left transition-all ${p===s?`${r.bg} ${r.border} ring-2 ring-offset-1 ring-${s==="manager"?"blue":s==="sales"?"emerald":s==="account"?"purple":"red"}-300`:"bg-white border-gray-200 hover:border-gray-300"}`,children:[e.jsxs("div",{className:"mb-0.5 flex items-center gap-1.5",children:[e.jsx("div",{className:`w-2 h-2 rounded-full ${r.dot}`}),e.jsx("span",{className:"text-xs font-medium text-gray-500 uppercase tracking-wider capitalize",children:s})]}),e.jsx("p",{className:"text-lg font-bold text-gray-900",children:O.byRole[s]||0})]},s)})]}),j&&e.jsxs("div",{className:"flex items-center gap-2 rounded-lg border border-red-200 bg-red-50 p-2.5",children:[e.jsx("div",{className:"w-8 h-8 bg-red-100 rounded-full flex items-center justify-center flex-shrink-0",children:e.jsx(t,{icon:w,size:16,className:"text-red-600"})}),e.jsx("p",{className:"text-sm text-red-700 flex-1",children:j}),e.jsx("button",{onClick:()=>n(""),className:"text-red-400 hover:text-red-600",children:e.jsx(t,{icon:w,size:16})})]}),e.jsxs("div",{className:"flex flex-col gap-2 rounded-lg border border-gray-200 bg-white p-2.5 sm:flex-row",children:[e.jsxs("div",{className:"relative flex-1",children:[e.jsx(t,{icon:J,size:18,className:"absolute left-3 top-1/2 -translate-y-1/2 text-gray-400"}),e.jsx("input",{type:"text",value:N,onChange:s=>P(s.target.value),placeholder:"Search users by name, username or email...",className:"w-full rounded-[4px] border border-gray-200 bg-gray-50 py-1.5 pl-10 pr-4 text-xs transition-colors focus:border-transparent focus:bg-white focus:ring-2 focus:ring-primary-500"})]}),e.jsxs("div",{className:"relative",children:[e.jsx(t,{icon:be,size:16,className:"absolute left-3 top-1/2 -translate-y-1/2 text-gray-400"}),e.jsxs("select",{value:p,onChange:s=>S(s.target.value),className:"cursor-pointer appearance-none rounded-[4px] border border-gray-200 bg-gray-50 py-1.5 pl-9 pr-8 text-xs focus:border-transparent focus:bg-white focus:ring-2 focus:ring-primary-500",children:[e.jsx("option",{value:"all",children:"All roles"}),f.map(s=>e.jsx("option",{value:s,className:"capitalize",children:s.charAt(0).toUpperCase()+s.slice(1)},s))]}),e.jsx(t,{icon:ue,size:14,className:"absolute right-3 top-1/2 -translate-y-1/2 text-gray-400 pointer-events-none"})]})]}),e.jsx("div",{className:"bg-white rounded-lg border border-gray-200 overflow-hidden",children:k?e.jsxs("div",{className:"p-8 text-center",children:[e.jsx("div",{className:"w-10 h-10 border-3 border-primary-200 border-t-primary-600 rounded-full animate-spin mx-auto mb-4"}),e.jsx("p",{className:"text-gray-500 font-medium",children:"Loading employees..."})]}):I.length===0?e.jsxs("div",{className:"p-8 text-center",children:[e.jsx("div",{className:"w-16 h-16 bg-gray-100 rounded-full flex items-center justify-center mx-auto mb-4",children:c.length===0?e.jsx(t,{icon:u,size:28,className:"text-gray-400"}):e.jsx(t,{icon:J,size:28,className:"text-gray-400"})}),e.jsx("h3",{className:"text-lg font-semibold text-gray-900 mb-1",children:c.length===0?"N
1o employees yet":"No employees found"}),e.jsx("p",{className:"text-gray-500 mb-4",children:c.length===0?"Get started by adding your first team member.":"Try adjusting your search or filter criteria."}),c.length===0&&e.jsxs("button",{onClick:T,className:"inline-flex items-center gap-2 px-4 py-2 bg-primary-600 text-white rounded-lg hover:bg-primary-700 text-sm",children:[e.jsx(t,{icon:u,size:16})," Add first employee"]})]}):e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"hidden grid-cols-12 gap-3 border-b border-gray-100 bg-gray-50 px-4 py-1.5 text-[10px] font-semibold uppercase tracking-wider text-gray-500 lg:grid",children:[e.jsx("div",{className:"col-span-3",children:"Employee"}),e.jsx("div",{className:"col-span-2",children:"Role"}),e.jsx("div",{className:"col-span-2",children:"Email"}),e.jsx("div",{className:"col-span-2",children:"Phone"}),e.jsx("div",{className:"col-span-1",children:"Joined"}),e.jsx("div",{className:"col-span-2 text-right",children:"Actions"})]}),e.jsx("div",{className:"divide-y divide-gray-100",children:I.map(s=>{const r=C[s.role]||C.staff,l=s.id===m?.id;return e.jsx("div",{className:"group px-3 py-2 transition-colors hover:bg-gray-50/50 sm:px-4",children:e.jsxs("div",{className:"flex flex-col gap-2 lg:grid lg:grid-cols-12 lg:items-center lg:gap-3",children:[e.jsxs("div",{className:"col-span-3 flex min-w-0 items-center gap-2",children:[e.jsx("div",{className:`h-8 w-8 rounded-full bg-gradient-to-br ${se(s)} flex items-center justify-center text-white text-xs font-bold flex-shrink-0 shadow-sm`,children:Z(s)}),e.jsxs("div",{className:"min-w-0",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("p",{className:"truncate text-xs font-semibold text-gray-900",children:ee(s)}),l&&e.jsx("span",{className:"flex-shrink-0 text-[10px] font-bold px-1.5 py-0.5 bg-primary-100 text-primary-700 rounded",children:"YOU"})]}),e.jsx("p",{className:"truncate text-[10px] text-gray-500",children:s.email||"â"})]})]}),e.jsx("div",{className:"col-span-2",children:e.jsxs("span",{className:`inline-flex items-center gap-1 px-2 py-0.5 rounded-full text-[10px] font-semibold ${r.bg} ${r.text} border ${r.border}`,children:[e.jsx("span",{className:`w-1.5 h-1.5 rounded-full ${r.dot}`}),(s.role||"sales").charAt(0).toUpperCase()+(s.role||"sales").slice(1)]})}),e.jsx("div",{className:"col-span-2 hidden lg:block",children:e.jsx("p",{className:"truncate text-xs text-gray-600",children:s.email||"â"})}),e.jsxs("div",{className:"col-span-2 hidden items-center gap-1.5 text-xs text-gray-500 lg:flex",children:[e.jsx(t,{icon:K,size:13,className:"flex-shrink-0"}),s.phone||"â"]}),e.jsx("div",{className:"col-span-1 hidden lg:flex items-center gap-1 text-xs text-gray-500",children:re(s.created_at||s.createdAt)}),e.jsxs("div",{className:"col-span-2 flex items-center justify-end gap-1",children:[e.jsx(v,{text:"Edit this employee's details or role",position:"left",children:e.jsx("button",{type:"button",onClick:()=>ae(s),className:"rounded-lg p-1.5 text-gray-400 transition-colors hover:bg-primary-50 hover:text-primary-600",children:e.jsx(t,{icon:Q,size:16})})}),e.jsx(v,{text:l?"You cannot delete your own account":"Delete this employee",position:"left",children:e.jsx("button",{type:"button",onClick:()=>le(s),disabled:l||A,className:"rounded-lg p-1.5 text-gray-400 transition-colors hover:bg-red-50 hover:text-red-600 disabled:cursor-not-allowed disabled:opacity-30",children:e.jsx(t,{icon:fe,size:16})})})]})]})},s.id)})}),e.jsxs("div",{className:"flex items-center justify-between border-t border-gray-100 bg-gray-50 px-3 py-1.5",children:[e.jsxs("p",{className:"text-xs text-gray-500",children:["Showing ",e.jsx("span",{className:"font-semibold text-gray-700",children:I.length})," of"," ",e.jsx("span",{className:"font-semibold text-gray-700",children:c.length})," employees"]}),(N||p!=="all")&&e.jsx("button",{onClick:()=>{P(""),S("all")},className:"text-xs text-primary-600 hover:text-primary-700 font-medium",children:"Clear filters"})]})]})})]}),X&&e.jsxs("div",{className:"fixed inset-0 z-50 flex items-center justify-center p-4",children:[e.jsx("div",{className:"absolute inset-0 bg-black/40 backdrop-blur-sm",onClick:b}),e.jsxs("div",{className:"relative bg-white rounded-xl shadow-2xl w-full max-w-lg overflow-hidden",children:[e.jsxs("div",{className:"flex items-center justify-between px-6 py-4 border-b border-gray-100",children:[e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("div",{className:"w-10 h-10 rounded-xl flex items-center justify-center bg-primary-50",children:i?e.jsx(t,{icon:Q,size:18,className:"text-primary-600"}):e.jsx(t,{icon:u,size:18,className:"text-primary-600"})}),e.jsxs("div",{children:[e.jsx("h2",{className:"text-lg font-bold text-gray-900",children:i?"Edit Employee":"Add New Employee"}),e.jsx("p",{className:"text-xs text-gray-500",children:i?`Editing ${i.first_name||""} ${i.last_name||""}`.trim()||i.email:"Create a new team member account"})]})]}),e.jsx("button",{onClick:b,className:"p-2 rounded-lg hover:bg-gray-100 text-gray-400 hover:text-gray-600 transition-colors",children:e.jsx(t,{icon:w,size:20})})]}),e.jsxs("form",{onSubmit:te,className:"p-6 space-y-5",children:[j&&e.jsxs("div",{className:"p-3 bg-red-50 border border-red-200 rounded-lg text-sm text-red-700 flex items-center gap-2",children:[e.jsx(t,{icon:w,size:14,className:"flex-shrink-0"}),j]}),e.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-4",children:[e.jsxs("div",{children:[e.jsxs("label",{className:"block text-sm font-semibold text-gray-700 mb-1.5",children:["First Name ",e.jsx("span",{className:"text-red-500",children:"*"})]}),e.jsx("input",{type:"text",value:a.firstName,onChange:s=>d(r=>({...r,firstName:s.target.value})),className:"w-full px-4 py-2.5 border border-gray-300 rounded-xl focus:ring-2 focus:ring-primary-500 focus:border-transparent text-sm",placeholder:"Ekow",autoFocus:!0})]}),e.jsxs("div",{children:[e.jsxs("label",{className:"block text-sm font-semibold text-gray-700 mb-1.5",children:["Last Name ",e.jsx("span",{className:"text-red-500",children:"*"})]}),e.jsx("input",{type:"text",value:a.lastName,onChange:s=>d(r=>({...r,lastName:s.target.value})),className:"w-full px-4 py-2.5 border border-gray-300 rounded-xl focus:ring-2 focus:ring-primary-500 focus:border-transparent text-sm",placeholder:"Smith"})]})]}),e.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-4",children:[e.jsxs("div",{children:[e.jsxs("label",{className:"block text-sm font-semibold text-gray-700 mb-1.5",children:["Email ",e.jsx("span",{className:"text-red-500",children:"*"})]}),e.jsxs("div",{className:"relative",children:[e.jsx(t,{icon:ye,size:16,className:"absolute left-3 top-1/2 -translate-y-1/2 text-gray-400"}),e.jsx("input",{type:"email",value:a.email,onChange:s=>d(r=>({...r,email:s.target.value})),className:"w-full pl-10 pr-4 py-2.5 border border-gray-300 rounded-xl focus:ring-2 focus:ring-primary-500 focus:border-transparent text-sm",placeholder:"[email protected]"})]})]}),e.jsxs("div",{children:[e.jsxs("label",{className:"block text-sm font-semibold text-gray-700 mb-1.5",children:["Phone ",e.jsx("span",{className:"text-gray-400 font-normal",children:"(optional)"})]}),e.jsxs("div",{className:"relative",children:[e.jsx(t,{icon:K,size:16,className:"absolute left-3 top-1/2 -translate-y-1/2 text-gray-400"}
1),e.jsx("input",{type:"tel",value:a.phone,onChange:s=>d(r=>({...r,phone:s.target.value})),className:"w-full pl-10 pr-4 py-2.5 border border-gray-300 rounded-xl focus:ring-2 focus:ring-primary-500 focus:border-transparent text-sm",placeholder:"+233567896543"})]})]})]}),e.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-4",children:[e.jsxs("div",{children:[e.jsxs("label",{className:"block text-sm font-semibold text-gray-700 mb-1.5",children:[i?"New Password":"Password"," ",!i&&e.jsx("span",{className:"text-red-500",children:"*"})]}),e.jsxs("div",{className:"relative",children:[e.jsx("input",{type:B?"text":"password",value:a.password,onChange:s=>d(r=>({...r,password:s.target.value})),className:"w-full px-4 py-2.5 border border-gray-300 rounded-xl focus:ring-2 focus:ring-primary-500 focus:border-transparent text-sm pr-10",placeholder:i?"Leave blank to keep":"Min 4 characters"}),e.jsx("button",{type:"button",onClick:()=>E(s=>!s),className:"absolute right-3 top-1/2 -translate-y-1/2 text-gray-400 hover:text-gray-600",children:B?e.jsx(t,{icon:je,size:16}):e.jsx(t,{icon:Ne,size:16})})]})]}),e.jsxs("div",{children:[e.jsxs("label",{className:"block text-sm font-semibold text-gray-700 mb-1.5",children:["Role ",e.jsx("span",{className:"text-red-500",children:"*"})]}),e.jsx("select",{value:a.role,onChange:s=>d(r=>({...r,role:s.target.value})),className:"w-full px-4 py-2.5 border border-gray-300 rounded-xl focus:ring-2 focus:ring-primary-500 focus:border-transparent text-sm appearance-none cursor-pointer bg-white",children:f.map(s=>e.jsx("option",{value:s,children:s.charAt(0).toUpperCase()+s.slice(1)},s))})]})]}),e.jsxs("div",{children:[e.jsxs("label",{className:"block text-sm font-semibold text-gray-700 mb-1.5",children:[e.jsxs("span",{className:"flex items-center gap-1.5",children:[e.jsx(t,{icon:ve,size:14})," Branch"]}),!i&&e.jsx("span",{className:"text-red-500 ml-1",children:"*"})]}),e.jsxs("select",{value:a.branch_id,onChange:s=>d(r=>({...r,branch_id:s.target.value})),className:"w-full px-4 py-2.5 border border-gray-300 rounded-xl focus:ring-2 focus:ring-primary-500 focus:border-transparent text-sm appearance-none cursor-pointer bg-white",children:[e.jsx("option",{value:"",children:"Select a branch..."}),h.map(s=>e.jsxs("option",{value:s.uuid||s.id,children:[s.name," â ",s.location]},s.uuid||s.id))]})]}),e.jsx("div",{className:"flex flex-wrap gap-2",children:f.map(s=>{const r=C[s];return e.jsxs("button",{type:"button",onClick:()=>d(l=>({...l,role:s})),className:`inline-flex items-center gap-1.5 px-3 py-1.5 rounded-full text-xs font-medium border transition-all ${a.role===s?`${r.bg} ${r.text} ${r.border} ring-2 ring-offset-1`:"bg-gray-50 text-gray-500 border-gray-200 hover:bg-gray-100"}`,children:[e.jsx("span",{className:`w-1.5 h-1.5 rounded-full ${a.role===s?r.dot:"bg-gray-400"}`}),s.charAt(0).toUpperCase()+s.slice(1)]},s)})}),e.jsxs("div",{className:"flex items-center justify-end gap-3 pt-4 border-t border-gray-100",children:[e.jsx("button",{type:"button",onClick:b,className:"px-5 py-2.5 border border-gray-300 text-gray-700 rounded-xl hover:bg-gray-50 text-sm font-medium transition-colors",children:"Cancel"}),e.jsx("button",{type:"submit",disabled:A,className:"px-5 py-2.5 bg-primary-600 text-white rounded-xl hover:bg-primary-700 disabled:opacity-50 text-sm font-medium shadow-sm transition-all flex items-center gap-2",children:A?e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"w-4 h-4 border-2 border-white/30 border-t-white rounded-full animate-spin"}),i?"Saving...":"Creating..."]}):e.jsxs(e.Fragment,{children:[i?e.jsx(t,{icon:we,size:16}):e.jsx(t,{icon:u,size:16}),i?"Save Changes":"Create Employee"]})})]})]})]})]})]}):e.jsx("div",{className:"p-6 flex items-center justify-center min-h-[60vh]",children:e.jsxs("div",{className:"bg-amber-50 border border-amber-200 rounded-lg p-10 text-center max-w-md",children:[e.jsx("div",{className:"w-16 h-16 bg-amber-100 rounded-full flex items-center justify-center mx-auto mb-4",children:e.jsx(t,{icon:he,className:"text-amber-600",size:32})}),e.jsx("h2",{className:"text-xl font-bold text-gray-900 mb-2",children:"Access Restricted"}),e.jsx("p",{className:"text-gray-600",children:"Only administrators can manage users and permissions."})]})})};export{Ae 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.