"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[16053,38434,72209],{38434:(e,t,a)=>{let s,r;a.d(t,{l$:()=>ee,Ay:()=>et,oR:()=>T});var i,o=a(12115);let n={data:""},l=/(?:([\u0080-\uFFFF\w-%@]+) *:? *([^{;]+?);|([^;}{]*?) *{)|(}\s*)/g,d=/\/\*[^]*?\*\/|  +/g,c=/\n+/g,u=(e,t)=>{let a="",s="",r="";for(let i in e){let o=e[i];"@"==i[0]?"i"==i[1]?a=i+" "+o+";":s+="f"==i[1]?u(o,i):i+"{"+u(o,"k"==i[1]?"":t)+"}":"object"==typeof o?s+=u(o,t?t.replace(/([^,])+/g,e=>i.replace(/([^,]*:\S+\([^)]*\))|([^,])+/g,t=>/&/.test(t)?t.replace(/&/g,e):e?e+" "+t:t)):i):null!=o&&(i=/^--/.test(i)?i:i.replace(/[A-Z]/g,"-$&").toLowerCase(),r+=u.p?u.p(i,o):i+":"+o+";")}return a+(t&&r?t+"{"+r+"}":r)+s},p={},m=e=>{if("object"==typeof e){let t="";for(let a in e)t+=a+m(e[a]);return t}return e};function f(e){let t,a,s=this||{},r=e.call?e(s.p):e;return((e,t,a,s,r)=>{var i;let o=m(e),n=p[o]||(p[o]=(e=>{let t=0,a=11;for(;t<e.length;)a=101*a+e.charCodeAt(t++)>>>0;return"go"+a})(o));if(!p[n]){let t=o!==e?e:(e=>{let t,a,s=[{}];for(;t=l.exec(e.replace(d,""));)t[4]?s.shift():t[3]?(a=t[3].replace(c," ").trim(),s.unshift(s[0][a]=s[0][a]||{})):s[0][t[1]]=t[2].replace(c," ").trim();return s[0]})(e);p[n]=u(r?{["@keyframes "+n]:t}:t,a?"":"."+n)}let f=a&&p.g?p.g:null;return a&&(p.g=p[n]),i=p[n],f?t.data=t.data.replace(f,i):-1===t.data.indexOf(i)&&(t.data=s?i+t.data:t.data+i),n})(r.unshift?r.raw?(t=[].slice.call(arguments,1),a=s.p,r.reduce((e,s,r)=>{let i=t[r];if(i&&i.call){let e=i(a),t=e&&e.props&&e.props.className||/^go/.test(e)&&e;i=t?"."+t:e&&"object"==typeof e?e.props?"":u(e,""):!1===e?"":e}return e+s+(null==i?"":i)},"")):r.reduce((e,t)=>Object.assign(e,t&&t.call?t(s.p):t),{}):r,(e=>{if("object"==typeof window){let t=(e?e.querySelector("#_goober"):window._goober)||Object.assign(document.createElement("style"),{innerHTML:" ",id:"_goober"});return t.nonce=window.__nonce__,t.parentNode||(e||document.head).appendChild(t),t.firstChild}return e||n})(s.target),s.g,s.o,s.k)}f.bind({g:1});let h,g,b,y=f.bind({k:1});function x(e,t){let a=this||{};return function(){let s=arguments;function r(i,o){let n=Object.assign({},i),l=n.className||r.className;a.p=Object.assign({theme:g&&g()},n),a.o=/ *go\d+/.test(l),n.className=f.apply(a,s)+(l?" "+l:""),t&&(n.ref=o);let d=e;return e[0]&&(d=n.as||e,delete n.as),b&&d[0]&&b(n),h(d,n)}return t?t(r):r}}var v=(e,t)=>"function"==typeof e?e(t):e,w=(s=0,()=>(++s).toString()),N=()=>{if(void 0===r&&"u">typeof window){let e=matchMedia("(prefers-reduced-motion: reduce)");r=!e||e.matches}return r},E="default",j=(e,t)=>{let{toastLimit:a}=e.settings;switch(t.type){case 0:return{...e,toasts:[t.toast,...e.toasts].slice(0,a)};case 1:return{...e,toasts:e.toasts.map(e=>e.id===t.toast.id?{...e,...t.toast}:e)};case 2:let{toast:s}=t;return j(e,{type:+!!e.toasts.find(e=>e.id===s.id),toast:s});case 3:let{toastId:r}=t;return{...e,toasts:e.toasts.map(e=>e.id===r||void 0===r?{...e,dismissed:!0,visible:!1}:e)};case 4:return void 0===t.toastId?{...e,toasts:[]}:{...e,toasts:e.toasts.filter(e=>e.id!==t.toastId)};case 5:return{...e,pausedAt:t.time};case 6:let i=t.time-(e.pausedAt||0);return{...e,pausedAt:void 0,toasts:e.toasts.map(e=>({...e,pauseDuration:e.pauseDuration+i}))}}},k=[],S={toasts:[],pausedAt:void 0,settings:{toastLimit:20}},$={},A=(e,t=E)=>{$[t]=j($[t]||S,e),k.forEach(([e,a])=>{e===t&&a($[t])})},P=e=>Object.keys($).forEach(t=>A(e,t)),_=(e=E)=>t=>{A(t,e)},C={blank:4e3,error:4e3,success:2e3,loading:1/0,custom:4e3},R=e=>(t,a)=>{let s,r=((e,t="blank",a)=>({createdAt:Date.now(),visible:!0,dismissed:!1,type:t,ariaProps:{role:"status","aria-live":"polite"},message:e,pauseDuration:0,...a,id:(null==a?void 0:a.id)||w()}))(t,e,a);return _(r.toasterId||(s=r.id,Object.keys($).find(e=>$[e].toasts.some(e=>e.id===s))))({type:2,toast:r}),r.id},T=(e,t)=>R("blank")(e,t);T.error=R("error"),T.success=R("success"),T.loading=R("loading"),T.custom=R("custom"),T.dismiss=(e,t)=>{let a={type:3,toastId:e};t?_(t)(a):P(a)},T.dismissAll=e=>T.dismiss(void 0,e),T.remove=(e,t)=>{let a={type:4,toastId:e};t?_(t)(a):P(a)},T.removeAll=e=>T.remove(void 0,e),T.promise=(e,t,a)=>{let s=T.loading(t.loading,{...a,...null==a?void 0:a.loading});return"function"==typeof e&&(e=e()),e.then(e=>{let r=t.success?v(t.success,e):void 0;return r?T.success(r,{id:s,...a,...null==a?void 0:a.success}):T.dismiss(s),e}).catch(e=>{let r=t.error?v(t.error,e):void 0;r?T.error(r,{id:s,...a,...null==a?void 0:a.error}):T.dismiss(s)}),e};var D=1e3,M=y`
from {
  transform: scale(0) rotate(45deg);
	opacity: 0;
}
to {
 transform: scale(1) rotate(45deg);
  opacity: 1;
}`,O=y`
from {
  transform: scale(0);
  opacity: 0;
}
to {
  transform: scale(1);
  opacity: 1;
}`,I=y`
from {
  transform: scale(0) rotate(90deg);
	opacity: 0;
}
to {
  transform: scale(1) rotate(90deg);
	opacity: 1;
}`,F=x("div")`
  width: 20px;
  opacity: 0;
  height: 20px;
  border-radius: 10px;
  background: ${e=>e.primary||"#ff4b4b"};
  position: relative;
  transform: rotate(45deg);

  animation: ${M} 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275)
    forwards;
  animation-delay: 100ms;

  &:after,
  &:before {
    content: '';
    animation: ${O} 0.15s ease-out forwards;
    animation-delay: 150ms;
    position: absolute;
    border-radius: 3px;
    opacity: 0;
    background: ${e=>e.secondary||"#fff"};
    bottom: 9px;
    left: 4px;
    height: 2px;
    width: 12px;
  }

  &:before {
    animation: ${I} 0.15s ease-out forwards;
    animation-delay: 180ms;
    transform: rotate(90deg);
  }
