1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[79531],{11377:(e,t,n)=>{"use strict";n.d(t,{A:()=>T});var r=n(73766),o=n(53239),i=n(8393),a=n(77117),s=n.n(a),d=n(68209),l=n(84087),c=n(61386),u=n(79672),m=n.n(u),p=n(11230),h=n.n(p),f=n(64869);n(33415);var v=n(7043),y=n(70435),C=n(78421);let g=(0,d.A)(()=>({root:{"&.bannerShown":{"& .main-layout-navbar,.main-content,.main-layout-system-drawer":{marginTop:48}}},alert:{position:"fixed",borderRadius:0,top:0,zIndex:400,width:"100%",alignItems:"center",background:"#73B9EE",paddingLeft:8,cursor:"pointer",color:"white","& .MuiAlert-icon":{display:"none"},"& .MuiAlert-message":{textAlign:"center",width:"100%"},"&:hover":{"& .MuiAlert-message":{textDecoration:"underline",userSelect:"none"}},"&.pastDue":{background:"#C00C10"}},"& .MuiButtonBase-root":{padding:"0px 5px",borderRadius:5,"&:first-child":{marginRight:5},"& img":{imageRendering:"crisp-edges",height:24,width:24,margin:8}}})),A="/billing";function N({children:e}){let t=g(),n=(0,f.d4)(v.dG),i=(0,f.d4)(v.dc),[a,s]=(0,o.useState)(!1),[d,u]=(0,o.useState)(!1),p=(0,y.useRouter)(),N=async()=>{try{let{data:e}=await m().get("/api/v1/payment-requests/userId/me/pending-payment-request");e&&(s(!0),u(e.status===C.O5.pastDue))}catch(e){}};return(0,o.useEffect)(()=>{i&&"student"===n&&p?.pathname!==A&&N()},[i,n,p?.pathname]),(0,r.FD)("div",{className:h()(t.root,"past-due-payment-request-banner",{bannerShown:a}),children:[a?(0,r.Y)(l.A,{className:h()(t.alert,{pastDue:d}),variant:"filled",icon:(0,r.Y)(c.A,{}),onClick:()=>{p.push(A)},children:d?"\uD83D\uDD14 You have past-due bills. Please make a payment soon to ensure uninterrupted lessons.":"\uD83D\uDD14 You have pending bills. Pay now."}):null,e]})}N.propTypes={children:s().node};let T=({children:e,...t})=>(0,r.Y)(N,{children:(0,r.Y)(i.A,{...t,children:e})})},27045:(e,t,n)=>{"use strict";n.r(t),n.d(t,{default:()=>S});var r=n(73766),o=n(79672),i=n.n(o),a=n(66741),s=n(53239),d=n(64869),l=n(46407),c=n(33415),u=n(9834),m=n(11377),p=n(6961),h=n(53583),f=n(49055),v=n(56214),y=n(71979),C=n(11981),g=n(94383),A=n(68209),N=n(11230),T=n.n(N),b=n(95848),$=n.n(b);let M=(0,A.A)(e=>({root:{margin:16},container:{maxHeight:600},counsellorSelector:{display:"flex",alignItems:"center",marginBottom:10,justifyContent:"space-between"},formControl:{margin:e.spacing(1),minWidth:250},selectMenu:{"& .MuiListItem-root:not(.Mui-disabled)":{paddingLeft:35},"& .Mui-disabled":{opacity:1,paddingLeft:15,fontWeight:600},"& .MuiListItem-root.hide":{maxHeight:0,padding:0,margin:0,visibility:"hidden"}}})),w=["new","interested","demo-requested","demo-scheduled","demo-completed"],Y=["fake","duplicate"],q=["interested","demo-requested","demo-scheduled","demo-completed","converted","not-converted","pre-pitch-drop-off","not-interested"],D=["converted","not-converted","pre-pitch-drop-off","not-interested"];function _(e,{status:t}){return{...e,[t]:(e?.[t]||0)+1,...w.includes(t)?{"in-process":(e?.["in-process"]||0)+1}:{},...Y.includes(t)?{invalid:(e?.invalid||0)+1}:{},...q.includes(t)?{valid:(e?.valid||0)+1}:{},...D.includes(t)?{processed:(e?.processed||0)+1}:{},conversionPercent:Math.round((e?.converted||0)/(e?.valid||0)*100),processedRequestsConversions:Math.round((e?.converted||0)/((e?.converted||0)+(e?.["not-converted"]||0)+(e?.["pre-pitch-drop-off"]||0)+(e?.["not-interested"]||0))*100),total:(e?.total||0)+1}}function S(){let[e,t]=(0,s.useState)("all"),[n,o]=(0,s.useState)([]),[A,N]=(0,s.useState)([]),[b,w]=(0,s.useState)([]),[Y,q]=(0,s.useState)(!1),[D,S]=(0,s.useState)(!1),I=M(),R=(0,d.wA)();(0,s.useEffect)(()=>{i().get(`/api/v1/classrooms/classroomRequests/analyse?${e&&"all"!==e?`counsellorId=${e}`:""}`).then(({data:e})=>{o(e)}).catch(e=>{R((0,l.z2)({message:(0,c.u1)(e),properties:{type:"error",autoHide:5e3}}))})},[R,e]),(0,s.useEffect)(()=>{if(n.length>0){let{minCreatedAtMs:e,maxCreatedAtMs:t,...r}=function(e,t=!0,n=!1){return e.reduce((e,{createdAt:r,status:o,counsellors:i})=>{if(!n&&!i.some(e=>e?.active))return e;let s=a.DateTime.fromISO(r),d=s.toFormat("LLL yyyy"),l=s.valueOf();return e.minCreatedAtMs||e.maxCreatedAtMs?(e.minCreatedAtMs>l&&(e.minCreatedAtMs=l),e.maxCreatedAtMs<l&&(e.maxCreatedAtMs=l)):(e.minCreatedAtMs=l,e.maxCreatedAtMs=l),{...e,[d]:{...e[d]||{},all:_(e?.[d]?.all,{status:o}),...t?i?.reduce((t,r)=>{if(n||r?.active){let n=`${r?.name?.first||""} ${r?.name?.last||""}`;
1return{...t,[n]:_(e?.[d]?.[n],{status:o,name:n})}}return t},{}):{}}}},{minCreatedAtMs:null,maxCreatedAtMs:null})}(n,Y,D);if(Object.values(r).length>0)w((function(e,t){let n=[],r=a.DateTime.fromMillis(t).startOf("month");do n.push(r.toFormat("LLL yyyy")),r=r.minus({month:1});while(r.valueOf()>e);return n})(e,t).reduce((e,t)=>[...e,...r?.[t]?Object.entries(r[t]).map(([e,n])=>({month:t,counsellor:e,...n})):[]],[]));else w([])}else w([])},[n,Y,D]),(0,s.useEffect)(()=>{i().get("/api/v1/users?role=admin").then(({data:e})=>{N(e)}).catch(e=>{R((0,l.z2)({message:(0,c.u1)(e),properties:{type:"error",autoHide:5e3}}))})},[R]);let k=(0,s.useMemo)(()=>{if(b.length>0){let e=0,t=0;return b.forEach(n=>{"all"===n.counsellor&&(e=(n?.converted||0)+e,t=(n?.processed||0)+t)}),Math.round(e/t*100)}return 0},[b]),P=(0,s.useMemo)(()=>A.reduce((e,t)=>({...e,...t.active?{active:[...e.active,t]}:{other:[...e.other,t]}}),{active:[],other:[]}),[A]),x=({_id:e,name:t,active:n})=>(0,r.Y)(p.A,{value:e,className:T()({hide:!D&&!n}),children:`${t?.first||""} ${t?.last||""}`},e);return(0,r.FD)(m.A,{minimizeSideNavbar:!1,children:[(0,r.Y)($(),{children:(0,r.Y)("title",{children:"Classroom Request Analyser"})}),(0,r.FD)("div",{className:I.root,children:[(0,r.Y)("div",{className:I.title,children:(0,r.Y)(h.A,{variant:"h6",component:"div",children:"Classroom Request Analyser"})}),(0,r.FD)("div",{className:I.counsellorSelector,children:[(0,r.FD)(f.A,{variant:"standard",className:I.formControl,children:[(0,r.Y)(v.A,{id:"counsellor-label",children:"Counsellors"}),(0,r.FD)(y.A,{variant:"standard",labelId:"counsellor-label",id:"counsellor-select",value:e,onChange:e=>{t(e.target.value)},color:"primary",MenuProps:{className:I.selectMenu},children:[(0,r.Y)(p.A,{value:"all",children:"All counsellors"}),(0,r.Y)(p.A,{disabled:!0,children:"Active Counsellors"}),P.active.map(x),(0,r.Y)(p.A,{disabled:!0,className:T()({hide:!D}),children:"Other Counsellors"}),P.other.map(x)]})]}),(0,r.Y)(f.A,{variant:"standard",className:I.formControl,children:(0,r.Y)(C.A,{control:(0,r.Y)(g.A,{checked:Y,onChange:e=>{q(e.target.checked)},name:"splitRequestCounsellors",color:"primary"}),label:"Split Reqsts by Counsellors"})}),(0,r.Y)(f.A,{variant:"standard",className:I.formControl,children:(0,r.Y)(C.A,{control:(0,r.Y)(g.A,{checked:D,onChange:e=>{S(e.target.checked)},name:"showInActiveCounsellors",color:"primary"}),label:"Show Inactive Counsellors"})}),(0,r.FD)(h.A,{variant:"h6",children:["Total Conversion: ",k,"%"]})]}),(0,r.Y)(u.A,{rows:b,columns:[{field:"month",headerName:"Month",minWidth:120,component:function(e){return e.month||0}},{field:"new",headerName:"New",sortType:u.$.numeric,component:function(e){return e.new||0}},{field:"interested",headerName:"Int",headerTitle:"Interested",sortType:u.$.numeric,component:function(e){return e.interested||0}},{field:"demo-requested",headerName:"D_Req",headerTitle:"Demo Requested",sortType:u.$.numeric,component:function(e){return e?.["demo-requested"]||0}},{field:"demo-scheduled",headerName:"D_Sch",headerTitle:"Demo Scheduled",sortType:u.$.numeric,component:function(e){return e?.["demo-scheduled"]||0}},{field:"demo-completed",headerName:"D_Com",headerTitle:"Demo Completed",sortType:u.$.numeric,component:function(e){return e?.["demo-completed"]||0}},{field:"converted",headerName:"Cnv",headerTitle:"Converted",sortType:u.$.numeric,component:function(e){return e.converted||0}},{field:"not-converted",headerName:"Nt_Cnv",headerTitle:"Not Converted",sortType:u.$.numeric,component:function(e){return e?.["not-converted"]||0}},{field:"pre-pitch-drop-off",headerName:"PrePitch",headerTitle:"Pre-Pitch Drop Off",sortType:u.$.numeric,component:function(e){return e?.["pre-pitch-drop-off"]||0}},{field:"not-interested",headerName:"Nt_Int",headerTitle:"Not Interested",sortType:u.$.numeric,component:function(e){return e?.["not-interested"]||0}},{field:"fake",headerName:"Fake",sortType:u.$.numeric,component:function(e){return e?.fake||0}},{field:"duplicate",headerName:"Dplc",sortType:u.$.numeric,component:function(e){return e?.duplicate||0}},{field:"rejected",headerName:"Rej",sortType:u.$.numeric,component:function(e){return e?.rejected||0}},{field:"in-process",headerName:"In_prc",headerTitle:"In Process",sortType:u.$.numeric,component:function(e){return e?.["in-process"]||0}},{field:"invalid",headerName:"Invld",sortType:u.$.numeric,component:function(e){return e?.invali
1d||0}},{field:"valid",headerName:"Vld",sortType:u.$.numeric,component:function(e){return e?.valid||0}},{field:"processed",headerName:"Prcsd",sortType:u.$.numeric,component:function(e){return e?.processed||0}},{field:"total",headerName:"Tot",sortType:u.$.numeric,component:function(e){return e?.total||0}},{field:"conversionPercent",headerName:"Cnv(%)",headerTitle:"Conversion (%)",sortType:u.$.numeric,component:function(e){return`${e?.conversionPercent||0}%`}},{field:"processedRequestsConversions",headerName:"Prcsd_Req_Conv(%)",headerTitle:"Processed Requests Conversions (%)",sortType:u.$.numeric,component:function(e){return`${e?.processedRequestsConversions||0}%`}},{field:"counsellor",headerName:"Counsellors",sortType:u.$.numeric,component:function(e){return`${e?.counsellor==="all"?"":e?.counsellor}`}}]})]})]})}},46652:(e,t,n)=>{(window.__NEXT_P=window.__NEXT_P||[]).push(["/admin/requests/analyse-table",function(){return n(27045)}])}},e=>{e.O(0,[89324,70340,71374,42635,33565,52945,55945,1753,84565,251,6067,79920,73287,84988,55565,71979,56952,19463,4498,37717,81722,85355,8393,9834,90636,46593,38792],()=>e(e.s=46652)),_N_E=e.O()}]);
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.