"use strict";exports.id=99895,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,91137,93470,95911,96371,97340,99895],exports.modules={14647:(a,b,c)=>{c.d(b,{B:()=>e,J:()=>f});var d=c(48249);function e({disabled:a}){return(0,d.jsx)("button",{type:"button",disabled:a,onClick:()=>window.print(),className:"inline-flex min-h-[40px] items-center justify-center rounded-md bg-primary-700 px-4 py-2 text-sm font-medium text-white hover:bg-primary-800 disabled:opacity-50 print:hidden",children:"Print / Save PDF"})}function f({letterhead:a,title:b,subtitle:c,meta:f,children:g,actions:h}){return(0,d.jsxs)("div",{className:"space-y-4",children:[(0,d.jsxs)("div",{className:"flex flex-wrap items-center justify-end gap-2 print:hidden",children:[h,(0,d.jsx)(e,{})]}),(0,d.jsxs)("div",{id:"sms-print-report",className:"overflow-hidden rounded-lg border border-slate-200 bg-white shadow-sm print:border-0 print:shadow-none",children:[(0,d.jsxs)("div",{className:"border-b border-slate-200 bg-slate-50 px-5 py-5 text-center sm:px-8",children:[(0,d.jsx)("p",{className:"text-xl font-bold tracking-tight text-slate-900 sm:text-2xl",children:a?.academyName||"School"}),a?.tagline?(0,d.jsx)("p",{className:"mt-1 text-sm text-slate-500",children:a.tagline}):null,(0,d.jsx)("p",{className:"mt-3 text-base font-semibold uppercase tracking-wide text-slate-800",children:b}),c?(0,d.jsx)("p",{className:"mt-1 text-sm text-slate-600",children:c}):null,f?(0,d.jsx)("p",{className:"mt-1 text-xs text-slate-500",children:f}):null]}),(0,d.jsx)("div",{className:"px-4 py-5 sm:px-8 sm:py-6",children:g}),(0,d.jsx)("div",{className:"border-t border-slate-100 px-5 py-4 text-xs text-slate-400 sm:px-8",children:"Generated for school records \xb7 Use Print / Save PDF for a paper copy"})]}),(0,d.jsx)("style",{children:`
        @media print {
          body * { visibility: hidden !important; }
          #sms-print-report, #sms-print-report * { visibility: visible !important; }
          #sms-print-report {
            position: absolute;
            left: 0;
            top: 0;
            width: 100%;
            border: none !important;
            box-shadow: none !important;
          }
        }
      `})]})}},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]})}},91415:(a,b,c)=>{c.d(b,{f:()=>j});var d=c(48249),e=c(60932),f=c(40433),g=c(14113),h=c(17060);let i=[{href:f.bw.SMS_ADMIN.REPORTS_ATTENDANCE,label:"Attendance",match:a=>a===f.bw.SMS_ADMIN.REPORTS||a===f.bw.SMS_ADMIN.REPORTS_ATTENDANCE},{href:f.bw.SMS_ADMIN.REPORTS_PROGRESS_CARD,label:"Progress card",match:a=>a.startsWith(f.bw.SMS_ADMIN.REPORTS_PROGRESS_CARD)},{href:f.bw.SMS_ADMIN.REPORTS_MARK_SHEET,label:"Mark sheet",match:a=>a.startsWith(f.bw.SMS_ADMIN.REPORTS_MARK_SHEET)},{href:f.bw.SMS_ADMIN.REPORTS_MERIT_LIST,label:"Merit list",match:a=>a.startsWith(f.bw.SMS_ADMIN.REPORTS_MERIT_LIST)},{href:f.bw.SMS_ADMIN.REPORTS_STUDENT,label:"Student",match:a=>a.startsWith(f.bw.SMS_ADMIN.REPORTS_STUDENT)},{href:f.bw.SMS_ADMIN.REPORTS_CLASS,label:"Class",match:a=>a.startsWith(f.bw.SMS_ADMIN.REPORTS_CLASS)},{href:f.bw.SMS_ADMIN.REPORTS_FEES,label:"Fees statement",match:a=>a.startsWith(f.bw.SMS_ADMIN.FEES_STATEMENT)}];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 print:hidden","aria-label":"School reports 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)})})}},99895:(a,b,c)=>{c.r(b),c.d(b,{default:()=>l});var d=c(48249),e=c(67484),f=c(84466),g=c(82697),h=c(91415),i=c(14647),j=c(81152),k=c(91115);function l(){let[a,b]=(0,e.useState)([]),[c,l]=(0,e.useState)(""),[m,n]=(0,e.useState)(""),[o,p]=(0,e.useState)(""),[q,r]=(0,e.useState)(null),[s,t]=(0,e.useState)(!1),u=(0,e.useCallback)(async()=>{if(c){t(!0);try{r(await (0,j.Wh)({schoolClassId:c,from:m||void 0,to:o||void 0}))}catch(a){(0,k.Qg)(a instanceof Error?a.message:"Failed to load report"),r(null)}finally{t(!1)}}},[c,m,o]);return(0,d.jsxs)("div",{className:"space-y-4 sm:space-y-6",children:[(0,d.jsx)(f.wc,{title:"Attendance report",description:"Present, absent, and late counts per student — printable for the office."}),(0,d.jsx)(h.f,{}),(0,d.jsxs)(g.r7,{children:[(0,d.jsx)(g.yB,{label:"Class",className:"min-w-0 flex-1 sm:min-w-[12rem]",children:(0,d.jsxs)(g.Kd,{value:c,onChange:a=>l(a.target.value),children:[(0,d.jsx)("option",{value:"",children:"Select class"}),a.map(a=>(0,d.jsx)("option",{value:a.id,children:a.displayName},a.id))]})}),(0,d.jsx)(g.yB,{label:"From",className:"min-w-0 flex-1 sm:min-w-[10rem]",children:(0,d.jsx)(g.IM,{value:m,onChange:a=>n(a.target.value)})}),(0,d.jsx)(g.yB,{label:"To",className:"min-w-0 flex-1 sm:min-w-[10rem]",children:(0,d.jsx)(g.IM,{value:o,onChange:a=>p(a.target.value)})}),(0,d.jsx)(g.bE,{children:(0,d.jsx)(g.kL,{type:"button",onClick:()=>void u(),disabled:!c||s,children:s?"Loading…":"Generate"})})]}),q?(0,d.jsx)(i.J,{title:"Attendance report",subtitle:q.schoolClass.displayName,meta:`${q.totalSessions} session(s)${m||o?` \xb7 ${m||"…"} to ${o||"…"}`:""}`,children:(0,d.jsx)(g.T7,{children:(0,d.jsxs)(g.cR,{minWidth:"36rem",children:[(0,d.jsx)(g.K_,{children:(0,d.jsxs)("tr",{children:[(0,d.jsx)("th",{className:`${g.aB} font-medium`,children:"Student"}),(0,d.jsx)("th",{className:`${g.aB} font-medium`,children:"Roll"}),(0,d.jsx)("th",{className:`${g.aB} font-medium text-center`,children:"Present"}),(0,d.jsx)("th",{className:`${g.aB} font-medium text-center`,children:"Late"}),(0,d.jsx)("th",{className:`${g.aB} font-medium text-center`,children:"Absent"}),(0,d.jsx)("th",{className:`${g.aB} font-medium text-center`,children:"%"})]})}),(0,d.jsx)("tbody",{children:0===q.students.length?(0,d.jsx)(g.tU,{colSpan:6,children:"No attendance data for this range."}):q.students.map(a=>(0,d.jsxs)("tr",{className:"border-t border-slate-100",children:[(0,d.jsx)("td",{className:`${g.Cl} font-medium text-slate-900`,children:a.fullName}),(0,d.jsx)("td",{className:g.Cl,children:a.rollNumber||"—"}),(0,d.jsx)("td",{className:`${g.Cl} text-center`,children:a.present}),(0,d.jsx)("td",{className:`${g.Cl} text-center`,children:a.late}),(0,d.jsx)("td",{className:`${g.Cl} text-center`,children:a.absent}),(0,d.jsxs)("td",{className:`${g.Cl} text-center font-medium`,children:[a.attendancePercent??"—","%"]})]},a.userId))})]})})}):null]})}}};