`,z=y`
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
`,L=x("div")`
  width: 12px;
  height: 12px;
  box-sizing: border-box;
  border: 2px solid;
  border-radius: 100%;
  border-color: ${e=>e.secondary||"#e0e0e0"};
  border-right-color: ${e=>e.primary||"#616161"};
  animation: ${z} 1s linear infinite;
`,H=y`
from {
  transform: scale(0) rotate(45deg);
	opacity: 0;
}
to {
  transform: scale(1) rotate(45deg);
	opacity: 1;
}`,U=y`
0% {
	height: 0;
	width: 0;
	opacity: 0;
}
40% {
  height: 0;
	width: 6px;
	opacity: 1;
}
100% {
  opacity: 1;
  height: 10px;
}`,B=x("div")`
  width: 20px;
  opacity: 0;
  height: 20px;
  border-radius: 10px;
  background: ${e=>e.primary||"#61d345"};
  position: relative;
  transform: rotate(45deg);

  animation: ${H} 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275)
    forwards;
  animation-delay: 100ms;
  &:after {
    content: '';
    box-sizing: border-box;
    animation: ${U} 0.2s ease-out forwards;
    opacity: 0;
    animation-delay: 200ms;
    position: absolute;
    border-right: 2px solid;
    border-bottom: 2px solid;
    border-color: ${e=>e.secondary||"#fff"};
    bottom: 6px;
    left: 6px;
    height: 10px;
    width: 6px;
  }
