"use strict";exports.id=89323,exports.ids=[1613,3946,5418,6847,13518,15851,18292,18752,19721,23994,25423,26327,29228,30197,35899,38232,42102,46375,47804,48708,51609,52578,58280,60613,62085,64483,68756,71089,73990,74959,81565,82994,83037,84466,86864,89323,91137,93470,95911,96371,97340],exports.modules={84466:(a,b,c)=>{c.d(b,{so:()=>f,u9:()=>e,wc:()=>g});var d=c(48249);let e="w-full min-w-0 px-3 sm:w-auto sm:px-4";function f({children:a,columns:b=2,className:c=""}){return(0,d.jsx)("div",{className:`grid w-full gap-2 ${1===b?"grid-cols-1":3===b?"grid-cols-2 sm:grid-cols-3":"grid-cols-2"} sm:flex sm:w-auto sm:flex-wrap sm:justify-end sm:shrink-0 ${c}`,children:a})}function g({title:a,description:b,className:c="",children:e}){return(0,d.jsxs)("div",{className:`mb-6 flex flex-col gap-4 sm:mb-8 sm:flex-row sm:items-start sm:justify-between ${c}`,children:[(0,d.jsxs)("div",{className:"min-w-0",children:["string"==typeof a?(0,d.jsx)("h1",{className:"text-2xl font-bold text-[var(--foreground)] sm:text-3xl",children:a}):a,null!=b&&""!==b&&("string"==typeof b?(0,d.jsx)("p",{className:"mt-1 text-sm text-[var(--muted-foreground)] sm:mt-2 sm:text-base",children:b}):b)]}),e]})}},89323:(a,b,c)=>{c.r(b),c.d(b,{default:()=>q});var d=c(48249),e=c(67484),f=c(19099),g=c(41421),h=c(60932),i=c(84466),j=c(3430),k=c(41090),l=c(82697),m=c(81152),n=c(40433),o=c(91115),p=c(92002);function q(){let a=(0,f.useRouter)(),[b,c]=(0,e.useState)(!1),[q,r]=(0,e.useState)(""),[s,t]=(0,e.useState)(""),[u,v]=(0,e.useState)(""),[w,x]=(0,e.useState)(""),[y,z]=(0,e.useState)("teacher"),A=async b=>{b.preventDefault(),c(!0);try{await (0,m.bP)({fullName:q.trim(),email:s.trim(),password:u,phone:w.trim()||void 0,staffRole:y}),(0,o.Te)("Staff member created"),a.push(n.bw.SMS_ADMIN.STAFF)}catch(a){(0,o.Qg)(a instanceof Error?a.message:"Failed to create staff member")}finally{c(!1)}};return(0,d.jsxs)("div",{className:"space-y-5",children:[(0,d.jsx)(i.wc,{title:"Add staff member",description:"Create a teacher, accountant, or administrator account for your school.",children:(0,d.jsx)(h.u,{href:n.bw.SMS_ADMIN.STAFF,className:"text-sm font-semibold text-primary-700 hover:underline",children:"← Back to staff directory"})}),(0,d.jsx)(p.O,{}),(0,d.jsx)(l.a,{tone:"info",title:"Staff login",children:"Each staff member gets their own email and password. Teachers can be assigned to classes and subjects after creation."}),(0,d.jsx)(k.Z,{className:"overflow-hidden shadow-sm",children:(0,d.jsx)("div",{className:"p-4 sm:p-5",children:(0,d.jsx)(l.Vd,{title:"Staff account",icon:g.FK_,children:(0,d.jsx)("form",{id:"staff-create-form",onSubmit:A,children:(0,d.jsxs)("div",{className:"grid grid-cols-1 gap-4 sm:grid-cols-2 lg:max-w-3xl",children:[(0,d.jsx)(j.p,{label:"Full name",value:q,onChange:a=>r(a.target.value),required:!0}),(0,d.jsx)(l.yB,{label:"Role",children:(0,d.jsxs)(l.Kd,{value:y,onChange:a=>z(a.target.value),required:!0,children:[(0,d.jsx)("option",{value:"teacher",children:"Teacher"}),(0,d.jsx)("option",{value:"accountant",children:"Accountant"}),(0,d.jsx)("option",{value:"administrator",children:"Administrator"})]})}),(0,d.jsx)(j.p,{label:"Email (login)",type:"email",value:s,onChange:a=>t(a.target.value),required:!0}),(0,d.jsx)(j.p,{label:"Password",type:"password",value:u,onChange:a=>v(a.target.value),required:!0}),(0,d.jsx)(j.p,{label:"Phone",value:w,onChange:a=>x(a.target.value)})]})})})})}),(0,d.jsx)(l.Yv,{hint:"Staff can sign in immediately after creation.",children:(0,d.jsx)(l.bE,{children:(0,d.jsx)(l.kL,{type:"submit",form:"staff-create-form",disabled:b||!q.trim()||!s.trim()||!u,children:b?"Creating…":"Create staff member"})})})]})}},92002:(a,b,c)=>{c.d(b,{O:()=>j});var d=c(48249),e=c(60932),f=c(40433),g=c(14113),h=c(17060);let i=[{href:f.bw.SMS_ADMIN.STAFF,label:"Directory",match:a=>a===f.bw.SMS_ADMIN.STAFF||a.startsWith(`${f.bw.SMS_ADMIN.STAFF}/`)},{href:f.bw.SMS_ADMIN.STAFF_ATTENDANCE,label:"Attendance",match:a=>a.startsWith(f.bw.SMS_ADMIN.STAFF_ATTENDANCE)},{href:f.bw.SMS_ADMIN.DEPARTMENTS,label:"Departments",match:a=>a.startsWith(f.bw.SMS_ADMIN.DEPARTMENTS)},{href:f.bw.SMS_ADMIN.DESIGNATIONS,label:"Designations",match:a=>a.startsWith(f.bw.SMS_ADMIN.DESIGNATIONS)}];function j(){let a=(0,h.sK)()??"";return(0,d.jsx)("nav",{className:"flex gap-1 overflow-x-auto rounded-lg border border-slate-200 bg-slate-50/80 p-1 scrollbar-none","aria-label":"Human resource sections",children:i.map(b=>{let c=b.match(a);return(0,d.jsx)(e.u,{href:b.href,className:(0,g.xW)("inline-flex shrink-0 items-center gap-1.5 rounded-md px-3 py-2 text-sm font-medium transition-all duration-200 ease-out motion-reduce:transition-none",c?"bg-white text-primary-800 shadow-sm ring-1 ring-slate-200/80":"text-slate-600 hover:bg-white hover:text-slate-900 hover:shadow-sm"),"aria-current":c?"page":void 0,children:b.label},b.href)})})}}};