mario-education 2.0.249-staging → 2.0.250-staging
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index-DoE-x6tL.cjs +1 -0
- package/dist/index-bDuiCnkV.js +2592 -0
- package/dist/index.js +1 -1
- package/dist/index.modern.js +1 -1
- package/dist/mario-education.css +1 -1
- package/package.json +1 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),v=require("react"),y=require("mario-core"),le=require("react-redux"),se=require("react-router-dom"),z=require("moment"),J=require("./EmotionIcons-CG5Kgp0c.cjs"),Fe=require("./constants-CEtnmqRg.cjs"),me=require("./constants-AmXlyc2R.cjs"),j=require("@mui/material"),X=require("./Loading-CHowA_dQ.cjs"),Ee=(s="en-US",a)=>{const n=new URLSearchParams({language:s});return a&&a!=="BOTH"&&n.append("schoolType",a),y.api.get(`${y.BASE_URL}/api/Report/homepage-init?${n.toString()}`)},Ae=s=>{const a=new URLSearchParams;s&&s!=="BOTH"&&a.append("schoolType",s);const n=a.toString();return y.api.get(`${y.BASE_URL}/api/Report/homepage-analytics${n?`?${n}`:""}`)},Oe=s=>y.api.get(`${y.BASE_URL}/api/WellBeing/total-dashboard`,{params:s}),Ge=(s,a,n="en-US")=>{const o=["Admin","Teacher","Assistant","Counselor","SecondaryTeacher"],l=a?{"x-school-level":"es"}:{"x-school-level":"ms"};return y.api.get(`${y.BASE_URL}/api/Session/${s}/results`,{params:{roles:o,lang:n},headers:l})},he=s=>{const a=s?{"x-school-level":"es"}:{"x-school-level":"ms"};return y.api.get(`${y.BASE_URL}/api/scaffoldingQuestion/get-tree`,{headers:a})},ee=[{usStage:"Preschool / Early Childhood",usGrade:"Preschool",ukStage:"Early Years / Nursery",ukYearGroup:"Nursery",ukKeyStage:"EYFS"},{usStage:"Pre-K / Kindergarten prep",usGrade:"Pre-K",ukStage:"Reception",ukYearGroup:"Reception",ukKeyStage:"EYFS"},{usStage:"Elementary School",usGrade:"Kindergarten",ukStage:"Primary School",ukYearGroup:"Year 1",ukKeyStage:"Key Stage 1"},{usStage:"Elementary School",usGrade:"Grade 1",ukStage:"Primary School",ukYearGroup:"Year 2",ukKeyStage:"Key Stage 1"},{usStage:"Elementary School",usGrade:"Grade 2",ukStage:"Primary School",ukYearGroup:"Year 3",ukKeyStage:"Key Stage 2"},{usStage:"Elementary School",usGrade:"Grade 3",ukStage:"Primary School",ukYearGroup:"Year 4",ukKeyStage:"Key Stage 2"},{usStage:"Elementary School",usGrade:"Grade 4",ukStage:"Primary School",ukYearGroup:"Year 5",ukKeyStage:"Key Stage 2"},{usStage:"Elementary School",usGrade:"Grade 5",ukStage:"Primary School",ukYearGroup:"Year 6",ukKeyStage:"Key Stage 2"},{usStage:"Middle School",usGrade:"Grade 6",ukStage:"Secondary School",ukYearGroup:"Year 7",ukKeyStage:"Key Stage 3"},{usStage:"Middle School",usGrade:"Grade 7",ukStage:"Secondary School",ukYearGroup:"Year 8",ukKeyStage:"Key Stage 3"},{usStage:"Middle School",usGrade:"Grade 8",ukStage:"Secondary School",ukYearGroup:"Year 9",ukKeyStage:"Key Stage 3"},{usStage:"High School",usGrade:"Grade 9",ukStage:"Secondary / GCSE years",ukYearGroup:"Year 10",ukKeyStage:"Key Stage 4"},{usStage:"High School",usGrade:"Grade 10",ukStage:"Secondary / GCSE years",ukYearGroup:"Year 11",ukKeyStage:"Key Stage 4"},{usStage:"High School",usGrade:"Grade 11",ukStage:"Sixth Form / College",ukYearGroup:"Year 12",ukKeyStage:"Key Stage 5"},{usStage:"High School",usGrade:"Grade 12",ukStage:"Sixth Form / College",ukYearGroup:"Year 13",ukKeyStage:"Key Stage 5"}],xe=[{icon:"sparkles",color:"#336DDA",gradient:"linear-gradient(135deg, #3b82f6, #6366f1)"},{icon:"heart",color:"#C54140",gradient:"linear-gradient(135deg, #f87171, #f43f5e)"},{icon:"trending-up",color:"#FFB04F",gradient:"linear-gradient(135deg, #fb923c, #f59e0b)"},{icon:"sparkles",color:"#73C8E5",gradient:"linear-gradient(135deg, #38bdf8, #3b82f6)"},{icon:"heart",color:"#C54140",gradient:"linear-gradient(135deg, #f472b6, #ef4444)"},{icon:"trending-up",color:"#336DDA",gradient:"linear-gradient(135deg, #60a5fa, #4f46e5)"},{icon:"trending-up",color:"#FFB04F",gradient:"linear-gradient(135deg, #fde047, #f97316)"},{icon:"trophy",color:"#73C8E5",gradient:"linear-gradient(135deg, #38bdf8, #22d3ee)"}],Te=(s,a,n=22)=>{const o=(a||"").toLowerCase();return o==="yes"||o==="1"?e.jsx(J.VeryHighIcon,{size:n}):o==="no"||o==="0"?e.jsx(J.VeryLowIcon,{size:n}):!s||isNaN(s)?null:s<=20?e.jsx(J.VeryLowIcon,{size:n}):s<=40?e.jsx(J.LowIcon,{size:n}):s<=60?e.jsx(J.NormalIcon,{size:n}):s<=80?e.jsx(J.HighIcon,{size:n}):e.jsx(J.VeryHighIcon,{size:n})};function ge(s,a){if(!s)return"";const n=s.trim(),o=n.toLowerCase();if(o==="k"||o==="kindergarten"){const i=ee.find(d=>d.usGrade.toLowerCase()==="kindergarten");return i?a?`${i.ukYearGroup} / ${i.usGrade}`:`${i.usGrade} / ${i.ukYearGroup}`:"Kindergarten"}let l=ee.find(i=>i.usGrade.toLowerCase()===o||i.ukYearGroup.toLowerCase()===o);!l&&o.startsWith("grade ")&&(l=ee.find(i=>i.usGrade.toLowerCase()===o)),!l&&o.startsWith("year ")&&(l=ee.find(i=>i.ukYearGroup.toLowerCase()===o));const u=o.replace(/^grade\s+/i,"").replace(/^year\s+/i,"").trim();return!l&&/^\d+$/.test(u)&&(a?l=ee.find(i=>i.ukYearGroup.toLowerCase().replace(/^year\s+/i,"").trim()===u):l=ee.find(i=>i.usGrade.toLowerCase().replace(/^grade\s+/i,"").trim()===u)),l?a?`${l.ukYearGroup} / ${l.usGrade}`:`${l.usGrade} / ${l.ukYearGroup}`:/^\d+$/.test(u)?a?`Year ${u} / Grade ${u}`:`Grade ${u} / Year ${u}`:n}function Ce(s){if(!s)return"S";const a=s.trim().split(/\s+/);return a.length===1?a[0].slice(0,2).toUpperCase():(a[0][0]+a[a.length-1][0]).toUpperCase()}function je(s){const a=Math.round((s||0)*60),n=Math.floor(a/3600),o=Math.floor(a%3600/60),l=a%60,u=i=>i.toString().padStart(2,"0");return`${u(n)}:${u(o)}:${u(l)}`}function Se(s){return!s||s.length===0?[]:s.map(a=>({studentId:a.studentId||0,studentName:a.studentName||"",studentAvatar:a.studentAvatar,gradeLevel:a.gradeLevel||"",isUnsafe:!!a.isUnsafe,isHighStress:!!a.isHighStress,lastInteractionDate:a.time,sessionId:a.sessionId,sessionResultId:a.sessionResultId})).sort((a,n)=>{const o=a.lastInteractionDate?new Date(a.lastInteractionDate).getTime():0;return(n.lastInteractionDate?new Date(n.lastInteractionDate).getTime():0)-o})}const re=s=>{const a=s.nameQuestion||s.text||s.question||s.name||"",n=a.match(/<p[^>]*>(.*?)<\/p>/i);let l=(n?n[1]:a).replace(/<[^>]+>/g,"").trim();return l==="School"?l="Safety at school":l==="Home"?l="Safety at home":l==="Online"&&(l="Safety online"),l},de=(s,a=!1)=>{const n=s.answer!==void 0&&s.answer!==null?String(s.answer).trim():"";if(!n)return"";if(isNaN(Number(n)))return n;const o=Number(n);let l=s.questionAnswer||s.questionAnswers||[];if(typeof l=="string")try{l=JSON.parse(l)}catch{l=[]}const u=String(s.type||"").toLowerCase(),i=s.type==="Rating"||s.type===10||s.type==="StarRating"||s.type===6||s.type==="Slider"||s.type===4||s.type==="ProgressBar"||s.type===5||u.includes("rating")||u.includes("slider")||u.includes("progressbar"),d=a||!!s.isQuestionForGrade1And2||typeof s.page=="number";if(Array.isArray(l)&&l.length>0){if(d){if(i&&(o===20||o===40||o===60||o===80||o===100)){const h=Math.min(Math.max(0,Math.round(o/20)-1),l.length-1);return l[h]||""}if(Number.isInteger(o)&&o>=0&&o<l.length)return l[o]||"";if(Number.isInteger(o)&&o>=1&&o<=l.length&&l[o-1])return l[o-1]}if(!d&&i){if(re(s).toLowerCase().includes("stress")){let k=0;return o<-60?k=0:o<-20?k=1:o<20?k=2:o<60?k=3:k=4,l[k]||l[0]||""}const c=Math.max(0,Math.min(100,o)),w=100/l.length;let b=Math.floor(c/w);return b=Math.min(b,l.length-1),l[b]||""}if(Array.isArray(s.questionItemAnswers)&&s.questionItemAnswers.length>0){const h=s.questionItemAnswers.find(c=>String(c.id)===n);if(h)return h.text||h.name||""}if(Number.isInteger(o)&&o>=0&&o<l.length){const h=l[o];return typeof h=="string"?h:h?.text||h?.name||""}if(Number.isInteger(o)&&o>=1&&o<=l.length&&l[o-1]){const h=l[o-1];return typeof h=="string"?h:h?.text||h?.name||""}const m=Math.max(0,Math.min(100,o)),g=100/l.length;let p=Math.floor(m/g);return p=Math.min(p,l.length-1),l[p]||""}if(d&&i){if(o===20)return"Low";if(o===40)return"Medium Low";if(o===60)return"Medium";if(o===80)return"Medium High";if(o===100)return"High"}return""},ke=(s,a=!1,n=!1)=>{if(a){if(s<=-60||s>=60)return{bg:"rgba(196, 65, 64, 0.24)",color:"#C44140"};if(s>=-60&&s<-20)return{bg:"rgba(169, 214, 96, 0.24)",color:"#5C8A18"};if(s>=-20&&s<20)return{bg:"rgba(15, 150, 85, 0.24)",color:"#0F9655"};if(s>=20&&s<60)return{bg:"rgba(255, 208, 40, 0.24)",color:"#854d0e"}}const o=Math.max(0,Math.min(100,s));return n?o<=20?{bg:"rgba(196, 65, 64, 0.24)",color:"#C44140"}:o<=40?{bg:"rgba(255, 176, 79, 0.24)",color:"#FFB04F"}:o<=60?{bg:"rgba(255, 208, 40, 0.24)",color:"#854d0e"}:o<=80?{bg:"rgba(169, 214, 96, 0.24)",color:"#5C8A18"}:{bg:"rgba(15, 150, 85, 0.24)",color:"#0F9655"}:o<20?{bg:"rgba(196, 65, 64, 0.24)",color:"#C44140"}:o<40?{bg:"rgba(255, 176, 79, 0.24)",color:"#FFB04F"}:o<60?{bg:"rgba(255, 208, 40, 0.24)",color:"#854d0e"}:o<80?{bg:"rgba(169, 214, 96, 0.24)",color:"#5C8A18"}:{bg:"rgba(15, 150, 85, 0.24)",color:"#0F9655"}},De=s=>{if(!s)return[];const a=s?.resultTeacher?.questions||s?.teacherResult?.questions||[],n=a.find(u=>u.type==="LearningStrategy"||u.learningStrategyAnswers&&u.learningStrategyAnswers.length>0)||a[0]||s?.learningStrategyOptions,o=n?.answer||s?.resultTeacher?.answer||s?.teacherResult?.answer||"",l=n?.learningStrategyAnswers||s?.learningStrategyAnswers||[];return o?String(o).split(";").filter(Boolean).map(i=>{const d=i.split("|"),m=parseInt(d[0],10);if(!isNaN(m)&&l&&l.length>0){const g=l.find(p=>Number(p.id)===m);if(g&&(g.text||g.name))return(g.text||g.name).trim()}return d[1]&&d[1].trim()!==""&&isNaN(Number(d[1].trim()))?d[1].trim():""}).filter(Boolean):s?.agreedStrategies&&Array.isArray(s.agreedStrategies)?s.agreedStrategies:s?.previousOneToOneStrategyName?s.previousOneToOneStrategyName.split(",").map(u=>u.trim()).filter(Boolean):[]},Pe=(s,a=!1)=>{if(!s||s.length===0)return[];const n=s.find(d=>{const m=re(d).toLowerCase();return m.includes("ready to learn")||m.includes("ready to do your best learning")||m.includes("are you ready")}),o=n?de(n,a).toLowerCase():"",l=n?.answer!==void 0&&n?.answer!==null?String(n.answer).trim().toLowerCase():"",u=o==="yes"||l==="yes"||l==="1";return s.filter(d=>{if(d.type==="Summarize"||d.type===20)return!1;const m=String(d.type||"").toLowerCase();if(d.type==="TextInput"||d.type==="TextInputWithSuggestions"||d.type===3||d.type===7||m.includes("textinput"))return!1;const g=re(d).toLowerCase(),p=g.includes("why")&&(g.includes("not ready")||g.includes("ready"));return u&&p||p&&!de(d,a)&&(!d.answer||String(d.answer).trim()==="")?!1:!d.isReasonQuestion}).map(d=>{const m=re(d)||"Indicator",g=Number(d.answer)||0,p=m.toLowerCase().includes("stress"),h=de(d,a);let{bg:c,color:w}=ke(g,p,a);const b=d.type==="SingleChoice"||d.type===2||String(d.type).toLowerCase()==="singlechoice",k=String(d.answer||"").trim(),I=h.toLowerCase(),f=k.toLowerCase();(b||I==="yes"||I==="no"||f==="yes"||f==="no")&&(I==="yes"||f==="yes"||k==="1"?(c="rgba(15, 150, 85, 0.24)",w="#0F9655"):(I==="no"||f==="no"||k==="0")&&(c="rgba(196, 65, 64, 0.24)",w="#C44140"));const x=d.percent?`${d.percent}%`:g?`${g}%`:"";return{name:m,val:h,num:b||I==="yes"||I==="no"||f==="yes"||f==="no"?"":x,score:g,bg:c,color:w,type:d.type,group:d.group}})},_e=s=>!s||!Array.isArray(s)?[]:s.map((a,n)=>{const o=xe[n%xe.length];return{id:`${(a.category||"").replace(/[^a-zA-Z0-9]/g,"_").toLowerCase()}_${n}`,label:a.category,...o,questions:a.questions||[]}});function pe(s,a,n,o,l,u,i){const d=a||0,m=n||o||0;if(l)u?u({sessionId:d,sessionResultId:m}):window.dispatchEvent(new CustomEvent("OPEN_ES_IFRAME",{detail:{sessionId:d,sessionResultId:m}}));else{const g=i?`&actionBack=${i}`:"",p=`/view-session/${d}/${m}?isReadOnly=true${g}`;s(p)}}async function Ue(s,a,n){if(!s)return null;try{const o=await Ge(s,a);if(o?.data)return n&&n(o.data),o.data}catch(o){console.error("Failed to fetch session detail for log modal",o)}return null}function He(s="BOTH"){const a=se.useNavigate(),n=le.useSelector(A=>A.common?.user),o=le.useSelector(A=>A.common?.language),l=n?.roles||[],u=n?.hasEsSchool!==!1,i=(n?.appTypeRaw??n?.appType??"").toUpperCase(),d=!i||i.includes("MS"),m=u&&(!i||i.includes("ES")),{msRoles:g,esRoles:p}=Fe.getAccessibleRoles(n?.appType,n?.msRoles,n?.esRoles),h=g.includes("Admin"),c=p.includes("Admin");let w="BOTH";h&&!c?w="MS":c&&!h?w="ES":m?d?w="BOTH":w="ES":w="MS";const b=s!=="BOTH"?s:w,[k,I]=v.useState(!0),[f,x]=v.useState(!0),[T,N]=v.useState(null),[R,F]=v.useState(null),[O,G]=v.useState(null),[D,E]=v.useState(!0),[H,C]=v.useState(null),[Y,Q]=v.useState([]),[ie,Z]=v.useState([]),[ce,_]=v.useState("without"),[S,L]=v.useState("US"),[$,P]=v.useState(null),[U,W]=v.useState(null),te=v.useCallback((A,V,B,M,K)=>{pe(a,A,V,B,M,ne=>{W(ne)},K)},[a]),q=v.useCallback(()=>{N(null),I(!0),x(!0),E(!0),Ee(o||"en-US",b).then(B=>{const M=B.data;b!=="BOTH"&&M?.students&&(M.students=M.students.filter(K=>K.schoolType?.toUpperCase()===b)),F(M)}).catch(B=>{console.error("Failed to load init data:",B),N(B?.message||"Failed to load init data")}).finally(()=>{I(!1)}),Ae(b).then(B=>{const M=B.data;b!=="BOTH"&&M?.flaggedStudents&&(M.flaggedStudents.redFlags&&(M.flaggedStudents.redFlags=M.flaggedStudents.redFlags.filter(K=>K.schoolType?.toUpperCase()===b),M.flaggedStudents.redFlagCount=M.flaggedStudents.redFlags.length),M.flaggedStudents.yellowFlags&&(M.flaggedStudents.yellowFlags=M.flaggedStudents.yellowFlags.filter(K=>K.schoolType?.toUpperCase()===b),M.flaggedStudents.yellowFlagCount=M.flaggedStudents.yellowFlags.length)),G(M)}).catch(B=>{console.error("Failed to load analytics data:",B),N(B?.message||"Failed to load analytics data")}).finally(()=>{x(!1)}),(async()=>{try{const B={startDate:z().startOf("month").valueOf(),endDate:z().endOf("month").valueOf(),optionDate:"Monthly",includeMonthAndWeekView:!0,roles:l,language:o||"en-US"},M=await Oe(B);M?.data&&C(M.data)}catch(B){console.error("Failed to load staff well-being data:",B),N(B?.message||"Failed to load staff well-being data")}finally{E(!1)}})();const V=[];m?V.push(he(!0).then(B=>{B?.data&&Q(_e(B.data))}).catch(()=>null)):Q([]),d?V.push(he(!1).then(B=>{B?.data&&Z(_e(B.data))}).catch(()=>null)):Z([]),Promise.all(V)},[m,d,l,o,b]);return v.useEffect(()=>{document.title="Overview",q()},[q]),{loading:k||f,loadingInit:k,loadingAnalytics:f,error:T,initData:R,analyticsData:O,caseMode:ce,setCaseMode:_,curriculumSystem:S,setCurriculumSystem:L,flagModal:$,setFlagModal:P,schoolType:b,refetch:q,handleViewCheckIn:te,esSessionIframe:U,setEsSessionIframe:W,conversationStartersEs:Y,conversationStartersMs:ie,loadingWellBeing:D,staffWellBeingData:H}}const fe=({width:s=17,height:a=17,color:n="#316CD9",className:o})=>e.jsxs("svg",{width:s,height:a,viewBox:"0 0 24 24",fill:"none",stroke:n,strokeWidth:"2",className:o,children:[e.jsx("path",{d:"M9 18h6"}),e.jsx("path",{d:"M10 22h4"}),e.jsx("path",{d:"M15.09 14c.18-.98.65-1.74 1.41-2.5A4.65 4.65 0 0 0 18 8 6 6 0 0 0 6 8c0 1.55.6 2.8 1.5 3.5.76.76 1.23 1.52 1.41 2.5"})]}),Le=({fill:s="#C44140",width:a=18,height:n=22,className:o})=>e.jsx("svg",{width:a,height:n,viewBox:"0 0 25 32",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:o,children:e.jsx("path",{d:"M24.2872 -0.141754C21.4658 3.28575 21.1281 7.25702 21.2999 11.6181C21.5098 16.9475 22.358 24.291 23.1786 29.5842C23.2998 30.3658 22.3867 30.8232 21.8404 30.2545C18.7939 27.0829 15.2541 23.33 12.0658 19.1775C9.28717 22.6735 7.06154 26.7226 4.6545 31.0487C4.42524 31.4608 3.88078 31.5433 3.52569 31.2194C3.11675 30.8465 2.84835 30.3374 2.77008 29.7869C1.08065 17.9028 0.131368 12.0405 2.66545e-06 -0.206989L24.2872 -0.141754Z",fill:s})}),ue=({width:s=16,height:a=16,color:n="currentColor",className:o})=>e.jsxs("svg",{width:s,height:a,viewBox:"0 0 24 24",fill:"none",stroke:n,strokeWidth:"2",className:o,children:[e.jsx("line",{x1:"5",y1:"12",x2:"19",y2:"12"}),e.jsx("polyline",{points:"12 5 19 12 12 19"})]}),Ie=({width:s=22,height:a=22,color:n="#316CD9",className:o})=>e.jsxs("svg",{width:s,height:a,viewBox:"0 0 24 24",fill:"none",stroke:n,strokeWidth:"2",className:o,children:[e.jsx("path",{d:"M19 21v-2a4 4 0 0 0-4-4H9a4 4 0 0 0-4 4v2"}),e.jsx("circle",{cx:"12",cy:"7",r:"4"})]}),$e=({width:s=18,height:a=18,color:n="rgba(36,36,36,0.56)",className:o})=>e.jsxs("svg",{width:s,height:a,viewBox:"0 0 24 24",fill:"none",stroke:n,strokeWidth:"2",className:o,children:[e.jsx("circle",{cx:"11",cy:"11",r:"8"}),e.jsx("line",{x1:"21",y1:"21",x2:"16.65",y2:"16.65"})]}),We=({width:s=17,height:a=17,color:n="currentColor",className:o})=>e.jsxs("svg",{width:s,height:a,viewBox:"0 0 24 24",fill:"none",stroke:n,strokeWidth:"2",className:o,children:[e.jsx("path",{d:"M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6"}),e.jsx("polyline",{points:"15 3 21 3 21 9"}),e.jsx("line",{x1:"10",y1:"14",x2:"21",y2:"3"})]}),Ve=({direction:s="up",width:a=16,height:n=16,color:o,className:l})=>{const u=s==="up",d=o||(u?"#0F9655":"#C44140");return e.jsx("svg",{width:a,height:n,viewBox:"0 0 24 24",fill:"none",stroke:d,strokeWidth:"2.5",strokeLinecap:"round",strokeLinejoin:"round",className:l,children:u?e.jsxs(e.Fragment,{children:[e.jsx("polyline",{points:"23 6 13.5 15.5 8.5 10.5 1 18"}),e.jsx("polyline",{points:"17 6 23 6 23 12"})]}):e.jsxs(e.Fragment,{children:[e.jsx("polyline",{points:"23 18 13.5 8.5 8.5 13.5 1 6"}),e.jsx("polyline",{points:"17 18 23 18 23 12"})]})})},Ye=({width:s=28,height:a=28,color:n="#ffffff",className:o})=>e.jsxs("svg",{width:s,height:a,viewBox:"0 0 24 24",fill:"none",stroke:n,strokeWidth:"2",className:o,children:[e.jsx("path",{d:"M17 21v-2a4 4 0 0 0-4-4H5a4 4 0 0 0-4 4v2"}),e.jsx("circle",{cx:"9",cy:"7",r:"4"}),e.jsx("path",{d:"M23 21v-2a4 4 0 0 0-3-3.87"}),e.jsx("path",{d:"M16 3.13a4 4 0 0 1 0 7.75"})]}),Ke=({width:s=18,height:a=18,color:n="#D3D3D3",className:o})=>e.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:s,height:a,viewBox:"0 0 24 24",fill:"none",stroke:n,strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:o,children:[e.jsx("rect",{width:"8",height:"4",x:"8",y:"2",rx:"1",ry:"1"}),e.jsx("path",{d:"M16 4h2a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V6a2 2 0 0 1 2-2h2"}),e.jsx("path",{d:"m9 14 2 2 4-4"})]}),ze=({width:s=18,height:a=18,color:n="#D3D3D3",className:o})=>e.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:s,height:a,viewBox:"0 0 24 24",fill:"none",stroke:n,strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:o,children:[e.jsx("circle",{cx:"12",cy:"12",r:"10"}),e.jsx("path",{d:"M12 6v6l4 2"})]}),Qe=({width:s=18,height:a=18,color:n="#D3D3D3",className:o})=>e.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:s,height:a,viewBox:"0 0 24 24",fill:"none",stroke:n,strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:o,children:e.jsx("path",{d:"M22 17a2 2 0 0 1-2 2H6.828a2 2 0 0 0-1.414.586l-2.202 2.202A.71.71 0 0 1 2 21.286V5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2z"})}),Be=({width:s=18,height:a=18,color:n="rgba(36,36,36,0.56)",className:o})=>e.jsxs("svg",{width:s,height:a,viewBox:"0 0 24 24",fill:"none",stroke:n,strokeWidth:"2",className:o,children:[e.jsx("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),e.jsx("line",{x1:"6",y1:"6",x2:"18",y2:"18"})]}),Ze=({width:s=12,height:a=12,color:n="rgba(36,36,36,0.56)",className:o})=>e.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:s,height:a,viewBox:"0 0 24 24",fill:"none",stroke:n,strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:o,children:[e.jsx("path",{d:"M8 2v4"}),e.jsx("path",{d:"M16 2v4"}),e.jsx("rect",{width:"18",height:"18",x:"3",y:"4",rx:"2"}),e.jsx("path",{d:"M3 10h18"})]}),qe=({width:s=13,height:a=13,color:n="#0F9655",className:o})=>e.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:s,height:a,viewBox:"0 0 24 24",fill:"none",stroke:n,strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:o,children:[e.jsx("circle",{cx:"12",cy:"12",r:"10"}),e.jsx("path",{d:"m9 12 2 2 4-4"})]}),Je=({width:s=13,height:a=13,color:n="rgba(36,36,36,0.56)",className:o})=>e.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:s,height:a,viewBox:"0 0 24 24",fill:"none",stroke:n,strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:o,children:[e.jsx("path",{d:"M10.1 2.182a10 10 0 0 1 3.8 0"}),e.jsx("path",{d:"M13.9 21.818a10 10 0 0 1-3.8 0"}),e.jsx("path",{d:"M17.609 3.721a10 10 0 0 1 2.69 2.7"}),e.jsx("path",{d:"M2.182 13.9a10 10 0 0 1 0-3.8"}),e.jsx("path",{d:"M20.279 17.609a10 10 0 0 1-2.7 2.69"}),e.jsx("path",{d:"M21.818 10.1a10 10 0 0 1 0 3.8"}),e.jsx("path",{d:"M3.721 6.391a10 10 0 0 1 2.7-2.69"}),e.jsx("path",{d:"M6.391 20.279a10 10 0 0 1-2.69-2.7"})]}),Me=({width:s=15,height:a=15,color:n="currentColor",className:o})=>e.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:s,height:a,viewBox:"0 0 24 24",fill:"none",stroke:n,strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:o,children:[e.jsx("rect",{width:"8",height:"4",x:"8",y:"2",rx:"1",ry:"1"}),e.jsx("path",{d:"M16 4h2a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V6a2 2 0 0 1 2-2h2"}),e.jsx("path",{d:"M12 11h4"}),e.jsx("path",{d:"M12 16h4"}),e.jsx("path",{d:"M8 11h.01"}),e.jsx("path",{d:"M8 16h.01"})]}),Xe=({width:s=15,height:a=15,color:n="currentColor",className:o})=>e.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:s,height:a,viewBox:"0 0 24 24",fill:"none",stroke:n,strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:o,children:[e.jsx("path",{d:"M13.4 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2v-7.4"}),e.jsx("path",{d:"M2 6h4"}),e.jsx("path",{d:"M2 10h4"}),e.jsx("path",{d:"M2 14h4"}),e.jsx("path",{d:"M2 18h4"}),e.jsx("path",{d:"M21.378 5.626a1 1 0 1 0-3.004-3.004l-5.01 5.012a2 2 0 0 0-.506.854l-.837 2.87a.5.5 0 0 0 .62.62l2.87-.837a2 2 0 0 0 .854-.506z"})]}),oe=({color:s="#0F9655",width:a=8,height:n=9})=>e.jsx("svg",{width:a,height:n,viewBox:"0 0 8 9",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:e.jsx("path",{d:"M4.35355 0.646446C4.15829 0.451184 3.84171 0.451184 3.64645 0.646446L0.464466 3.82843C0.269204 4.02369 0.269204 4.34027 0.464466 4.53553C0.659728 4.7308 0.976311 4.7308 1.17157 4.53553L4 1.70711L6.82843 4.53553C7.02369 4.7308 7.34027 4.7308 7.53553 4.53553C7.7308 4.34027 7.7308 4.02369 7.53553 3.82843L4.35355 0.646446ZM4.5 9L4.5 1L3.5 1L3.5 9L4.5 9Z",fill:s})}),ve=({color:s="#C44140",width:a=8,height:n=9})=>e.jsx("svg",{width:a,height:n,viewBox:"0 0 8 9",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:e.jsx("path",{d:"M4.35355 8.35355C4.15829 8.54882 3.84171 8.54882 3.64645 8.35355L0.464466 5.17157C0.269204 4.97631 0.269204 4.65973 0.464466 4.46447C0.659728 4.2692 0.976311 4.2692 1.17157 4.46447L4 7.29289L6.82843 4.46447C7.02369 4.2692 7.34027 4.2692 7.53553 4.46447C7.7308 4.65973 7.7308 4.97631 7.53553 5.17157L4.35355 8.35355ZM4.5 2.18557e-08L4.5 8L3.5 8L3.5 -2.18557e-08L4.5 2.18557e-08Z",fill:s})}),es=({width:s=17,height:a=17,color:n="#316CD9",className:o})=>e.jsxs("svg",{width:s,height:a,viewBox:"0 0 24 24",fill:"none",stroke:n,strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:o,children:[e.jsx("path",{d:"M3 3v18h18"}),e.jsx("path",{d:"M18 17V9"}),e.jsx("path",{d:"M13 17V5"}),e.jsx("path",{d:"M8 17v-3"})]}),ss=({width:s=18,height:a=18,color:n="#316CD9",className:o})=>e.jsxs("svg",{width:s,height:a,viewBox:"0 0 24 24",fill:"none",stroke:n,strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:o,children:[e.jsx("path",{d:"M3 9l9-7 9 7v11a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z"}),e.jsx("polyline",{points:"9 22 9 12 15 12 15 22"})]}),ts=({width:s=18,height:a=18,color:n="#316CD9",className:o})=>e.jsxs("svg",{width:s,height:a,viewBox:"0 0 24 24",fill:"none",stroke:n,strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:o,children:[e.jsx("circle",{cx:"12",cy:"12",r:"10"}),e.jsx("line",{x1:"2",y1:"12",x2:"22",y2:"12"}),e.jsx("path",{d:"M12 2a15.3 15.3 0 0 1 4 10 15.3 15.3 0 0 1-4 10 15.3 15.3 0 0 1-4-10 15.3 15.3 0 0 1 4-10z"})]}),ns=({width:s=18,height:a=18,color:n="#316CD9",className:o})=>e.jsxs("svg",{width:s,height:a,viewBox:"0 0 24 24",fill:"none",stroke:n,strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:o,children:[e.jsx("path",{d:"M14 22v-4a2 2 0 0 0-2-2v0a2 2 0 0 0-2 2v4"}),e.jsx("path",{d:"M18 22V6l-6-4-6 4v16"}),e.jsx("path",{d:"M6 12h12"}),e.jsx("path",{d:"M6 16h12"}),e.jsx("circle",{cx:"12",cy:"6",r:"1",fill:n})]}),as=({width:s=14,height:a=14,color:n="#C44140",className:o})=>e.jsx("svg",{width:s,height:a,viewBox:"0 0 24 24",fill:"none",stroke:n,strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:o,children:e.jsx("path",{d:"M12 22s8-4 8-10V5l-8-3-8 3v7c0 6 8 10 8 10z"})}),Re=({width:s=14,height:a=14,color:n="#B46A00",className:o})=>e.jsx("svg",{width:s,height:a,viewBox:"0 0 24 24",fill:"none",stroke:n,strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:o,children:e.jsx("polyline",{points:"22 12 18 12 15 21 9 3 6 12 2 12"})}),os=({width:s=17,height:a=17,color:n="#C44140",className:o})=>e.jsxs("svg",{width:s,height:a,viewBox:"0 0 24 24",fill:"none",stroke:n,strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:o,children:[e.jsx("path",{d:"M17 21v-2a4 4 0 0 0-4-4H5a4 4 0 0 0-4 4v2"}),e.jsx("circle",{cx:"9",cy:"7",r:"4"}),e.jsx("path",{d:"M23 21v-2a4 4 0 0 0-3-3.87"}),e.jsx("path",{d:"M16 3.13a4 4 0 0 1 0 7.75"})]}),ls=({width:s=16,height:a=16,color:n="#316CD9",className:o})=>e.jsxs("svg",{width:s,height:a,viewBox:"0 0 24 24",fill:"none",stroke:n,strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:o,children:[e.jsx("line",{x1:"19",y1:"12",x2:"5",y2:"12"}),e.jsx("polyline",{points:"12 19 5 12 12 5"})]}),rs="_overviewContainer_socjn_3",is="_mainContent_socjn_13",cs="_maxWidthWrapper_socjn_19",ds="_headerRow_socjn_24",hs="_mainTitle_socjn_33",_s="_subTitle_socjn_42",us="_layoutGrid_socjn_50",gs="_leftColumn_socjn_63",ps="_rightColumn_socjn_76",ms="_statCardGrid_socjn_86",xs="_statCard_socjn_86",js="_statCardHeader_socjn_115",fs="_iconBadge_socjn_122",vs="_iconBadgeRed_socjn_131",ws="_iconBadgeYellow_socjn_135",ys="_statCardLabel_socjn_139",bs="_statCardBody_socjn_148",Ns="_statCardValue_socjn_156",Ts="_statCardFooter_socjn_164",Cs="_lookupCard_socjn_175",Ss="_lookupTitleGroup_socjn_186",ks="_lookupIconBadge_socjn_194",Ls="_lookupHeading_socjn_204",Is="_lookupSubText_socjn_213",Bs="_lookupSearchGroup_socjn_219",Ms="_searchInputWrapper_socjn_228",Rs="_searchInput_socjn_228",Fs="_autocompleteMenu_socjn_255",Es="_autocompleteItem_socjn_269",As="_viewProfileBtn_socjn_279",Os="_wellnessCard_socjn_297",Gs="_wellnessHeader_socjn_304",Ds="_wellnessTitle_socjn_313",Ps="_wellnessSubtitle_socjn_322",Us="_phaseTabContainer_socjn_329",Hs="_phaseTabs_socjn_330",$s="_phaseTabBtn_socjn_338",Ws="_phaseTabBtnActive_socjn_350",Vs="_wellnessGrid_socjn_356",Ys="_wellnessGridEs_socjn_369",Ks="_wellnessRow_socjn_374",zs="_wellnessIconImg_socjn_382",Qs="_wellnessIconBadge_socjn_389",Zs="_wellnessRowLabel_socjn_399",qs="_wellnessRowLabelMs_socjn_405",Js="_wellnessRowLabelEs_socjn_410",Xs="_wellnessPill_socjn_414",et="_wellnessPillDivider_socjn_426",st="_wellnessPillPct_socjn_432",tt="_wellnessRowPct_socjn_436",nt="_wellnessRowRight_socjn_443",at="_viewDashBtn_socjn_450",ot="_seeUnhealthyBtn_socjn_466",lt="_unsafeBadge_socjn_487",rt="_highStressBadge_socjn_499",it="_usagePanel_socjn_512",ct="_usageHeader_socjn_519",dt="_usageIconCircle_socjn_527",ht="_schoolLogoImg_socjn_538",_t="_schoolBadgeName_socjn_545",ut="_usageTitle_socjn_553",gt="_usageDivider_socjn_561",pt="_usageTilesList_socjn_567",mt="_usageTile_socjn_567",xt="_usageTileHeader_socjn_580",jt="_usageTileLabel_socjn_587",ft="_usageProgressBarTrack_socjn_595",vt="_usageProgressBarFill_socjn_603",wt="_usageProgressBarFillGreen_socjn_609",yt="_usageTileValue_socjn_615",bt="_usageTileSubText_socjn_623",Nt="_deltaUp_socjn_630",Tt="_deltaDown_socjn_635",Ct="_campusCard_socjn_641",St="_campusHeader_socjn_649",kt="_campusTitle_socjn_658",Lt="_campusSubText_socjn_666",It="_sysToggleGroup_socjn_671",Bt="_sysToggleLabel_socjn_677",Mt="_tableWrapper_socjn_683",Rt="_overviewTable_socjn_689",Ft="_totalsRow_socjn_722",Et="_dashMuted_socjn_730",At="_redFlagText_socjn_735",Ot="_yellowFlagText_socjn_740",Gt="_helpPopoverWrapper_socjn_746",Dt="_infoHelpBtn_socjn_751",Pt="_popoverBackdrop_socjn_770",Ut="_referencePopover_socjn_779",Ht="_refTitle_socjn_803",$t="_refSubText_socjn_811",Wt="_refTableWrapper_socjn_818",Vt="_refTable_socjn_818",Yt="_usStageTd_socjn_849",Kt="_adminTipsWrapper_socjn_855",zt="_adminTipsBtn_socjn_862",Qt="_adminTipsPopover_socjn_876",Zt="_popoverArrow_socjn_889",qt="_popoverHeaderRow_socjn_907",Jt="_popoverIconCircle_socjn_914",Xt="_popoverHeaderTitle_socjn_923",en="_tipItem_socjn_937",sn="_tipNumber_socjn_944",tn="_tipText_socjn_958",nn="_dialogContentZero_socjn_969",an="_studentAvatarRed_socjn_973",on="_studentAvatarYellow_socjn_978",ln="_studentInfoCol_socjn_983",rn="_modalHeader_socjn_988",cn="_modalTitle_socjn_996",dn="_modalSubtitle_socjn_1004",hn="_modalCloseBtn_socjn_1010",_n="_modalStudentList_socjn_1022",un="_studentRow_socjn_1028",gn="_studentAvatar_socjn_973",pn="_studentName_socjn_1050",mn="_studentGrade_socjn_1056",xn="_studentMetaRow_socjn_1062",jn="_dateLabel_socjn_1070",fn="_loggedPill_socjn_1078",vn="_notLoggedPill_socjn_1090",wn="_modalActionButtons_socjn_1102",yn="_btnViewCheckIn_socjn_1109",bn="_btnViewLogActive_socjn_1123",Nn="_btnViewLogDisabled_socjn_1137",Tn="_wellBeingCard_socjn_1506",Cn="_iconContainer_socjn_1517",Sn="_wellBeingIconLabel_socjn_1527",kn="_wellBeingTitle_socjn_1532",Ln="_wellBeingDescription_socjn_1541",In="_wellBeingHeader_socjn_1550",Bn="_wellBeingActionBtn_socjn_1563",Mn="_staffOnlyBadge_socjn_1577",Rn="_gridContainer_socjn_1590",Fn="_cardItem_socjn_1597",En="_cardTitle_socjn_1603",An="_cardValue_socjn_1614",On="_subValue_socjn_1622",Gn="_cardSubText_socjn_1631",Dn="_customTooltip_socjn_1637",Pn="_emptyRoutineContainer_socjn_1666",Un="_emptyIconWrapper_socjn_1680",Hn="_emptyTitle_socjn_1691",$n="_emptySubText_socjn_1698",Wn="_setupRoutineBtn_socjn_1706",t={overviewContainer:rs,mainContent:is,maxWidthWrapper:cs,headerRow:ds,mainTitle:hs,subTitle:_s,layoutGrid:us,leftColumn:gs,rightColumn:ps,statCardGrid:ms,statCard:xs,statCardHeader:js,iconBadge:fs,iconBadgeRed:vs,iconBadgeYellow:ws,statCardLabel:ys,statCardBody:bs,statCardValue:Ns,statCardFooter:Ts,lookupCard:Cs,lookupTitleGroup:Ss,lookupIconBadge:ks,lookupHeading:Ls,lookupSubText:Is,lookupSearchGroup:Bs,searchInputWrapper:Ms,searchInput:Rs,autocompleteMenu:Fs,autocompleteItem:Es,viewProfileBtn:As,wellnessCard:Os,wellnessHeader:Gs,wellnessTitle:Ds,wellnessSubtitle:Ps,phaseTabContainer:Us,phaseTabs:Hs,phaseTabBtn:$s,phaseTabBtnActive:Ws,wellnessGrid:Vs,wellnessGridEs:Ys,wellnessRow:Ks,wellnessIconImg:zs,wellnessIconBadge:Qs,wellnessRowLabel:Zs,wellnessRowLabelMs:qs,wellnessRowLabelEs:Js,wellnessPill:Xs,wellnessPillDivider:et,wellnessPillPct:st,wellnessRowPct:tt,wellnessRowRight:nt,viewDashBtn:at,seeUnhealthyBtn:ot,unsafeBadge:lt,highStressBadge:rt,usagePanel:it,usageHeader:ct,usageIconCircle:dt,schoolLogoImg:ht,schoolBadgeName:_t,usageTitle:ut,usageDivider:gt,usageTilesList:pt,usageTile:mt,usageTileHeader:xt,usageTileLabel:jt,usageProgressBarTrack:ft,usageProgressBarFill:vt,usageProgressBarFillGreen:wt,usageTileValue:yt,usageTileSubText:bt,deltaUp:Nt,deltaDown:Tt,campusCard:Ct,campusHeader:St,campusTitle:kt,campusSubText:Lt,sysToggleGroup:It,sysToggleLabel:Bt,tableWrapper:Mt,overviewTable:Rt,totalsRow:Ft,dashMuted:Et,redFlagText:At,yellowFlagText:Ot,helpPopoverWrapper:Gt,infoHelpBtn:Dt,popoverBackdrop:Pt,referencePopover:Ut,refTitle:Ht,refSubText:$t,refTableWrapper:Wt,refTable:Vt,usStageTd:Yt,adminTipsWrapper:Kt,adminTipsBtn:zt,adminTipsPopover:Qt,popoverArrow:Zt,popoverHeaderRow:qt,popoverIconCircle:Jt,popoverHeaderTitle:Xt,tipItem:en,tipNumber:sn,tipText:tn,dialogContentZero:nn,studentAvatarRed:an,studentAvatarYellow:on,studentInfoCol:ln,modalHeader:rn,modalTitle:cn,modalSubtitle:dn,modalCloseBtn:hn,modalStudentList:_n,studentRow:un,studentAvatar:gn,studentName:pn,studentGrade:mn,studentMetaRow:xn,dateLabel:jn,loggedPill:fn,notLoggedPill:vn,modalActionButtons:wn,btnViewCheckIn:yn,btnViewLogActive:bn,btnViewLogDisabled:Nn,wellBeingCard:Tn,iconContainer:Cn,wellBeingIconLabel:Sn,wellBeingTitle:kn,wellBeingDescription:Ln,wellBeingHeader:In,wellBeingActionBtn:Bn,staffOnlyBadge:Mn,gridContainer:Rn,cardItem:Fn,cardTitle:En,cardValue:An,subValue:On,cardSubText:Gn,customTooltip:Dn,emptyRoutineContainer:Pn,emptyIconWrapper:Un,emptyTitle:Hn,emptySubText:$n,setupRoutineBtn:Wn},we=({kind:s,label:a,value:n,onOpen:o})=>{const{t:l}=y.useTranslation(),u=s==="red",i=u?"#C44140":"#F5D500",d=u?t.iconBadgeRed:t.iconBadgeYellow,m=l(u?"see_all_red_flags":"see_all_yellow_flags");return e.jsxs("div",{className:t.statCard,onClick:o,children:[e.jsxs("div",{className:t.statCardHeader,children:[e.jsx("div",{className:`${t.iconBadge} ${d}`,children:e.jsx(Le,{fill:i,width:18,height:22})}),e.jsx("span",{className:t.statCardLabel,children:a})]}),e.jsx("div",{className:t.statCardBody,children:e.jsx("span",{className:t.statCardValue,children:n})}),e.jsxs("div",{className:t.statCardFooter,children:[e.jsx("span",{children:m}),e.jsx(ue,{width:16,height:16})]})]})},Vn=({students:s=[],onSelectStudent:a})=>{const{t:n}=y.useTranslation(),o=le.useDispatch(),l=se.useNavigate(),i=le.useSelector(f=>f.common?.user)?.hasEsSchool!==!1,d=v.useRef(null),[m,g]=v.useState(""),[p,h]=v.useState(!1),[c,w]=v.useState(null),b=m.trim()?s.filter(f=>f.fullName.toLowerCase().includes(m.toLowerCase())):[];v.useEffect(()=>{const f=x=>{d.current&&!d.current.contains(x.target)&&h(!1)};return document.addEventListener("mousedown",f),()=>{document.removeEventListener("mousedown",f)}},[]);const k=f=>{g(f.fullName),w(f),h(!1),a&&a(f)},I=()=>{if(!c){o(y.setAlert({type:"danger",message:n("please_select_a_student")||"Please select a student from the list"}));return}const f={studentId:Number(c.id),studentUserId:c.userId||"",gender:[0,1,2],grade:c.gradeLevel?[c.gradeLevel]:[],optionDate:"Monthly"};sessionStorage.setItem(me.overviewFilterStorage,JSON.stringify(f)),localStorage.setItem(me.overviewFilterStorage,JSON.stringify(f));const x=c.schoolType?.trim().toUpperCase()||"",T=c.gradeLevel?.trim().toLowerCase()||"",N=i&&(x==="ES"||x==="ELEMENTARY"||["k","kg","pk","prek","pre-k","1","2","3","4","5"].includes(T));l(N?`/admin/dashboard-wrapper?type=elementary&studentId=${c.id}`:`/admin/dashboard?studentId=${c.id}`)};return e.jsxs("div",{className:t.lookupCard,ref:d,children:[e.jsxs("div",{className:t.lookupTitleGroup,children:[e.jsx("div",{className:t.lookupIconBadge,children:e.jsx(Ie,{width:22,height:22,color:"#316CD9"})}),e.jsxs("div",{children:[e.jsx("h2",{className:t.lookupHeading,children:n("student_lookup")}),e.jsx("p",{className:t.lookupSubText,children:n("search_and_view_any_student_profile")})]})]}),e.jsxs("div",{className:t.lookupSearchGroup,children:[e.jsxs("div",{className:t.searchInputWrapper,children:[e.jsx($e,{width:18,height:18,color:"rgba(36,36,36,0.56)"}),e.jsx("input",{type:"text",className:t.searchInput,value:m,onChange:f=>{g(f.target.value),w(null),h(!0)},onFocus:()=>h(!0),placeholder:n("search_by_student_name")})]}),p&&b.length>0&&e.jsx("div",{className:t.autocompleteMenu,children:b.map(f=>e.jsxs("div",{className:t.autocompleteItem,onClick:()=>k(f),children:[f.fullName," (",`Grade ${f.gradeLevel||"——"}`,")"]},f.id))}),e.jsxs("button",{type:"button",className:t.viewProfileBtn,onClick:I,children:[e.jsx(We,{width:17,height:17}),e.jsx("span",{children:n("view_profile")})]})]})]})},Yn="/images/image-default.png",Kn=({open:s,onClose:a,students:n,curriculumSystem:o="US",isEs:l=!1})=>{const u=se.useNavigate(),{t:i}=y.useTranslation(),d=Se(n),m=i("unsafe_and_stressed_students"),g=`${d.length} ${i("students_flagged_for_safety_or_stress")}`;return e.jsxs(j.Dialog,{open:s,onClose:a,maxWidth:"md",fullWidth:!0,PaperProps:{style:{borderRadius:20,boxShadow:"0 20px 60px rgba(31, 63, 115, 0.3)",overflow:"hidden"}},children:[e.jsxs("div",{className:t.modalHeader,children:[e.jsxs("div",{children:[e.jsx("h2",{className:t.modalTitle,children:m}),e.jsx("p",{className:t.modalSubtitle,children:g})]}),e.jsx("button",{type:"button",className:t.modalCloseBtn,onClick:a,children:e.jsx(Be,{width:18,height:18,color:"rgba(36,36,36,0.56)"})})]}),e.jsx(j.DialogContent,{className:t.dialogContentZero,children:e.jsx("div",{className:t.modalStudentList,children:d.map(p=>e.jsxs("div",{className:t.studentRow,children:[p.studentAvatar?e.jsx(j.Avatar,{alt:p.studentName?.toUpperCase(),src:y.getFileUrl(p.studentAvatar)||Yn,className:`${t.studentAvatar} ${t.studentAvatarRed}`}):e.jsx("div",{className:`${t.studentAvatar} ${t.studentAvatarRed}`,children:Ce(p.studentName)}),e.jsx("div",{className:t.studentInfoCol,children:e.jsxs("div",{className:t.studentName,children:[p.studentName,p.gradeLevel&&e.jsxs("span",{className:t.studentGrade,children:[" · ",ge(p.gradeLevel,o==="UK")]})]})}),e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:8,marginLeft:"auto",marginRight:16},children:[p.isUnsafe&&e.jsxs("span",{className:t.unsafeBadge,children:[e.jsx(as,{width:14,height:14,color:"#C44140"}),e.jsx("span",{children:i("unsafe_badge")})]}),p.isHighStress&&e.jsxs("span",{className:t.highStressBadge,children:[e.jsx(Re,{width:14,height:14,color:"#B46A00"}),e.jsx("span",{children:i("high_stress")})]})]}),e.jsx("div",{className:t.modalActionButtons,style:{marginLeft:0},children:e.jsxs("button",{type:"button",className:t.btnViewCheckIn,onClick:()=>pe(u,p.sessionId,p.sessionResultId,p.studentId,l,void 0,l?"overview_openSafetyEs":"overview_openSafety"),children:[e.jsx(Me,{width:15,height:15}),e.jsx("span",{children:i("view_check_in")})]})})]},p.studentId||p.studentName))})})]})},zn=({wellnessData:s,schoolType:a="BOTH"})=>{const n=se.useNavigate(),o=se.useLocation(),{t:l}=y.useTranslation(),[u,i]=v.useState("MS"),[d,m]=v.useState(!1);v.useEffect(()=>{const x=new URLSearchParams(o.search),T=x.get("actionBack");if(T==="openSafety"||T==="openSafetyEs"||T==="overview_openSafety"||T==="overview_openSafetyEs"){i(T==="openSafetyEs"||T==="overview_openSafetyEs"?"ES":"MS"),m(!0),x.delete("actionBack");const N=o.pathname+(x.toString()?`?${x.toString()}`:"");n(N,{replace:!0})}},[o,n]);const g=s?.msWellness&&s.msWellness.length>0?[...s.msWellness].sort((x,T)=>{const N=(x.title||"").toLowerCase(),R=(T.title||"").toLowerCase();return N.includes("stress")?-1:R.includes("stress")?1:0}):[],p=s?.esWellness&&s.esWellness.length>0?[...s.esWellness].sort((x,T)=>{const N=(x.title||"").toLowerCase(),R=(T.title||"").toLowerCase();return N.includes("stress")?-1:R.includes("stress")?1:0}):[],h=a==="MS"?"MS":a==="ES"?"ES":g.length>0&&p.length===0?"MS":p.length>0&&g.length===0?"ES":u,c=a==="BOTH"&&g.length>0&&p.length>0,w=h==="ES"?p:g,b=h==="ES"?s?.esUnhealthyStudents||[]:s?.msUnhealthyStudents||[],I=Se(b).length>0,f=x=>{const T=(x.key||"").toLowerCase(),N=(x.title||"").toLowerCase(),R=T.includes("stress")||N.includes("stress");if(h==="ES")return R?e.jsx("img",{src:y.getStaticFileUrl("/images/home/stress.png"),alt:"",className:t.wellnessIconImg}):T.includes("home")||N.includes("home")?e.jsx("div",{className:t.wellnessIconBadge,children:e.jsx(ss,{width:18,height:18,color:"#316CD9"})}):T.includes("online")||N.includes("online")?e.jsx("div",{className:t.wellnessIconBadge,children:e.jsx(ts,{width:18,height:18,color:"#316CD9"})}):T.includes("school")||N.includes("school")?e.jsx("div",{className:t.wellnessIconBadge,children:e.jsx(ns,{width:18,height:18,color:"#316CD9"})}):e.jsx("img",{src:y.getStaticFileUrl("/images/home/safety.png"),alt:"",className:t.wellnessIconImg});const O=T.includes("safety")||N.includes("safety")||N.includes("safe")?y.getStaticFileUrl("/images/home/safety.png"):R?y.getStaticFileUrl("/images/home/stress.png"):null;return O?e.jsx("img",{src:O,alt:"",className:t.wellnessIconImg}):null};return e.jsxs("div",{className:t.wellnessCard,children:[e.jsxs("div",{className:t.wellnessHeader,children:[e.jsxs("div",{children:[e.jsx("h2",{className:t.wellnessTitle,children:l("student_wellness")}),e.jsx("p",{className:t.wellnessSubtitle,children:l("this_months_average_vs_last_month")})]}),c&&e.jsxs("div",{className:t.phaseTabContainer,children:[e.jsx("button",{type:"button",className:`${t.phaseTabBtn} ${h==="MS"?t.phaseTabBtnActive:""}`,onClick:()=>i("MS"),children:l("middle_school")}),e.jsx("button",{type:"button",className:`${t.phaseTabBtn} ${h==="ES"?t.phaseTabBtnActive:""}`,onClick:()=>i("ES"),children:l("elementary_school")})]})]}),e.jsx("div",{className:`${t.wellnessGrid} ${h==="ES"?t.wellnessGridEs:""}`,children:w.map((x,T)=>{const N=(x.key||"").toLowerCase().includes("stress")||(x.title||"").toLowerCase().includes("stress"),R=ke(x.averageScore,N);return e.jsxs("div",{className:t.wellnessRow,children:[f(x),e.jsx("span",{className:`${t.wellnessRowLabel} ${h==="ES"?t.wellnessRowLabelEs:t.wellnessRowLabelMs}`,children:l(x.title)}),h==="ES"?e.jsxs(e.Fragment,{children:[e.jsxs("span",{className:t.wellnessRowPct,children:[x.averageScore,"%"]}),Te(x.averageScore,void 0,36)]}):(()=>{const F=x.changeVsLastMonth>=0;return e.jsxs(e.Fragment,{children:[e.jsxs("span",{className:t.wellnessPill,style:{backgroundColor:R.bg,color:R.color},children:[e.jsx("span",{style:{fontWeight:500},children:l(x.ratingLabel||"")}),e.jsx("span",{className:t.wellnessPillDivider}),e.jsxs("span",{className:t.wellnessPillPct,children:[x.averageScore,"%"]})]}),e.jsx("span",{className:t.wellnessRowRight,children:e.jsx(Ve,{direction:F?"up":"down",width:20,height:20})})]})})()]},x.key||T)})}),e.jsxs("button",{type:"button",className:t.viewDashBtn,onClick:()=>{n(h==="ES"?"/admin/dashboard-wrapper?type=elementary":"/admin/dashboard")},children:[e.jsx(es,{width:17,height:17,color:"#316CD9"}),e.jsx("span",{children:l("view_data_dashboard")}),e.jsx(ue,{width:15,height:15})]}),I&&e.jsxs("button",{type:"button",className:t.seeUnhealthyBtn,onClick:()=>m(!0),children:[e.jsx(os,{width:17,height:17,color:"#C44140"}),e.jsx("span",{children:l("see_all_unsafe_and_stressed_students")}),e.jsx(ue,{width:15,height:15,color:"#C44140"})]}),d&&e.jsx(Kn,{open:d,onClose:()=>m(!1),students:b,isEs:h==="ES"})]})},Qn=({usageData:s})=>{const{t:a}=y.useTranslation(),n=s?.schoolName||"",o=s?.schoolLogo?y.getFileUrl(s.schoolLogo):null,l=s?.totalCheckIns??0,u=s?.totalStudents??0,i=(s?.totalCheckIns??0)-(s?.totalCheckInsLastMonth??0),d=s?.totalOneToOneMinutes??0,m=je(d),g=Math.round((s?.totalOneToOneMinutes??0)-(s?.totalOneToOneMinutesLastMonth??0)),p=je(Math.abs(g)),h=s?.totalOneToOneCount??0,c=s?.totalOneToOneRequired??0,w=c>0?Math.min(1,h/c):0,b=Math.round(w*100),k=s?.totalConferenceCount??0,I=(s?.totalConferenceCount??0)-(s?.totalConferenceCountLastMonth??0),f=s?.totalClassReflectionsCount??0,x=(s?.totalClassReflectionsCount??0)-(s?.totalClassReflectionsCountLastMonth??0),T=Math.min(1,Math.max(0,l/(u||1))),N=F=>{if(F===0){const E="#8E8E93";return e.jsxs("span",{style:{color:E,display:"inline-flex",alignItems:"center",gap:"4px"},children:[e.jsx(oe,{color:E,width:8,height:9}),"0 ",a("vs_last_month")]})}const O=F>0,G=O?"#0F9655":"#C44140",D=O?oe:ve;return e.jsxs("span",{className:O?t.deltaUp:t.deltaDown,style:{color:G,display:"inline-flex",alignItems:"center",gap:"4px"},children:[e.jsx(D,{color:G,width:8,height:9}),Math.abs(F)," ",a("vs_last_month")]})},R=(F,O)=>{if(F===0){const H="#8E8E93";return e.jsxs("span",{style:{color:H,display:"inline-flex",alignItems:"center",gap:"4px"},children:[e.jsx(oe,{color:H,width:8,height:9}),O," ",a("vs_last_month")]})}const G=F>0,D=G?"#0F9655":"#C44140",E=G?oe:ve;return e.jsxs("span",{className:G?t.deltaUp:t.deltaDown,style:{color:D,display:"inline-flex",alignItems:"center",gap:"4px"},children:[e.jsx(E,{color:D,width:8,height:9}),O," ",a("vs_last_month")]})};return e.jsxs("div",{className:t.usagePanel,children:[e.jsxs("div",{className:t.usageHeader,children:[e.jsx("div",{className:t.usageIconCircle,children:o?e.jsx("img",{src:o,alt:n,className:t.schoolLogoImg,onError:F=>{F.target.style.display="none"}}):e.jsx(Ye,{width:28,height:28,color:"#ffffff"})}),n&&e.jsx("span",{className:t.schoolBadgeName,children:n}),e.jsx("h2",{className:t.usageTitle,children:a("school_monthly_usage")})]}),e.jsx("div",{className:t.usageDivider}),e.jsxs("div",{className:t.usageTilesList,children:[e.jsxs("div",{className:t.usageTile,children:[e.jsxs("div",{className:t.usageTileHeader,children:[e.jsx("span",{className:t.usageTileLabel,children:a("total_check_ins")}),e.jsx(Ke,{width:18,height:18,color:"#D3D3D3"})]}),e.jsx("div",{className:t.usageProgressBarTrack,children:e.jsx("div",{className:t.usageProgressBarFill,style:{width:`${Math.round(T*100)}%`}})}),e.jsx("div",{className:t.usageTileValue,children:l}),e.jsxs("div",{className:t.usageTileSubText,children:[e.jsxs("span",{children:["/ ",u," ",a("students")," "]}),N(i)]})]}),e.jsxs("div",{className:t.usageTile,children:[e.jsxs("div",{className:t.usageTileHeader,children:[e.jsx("span",{className:t.usageTileLabel,children:a("total_conversation_time")}),e.jsx(ze,{width:18,height:18,color:"#D3D3D3"})]}),e.jsx("div",{className:t.usageTileValue,children:m}),e.jsx("div",{className:t.usageTileSubText,children:R(g,p)})]}),e.jsxs("div",{className:t.usageTile,children:[e.jsxs("div",{className:t.usageTileHeader,children:[e.jsx("span",{className:t.usageTileLabel,children:a("total_one_to_one_conversations")}),e.jsx(Qe,{width:18,height:18,color:"#D3D3D3"})]}),e.jsx("div",{className:t.usageProgressBarTrack,children:e.jsx("div",{className:t.usageProgressBarFillGreen,style:{width:`${b}%`}})}),e.jsx("div",{className:t.usageTileValue,children:h}),e.jsxs("div",{className:t.usageTileSubText,children:[e.jsxs("span",{children:["/ ",c," ",a("required")," "]}),e.jsxs("span",{className:t.deltaUp,style:{color:"#0F9655",display:"inline-flex",alignItems:"center",gap:"4px"},children:[e.jsx(oe,{color:"#0F9655",width:8,height:9})," ",b,"% ",a("completion")]})]})]}),e.jsxs("div",{className:t.usageTile,children:[e.jsxs("div",{className:t.usageTileHeader,children:[e.jsx("span",{className:t.usageTileLabel,children:a("total_conferences")}),e.jsx(Ie,{width:18,height:18,color:"#D3D3D3"})]}),e.jsx("div",{className:t.usageTileValue,children:k}),e.jsx("div",{className:t.usageTileSubText,children:N(I)})]}),e.jsxs("div",{className:t.usageTile,children:[e.jsxs("div",{className:t.usageTileHeader,children:[e.jsx("span",{className:t.usageTileLabel,children:a("total_class_reflections")}),e.jsx(Re,{width:18,height:18,color:"#D3D3D3"})]}),e.jsx("div",{className:t.usageTileValue,children:f}),e.jsx("div",{className:t.usageTileSubText,children:N(x)})]})]})]})},Zn=({gradeOverview:s,caseMode:a="without",curriculumSystem:n="US",onSetCurriculumSystem:o})=>{const{t:l}=y.useTranslation(),[u,i]=v.useState(!1),d=a==="with",m=n==="UK",g=new Map;(s??[]).forEach(c=>{const w=(c.grade||"").trim();if(!w)return;const b=ge(w,m),k=w.toLowerCase();if(!g.has(k))g.set(k,{label:b,redFlagCount:c.redFlagCount||0,yellowFlagCount:c.yellowFlagCount||0,cases:c.cases||0,totalCheckIn:c.totalCheckIn||0,totalOneToOne:c.totalOneToOne||0});else{const I=g.get(k);I.redFlagCount+=c.redFlagCount||0,I.yellowFlagCount+=c.yellowFlagCount||0,I.cases+=c.cases||0,I.totalCheckIn+=c.totalCheckIn||0,I.totalOneToOne+=c.totalOneToOne||0}});const p=Array.from(g.values()),h=p.reduce((c,w)=>({checkIns:c.checkIns+w.totalCheckIn,redFlags:c.redFlags+w.redFlagCount,yellowFlags:c.yellowFlags+w.yellowFlagCount,cases:c.cases+w.cases,oneToOneLogs:c.oneToOneLogs+w.totalOneToOne}),{checkIns:0,redFlags:0,yellowFlags:0,cases:0,oneToOneLogs:0});return e.jsxs("div",{className:t.campusCard,children:[e.jsxs("div",{className:t.campusHeader,children:[e.jsxs("div",{children:[e.jsx("h2",{className:t.campusTitle,children:l("school_overview")}),e.jsx("p",{className:t.campusSubText,children:l("flag_metrics_and_engagement_breakdown")})]}),e.jsxs("div",{className:t.sysToggleGroup,children:[e.jsxs("span",{className:t.sysToggleLabel,children:[l("curriculum_system"),":"]}),e.jsxs("div",{className:t.phaseTabs,children:[e.jsx("button",{type:"button",className:`${t.phaseTabBtn} ${n==="US"?t.phaseTabBtnActive:""}`,onClick:()=>o&&o("US"),children:"US (Grades)"}),e.jsx("button",{type:"button",className:`${t.phaseTabBtn} ${n==="UK"?t.phaseTabBtnActive:""}`,onClick:()=>o&&o("UK"),children:"UK (Years)"})]}),e.jsxs("div",{className:t.helpPopoverWrapper,children:[e.jsx("button",{type:"button",className:t.infoHelpBtn,onClick:()=>i(c=>!c),title:l("curriculum_system_reference"),children:"?"}),u&&e.jsxs(e.Fragment,{children:[e.jsx("div",{className:t.popoverBackdrop,onClick:()=>i(!1)}),e.jsxs("div",{className:t.referencePopover,children:[e.jsx("h3",{className:t.refTitle,children:l("curriculum_system_reference")}),e.jsx("p",{className:t.refSubText,children:l("how_us_grades_map_to_uk_year_groups")}),e.jsx("div",{className:t.refTableWrapper,children:e.jsxs("table",{className:t.refTable,children:[e.jsx("thead",{children:e.jsxs("tr",{children:[e.jsx("th",{children:l("us_stage")}),e.jsx("th",{children:l("us_grade")}),e.jsx("th",{children:l("uk_stage")}),e.jsx("th",{children:l("uk_year_group")}),e.jsx("th",{children:l("uk_key_stage")})]})}),e.jsx("tbody",{children:ee.map((c,w)=>e.jsxs("tr",{children:[e.jsx("td",{className:t.usStageTd,children:c.usStage}),e.jsx("td",{children:c.usGrade}),e.jsx("td",{children:c.ukStage}),e.jsx("td",{children:c.ukYearGroup}),e.jsx("td",{children:c.ukKeyStage})]},w))})]})})]})]})]})]})]}),e.jsx("div",{className:t.tableWrapper,children:e.jsxs("table",{className:t.overviewTable,children:[e.jsx("thead",{children:e.jsxs("tr",{children:[e.jsx("th",{children:l(m?"year_group_grade":"grade_year_group")}),e.jsx("th",{children:l("red_flags")}),e.jsx("th",{children:l("yellow_flags")}),d&&e.jsx("th",{children:l("cases")}),e.jsx("th",{children:l("check_ins")}),e.jsx("th",{children:l("one_to_one_logs")})]})}),e.jsxs("tbody",{children:[p.map((c,w)=>e.jsxs("tr",{children:[e.jsx("td",{children:c.label}),e.jsx("td",{children:c.redFlagCount?e.jsx("span",{className:t.redFlagText,children:c.redFlagCount}):e.jsx("span",{className:t.dashMuted,children:"—"})}),e.jsx("td",{children:c.yellowFlagCount?e.jsx("span",{className:t.yellowFlagText,children:c.yellowFlagCount}):e.jsx("span",{className:t.dashMuted,children:"—"})}),d&&e.jsx("td",{children:c.cases?c.cases:e.jsx("span",{className:t.dashMuted,children:"—"})}),e.jsx("td",{children:c.totalCheckIn}),e.jsx("td",{children:c.totalOneToOne})]},w)),e.jsxs("tr",{className:t.totalsRow,children:[e.jsx("td",{children:l("totals")}),e.jsx("td",{children:h.redFlags?e.jsx("span",{className:t.redFlagText,children:h.redFlags}):e.jsx("span",{className:t.dashMuted,children:"—"})}),e.jsx("td",{children:h.yellowFlags?e.jsx("span",{className:t.yellowFlagText,children:h.yellowFlags}):e.jsx("span",{className:t.dashMuted,children:"—"})}),d&&e.jsx("td",{children:h.cases?h.cases:e.jsx("span",{className:t.dashMuted,children:"—"})}),e.jsx("td",{children:h.checkIns.toLocaleString()}),e.jsx("td",{children:h.oneToOneLogs})]})]})]})})]})};function ye(s){return s?typeof s=="string"?s:typeof s=="object"&&s.text?s.text:String(s):""}const qn=({adminTips:s,tips:a})=>{const{t:n}=y.useTranslation(),[o,l]=v.useState(!1),u=s?.msAdminTips||[],i=s?.esAdminTips||[],d=u.length>0&&i.length>0,m=[...u,...i],g=m.length>0?m:a||[];return e.jsxs("div",{className:t.adminTipsWrapper,children:[e.jsxs("button",{type:"button",className:t.adminTipsBtn,onClick:()=>l(p=>!p),children:[e.jsx(fe,{width:17,height:17,color:"#316CD9"}),e.jsx("span",{children:n("admin_tips")})]}),o&&e.jsxs(e.Fragment,{children:[e.jsx("div",{className:t.popoverBackdrop,onClick:()=>l(!1)}),e.jsxs("div",{className:t.adminTipsPopover,children:[e.jsx("div",{className:t.popoverArrow}),e.jsxs("div",{className:t.popoverHeaderRow,children:[e.jsx("div",{className:t.popoverIconCircle,children:e.jsx(fe,{width:18,height:18,color:"#316CD9"})}),e.jsx("h3",{className:t.popoverHeaderTitle,children:n("admin_tips")})]}),d?e.jsx("div",{children:u.map((p,h)=>e.jsxs("div",{className:t.tipItem,children:[e.jsx("div",{className:t.tipNumber,children:h+1}),e.jsx("div",{className:t.tipText,dangerouslySetInnerHTML:{__html:ye(p)}})]},`ms-${h}`))}):g.map((p,h)=>e.jsxs("div",{className:t.tipItem,children:[e.jsx("div",{className:t.tipNumber,children:h+1}),e.jsx("div",{className:t.tipText,dangerouslySetInnerHTML:{__html:ye(p)}})]},h))]})]})]})},r={"hn-root":"_hn-root_18mp7_1","hn-header":"_hn-header_18mp7_13","hn-header__left":"_hn-header__left_18mp7_23","hn-header__avatar":"_hn-header__avatar_18mp7_28","hn-header__avatar--icon":"_hn-header__avatar--icon_18mp7_37","hn-header__info":"_hn-header__info_18mp7_43","hn-header__name-row":"_hn-header__name-row_18mp7_46","hn-header__student-name":"_hn-header__student-name_18mp7_51","hn-header__grade-badge":"_hn-header__grade-badge_18mp7_56","hn-header__duration-row":"_hn-header__duration-row_18mp7_65","hn-header__close-btn":"_hn-header__close-btn_18mp7_76","hn-body":"_hn-body_18mp7_88","hn-left":"_hn-left_18mp7_97","hn-left__section-header":"_hn-left__section-header_18mp7_115","hn-left__section-icon":"_hn-left__section-icon_18mp7_121","hn-left__section-title":"_hn-left__section-title_18mp7_132","hn-left__card":"_hn-left__card_18mp7_137","hn-left__card-last":"_hn-left__card-last_18mp7_145","hn-left__last-checkin-row":"_hn-left__last-checkin-row_18mp7_152","hn-left__dot-row":"_hn-left__dot-row_18mp7_155","hn-left__dot":"_hn-left__dot_18mp7_155","hn-left__checkin-value":"_hn-left__checkin-value_18mp7_172","hn-left__indicators-grid":"_hn-left__indicators-grid_18mp7_177","hn-left__indicator-item":"_hn-left__indicator-item_18mp7_182","hn-left__indicator-name":"_hn-left__indicator-name_18mp7_187","hn-left__indicator-badge":"_hn-left__indicator-badge_18mp7_193","hn-left__prev-notes-header":"_hn-left__prev-notes-header_18mp7_203","hn-left__prev-notes-block":"_hn-left__prev-notes-block_18mp7_214","hn-left__prev-date":"_hn-left__prev-date_18mp7_218","hn-left__prev-user":"_hn-left__prev-user_18mp7_224","hn-left__prev-text":"_hn-left__prev-text_18mp7_230","hn-left__prev-notes-divider":"_hn-left__prev-notes-divider_18mp7_238","hn-left__prev-strategy":"_hn-left__prev-strategy_18mp7_243","hn-left__prev-notes-extra":"_hn-left__prev-notes-extra_18mp7_252","hn-left__prev-outcome":"_hn-left__prev-outcome_18mp7_255","hn-left__prev-scaffolding-list":"_hn-left__prev-scaffolding-list_18mp7_264","hn-left__prev-scaffolding-item":"_hn-left__prev-scaffolding-item_18mp7_269","hn-middle":"_hn-middle_18mp7_276","hn-middle__focus-card":"_hn-middle__focus-card_18mp7_294","hn-middle__notes-card":"_hn-middle__notes-card_18mp7_294","hn-middle__strategy-card":"_hn-middle__strategy-card_18mp7_294","hn-middle__outcomes-card":"_hn-middle__outcomes-card_18mp7_294","hn-middle__toggle-card":"_hn-middle__toggle-card_18mp7_294","hn-middle__notes-label":"_hn-middle__notes-label_18mp7_307","hn-middle__strategy-label":"_hn-middle__strategy-label_18mp7_307","hn-middle__outcomes-label":"_hn-middle__outcomes-label_18mp7_307","hn-middle__focus-tags":"_hn-middle__focus-tags_18mp7_313","hn-middle__outcomes-tags":"_hn-middle__outcomes-tags_18mp7_313","hn-middle__focus-tag":"_hn-middle__focus-tag_18mp7_313","hn-middle__outcome-tag":"_hn-middle__outcome-tag_18mp7_319","hn-middle__focus-tag--active":"_hn-middle__focus-tag--active_18mp7_330","hn-middle__outcome-tag--active":"_hn-middle__outcome-tag--active_18mp7_330","hn-middle__strategy-chips":"_hn-middle__strategy-chips_18mp7_339","hn-middle__strategy-chip":"_hn-middle__strategy-chip_18mp7_339","hn-middle__readonly-text":"_hn-middle__readonly-text_18mp7_349","hn-middle__toggle-btn":"_hn-middle__toggle-btn_18mp7_369","hn-middle__toggle-btn--active":"_hn-middle__toggle-btn--active_18mp7_379","hn-middle__toggle-thumb":"_hn-middle__toggle-thumb_18mp7_382","hn-middle__toggle-info":"_hn-middle__toggle-info_18mp7_397","hn-middle__toggle-label":"_hn-middle__toggle-label_18mp7_401","hn-middle__toggle-sub":"_hn-middle__toggle-sub_18mp7_406","hn-right":"_hn-right_18mp7_411","hn-right__header":"_hn-right__header_18mp7_432","hn-right__header-title-row":"_hn-right__header-title-row_18mp7_437","hn-right__header-title":"_hn-right__header-title_18mp7_437","hn-right__header-sub":"_hn-right__header-sub_18mp7_448","hn-right__scroll-list":"_hn-right__scroll-list_18mp7_452","hn-right__cat-wrapper":"_hn-right__cat-wrapper_18mp7_457","hn-right__cat-btn":"_hn-right__cat-btn_18mp7_460","hn-right__cat-inner-row":"_hn-right__cat-inner-row_18mp7_472","hn-right__cat-icon-circle":"_hn-right__cat-icon-circle_18mp7_477","hn-right__cat-title-col":"_hn-right__cat-title-col_18mp7_488","hn-right__cat-label":"_hn-right__cat-label_18mp7_491","hn-right__cat-right":"_hn-right__cat-right_18mp7_496","hn-right__cat-count":"_hn-right__cat-count_18mp7_501","hn-right__questions-list":"_hn-right__questions-list_18mp7_506","hn-right__question-btn":"_hn-right__question-btn_18mp7_513","hn-right__question-btn--clicked":"_hn-right__question-btn--clicked_18mp7_526","hn-right__q-dot":"_hn-right__q-dot_18mp7_530","hn-right__question-text":"_hn-right__question-text_18mp7_544"},Jn=({size:s=20})=>e.jsx("img",{src:y.getStaticFileUrl("/teacher-student/icons/close.svg"),width:s,height:s,alt:"close"}),be=({size:s=20})=>e.jsx("img",{src:y.getStaticFileUrl("/teacher-student/icons/sparkles.svg"),width:s,height:s,alt:"sparkles"}),Xn=({size:s=20})=>e.jsx("img",{src:y.getStaticFileUrl("/teacher-student/icons/sparkles_blue.svg"),width:s,height:s,alt:"sparkles"}),ea=({size:s=16})=>e.jsx("img",{src:y.getStaticFileUrl("/teacher-student/icons/heart.svg"),width:s,height:s,alt:"heart"}),sa=({size:s=16})=>e.jsx("img",{src:y.getStaticFileUrl("/teacher-student/icons/trending-up.svg"),width:s,height:s,alt:"trending-up"}),ta=({size:s=16})=>e.jsx("img",{src:y.getStaticFileUrl("/teacher-student/icons/trophy.svg"),width:s,height:s,alt:"trophy"}),na=({size:s=16,style:a})=>e.jsx("img",{src:y.getStaticFileUrl("/teacher-student/icons/chevron-down.svg"),width:s,height:s,style:a,alt:"chevron-down"}),aa=({size:s=14})=>e.jsx("img",{src:y.getStaticFileUrl("/teacher-student/icons/eye.svg"),width:s,height:s,alt:"eye"}),oa=({size:s=14})=>e.jsx("img",{src:y.getStaticFileUrl("/teacher-student/icons/eye-off.svg"),width:s,height:s,alt:"eye-off"}),la="0001-01-01T00:00:00",ae=s=>{if(!s||s===la||s.startsWith("0001-01-01"))return!0;const a=z.utc(s);return!a.isValid()||a.year()<=1900},Ne=s=>!s||ae(s)?"":z.utc(s).local().fromNow(),ra=({isOpen:s,onClose:a,sessionSelected:n,typeHappen:o,conversationStarters:l=[],isEs:u})=>{const{t:i}=y.useTranslation(),[d,m]=v.useState(""),[g,p]=v.useState([]);v.useEffect(()=>{const _=n?.scaffoldingIds||n?.previousScaffoldingIds||n?.resultTeacher?.scaffoldingIds||n?.teacherResult?.scaffoldingIds||"";if(_){const S=String(_).split(",").map(L=>L.trim()).filter(Boolean);p(S)}else p([])},[n]);const h=_=>{p(S=>S.includes(_)?S.filter(L=>L!==_):[...S,_])},c=!!(u||n?.isEs||n?.schoolType?.toUpperCase()==="ES"||n?.schoolLevel?.toLowerCase()==="es"||n?.isKidConversation),w=o===2||n?.oneToOneType===2||n?.typeHappen===2,[b,k]=v.useState(l||[]);v.useEffect(()=>{l&&l.length>0?k(l):he(c).then(_=>{_?.data&&Array.isArray(_.data)&&_.data.length>0&&k(_e(_.data))}).catch(()=>{})},[l,c]);const I=v.useMemo(()=>{const _=n?.previousScaffoldingIds;if(!_||!b?.length)return[];const S=new Set(String(_).split(",").map(P=>P.trim()).filter(Boolean)),L=P=>{const U=[];for(const W of P)S.has(String(W.id))&&U.push(W.question||W.text||""),W.questions?.length&&U.push(...L(W.questions)),W.children?.length&&U.push(...L(W.children));return U.filter(Boolean)},$=[];for(const P of b)P.questions?.length&&$.push(...L(P.questions));return $},[b,n?.previousScaffoldingIds]),f=g.length>0,x=!w||f,T=n?.categoryOneToOne,N=n?.outcomes,R=n?.resultStudent,F=v.useMemo(()=>T?typeof T=="string"?T.split(",").map(_=>_.trim()):[]:[],[T]),O=v.useMemo(()=>N?typeof N=="string"?N.split(",").map(_=>_.trim()):[]:[],[N]),G=v.useMemo(()=>De(n),[n]),D=v.useMemo(()=>{const _=R?.questions||n?.studentResult?.questions||[],S=Pe(_,c);return c?S.filter(L=>{const $=String(L.type||"").toLowerCase(),P=L.type==="Rating"||L.type===10||L.type==="StarRating"||L.type===6||L.type==="Slider"||L.type===4||L.type==="ProgressBar"||L.type===5||$.includes("rating")||$.includes("slider")||$.includes("progressbar"),U=typeof L.score=="number"&&L.score>0;return P||U}):S},[R,n,c]);if(!n)return null;const E=n?.studentProfile?.name||n?.studentName||"Student",H=n?.studentProfile?.avatar||n?.studentProfileImage||"",C=n?.studentProfile?.gradeLevel||n?.gradeLevel||"",Y=!!n?.isPrivateOneToOne,Q=n?.oneToOneDate,ie=Q&&!ae(Q)?z.utc(Q).local().format("DD MMMM YYYY - hh:mm A"):n?.startTime&&!ae(n.startTime)?z.utc(n.startTime).local().format("DD MMMM YYYY - hh:mm A"):"N/A",Z=n?.startTime||n?.startDate||n?.studentResult?.createdAt||n?.resultStudent?.createdAt||n?.createAt||n?.createdAt,ce=Z&&!ae(Z)?z.utc(Z).local().format("DD MMMM YYYY - hh:mm A"):"N/A";return e.jsx(j.Dialog,{open:s,onClose:a,maxWidth:x?"xl":"lg",fullWidth:!0,style:{zIndex:1400},PaperProps:{style:{borderRadius:24,maxHeight:"92vh",backgroundColor:"#ffffff",boxShadow:"0 25px 50px -12px rgba(0, 0, 0, 0.25)",overflow:"hidden"}},children:e.jsxs("div",{className:r["hn-root"],children:[e.jsxs("div",{className:r["hn-header"],children:[e.jsxs("div",{className:r["hn-header__left"],children:[e.jsx(j.Avatar,{className:r["hn-header__avatar"],children:H?e.jsx("img",{className:r["hn-header__avatar--icon"],src:y.getFileUrl(H),alt:"avatar"}):E.charAt(0)}),e.jsxs("div",{className:r["hn-header__info"],children:[e.jsxs("div",{className:r["hn-header__name-row"],children:[e.jsx(j.Tooltip,{title:e.jsx("span",{style:{fontSize:"16px"},children:E}),arrow:!0,placement:"bottom",children:e.jsx(j.Typography,{variant:"h3",className:r["hn-header__student-name"],children:E})}),C&&e.jsxs("span",{className:r["hn-header__grade-badge"],children:[i("grade")," ",C]})]}),e.jsx("div",{className:r["hn-header__duration-row"],children:e.jsxs(j.Typography,{children:[i("one_to_one_conversation_log")," • ",ie,n?.timeOneToOne?` (${n.timeOneToOne} mins)`:""]})})]})]}),e.jsx(j.Button,{onClick:a,className:r["hn-header__close-btn"],children:e.jsx(Jn,{size:20})})]}),e.jsxs("div",{className:r["hn-body"],children:[e.jsxs("div",{className:r["hn-left"],children:[e.jsxs("div",{className:r["hn-left__section-header"],children:[e.jsx("div",{className:r["hn-left__section-icon"],children:e.jsx("svg",{fill:"currentColor",viewBox:"0 0 20 20",width:"16",height:"16",children:e.jsx("path",{fillRule:"evenodd",d:"M6 2a1 1 0 00-1 1v1H4a2 2 0 00-2 2v10a2 2 0 002 2h12a2 2 0 002-2V6a2 2 0 00-2-2h-1V3a1 1 0 10-2 0v1H7V3a1 1 0 00-1-1zm0 5a1 1 0 000 2h8a1 1 0 100-2H6z",clipRule:"evenodd"})})}),e.jsx(j.Typography,{className:r["hn-left__section-title"],children:i("student_context")})]}),e.jsxs("div",{className:r["hn-left__card"],children:[e.jsxs("div",{className:r["hn-left__last-checkin-row"],children:[e.jsxs("div",{className:r["hn-left__dot-row"],children:[e.jsx("div",{className:r["hn-left__dot"]}),e.jsx(j.Typography,{children:i("check_in_time")})]}),e.jsxs(j.Typography,{className:r["hn-left__checkin-value"],children:[ce," ",Ne(Z)&&`(${Ne(Z)})`]})]}),e.jsx("div",{className:r["hn-left__indicators-grid"],children:D.map((_,S)=>{const L=Te(_.score,_.val);return c?e.jsx("div",{className:r["hn-left__indicator-item"],children:e.jsxs("div",{className:r["hn-left__indicator-badge"],style:{backgroundColor:_.bg,color:_.color,display:"flex",alignItems:"center",justifyContent:"space-between",padding:"8px 12px",borderRadius:"12px",fontWeight:600,width:"100%",boxSizing:"border-box"},children:[e.jsx("span",{style:{fontSize:"13px",lineHeight:1.2},children:_.name}),L?e.jsx("span",{style:{display:"inline-flex",marginLeft:8,flexShrink:0},children:L}):e.jsx("span",{style:{marginLeft:8,fontSize:"12px",flexShrink:0},children:[_.val,_.num].filter(Boolean).join(" | ")})]})},S):e.jsxs("div",{className:r["hn-left__indicator-item"],children:[e.jsx(j.Typography,{className:r["hn-left__indicator-name"],children:_.name}),e.jsx("div",{className:r["hn-left__indicator-badge"],style:{backgroundColor:_.bg,color:_.color},children:[_.val,_.num].filter(Boolean).join(" | ")})]},S)})})]}),e.jsxs("div",{className:r["hn-left__card-last"],children:[e.jsxs("div",{className:r["hn-left__prev-notes-header"],children:[e.jsx("div",{className:r["hn-left__dot"],style:{backgroundColor:"#FFB04F"}}),e.jsx(j.Typography,{children:i("previous_notes")})]}),n?.previousOneToOneDate&&!ae(n?.previousOneToOneDate)?e.jsxs("div",{className:r["hn-left__prev-notes-block"],children:[!ae(n.previousOneToOneDate)&&e.jsx(j.Typography,{className:r["hn-left__prev-date"],children:z.utc(n.previousOneToOneDate).local().format("MMMM D, YYYY")}),(()=>{const _=n?.previousUserLog&&n.previousUserLog!=="undefined"&&n.previousUserLog!=="null"?n.previousUserLog.trim():"",S=n?.previousUserRoleLog&&n.previousUserRoleLog!=="undefined"&&n.previousUserRoleLog!=="null"?n.previousUserRoleLog.trim():"",L=[_,S?`(${S})`:""].filter(Boolean).join(" ");return L?e.jsx(j.Typography,{className:r["hn-left__prev-user"],children:L}):null})(),n?.previousOneToOneNote&&n.previousOneToOneNote!=="undefined"&&n.previousOneToOneNote!=="null"&&e.jsx(j.Typography,{className:r["hn-left__prev-text"],children:n.previousOneToOneNote}),n?.previousOneToOneStrategyName&&e.jsx("div",{className:r["hn-left__prev-notes-divider"],children:e.jsxs(j.Typography,{className:r["hn-left__prev-strategy"],children:[e.jsxs("span",{style:{textTransform:"capitalize"},children:[i("strategy"),": "]}),n.previousOneToOneStrategyName]})}),n?.previousOutcomes&&e.jsx("div",{className:r["hn-left__prev-notes-extra"],children:e.jsxs(j.Typography,{className:r["hn-left__prev-outcome"],children:[e.jsxs("span",{children:[i("session_outcome"),": "]}),n.previousOutcomes.replace(/^,\s*/,"")]})}),I?.length>0&&e.jsxs("div",{className:r["hn-left__prev-notes-extra"],children:[e.jsx(j.Typography,{className:r["hn-left__prev-outcome"],children:e.jsxs("span",{children:[i("conversation_starters"),":"]})}),e.jsx("ul",{className:r["hn-left__prev-scaffolding-list"],children:I.map((_,S)=>e.jsx("li",{className:r["hn-left__prev-scaffolding-item"],children:_},S))})]})]}):e.jsx("div",{className:r["hn-left__prev-notes-block"],children:e.jsx(j.Typography,{style:{color:"#94a3b8",fontSize:12},children:i("no_conversation_history")})})]})]}),e.jsxs("div",{className:r["hn-middle"],children:[e.jsxs("div",{className:r["hn-middle__focus-card"],children:[e.jsxs(j.Typography,{className:r["hn-middle__focus-label"],children:["🎯 ",i("what_was_the_main_focus_of_this_session")]}),e.jsx("div",{className:r["hn-middle__focus-tags"],children:["Academics","Social","Home Life","Goals","Personal","Well-being"].map(_=>{const S=F.includes(_);return e.jsx(j.Button,{disabled:!0,className:`${r["hn-middle__focus-tag"]}${S?` ${r["hn-middle__focus-tag--active"]}`:""}`,children:_},_)})}),e.jsx("div",{className:r["hn-middle__readonly-text"],children:n?.topicOneToOne||i("no_description_provided")})]}),e.jsxs("div",{className:r["hn-middle__notes-card"],children:[e.jsx(j.Typography,{className:r["hn-middle__notes-label"],children:i("other_notes_optional")}),e.jsx("div",{className:r["hn-middle__readonly-text"],children:n?.oneToOneNote||n?.OneToOneNote||i("no_notes_added")})]}),!c&&e.jsxs("div",{className:r["hn-middle__strategy-card"],children:[e.jsxs(j.Typography,{className:r["hn-middle__strategy-label"],children:["💡 ",i("agreed_learning_strategy")]}),G.length>0?e.jsx("div",{className:r["hn-middle__strategy-chips"],children:G.map((_,S)=>e.jsx(j.Chip,{label:_,className:r["hn-middle__strategy-chip"]},S))}):e.jsx("div",{className:r["hn-middle__readonly-text"],children:i("no_strategy_selected")||"No agreed strategy selected"})]}),e.jsxs("div",{className:r["hn-middle__outcomes-card"],children:[e.jsxs(j.Typography,{className:r["hn-middle__outcomes-label"],children:["✅ ",i("session_outcomes_next_steps")]}),e.jsx("div",{className:r["hn-middle__outcomes-tags"],children:["Follow-up Set","Goal Established","Refer to Counselor","Action Item Created","No Follow-up Necessary"].map(_=>{const S=O.includes(_);return e.jsx(j.Button,{disabled:!0,className:`${r["hn-middle__outcome-tag"]}${S?` ${r["hn-middle__outcome-tag--active"]}`:""}`,children:_},_)})})]}),e.jsxs("div",{className:r["hn-middle__toggle-card"],children:[e.jsx("div",{className:`${r["hn-middle__toggle-btn"]}${Y?` ${r["hn-middle__toggle-btn--active"]}`:""}`,children:e.jsx("div",{className:r["hn-middle__toggle-thumb"],style:{transform:Y?"translateX(24px)":"translateX(0)"},children:Y?e.jsx(oa,{size:14}):e.jsx(aa,{size:14})})}),e.jsxs("div",{className:r["hn-middle__toggle-info"],children:[e.jsx(j.Typography,{className:r["hn-middle__toggle-label"],children:i("hidden_from_student")}),e.jsx(j.Typography,{className:r["hn-middle__toggle-sub"],children:i(Y?"hidden_from_students_description":"shared_with_students_unless_hidden")})]})]})]}),x&&e.jsxs("div",{className:r["hn-right"],children:[e.jsxs("div",{className:r["hn-right__header"],children:[e.jsxs("div",{className:r["hn-right__header-title-row"],children:[e.jsx(Xn,{size:20}),e.jsx(j.Typography,{className:r["hn-right__header-title"],children:i("conversation_starters")})]}),e.jsx(j.Typography,{className:r["hn-right__header-sub"],children:i("tap_cards_to_guide_the_conversation")})]}),e.jsx("div",{className:r["hn-right__scroll-list"],children:b.map(_=>{const S=d===_.id,L=(_.questions||[]).reduce((A,V)=>[...A,V,...V.children||[]],[]),$=L.length,P=L.filter(A=>g.includes(String(A.id))).length,U=P===$&&$>0,W="linear-gradient(135deg, #3b82f6, #6366f1)",te=typeof _.gradient=="string"?_.gradient.trim():"",q=te.startsWith("linear-gradient")||te.startsWith("#")||te.startsWith("rgb")?te:W;return e.jsxs("div",{className:r["hn-right__cat-wrapper"],children:[e.jsxs(j.Button,{onClick:()=>m(S?"":_.id),className:`${r["hn-right__cat-btn"]}${S?` ${r["hn-right__cat-btn--expanded"]}`:""}`,children:[e.jsxs("div",{className:r["hn-right__cat-inner-row"],children:[e.jsx("div",{className:r["hn-right__cat-icon-circle"],style:{background:q,"--hn-cat-gradient":q,border:U?"2px solid #05df72":"none"},children:U?"✓":e.jsxs(e.Fragment,{children:[_.icon==="sparkles"&&e.jsx(be,{size:16}),_.icon==="heart"&&e.jsx(ea,{size:16}),_.icon==="trending-up"&&e.jsx(sa,{size:16}),_.icon==="trophy"&&e.jsx(ta,{size:16}),!["sparkles","heart","trending-up","trophy"].includes(_.icon)&&e.jsx(be,{size:16})]})}),e.jsxs("div",{className:r["hn-right__cat-title-col"],children:[e.jsx(j.Typography,{className:r["hn-right__cat-label"],children:_.label}),U&&e.jsx(j.Typography,{className:r["hn-right__cat-completed"],children:i("completed")})]})]}),e.jsxs("div",{className:r["hn-right__cat-right"],children:[e.jsxs(j.Typography,{className:`${r["hn-right__cat-count"]}${U?` ${r["hn-right__cat-count--completed"]}`:""}`,children:[P,"/",$]}),e.jsx(na,{size:16,style:{transition:"transform 0.2s",transform:S?"rotate(180deg)":"rotate(0)"}})]})]}),S&&e.jsx("div",{className:r["hn-right__questions-list"],children:(_.questions||[]).map((A,V)=>{const B=g.includes(String(A.id));return e.jsxs("div",{className:r["hn-right__question-group"],children:[e.jsxs(j.Button,{onClick:()=>h(String(A.id)),className:[r["hn-right__question-btn"],B?r["hn-right__question-btn--clicked"]:""].filter(Boolean).join(" "),children:[e.jsx("div",{className:r["hn-right__q-dot"],style:{"--hn-q-dot-bg":B?"#10B981":q},children:B?"✓":"L1"}),e.jsx(j.Typography,{className:`${r["hn-right__question-text"]}${B?` ${r["hn-right__question-text--clicked"]}`:""}`,children:A.question})]}),B&&A.children&&A.children.length>0&&e.jsx("div",{className:r["hn-right__l2-list"],style:{marginLeft:"24px",marginTop:"8px",display:"flex",flexDirection:"column",gap:"8px"},children:A.children.map((M,K)=>{const ne=g.includes(String(M.id));return e.jsxs(j.Button,{onClick:()=>h(String(M.id)),className:[r["hn-right__question-btn"],r["hn-right__question-btn--l2"],ne?r["hn-right__question-btn--clicked"]:""].filter(Boolean).join(" "),children:[e.jsx("div",{className:r["hn-right__q-dot"],style:{"--hn-q-dot-bg":ne?"#10B981":q},children:ne?"✓":"L2"}),e.jsx(j.Typography,{className:`${r["hn-right__question-text"]}${ne?` ${r["hn-right__question-text--clicked"]}`:""}`,children:M.question})]},M.id||K)})})]},A.id||V)})})]},_.id)})})]})]})]})})},ia="/images/image-default.png";function ca(s){if(!s)return"";const a=z(s);return a.isValid()?a.format("DD MMM YYYY · h:mm A"):s}const da=({kind:s,open:a,onClose:n,students:o,curriculumSystem:l="US",conversationStarters:u=[],conversationStartersEs:i=[],conversationStartersMs:d=[]})=>{const m=se.useNavigate(),{t:g}=y.useTranslation(),h=le.useSelector(C=>C.common?.user)?.hasEsSchool!==!1,[c,w]=v.useState(null),[b,k]=v.useState(!1),[I,f]=v.useState(null),x=s==="red",T=x?"#C44140":"#F5D500",N=x?t.iconBadgeRed:t.iconBadgeYellow,R=x?t.studentAvatarRed:t.studentAvatarYellow,F=o&&o.length>0?o:[],O=g(x?"red_flags_this_month":"yellow_flags_this_month"),G=`${F.length} ${g("students_flagged_review_check_in")}`,D=async(C,Y)=>{C&&(f(C),await Ue(C,Y,Q=>{w({...Q,isEs:Y}),k(!0)}),f(null))},E=h&&(c?.isEs||c?.schoolType?.toUpperCase()==="ES"||c?.schoolLevel==="es"),H=E?i.length>0?i:u:d.length>0?d:u;return e.jsxs(e.Fragment,{children:[e.jsxs(j.Dialog,{open:a,onClose:n,maxWidth:"md",fullWidth:!0,PaperProps:{style:{borderRadius:20,boxShadow:"0 20px 60px rgba(31, 63, 115, 0.3)",overflow:"hidden"}},children:[e.jsxs("div",{className:t.modalHeader,children:[e.jsx("div",{className:`${t.iconBadge} ${N}`,children:e.jsx(Le,{fill:T,width:20,height:24})}),e.jsxs("div",{children:[e.jsx("h2",{className:t.modalTitle,children:O}),e.jsx("p",{className:t.modalSubtitle,children:G})]}),e.jsx("button",{type:"button",className:t.modalCloseBtn,onClick:n,children:e.jsx(Be,{width:18,height:18,color:"rgba(36,36,36,0.56)"})})]}),e.jsx(j.DialogContent,{className:t.dialogContentZero,children:e.jsx("div",{className:t.modalStudentList,children:F.map(C=>e.jsxs("div",{className:t.studentRow,children:[C.avatar?e.jsx(j.Avatar,{alt:C.fullName?.toUpperCase(),src:y.getFileUrl(C.avatar)||ia,className:`${t.studentAvatar} ${R}`}):e.jsx("div",{className:`${t.studentAvatar} ${R}`,children:Ce(C.fullName)}),e.jsxs("div",{className:t.studentInfoCol,children:[e.jsxs("div",{className:t.studentName,children:[C.fullName," ",e.jsxs("span",{className:t.studentGrade,children:["· ",ge(C.gradeLevel,l==="UK")]})]}),e.jsxs("div",{className:t.studentMetaRow,children:[e.jsxs("span",{className:t.dateLabel,children:[e.jsx(Ze,{width:12,height:12}),ca(C.lastInteractionDate)]}),C.hasOneToOneLogged?e.jsxs("span",{className:t.loggedPill,children:[e.jsx(qe,{width:13,height:13}),g("one_to_one_logged"),C.loggedByEducatorName?` · ${C.loggedByEducatorName}`:""]}):e.jsxs("span",{className:t.notLoggedPill,children:[e.jsx(Je,{width:13,height:13}),g("no_one_to_one_yet")]})]})]}),e.jsxs("div",{className:t.modalActionButtons,children:[e.jsxs("button",{type:"button",className:t.btnViewCheckIn,onClick:()=>pe(m,C.sessionId,C.sessionResultId,C.studentId,h&&C.schoolType?.toUpperCase()==="ES"),children:[e.jsx(Me,{width:15,height:15}),e.jsx("span",{children:g("view_check_in")})]}),e.jsxs("button",{type:"button",disabled:!C.hasOneToOneLogged||I===C.sessionId,className:C.hasOneToOneLogged?t.btnViewLogActive:t.btnViewLogDisabled,onClick:()=>D(C.sessionId,h&&C.schoolType?.toUpperCase()==="ES"),children:[e.jsx(Xe,{width:15,height:15}),e.jsx("span",{children:I===C.sessionId?"...":g("view_log")})]})]})]},C.studentId||C.fullName))})})]}),b&&e.jsx(ra,{isOpen:b,onClose:()=>{k(!1),w(null)},sessionSelected:c,conversationStarters:H,isEs:E})]})},ha=({staffWellBeingData:s})=>{const{t:a}=y.useTranslation(),n=se.useNavigate(),[o,l]=v.useState(!1);return e.jsxs("div",{className:t.wellBeingCard,children:[e.jsxs("div",{className:t.wellBeingHeader,children:[e.jsxs("div",{className:"d-flex flex-items-start gap-2",children:[e.jsx("div",{className:t.iconContainer,children:e.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"21",height:"21",viewBox:"0 0 24 24",fill:"none",stroke:"#2E7D99","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",children:e.jsx("path",{d:"M19.414 14.414C21 12.828 22 11.5 22 9.5a5.5 5.5 0 0 0-9.591-3.676.6.6 0 0 1-.818.001A5.5 5.5 0 0 0 2 9.5c0 2.3 1.5 4 3 5.5l5.535 5.362a2 2 0 0 0 2.879.052 2.12 2.12 0 0 0-.004-3 2.124 2.124 0 1 0 3-3 2.124 2.124 0 0 0 3.004 0 2 2 0 0 0 0-2.828l-1.881-1.882a2.41 2.41 0 0 0-3.409 0l-1.71 1.71a2 2 0 0 1-2.828 0 2 2 0 0 1 0-2.828l2.823-2.762"})})}),e.jsx("span",{className:t.wellBeingIconLabel,children:e.jsx("h2",{className:t.wellBeingTitle,children:a("staff_well_being")})})]}),e.jsxs("div",{className:t.actionButtonsContainer,children:[!!s?.isEnabledRoutine&&e.jsxs("button",{onClick:()=>{n("/admin/well-being-dashboard")},className:t.wellBeingActionBtn,children:[e.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"15",height:"15",viewBox:"0 0 24 24",fill:"none",stroke:"#2E7D99","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",children:[e.jsx("rect",{width:"8",height:"4",x:"8",y:"2",rx:"1",ry:"1"}),e.jsx("path",{d:"M16 4h2a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V6a2 2 0 0 1 2-2h2"}),e.jsx("path",{d:"M12 11h4"}),e.jsx("path",{d:"M12 16h4"}),e.jsx("path",{d:"M8 11h.01"}),e.jsx("path",{d:"M8 16h.01"})]}),a("view_check_in_data")]}),e.jsxs("div",{className:t.staffOnlyBadge,children:[e.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"13",height:"13",viewBox:"0 0 24 24",fill:"none",stroke:"#2E7D99","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",children:[e.jsx("rect",{width:"18",height:"11",x:"3",y:"11",rx:"2",ry:"2"}),e.jsx("path",{d:"M7 11V7a5 5 0 0 1 10 0v4"})]}),a("staff_only")]})]})]}),e.jsx("p",{className:t.wellBeingDescription,children:a("staff_well_being_description")}),s?.isEnabledRoutine?e.jsxs("div",{className:t.gridContainer,children:[e.jsxs("div",{className:t.cardItem,children:[e.jsx("p",{className:t.cardTitle,children:a("total_check_ins")}),e.jsx("p",{className:t.cardValue,children:s.totalWellbeing}),e.jsx("p",{className:t.cardSubText,children:a("this_month")})]}),e.jsxs("div",{className:t.cardItem,children:[e.jsxs("div",{className:"d-flex",children:[e.jsx("p",{className:t.cardTitle,children:a("engagement")}),e.jsxs("div",{className:t.tooltipContainer,onMouseEnter:()=>l(!0),onMouseLeave:()=>l(!1),style:{position:"relative",display:"inline-flex",marginLeft:"6px",cursor:"pointer"},children:[e.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"13",height:"13",viewBox:"0 0 24 24",fill:"none",stroke:"rgba(36,36,36,0.56)",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[e.jsx("circle",{cx:"12",cy:"12",r:"10"}),e.jsx("path",{d:"M12 16v-4"}),e.jsx("path",{d:"M12 8h.01"})]}),o&&e.jsx("div",{className:t.customTooltip,children:a("engagement_tooltip_text")||"Educators who have completed at least one check-in this month."})]})]}),e.jsxs("div",{className:"d-flex",children:[e.jsx("p",{className:t.cardValue,children:s.totalEngagement!==void 0&&s.totalEngagement!==null?Number(s.totalEngagement).toLocaleString(void 0,{minimumFractionDigits:2,maximumFractionDigits:2}):0}),e.jsx("p",{className:t.subValue,children:"%"})]}),e.jsx("p",{className:t.cardSubText,children:a("this_month")})]}),e.jsxs("div",{className:t.cardItem,children:[e.jsx("p",{className:t.cardTitle,children:a("total_1_1_requested")}),e.jsx("p",{className:t.cardValue,children:s.totalConversation}),e.jsx("p",{className:t.cardSubText,children:a("this_month")})]})]}):e.jsxs("div",{className:t.emptyRoutineContainer,children:[e.jsx("div",{className:t.emptyIconWrapper,children:e.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"#2E7D99",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[e.jsx("rect",{width:"18",height:"18",x:"3",y:"4",rx:"2",ry:"2"}),e.jsx("line",{x1:"16",x2:"16",y1:"2",y2:"6"}),e.jsx("line",{x1:"8",x2:"8",y1:"2",y2:"6"}),e.jsx("line",{x1:"3",x2:"21",y1:"10",y2:"10"}),e.jsx("path",{d:"M8 14h.01"}),e.jsx("path",{d:"M12 14h.01"}),e.jsx("path",{d:"M16 14h.01"}),e.jsx("path",{d:"M8 18h.01"}),e.jsx("path",{d:"M12 18h.01"}),e.jsx("path",{d:"M16 18h.01"})]})}),e.jsx("h3",{className:t.emptyTitle,children:a("you_haven_t_set_the_staff_well_being_routine_yet")}),e.jsx("p",{className:t.emptySubText,children:a("choose_check_in_cadence_desc")}),e.jsxs("button",{type:"button",onClick:()=>{n("/admin/frequency-and-setup")},className:t.setupRoutineBtn,children:[e.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[e.jsx("path",{d:"M12.22 2h-.44a2 2 0 0 0-2 2v.18a2 2 0 0 1-1 1.73l-.43.25a2 2 0 0 1-2 0l-.15-.08a2 2 0 0 0-2.73.73l-.22.38a2 2 0 0 0 .73 2.73l.15.1a2 2 0 0 1 1 1.72v.51a2 2 0 0 1-1 1.74l-.15.09a2 2 0 0 0-.73 2.73l.22.38a2 2 0 0 0 2.73.73l.15-.08a2 2 0 0 1 2 0l.43.25a2 2 0 0 1 1 1.73V20a2 2 0 0 0 2 2h.44a2 2 0 0 0 2-2v-.18a2 2 0 0 1 1-1.73l.43-.25a2 2 0 0 1 2 0l.15.08a2 2 0 0 0 2.73-.73l.22-.39a2 2 0 0 0-.73-2.73l-.15-.08a2 2 0 0 1-1-1.74v-.5a2 2 0 0 1 1-1.74l.15-.09a2 2 0 0 0 .73-2.73l-.22-.38a2 2 0 0 0-2.73-.73l-.15.08a2 2 0 0 1-2 0l-.43-.25a2 2 0 0 1-1-1.73V4a2 2 0 0 0-2-2z"}),e.jsx("circle",{cx:"12",cy:"12",r:"3"})]}),a("set_up_the_routine")]})]})]})},_a=()=>{const{t:s}=y.useTranslation(),{loadingInit:a,loadingAnalytics:n,initData:o,analyticsData:l,caseMode:u,curriculumSystem:i,setCurriculumSystem:d,flagModal:m,setFlagModal:g,schoolType:p,esSessionIframe:h,setEsSessionIframe:c,conversationStartersEs:w,conversationStartersMs:b,staffWellBeingData:k}=He("BOTH");v.useEffect(()=>{const G=E=>{(E.data==="closeEsIframe"||E.data?.action==="backOverview"||E.data?.type==="BACK_OVERVIEW")&&c(null)},D=E=>{const H=E;H.detail&&c(H.detail)};return window.addEventListener("message",G),window.addEventListener("OPEN_ES_IFRAME",D),()=>{window.removeEventListener("message",G),window.removeEventListener("OPEN_ES_IFRAME",D)}},[c]);const f=s(u==="with"?"campus_engagement_and_guardrail_overview":"school_engagement_and_overview"),x=s("real_time_summary_of_student_wellness"),T=l?.flaggedStudents?.redFlagCount??0,N=l?.flaggedStudents?.yellowFlagCount??0,R=l?.flaggedStudents?.redFlags,F=l?.flaggedStudents?.yellowFlags,O=h?`${window.location.origin}/es/view-session/${h.sessionId}/${h.sessionResultId}?isReadOnly=true&fullsize=true`:"";return e.jsxs("div",{className:t.overviewContainer,children:[e.jsx("main",{className:t.mainContent,children:e.jsxs("div",{className:t.maxWidthWrapper,children:[e.jsxs("div",{className:t.headerRow,children:[e.jsxs("div",{children:[e.jsx("h1",{className:t.mainTitle,children:f}),e.jsx("p",{className:t.subTitle,children:x})]}),a?e.jsx("div",{style:{display:"flex",alignItems:"center",justifyContent:"center",minWidth:100,height:38},children:e.jsx(X.Loading,{size:20})}):e.jsx(qn,{adminTips:o?.adminTips})]}),e.jsxs("div",{className:t.layoutGrid,children:[e.jsxs("div",{className:t.leftColumn,children:[n?e.jsx("div",{className:t.statCardGrid,style:{display:"flex",alignItems:"center",justifyContent:"center",minHeight:140,background:"#ffffff",borderRadius:16,border:"1px solid #E2E8F0"},children:e.jsx(X.Loading,{size:28})}):e.jsxs("div",{className:t.statCardGrid,children:[e.jsx(we,{kind:"red",label:s("red_flags_this_month"),value:T,onOpen:()=>g("red")}),e.jsx(we,{kind:"yellow",label:s("yellow_flags_this_month"),value:N,onOpen:()=>g("yellow")})]}),a?e.jsx("div",{style:{display:"flex",alignItems:"center",justifyContent:"center",minHeight:140,background:"#ffffff",borderRadius:16,border:"1px solid #E2E8F0",padding:24},children:e.jsx(X.Loading,{size:28})}):e.jsx(Vn,{students:o?.students}),n?e.jsx("div",{style:{display:"flex",alignItems:"center",justifyContent:"center",minHeight:280,background:"#ffffff",borderRadius:16,border:"1px solid #E2E8F0",padding:24},children:e.jsx(X.Loading,{size:32})}):e.jsx(zn,{wellnessData:l?.studentWellness,schoolType:p}),n?e.jsx("div",{style:{display:"flex",alignItems:"center",justifyContent:"center",minHeight:280,background:"#ffffff",borderRadius:16,border:"1px solid #E2E8F0",padding:24},children:e.jsx(X.Loading,{size:32})}):e.jsx(ha,{staffWellBeingData:k})]}),e.jsx("div",{className:t.rightColumn,children:n?e.jsx("div",{style:{display:"flex",alignItems:"center",justifyContent:"center",minHeight:480,background:"#ffffff",borderRadius:16,border:"1px solid #E2E8F0",padding:24,height:"100%"},children:e.jsx(X.Loading,{size:32})}):e.jsx(Qn,{usageData:l?.schoolMonthlyUsage})})]}),n?e.jsx("div",{style:{display:"flex",alignItems:"center",justifyContent:"center",minHeight:250,background:"#ffffff",borderRadius:16,border:"1px solid #E2E8F0",padding:24,marginTop:24},children:e.jsx(X.Loading,{size:32})}):e.jsx(Zn,{gradeOverview:l?.schoolOverviewByGrade,caseMode:u,curriculumSystem:i,onSetCurriculumSystem:d})]})}),m&&e.jsx(da,{kind:m,open:!!m,onClose:()=>g(null),students:m==="red"?R:F,curriculumSystem:i,conversationStartersEs:w,conversationStartersMs:b}),h&&e.jsxs("div",{style:{position:"fixed",top:0,left:0,right:0,bottom:0,zIndex:9999,background:"#ffffff",display:"flex",flexDirection:"column"},children:[e.jsxs("div",{style:{height:48,padding:"0 20px",background:"#F8FAFC",borderBottom:"1px solid #E2E8F0",display:"flex",alignItems:"center",justifyContent:"space-between"},children:[e.jsxs("button",{type:"button",onClick:()=>c(null),style:{display:"flex",alignItems:"center",gap:8,border:"none",background:"transparent",cursor:"pointer",fontSize:14,fontWeight:600,color:"#316CD9"},children:[e.jsx(ls,{width:18,height:18,color:"#316CD9"}),e.jsx("span",{children:s("back_to_overview")})]}),e.jsx("span",{style:{fontSize:13,fontWeight:500,color:"#64748B"},children:s("elementary_session_view")})]}),e.jsx("iframe",{src:O,style:{width:"100%",flex:1,border:"none",display:"block"},title:"Elementary Session View"})]})]})};exports.default=_a;
|