`,q=x("div")`
  position: absolute;
`,V=x("div")`
  position: relative;
  display: flex;
  justify-content: center;
  align-items: center;
  min-width: 20px;
  min-height: 20px;
`,W=y`
from {
  transform: scale(0.6);
  opacity: 0.4;
}
to {
  transform: scale(1);
  opacity: 1;
}`,Q=x("div")`
  position: relative;
  transform: scale(0.6);
  opacity: 0.4;
  min-width: 20px;
  animation: ${W} 0.3s 0.12s cubic-bezier(0.175, 0.885, 0.32, 1.275)
    forwards;
`,Y=({toast:e})=>{let{icon:t,type:a,iconTheme:s}=e;return void 0!==t?"string"==typeof t?o.createElement(Q,null,t):t:"blank"===a?null:o.createElement(V,null,o.createElement(L,{...s}),"loading"!==a&&o.createElement(q,null,"error"===a?o.createElement(F,{...s}):o.createElement(B,{...s})))},Z=x("div")`
  display: flex;
  align-items: center;
  background: #fff;
  color: #363636;
  line-height: 1.3;
  will-change: transform;
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.1), 0 3px 3px rgba(0, 0, 0, 0.05);
  max-width: 350px;
  pointer-events: auto;
  padding: 8px 10px;
  border-radius: 8px;
`,G=x("div")`
  display: flex;
  justify-content: center;
  margin: 4px 10px;
  color: inherit;
  flex: 1 1 auto;
  white-space: pre-line;
`,J=o.memo(({toast:e,position:t,style:a,children:s})=>{let r=e.height?((e,t)=>{let a=e.includes("top")?1:-1,[s,r]=N()?["0%{opacity:0;} 100%{opacity:1;}","0%{opacity:1;} 100%{opacity:0;}"]:[`
0% {transform: translate3d(0,${-200*a}%,0) scale(.6); opacity:.5;}
100% {transform: translate3d(0,0,0) scale(1); opacity:1;}
`,`
0% {transform: translate3d(0,0,-1px) scale(1); opacity:1;}
100% {transform: translate3d(0,${-150*a}%,-1px) scale(.6); opacity:0;}
`];return{animation:t?`${y(s)} 0.35s cubic-bezier(.21,1.02,.73,1) forwards`:`${y(r)} 0.4s forwards cubic-bezier(.06,.71,.55,1)`}})(e.position||t||"top-center",e.visible):{opacity:0},i=o.createElement(Y,{toast:e}),n=o.createElement(G,{...e.ariaProps},v(e.message,e));return o.createElement(Z,{className:e.className,style:{...r,...a,...e.style}},"function"==typeof s?s({icon:i,message:n}):o.createElement(o.Fragment,null,i,n))});i=o.createElement,u.p=void 0,h=i,g=void 0,b=void 0;var K=({id:e,className:t,style:a,onHeightUpdate:s,children:r})=>{let i=o.useCallback(t=>{if(t){let a=()=>{s(e,t.getBoundingClientRect().height)};a(),new MutationObserver(a).observe(t,{subtree:!0,childList:!0,characterData:!0})}},[e,s]);return o.createElement("div",{ref:i,className:t,style:a},r)},X=f`
  z-index: 9999;
  > * {
    pointer-events: auto;
  }
`,ee=({reverseOrder:e,position:t="top-center",toastOptions:a,gutter:s,children:r,toasterId:i,containerStyle:n,containerClassName:l})=>{let{toasts:d,handlers:c}=((e,t="default")=>{let{toasts:a,pausedAt:s}=((e={},t=E)=>{let[a,s]=(0,o.useState)($[t]||S),r=(0,o.useRef)($[t]);(0,o.useEffect)(()=>(r.current!==$[t]&&s($[t]),k.push([t,s]),()=>{let e=k.findIndex(([e])=>e===t);e>-1&&k.splice(e,1)}),[t]);let i=a.toasts.map(t=>{var a,s,r;return{...e,...e[t.type],...t,removeDelay:t.removeDelay||(null==(a=e[t.type])?void 0:a.removeDelay)||(null==e?void 0:e.removeDelay),duration:t.duration||(null==(s=e[t.type])?void 0:s.duration)||(null==e?void 0:e.duration)||C[t.type],style:{...e.style,...null==(r=e[t.type])?void 0:r.style,...t.style}}});return{...a,toasts:i}})(e,t),r=(0,o.useRef)(new Map).current,i=(0,o.useCallback)((e,t=D)=>{if(r.has(e))return;let a=setTimeout(()=>{r.delete(e),n({type:4,toastId:e})},t);r.set(e,a)},[]);(0,o.useEffect)(()=>{if(s)return;let e=Date.now(),r=a.map(a=>{if(a.duration===1/0)return;let s=(a.duration||0)+a.pauseDuration-(e-a.createdAt);if(s<0){a.visible&&T.dismiss(a.id);return}return setTimeout(()=>T.dismiss(a.id,t),s)});return()=>{r.forEach(e=>e&&clearTimeout(e))}},[a,s,t]);let n=(0,o.useCallback)(_(t),[t]),l=(0,o.useCallback)(()=>{n({type:5,time:Date.now()})},[n]),d=(0,o.useCallback)((e,t)=>{n({type:1,toast:{id:e,height:t}})},[n]),c=(0,o.useCallback)(()=>{s&&n({type:6,time:Date.now()})},[s,n]),u=(0,o.useCallback)((e,t)=>{let{reverseOrder:s=!1,gutter:r=8,defaultPosition:i}=t||{},o=a.filter(t=>(t.position||i)===(e.position||i)&&t.height),n=o.findIndex(t=>t.id===e.id),l=o.filter((e,t)=>t<n&&e.visible).length;return o.filter(e=>e.visible).slice(...s?[l+1]:[0,l]).reduce((e,t)=>e+(t.height||0)+r,0)},[a]);return(0,o.useEffect)(()=>{a.forEach(e=>{if(e.dismissed)i(e.id,e.removeDelay);else{let t=r.get(e.id);t&&(clearTimeout(t),r.delete(e.id))}})},[a,i]),{toasts:a,handlers:{updateHeight:d,startPause:l,endPause:c,calculateOffset:u}}})(a,i);return o.createElement("div",{"data-rht-toaster":i||"",style:{position:"fixed",zIndex:9999,top:16,left:16,right:16,bottom:16,pointerEvents:"none",...n},className:l,onMouseEnter:c.startPause,onMouseLeave:c.endPause},d.map(a=>{let i,n,l=a.position||t,d=c.calculateOffset(a,{reverseOrder:e,gutter:s,defaultPosition:t}),u=(i=l.includes("top"),n=l.includes("center")?{justifyContent:"center"}:l.includes("right")?{justifyContent:"flex-end"}:{},{left:0,right:0,display:"flex",position:"absolute",transition:N()?void 0:"all 230ms cubic-bezier(.21,1.02,.73,1)",transform:`translateY(${d*(i?1:-1)}px)`,...i?{top:0}:{bottom:0},...n});return o.createElement(K,{id:a.id,key:a.id,onHeightUpdate:c.updateHeight,className:a.visible?X:"",style:u},"custom"===a.type?v(a.message,a):r?r(a):o.createElement(J,{toast:a,position:l}))}))},et=T},66876:(e,t,a)=>{a.r(t),a.d(t,{default:()=>f});var s=a(95155),r=a(12115),i=a(73321),o=a(61659),n=a(73698),l=a(55368),d=a(30313),c=a(88541),u=a(16099),p=a(2581);function m({label:e,value:t,hint:a,href:r,icon:i}){let o=(0,s.jsxs)("div",{className:"h-full rounded-lg border border-slate-100 bg-white px-4 py-4 shadow-sm transition-shadow hover:shadow-md",children:[(0,s.jsxs)("div",{className:"flex items-start justify-between gap-2",children:[(0,s.jsx)("p",{className:"text-xs font-medium uppercase tracking-wide text-slate-500",children:e}),(0,s.jsx)(i,{className:"h-4 w-4 shrink-0 text-slate-400","aria-hidden":!0})]}),(0,s.jsx)("p",{className:"mt-2 text-2xl font-semibold tabular-nums text-slate-900",children:t}),a?(0,s.jsx)("p",{className:"mt-1 text-xs text-slate-500",children:a}):null]});return r?(0,s.jsx)(n.j,{href:r,className:"block h-full",children:o}):o}function f(){let e=(0,i.useParams)(),t="string"==typeof e?.studentUserId?e.studentUserId:"",[a,f]=(0,r.useState)(null),[h,g]=(0,r.useState)(!0);(0,r.useEffect)(()=>{if(!t)return;let e=!1;return(0,c.kN)(t).then(t=>{e||f(t)}).catch(t=>{e||(0,p.Qg)(t instanceof Error?t.message:"Failed to load overview")}).finally(()=>{e||g(!1)}),()=>{e=!0}},[t]);let b=a?.profile,y=a?.stats,x=b?.student?.fullName||"Student",v=b?.schoolClass?.displayName;return(0,s.jsx)(l.R,{title:h?"Loading…":x,description:v?[v,b?.rollNumber?`Roll ${b.rollNumber}`:null].filter(Boolean).join(" \xb7 "):"School overview",actions:h?null:(0,s.jsx)(n.j,{href:u.bw.SMS_PARENT.childDetails(t),className:"inline-flex min-h-[44px] w-full items-center justify-center rounded-md border border-slate-200 bg-white px-4 py-2 text-sm font-medium text-slate-700 hover:bg-slate-50 sm:min-h-0 sm:w-auto",children:"Student details"}),children:h?(0,s.jsx)("div",{className:"grid animate-pulse grid-cols-2 gap-3 lg:grid-cols-4",children:Array.from({length:4}).map((e,t)=>(0,s.jsx)("div",{className:"h-28 rounded-lg bg-slate-100"},t))}):b?.hasEnrollment?(0,s.jsxs)(s.Fragment,{children:[(0,s.jsxs)("div",{className:"grid grid-cols-2 gap-3 lg:grid-cols-4",children:[(0,s.jsx)(m,{label:"Present rate",value:`${y?.attendance.presentRate??0}%`,hint:`${y?.attendance.present??0} present \xb7 ${y?.attendance.absent??0} absent`,href:u.bw.SMS_PARENT.childAttendance(t),icon:o.VwS}),(0,s.jsx)(m,{label:"Homework",value:y?.homeworkCount??0,href:u.bw.SMS_PARENT.childHomework(t),icon:o.gpD}),(0,s.jsx)(m,{label:"Fees due",value:y?.feesDue!=null?Number(y.feesDue).toLocaleString(void 0,{maximumFractionDigits:0}):"—",hint:`Paid ${Number(y?.feesPaid||0).toLocaleString()}`,href:u.bw.SMS_PARENT.childFees(t),icon:o.L9S}),(0,s.jsx)(m,{label:"Notices",value:y?.noticeCount??0,href:u.bw.SMS_PARENT.childNotices(t),icon:o.AT_})]}),(0,s.jsxs)("section",{className:"rounded-lg border border-slate-100 bg-white shadow-sm",children:[(0,s.jsxs)("div",{className:"flex items-center justify-between gap-3 border-b border-slate-100 px-4 py-3 sm:px-5",children:[(0,s.jsx)("h2",{className:"text-sm font-semibold text-slate-900",children:"Recent notices"}),(0,s.jsx)(n.j,{href:u.bw.SMS_PARENT.childNotices(t),className:"text-sm font-medium text-primary-700 hover:underline",children:"View all"})]}),(0,s.jsx)("div",{className:"px-4 py-4 sm:px-5",children:a?.recentNotices?.length?(0,s.jsx)("ul",{className:"divide-y divide-slate-100",children:a.recentNotices.map(e=>(0,s.jsxs)("li",{className:"py-3 first:pt-0 last:pb-0",children:[(0,s.jsx)("p",{className:"font-medium text-slate-900",children:e.title}),(0,s.jsx)("p",{className:"mt-1 line-clamp-2 text-sm text-slate-500",children:e.body})]},e.id))}):(0,s.jsx)(d.i0,{title:"No notices yet",description:"School announcements for your child's class will appear here."})})]}),(0,s.jsx)("div",{className:"grid grid-cols-2 gap-2 sm:grid-cols-5",children:[{href:u.bw.SMS_PARENT.childAttendance(t),label:"Attendance"},{href:u.bw.SMS_PARENT.childHomework(t),label:"Homework"},{href:u.bw.SMS_PARENT.childFees(t),label:"Fees"},{href:u.bw.SMS_PARENT.childExams(t),label:"Exam results"},{href:u.bw.SMS_PARENT.childNotices(t),label:"Notices"}].map(e=>(0,s.jsx)(n.j,{href:e.href,className:"rounded-lg border border-slate-200 bg-slate-50 px-3 py-3 text-center text-sm font-medium text-slate-700 hover:border-primary-200 hover:bg-white hover:text-primary-800",children:e.label},e.href))})]}):(0,s.jsx)(d.i0,{title:"No school enrollment",description:"This child is linked but not enrolled in an active school class yet."})})}},88541:(e,t,a)=>{a.d(t,{BT:()=>n,CP:()=>f,OI:()=>c,W6:()=>i,WR:()=>u,hi:()=>d,kN:()=>o,mk:()=>l,n9:()=>m,xw:()=>p});var s=a(76541);function r(e){if(!e.data.success||void 0===e.data.data)throw Error(e.data.message||"Request failed");return e.data.data}async function i(){return r(await s.uE.get("/school/parent/home"))}async function o(e){return r(await s.uE.get(`/school/parent/children/${e}/overview`))}async function n(e){return r(await s.uE.get(`/school/parent/children/${e}/details`))}async function l(e){return r(await s.uE.get(`/school/parent/children/${e}/notices`))}async function d(e){return r(await s.uE.get(`/school/parent/children/${e}/homework`))}async function c(e,t){return r(await s.uE.get(`/school/parent/children/${e}/attendance`,{params:t}))}async function u(e){return r(await s.uE.get(`/school/parent/children/${e}/fees`))}async function p(e){return r(await s.uE.get(`/school/parent/children/${e}/exams`))}async function m(e,t){return r(await s.uE.get(`/school/parent/children/${e}/exam-result`,{params:{examId:t}}))}async function f(){return r(await s.uE.get("/school/parent/holidays"))}}}]);