openlearn-next 0.3.1 → 0.3.3
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/cli.mjs +2 -0
- package/dist/assets/{BatchPickerModal-of9a5EJz.js → BatchPickerModal-2jsnyMYM.js} +1 -1
- package/dist/assets/{ClassesView-CefnsjZ8.js → ClassesView-DUnZ5nFa.js} +1 -1
- package/dist/assets/{CloudDriveModal-DgVQLbO5.js → CloudDriveModal-DXJktxoq.js} +1 -1
- package/dist/assets/{CourseManagement-Cxhc784Q.js → CourseManagement-ChHr_wNd.js} +1 -1
- package/dist/assets/{CourseWizardModal-Da6PKhnU.js → CourseWizardModal-RAaltA_q.js} +1 -1
- package/dist/assets/{Dashboard-LWbFbup4.js → Dashboard-BMXQhpnj.js} +1 -1
- package/dist/assets/{ExportWeightModal-Cyg1zMEd.js → ExportWeightModal-BwW76Kqo.js} +1 -1
- package/dist/assets/{HelpView-CvpgBpdr.js → HelpView-BqUqq-QE.js} +1 -1
- package/dist/assets/{ImportLessonsModal-CfWIrW1K.js → ImportLessonsModal-DHLxg68P.js} +1 -1
- package/dist/assets/{InteractiveCoursewareViewer-CS5BqfJZ.js → InteractiveCoursewareViewer-C8uZcebL.js} +1 -1
- package/dist/assets/{InteractiveWhiteboard-U23CsqGo.js → InteractiveWhiteboard-C2HAx6zv.js} +1 -1
- package/dist/assets/{LazyCourseware-DXL9IxZO.js → LazyCourseware-C1bH8aKj.js} +1 -1
- package/dist/assets/{LazyWhiteboard-CtkzSFtN.js → LazyWhiteboard-DE9sMBUF.js} +1 -1
- package/dist/assets/{LessonEditorView-Bfxf4VVB.js → LessonEditorView-mIxHUfYb.js} +1 -1
- package/dist/assets/{LiveClassroomView-DHzCM4qQ.js → LiveClassroomView-DNGZaCC8.js} +1 -1
- package/dist/assets/{NotificationDetailModal-BxrpnlWV.js → NotificationDetailModal-CPrHxHcC.js} +1 -1
- package/dist/assets/{PluginView-12qYzmnq.js → PluginView-DSLBfNDj.js} +1 -1
- package/dist/assets/{QuizGeneratorModal-DfZI40Ii.js → QuizGeneratorModal-CoeGXKck.js} +1 -1
- package/dist/assets/{StudentAssignmentView-BP6zbHuM.js → StudentAssignmentView-V7Kp6TnP.js} +1 -1
- package/dist/assets/{StudentLessonView-DEpMzrH2.js → StudentLessonView-IZVXM5kz.js} +1 -1
- package/dist/assets/{StudentPreviewModal-DCmai53s.js → StudentPreviewModal-DwumAjWX.js} +1 -1
- package/dist/assets/{StudentView-CcGlfW25.js → StudentView-3mCaDwFB.js} +1 -1
- package/dist/assets/{SystemResourceLibraryModal-BzHw1edT.js → SystemResourceLibraryModal-B6ms798K.js} +1 -1
- package/dist/assets/{TeacherView-Dw6mKwcv.js → TeacherView-BVd_ZMFH.js} +1 -1
- package/dist/assets/{index-CYzNsYZB.js → index-Cwf8LQbY.js} +3 -3
- package/dist/assets/{index-C8sCKzmN.js → index-Vr-_Vpp3.js} +1 -1
- package/dist/index.html +1 -1
- package/dist/server.cjs +50 -19
- package/package.json +2 -2
package/cli.mjs
CHANGED
|
@@ -37,6 +37,8 @@ if (!process.env.OPENLEARN_DB_PATH) {
|
|
|
37
37
|
process.env.OPENLEARN_DB_PATH = join(dataDir, 'data.db');
|
|
38
38
|
}
|
|
39
39
|
|
|
40
|
+
process.env.NODE_ENV = process.env.NODE_ENV || 'production';
|
|
41
|
+
|
|
40
42
|
console.log(`[openlearn-next] PORT=${process.env.PORT || '9000'}`);
|
|
41
43
|
console.log(`[openlearn-next] DB=${process.env.OPENLEARN_DB_PATH}`);
|
|
42
44
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{j as e}from"./vendor-react-0Lg0vA-4.js";import{m as p}from"./index-
|
|
1
|
+
import{j as e}from"./vendor-react-0Lg0vA-4.js";import{m as p}from"./index-Cwf8LQbY.js";import"./vendor-icons-Dq6MhgH9.js";import"./vendor-pdf-Cp-cYteE.js";import"./vendor-utils-BEhuP0Zq.js";import"./vendor-motion-DjY2czvL.js";import"./vendor-pptx-B_NheIKl.js";import"./vendor-charts-CRXa4AlU.js";function w({batchPicker:o,setBatchPicker:t,batchPickerLesson:l,setBatchPickerLesson:a,batchPickerDate:i,setBatchPickerDate:n,batchPickerTargetClass:d,setBatchPickerTargetClass:c,lessons:x,classes:u,expandedClassId:m,confirmBatchPicker:h,lang:r}){return o?e.jsx("div",{className:"fixed inset-0 bg-gray-900/40 backdrop-blur-sm flex items-center justify-center p-6 z-50",children:e.jsxs(p.div,{initial:{opacity:0,scale:.95},animate:{opacity:1,scale:1},className:"bg-white border text-gray-900 border-gray-200 rounded-2xl shadow-2xl w-full max-w-md flex flex-col overflow-hidden",children:[e.jsxs("div",{className:"p-4 border-b border-gray-100 flex items-center justify-between bg-gray-50/80",children:[e.jsx("h2",{className:"font-bold text-gray-800 text-base",children:o==="schedule"?r==="zh"?"批量排课":"Batch Schedule":o==="lockedLesson"?r==="zh"?"批量设置锁定课程":"Batch Lock Lesson":r==="zh"?"批量转班":"Batch Transfer"}),e.jsx("button",{onClick:()=>t(null),className:"text-gray-400 hover:text-gray-600 text-lg font-bold p-1 hover:bg-gray-200 rounded",children:"×"})]}),e.jsxs("div",{className:"p-5 space-y-4",children:[(o==="schedule"||o==="lockedLesson")&&e.jsxs("div",{className:"space-y-1.5",children:[e.jsx("label",{className:"text-xs font-semibold text-gray-600",children:r==="zh"?"选择课程":"Select Lesson"}),e.jsxs("select",{value:l,onChange:s=>a(s.target.value),className:"w-full border border-gray-200 rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-indigo-500",children:[e.jsx("option",{value:"",children:r==="zh"?"— 请选择 —":"— Select —"}),x.map(s=>e.jsx("option",{value:s.id,children:s.title},s.id))]})]}),o==="schedule"&&e.jsxs("div",{className:"space-y-1.5",children:[e.jsx("label",{className:"text-xs font-semibold text-gray-600",children:r==="zh"?"上课日期":"Schedule Date"}),e.jsx("input",{type:"date",value:i,onChange:s=>n(s.target.value),className:"w-full border border-gray-200 rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-indigo-500"})]}),o==="transfer"&&e.jsxs("div",{className:"space-y-1.5",children:[e.jsx("label",{className:"text-xs font-semibold text-gray-600",children:r==="zh"?"选择目标班级":"Select Target Class"}),e.jsxs("select",{value:d,onChange:s=>c(s.target.value),className:"w-full border border-gray-200 rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-indigo-500",children:[e.jsx("option",{value:"",children:r==="zh"?"— 请选择 —":"— Select —"}),u.filter(s=>s.id!==m).map(s=>e.jsx("option",{value:s.id,children:s.name},s.id))]})]})]}),e.jsxs("div",{className:"p-4 border-t border-gray-100 flex justify-end gap-2",children:[e.jsx("button",{onClick:()=>t(null),className:"px-4 py-2 text-sm rounded-lg border border-gray-200 text-gray-600 hover:bg-gray-100 cursor-pointer",children:r==="zh"?"取消":"Cancel"}),e.jsx("button",{onClick:h,className:"px-4 py-2 text-sm rounded-lg bg-indigo-600 text-white hover:bg-indigo-700 cursor-pointer",children:r==="zh"?"确认":"Confirm"})]})]})}):null}export{w as BatchPickerModal};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{j as e,r as A}from"./vendor-react-0Lg0vA-4.js";import{b as ce,a9 as xe,U as ee,B as te,n as we,t as ae,a5 as Y,a2 as ie,o as ze,x as le,aK as Ie,f as re,aa as Oe,e as he,a4 as fe,a8 as Re,w as Z,C as se,ab as We,I as oe,D as ne,W as Ae,aw as Be,ac as Fe,ao as ke,aL as He,L as Qe,aM as Ue,aN as Je,aO as Ve,aP as Ke,aQ as qe,aR as Xe,aS as De,aT as Ye,aU as Ze,aV as et,T as de,aW as tt,i as je,aX as st,aY as at,G as rt,aZ as nt,d as Pe,al as it,X as ve,S as Le,v as lt,aj as ye,ag as Ne}from"./vendor-icons-Dq6MhgH9.js";import{a as me,A as ot,C as Se,X as ge,Y as ue,T as be,b as $e,d as dt,L as ct,c as xt,B as Ee,e as Me}from"./vendor-charts-CRXa4AlU.js";import{A as ht,m as pe}from"./index-CYzNsYZB.js";import"./vendor-utils-BEhuP0Zq.js";import"./vendor-pdf-Cp-cYteE.js";import"./vendor-motion-DjY2czvL.js";import"./vendor-pptx-B_NheIKl.js";function mt({cls:t,lang:a,isExpanded:i,batchMode:s,selectedClassIds:l,setExpandedClassId:c,setSelectedStudentIds:p,toggleClassSelection:w,fetchClassStudents:$,fetchClassProgress:S,fetchClassDashboard:j,fetchClassSchedules:g}){const _=()=>{c(t.id),p(new Set),$(t.id),S(t.id),j(t.id),g(t.id)};return e.jsxs("div",{className:`p-2 flex items-center justify-between ${s?"cursor-pointer hover:bg-amber-50/60":"cursor-pointer hover:bg-gray-50"}`,onClick:()=>{if(s){w(t.id);return}i?c(null):_()},children:[e.jsxs("div",{className:"flex items-center gap-2",children:[s&&e.jsx("input",{type:"checkbox",className:"shrink-0 accent-amber-500",checked:l.has(t.id),onChange:()=>w(t.id),onClick:L=>L.stopPropagation()}),e.jsx("button",{type:"button",onClick:L=>{L.stopPropagation(),i?c(null):_()},className:"text-gray-400 hover:text-gray-600 shrink-0",children:i?e.jsx(ce,{size:14}):e.jsx(xe,{size:14})}),e.jsx("div",{className:`text-sm font-medium ${s&&l.has(t.id)?"text-amber-700":"text-gray-800"}`,children:t.name})]}),e.jsxs("div",{className:"flex items-center gap-3 text-[11px] text-gray-500 shrink-0",children:[e.jsxs("span",{className:"flex items-center gap-1",title:a==="zh"?"学生人数":"Students",children:[e.jsx(ee,{size:13,className:"text-gray-400"}),t.student_count??0]}),e.jsxs("span",{className:"flex items-center gap-1",title:a==="zh"?"课程数量":"Courses",children:[e.jsx(te,{size:13,className:"text-gray-400"}),t.course_count??0]}),e.jsxs("span",{className:"flex items-center gap-1",title:a==="zh"?"作业数量":"Assignments",children:[e.jsx(we,{size:13,className:"text-gray-400"}),t.assignment_count??0]})]})]})}function gt({cls:t,lang:a,fetchClasses:i}){return e.jsxs("div",{className:"mb-4 bg-gradient-to-r from-indigo-50/70 to-violet-50/70 p-3.5 rounded-2xl border border-indigo-150/40 shadow-xs flex flex-col sm:flex-row sm:items-center justify-between gap-3 font-sans text-left",onClick:s=>s.stopPropagation(),children:[e.jsxs("div",{className:"space-y-1 text-left",children:[e.jsxs("div",{className:"flex items-center gap-1.5 justify-start",children:[e.jsx("span",{className:"inline-block w-2 h-2 rounded-full bg-indigo-500 animate-pulse shrink-0"}),e.jsx("span",{className:"text-xs font-black text-indigo-950 uppercase tracking-wider",children:a==="zh"?"临时班级密码 (支持学生快速一键密码登录)":"Temporary Class Passcode"})]}),e.jsx("p",{className:"text-[10px] text-indigo-600/80 font-semibold leading-relaxed text-left block",children:a==="zh"?"开始课堂后,全班学生均可使用此特定临时密码统一安全登录,无需强制输入个人自设密码。":"Once set, any pupil in this class can use this temporary passcode to log in directly."})]}),e.jsxs("div",{className:"flex items-center gap-1.5 shrink-0 justify-end",children:[e.jsx("input",{id:`class-passcode-${t.id}`,type:"text",value:t.class_passcode||"",onChange:async s=>{const l=s.target.value;await fetch(`/api/classes/${t.id}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({class_passcode:l})}),await i()},placeholder:a==="zh"?"暂未设定 / 留空禁用":"Disabled / Enter code",className:"border border-indigo-200/80 rounded-xl text-xs px-2.5 py-1.5 w-36 text-center bg-white focus:outline-none focus:ring-2 focus:ring-indigo-500 font-mono font-bold text-gray-800 focus:border-transparent transition-all",onClick:s=>s.stopPropagation()}),e.jsx("button",{onClick:async s=>{s.stopPropagation();const l=Math.floor(1e3+Math.random()*9e3).toString();await fetch(`/api/classes/${t.id}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({class_passcode:l})}),await i()},className:"bg-indigo-600 hover:bg-indigo-700 text-white rounded-xl text-[10px] p-2 py-1.5 font-black shadow-xs transition-all hover:shadow-sm cursor-pointer shrink-0",title:a==="zh"?"随机生成班级密码":"Generate random passcode",children:a==="zh"?"随机生成":"Random Gen"}),t.class_passcode&&e.jsx("button",{onClick:async s=>{s.stopPropagation(),await fetch(`/api/classes/${t.id}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({class_passcode:null})}),await i()},className:"bg-slate-200 hover:bg-slate-300 text-slate-700 rounded-xl text-[10px] p-2 py-1.5 font-bold shadow-xs transition-colors cursor-pointer shrink-0",title:a==="zh"?"清除临时密码":"Clear temporary passcode",children:a==="zh"?"清除":"Clear"})]})]})}function ut({cls:t,lang:a,classActiveTabs:i,setClassActiveTabs:s}){return e.jsxs("div",{className:"flex items-center gap-1 bg-slate-100 p-1 rounded-xl mb-4 max-w-md border border-slate-200/40",onClick:l=>l.stopPropagation(),children:[e.jsxs("button",{onClick:l=>{l.stopPropagation(),s(c=>({...c,[t.id]:"students"}))},className:`flex-1 py-1.5 px-3 rounded-lg text-xs font-semibold flex items-center justify-center gap-1.5 transition-all duration-200 cursor-pointer ${(i[t.id]||"students")==="students"?"bg-white text-indigo-600 shadow-xs font-bold border border-slate-200/50":"text-slate-500 hover:text-slate-800 hover:bg-white/40"}`,children:[e.jsx(ee,{size:12}),e.jsx("span",{children:a==="zh"?"学生名单":"Students"})]}),e.jsxs("button",{onClick:l=>{l.stopPropagation(),s(c=>({...c,[t.id]:"assignments"}))},className:`flex-1 py-1.5 px-3 rounded-lg text-xs font-semibold flex items-center justify-center gap-1.5 transition-all duration-200 cursor-pointer ${(i[t.id]||"students")==="assignments"?"bg-white text-indigo-600 shadow-xs font-bold border border-slate-200/50":"text-slate-500 hover:text-slate-800 hover:bg-white/40"}`,children:[e.jsx(ae,{size:12}),e.jsx("span",{children:a==="zh"?"作业成绩":"Assignments"})]}),e.jsxs("button",{onClick:l=>{l.stopPropagation(),s(c=>({...c,[t.id]:"schedules"}))},className:`flex-1 py-1.5 px-3 rounded-lg text-xs font-semibold flex items-center justify-center gap-1.5 transition-all duration-200 cursor-pointer ${(i[t.id]||"students")==="schedules"?"bg-white text-indigo-600 shadow-xs font-bold border border-slate-200/50":"text-slate-500 hover:text-slate-800 hover:bg-white/40"}`,children:[e.jsx(Y,{size:12}),e.jsx("span",{children:a==="zh"?"课表考勤":"Attendance"})]}),e.jsxs("button",{onClick:l=>{l.stopPropagation(),s(c=>({...c,[t.id]:"grades"}))},className:`flex-1 py-1.5 px-3 rounded-lg text-xs font-semibold flex items-center justify-center gap-1.5 transition-all duration-200 cursor-pointer ${(i[t.id]||"students")==="grades"?"bg-white text-indigo-600 shadow-xs font-bold border border-slate-200/50":"text-slate-500 hover:text-slate-800 hover:bg-white/40"}`,children:[e.jsx(we,{size:12}),e.jsx("span",{children:a==="zh"?"学期总评":"Grades"})]})]})}function bt({schedules:t=[],progress:a=[],lang:i="en"}){const s=A.useMemo(()=>!t||t.length===0?[]:[...t].sort((p,w)=>new Date(p.scheduled_date).getTime()-new Date(w.scheduled_date).getTime()).map((p,w)=>{const $=a.find(_=>_.lesson_id===p.lesson_id),S=$?Math.round($.average_progress):0,j=new Date(p.scheduled_date),g=isNaN(j.getTime())?p.scheduled_date:j.toLocaleDateString(i==="zh"?"zh-CN":"en-US",{month:"short",day:"numeric"});return{id:p.id,index:w+1,lessonId:p.lesson_id,lessonTitle:p.lesson_title||p.title||`Lesson ${w+1}`,scheduledDate:p.scheduled_date,dateLabel:g,progress:S}}),[t,a,i]),l=A.useMemo(()=>{if(s.length===0)return{avgProg:0,completedCount:0,pendingCount:0,activeCount:0};const p=s.reduce((g,_)=>g+_.progress,0),w=Math.round(p/s.length),$=s.filter(g=>g.progress>=90).length,S=s.filter(g=>g.progress>0&&g.progress<90).length,j=s.filter(g=>g.progress===0).length;return{avgProg:w,completedCount:$,pendingCount:j,activeCount:S}},[s]),c={title:i==="zh"?"学期排课进度看板":"Scheduled Lessons Progress",subtitle:i==="zh"?"班级在全学期已规划课程中的平均学习进度曲线":"Class average completion progress across the semester's scheduled lessons",averageProgress:i==="zh"?"平均课程总进度":"Average Class Progress",completedLessons:i==="zh"?"已通关课程":"Completed Lessons",activeLessons:i==="zh"?"进行中课程":"Lessons In-Progress",pendingLessons:i==="zh"?"未开始课程":"Not Started",timeline:i==="zh"?"排课进度时间轴":"Lesson Progress Timeline",over90:i==="zh"?"通关基准线 (90%)":"Completion Benchmark (90%)",averageLine:i==="zh"?"平均进度线":"Class Average Line",emptyTitle:i==="zh"?"暂无排课进度":"No Scheduled Progress Data",emptyDesc:i==="zh"?"该班级尚未规划任何课程。请在下方【日程安排与考勤】中指派具体的微课及日期,随后此处的实时进度图表便会随学生学习进程同步渲染。":'No schedules have been defined for this class yet. Assign lessons under the "Schedule & Attendance" panel below to begin visualizing your student group progress trajectory.',detailsLabel:i==="zh"?"第 {idx} 节课: {title}":"Session #{idx}: {title}"};return t.length===0?e.jsx("div",{className:"bg-white border border-gray-150 rounded-xl p-6 shadow-sm font-sans",children:e.jsxs("div",{className:"max-w-md mx-auto text-center py-6",children:[e.jsx("div",{className:"inline-flex p-3 bg-pink-50 text-pink-600 rounded-full mb-3",children:e.jsx(ae,{className:"w-6 h-6 animate-pulse"})}),e.jsx("h4",{className:"font-bold text-gray-800 text-sm",children:c.emptyTitle}),e.jsx("p",{className:"text-gray-500 text-[11px] mt-2 leading-relaxed",children:c.emptyDesc})]})}):e.jsxs("div",{className:"bg-white border border-gray-150 rounded-xl shadow-xs overflow-hidden flex flex-col font-sans",id:"scheduled-lessons-progress-container",children:[e.jsx("div",{className:"p-4 border-b border-gray-100 bg-gray-50/50 flex flex-col sm:flex-row sm:items-center justify-between gap-3",children:e.jsxs("div",{className:"flex items-start gap-2.5",children:[e.jsx("div",{className:"p-2 bg-pink-50 text-pink-600 rounded-lg shrink-0",children:e.jsx(ie,{size:16})}),e.jsxs("div",{children:[e.jsxs("h4",{className:"font-bold text-gray-800 text-sm flex items-center gap-1.5 flex-wrap",children:[e.jsx("span",{children:c.title}),e.jsxs("span",{className:"inline-flex items-center gap-1 bg-pink-50 text-pink-700 border border-pink-100 rounded-full px-2 py-0.5 text-[9px] font-bold",children:[e.jsx("span",{className:"w-1 h-1 rounded-full bg-pink-500 animate-ping"}),i==="zh"?"实时同步":"Live Sync"]})]}),e.jsx("p",{className:"text-gray-400 text-[10px] mt-0.5 leading-relaxed",children:c.subtitle})]})]})}),e.jsxs("div",{className:"px-4 py-3 border-b border-gray-100 bg-white grid grid-cols-2 sm:grid-cols-4 gap-2.5",children:[e.jsxs("div",{className:"bg-pink-50/20 border border-pink-100/40 p-2.5 rounded-lg flex items-center gap-2",children:[e.jsx("div",{className:"p-2 bg-pink-50 text-pink-600 rounded-md shrink-0",children:e.jsx(ae,{size:14})}),e.jsxs("div",{className:"min-w-0",children:[e.jsx("div",{className:"text-[9px] font-bold text-gray-400 uppercase tracking-wider truncate",children:c.averageProgress}),e.jsxs("div",{className:"text-xs font-bold text-gray-800 font-mono mt-0.5",children:[l.avgProg,"%"]})]})]}),e.jsxs("div",{className:"bg-emerald-50/20 border border-emerald-100/40 p-2.5 rounded-lg flex items-center gap-2",children:[e.jsx("div",{className:"p-2 bg-emerald-50 text-emerald-600 rounded-md shrink-0",children:e.jsx(ze,{size:14})}),e.jsxs("div",{className:"min-w-0",children:[e.jsx("div",{className:"text-[9px] font-bold text-gray-400 uppercase tracking-wider truncate",children:c.completedLessons}),e.jsxs("div",{className:"text-xs font-bold text-gray-800 font-mono mt-0.5",children:[l.completedCount," / ",s.length]})]})]}),e.jsxs("div",{className:"bg-yellow-50/20 border border-yellow-100/30 p-2.5 rounded-lg flex items-center gap-2",children:[e.jsx("div",{className:"p-2 bg-yellow-50 text-yellow-600 rounded-md shrink-0",children:e.jsx(le,{size:14})}),e.jsxs("div",{className:"min-w-0",children:[e.jsx("div",{className:"text-[9px] font-bold text-gray-400 uppercase tracking-wider truncate",children:c.activeLessons}),e.jsx("div",{className:"text-xs font-bold text-gray-800 font-mono mt-0.5",children:l.activeCount})]})]}),e.jsxs("div",{className:"bg-slate-50/30 border border-slate-100/60 p-2.5 rounded-lg flex items-center gap-2",children:[e.jsx("div",{className:"p-2 bg-slate-50 text-slate-500 rounded-md shrink-0",children:e.jsx(te,{size:14})}),e.jsxs("div",{className:"min-w-0",children:[e.jsx("div",{className:"text-[9px] font-bold text-gray-400 uppercase tracking-wider truncate",children:c.pendingLessons}),e.jsx("div",{className:"text-xs font-bold text-gray-800 font-mono mt-0.5",children:l.pendingCount})]})]})]}),e.jsxs("div",{className:"p-4 space-y-4",children:[e.jsxs("div",{className:"text-[10px] font-bold text-pink-900 flex items-center gap-1",children:[e.jsx(Y,{size:11,className:"text-pink-500"}),e.jsx("span",{children:c.timeline})]}),e.jsx("div",{className:"h-44 w-full bg-slate-50/30 border border-slate-100 p-2 rounded-lg relative",children:e.jsx(me,{width:"100%",height:"100%",children:e.jsxs(ot,{data:s,margin:{top:10,right:10,left:-24,bottom:0},children:[e.jsx("defs",{children:e.jsxs("linearGradient",{id:"progressGrad",x1:"0",y1:"0",x2:"0",y2:"1",children:[e.jsx("stop",{offset:"5%",stopColor:"#ec4899",stopOpacity:.25}),e.jsx("stop",{offset:"95%",stopColor:"#ec4899",stopOpacity:0})]})}),e.jsx(Se,{strokeDasharray:"3 3",vertical:!1,stroke:"#f1f5f9"}),e.jsx(ge,{dataKey:"dateLabel",tick:{fontSize:8,fill:"#64748b",fontWeight:"bold"},axisLine:{stroke:"#e2e8f0"},tickLine:!1}),e.jsx(ue,{domain:[0,100],tick:{fontSize:8,fill:"#64748b",fontWeight:"bold"},axisLine:{stroke:"#e2e8f0"},tickLine:!1}),e.jsx(be,{content:({active:p,payload:w})=>{if(p&&w&&w.length){const $=w[0].payload;return e.jsxs("div",{className:"p-2.5 bg-white border border-pink-100 rounded-lg shadow-md max-w-[220px]",children:[e.jsxs("div",{className:"flex items-center justify-between gap-2 border-b border-gray-100 pb-1.5 mb-1.5",children:[e.jsx("span",{className:"text-[8px] text-gray-400 font-bold font-mono",children:$.scheduledDate}),e.jsxs("span",{className:"inline-flex items-center bg-pink-50 text-pink-700 px-1.5 py-0.5 rounded-full text-[9px] font-extrabold font-mono border border-pink-100",children:[$.progress,"%"]})]}),e.jsx("p",{className:"text-[10px] font-bold text-gray-800 leading-tight",children:c.detailsLabel.replace("{idx}",$.index).replace("{title}",$.lessonTitle)})]})}return null}}),e.jsx($e,{y:90,stroke:"#10b981",strokeWidth:1,strokeDasharray:"3 3",label:{value:c.over90,fill:"#10b981",fontSize:7,fontWeight:"bold",position:"top",offset:2}}),e.jsx($e,{y:l.avgProg,stroke:"#ec4899",strokeWidth:1,strokeDasharray:"2 2",label:{value:`${c.averageLine} (${l.avgProg}%)`,fill:"#ec4899",fontSize:7,fontWeight:"semibold",position:"bottom",offset:2}}),e.jsx(dt,{type:"monotone",dataKey:"progress",stroke:"#ec4899",strokeWidth:2,fillOpacity:1,fill:"url(#progressGrad)",dot:{r:3,stroke:"#ffffff",strokeWidth:1.5,fill:"#ec4899"},activeDot:{r:5,stroke:"#ffffff",strokeWidth:1.5,fill:"#f43f5e"}})]})})})]})]})}function pt({students:t=[],assignments:a=[],performance:i=[],lang:s="en"}){const[l,c]=A.useState(()=>t.length>=2?[t[0].id,t[1].id]:t.map(x=>x.id)),[p,w]=A.useState("running_average"),$=["#6366f1","#f43f5e","#10b981","#0ea5e9","#f59e0b","#8b5cf6","#ec4899","#14b8a6"],{chartData:S,comparedStudentSummary:j,chronologicalAssignments:g}=A.useMemo(()=>{const x=[...a].sort((N,k)=>(N.created_at||0)-(k.created_at||0)),T=t.filter(N=>l.includes(N.id)),n={},h={};T.forEach(N=>{n[N.id]=0,h[N.id]=0});const f=x.map((N,k)=>{const M={name:N.title.replace("MCQ Evaluation: ","").replace("评估: ",""),fullName:N.title,index:k+1};return T.forEach(D=>{const J=i.find(u=>u.student_id===D.id&&u.assignment_id===N.id&&u.submission_status==="graded"&&typeof u.score=="number"&&u.score!==null);if(J&&J.score!==null){const u=Number(J.score);n[D.id]+=u,h[D.id]+=1;const C=Math.round(n[D.id]/h[D.id]*10)/10;M[`raw_${D.id}`]=u,M[`avg_${D.id}`]=C}else M[`raw_${D.id}`]=null,M[`avg_${D.id}`]=h[D.id]>0?Math.round(n[D.id]/h[D.id]*10)/10:null}),M}),z=T.map((N,k)=>{const M=x.map(I=>i.find(P=>P.student_id===N.id&&P.assignment_id===I.id&&P.submission_status==="graded"&&typeof P.score=="number"&&P.score!==null)).filter(I=>I&&I.score!==null).map(I=>Number(I.score)),D=M.length,J=D>0?M[0]:0,u=D>0?M[D-1]:0,C=f.map(I=>I[`avg_${N.id}`]).filter(I=>typeof I=="number"&&I!==null),R=C.length>0?C[0]:0,E=C.length>0?C[C.length-1]:0,U=Math.round((E-R)*10)/10,q=D>0?Math.max(...M):0;return{id:N.id,name:N.name,color:$[k%$.length],totalItems:D,startingScore:J,currentScore:u,startingAvg:R,finalAvg:E,netGrowth:U,peak:q}});return{chartData:f.filter(N=>T.some(k=>N[`avg_${k.id}`]!==null||N[`raw_${k.id}`]!==null)),comparedStudentSummary:z,chronologicalAssignments:x}},[t,a,i,l]),_=x=>{c(T=>T.includes(x)?T.filter(n=>n!==x):[...T,x])},L={panelTitle:s==="zh"?"多生学力成长对比透视":"Student Performance & Growth Comparison",panelSub:s==="zh"?"选择多位学生,跨作业维度水平比对单次得分或累积移动平均线,分析班级成长差值":"Select two or more pupils to synthesize comparative academic curves over coursework timelines",metricSelect:s==="zh"?"对比数据:":"Metric:",noStudentsMsg:s==="zh"?"请选择至少两位学生以生成比对坐标系":"Please select at least two students to visualize academic trends",metricsTableTitle:s==="zh"?"学术轨迹成长对比数据":"Trajectory Growth Metrics Summary",tableNet:s==="zh"?"成长趋势净值":"Net Growth Trend",insufficientData:s==="zh"?"当前班级数据不满足比对条件。请录入多名学生及作业评分后再作比对。":"Insufficient dataset. Please enroll multiple student evaluations to configure comparing nodes."};return t.length===0||a.length===0?e.jsxs("div",{className:"bg-white border border-gray-200 rounded-xl p-6 text-center shadow-xs font-sans",children:[e.jsx(Ie,{className:"w-8 h-8 text-indigo-500 mx-auto mb-2 animate-bounce"}),e.jsx("p",{className:"text-gray-550 text-xs font-medium leading-relaxed",children:L.insufficientData})]}):e.jsxs("div",{className:"bg-white border border-gray-200 rounded-2xl shadow-xs overflow-hidden flex flex-col font-sans mt-2 mb-6",id:"student-growth-compare-card",children:[e.jsxs("div",{className:"p-4 border-b border-gray-100 bg-linear-to-r from-indigo-50/10 via-white to-sky-50/10 flex flex-col gap-2",children:[e.jsxs("div",{className:"flex items-start gap-2.5",children:[e.jsx("div",{className:"p-2 bg-indigo-50 text-indigo-600 rounded-xl mt-0.5",children:e.jsx(ee,{size:18,className:"stroke-[2.5]"})}),e.jsxs("div",{children:[e.jsxs("h4",{className:"font-extrabold text-gray-900 text-sm flex items-center gap-1.5 flex-wrap",children:[e.jsx("span",{children:L.panelTitle}),e.jsxs("span",{className:"inline-flex items-center gap-0.5 bg-indigo-100 text-indigo-800 border border-indigo-200/50 rounded-full px-2 py-0.5 text-[9px] font-black uppercase",children:[e.jsx(re,{size:8,className:"animate-spin text-indigo-600"}),s==="zh"?"多维透视":"Cohort Analytics"]})]}),e.jsx("p",{className:"text-gray-500 text-[11px] mt-0.5 leading-relaxed",children:L.panelSub})]})]}),e.jsxs("div",{className:"flex flex-col sm:flex-row sm:items-center justify-between gap-3 mt-2 border-t border-gray-100/60 pt-3",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("span",{className:"text-[10px] font-extrabold text-gray-400 uppercase tracking-wider",children:L.metricSelect}),e.jsxs("div",{className:"inline-flex bg-gray-100 p-0.5 rounded-lg border border-gray-200/55 shadow-3xs select-none",children:[e.jsxs("button",{type:"button",onClick:()=>w("running_average"),className:`px-3 py-1 text-[10px] font-bold rounded-md transition-all cursor-pointer flex items-center gap-1 ${p==="running_average"?"bg-white text-indigo-700 shadow-xs border-indigo-50 font-extrabold":"text-gray-500 hover:text-gray-800"}`,children:[e.jsx(ie,{size:11}),e.jsx("span",{children:s==="zh"?"累积成长轨迹":"Running Trajectory"})]}),e.jsxs("button",{type:"button",onClick:()=>w("raw_score"),className:`px-3 py-1 text-[10px] font-bold rounded-md transition-all cursor-pointer flex items-center gap-1 ${p==="raw_score"?"bg-white text-indigo-700 shadow-xs border-indigo-50 font-extrabold":"text-gray-500 hover:text-gray-800"}`,children:[e.jsx(Oe,{size:11}),e.jsx("span",{children:s==="zh"?"单次作业得分":"Syllabus Scores"})]})]})]}),e.jsx("div",{className:"text-[10px] text-indigo-600/75 italic bg-indigo-50/50 px-2 py-1 rounded-md border border-indigo-100/30",children:p==="running_average"?s==="zh"?"💡 呈现从第一次作业后开始的平均学力,能更好地平滑单次测验失常":"💡 Cumulative average line provides an overview of consistency while eliminating single test noise":s==="zh"?"💡 呈现每次作业的评估分数波动,能捕捉近期的突破和退步":"💡 Raw scores show performance on individual assignments, highlighting highlights and deviations"})]})]}),e.jsxs("div",{className:"p-4 grid grid-cols-1 lg:grid-cols-4 gap-5",children:[e.jsxs("div",{className:"lg:col-span-1 bg-slate-50/50 rounded-xl border border-slate-150 p-3 flex flex-col justify-between max-h-[340px] overflow-hidden",children:[e.jsxs("div",{className:"flex flex-col h-full",children:[e.jsx("span",{className:"text-[10px] font-black uppercase text-slate-400 tracking-wider mb-2 block select-none",children:s==="zh"?"参比学生选单":"Active Pupil List"}),e.jsx("div",{className:"flex-1 overflow-y-auto space-y-1.5 pr-0.5",id:"enrolled-pupils-compare-checklist",children:t.map((x,T)=>{const n=l.includes(x.id),h=$[T%$.length];return e.jsx("button",{type:"button",onClick:()=>_(x.id),className:`w-full flex items-center justify-between text-left p-2 rounded-xl border transition-all text-xs cursor-pointer select-none ${n?"bg-white border-gray-200/80 shadow-3xs font-bold ring-1 ring-slate-100/50":"bg-transparent border-transparent text-gray-500 hover:bg-slate-100/60"}`,children:e.jsxs("div",{className:"flex items-center gap-2 truncate pr-2",children:[e.jsx("div",{className:"w-5 h-5 rounded-full flex items-center justify-center border text-[9px] text-white shrink-0 font-extrabold",style:{backgroundColor:n?h:"#e2e8f0",borderColor:n?h:"#cbd5e1"},children:n?e.jsx(he,{size:11,className:"stroke-[3]"}):x.name.charAt(0)}),e.jsxs("div",{className:"truncate",children:[e.jsx("div",{className:"truncate font-bold text-gray-800 text-[11.5px]",children:x.name}),x.email&&e.jsx("div",{className:"text-[8.5px] text-gray-400 truncate",children:x.email})]})]})},x.id)})})]}),e.jsxs("div",{className:"mt-3 pt-2.5 border-t border-slate-200/70 text-[9.5px] text-slate-400 leading-normal flex items-center gap-1",children:[e.jsx(ae,{size:12,className:"text-indigo-400"}),e.jsx("span",{children:s==="zh"?"勾选即可实时载入/移除比对":"Toggle checkboxes to real-time update"})]})]}),e.jsx("div",{className:"lg:col-span-3 flex flex-col justify-between",id:"compare-canvas-holder",children:l.length<2?e.jsx("div",{className:"h-[250px] flex items-center justify-center border border-dashed border-gray-200 bg-gray-50/50 rounded-xl p-6",children:e.jsxs("div",{className:"max-w-xs text-center",children:[e.jsx(ee,{size:24,className:"text-indigo-300 mx-auto mb-2 animate-bounce"}),e.jsx("p",{className:"text-gray-500 text-xs font-semibold leading-relaxed",children:L.noStudentsMsg})]})}):e.jsx("div",{className:"h-[250px] w-full relative bg-slate-50/15 border border-slate-100 p-2.5 rounded-2xl shadow-3xs",children:e.jsx(me,{width:"100%",height:"100%",children:e.jsxs(ct,{data:S,margin:{top:15,right:15,left:-22,bottom:5},children:[e.jsx(Se,{strokeDasharray:"3 3",stroke:"#f1f5f9",vertical:!1}),e.jsx(ge,{dataKey:"name",tick:{fontSize:9,fill:"#64748b",fontWeight:"bold"},axisLine:{stroke:"#e2e8f0"},tickLine:!1}),e.jsx(ue,{domain:[0,100],tick:{fontSize:9,fill:"#64748b",fontWeight:"bold"},axisLine:{stroke:"#e2e8f0"},tickLine:!1}),e.jsx(be,{content:({active:x,payload:T,label:n})=>x&&T&&T.length?e.jsxs("div",{className:"p-3 bg-white/95 border border-gray-150 rounded-xl shadow-xl max-w-[280px] font-sans text-xs",children:[e.jsxs("div",{className:"font-extrabold text-slate-800 leading-tight mb-2 border-b border-gray-100 pb-1.5 flex items-center justify-between",children:[e.jsx("span",{className:"truncate max-w-[180px]",children:n}),e.jsx("span",{className:"text-[8px] bg-slate-100 text-slate-500 px-1.5 py-0.5 rounded font-bold uppercase shrink-0",children:"Evaluated Item"})]}),e.jsx("div",{className:"space-y-1.5",children:T.map(h=>{const f=h.dataKey.split("_")[1],z=t.find(N=>N.id===f);return z?e.jsxs("div",{className:"flex items-center justify-between gap-4 font-sans text-[11px]",children:[e.jsxs("div",{className:"flex items-center gap-1.5 min-w-0",children:[e.jsx("span",{className:"w-1.5 h-1.5 rounded-full shrink-0",style:{backgroundColor:h.stroke}}),e.jsx("span",{className:"font-semibold text-gray-700 truncate",children:z.name})]}),e.jsxs("span",{className:"font-black font-mono",style:{color:h.stroke},children:[h.value,"%"]})]},h.dataKey):null})})]}):null}),j.map(x=>{const T=p==="running_average"?`avg_${x.id}`:`raw_${x.id}`;return e.jsx(xt,{type:"monotone",name:x.name,dataKey:T,stroke:x.color,strokeWidth:p==="running_average"?3.5:2.5,dot:{r:3,stroke:"#ffffff",strokeWidth:1.5,fill:x.color},activeDot:{r:5,stroke:"#ffffff",strokeWidth:2,fill:x.color},animationDuration:1e3,connectNulls:!0},x.id)})]})})})})]}),l.length>=2&&j.length>0&&e.jsxs("div",{className:"px-4 pb-4 border-t border-gray-100 pt-3",children:[e.jsxs("div",{className:"text-[10px] font-black uppercase text-slate-400 tracking-wider mb-2.5 select-none flex items-center gap-1",children:[e.jsx(fe,{size:12,className:"text-indigo-500"}),e.jsx("span",{children:L.metricsTableTitle})]}),e.jsx("div",{className:"grid grid-cols-1 sm:grid-cols-2 md:grid-cols-4 gap-3",children:j.map(x=>{const T=x.netGrowth>1,n=x.netGrowth<-1;return e.jsxs("div",{className:"p-3 bg-slate-50/50 border border-slate-100 rounded-xl flex flex-col justify-between",style:{borderLeft:`3px solid ${x.color}`},children:[e.jsxs("div",{className:"flex justify-between items-start gap-1",children:[e.jsx("span",{className:"text-xs font-extrabold text-slate-800 truncate",title:x.name,children:x.name}),e.jsxs("span",{className:"text-[9px] text-gray-400 font-mono font-bold",children:[x.totalItems," ",s==="zh"?"个样本":"graded"]})]}),e.jsxs("div",{className:"grid grid-cols-2 gap-2 mt-2 pt-2 border-t border-slate-100/60 select-none",children:[e.jsxs("div",{children:[e.jsx("span",{className:"text-[8px] text-gray-400 uppercase font-black",children:s==="zh"?"基础/当前均分":"Base/Live Avg"}),e.jsxs("div",{className:"text-[11px] font-bold font-mono text-slate-700 mt-0.5",children:[x.startingAvg,"% → ",x.finalAvg,"%"]})]}),e.jsxs("div",{className:"text-right",children:[e.jsx("span",{className:"text-[8px] text-gray-400 uppercase font-black",children:L.tableNet}),e.jsxs("div",{className:"flex items-center justify-end gap-0.5 mt-0.5",children:[e.jsxs("span",{className:`text-[11px] font-black font-mono ${T?"text-emerald-600":n?"text-red-500":"text-slate-600"}`,children:[x.netGrowth>0?`+${x.netGrowth}`:x.netGrowth,"%"]}),T&&e.jsx(ie,{size:11,className:"text-emerald-500 shrink-0"}),n&&e.jsx(Re,{size:11,className:"text-red-400 shrink-0"})]})]})]}),e.jsxs("div",{className:"mt-2 text-[9px] bg-white p-1 rounded border border-slate-150 flex items-center justify-between font-mono select-none",children:[e.jsx("span",{className:"text-gray-400 font-bold",children:s==="zh"?"评估最值":"Peak Score"}),e.jsxs("span",{className:"font-extrabold text-indigo-700",children:[x.peak,"%"]})]})]},x.id)})})]})]})}function ft({classId:t,lang:a="en"}){const[i,s]=A.useState([]),[l,c]=A.useState(!0),[p,w]=A.useState(null),[$,S]=A.useState("heatmap"),[j,g]=A.useState(null),_=A.useMemo(()=>i.length===0?null:[...i].sort((n,h)=>n.attendanceRate-h.attendanceRate)[0],[i]),L=A.useMemo(()=>{const n=new Date,h=new Date;h.setDate(n.getDate()-34);const f=h.getDay(),z=f===0?6:f-1;h.setDate(h.getDate()-z);const N=[],k=new Date(h),M=new Date(n),D=M.getDay(),J=D===0?0:7-D;for(M.setDate(M.getDate()+J);k<=M;){const u=k.toISOString().split("T")[0],C=i.find(R=>R.date===u);N.push({dateStr:u,dayOfMonth:k.getDate(),monthName:k.toLocaleDateString(a==="zh"?"zh-CN":"en-US",{month:"short"}),isToday:u===n.toISOString().split("T")[0],isFuture:k>n,dayOfWeek:k.getDay(),match:C}),k.setDate(k.getDate()+1)}return N},[i,a]);A.useEffect(()=>{if(i&&i.length>0&&L&&L.length>0){const n=[...i].sort((h,f)=>h.attendanceRate-f.attendanceRate)[0];if(n){const h=L.find(f=>f.dateStr===n.date);h&&g(h)}}},[i,L]),A.useEffect(()=>{let n=!0;return(async()=>{c(!0),w(null);try{const f=await fetch(`/api/classes/${t}/attendance-summary`);if(!f.ok)throw new Error(`Error: ${f.status} ${f.statusText}`);const z=await f.json();n&&s(z)}catch(f){n&&w(f.message||"Failed to loaded attendance summary")}finally{n&&c(!1)}})(),()=>{n=!1}},[t]);const x=A.useMemo(()=>{if(i.length===0)return{avgRate:0,totalPresent:0,totalLate:0,totalAbsent:0,totalSchedules:0};let n=0,h=0,f=0,z=0;return i.forEach(N=>{n+=N.attendanceRate,h+=N.present,f+=N.late,z+=N.absent}),{avgRate:Math.round(n/i.length),totalPresent:h,totalLate:f,totalAbsent:z,totalSchedules:i.length}},[i]);if(l)return e.jsxs("div",{className:"bg-white border border-gray-100 rounded-xl p-6 shadow-sm flex flex-col items-center justify-center min-h-[220px]",children:[e.jsx(Z,{className:"animate-spin text-indigo-500 mb-2",size:24}),e.jsx("span",{className:"text-xs text-gray-400 font-sans",children:a==="zh"?"正在加载出勤分析数据...":"Loading attendance analytics..."})]});if(p)return e.jsxs("div",{className:"bg-white border border-red-100 rounded-xl p-6 shadow-sm flex flex-col items-center justify-center min-h-[220px]",children:[e.jsx(se,{className:"text-red-500 mb-2",size:24}),e.jsx("span",{className:"text-xs text-red-600 font-sans text-center",children:a==="zh"?`无法加载出勤分析: ${p}`:`Failed to load attendance analysis: ${p}`})]});if(i.length===0)return e.jsxs("div",{className:"bg-white border border-gray-100 rounded-xl p-6 shadow-sm flex flex-col items-center justify-center min-h-[220px] select-none text-center",children:[e.jsx(Y,{className:"text-gray-300 mb-2",size:28}),e.jsx("span",{className:"text-xs font-semibold text-gray-500 font-sans block mb-1",children:a==="zh"?"近30天内没有出勤记录":"No Attendance Records in Last 30 Days"}),e.jsx("span",{className:"text-[10px] text-gray-400 max-w-sm",children:a==="zh"?"在新日程安排中为学生记录出勤后,统计数据将自动在此处生成。":"Attendance stats will generate automatically once you schedule lessons and register student statuses."})]});const T=i.map(n=>{try{const h=new Date(n.date);if(isNaN(h.getTime()))return{...n,displayDate:n.date};const f=h.getDate(),z=h.toLocaleDateString(a==="zh"?"zh-CN":"en-US",{month:"short"});return{...n,displayDate:a==="zh"?`${z}${f}日`:`${z} ${f}`}}catch{return{...n,displayDate:n.date}}});return e.jsxs("div",{className:"bg-white border border-gray-100 rounded-xl p-4 shadow-sm flex flex-col gap-4 font-sans",children:[e.jsxs("div",{className:"flex flex-col md:flex-row md:items-center justify-between gap-3 border-b border-gray-100 pb-3",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("div",{className:"p-2 bg-indigo-50 text-indigo-600 rounded-lg",children:e.jsx(ze,{size:16})}),e.jsxs("div",{children:[e.jsx("h4",{className:"text-sm font-bold text-gray-800",children:a==="zh"?"近30天班级出勤率分析":"30-Day Class Attendance Rates"}),e.jsx("p",{className:"text-[10px] text-gray-400",children:a==="zh"?"基于最近30天内的课程日程和已记录的出勤状态":"Based on scheduled lessons and submitted attendance records"})]})]}),e.jsxs("div",{className:"flex items-center gap-4 bg-gray-50/50 p-1.5 px-3 rounded-lg border border-gray-100/60 text-xs text-gray-600",children:[e.jsxs("div",{className:"flex items-center gap-1",children:[e.jsxs("span",{className:"text-[10px] text-gray-400 uppercase font-bold tracking-wider",children:[a==="zh"?"平均率":"Avg Rate",":"]}),e.jsxs("span",{className:`font-black ${x.avgRate>=90?"text-green-600":x.avgRate>=75?"text-amber-500":"text-red-500"}`,children:[x.avgRate,"%"]})]}),e.jsx("div",{className:"h-3 w-[1px] bg-gray-200"}),e.jsxs("div",{className:"flex items-center gap-1",children:[e.jsxs("span",{className:"text-[10px] text-gray-400 uppercase font-bold tracking-wider",children:[a==="zh"?"总课时":"Schedules",":"]}),e.jsx("span",{className:"font-extrabold text-slate-800",children:x.totalSchedules})]})]})]}),e.jsxs("div",{className:"grid grid-cols-3 gap-2 bg-gray-50/50 p-2 rounded-lg border border-gray-100/50 text-center text-xs",children:[e.jsxs("div",{className:"flex flex-col items-center py-1",children:[e.jsxs("div",{className:"flex items-center gap-1.5 text-green-600 mb-0.5",children:[e.jsx("span",{className:"w-1.5 h-1.5 bg-green-500 rounded-full animate-ping"}),e.jsx("span",{className:"font-semibold text-[10px]",children:a==="zh"?"已到":"Present"})]}),e.jsx("div",{className:"text-sm font-bold text-gray-800",children:x.totalPresent})]}),e.jsxs("div",{className:"flex flex-col items-center py-1 border-x border-gray-100",children:[e.jsxs("div",{className:"flex items-center gap-1.5 text-amber-500 mb-0.5",children:[e.jsx("span",{className:"w-1.5 h-1.5 bg-amber-400 rounded-full"}),e.jsx("span",{className:"font-semibold text-[10px]",children:a==="zh"?"迟到":"Late"})]}),e.jsx("div",{className:"text-sm font-bold text-gray-800",children:x.totalLate})]}),e.jsxs("div",{className:"flex flex-col items-center py-1",children:[e.jsxs("div",{className:"flex items-center gap-1.5 text-red-500 mb-0.5",children:[e.jsx("span",{className:"w-1.5 h-1.5 bg-red-400 rounded-full"}),e.jsx("span",{className:"font-semibold text-[10px]",children:a==="zh"?"缺勤":"Absent"})]}),e.jsx("div",{className:"text-sm font-bold text-gray-800",children:x.totalAbsent})]})]}),e.jsxs("div",{className:"flex bg-slate-100 p-0.5 rounded-lg self-start shrink-0",children:[e.jsxs("button",{type:"button",onClick:()=>S("heatmap"),className:`px-3 py-1.5 text-xs font-black rounded-md transition-all cursor-pointer flex items-center gap-1.5 ${$==="heatmap"?"bg-white text-indigo-700 shadow-md font-bold":"text-gray-500 hover:text-gray-850"}`,children:[e.jsx(Y,{size:13}),a==="zh"?"出勤日历热力图":"Calendar Heatmap"]}),e.jsxs("button",{type:"button",onClick:()=>S("chart"),className:`px-3 py-1.5 text-xs font-black rounded-md transition-all cursor-pointer flex items-center gap-1.5 ${$==="chart"?"bg-white text-indigo-700 shadow-md font-bold":"text-gray-500 hover:text-gray-850"}`,children:[e.jsx(ie,{size:13}),a==="zh"?"到课趋势柱状图":"Trend Chart"]})]}),$==="heatmap"?e.jsxs("div",{className:"flex flex-col gap-4 animate-fade-in text-gray-800",children:[_&&_.attendanceRate<80&&e.jsxs("div",{className:"p-3 bg-rose-50 border border-rose-100 rounded-xl flex items-start gap-2.5 text-xs text-rose-850",children:[e.jsx(se,{size:16,className:"text-rose-500 mt-0.5 shrink-0 animate-bounce"}),e.jsxs("div",{className:"text-left",children:[e.jsx("span",{className:"font-extrabold block",children:a==="zh"?"检测到低出勤率周期预警":"Problematic Low Attendance Period Detected"}),e.jsx("p",{className:"mt-0.5 text-[11px] text-rose-700/90 leading-relaxed",children:a==="zh"?`班级在 ${_.date}(课程: 《${_.lessonTitle}》)到课率处于低谷(仅为 ${_.attendanceRate}%)。请留意可能存在影响出勤的外部因素或教学周期瓶颈。`:`Check-in density dropped to a critical low of ${_.attendanceRate}% on ${_.date} for lesson: "${_.lessonTitle}". Keep track of potential class milestones or periodic patterns.`})]})]}),e.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-3 text-[10px] text-gray-500 bg-slate-50/50 px-3 py-2 rounded-lg border border-gray-100/50",children:[e.jsx("span",{className:"font-semibold",children:a==="zh"?"出勤率梯度图例:":"Attendance Rate Intensity:"}),e.jsxs("div",{className:"flex items-center gap-4",children:[e.jsxs("div",{className:"flex items-center gap-1",children:[e.jsx("span",{className:"w-3 h-3 rounded bg-emerald-500 block"}),e.jsx("span",{children:a==="zh"?"极佳 (≥90%)":"Excellent (≥90%)"})]}),e.jsxs("div",{className:"flex items-center gap-1",children:[e.jsx("span",{className:"w-3 h-3 rounded bg-amber-500 block"}),e.jsx("span",{children:a==="zh"?"黄牌警告 (75%-89%)":"Warning (75%-89%)"})]}),e.jsxs("div",{className:"flex items-center gap-1",children:[e.jsx("span",{className:"w-3 h-3 rounded bg-rose-500 block"}),e.jsx("span",{children:a==="zh"?"严重偏低 (<75%)":"Critical (<75%)"})]}),e.jsxs("div",{className:"flex items-center gap-1",children:[e.jsx("span",{className:"w-3 h-3 rounded bg-slate-100 border border-slate-200 block"}),e.jsx("span",{children:a==="zh"?"未排课":"No Class"})]})]})]}),e.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-12 gap-5 items-start",children:[e.jsxs("div",{className:"md:col-span-7 bg-white border border-gray-100 p-4 rounded-xl shadow-2xs",children:[e.jsxs("div",{className:"flex items-center justify-between mb-3 border-b border-gray-50 pb-2",children:[e.jsx("span",{className:"text-[10px] font-black text-slate-400 uppercase tracking-widest block",children:a==="zh"?"35天教学周期考勤热度":"5-Week Sequential Heatmap"}),e.jsx("span",{className:"text-[9.5px] text-gray-400 font-mono",children:"Mon-Sun Matrix"})]}),e.jsxs("div",{className:"grid grid-cols-7 gap-1.5 sm:gap-2",children:[(a==="zh"?["一","二","三","四","五","六","日"]:["Mon","Tue","Wed","Thu","Fri","Sat","Sun"]).map(n=>e.jsx("div",{className:"text-center text-[10px] font-black text-slate-400 py-1 uppercase tracking-wider font-sans",children:n},n)),L.map(n=>{let h="bg-slate-50 border border-slate-150 text-gray-400 cursor-default hover:bg-slate-100/50",f=null;n.isFuture?h="bg-slate-50/20 text-slate-300 opacity-40 border border-dashed border-slate-100 cursor-not-allowed":n.match&&(f=n.match.attendanceRate,f>=90?h="bg-emerald-500 hover:bg-emerald-600 text-white font-extrabold cursor-pointer border border-transparent":f>=75?h="bg-amber-500 hover:bg-amber-600 text-white font-extrabold cursor-pointer border border-transparent":h="bg-rose-500 hover:bg-rose-600 text-white font-extrabold cursor-pointer border border-transparent");const N=j&&j.dateStr===n.dateStr?"ring-2 ring-indigo-600 ring-offset-2 scale-105 z-10 shadow-md":n.isToday?"ring-2 ring-slate-800 ring-offset-1 z-10":"";return e.jsxs("button",{type:"button",onClick:()=>{n.isFuture||g(n)},disabled:n.isFuture,className:`relative aspect-square rounded-lg flex flex-col items-center justify-center p-1 transition-all group shrink-0 ${h} ${N}`,title:n.match?`${n.dateStr}: ${n.match.lessonTitle} (${f}%)`:`${n.dateStr}`,children:[e.jsx("span",{className:"text-[11px] font-bold select-none",children:n.dayOfMonth}),n.dayOfMonth===1&&e.jsx("span",{className:"absolute -top-1.5 -right-1 bg-indigo-700 text-white text-[7px] font-black tracking-widest uppercase px-1 rounded shadow-xs scale-90",children:n.monthName}),n.match&&e.jsxs("div",{className:"pointer-events-none absolute bottom-full left-1/2 -translate-x-1/2 mb-2 w-48 bg-slate-950 text-white p-2 text-[9.5px] leading-relaxed rounded-xl shadow-2xl opacity-0 scale-95 group-hover:opacity-100 group-hover:scale-100 group-hover:-translate-y-0.5 transition-all duration-150 z-50 block",children:[e.jsx("div",{className:"font-extrabold border-b border-slate-850 pb-1 mb-1 truncate text-left",children:n.match.lessonTitle}),e.jsxs("div",{className:"flex justify-between font-mono gap-1 text-[8.5px]",children:[e.jsxs("span",{className:"text-slate-400",children:[a==="zh"?"日期":"Date",":"]}),e.jsx("span",{className:"font-bold",children:n.dateStr})]}),e.jsxs("div",{className:"flex justify-between font-mono gap-1 text-[8.5px]",children:[e.jsxs("span",{className:"text-slate-400",children:[a==="zh"?"实到人数":"Present",":"]}),e.jsx("span",{className:"font-extrabold text-emerald-300",children:n.match.present})]}),e.jsxs("div",{className:"flex justify-between font-mono gap-1 text-[8.5px]",children:[e.jsxs("span",{className:"text-slate-400",children:[a==="zh"?"迟到人数":"Late",":"]}),e.jsx("span",{className:"font-extrabold text-amber-300",children:n.match.late})]}),e.jsxs("div",{className:"flex justify-between font-mono gap-1 text-[8.5px]",children:[e.jsxs("span",{className:"text-slate-400",children:[a==="zh"?"未到人数":"Absent",":"]}),e.jsx("span",{className:"font-extrabold text-rose-300",children:n.match.absent})]}),e.jsxs("div",{className:"text-center font-bold font-mono text-[11px] text-indigo-300 pt-1 border-t border-slate-800 mt-1",children:[a==="zh"?"到课比率:":"Access density:"," ",f,"%"]}),e.jsx("div",{className:"absolute top-full left-1/2 -translate-x-1/2 -mt-1 border-[4px] border-transparent border-t-slate-950"})]})]},n.dateStr)})]})]}),e.jsx("div",{className:"md:col-span-5 bg-slate-50 border border-gray-200 p-4 rounded-xl min-h-[210px] flex flex-col justify-between",children:j?e.jsxs("div",{className:"text-left flex-1 flex flex-col justify-between h-full space-y-3",children:[e.jsxs("div",{children:[e.jsx("span",{className:"text-[9px] font-black text-slate-400 uppercase tracking-widest block mb-1",children:a==="zh"?"日期考勤指数详情":"Acreage Diagnostic Center"}),e.jsxs("h5",{className:"text-xs font-black text-gray-800 flex items-center gap-1.5 justify-start",children:[e.jsx(Y,{size:13,className:"text-indigo-650"}),j.dateStr," ",j.isToday?`(${a==="zh"?"今天":"Today"})`:""]})]}),j.match?e.jsxs("div",{className:"space-y-3 flex-1 flex flex-col justify-between",children:[e.jsxs("div",{className:"bg-white border border-gray-150 p-2.5 rounded-lg text-left",children:[e.jsx("span",{className:"text-[8.5px] font-bold text-gray-400 block uppercase",children:a==="zh"?"讲授课目":"Subject of Instruction"}),e.jsx("p",{className:"text-xs font-extrabold text-indigo-900 line-clamp-2 mt-0.5",title:j.match.lessonTitle,children:j.match.lessonTitle})]}),e.jsxs("div",{className:"flex items-center gap-4 py-1.5",children:[e.jsxs("div",{className:"relative flex items-center justify-center shrink-0",children:[e.jsxs("svg",{className:"w-14 h-14 transform -rotate-90",children:[e.jsx("circle",{cx:"28",cy:"28",r:"23",className:"stroke-gray-200 fill-none",strokeWidth:"3.5"}),e.jsx("circle",{cx:"28",cy:"28",r:"23",className:`fill-none transition-all duration-300 ${j.match.attendanceRate>=90?"stroke-emerald-500":j.match.attendanceRate>=75?"stroke-amber-500":"stroke-rose-500"}`,strokeWidth:"4",strokeDasharray:`${2*Math.PI*23}`,strokeDashoffset:`${2*Math.PI*23*(1-j.match.attendanceRate/100)}`,strokeLinecap:"round"})]}),e.jsxs("span",{className:"absolute text-xs font-black font-mono text-gray-800",children:[j.match.attendanceRate,"%"]})]}),e.jsxs("div",{className:"text-left space-y-0.5",children:[e.jsx("span",{className:"text-[10px] font-bold text-gray-400 block uppercase",children:a==="zh"?"考勤宏观评估":"Check-in Diagnostics"}),e.jsx("span",{className:`text-xs font-extrabold block ${j.match.attendanceRate>=90?"text-emerald-600":j.match.attendanceRate>=75?"text-amber-500":"text-rose-600"}`,children:j.match.attendanceRate>=90?a==="zh"?"出勤情况极好":"Excellent Check-in":j.match.attendanceRate>=75?a==="zh"?"出勤尚可但有波动":"Moderate Attendance":a==="zh"?"出勤率严重偏低":"Low Attendance Alert"})]})]}),e.jsxs("div",{className:"grid grid-cols-3 gap-1.5 text-center",children:[e.jsxs("div",{className:"bg-white border border-gray-150 p-1.5 rounded-lg",children:[e.jsx("span",{className:"text-[8px] font-bold text-emerald-600 block uppercase",children:a==="zh"?"到席":"In Class"}),e.jsx("span",{className:"text-xs font-mono font-extrabold text-slate-800",children:j.match.present})]}),e.jsxs("div",{className:"bg-white border border-gray-150 p-1.5 rounded-lg",children:[e.jsx("span",{className:"text-[8px] font-bold text-amber-500 block uppercase",children:a==="zh"?"迟到":"Late"}),e.jsx("span",{className:"text-xs font-mono font-extrabold text-slate-800",children:j.match.late})]}),e.jsxs("div",{className:"bg-white border border-gray-150 p-1.5 rounded-lg",children:[e.jsx("span",{className:"text-[8px] font-bold text-rose-500 block uppercase",children:a==="zh"?"缺席":"Absent"}),e.jsx("span",{className:"text-xs font-mono font-extrabold text-slate-800",children:j.match.absent})]})]})]}):e.jsxs("div",{className:"flex-1 flex flex-col items-center justify-center py-6 text-slate-400 text-center gap-1 select-none font-sans",children:[e.jsx(se,{size:24,className:"text-slate-300"}),e.jsx("span",{className:"font-bold text-slate-500 text-[11px]",children:a==="zh"?"当天没有排课计划":"No Lesson Scheduled"}),e.jsx("span",{className:"text-[9px] max-w-[180px] text-gray-400",children:a==="zh"?"本日期无分配的课程安排及签到表。":"No instruction maps were recorded on this period."})]})]}):e.jsxs("div",{className:"flex flex-col items-center justify-center py-8 text-slate-400 text-center h-full select-none gap-2 font-sans",children:[e.jsx(Y,{size:28,className:"text-indigo-400 animate-pulse"}),e.jsx("span",{className:"font-bold text-slate-600 text-xs",children:a==="zh"?"请点击考勤方块":"Select a Cell to Inspect"}),e.jsx("span",{className:"text-[9.5px] text-gray-400 max-w-[180px] leading-relaxed",children:a==="zh"?"在左侧历史视窗中轻点日期,可瞬间深度解读班级应出席名册及课题明细。":"Click any of the heat blocks to audit lesson stats and classroom ratios."})]})})]})]}):e.jsx("div",{className:"h-44 w-full font-sans select-none animate-fade-in",children:e.jsx(me,{width:"100%",height:"100%",children:e.jsxs(Ee,{data:T,margin:{top:10,right:10,left:-25,bottom:0},children:[e.jsx(Se,{strokeDasharray:"3 3",vertical:!1,stroke:"#f0f0f0"}),e.jsx(ge,{dataKey:"displayDate",tick:{fontSize:9,fill:"#9ca3af"},axisLine:{stroke:"#e5e7eb"},tickLine:!1}),e.jsx(ue,{domain:[0,100],tickFormatter:n=>`${n}%`,tick:{fontSize:9,fill:"#9ca3af"},axisLine:!1,tickLine:!1}),e.jsx(be,{cursor:{fill:"#f3f4f6",opacity:.6},content:({active:n,payload:h})=>{if(n&&h&&h.length){const f=h[0].payload;return e.jsxs("div",{className:"bg-white border border-gray-150 p-2.5 rounded-xl shadow-xl font-sans text-xs flex flex-col gap-1.5",children:[e.jsxs("div",{className:"font-bold text-gray-800 border-b border-gray-150 pb-1 mb-1 flex items-center justify-between gap-4",children:[e.jsx("span",{className:"max-w-[130px] truncate",title:f.lessonTitle,children:f.lessonTitle}),e.jsx("span",{className:"text-[10px] text-gray-400 font-mono normal-case",children:f.date})]}),e.jsxs("div",{className:"flex justify-between gap-4 text-gray-600",children:[e.jsxs("span",{className:"flex items-center gap-1 text-gray-400",children:[e.jsx(ee,{size:11})," ",a==="zh"?"总注册学生":"Total Students",":"]}),e.jsx("span",{className:"font-bold text-slate-700",children:f.total})]}),e.jsxs("div",{className:"flex justify-between gap-4 text-emerald-600",children:[e.jsxs("span",{className:"flex items-center gap-1",children:[e.jsx("span",{className:"w-1.5 h-1.5 rounded-full bg-green-500"})," ",a==="zh"?"实到人数":"Present",":"]}),e.jsx("span",{className:"font-semibold",children:f.present})]}),e.jsxs("div",{className:"flex justify-between gap-4 text-amber-500",children:[e.jsxs("span",{className:"flex items-center gap-1",children:[e.jsx("span",{className:"w-1.5 h-1.5 rounded-full bg-amber-400"})," ",a==="zh"?"迟到人数":"Late",":"]}),e.jsx("span",{className:"font-semibold",children:f.late})]}),e.jsxs("div",{className:"flex justify-between gap-4 text-red-500",children:[e.jsxs("span",{className:"flex items-center gap-1",children:[e.jsx("span",{className:"w-1.5 h-1.5 rounded-full bg-red-400"})," ",a==="zh"?"未到人数":"Absent",":"]}),e.jsx("span",{className:"font-semibold",children:f.absent})]}),e.jsxs("div",{className:"flex justify-between gap-4 text-indigo-600 border-t border-gray-100 pt-1.5 mt-1 font-bold",children:[e.jsxs("span",{children:[a==="zh"?"单次出勤率":"Attendance Rate",":"]}),e.jsxs("span",{children:[f.attendanceRate,"%"]})]})]})}return null}}),e.jsx(Me,{dataKey:"attendanceRate",fill:"#6366f1",radius:[4,4,0,0],maxBarSize:28})]})})})]})}function jt(t){const{cls:a,lang:i,cStudents:s,classProgressMap:l,classSchedulesMap:c,classDashboardMap:p}=t;return e.jsxs("div",{className:"space-y-4",children:[l[a.id]&&l[a.id].length>0&&e.jsxs("div",{className:"mb-4 bg-white p-2 border border-gray-100 rounded shadow-sm",children:[e.jsxs("div",{className:"text-xs font-medium text-gray-500 mb-2 flex items-center gap-1",children:[e.jsx(We,{size:12})," Class Avg Completion"]}),e.jsx("div",{className:"h-32 w-full",children:e.jsx(me,{width:"100%",height:"100%",children:e.jsxs(Ee,{data:l[a.id],children:[e.jsx(ge,{dataKey:"lesson_title",hide:!0}),e.jsx(ue,{domain:[0,100],hide:!0}),e.jsx(be,{contentStyle:{fontSize:"10px",padding:"4px",borderRadius:"4px"},formatter:w=>[`${Math.round(w)}%`,"Average"]}),e.jsx(Me,{dataKey:"average_progress",fill:"#6366f1",radius:[2,2,0,0]})]})})})]}),e.jsx("div",{className:"mb-4",children:e.jsx(bt,{schedules:c[a.id]||[],progress:l[a.id]||[],lang:i})}),e.jsx("div",{className:"mb-4",children:e.jsx(ft,{classId:a.id,lang:i})}),p[a.id]&&e.jsx(pt,{students:s,assignments:p[a.id].assignments||[],performance:p[a.id].performance||[],lang:i})]})}function vt(t){const{cls:a,lang:i,cStudents:s,activeSubmissionFilter:l,classDashboardMap:c,assignmentSortOrder:p,setAssignmentSortOrder:w,lessons:$,isGeneratingPDFReport:S,handleGeneratePDFReport:j,setExportClassId:g,setExportClassName:_,setQuizzesWeight:L,setAssignmentsWeight:x,setCustomCategoryOverrides:T,setIsExportWeightModalOpen:n,isGeneratingAssignment:h,setQuizGeneratorClassId:f,setQuizGenMode:z,setQuizGenSelectedLessonId:N,setQuizGenTopic:k,setSuggestedObjectives:M,setSuggestedQuestions:D,setIsQuizGeneratorOpen:J,setClassSubmissionFilters:u,setActiveStudentId:C,setSelectedAssignment:R,setStudentViewStatus:E,setActiveRole:U,isGrading:q,setIsGrading:I,fetchClassDashboard:P,get30DayAverageWarning:d}=t,G=c[a.id]?.recentSubmissions||[],K=c[a.id]?.performance||[],V=(()=>{if(l==="all")return G;if(l==="submitted")return G.filter(r=>r.status==="submitted");if(l==="graded")return G.filter(r=>r.status==="graded");if(l==="pending"){const r=G.filter(b=>b.status==="submitted"),v=K.filter(b=>!b.submission_status||b.submission_status===null).map(b=>({assignment_id:b.assignment_id,assignment_title:b.assignment_title,student_id:b.student_id,student_name:b.student_name,content:i==="zh"?"尚未提交此作业":"Has not submitted this assignment yet",status:"pending_student"}));return[...r,...v]}return G})();return e.jsxs("div",{className:"mb-4 bg-white p-3 rounded-xl border border-slate-100 shadow-xs",children:[e.jsxs("div",{className:"flex items-center justify-between mb-3 border-b border-gray-200 pb-2",children:[e.jsxs("div",{className:"text-xs font-semibold text-gray-700 flex items-center gap-1",children:[e.jsx(ae,{size:14,className:"text-indigo-500"})," Class Dashboard"]}),e.jsxs("div",{className:"flex items-center gap-2",children:[c[a.id]&&e.jsxs(e.Fragment,{children:[e.jsxs("button",{id:`generate-pdf-btn-${a.id}`,disabled:S[a.id],onClick:r=>{r.stopPropagation(),j(a.id,a.name)},className:"text-white hover:bg-emerald-750 bg-emerald-600 hover:bg-emerald-700 transition-all font-semibold rounded px-2.5 py-1 text-[10px] items-center flex gap-1.5 shadow-sm cursor-pointer font-sans disabled:opacity-50",children:[S[a.id]?e.jsx(Z,{size:10,className:"animate-spin"}):e.jsx(oe,{size:10}),e.jsx("span",{children:i==="zh"?"下载班级 PDF 报告":"Download Class PDF Report"})]}),e.jsxs("button",{id:`export-grades-btn-${a.id}`,onClick:r=>{r.stopPropagation(),g(a.id),_(a.name),L(40),x(60),T({}),n(!0)},className:"text-slate-700 hover:text-slate-900 border border-gray-300 bg-white hover:bg-gray-100 transition-all font-semibold rounded px-2 py-1 text-[10px] items-center flex gap-1 shadow-sm cursor-pointer font-sans",children:[e.jsx(ne,{size:10})," ",i==="zh"?"选项与导出":"Export Grades"]})]}),e.jsxs("button",{disabled:h===a.id,onClick:async r=>{r.stopPropagation(),f(a.id),z("scan_lesson"),$.length>0?N($[0].id):N(""),k(""),M([]),D([]),J(!0)},className:"text-white bg-indigo-500 hover:bg-indigo-600 px-2 py-1 rounded text-[10px] items-center flex gap-1 shadow-sm disabled:opacity-50",children:[h===a.id?e.jsx(Z,{size:10,className:"animate-spin"}):e.jsx(Ae,{size:10})," Generate AI Quiz"]})]})]}),c[a.id]?e.jsxs("div",{className:"space-y-4",children:[e.jsxs("div",{children:[e.jsxs("div",{className:"flex items-center justify-between mb-2",children:[e.jsx("div",{className:"text-[10px] font-medium text-gray-500 uppercase tracking-wider",children:i==="zh"?"班级作业与测验":"Class Assignments & Quizzes"}),e.jsxs("div",{className:"flex items-center gap-1.5 bg-white border border-gray-200 px-2 py-1 rounded-lg shadow-sm",children:[e.jsx("span",{className:"text-[9px] font-bold text-gray-400 uppercase tracking-wider",children:i==="zh"?"排序:":"Sort:"}),e.jsxs("select",{value:p,onChange:r=>w(r.target.value),className:"bg-transparent border-0 text-[10px] text-gray-750 font-bold focus:outline-none focus:ring-0 p-0 cursor-pointer outline-none font-sans",id:"assignment-sort-select",children:[e.jsx("option",{value:"dueDate",children:i==="zh"?"截止日期":"Due Date"}),e.jsx("option",{value:"status",children:i==="zh"?"评分状态":"Status (Graded/Pending)"}),e.jsx("option",{value:"avgScore",children:i==="zh"?"平均分":"Average Score"})]})]})]}),e.jsxs("div",{className:"grid gap-2 grid-cols-2",children:[c[a.id].assignments&&(()=>{const r=c[a.id]?.assignments||[],v=c[a.id]?.performance||[];return r.map(y=>{const B=v.filter(X=>X.assignment_id===y.id);B.length;const H=B.filter(X=>X.submission_status==="submitted").length,o=B.filter(X=>X.submission_status==="graded").length;let m="pending",F=i==="zh"?"未提交":"No Submissions";H>0?(m="pending",F=i==="zh"?"待评分":"Pending Grading"):o>0&&(m="graded",F=i==="zh"?"已评分":"Graded");const W=B.filter(X=>X.score!==null&&X.score!==void 0).map(X=>Number(X.score)),Q=W.length>0?Math.round(W.reduce((X,Ge)=>X+Ge,0)/W.length):null,Ce=y.created_at+10080*60*1e3;return{...y,dueDateTimestamp:Ce,status:m,statusLabel:F,avgScore:Q,pendingGradingCount:H,gradedCount:o}}).sort((y,B)=>{if(p==="dueDate")return y.dueDateTimestamp-B.dueDateTimestamp;if(p==="status")return y.status===B.status?B.dueDateTimestamp-y.dueDateTimestamp:y.status==="pending"?-1:1;if(p==="avgScore"){const H=y.avgScore!==null?y.avgScore:-1;return(B.avgScore!==null?B.avgScore:-1)-H}return 0}).map(y=>e.jsxs("div",{className:"bg-white p-3 rounded-xl border border-gray-150 hover:border-indigo-200 shadow-sm text-xs cursor-pointer hover:shadow transition-all flex flex-col justify-between",children:[e.jsxs("div",{className:"flex items-start justify-between gap-1.5 mb-1.5",children:[e.jsx("div",{className:"font-semibold text-gray-800 line-clamp-1 flex-1 font-sans",title:y.title,children:y.title}),e.jsx("span",{className:`px-1.5 py-0.5 rounded text-[9px] font-bold shrink-0 border uppercase tracking-wider font-sans ${y.status==="graded"?"bg-emerald-50 text-emerald-700 border-emerald-100":y.pendingGradingCount>0?"bg-amber-50 text-amber-700 border-amber-100":"bg-gray-50 text-gray-500 border-gray-100"}`,children:y.statusLabel})]}),e.jsx("div",{className:"text-gray-500 text-[10px] line-clamp-2 leading-normal mb-2.5 font-sans",children:y.description||y.content}),e.jsxs("div",{className:"flex items-center justify-between border-t border-gray-55 pt-2 mt-auto gap-2",children:[e.jsxs("div",{className:"flex items-center gap-1.5 font-sans",children:[e.jsxs("span",{className:"text-[10px] text-gray-400 font-medium",children:[i==="zh"?"截止: ":"Due: ",e.jsx("span",{className:"text-gray-600 font-semibold",children:new Date(y.dueDateTimestamp).toLocaleDateString(i==="zh"?"zh-CN":"en-US",{month:"short",day:"numeric"})})]}),y.avgScore!==null&&e.jsxs("span",{className:"inline-flex items-center gap-0.5 bg-indigo-50 text-indigo-700 border border-indigo-100 px-1.5 py-0.5 rounded text-[9px] font-bold",children:[i==="zh"?"均分":"Avg",": ",y.avgScore,"%"]})]}),e.jsxs("button",{onClick:async B=>{if(B.stopPropagation(),s.length===0)return alert("No students in class to submit!");const H=s[Math.floor(Math.random()*s.length)],o=window.prompt(`Simulate student '${H.name}' submitting:`);o&&(await fetch(`/api/assignments/${y.id}/submissions`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({studentId:H.id,content:o})})).ok&&await P(a.id)},className:"text-[9px] text-indigo-600 border border-indigo-200 hover:border-indigo-300 hover:bg-indigo-50/50 bg-white px-2 py-0.5 rounded font-bold flex items-center gap-1 cursor-pointer transition-all shrink-0 font-sans",children:[e.jsx(Be,{size:8})," ",i==="zh"?"模拟":"Simulate"]})]})]},y.id))})(),c[a.id].assignments.length===0&&e.jsx("div",{className:"text-xs text-gray-400 italic",children:"No assignments yet."})]})]}),e.jsxs("div",{children:[e.jsxs("div",{className:"flex flex-col sm:flex-row sm:items-center justify-between gap-2 mb-2 border-b border-gray-100 pb-1.5 pt-1",children:[e.jsxs("div",{className:"text-[10px] font-bold text-gray-500 uppercase tracking-wider flex items-center gap-1",children:[e.jsx(Y,{size:11,className:"text-gray-400"}),i==="zh"?"近期作业提交":"Recent Submissions"]}),e.jsx("div",{className:"flex items-center gap-1 bg-gray-50 p-0.5 rounded-lg border border-gray-200",children:["all","submitted","graded","pending"].map(r=>{const v=l===r,b=(()=>{if(r==="all")return G.length;if(r==="submitted")return G.filter(y=>y.status==="submitted").length;if(r==="graded")return G.filter(y=>y.status==="graded").length;if(r==="pending"){const y=G.filter(H=>H.status==="submitted").length,B=K.filter(H=>!H.submission_status||H.submission_status===null).length;return y+B}return 0})(),O={all:i==="zh"?"全部":"All",submitted:i==="zh"?"待评分":"Submitted",graded:i==="zh"?"已完成":"Graded",pending:i==="zh"?"待完成":"Pending"}[r];return e.jsxs("button",{onClick:y=>{y.stopPropagation(),u(B=>({...B,[a.id]:r}))},className:`px-2 py-0.5 rounded-md text-[10px] font-semibold transition-all cursor-pointer flex items-center gap-1 font-sans ${v?"bg-white shadow-sm text-indigo-600 border border-indigo-100":"text-gray-500 hover:text-gray-700 hover:bg-gray-100 border border-transparent"}`,children:[e.jsx("span",{children:O}),e.jsx("span",{className:`px-1 py-0.1 ml-0.5 rounded-full text-[8.5px] leading-tight ${v?"bg-indigo-50 text-indigo-600 font-bold":"bg-gray-200/60 text-gray-400 font-medium"}`,children:b})]},r)})})]}),e.jsxs("div",{className:"flex flex-col gap-1.5 max-h-56 overflow-y-auto pr-1",children:[V.map((r,v)=>e.jsxs("div",{className:"bg-white p-2 border border-gray-150 rounded-lg text-xs flex justify-between items-center group hover:border-gray-300 transition-colors shadow-none mt-0.5",children:[e.jsxs("div",{className:"flex-1 min-w-0 pr-2",children:[e.jsxs("div",{className:"font-semibold text-gray-800 truncate flex items-center gap-1.5",children:[e.jsx("span",{className:"max-w-[110px] truncate",children:r.student_name}),e.jsx("span",{className:"text-[10px] text-gray-400 font-normal",children:"in"}),e.jsx("span",{className:"truncate text-gray-500 max-w-[130px]",title:r.assignment_title,children:r.assignment_title})]}),e.jsx("div",{className:"text-[10px] text-gray-500 truncate italic mt-0.5",children:r.status==="pending_student"?e.jsxs("span",{className:"text-amber-500 font-medium flex items-center gap-1",children:[e.jsx(le,{size:10,className:"animate-pulse"}),r.content]}):`"${r.content}"`})]}),e.jsxs("div",{className:"shrink-0 flex items-center justify-end gap-1.5",children:[r.status!=="pending_student"&&e.jsxs("button",{onClick:()=>{C(r.student_id),R({id:r.assignment_id,title:r.assignment_title,student_id:r.student_id,student_name:r.student_name,submission_status:r.status,score:r.score,feedback:r.feedback,content:r.question_content}),E("assignment"),U("student")},className:"text-indigo-600 bg-indigo-50 hover:bg-indigo-100 px-2 py-1 rounded-md text-[9px] flex items-center gap-1 shadow-none font-bold border border-indigo-100 hover:border-indigo-200 transition-all cursor-pointer",children:[e.jsx(Fe,{size:9})," Live Canvas"]}),r.status==="graded"?e.jsxs("span",{className:`px-1.5 py-0.5 rounded text-[10px] font-medium ${r.score>=85?"bg-green-100 text-green-700 border border-green-200":r.score>=70?"bg-indigo-100 text-indigo-700 border border-indigo-200":"bg-yellow-105 text-yellow-700 border border-yellow-250"}`,children:[r.score,"%"]}):e.jsxs("button",{disabled:q[`${r.assignment_id}-${r.student_id}`],onClick:async()=>{I(b=>({...b,[`${r.assignment_id}-${r.student_id}`]:!0}));try{(await fetch(`/api/assignments/${r.assignment_id}/submissions/${r.student_id}/grade`,{method:"POST"})).ok&&await P(a.id)}finally{I(b=>({...b,[`${r.assignment_id}-${r.student_id}`]:!1}))}},className:"text-white bg-green-500 hover:bg-green-600 px-2 py-1 rounded-md text-[9px] flex items-center gap-1 shadow-sm font-bold border border-green-600 hover:border-green-700 hover:-translate-y-0.1 transition-all disabled:opacity-50 cursor-pointer",children:[q[`${r.assignment_id}-${r.student_id}`]?e.jsx(Z,{size:10,className:"animate-spin"}):e.jsx(Ae,{size:10})," ",i==="zh"?"评分":"Grade"]})]})]},r.status==="pending_student"?`${r.assignment_id}-${r.student_id}-pending-${v}`:`${r.assignment_id}-${r.student_id}-${v}`)),V.length===0&&e.jsx("div",{className:"text-xs text-gray-400 italic p-4 text-center bg-gray-50 border border-dashed border-gray-200 rounded-lg select-none",children:i==="zh"?"该筛选下暂无可展示的作业项目。":"No submissions under this filter."})]})]}),c[a.id].assignments.length>0&&s.length>0&&e.jsxs("div",{children:[e.jsx("div",{className:"text-[10px] font-medium text-gray-500 mb-1 uppercase tracking-wider",children:"Class Performance Heatmap"}),e.jsx("div",{className:"overflow-x-auto border border-gray-200 rounded",children:e.jsxs("table",{className:"w-full text-xs text-left bg-white",children:[e.jsx("thead",{className:"bg-gray-50 sticky top-0",children:e.jsxs("tr",{children:[e.jsx("th",{className:"p-2 border-b border-r border-gray-200 font-medium whitespace-nowrap text-gray-600",children:"Student"}),c[a.id].assignments.map(r=>e.jsx("th",{className:"p-2 border-b border-r border-gray-200 font-medium truncate max-w-[80px]",title:r.title,children:r.title},r.id))]})}),e.jsx("tbody",{children:s.map(r=>e.jsxs("tr",{className:"border-b border-gray-100 last:border-b-0",children:[e.jsx("td",{className:"p-2 border-r border-gray-100 font-medium text-gray-700 whitespace-nowrap truncate max-w-[160px]",children:e.jsxs("div",{className:"flex items-center gap-1.5",children:[e.jsx("span",{className:"truncate",title:r.name,children:r.name}),(()=>{const v=d(r.id,a.id);return v!==null?e.jsxs("span",{className:"inline-flex items-center gap-0.5 bg-red-50 text-red-700 border border-red-200 px-1 py-0.5 rounded text-[9px] font-bold animate-pulse",title:i==="zh"?`30天平均成绩已降至60%以下 (${v}%)`:`30-day average has dropped below 60% (${v}%)`,children:[e.jsx(ke,{size:10,className:"text-red-500"}),v,"%"]}):null})()]})}),c[a.id].assignments.map(v=>{const b=c[a.id].performance.find(B=>B.assignment_id===v.id&&B.student_id===r.id);let O="bg-gray-50",y="-";return b&&b.score!==null?(y=b.score.toString(),b.score>=90?O="bg-green-100 text-green-800 font-medium":b.score>=70?O="bg-green-50 text-green-700":b.score>=50?O="bg-yellow-50 text-yellow-700":O="bg-red-50 text-red-700"):b&&b.submission_status==="submitted"&&(y="Wait",O="bg-blue-50 text-blue-500 text-[9px]"),e.jsx("td",{className:`p-2 border-r border-gray-100 text-center relative group/cell ${O}`,children:(()=>{const H=b&&b.graded_at?new Date(b.graded_at).toLocaleString(i==="zh"?"zh-CN":"en-US",{month:"short",day:"numeric",hour:"2-digit",minute:"2-digit"}):"";return e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"flex items-center justify-center gap-0.5 select-none font-sans",children:[e.jsx("span",{children:y}),b&&b.score!==null&&e.jsx("span",{className:"w-1 h-1 rounded-full bg-emerald-500 shrink-0 inline-block animate-pulse"})]}),b&&b.score!==null&&e.jsxs("div",{className:"absolute bottom-full mb-1.5 left-1/2 -translate-x-1/2 hidden group-hover/cell:block bg-gray-900 border border-gray-800 text-white text-[10px] p-2.5 rounded-xl shadow-2xl z-30 w-44 pointer-events-none text-left leading-normal font-sans font-normal normal-case",children:[e.jsxs("div",{className:"font-bold text-[11px] mb-1 text-emerald-400 flex items-center gap-1",children:[e.jsx(ze,{size:11,className:"shrink-0"}),i==="zh"?"已完成评分":"Graded & Evaluated"]}),H&&e.jsxs("div",{className:"text-gray-300 flex items-center gap-1 font-semibold text-[9px] mb-1",children:[e.jsx(le,{size:10,className:"shrink-0 text-indigo-400"}),e.jsx("span",{children:i==="zh"?`时间: ${H}`:`Graded: ${H}`})]}),b.feedback&&e.jsxs("div",{className:"text-gray-200 mt-1 pt-1 border-t border-gray-800 line-clamp-3 text-[9px] italic",children:['"',b.feedback,'"']}),e.jsx("div",{className:"absolute top-full left-1/2 -translate-x-1/2 -mt-1 border-4 border-transparent border-t-gray-900"})]})]})})()},v.id)})]},r.id))})]})})]})]}):e.jsx("div",{className:"flex justify-center p-4 text-gray-400",children:e.jsx(Z,{size:16,className:"animate-spin"})})]})}function yt(t){const{cls:a,lang:i,cStudents:s,newScheduleDate:l,setNewScheduleDate:c,newScheduleLessonId:p,setNewScheduleLessonId:w,lessons:$,fetchClassSchedules:S,classSchedulesMap:j,expandedScheduleId:g,setExpandedScheduleId:_,fetchScheduleAttendance:L,scheduleAttendanceMap:x,get30DayAverageWarning:T}=t;return e.jsxs("div",{className:"mb-4 bg-white p-3 rounded-xl border border-slate-100 shadow-xs",children:[e.jsx("div",{className:"flex items-center justify-between mb-3 border-b border-gray-200 pb-2",children:e.jsxs("div",{className:"text-xs font-semibold text-gray-700 flex items-center gap-1",children:[e.jsx(Y,{size:14,className:"text-pink-500"})," Schedule & Attendance"]})}),e.jsxs("div",{className:"mb-3 flex gap-2 items-center",children:[e.jsx("input",{title:"Schedule Date",type:"date",className:"border border-slate-200 hover:border-slate-300 rounded-lg text-xs p-1.5 flex-1 bg-white focus:outline-hidden focus:ring-1 focus:ring-indigo-500 text-gray-750 transition-all font-sans",value:l,onChange:n=>c(n.target.value),onClick:n=>n.stopPropagation()}),e.jsxs("select",{title:"Schedule Lesson",className:"border border-slate-200 hover:border-slate-300 rounded-lg text-xs p-1.5 flex-1 bg-white focus:outline-hidden focus:ring-1 focus:ring-indigo-500 text-gray-750 transition-all font-sans cursor-pointer",value:p,onChange:n=>w(n.target.value),onClick:n=>n.stopPropagation(),children:[e.jsx("option",{value:"",children:"Select Lesson..."}),$.map(n=>e.jsx("option",{value:n.id,children:n.title},n.id))]}),e.jsx("button",{className:"bg-pink-500 hover:bg-pink-600 text-white p-1 px-2 rounded text-xs disabled:opacity-50 flex items-center gap-1",disabled:!l||!p,onClick:async n=>{n.stopPropagation(),(await fetch(`/api/classes/${a.id}/schedules`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({lessonId:p,scheduledDate:l})})).ok&&(c(""),w(""),await S(a.id))},children:"Schedule"})]}),e.jsx("div",{className:"flex flex-col gap-2",children:(j[a.id]||[]).length===0?e.jsx("div",{className:"text-xs text-gray-400 italic",children:"No schedules yet."}):j[a.id].map(n=>{const h=g===n.id,f=x[n.id]||[];return e.jsxs("div",{className:"bg-white border border-slate-100/90 rounded-xl shadow-xs hover:shadow-sm transition-all overflow-hidden mb-2",children:[e.jsx("div",{className:"p-2 flex justify-between items-center cursor-pointer hover:bg-gray-50",onClick:()=>{h?_(null):(_(n.id),L(n.id))},children:e.jsxs("div",{className:"flex items-center gap-2 text-xs",children:[h?e.jsx(ce,{size:14,className:"text-gray-400"}):e.jsx(xe,{size:14,className:"text-gray-400"}),e.jsxs("div",{className:"flex flex-col",children:[e.jsx("span",{className:"font-semibold text-gray-800",children:n.lesson_title}),e.jsxs("span",{className:"text-[10px] text-gray-500 flex items-center gap-1",children:[e.jsx(Y,{size:10})," ",n.scheduled_date]})]})]})}),h&&e.jsxs("div",{className:"border-t border-gray-100 p-2 bg-gray-50/50",children:[e.jsx("div",{className:"text-[10px] font-medium text-gray-500 mb-2 uppercase tracking-wider",children:"Attendance Check-in"}),e.jsxs("div",{className:"grid gap-1",children:[s.map(z=>{const N=f.find(k=>k.student_id===z.id);return e.jsxs("div",{className:"flex items-center justify-between text-xs bg-white p-1 rounded border border-gray-200",children:[e.jsxs("div",{className:"flex items-center gap-1.5 truncate max-w-[150px]",children:[e.jsx("span",{className:"font-medium text-gray-700 truncate",title:z.name,children:z.name}),(()=>{const k=T(z.id,a.id);return k!==null?e.jsxs("span",{className:"inline-flex items-center gap-0.5 bg-red-50 text-red-700 border border-red-200 px-1 py-0.5 rounded text-[9px] font-bold animate-pulse",title:i==="zh"?`30天平均成绩已降至60%以下 (${k}%)`:`30-day average has dropped below 60% (${k}%)`,children:[e.jsx(ke,{size:10,className:"text-red-500"}),k,"%"]}):null})()]}),e.jsx("div",{className:"flex gap-1 shrink-0",children:["present","late","absent"].map(k=>e.jsx("button",{onClick:async M=>{M.stopPropagation(),(await fetch(`/api/schedules/${n.id}/attendance`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({studentId:z.id,status:k})})).ok&&L(n.id)},className:`px-1.5 py-0.5 rounded text-[10px] capitalize border transition-all cursor-pointer ${N?.status===k?k==="present"?"bg-green-50 border-green-200 text-green-700 font-medium":k==="late"?"bg-yellow-50 border-yellow-200 text-yellow-700 font-medium":"bg-red-50 border-red-200 text-red-700 font-medium":"bg-slate-50 border-slate-100/70 text-slate-400 hover:bg-slate-100"}`,children:k},k))})]},z.id)}),s.length===0&&e.jsx("div",{className:"text-[10px] italic text-gray-400",children:"No students to check in."})]})]})]},n.id)})})]})}const _e={zh:[{key:"General",label:"日常备忘",color:"bg-emerald-50 text-emerald-700 border-emerald-250 hover:bg-emerald-100",icon:"Bookmark"},{key:"Academic",label:"学术表现",color:"bg-blue-50 text-blue-700 border-blue-250 hover:bg-blue-100",icon:"GraduationCap"},{key:"Behavioral",label:"行为状态",color:"bg-purple-50 text-purple-700 border-purple-250 hover:bg-purple-100",icon:"Brain"},{key:"SpecialCare",label:"特别关注",color:"bg-rose-50 text-rose-700 border-rose-250 hover:bg-rose-100",icon:"AlertCircle"}],en:[{key:"General",label:"General",color:"bg-emerald-50 text-emerald-700 border-emerald-250 hover:bg-emerald-100",icon:"Bookmark"},{key:"Academic",label:"Academic",color:"bg-blue-50 text-blue-700 border-blue-250 hover:bg-blue-100",icon:"GraduationCap"},{key:"Behavioral",label:"Behavioral",color:"bg-purple-50 text-purple-700 border-purple-250 hover:bg-purple-100",icon:"Brain"},{key:"SpecialCare",label:"Special Care",color:"bg-rose-50 text-rose-700 border-rose-250 hover:bg-rose-100",icon:"AlertCircle"}]},Nt=(t,a=12)=>{switch(t){case"GraduationCap":return e.jsx(rt,{size:a});case"Brain":return e.jsx(at,{size:a});case"AlertCircle":return e.jsx(se,{size:a});default:return e.jsx(st,{size:a})}},Te={zh:[{title:"📋 学术表现观察",content:`<div><strong>【学术表现观察 (Academic Observation)】</strong></div>
|
|
1
|
+
import{j as e,r as A}from"./vendor-react-0Lg0vA-4.js";import{b as ce,a9 as xe,U as ee,B as te,n as we,t as ae,a5 as Y,a2 as ie,o as ze,x as le,aK as Ie,f as re,aa as Oe,e as he,a4 as fe,a8 as Re,w as Z,C as se,ab as We,I as oe,D as ne,W as Ae,aw as Be,ac as Fe,ao as ke,aL as He,L as Qe,aM as Ue,aN as Je,aO as Ve,aP as Ke,aQ as qe,aR as Xe,aS as De,aT as Ye,aU as Ze,aV as et,T as de,aW as tt,i as je,aX as st,aY as at,G as rt,aZ as nt,d as Pe,al as it,X as ve,S as Le,v as lt,aj as ye,ag as Ne}from"./vendor-icons-Dq6MhgH9.js";import{a as me,A as ot,C as Se,X as ge,Y as ue,T as be,b as $e,d as dt,L as ct,c as xt,B as Ee,e as Me}from"./vendor-charts-CRXa4AlU.js";import{A as ht,m as pe}from"./index-Cwf8LQbY.js";import"./vendor-utils-BEhuP0Zq.js";import"./vendor-pdf-Cp-cYteE.js";import"./vendor-motion-DjY2czvL.js";import"./vendor-pptx-B_NheIKl.js";function mt({cls:t,lang:a,isExpanded:i,batchMode:s,selectedClassIds:l,setExpandedClassId:c,setSelectedStudentIds:p,toggleClassSelection:w,fetchClassStudents:$,fetchClassProgress:S,fetchClassDashboard:j,fetchClassSchedules:g}){const _=()=>{c(t.id),p(new Set),$(t.id),S(t.id),j(t.id),g(t.id)};return e.jsxs("div",{className:`p-2 flex items-center justify-between ${s?"cursor-pointer hover:bg-amber-50/60":"cursor-pointer hover:bg-gray-50"}`,onClick:()=>{if(s){w(t.id);return}i?c(null):_()},children:[e.jsxs("div",{className:"flex items-center gap-2",children:[s&&e.jsx("input",{type:"checkbox",className:"shrink-0 accent-amber-500",checked:l.has(t.id),onChange:()=>w(t.id),onClick:L=>L.stopPropagation()}),e.jsx("button",{type:"button",onClick:L=>{L.stopPropagation(),i?c(null):_()},className:"text-gray-400 hover:text-gray-600 shrink-0",children:i?e.jsx(ce,{size:14}):e.jsx(xe,{size:14})}),e.jsx("div",{className:`text-sm font-medium ${s&&l.has(t.id)?"text-amber-700":"text-gray-800"}`,children:t.name})]}),e.jsxs("div",{className:"flex items-center gap-3 text-[11px] text-gray-500 shrink-0",children:[e.jsxs("span",{className:"flex items-center gap-1",title:a==="zh"?"学生人数":"Students",children:[e.jsx(ee,{size:13,className:"text-gray-400"}),t.student_count??0]}),e.jsxs("span",{className:"flex items-center gap-1",title:a==="zh"?"课程数量":"Courses",children:[e.jsx(te,{size:13,className:"text-gray-400"}),t.course_count??0]}),e.jsxs("span",{className:"flex items-center gap-1",title:a==="zh"?"作业数量":"Assignments",children:[e.jsx(we,{size:13,className:"text-gray-400"}),t.assignment_count??0]})]})]})}function gt({cls:t,lang:a,fetchClasses:i}){return e.jsxs("div",{className:"mb-4 bg-gradient-to-r from-indigo-50/70 to-violet-50/70 p-3.5 rounded-2xl border border-indigo-150/40 shadow-xs flex flex-col sm:flex-row sm:items-center justify-between gap-3 font-sans text-left",onClick:s=>s.stopPropagation(),children:[e.jsxs("div",{className:"space-y-1 text-left",children:[e.jsxs("div",{className:"flex items-center gap-1.5 justify-start",children:[e.jsx("span",{className:"inline-block w-2 h-2 rounded-full bg-indigo-500 animate-pulse shrink-0"}),e.jsx("span",{className:"text-xs font-black text-indigo-950 uppercase tracking-wider",children:a==="zh"?"临时班级密码 (支持学生快速一键密码登录)":"Temporary Class Passcode"})]}),e.jsx("p",{className:"text-[10px] text-indigo-600/80 font-semibold leading-relaxed text-left block",children:a==="zh"?"开始课堂后,全班学生均可使用此特定临时密码统一安全登录,无需强制输入个人自设密码。":"Once set, any pupil in this class can use this temporary passcode to log in directly."})]}),e.jsxs("div",{className:"flex items-center gap-1.5 shrink-0 justify-end",children:[e.jsx("input",{id:`class-passcode-${t.id}`,type:"text",value:t.class_passcode||"",onChange:async s=>{const l=s.target.value;await fetch(`/api/classes/${t.id}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({class_passcode:l})}),await i()},placeholder:a==="zh"?"暂未设定 / 留空禁用":"Disabled / Enter code",className:"border border-indigo-200/80 rounded-xl text-xs px-2.5 py-1.5 w-36 text-center bg-white focus:outline-none focus:ring-2 focus:ring-indigo-500 font-mono font-bold text-gray-800 focus:border-transparent transition-all",onClick:s=>s.stopPropagation()}),e.jsx("button",{onClick:async s=>{s.stopPropagation();const l=Math.floor(1e3+Math.random()*9e3).toString();await fetch(`/api/classes/${t.id}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({class_passcode:l})}),await i()},className:"bg-indigo-600 hover:bg-indigo-700 text-white rounded-xl text-[10px] p-2 py-1.5 font-black shadow-xs transition-all hover:shadow-sm cursor-pointer shrink-0",title:a==="zh"?"随机生成班级密码":"Generate random passcode",children:a==="zh"?"随机生成":"Random Gen"}),t.class_passcode&&e.jsx("button",{onClick:async s=>{s.stopPropagation(),await fetch(`/api/classes/${t.id}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({class_passcode:null})}),await i()},className:"bg-slate-200 hover:bg-slate-300 text-slate-700 rounded-xl text-[10px] p-2 py-1.5 font-bold shadow-xs transition-colors cursor-pointer shrink-0",title:a==="zh"?"清除临时密码":"Clear temporary passcode",children:a==="zh"?"清除":"Clear"})]})]})}function ut({cls:t,lang:a,classActiveTabs:i,setClassActiveTabs:s}){return e.jsxs("div",{className:"flex items-center gap-1 bg-slate-100 p-1 rounded-xl mb-4 max-w-md border border-slate-200/40",onClick:l=>l.stopPropagation(),children:[e.jsxs("button",{onClick:l=>{l.stopPropagation(),s(c=>({...c,[t.id]:"students"}))},className:`flex-1 py-1.5 px-3 rounded-lg text-xs font-semibold flex items-center justify-center gap-1.5 transition-all duration-200 cursor-pointer ${(i[t.id]||"students")==="students"?"bg-white text-indigo-600 shadow-xs font-bold border border-slate-200/50":"text-slate-500 hover:text-slate-800 hover:bg-white/40"}`,children:[e.jsx(ee,{size:12}),e.jsx("span",{children:a==="zh"?"学生名单":"Students"})]}),e.jsxs("button",{onClick:l=>{l.stopPropagation(),s(c=>({...c,[t.id]:"assignments"}))},className:`flex-1 py-1.5 px-3 rounded-lg text-xs font-semibold flex items-center justify-center gap-1.5 transition-all duration-200 cursor-pointer ${(i[t.id]||"students")==="assignments"?"bg-white text-indigo-600 shadow-xs font-bold border border-slate-200/50":"text-slate-500 hover:text-slate-800 hover:bg-white/40"}`,children:[e.jsx(ae,{size:12}),e.jsx("span",{children:a==="zh"?"作业成绩":"Assignments"})]}),e.jsxs("button",{onClick:l=>{l.stopPropagation(),s(c=>({...c,[t.id]:"schedules"}))},className:`flex-1 py-1.5 px-3 rounded-lg text-xs font-semibold flex items-center justify-center gap-1.5 transition-all duration-200 cursor-pointer ${(i[t.id]||"students")==="schedules"?"bg-white text-indigo-600 shadow-xs font-bold border border-slate-200/50":"text-slate-500 hover:text-slate-800 hover:bg-white/40"}`,children:[e.jsx(Y,{size:12}),e.jsx("span",{children:a==="zh"?"课表考勤":"Attendance"})]}),e.jsxs("button",{onClick:l=>{l.stopPropagation(),s(c=>({...c,[t.id]:"grades"}))},className:`flex-1 py-1.5 px-3 rounded-lg text-xs font-semibold flex items-center justify-center gap-1.5 transition-all duration-200 cursor-pointer ${(i[t.id]||"students")==="grades"?"bg-white text-indigo-600 shadow-xs font-bold border border-slate-200/50":"text-slate-500 hover:text-slate-800 hover:bg-white/40"}`,children:[e.jsx(we,{size:12}),e.jsx("span",{children:a==="zh"?"学期总评":"Grades"})]})]})}function bt({schedules:t=[],progress:a=[],lang:i="en"}){const s=A.useMemo(()=>!t||t.length===0?[]:[...t].sort((p,w)=>new Date(p.scheduled_date).getTime()-new Date(w.scheduled_date).getTime()).map((p,w)=>{const $=a.find(_=>_.lesson_id===p.lesson_id),S=$?Math.round($.average_progress):0,j=new Date(p.scheduled_date),g=isNaN(j.getTime())?p.scheduled_date:j.toLocaleDateString(i==="zh"?"zh-CN":"en-US",{month:"short",day:"numeric"});return{id:p.id,index:w+1,lessonId:p.lesson_id,lessonTitle:p.lesson_title||p.title||`Lesson ${w+1}`,scheduledDate:p.scheduled_date,dateLabel:g,progress:S}}),[t,a,i]),l=A.useMemo(()=>{if(s.length===0)return{avgProg:0,completedCount:0,pendingCount:0,activeCount:0};const p=s.reduce((g,_)=>g+_.progress,0),w=Math.round(p/s.length),$=s.filter(g=>g.progress>=90).length,S=s.filter(g=>g.progress>0&&g.progress<90).length,j=s.filter(g=>g.progress===0).length;return{avgProg:w,completedCount:$,pendingCount:j,activeCount:S}},[s]),c={title:i==="zh"?"学期排课进度看板":"Scheduled Lessons Progress",subtitle:i==="zh"?"班级在全学期已规划课程中的平均学习进度曲线":"Class average completion progress across the semester's scheduled lessons",averageProgress:i==="zh"?"平均课程总进度":"Average Class Progress",completedLessons:i==="zh"?"已通关课程":"Completed Lessons",activeLessons:i==="zh"?"进行中课程":"Lessons In-Progress",pendingLessons:i==="zh"?"未开始课程":"Not Started",timeline:i==="zh"?"排课进度时间轴":"Lesson Progress Timeline",over90:i==="zh"?"通关基准线 (90%)":"Completion Benchmark (90%)",averageLine:i==="zh"?"平均进度线":"Class Average Line",emptyTitle:i==="zh"?"暂无排课进度":"No Scheduled Progress Data",emptyDesc:i==="zh"?"该班级尚未规划任何课程。请在下方【日程安排与考勤】中指派具体的微课及日期,随后此处的实时进度图表便会随学生学习进程同步渲染。":'No schedules have been defined for this class yet. Assign lessons under the "Schedule & Attendance" panel below to begin visualizing your student group progress trajectory.',detailsLabel:i==="zh"?"第 {idx} 节课: {title}":"Session #{idx}: {title}"};return t.length===0?e.jsx("div",{className:"bg-white border border-gray-150 rounded-xl p-6 shadow-sm font-sans",children:e.jsxs("div",{className:"max-w-md mx-auto text-center py-6",children:[e.jsx("div",{className:"inline-flex p-3 bg-pink-50 text-pink-600 rounded-full mb-3",children:e.jsx(ae,{className:"w-6 h-6 animate-pulse"})}),e.jsx("h4",{className:"font-bold text-gray-800 text-sm",children:c.emptyTitle}),e.jsx("p",{className:"text-gray-500 text-[11px] mt-2 leading-relaxed",children:c.emptyDesc})]})}):e.jsxs("div",{className:"bg-white border border-gray-150 rounded-xl shadow-xs overflow-hidden flex flex-col font-sans",id:"scheduled-lessons-progress-container",children:[e.jsx("div",{className:"p-4 border-b border-gray-100 bg-gray-50/50 flex flex-col sm:flex-row sm:items-center justify-between gap-3",children:e.jsxs("div",{className:"flex items-start gap-2.5",children:[e.jsx("div",{className:"p-2 bg-pink-50 text-pink-600 rounded-lg shrink-0",children:e.jsx(ie,{size:16})}),e.jsxs("div",{children:[e.jsxs("h4",{className:"font-bold text-gray-800 text-sm flex items-center gap-1.5 flex-wrap",children:[e.jsx("span",{children:c.title}),e.jsxs("span",{className:"inline-flex items-center gap-1 bg-pink-50 text-pink-700 border border-pink-100 rounded-full px-2 py-0.5 text-[9px] font-bold",children:[e.jsx("span",{className:"w-1 h-1 rounded-full bg-pink-500 animate-ping"}),i==="zh"?"实时同步":"Live Sync"]})]}),e.jsx("p",{className:"text-gray-400 text-[10px] mt-0.5 leading-relaxed",children:c.subtitle})]})]})}),e.jsxs("div",{className:"px-4 py-3 border-b border-gray-100 bg-white grid grid-cols-2 sm:grid-cols-4 gap-2.5",children:[e.jsxs("div",{className:"bg-pink-50/20 border border-pink-100/40 p-2.5 rounded-lg flex items-center gap-2",children:[e.jsx("div",{className:"p-2 bg-pink-50 text-pink-600 rounded-md shrink-0",children:e.jsx(ae,{size:14})}),e.jsxs("div",{className:"min-w-0",children:[e.jsx("div",{className:"text-[9px] font-bold text-gray-400 uppercase tracking-wider truncate",children:c.averageProgress}),e.jsxs("div",{className:"text-xs font-bold text-gray-800 font-mono mt-0.5",children:[l.avgProg,"%"]})]})]}),e.jsxs("div",{className:"bg-emerald-50/20 border border-emerald-100/40 p-2.5 rounded-lg flex items-center gap-2",children:[e.jsx("div",{className:"p-2 bg-emerald-50 text-emerald-600 rounded-md shrink-0",children:e.jsx(ze,{size:14})}),e.jsxs("div",{className:"min-w-0",children:[e.jsx("div",{className:"text-[9px] font-bold text-gray-400 uppercase tracking-wider truncate",children:c.completedLessons}),e.jsxs("div",{className:"text-xs font-bold text-gray-800 font-mono mt-0.5",children:[l.completedCount," / ",s.length]})]})]}),e.jsxs("div",{className:"bg-yellow-50/20 border border-yellow-100/30 p-2.5 rounded-lg flex items-center gap-2",children:[e.jsx("div",{className:"p-2 bg-yellow-50 text-yellow-600 rounded-md shrink-0",children:e.jsx(le,{size:14})}),e.jsxs("div",{className:"min-w-0",children:[e.jsx("div",{className:"text-[9px] font-bold text-gray-400 uppercase tracking-wider truncate",children:c.activeLessons}),e.jsx("div",{className:"text-xs font-bold text-gray-800 font-mono mt-0.5",children:l.activeCount})]})]}),e.jsxs("div",{className:"bg-slate-50/30 border border-slate-100/60 p-2.5 rounded-lg flex items-center gap-2",children:[e.jsx("div",{className:"p-2 bg-slate-50 text-slate-500 rounded-md shrink-0",children:e.jsx(te,{size:14})}),e.jsxs("div",{className:"min-w-0",children:[e.jsx("div",{className:"text-[9px] font-bold text-gray-400 uppercase tracking-wider truncate",children:c.pendingLessons}),e.jsx("div",{className:"text-xs font-bold text-gray-800 font-mono mt-0.5",children:l.pendingCount})]})]})]}),e.jsxs("div",{className:"p-4 space-y-4",children:[e.jsxs("div",{className:"text-[10px] font-bold text-pink-900 flex items-center gap-1",children:[e.jsx(Y,{size:11,className:"text-pink-500"}),e.jsx("span",{children:c.timeline})]}),e.jsx("div",{className:"h-44 w-full bg-slate-50/30 border border-slate-100 p-2 rounded-lg relative",children:e.jsx(me,{width:"100%",height:"100%",children:e.jsxs(ot,{data:s,margin:{top:10,right:10,left:-24,bottom:0},children:[e.jsx("defs",{children:e.jsxs("linearGradient",{id:"progressGrad",x1:"0",y1:"0",x2:"0",y2:"1",children:[e.jsx("stop",{offset:"5%",stopColor:"#ec4899",stopOpacity:.25}),e.jsx("stop",{offset:"95%",stopColor:"#ec4899",stopOpacity:0})]})}),e.jsx(Se,{strokeDasharray:"3 3",vertical:!1,stroke:"#f1f5f9"}),e.jsx(ge,{dataKey:"dateLabel",tick:{fontSize:8,fill:"#64748b",fontWeight:"bold"},axisLine:{stroke:"#e2e8f0"},tickLine:!1}),e.jsx(ue,{domain:[0,100],tick:{fontSize:8,fill:"#64748b",fontWeight:"bold"},axisLine:{stroke:"#e2e8f0"},tickLine:!1}),e.jsx(be,{content:({active:p,payload:w})=>{if(p&&w&&w.length){const $=w[0].payload;return e.jsxs("div",{className:"p-2.5 bg-white border border-pink-100 rounded-lg shadow-md max-w-[220px]",children:[e.jsxs("div",{className:"flex items-center justify-between gap-2 border-b border-gray-100 pb-1.5 mb-1.5",children:[e.jsx("span",{className:"text-[8px] text-gray-400 font-bold font-mono",children:$.scheduledDate}),e.jsxs("span",{className:"inline-flex items-center bg-pink-50 text-pink-700 px-1.5 py-0.5 rounded-full text-[9px] font-extrabold font-mono border border-pink-100",children:[$.progress,"%"]})]}),e.jsx("p",{className:"text-[10px] font-bold text-gray-800 leading-tight",children:c.detailsLabel.replace("{idx}",$.index).replace("{title}",$.lessonTitle)})]})}return null}}),e.jsx($e,{y:90,stroke:"#10b981",strokeWidth:1,strokeDasharray:"3 3",label:{value:c.over90,fill:"#10b981",fontSize:7,fontWeight:"bold",position:"top",offset:2}}),e.jsx($e,{y:l.avgProg,stroke:"#ec4899",strokeWidth:1,strokeDasharray:"2 2",label:{value:`${c.averageLine} (${l.avgProg}%)`,fill:"#ec4899",fontSize:7,fontWeight:"semibold",position:"bottom",offset:2}}),e.jsx(dt,{type:"monotone",dataKey:"progress",stroke:"#ec4899",strokeWidth:2,fillOpacity:1,fill:"url(#progressGrad)",dot:{r:3,stroke:"#ffffff",strokeWidth:1.5,fill:"#ec4899"},activeDot:{r:5,stroke:"#ffffff",strokeWidth:1.5,fill:"#f43f5e"}})]})})})]})]})}function pt({students:t=[],assignments:a=[],performance:i=[],lang:s="en"}){const[l,c]=A.useState(()=>t.length>=2?[t[0].id,t[1].id]:t.map(x=>x.id)),[p,w]=A.useState("running_average"),$=["#6366f1","#f43f5e","#10b981","#0ea5e9","#f59e0b","#8b5cf6","#ec4899","#14b8a6"],{chartData:S,comparedStudentSummary:j,chronologicalAssignments:g}=A.useMemo(()=>{const x=[...a].sort((N,k)=>(N.created_at||0)-(k.created_at||0)),T=t.filter(N=>l.includes(N.id)),n={},h={};T.forEach(N=>{n[N.id]=0,h[N.id]=0});const f=x.map((N,k)=>{const M={name:N.title.replace("MCQ Evaluation: ","").replace("评估: ",""),fullName:N.title,index:k+1};return T.forEach(D=>{const J=i.find(u=>u.student_id===D.id&&u.assignment_id===N.id&&u.submission_status==="graded"&&typeof u.score=="number"&&u.score!==null);if(J&&J.score!==null){const u=Number(J.score);n[D.id]+=u,h[D.id]+=1;const C=Math.round(n[D.id]/h[D.id]*10)/10;M[`raw_${D.id}`]=u,M[`avg_${D.id}`]=C}else M[`raw_${D.id}`]=null,M[`avg_${D.id}`]=h[D.id]>0?Math.round(n[D.id]/h[D.id]*10)/10:null}),M}),z=T.map((N,k)=>{const M=x.map(I=>i.find(P=>P.student_id===N.id&&P.assignment_id===I.id&&P.submission_status==="graded"&&typeof P.score=="number"&&P.score!==null)).filter(I=>I&&I.score!==null).map(I=>Number(I.score)),D=M.length,J=D>0?M[0]:0,u=D>0?M[D-1]:0,C=f.map(I=>I[`avg_${N.id}`]).filter(I=>typeof I=="number"&&I!==null),R=C.length>0?C[0]:0,E=C.length>0?C[C.length-1]:0,U=Math.round((E-R)*10)/10,q=D>0?Math.max(...M):0;return{id:N.id,name:N.name,color:$[k%$.length],totalItems:D,startingScore:J,currentScore:u,startingAvg:R,finalAvg:E,netGrowth:U,peak:q}});return{chartData:f.filter(N=>T.some(k=>N[`avg_${k.id}`]!==null||N[`raw_${k.id}`]!==null)),comparedStudentSummary:z,chronologicalAssignments:x}},[t,a,i,l]),_=x=>{c(T=>T.includes(x)?T.filter(n=>n!==x):[...T,x])},L={panelTitle:s==="zh"?"多生学力成长对比透视":"Student Performance & Growth Comparison",panelSub:s==="zh"?"选择多位学生,跨作业维度水平比对单次得分或累积移动平均线,分析班级成长差值":"Select two or more pupils to synthesize comparative academic curves over coursework timelines",metricSelect:s==="zh"?"对比数据:":"Metric:",noStudentsMsg:s==="zh"?"请选择至少两位学生以生成比对坐标系":"Please select at least two students to visualize academic trends",metricsTableTitle:s==="zh"?"学术轨迹成长对比数据":"Trajectory Growth Metrics Summary",tableNet:s==="zh"?"成长趋势净值":"Net Growth Trend",insufficientData:s==="zh"?"当前班级数据不满足比对条件。请录入多名学生及作业评分后再作比对。":"Insufficient dataset. Please enroll multiple student evaluations to configure comparing nodes."};return t.length===0||a.length===0?e.jsxs("div",{className:"bg-white border border-gray-200 rounded-xl p-6 text-center shadow-xs font-sans",children:[e.jsx(Ie,{className:"w-8 h-8 text-indigo-500 mx-auto mb-2 animate-bounce"}),e.jsx("p",{className:"text-gray-550 text-xs font-medium leading-relaxed",children:L.insufficientData})]}):e.jsxs("div",{className:"bg-white border border-gray-200 rounded-2xl shadow-xs overflow-hidden flex flex-col font-sans mt-2 mb-6",id:"student-growth-compare-card",children:[e.jsxs("div",{className:"p-4 border-b border-gray-100 bg-linear-to-r from-indigo-50/10 via-white to-sky-50/10 flex flex-col gap-2",children:[e.jsxs("div",{className:"flex items-start gap-2.5",children:[e.jsx("div",{className:"p-2 bg-indigo-50 text-indigo-600 rounded-xl mt-0.5",children:e.jsx(ee,{size:18,className:"stroke-[2.5]"})}),e.jsxs("div",{children:[e.jsxs("h4",{className:"font-extrabold text-gray-900 text-sm flex items-center gap-1.5 flex-wrap",children:[e.jsx("span",{children:L.panelTitle}),e.jsxs("span",{className:"inline-flex items-center gap-0.5 bg-indigo-100 text-indigo-800 border border-indigo-200/50 rounded-full px-2 py-0.5 text-[9px] font-black uppercase",children:[e.jsx(re,{size:8,className:"animate-spin text-indigo-600"}),s==="zh"?"多维透视":"Cohort Analytics"]})]}),e.jsx("p",{className:"text-gray-500 text-[11px] mt-0.5 leading-relaxed",children:L.panelSub})]})]}),e.jsxs("div",{className:"flex flex-col sm:flex-row sm:items-center justify-between gap-3 mt-2 border-t border-gray-100/60 pt-3",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("span",{className:"text-[10px] font-extrabold text-gray-400 uppercase tracking-wider",children:L.metricSelect}),e.jsxs("div",{className:"inline-flex bg-gray-100 p-0.5 rounded-lg border border-gray-200/55 shadow-3xs select-none",children:[e.jsxs("button",{type:"button",onClick:()=>w("running_average"),className:`px-3 py-1 text-[10px] font-bold rounded-md transition-all cursor-pointer flex items-center gap-1 ${p==="running_average"?"bg-white text-indigo-700 shadow-xs border-indigo-50 font-extrabold":"text-gray-500 hover:text-gray-800"}`,children:[e.jsx(ie,{size:11}),e.jsx("span",{children:s==="zh"?"累积成长轨迹":"Running Trajectory"})]}),e.jsxs("button",{type:"button",onClick:()=>w("raw_score"),className:`px-3 py-1 text-[10px] font-bold rounded-md transition-all cursor-pointer flex items-center gap-1 ${p==="raw_score"?"bg-white text-indigo-700 shadow-xs border-indigo-50 font-extrabold":"text-gray-500 hover:text-gray-800"}`,children:[e.jsx(Oe,{size:11}),e.jsx("span",{children:s==="zh"?"单次作业得分":"Syllabus Scores"})]})]})]}),e.jsx("div",{className:"text-[10px] text-indigo-600/75 italic bg-indigo-50/50 px-2 py-1 rounded-md border border-indigo-100/30",children:p==="running_average"?s==="zh"?"💡 呈现从第一次作业后开始的平均学力,能更好地平滑单次测验失常":"💡 Cumulative average line provides an overview of consistency while eliminating single test noise":s==="zh"?"💡 呈现每次作业的评估分数波动,能捕捉近期的突破和退步":"💡 Raw scores show performance on individual assignments, highlighting highlights and deviations"})]})]}),e.jsxs("div",{className:"p-4 grid grid-cols-1 lg:grid-cols-4 gap-5",children:[e.jsxs("div",{className:"lg:col-span-1 bg-slate-50/50 rounded-xl border border-slate-150 p-3 flex flex-col justify-between max-h-[340px] overflow-hidden",children:[e.jsxs("div",{className:"flex flex-col h-full",children:[e.jsx("span",{className:"text-[10px] font-black uppercase text-slate-400 tracking-wider mb-2 block select-none",children:s==="zh"?"参比学生选单":"Active Pupil List"}),e.jsx("div",{className:"flex-1 overflow-y-auto space-y-1.5 pr-0.5",id:"enrolled-pupils-compare-checklist",children:t.map((x,T)=>{const n=l.includes(x.id),h=$[T%$.length];return e.jsx("button",{type:"button",onClick:()=>_(x.id),className:`w-full flex items-center justify-between text-left p-2 rounded-xl border transition-all text-xs cursor-pointer select-none ${n?"bg-white border-gray-200/80 shadow-3xs font-bold ring-1 ring-slate-100/50":"bg-transparent border-transparent text-gray-500 hover:bg-slate-100/60"}`,children:e.jsxs("div",{className:"flex items-center gap-2 truncate pr-2",children:[e.jsx("div",{className:"w-5 h-5 rounded-full flex items-center justify-center border text-[9px] text-white shrink-0 font-extrabold",style:{backgroundColor:n?h:"#e2e8f0",borderColor:n?h:"#cbd5e1"},children:n?e.jsx(he,{size:11,className:"stroke-[3]"}):x.name.charAt(0)}),e.jsxs("div",{className:"truncate",children:[e.jsx("div",{className:"truncate font-bold text-gray-800 text-[11.5px]",children:x.name}),x.email&&e.jsx("div",{className:"text-[8.5px] text-gray-400 truncate",children:x.email})]})]})},x.id)})})]}),e.jsxs("div",{className:"mt-3 pt-2.5 border-t border-slate-200/70 text-[9.5px] text-slate-400 leading-normal flex items-center gap-1",children:[e.jsx(ae,{size:12,className:"text-indigo-400"}),e.jsx("span",{children:s==="zh"?"勾选即可实时载入/移除比对":"Toggle checkboxes to real-time update"})]})]}),e.jsx("div",{className:"lg:col-span-3 flex flex-col justify-between",id:"compare-canvas-holder",children:l.length<2?e.jsx("div",{className:"h-[250px] flex items-center justify-center border border-dashed border-gray-200 bg-gray-50/50 rounded-xl p-6",children:e.jsxs("div",{className:"max-w-xs text-center",children:[e.jsx(ee,{size:24,className:"text-indigo-300 mx-auto mb-2 animate-bounce"}),e.jsx("p",{className:"text-gray-500 text-xs font-semibold leading-relaxed",children:L.noStudentsMsg})]})}):e.jsx("div",{className:"h-[250px] w-full relative bg-slate-50/15 border border-slate-100 p-2.5 rounded-2xl shadow-3xs",children:e.jsx(me,{width:"100%",height:"100%",children:e.jsxs(ct,{data:S,margin:{top:15,right:15,left:-22,bottom:5},children:[e.jsx(Se,{strokeDasharray:"3 3",stroke:"#f1f5f9",vertical:!1}),e.jsx(ge,{dataKey:"name",tick:{fontSize:9,fill:"#64748b",fontWeight:"bold"},axisLine:{stroke:"#e2e8f0"},tickLine:!1}),e.jsx(ue,{domain:[0,100],tick:{fontSize:9,fill:"#64748b",fontWeight:"bold"},axisLine:{stroke:"#e2e8f0"},tickLine:!1}),e.jsx(be,{content:({active:x,payload:T,label:n})=>x&&T&&T.length?e.jsxs("div",{className:"p-3 bg-white/95 border border-gray-150 rounded-xl shadow-xl max-w-[280px] font-sans text-xs",children:[e.jsxs("div",{className:"font-extrabold text-slate-800 leading-tight mb-2 border-b border-gray-100 pb-1.5 flex items-center justify-between",children:[e.jsx("span",{className:"truncate max-w-[180px]",children:n}),e.jsx("span",{className:"text-[8px] bg-slate-100 text-slate-500 px-1.5 py-0.5 rounded font-bold uppercase shrink-0",children:"Evaluated Item"})]}),e.jsx("div",{className:"space-y-1.5",children:T.map(h=>{const f=h.dataKey.split("_")[1],z=t.find(N=>N.id===f);return z?e.jsxs("div",{className:"flex items-center justify-between gap-4 font-sans text-[11px]",children:[e.jsxs("div",{className:"flex items-center gap-1.5 min-w-0",children:[e.jsx("span",{className:"w-1.5 h-1.5 rounded-full shrink-0",style:{backgroundColor:h.stroke}}),e.jsx("span",{className:"font-semibold text-gray-700 truncate",children:z.name})]}),e.jsxs("span",{className:"font-black font-mono",style:{color:h.stroke},children:[h.value,"%"]})]},h.dataKey):null})})]}):null}),j.map(x=>{const T=p==="running_average"?`avg_${x.id}`:`raw_${x.id}`;return e.jsx(xt,{type:"monotone",name:x.name,dataKey:T,stroke:x.color,strokeWidth:p==="running_average"?3.5:2.5,dot:{r:3,stroke:"#ffffff",strokeWidth:1.5,fill:x.color},activeDot:{r:5,stroke:"#ffffff",strokeWidth:2,fill:x.color},animationDuration:1e3,connectNulls:!0},x.id)})]})})})})]}),l.length>=2&&j.length>0&&e.jsxs("div",{className:"px-4 pb-4 border-t border-gray-100 pt-3",children:[e.jsxs("div",{className:"text-[10px] font-black uppercase text-slate-400 tracking-wider mb-2.5 select-none flex items-center gap-1",children:[e.jsx(fe,{size:12,className:"text-indigo-500"}),e.jsx("span",{children:L.metricsTableTitle})]}),e.jsx("div",{className:"grid grid-cols-1 sm:grid-cols-2 md:grid-cols-4 gap-3",children:j.map(x=>{const T=x.netGrowth>1,n=x.netGrowth<-1;return e.jsxs("div",{className:"p-3 bg-slate-50/50 border border-slate-100 rounded-xl flex flex-col justify-between",style:{borderLeft:`3px solid ${x.color}`},children:[e.jsxs("div",{className:"flex justify-between items-start gap-1",children:[e.jsx("span",{className:"text-xs font-extrabold text-slate-800 truncate",title:x.name,children:x.name}),e.jsxs("span",{className:"text-[9px] text-gray-400 font-mono font-bold",children:[x.totalItems," ",s==="zh"?"个样本":"graded"]})]}),e.jsxs("div",{className:"grid grid-cols-2 gap-2 mt-2 pt-2 border-t border-slate-100/60 select-none",children:[e.jsxs("div",{children:[e.jsx("span",{className:"text-[8px] text-gray-400 uppercase font-black",children:s==="zh"?"基础/当前均分":"Base/Live Avg"}),e.jsxs("div",{className:"text-[11px] font-bold font-mono text-slate-700 mt-0.5",children:[x.startingAvg,"% → ",x.finalAvg,"%"]})]}),e.jsxs("div",{className:"text-right",children:[e.jsx("span",{className:"text-[8px] text-gray-400 uppercase font-black",children:L.tableNet}),e.jsxs("div",{className:"flex items-center justify-end gap-0.5 mt-0.5",children:[e.jsxs("span",{className:`text-[11px] font-black font-mono ${T?"text-emerald-600":n?"text-red-500":"text-slate-600"}`,children:[x.netGrowth>0?`+${x.netGrowth}`:x.netGrowth,"%"]}),T&&e.jsx(ie,{size:11,className:"text-emerald-500 shrink-0"}),n&&e.jsx(Re,{size:11,className:"text-red-400 shrink-0"})]})]})]}),e.jsxs("div",{className:"mt-2 text-[9px] bg-white p-1 rounded border border-slate-150 flex items-center justify-between font-mono select-none",children:[e.jsx("span",{className:"text-gray-400 font-bold",children:s==="zh"?"评估最值":"Peak Score"}),e.jsxs("span",{className:"font-extrabold text-indigo-700",children:[x.peak,"%"]})]})]},x.id)})})]})]})}function ft({classId:t,lang:a="en"}){const[i,s]=A.useState([]),[l,c]=A.useState(!0),[p,w]=A.useState(null),[$,S]=A.useState("heatmap"),[j,g]=A.useState(null),_=A.useMemo(()=>i.length===0?null:[...i].sort((n,h)=>n.attendanceRate-h.attendanceRate)[0],[i]),L=A.useMemo(()=>{const n=new Date,h=new Date;h.setDate(n.getDate()-34);const f=h.getDay(),z=f===0?6:f-1;h.setDate(h.getDate()-z);const N=[],k=new Date(h),M=new Date(n),D=M.getDay(),J=D===0?0:7-D;for(M.setDate(M.getDate()+J);k<=M;){const u=k.toISOString().split("T")[0],C=i.find(R=>R.date===u);N.push({dateStr:u,dayOfMonth:k.getDate(),monthName:k.toLocaleDateString(a==="zh"?"zh-CN":"en-US",{month:"short"}),isToday:u===n.toISOString().split("T")[0],isFuture:k>n,dayOfWeek:k.getDay(),match:C}),k.setDate(k.getDate()+1)}return N},[i,a]);A.useEffect(()=>{if(i&&i.length>0&&L&&L.length>0){const n=[...i].sort((h,f)=>h.attendanceRate-f.attendanceRate)[0];if(n){const h=L.find(f=>f.dateStr===n.date);h&&g(h)}}},[i,L]),A.useEffect(()=>{let n=!0;return(async()=>{c(!0),w(null);try{const f=await fetch(`/api/classes/${t}/attendance-summary`);if(!f.ok)throw new Error(`Error: ${f.status} ${f.statusText}`);const z=await f.json();n&&s(z)}catch(f){n&&w(f.message||"Failed to loaded attendance summary")}finally{n&&c(!1)}})(),()=>{n=!1}},[t]);const x=A.useMemo(()=>{if(i.length===0)return{avgRate:0,totalPresent:0,totalLate:0,totalAbsent:0,totalSchedules:0};let n=0,h=0,f=0,z=0;return i.forEach(N=>{n+=N.attendanceRate,h+=N.present,f+=N.late,z+=N.absent}),{avgRate:Math.round(n/i.length),totalPresent:h,totalLate:f,totalAbsent:z,totalSchedules:i.length}},[i]);if(l)return e.jsxs("div",{className:"bg-white border border-gray-100 rounded-xl p-6 shadow-sm flex flex-col items-center justify-center min-h-[220px]",children:[e.jsx(Z,{className:"animate-spin text-indigo-500 mb-2",size:24}),e.jsx("span",{className:"text-xs text-gray-400 font-sans",children:a==="zh"?"正在加载出勤分析数据...":"Loading attendance analytics..."})]});if(p)return e.jsxs("div",{className:"bg-white border border-red-100 rounded-xl p-6 shadow-sm flex flex-col items-center justify-center min-h-[220px]",children:[e.jsx(se,{className:"text-red-500 mb-2",size:24}),e.jsx("span",{className:"text-xs text-red-600 font-sans text-center",children:a==="zh"?`无法加载出勤分析: ${p}`:`Failed to load attendance analysis: ${p}`})]});if(i.length===0)return e.jsxs("div",{className:"bg-white border border-gray-100 rounded-xl p-6 shadow-sm flex flex-col items-center justify-center min-h-[220px] select-none text-center",children:[e.jsx(Y,{className:"text-gray-300 mb-2",size:28}),e.jsx("span",{className:"text-xs font-semibold text-gray-500 font-sans block mb-1",children:a==="zh"?"近30天内没有出勤记录":"No Attendance Records in Last 30 Days"}),e.jsx("span",{className:"text-[10px] text-gray-400 max-w-sm",children:a==="zh"?"在新日程安排中为学生记录出勤后,统计数据将自动在此处生成。":"Attendance stats will generate automatically once you schedule lessons and register student statuses."})]});const T=i.map(n=>{try{const h=new Date(n.date);if(isNaN(h.getTime()))return{...n,displayDate:n.date};const f=h.getDate(),z=h.toLocaleDateString(a==="zh"?"zh-CN":"en-US",{month:"short"});return{...n,displayDate:a==="zh"?`${z}${f}日`:`${z} ${f}`}}catch{return{...n,displayDate:n.date}}});return e.jsxs("div",{className:"bg-white border border-gray-100 rounded-xl p-4 shadow-sm flex flex-col gap-4 font-sans",children:[e.jsxs("div",{className:"flex flex-col md:flex-row md:items-center justify-between gap-3 border-b border-gray-100 pb-3",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("div",{className:"p-2 bg-indigo-50 text-indigo-600 rounded-lg",children:e.jsx(ze,{size:16})}),e.jsxs("div",{children:[e.jsx("h4",{className:"text-sm font-bold text-gray-800",children:a==="zh"?"近30天班级出勤率分析":"30-Day Class Attendance Rates"}),e.jsx("p",{className:"text-[10px] text-gray-400",children:a==="zh"?"基于最近30天内的课程日程和已记录的出勤状态":"Based on scheduled lessons and submitted attendance records"})]})]}),e.jsxs("div",{className:"flex items-center gap-4 bg-gray-50/50 p-1.5 px-3 rounded-lg border border-gray-100/60 text-xs text-gray-600",children:[e.jsxs("div",{className:"flex items-center gap-1",children:[e.jsxs("span",{className:"text-[10px] text-gray-400 uppercase font-bold tracking-wider",children:[a==="zh"?"平均率":"Avg Rate",":"]}),e.jsxs("span",{className:`font-black ${x.avgRate>=90?"text-green-600":x.avgRate>=75?"text-amber-500":"text-red-500"}`,children:[x.avgRate,"%"]})]}),e.jsx("div",{className:"h-3 w-[1px] bg-gray-200"}),e.jsxs("div",{className:"flex items-center gap-1",children:[e.jsxs("span",{className:"text-[10px] text-gray-400 uppercase font-bold tracking-wider",children:[a==="zh"?"总课时":"Schedules",":"]}),e.jsx("span",{className:"font-extrabold text-slate-800",children:x.totalSchedules})]})]})]}),e.jsxs("div",{className:"grid grid-cols-3 gap-2 bg-gray-50/50 p-2 rounded-lg border border-gray-100/50 text-center text-xs",children:[e.jsxs("div",{className:"flex flex-col items-center py-1",children:[e.jsxs("div",{className:"flex items-center gap-1.5 text-green-600 mb-0.5",children:[e.jsx("span",{className:"w-1.5 h-1.5 bg-green-500 rounded-full animate-ping"}),e.jsx("span",{className:"font-semibold text-[10px]",children:a==="zh"?"已到":"Present"})]}),e.jsx("div",{className:"text-sm font-bold text-gray-800",children:x.totalPresent})]}),e.jsxs("div",{className:"flex flex-col items-center py-1 border-x border-gray-100",children:[e.jsxs("div",{className:"flex items-center gap-1.5 text-amber-500 mb-0.5",children:[e.jsx("span",{className:"w-1.5 h-1.5 bg-amber-400 rounded-full"}),e.jsx("span",{className:"font-semibold text-[10px]",children:a==="zh"?"迟到":"Late"})]}),e.jsx("div",{className:"text-sm font-bold text-gray-800",children:x.totalLate})]}),e.jsxs("div",{className:"flex flex-col items-center py-1",children:[e.jsxs("div",{className:"flex items-center gap-1.5 text-red-500 mb-0.5",children:[e.jsx("span",{className:"w-1.5 h-1.5 bg-red-400 rounded-full"}),e.jsx("span",{className:"font-semibold text-[10px]",children:a==="zh"?"缺勤":"Absent"})]}),e.jsx("div",{className:"text-sm font-bold text-gray-800",children:x.totalAbsent})]})]}),e.jsxs("div",{className:"flex bg-slate-100 p-0.5 rounded-lg self-start shrink-0",children:[e.jsxs("button",{type:"button",onClick:()=>S("heatmap"),className:`px-3 py-1.5 text-xs font-black rounded-md transition-all cursor-pointer flex items-center gap-1.5 ${$==="heatmap"?"bg-white text-indigo-700 shadow-md font-bold":"text-gray-500 hover:text-gray-850"}`,children:[e.jsx(Y,{size:13}),a==="zh"?"出勤日历热力图":"Calendar Heatmap"]}),e.jsxs("button",{type:"button",onClick:()=>S("chart"),className:`px-3 py-1.5 text-xs font-black rounded-md transition-all cursor-pointer flex items-center gap-1.5 ${$==="chart"?"bg-white text-indigo-700 shadow-md font-bold":"text-gray-500 hover:text-gray-850"}`,children:[e.jsx(ie,{size:13}),a==="zh"?"到课趋势柱状图":"Trend Chart"]})]}),$==="heatmap"?e.jsxs("div",{className:"flex flex-col gap-4 animate-fade-in text-gray-800",children:[_&&_.attendanceRate<80&&e.jsxs("div",{className:"p-3 bg-rose-50 border border-rose-100 rounded-xl flex items-start gap-2.5 text-xs text-rose-850",children:[e.jsx(se,{size:16,className:"text-rose-500 mt-0.5 shrink-0 animate-bounce"}),e.jsxs("div",{className:"text-left",children:[e.jsx("span",{className:"font-extrabold block",children:a==="zh"?"检测到低出勤率周期预警":"Problematic Low Attendance Period Detected"}),e.jsx("p",{className:"mt-0.5 text-[11px] text-rose-700/90 leading-relaxed",children:a==="zh"?`班级在 ${_.date}(课程: 《${_.lessonTitle}》)到课率处于低谷(仅为 ${_.attendanceRate}%)。请留意可能存在影响出勤的外部因素或教学周期瓶颈。`:`Check-in density dropped to a critical low of ${_.attendanceRate}% on ${_.date} for lesson: "${_.lessonTitle}". Keep track of potential class milestones or periodic patterns.`})]})]}),e.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-3 text-[10px] text-gray-500 bg-slate-50/50 px-3 py-2 rounded-lg border border-gray-100/50",children:[e.jsx("span",{className:"font-semibold",children:a==="zh"?"出勤率梯度图例:":"Attendance Rate Intensity:"}),e.jsxs("div",{className:"flex items-center gap-4",children:[e.jsxs("div",{className:"flex items-center gap-1",children:[e.jsx("span",{className:"w-3 h-3 rounded bg-emerald-500 block"}),e.jsx("span",{children:a==="zh"?"极佳 (≥90%)":"Excellent (≥90%)"})]}),e.jsxs("div",{className:"flex items-center gap-1",children:[e.jsx("span",{className:"w-3 h-3 rounded bg-amber-500 block"}),e.jsx("span",{children:a==="zh"?"黄牌警告 (75%-89%)":"Warning (75%-89%)"})]}),e.jsxs("div",{className:"flex items-center gap-1",children:[e.jsx("span",{className:"w-3 h-3 rounded bg-rose-500 block"}),e.jsx("span",{children:a==="zh"?"严重偏低 (<75%)":"Critical (<75%)"})]}),e.jsxs("div",{className:"flex items-center gap-1",children:[e.jsx("span",{className:"w-3 h-3 rounded bg-slate-100 border border-slate-200 block"}),e.jsx("span",{children:a==="zh"?"未排课":"No Class"})]})]})]}),e.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-12 gap-5 items-start",children:[e.jsxs("div",{className:"md:col-span-7 bg-white border border-gray-100 p-4 rounded-xl shadow-2xs",children:[e.jsxs("div",{className:"flex items-center justify-between mb-3 border-b border-gray-50 pb-2",children:[e.jsx("span",{className:"text-[10px] font-black text-slate-400 uppercase tracking-widest block",children:a==="zh"?"35天教学周期考勤热度":"5-Week Sequential Heatmap"}),e.jsx("span",{className:"text-[9.5px] text-gray-400 font-mono",children:"Mon-Sun Matrix"})]}),e.jsxs("div",{className:"grid grid-cols-7 gap-1.5 sm:gap-2",children:[(a==="zh"?["一","二","三","四","五","六","日"]:["Mon","Tue","Wed","Thu","Fri","Sat","Sun"]).map(n=>e.jsx("div",{className:"text-center text-[10px] font-black text-slate-400 py-1 uppercase tracking-wider font-sans",children:n},n)),L.map(n=>{let h="bg-slate-50 border border-slate-150 text-gray-400 cursor-default hover:bg-slate-100/50",f=null;n.isFuture?h="bg-slate-50/20 text-slate-300 opacity-40 border border-dashed border-slate-100 cursor-not-allowed":n.match&&(f=n.match.attendanceRate,f>=90?h="bg-emerald-500 hover:bg-emerald-600 text-white font-extrabold cursor-pointer border border-transparent":f>=75?h="bg-amber-500 hover:bg-amber-600 text-white font-extrabold cursor-pointer border border-transparent":h="bg-rose-500 hover:bg-rose-600 text-white font-extrabold cursor-pointer border border-transparent");const N=j&&j.dateStr===n.dateStr?"ring-2 ring-indigo-600 ring-offset-2 scale-105 z-10 shadow-md":n.isToday?"ring-2 ring-slate-800 ring-offset-1 z-10":"";return e.jsxs("button",{type:"button",onClick:()=>{n.isFuture||g(n)},disabled:n.isFuture,className:`relative aspect-square rounded-lg flex flex-col items-center justify-center p-1 transition-all group shrink-0 ${h} ${N}`,title:n.match?`${n.dateStr}: ${n.match.lessonTitle} (${f}%)`:`${n.dateStr}`,children:[e.jsx("span",{className:"text-[11px] font-bold select-none",children:n.dayOfMonth}),n.dayOfMonth===1&&e.jsx("span",{className:"absolute -top-1.5 -right-1 bg-indigo-700 text-white text-[7px] font-black tracking-widest uppercase px-1 rounded shadow-xs scale-90",children:n.monthName}),n.match&&e.jsxs("div",{className:"pointer-events-none absolute bottom-full left-1/2 -translate-x-1/2 mb-2 w-48 bg-slate-950 text-white p-2 text-[9.5px] leading-relaxed rounded-xl shadow-2xl opacity-0 scale-95 group-hover:opacity-100 group-hover:scale-100 group-hover:-translate-y-0.5 transition-all duration-150 z-50 block",children:[e.jsx("div",{className:"font-extrabold border-b border-slate-850 pb-1 mb-1 truncate text-left",children:n.match.lessonTitle}),e.jsxs("div",{className:"flex justify-between font-mono gap-1 text-[8.5px]",children:[e.jsxs("span",{className:"text-slate-400",children:[a==="zh"?"日期":"Date",":"]}),e.jsx("span",{className:"font-bold",children:n.dateStr})]}),e.jsxs("div",{className:"flex justify-between font-mono gap-1 text-[8.5px]",children:[e.jsxs("span",{className:"text-slate-400",children:[a==="zh"?"实到人数":"Present",":"]}),e.jsx("span",{className:"font-extrabold text-emerald-300",children:n.match.present})]}),e.jsxs("div",{className:"flex justify-between font-mono gap-1 text-[8.5px]",children:[e.jsxs("span",{className:"text-slate-400",children:[a==="zh"?"迟到人数":"Late",":"]}),e.jsx("span",{className:"font-extrabold text-amber-300",children:n.match.late})]}),e.jsxs("div",{className:"flex justify-between font-mono gap-1 text-[8.5px]",children:[e.jsxs("span",{className:"text-slate-400",children:[a==="zh"?"未到人数":"Absent",":"]}),e.jsx("span",{className:"font-extrabold text-rose-300",children:n.match.absent})]}),e.jsxs("div",{className:"text-center font-bold font-mono text-[11px] text-indigo-300 pt-1 border-t border-slate-800 mt-1",children:[a==="zh"?"到课比率:":"Access density:"," ",f,"%"]}),e.jsx("div",{className:"absolute top-full left-1/2 -translate-x-1/2 -mt-1 border-[4px] border-transparent border-t-slate-950"})]})]},n.dateStr)})]})]}),e.jsx("div",{className:"md:col-span-5 bg-slate-50 border border-gray-200 p-4 rounded-xl min-h-[210px] flex flex-col justify-between",children:j?e.jsxs("div",{className:"text-left flex-1 flex flex-col justify-between h-full space-y-3",children:[e.jsxs("div",{children:[e.jsx("span",{className:"text-[9px] font-black text-slate-400 uppercase tracking-widest block mb-1",children:a==="zh"?"日期考勤指数详情":"Acreage Diagnostic Center"}),e.jsxs("h5",{className:"text-xs font-black text-gray-800 flex items-center gap-1.5 justify-start",children:[e.jsx(Y,{size:13,className:"text-indigo-650"}),j.dateStr," ",j.isToday?`(${a==="zh"?"今天":"Today"})`:""]})]}),j.match?e.jsxs("div",{className:"space-y-3 flex-1 flex flex-col justify-between",children:[e.jsxs("div",{className:"bg-white border border-gray-150 p-2.5 rounded-lg text-left",children:[e.jsx("span",{className:"text-[8.5px] font-bold text-gray-400 block uppercase",children:a==="zh"?"讲授课目":"Subject of Instruction"}),e.jsx("p",{className:"text-xs font-extrabold text-indigo-900 line-clamp-2 mt-0.5",title:j.match.lessonTitle,children:j.match.lessonTitle})]}),e.jsxs("div",{className:"flex items-center gap-4 py-1.5",children:[e.jsxs("div",{className:"relative flex items-center justify-center shrink-0",children:[e.jsxs("svg",{className:"w-14 h-14 transform -rotate-90",children:[e.jsx("circle",{cx:"28",cy:"28",r:"23",className:"stroke-gray-200 fill-none",strokeWidth:"3.5"}),e.jsx("circle",{cx:"28",cy:"28",r:"23",className:`fill-none transition-all duration-300 ${j.match.attendanceRate>=90?"stroke-emerald-500":j.match.attendanceRate>=75?"stroke-amber-500":"stroke-rose-500"}`,strokeWidth:"4",strokeDasharray:`${2*Math.PI*23}`,strokeDashoffset:`${2*Math.PI*23*(1-j.match.attendanceRate/100)}`,strokeLinecap:"round"})]}),e.jsxs("span",{className:"absolute text-xs font-black font-mono text-gray-800",children:[j.match.attendanceRate,"%"]})]}),e.jsxs("div",{className:"text-left space-y-0.5",children:[e.jsx("span",{className:"text-[10px] font-bold text-gray-400 block uppercase",children:a==="zh"?"考勤宏观评估":"Check-in Diagnostics"}),e.jsx("span",{className:`text-xs font-extrabold block ${j.match.attendanceRate>=90?"text-emerald-600":j.match.attendanceRate>=75?"text-amber-500":"text-rose-600"}`,children:j.match.attendanceRate>=90?a==="zh"?"出勤情况极好":"Excellent Check-in":j.match.attendanceRate>=75?a==="zh"?"出勤尚可但有波动":"Moderate Attendance":a==="zh"?"出勤率严重偏低":"Low Attendance Alert"})]})]}),e.jsxs("div",{className:"grid grid-cols-3 gap-1.5 text-center",children:[e.jsxs("div",{className:"bg-white border border-gray-150 p-1.5 rounded-lg",children:[e.jsx("span",{className:"text-[8px] font-bold text-emerald-600 block uppercase",children:a==="zh"?"到席":"In Class"}),e.jsx("span",{className:"text-xs font-mono font-extrabold text-slate-800",children:j.match.present})]}),e.jsxs("div",{className:"bg-white border border-gray-150 p-1.5 rounded-lg",children:[e.jsx("span",{className:"text-[8px] font-bold text-amber-500 block uppercase",children:a==="zh"?"迟到":"Late"}),e.jsx("span",{className:"text-xs font-mono font-extrabold text-slate-800",children:j.match.late})]}),e.jsxs("div",{className:"bg-white border border-gray-150 p-1.5 rounded-lg",children:[e.jsx("span",{className:"text-[8px] font-bold text-rose-500 block uppercase",children:a==="zh"?"缺席":"Absent"}),e.jsx("span",{className:"text-xs font-mono font-extrabold text-slate-800",children:j.match.absent})]})]})]}):e.jsxs("div",{className:"flex-1 flex flex-col items-center justify-center py-6 text-slate-400 text-center gap-1 select-none font-sans",children:[e.jsx(se,{size:24,className:"text-slate-300"}),e.jsx("span",{className:"font-bold text-slate-500 text-[11px]",children:a==="zh"?"当天没有排课计划":"No Lesson Scheduled"}),e.jsx("span",{className:"text-[9px] max-w-[180px] text-gray-400",children:a==="zh"?"本日期无分配的课程安排及签到表。":"No instruction maps were recorded on this period."})]})]}):e.jsxs("div",{className:"flex flex-col items-center justify-center py-8 text-slate-400 text-center h-full select-none gap-2 font-sans",children:[e.jsx(Y,{size:28,className:"text-indigo-400 animate-pulse"}),e.jsx("span",{className:"font-bold text-slate-600 text-xs",children:a==="zh"?"请点击考勤方块":"Select a Cell to Inspect"}),e.jsx("span",{className:"text-[9.5px] text-gray-400 max-w-[180px] leading-relaxed",children:a==="zh"?"在左侧历史视窗中轻点日期,可瞬间深度解读班级应出席名册及课题明细。":"Click any of the heat blocks to audit lesson stats and classroom ratios."})]})})]})]}):e.jsx("div",{className:"h-44 w-full font-sans select-none animate-fade-in",children:e.jsx(me,{width:"100%",height:"100%",children:e.jsxs(Ee,{data:T,margin:{top:10,right:10,left:-25,bottom:0},children:[e.jsx(Se,{strokeDasharray:"3 3",vertical:!1,stroke:"#f0f0f0"}),e.jsx(ge,{dataKey:"displayDate",tick:{fontSize:9,fill:"#9ca3af"},axisLine:{stroke:"#e5e7eb"},tickLine:!1}),e.jsx(ue,{domain:[0,100],tickFormatter:n=>`${n}%`,tick:{fontSize:9,fill:"#9ca3af"},axisLine:!1,tickLine:!1}),e.jsx(be,{cursor:{fill:"#f3f4f6",opacity:.6},content:({active:n,payload:h})=>{if(n&&h&&h.length){const f=h[0].payload;return e.jsxs("div",{className:"bg-white border border-gray-150 p-2.5 rounded-xl shadow-xl font-sans text-xs flex flex-col gap-1.5",children:[e.jsxs("div",{className:"font-bold text-gray-800 border-b border-gray-150 pb-1 mb-1 flex items-center justify-between gap-4",children:[e.jsx("span",{className:"max-w-[130px] truncate",title:f.lessonTitle,children:f.lessonTitle}),e.jsx("span",{className:"text-[10px] text-gray-400 font-mono normal-case",children:f.date})]}),e.jsxs("div",{className:"flex justify-between gap-4 text-gray-600",children:[e.jsxs("span",{className:"flex items-center gap-1 text-gray-400",children:[e.jsx(ee,{size:11})," ",a==="zh"?"总注册学生":"Total Students",":"]}),e.jsx("span",{className:"font-bold text-slate-700",children:f.total})]}),e.jsxs("div",{className:"flex justify-between gap-4 text-emerald-600",children:[e.jsxs("span",{className:"flex items-center gap-1",children:[e.jsx("span",{className:"w-1.5 h-1.5 rounded-full bg-green-500"})," ",a==="zh"?"实到人数":"Present",":"]}),e.jsx("span",{className:"font-semibold",children:f.present})]}),e.jsxs("div",{className:"flex justify-between gap-4 text-amber-500",children:[e.jsxs("span",{className:"flex items-center gap-1",children:[e.jsx("span",{className:"w-1.5 h-1.5 rounded-full bg-amber-400"})," ",a==="zh"?"迟到人数":"Late",":"]}),e.jsx("span",{className:"font-semibold",children:f.late})]}),e.jsxs("div",{className:"flex justify-between gap-4 text-red-500",children:[e.jsxs("span",{className:"flex items-center gap-1",children:[e.jsx("span",{className:"w-1.5 h-1.5 rounded-full bg-red-400"})," ",a==="zh"?"未到人数":"Absent",":"]}),e.jsx("span",{className:"font-semibold",children:f.absent})]}),e.jsxs("div",{className:"flex justify-between gap-4 text-indigo-600 border-t border-gray-100 pt-1.5 mt-1 font-bold",children:[e.jsxs("span",{children:[a==="zh"?"单次出勤率":"Attendance Rate",":"]}),e.jsxs("span",{children:[f.attendanceRate,"%"]})]})]})}return null}}),e.jsx(Me,{dataKey:"attendanceRate",fill:"#6366f1",radius:[4,4,0,0],maxBarSize:28})]})})})]})}function jt(t){const{cls:a,lang:i,cStudents:s,classProgressMap:l,classSchedulesMap:c,classDashboardMap:p}=t;return e.jsxs("div",{className:"space-y-4",children:[l[a.id]&&l[a.id].length>0&&e.jsxs("div",{className:"mb-4 bg-white p-2 border border-gray-100 rounded shadow-sm",children:[e.jsxs("div",{className:"text-xs font-medium text-gray-500 mb-2 flex items-center gap-1",children:[e.jsx(We,{size:12})," Class Avg Completion"]}),e.jsx("div",{className:"h-32 w-full",children:e.jsx(me,{width:"100%",height:"100%",children:e.jsxs(Ee,{data:l[a.id],children:[e.jsx(ge,{dataKey:"lesson_title",hide:!0}),e.jsx(ue,{domain:[0,100],hide:!0}),e.jsx(be,{contentStyle:{fontSize:"10px",padding:"4px",borderRadius:"4px"},formatter:w=>[`${Math.round(w)}%`,"Average"]}),e.jsx(Me,{dataKey:"average_progress",fill:"#6366f1",radius:[2,2,0,0]})]})})})]}),e.jsx("div",{className:"mb-4",children:e.jsx(bt,{schedules:c[a.id]||[],progress:l[a.id]||[],lang:i})}),e.jsx("div",{className:"mb-4",children:e.jsx(ft,{classId:a.id,lang:i})}),p[a.id]&&e.jsx(pt,{students:s,assignments:p[a.id].assignments||[],performance:p[a.id].performance||[],lang:i})]})}function vt(t){const{cls:a,lang:i,cStudents:s,activeSubmissionFilter:l,classDashboardMap:c,assignmentSortOrder:p,setAssignmentSortOrder:w,lessons:$,isGeneratingPDFReport:S,handleGeneratePDFReport:j,setExportClassId:g,setExportClassName:_,setQuizzesWeight:L,setAssignmentsWeight:x,setCustomCategoryOverrides:T,setIsExportWeightModalOpen:n,isGeneratingAssignment:h,setQuizGeneratorClassId:f,setQuizGenMode:z,setQuizGenSelectedLessonId:N,setQuizGenTopic:k,setSuggestedObjectives:M,setSuggestedQuestions:D,setIsQuizGeneratorOpen:J,setClassSubmissionFilters:u,setActiveStudentId:C,setSelectedAssignment:R,setStudentViewStatus:E,setActiveRole:U,isGrading:q,setIsGrading:I,fetchClassDashboard:P,get30DayAverageWarning:d}=t,G=c[a.id]?.recentSubmissions||[],K=c[a.id]?.performance||[],V=(()=>{if(l==="all")return G;if(l==="submitted")return G.filter(r=>r.status==="submitted");if(l==="graded")return G.filter(r=>r.status==="graded");if(l==="pending"){const r=G.filter(b=>b.status==="submitted"),v=K.filter(b=>!b.submission_status||b.submission_status===null).map(b=>({assignment_id:b.assignment_id,assignment_title:b.assignment_title,student_id:b.student_id,student_name:b.student_name,content:i==="zh"?"尚未提交此作业":"Has not submitted this assignment yet",status:"pending_student"}));return[...r,...v]}return G})();return e.jsxs("div",{className:"mb-4 bg-white p-3 rounded-xl border border-slate-100 shadow-xs",children:[e.jsxs("div",{className:"flex items-center justify-between mb-3 border-b border-gray-200 pb-2",children:[e.jsxs("div",{className:"text-xs font-semibold text-gray-700 flex items-center gap-1",children:[e.jsx(ae,{size:14,className:"text-indigo-500"})," Class Dashboard"]}),e.jsxs("div",{className:"flex items-center gap-2",children:[c[a.id]&&e.jsxs(e.Fragment,{children:[e.jsxs("button",{id:`generate-pdf-btn-${a.id}`,disabled:S[a.id],onClick:r=>{r.stopPropagation(),j(a.id,a.name)},className:"text-white hover:bg-emerald-750 bg-emerald-600 hover:bg-emerald-700 transition-all font-semibold rounded px-2.5 py-1 text-[10px] items-center flex gap-1.5 shadow-sm cursor-pointer font-sans disabled:opacity-50",children:[S[a.id]?e.jsx(Z,{size:10,className:"animate-spin"}):e.jsx(oe,{size:10}),e.jsx("span",{children:i==="zh"?"下载班级 PDF 报告":"Download Class PDF Report"})]}),e.jsxs("button",{id:`export-grades-btn-${a.id}`,onClick:r=>{r.stopPropagation(),g(a.id),_(a.name),L(40),x(60),T({}),n(!0)},className:"text-slate-700 hover:text-slate-900 border border-gray-300 bg-white hover:bg-gray-100 transition-all font-semibold rounded px-2 py-1 text-[10px] items-center flex gap-1 shadow-sm cursor-pointer font-sans",children:[e.jsx(ne,{size:10})," ",i==="zh"?"选项与导出":"Export Grades"]})]}),e.jsxs("button",{disabled:h===a.id,onClick:async r=>{r.stopPropagation(),f(a.id),z("scan_lesson"),$.length>0?N($[0].id):N(""),k(""),M([]),D([]),J(!0)},className:"text-white bg-indigo-500 hover:bg-indigo-600 px-2 py-1 rounded text-[10px] items-center flex gap-1 shadow-sm disabled:opacity-50",children:[h===a.id?e.jsx(Z,{size:10,className:"animate-spin"}):e.jsx(Ae,{size:10})," Generate AI Quiz"]})]})]}),c[a.id]?e.jsxs("div",{className:"space-y-4",children:[e.jsxs("div",{children:[e.jsxs("div",{className:"flex items-center justify-between mb-2",children:[e.jsx("div",{className:"text-[10px] font-medium text-gray-500 uppercase tracking-wider",children:i==="zh"?"班级作业与测验":"Class Assignments & Quizzes"}),e.jsxs("div",{className:"flex items-center gap-1.5 bg-white border border-gray-200 px-2 py-1 rounded-lg shadow-sm",children:[e.jsx("span",{className:"text-[9px] font-bold text-gray-400 uppercase tracking-wider",children:i==="zh"?"排序:":"Sort:"}),e.jsxs("select",{value:p,onChange:r=>w(r.target.value),className:"bg-transparent border-0 text-[10px] text-gray-750 font-bold focus:outline-none focus:ring-0 p-0 cursor-pointer outline-none font-sans",id:"assignment-sort-select",children:[e.jsx("option",{value:"dueDate",children:i==="zh"?"截止日期":"Due Date"}),e.jsx("option",{value:"status",children:i==="zh"?"评分状态":"Status (Graded/Pending)"}),e.jsx("option",{value:"avgScore",children:i==="zh"?"平均分":"Average Score"})]})]})]}),e.jsxs("div",{className:"grid gap-2 grid-cols-2",children:[c[a.id].assignments&&(()=>{const r=c[a.id]?.assignments||[],v=c[a.id]?.performance||[];return r.map(y=>{const B=v.filter(X=>X.assignment_id===y.id);B.length;const H=B.filter(X=>X.submission_status==="submitted").length,o=B.filter(X=>X.submission_status==="graded").length;let m="pending",F=i==="zh"?"未提交":"No Submissions";H>0?(m="pending",F=i==="zh"?"待评分":"Pending Grading"):o>0&&(m="graded",F=i==="zh"?"已评分":"Graded");const W=B.filter(X=>X.score!==null&&X.score!==void 0).map(X=>Number(X.score)),Q=W.length>0?Math.round(W.reduce((X,Ge)=>X+Ge,0)/W.length):null,Ce=y.created_at+10080*60*1e3;return{...y,dueDateTimestamp:Ce,status:m,statusLabel:F,avgScore:Q,pendingGradingCount:H,gradedCount:o}}).sort((y,B)=>{if(p==="dueDate")return y.dueDateTimestamp-B.dueDateTimestamp;if(p==="status")return y.status===B.status?B.dueDateTimestamp-y.dueDateTimestamp:y.status==="pending"?-1:1;if(p==="avgScore"){const H=y.avgScore!==null?y.avgScore:-1;return(B.avgScore!==null?B.avgScore:-1)-H}return 0}).map(y=>e.jsxs("div",{className:"bg-white p-3 rounded-xl border border-gray-150 hover:border-indigo-200 shadow-sm text-xs cursor-pointer hover:shadow transition-all flex flex-col justify-between",children:[e.jsxs("div",{className:"flex items-start justify-between gap-1.5 mb-1.5",children:[e.jsx("div",{className:"font-semibold text-gray-800 line-clamp-1 flex-1 font-sans",title:y.title,children:y.title}),e.jsx("span",{className:`px-1.5 py-0.5 rounded text-[9px] font-bold shrink-0 border uppercase tracking-wider font-sans ${y.status==="graded"?"bg-emerald-50 text-emerald-700 border-emerald-100":y.pendingGradingCount>0?"bg-amber-50 text-amber-700 border-amber-100":"bg-gray-50 text-gray-500 border-gray-100"}`,children:y.statusLabel})]}),e.jsx("div",{className:"text-gray-500 text-[10px] line-clamp-2 leading-normal mb-2.5 font-sans",children:y.description||y.content}),e.jsxs("div",{className:"flex items-center justify-between border-t border-gray-55 pt-2 mt-auto gap-2",children:[e.jsxs("div",{className:"flex items-center gap-1.5 font-sans",children:[e.jsxs("span",{className:"text-[10px] text-gray-400 font-medium",children:[i==="zh"?"截止: ":"Due: ",e.jsx("span",{className:"text-gray-600 font-semibold",children:new Date(y.dueDateTimestamp).toLocaleDateString(i==="zh"?"zh-CN":"en-US",{month:"short",day:"numeric"})})]}),y.avgScore!==null&&e.jsxs("span",{className:"inline-flex items-center gap-0.5 bg-indigo-50 text-indigo-700 border border-indigo-100 px-1.5 py-0.5 rounded text-[9px] font-bold",children:[i==="zh"?"均分":"Avg",": ",y.avgScore,"%"]})]}),e.jsxs("button",{onClick:async B=>{if(B.stopPropagation(),s.length===0)return alert("No students in class to submit!");const H=s[Math.floor(Math.random()*s.length)],o=window.prompt(`Simulate student '${H.name}' submitting:`);o&&(await fetch(`/api/assignments/${y.id}/submissions`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({studentId:H.id,content:o})})).ok&&await P(a.id)},className:"text-[9px] text-indigo-600 border border-indigo-200 hover:border-indigo-300 hover:bg-indigo-50/50 bg-white px-2 py-0.5 rounded font-bold flex items-center gap-1 cursor-pointer transition-all shrink-0 font-sans",children:[e.jsx(Be,{size:8})," ",i==="zh"?"模拟":"Simulate"]})]})]},y.id))})(),c[a.id].assignments.length===0&&e.jsx("div",{className:"text-xs text-gray-400 italic",children:"No assignments yet."})]})]}),e.jsxs("div",{children:[e.jsxs("div",{className:"flex flex-col sm:flex-row sm:items-center justify-between gap-2 mb-2 border-b border-gray-100 pb-1.5 pt-1",children:[e.jsxs("div",{className:"text-[10px] font-bold text-gray-500 uppercase tracking-wider flex items-center gap-1",children:[e.jsx(Y,{size:11,className:"text-gray-400"}),i==="zh"?"近期作业提交":"Recent Submissions"]}),e.jsx("div",{className:"flex items-center gap-1 bg-gray-50 p-0.5 rounded-lg border border-gray-200",children:["all","submitted","graded","pending"].map(r=>{const v=l===r,b=(()=>{if(r==="all")return G.length;if(r==="submitted")return G.filter(y=>y.status==="submitted").length;if(r==="graded")return G.filter(y=>y.status==="graded").length;if(r==="pending"){const y=G.filter(H=>H.status==="submitted").length,B=K.filter(H=>!H.submission_status||H.submission_status===null).length;return y+B}return 0})(),O={all:i==="zh"?"全部":"All",submitted:i==="zh"?"待评分":"Submitted",graded:i==="zh"?"已完成":"Graded",pending:i==="zh"?"待完成":"Pending"}[r];return e.jsxs("button",{onClick:y=>{y.stopPropagation(),u(B=>({...B,[a.id]:r}))},className:`px-2 py-0.5 rounded-md text-[10px] font-semibold transition-all cursor-pointer flex items-center gap-1 font-sans ${v?"bg-white shadow-sm text-indigo-600 border border-indigo-100":"text-gray-500 hover:text-gray-700 hover:bg-gray-100 border border-transparent"}`,children:[e.jsx("span",{children:O}),e.jsx("span",{className:`px-1 py-0.1 ml-0.5 rounded-full text-[8.5px] leading-tight ${v?"bg-indigo-50 text-indigo-600 font-bold":"bg-gray-200/60 text-gray-400 font-medium"}`,children:b})]},r)})})]}),e.jsxs("div",{className:"flex flex-col gap-1.5 max-h-56 overflow-y-auto pr-1",children:[V.map((r,v)=>e.jsxs("div",{className:"bg-white p-2 border border-gray-150 rounded-lg text-xs flex justify-between items-center group hover:border-gray-300 transition-colors shadow-none mt-0.5",children:[e.jsxs("div",{className:"flex-1 min-w-0 pr-2",children:[e.jsxs("div",{className:"font-semibold text-gray-800 truncate flex items-center gap-1.5",children:[e.jsx("span",{className:"max-w-[110px] truncate",children:r.student_name}),e.jsx("span",{className:"text-[10px] text-gray-400 font-normal",children:"in"}),e.jsx("span",{className:"truncate text-gray-500 max-w-[130px]",title:r.assignment_title,children:r.assignment_title})]}),e.jsx("div",{className:"text-[10px] text-gray-500 truncate italic mt-0.5",children:r.status==="pending_student"?e.jsxs("span",{className:"text-amber-500 font-medium flex items-center gap-1",children:[e.jsx(le,{size:10,className:"animate-pulse"}),r.content]}):`"${r.content}"`})]}),e.jsxs("div",{className:"shrink-0 flex items-center justify-end gap-1.5",children:[r.status!=="pending_student"&&e.jsxs("button",{onClick:()=>{C(r.student_id),R({id:r.assignment_id,title:r.assignment_title,student_id:r.student_id,student_name:r.student_name,submission_status:r.status,score:r.score,feedback:r.feedback,content:r.question_content}),E("assignment"),U("student")},className:"text-indigo-600 bg-indigo-50 hover:bg-indigo-100 px-2 py-1 rounded-md text-[9px] flex items-center gap-1 shadow-none font-bold border border-indigo-100 hover:border-indigo-200 transition-all cursor-pointer",children:[e.jsx(Fe,{size:9})," Live Canvas"]}),r.status==="graded"?e.jsxs("span",{className:`px-1.5 py-0.5 rounded text-[10px] font-medium ${r.score>=85?"bg-green-100 text-green-700 border border-green-200":r.score>=70?"bg-indigo-100 text-indigo-700 border border-indigo-200":"bg-yellow-105 text-yellow-700 border border-yellow-250"}`,children:[r.score,"%"]}):e.jsxs("button",{disabled:q[`${r.assignment_id}-${r.student_id}`],onClick:async()=>{I(b=>({...b,[`${r.assignment_id}-${r.student_id}`]:!0}));try{(await fetch(`/api/assignments/${r.assignment_id}/submissions/${r.student_id}/grade`,{method:"POST"})).ok&&await P(a.id)}finally{I(b=>({...b,[`${r.assignment_id}-${r.student_id}`]:!1}))}},className:"text-white bg-green-500 hover:bg-green-600 px-2 py-1 rounded-md text-[9px] flex items-center gap-1 shadow-sm font-bold border border-green-600 hover:border-green-700 hover:-translate-y-0.1 transition-all disabled:opacity-50 cursor-pointer",children:[q[`${r.assignment_id}-${r.student_id}`]?e.jsx(Z,{size:10,className:"animate-spin"}):e.jsx(Ae,{size:10})," ",i==="zh"?"评分":"Grade"]})]})]},r.status==="pending_student"?`${r.assignment_id}-${r.student_id}-pending-${v}`:`${r.assignment_id}-${r.student_id}-${v}`)),V.length===0&&e.jsx("div",{className:"text-xs text-gray-400 italic p-4 text-center bg-gray-50 border border-dashed border-gray-200 rounded-lg select-none",children:i==="zh"?"该筛选下暂无可展示的作业项目。":"No submissions under this filter."})]})]}),c[a.id].assignments.length>0&&s.length>0&&e.jsxs("div",{children:[e.jsx("div",{className:"text-[10px] font-medium text-gray-500 mb-1 uppercase tracking-wider",children:"Class Performance Heatmap"}),e.jsx("div",{className:"overflow-x-auto border border-gray-200 rounded",children:e.jsxs("table",{className:"w-full text-xs text-left bg-white",children:[e.jsx("thead",{className:"bg-gray-50 sticky top-0",children:e.jsxs("tr",{children:[e.jsx("th",{className:"p-2 border-b border-r border-gray-200 font-medium whitespace-nowrap text-gray-600",children:"Student"}),c[a.id].assignments.map(r=>e.jsx("th",{className:"p-2 border-b border-r border-gray-200 font-medium truncate max-w-[80px]",title:r.title,children:r.title},r.id))]})}),e.jsx("tbody",{children:s.map(r=>e.jsxs("tr",{className:"border-b border-gray-100 last:border-b-0",children:[e.jsx("td",{className:"p-2 border-r border-gray-100 font-medium text-gray-700 whitespace-nowrap truncate max-w-[160px]",children:e.jsxs("div",{className:"flex items-center gap-1.5",children:[e.jsx("span",{className:"truncate",title:r.name,children:r.name}),(()=>{const v=d(r.id,a.id);return v!==null?e.jsxs("span",{className:"inline-flex items-center gap-0.5 bg-red-50 text-red-700 border border-red-200 px-1 py-0.5 rounded text-[9px] font-bold animate-pulse",title:i==="zh"?`30天平均成绩已降至60%以下 (${v}%)`:`30-day average has dropped below 60% (${v}%)`,children:[e.jsx(ke,{size:10,className:"text-red-500"}),v,"%"]}):null})()]})}),c[a.id].assignments.map(v=>{const b=c[a.id].performance.find(B=>B.assignment_id===v.id&&B.student_id===r.id);let O="bg-gray-50",y="-";return b&&b.score!==null?(y=b.score.toString(),b.score>=90?O="bg-green-100 text-green-800 font-medium":b.score>=70?O="bg-green-50 text-green-700":b.score>=50?O="bg-yellow-50 text-yellow-700":O="bg-red-50 text-red-700"):b&&b.submission_status==="submitted"&&(y="Wait",O="bg-blue-50 text-blue-500 text-[9px]"),e.jsx("td",{className:`p-2 border-r border-gray-100 text-center relative group/cell ${O}`,children:(()=>{const H=b&&b.graded_at?new Date(b.graded_at).toLocaleString(i==="zh"?"zh-CN":"en-US",{month:"short",day:"numeric",hour:"2-digit",minute:"2-digit"}):"";return e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"flex items-center justify-center gap-0.5 select-none font-sans",children:[e.jsx("span",{children:y}),b&&b.score!==null&&e.jsx("span",{className:"w-1 h-1 rounded-full bg-emerald-500 shrink-0 inline-block animate-pulse"})]}),b&&b.score!==null&&e.jsxs("div",{className:"absolute bottom-full mb-1.5 left-1/2 -translate-x-1/2 hidden group-hover/cell:block bg-gray-900 border border-gray-800 text-white text-[10px] p-2.5 rounded-xl shadow-2xl z-30 w-44 pointer-events-none text-left leading-normal font-sans font-normal normal-case",children:[e.jsxs("div",{className:"font-bold text-[11px] mb-1 text-emerald-400 flex items-center gap-1",children:[e.jsx(ze,{size:11,className:"shrink-0"}),i==="zh"?"已完成评分":"Graded & Evaluated"]}),H&&e.jsxs("div",{className:"text-gray-300 flex items-center gap-1 font-semibold text-[9px] mb-1",children:[e.jsx(le,{size:10,className:"shrink-0 text-indigo-400"}),e.jsx("span",{children:i==="zh"?`时间: ${H}`:`Graded: ${H}`})]}),b.feedback&&e.jsxs("div",{className:"text-gray-200 mt-1 pt-1 border-t border-gray-800 line-clamp-3 text-[9px] italic",children:['"',b.feedback,'"']}),e.jsx("div",{className:"absolute top-full left-1/2 -translate-x-1/2 -mt-1 border-4 border-transparent border-t-gray-900"})]})]})})()},v.id)})]},r.id))})]})})]})]}):e.jsx("div",{className:"flex justify-center p-4 text-gray-400",children:e.jsx(Z,{size:16,className:"animate-spin"})})]})}function yt(t){const{cls:a,lang:i,cStudents:s,newScheduleDate:l,setNewScheduleDate:c,newScheduleLessonId:p,setNewScheduleLessonId:w,lessons:$,fetchClassSchedules:S,classSchedulesMap:j,expandedScheduleId:g,setExpandedScheduleId:_,fetchScheduleAttendance:L,scheduleAttendanceMap:x,get30DayAverageWarning:T}=t;return e.jsxs("div",{className:"mb-4 bg-white p-3 rounded-xl border border-slate-100 shadow-xs",children:[e.jsx("div",{className:"flex items-center justify-between mb-3 border-b border-gray-200 pb-2",children:e.jsxs("div",{className:"text-xs font-semibold text-gray-700 flex items-center gap-1",children:[e.jsx(Y,{size:14,className:"text-pink-500"})," Schedule & Attendance"]})}),e.jsxs("div",{className:"mb-3 flex gap-2 items-center",children:[e.jsx("input",{title:"Schedule Date",type:"date",className:"border border-slate-200 hover:border-slate-300 rounded-lg text-xs p-1.5 flex-1 bg-white focus:outline-hidden focus:ring-1 focus:ring-indigo-500 text-gray-750 transition-all font-sans",value:l,onChange:n=>c(n.target.value),onClick:n=>n.stopPropagation()}),e.jsxs("select",{title:"Schedule Lesson",className:"border border-slate-200 hover:border-slate-300 rounded-lg text-xs p-1.5 flex-1 bg-white focus:outline-hidden focus:ring-1 focus:ring-indigo-500 text-gray-750 transition-all font-sans cursor-pointer",value:p,onChange:n=>w(n.target.value),onClick:n=>n.stopPropagation(),children:[e.jsx("option",{value:"",children:"Select Lesson..."}),$.map(n=>e.jsx("option",{value:n.id,children:n.title},n.id))]}),e.jsx("button",{className:"bg-pink-500 hover:bg-pink-600 text-white p-1 px-2 rounded text-xs disabled:opacity-50 flex items-center gap-1",disabled:!l||!p,onClick:async n=>{n.stopPropagation(),(await fetch(`/api/classes/${a.id}/schedules`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({lessonId:p,scheduledDate:l})})).ok&&(c(""),w(""),await S(a.id))},children:"Schedule"})]}),e.jsx("div",{className:"flex flex-col gap-2",children:(j[a.id]||[]).length===0?e.jsx("div",{className:"text-xs text-gray-400 italic",children:"No schedules yet."}):j[a.id].map(n=>{const h=g===n.id,f=x[n.id]||[];return e.jsxs("div",{className:"bg-white border border-slate-100/90 rounded-xl shadow-xs hover:shadow-sm transition-all overflow-hidden mb-2",children:[e.jsx("div",{className:"p-2 flex justify-between items-center cursor-pointer hover:bg-gray-50",onClick:()=>{h?_(null):(_(n.id),L(n.id))},children:e.jsxs("div",{className:"flex items-center gap-2 text-xs",children:[h?e.jsx(ce,{size:14,className:"text-gray-400"}):e.jsx(xe,{size:14,className:"text-gray-400"}),e.jsxs("div",{className:"flex flex-col",children:[e.jsx("span",{className:"font-semibold text-gray-800",children:n.lesson_title}),e.jsxs("span",{className:"text-[10px] text-gray-500 flex items-center gap-1",children:[e.jsx(Y,{size:10})," ",n.scheduled_date]})]})]})}),h&&e.jsxs("div",{className:"border-t border-gray-100 p-2 bg-gray-50/50",children:[e.jsx("div",{className:"text-[10px] font-medium text-gray-500 mb-2 uppercase tracking-wider",children:"Attendance Check-in"}),e.jsxs("div",{className:"grid gap-1",children:[s.map(z=>{const N=f.find(k=>k.student_id===z.id);return e.jsxs("div",{className:"flex items-center justify-between text-xs bg-white p-1 rounded border border-gray-200",children:[e.jsxs("div",{className:"flex items-center gap-1.5 truncate max-w-[150px]",children:[e.jsx("span",{className:"font-medium text-gray-700 truncate",title:z.name,children:z.name}),(()=>{const k=T(z.id,a.id);return k!==null?e.jsxs("span",{className:"inline-flex items-center gap-0.5 bg-red-50 text-red-700 border border-red-200 px-1 py-0.5 rounded text-[9px] font-bold animate-pulse",title:i==="zh"?`30天平均成绩已降至60%以下 (${k}%)`:`30-day average has dropped below 60% (${k}%)`,children:[e.jsx(ke,{size:10,className:"text-red-500"}),k,"%"]}):null})()]}),e.jsx("div",{className:"flex gap-1 shrink-0",children:["present","late","absent"].map(k=>e.jsx("button",{onClick:async M=>{M.stopPropagation(),(await fetch(`/api/schedules/${n.id}/attendance`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({studentId:z.id,status:k})})).ok&&L(n.id)},className:`px-1.5 py-0.5 rounded text-[10px] capitalize border transition-all cursor-pointer ${N?.status===k?k==="present"?"bg-green-50 border-green-200 text-green-700 font-medium":k==="late"?"bg-yellow-50 border-yellow-200 text-yellow-700 font-medium":"bg-red-50 border-red-200 text-red-700 font-medium":"bg-slate-50 border-slate-100/70 text-slate-400 hover:bg-slate-100"}`,children:k},k))})]},z.id)}),s.length===0&&e.jsx("div",{className:"text-[10px] italic text-gray-400",children:"No students to check in."})]})]})]},n.id)})})]})}const _e={zh:[{key:"General",label:"日常备忘",color:"bg-emerald-50 text-emerald-700 border-emerald-250 hover:bg-emerald-100",icon:"Bookmark"},{key:"Academic",label:"学术表现",color:"bg-blue-50 text-blue-700 border-blue-250 hover:bg-blue-100",icon:"GraduationCap"},{key:"Behavioral",label:"行为状态",color:"bg-purple-50 text-purple-700 border-purple-250 hover:bg-purple-100",icon:"Brain"},{key:"SpecialCare",label:"特别关注",color:"bg-rose-50 text-rose-700 border-rose-250 hover:bg-rose-100",icon:"AlertCircle"}],en:[{key:"General",label:"General",color:"bg-emerald-50 text-emerald-700 border-emerald-250 hover:bg-emerald-100",icon:"Bookmark"},{key:"Academic",label:"Academic",color:"bg-blue-50 text-blue-700 border-blue-250 hover:bg-blue-100",icon:"GraduationCap"},{key:"Behavioral",label:"Behavioral",color:"bg-purple-50 text-purple-700 border-purple-250 hover:bg-purple-100",icon:"Brain"},{key:"SpecialCare",label:"Special Care",color:"bg-rose-50 text-rose-700 border-rose-250 hover:bg-rose-100",icon:"AlertCircle"}]},Nt=(t,a=12)=>{switch(t){case"GraduationCap":return e.jsx(rt,{size:a});case"Brain":return e.jsx(at,{size:a});case"AlertCircle":return e.jsx(se,{size:a});default:return e.jsx(st,{size:a})}},Te={zh:[{title:"📋 学术表现观察",content:`<div><strong>【学术表现观察 (Academic Observation)】</strong></div>
|
|
2
2
|
<div>• <strong>课堂参与:</strong> 在讨论中表现活跃,能够主动提出有深度的问题。</div>
|
|
3
3
|
<div>• <strong>理解与熟练度:</strong> 对于今天教授的核心概念理解迅速,但在算法步骤上仍有一些小失误。</div>
|
|
4
4
|
<div>• <strong>随堂练习完成度:</strong> 练习题完成度 100%,正确率约 90%。</div>`},{title:"🧠 心理/行为表现",content:`<div><strong>【学生行为与专注力评估 (Behavioral Assessment)】</strong></div>
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{j as e}from"./vendor-react-0Lg0vA-4.js";import{L as o}from"./LazyCourseware-
|
|
1
|
+
import{j as e}from"./vendor-react-0Lg0vA-4.js";import{L as o}from"./LazyCourseware-C1bH8aKj.js";import{ai as a,a9 as x,X as c,af as d}from"./vendor-icons-Dq6MhgH9.js";import{M as m}from"./index-Cwf8LQbY.js";import"./vendor-pdf-Cp-cYteE.js";import"./vendor-utils-BEhuP0Zq.js";import"./vendor-motion-DjY2czvL.js";import"./vendor-pptx-B_NheIKl.js";import"./vendor-charts-CRXa4AlU.js";function g({vfsNodes:r,currentVfsParent:n,setCurrentVfsParent:t,cloudDrivePreviewNode:l,setCloudDrivePreviewNode:i}){return e.jsxs("div",{className:"flex-1 flex overflow-hidden min-h-0",children:[e.jsxs("div",{className:"w-64 border-r border-gray-100 flex flex-col bg-gray-50 shrink-0",children:[e.jsx("div",{className:"p-3 border-b border-gray-200 flex items-center gap-2",children:e.jsxs("button",{onClick:()=>{t(null),i(null)},className:`text-sm font-medium w-full text-left flex items-center gap-2 p-2 rounded cursor-pointer ${n===null?"bg-indigo-100 text-indigo-800 font-bold":"text-gray-600 hover:bg-gray-200"}`,children:[e.jsx(a,{size:16})," Data Root"]})}),e.jsxs("div",{className:"flex-1 overflow-y-auto p-2",children:[n&&e.jsxs("button",{onClick:()=>t(null),className:"flex items-center gap-2 p-2 text-xs text-indigo-600 w-full hover:bg-gray-200 rounded mb-2 font-medium cursor-pointer",children:[e.jsx(x,{className:"rotate-180",size:14})," Back to Root"]}),e.jsx("div",{className:"text-xs uppercase font-semibold text-gray-400 px-2 py-1 mb-1",children:"Current Path Nodes"}),r.filter(s=>s.type==="dir").map(s=>e.jsxs("button",{onClick:()=>{t(s.id),i(null)},className:"w-full text-left p-2 rounded text-sm text-gray-700 hover:bg-gray-200 flex items-center gap-2 group mb-1 cursor-pointer",children:[e.jsx(a,{size:14,className:"text-indigo-400 group-hover:text-indigo-600"}),e.jsx("span",{className:"truncate",children:s.name})]},s.id))]})]}),e.jsx("div",{className:"flex-1 flex flex-col bg-white overflow-hidden min-w-0",children:l?e.jsxs("div",{className:"flex-1 flex flex-col h-full min-h-0",children:[e.jsxs("div",{className:"p-3 border-b border-gray-100 bg-gray-50 flex items-center gap-2 shrink-0",children:[e.jsx("button",{onClick:()=>i(null),className:"text-gray-500 hover:text-gray-700 cursor-pointer",children:e.jsx(c,{size:16})}),e.jsxs("span",{className:"text-sm font-medium text-gray-700",children:["Previewing: ",l.name]})]}),l.name.endsWith(".html")||l.name.endsWith(".htm")||l.content?.includes("<html")?e.jsx("div",{className:"flex-1 relative bg-gray-50",children:e.jsx(o,{coursewareId:l.id})}):e.jsx("div",{className:"flex-1 overflow-y-auto p-6 bg-white prose prose-sm max-w-none",children:e.jsx(m,{children:l.content})})]}):e.jsx("div",{className:"flex-1 p-6 overflow-y-auto",children:e.jsxs("div",{className:"grid grid-cols-2 lg:grid-cols-3 xl:grid-cols-4 gap-4",children:[r.length===0&&e.jsx("div",{className:"col-span-full h-32 flex items-center justify-center text-sm text-gray-400 italic",children:"This directory is empty."}),r.map(s=>e.jsxs("div",{onClick:()=>{s.type==="dir"?t(s.id):i({id:s.id,name:s.name,content:s.content||"*(Empty file)*"})},className:"border border-gray-200 hover:border-indigo-300 hover:shadow-md cursor-pointer rounded-xl p-4 flex flex-col gap-3 transition-all bg-white",children:[e.jsx("div",{className:"p-3 rounded-xl w-12 h-12 flex items-center justify-center shrink-0 shadow-sm bg-gray-50 border border-gray-100",children:s.type==="dir"?e.jsx(a,{size:24,className:"text-indigo-500"}):e.jsx(d,{size:24,className:"text-gray-500"})}),e.jsx("div",{className:"text-sm font-medium text-gray-800 break-words",children:s.name})]},s.id))]})})})]})}function w(r){return r.isOpen?e.jsx("div",{className:"fixed inset-0 bg-gray-900/40 backdrop-blur-sm flex items-center justify-center p-6 z-50",children:e.jsxs("div",{className:"bg-white border text-gray-900 border-gray-200 rounded-2xl shadow-2xl w-full max-w-5xl h-[85vh] flex flex-col overflow-hidden",children:[e.jsxs("div",{className:"p-4 border-b border-gray-100 flex items-center justify-between bg-gray-50/80 shrink-0",children:[e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx(a,{size:20,className:"text-indigo-600"}),e.jsx("h2",{className:"font-semibold text-gray-800 text-lg",children:"Cloud Course Resource Browser"})]}),e.jsx("button",{onClick:r.onClose,className:"text-gray-400 hover:text-gray-600 font-bold p-1 hover:bg-gray-200 rounded transition-colors cursor-pointer",children:"×"})]}),e.jsx(g,{...r})]})}):null}export{w as CloudDriveModal,g as CloudDrivePanel};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as l,j as e}from"./vendor-react-0Lg0vA-4.js";import{a as X,M as q}from"./index-CYzNsYZB.js";import{B as p,d as G,ag as k,al as S,X as H,aI as K,U as _,aJ as Y,E as Q,j as ee,T as D,at as te,w as A}from"./vendor-icons-Dq6MhgH9.js";import"./vendor-pdf-Cp-cYteE.js";import"./vendor-utils-BEhuP0Zq.js";import"./vendor-motion-DjY2czvL.js";import"./vendor-pptx-B_NheIKl.js";import"./vendor-charts-CRXa4AlU.js";function ce({lang:t,session:M,lessons:d,lessonsSearchQuery:x,setLessonsSearchQuery:m,lessonsSortOrder:$,setLessonsSortOrder:E,filteredLessons:h,onOpenImportLessons:L,onOpenCourseWizard:y,onViewCourse:f,onDeleteCourse:T,onCopyCourse:I,filterEnrollment:j,setFilterEnrollment:F,filterHasContent:N,setFilterHasContent:O,filterThisMonth:v,setFilterThisMonth:R,copyingLessonId:U}){const B=X(s=>s.session),r=M||B,V=r?.username==="admin"||r?.userId==="usr_admin"||r?.role==="administrator"||r?.subRole==="administrator",[g,P]=l.useState(!1),[a,u]=l.useState(null),[i,o]=l.useState(null),[w,z]=l.useState(!1),[W,C]=l.useState(!1),Z=async s=>{u(s),o(null),C(!0);try{const c=await fetch(`/api/lessons/${s.id}/stats`);if(c.ok){const n=await c.json();o(n)}}catch{o({whiteboardCount:0,scheduleCount:0,enrollmentCount:0,assignmentCount:0})}finally{C(!1)}},J=async()=>{if(a){z(!0);try{await T(a.id),u(null),o(null)}finally{z(!1)}}};return e.jsxs("div",{className:"flex-1 flex flex-col gap-6 h-full overflow-y-auto",children:[e.jsxs("div",{className:"flex-1 bg-white border border-gray-200 rounded-xl shadow-sm flex flex-col min-h-0",children:[e.jsxs("div",{className:"p-4 border-b border-gray-100 flex items-center justify-between shrink-0",children:[e.jsxs("h3",{className:"font-medium text-gray-700 flex items-center gap-2",children:[e.jsx(p,{size:16,className:"text-gray-400"}),t==="zh"?"课程与教学环节管理 (SQLite)":"Courses & Lessons Management"]}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsxs("button",{id:"import-lessons-csv-btn",onClick:L,className:"flex items-center gap-1.5 px-3 py-1.5 text-xs bg-indigo-50 hover:bg-indigo-100 text-indigo-700 border border-indigo-200 font-semibold rounded-lg shadow-3xs transition-all hover:shadow-xs hover:-translate-y-0.5 cursor-pointer",children:[e.jsx(G,{size:14}),t==="zh"?"批量导入课程 (CSV)":"Import Lessons (CSV)"]}),e.jsxs("button",{id:"add-course-wizard-btn",onClick:y,className:"flex items-center gap-1.5 px-3 py-1.5 text-xs bg-indigo-600 hover:bg-indigo-700 text-white font-semibold rounded-lg shadow-sm transition-all hover:shadow-md hover:-translate-y-0.5 cursor-pointer",children:[e.jsx(k,{size:14}),t==="zh"?"手动添加课程 (向导)":"Add Course Wizard"]})]})]}),d.length>0&&e.jsxs("div",{className:"px-5 py-3.5 border-b border-gray-100 bg-gray-50/50 flex flex-col sm:flex-row items-center justify-between gap-3 shrink-0",children:[e.jsxs("div",{className:"flex flex-wrap items-center gap-3 w-full sm:w-auto",children:[e.jsxs("div",{className:"relative w-full sm:w-64",children:[e.jsx("span",{className:"absolute inset-y-0 left-0 flex items-center pl-3 pointer-events-none text-gray-400",children:e.jsx(S,{size:14})}),e.jsx("input",{type:"text",placeholder:"Search courses by title...",value:x,onChange:s=>m(s.target.value),className:"w-full pl-9 pr-8 py-1.5 text-xs bg-white border border-gray-200 rounded-lg focus:outline-none focus:ring-2 focus:ring-indigo-500 text-gray-800 shadow-sm"}),x&&e.jsx("button",{onClick:()=>m(""),className:"absolute inset-y-0 right-0 flex items-center pr-2.5 text-gray-400 hover:text-gray-600",children:e.jsx(H,{size:12,className:"bg-gray-100 hover:bg-gray-200 rounded-full p-0.5"})})]}),e.jsxs("div",{className:"flex items-center gap-1.5",children:[e.jsx("span",{className:"text-[11px] font-bold text-gray-400 uppercase tracking-wider",children:t==="zh"?"排序方式:":"Sort by:"}),e.jsxs("select",{value:$,onChange:s=>E(s.target.value),className:"bg-white border border-gray-200 text-xs text-gray-755 font-bold px-2.5 py-1.5 rounded-lg focus:outline-none focus:ring-2 focus:ring-indigo-500 shadow-sm",id:"courses-sort-select",children:[e.jsx("option",{value:"recent",children:t==="zh"?"最新创建":"Most Recent"}),e.jsx("option",{value:"alphabetical",children:t==="zh"?"按名称 (A-Z)":"Alphabetical (A-Z)"}),e.jsx("option",{value:"enrollment",children:t==="zh"?"学生选课人次":"Student Enrollment Count"})]})]})]}),e.jsxs("div",{className:"flex items-center gap-3 flex-wrap",children:[e.jsxs("div",{className:"flex items-center gap-1.5",children:[e.jsxs("button",{onClick:()=>P(!g),className:`px-2 py-1 text-[10px] font-bold rounded-md border transition-all cursor-pointer ${g?"bg-indigo-600 text-white border-indigo-600 shadow-2xs":"bg-white text-gray-600 border-gray-200 hover:border-gray-300"}`,title:t==="zh"?"只看我创建的课程":"Only show courses created by me",children:[e.jsx(K,{size:11,className:"inline mr-0.5 -mt-0.5"}),t==="zh"?"我的备课":"My Courses"]}),e.jsxs("button",{onClick:()=>F(!j),className:`px-2 py-1 text-[10px] font-bold rounded-md border transition-all cursor-pointer ${j?"bg-emerald-50 text-emerald-700 border-emerald-200":"bg-white text-gray-500 border-gray-200 hover:border-gray-300"}`,children:[e.jsx(_,{size:11,className:"inline mr-0.5 -mt-0.5"}),t==="zh"?"有人选":"Enrolled"]}),e.jsxs("button",{onClick:()=>O(!N),className:`px-2 py-1 text-[10px] font-bold rounded-md border transition-all cursor-pointer ${N?"bg-indigo-50 text-indigo-700 border-indigo-200":"bg-white text-gray-500 border-gray-200 hover:border-gray-300"}`,children:[e.jsx(p,{size:11,className:"inline mr-0.5 -mt-0.5"}),t==="zh"?"有内容":"Has Content"]}),e.jsx("button",{onClick:()=>R(!v),className:`px-2 py-1 text-[10px] font-bold rounded-md border transition-all cursor-pointer ${v?"bg-amber-50 text-amber-700 border-amber-200":"bg-white text-gray-500 border-gray-200 hover:border-gray-300"}`,children:t==="zh"?"本月":"This Month"})]}),e.jsxs("div",{className:"text-xs font-semibold text-gray-500",children:["Found ",e.jsx("span",{className:"text-indigo-650 font-bold",children:h.length})," of ",e.jsx("span",{className:"text-gray-700 font-bold",children:d.length})," course",d.length===1?"":"s"]})]})]}),e.jsx("div",{className:"flex-1 overflow-y-auto p-4",children:d.length===0?e.jsxs("div",{className:"flex flex-col items-center justify-center h-full text-gray-400 min-h-[300px]",children:[e.jsx(p,{size:48,className:"mb-4 opacity-30 text-indigo-500"}),e.jsx("h3",{className:"text-lg font-bold text-gray-800",children:t==="zh"?"暂无可用课程":"No Courses Available"}),e.jsx("p",{className:"mt-2 text-sm text-gray-500 text-center max-w-xs",children:t==="zh"?"系统中暂未部署任何课程。请通过下方按钮启动添加向导指南。":"There are no courses active in the system yet. Build your first curriculum!"}),e.jsxs("button",{id:"empty-add-course-btn",onClick:y,className:"mt-5 flex items-center gap-2 px-5 py-2.5 bg-indigo-600 hover:bg-indigo-700 text-white font-bold rounded-xl shadow-md transition-all cursor-pointer",children:[e.jsx(k,{size:16}),t==="zh"?"使用向导指南来创建新课程":"Create Course via Wizard"]})]}):h.length===0?e.jsxs("div",{className:"flex flex-col items-center justify-center h-full py-12 text-gray-450 text-center",children:[e.jsx(S,{size:44,className:"mb-3 opacity-30 text-gray-450"}),e.jsxs("h4",{className:"font-semibold text-gray-700 text-sm",children:['No Courses Match "',x,'"']}),e.jsx("p",{className:"text-xs text-gray-500 mt-1 max-w-xs",children:"Double-check the spelling or try searching for another curriculum keyword."}),e.jsx("button",{onClick:()=>m(""),className:"mt-3 text-xs bg-indigo-50 hover:bg-indigo-100 text-indigo-700 border border-indigo-200 font-semibold px-3 py-1.5 rounded-lg transition-colors",children:"Clear Search Filter"})]}):e.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 xl:grid-cols-3 gap-4",children:h.filter(s=>g?!s.creator_id||s.creator_id===r?.userId||s.creator_id===r?.username:!0).map(s=>{const c=U===s.id,n=!s.creator_id||s.creator_id===r?.userId||s.creator_id===r?.username,b=V||n;return e.jsxs("div",{className:`border border-gray-200 hover:border-indigo-300 rounded-xl p-4 flex flex-col bg-gray-50/50 hover:shadow-md transition-all ${c?"opacity-60 pointer-events-none":""}`,children:[e.jsxs("div",{className:"flex items-center justify-between mb-2 gap-2",children:[e.jsx("div",{className:"font-semibold text-gray-800 text-lg truncate cursor-pointer hover:text-indigo-600 transition-colors",title:s.title,onClick:()=>f(s.id),children:s.title}),e.jsxs("div",{className:"flex items-center gap-1.5 shrink-0",children:[s.creator_name?e.jsxs("span",{className:`text-[10px] font-medium px-1.5 py-0.5 rounded border flex items-center gap-0.5 ${n?"bg-indigo-50 text-indigo-700 border-indigo-200 font-semibold":"bg-slate-100 text-slate-600 border-slate-200"}`,title:t==="zh"?`创建教师: ${s.creator_name}`:`Created by: ${s.creator_name}`,children:[n?"👑 ":"👤 ",s.creator_name]}):null,e.jsxs("span",{className:"inline-flex items-center gap-1 bg-indigo-50 text-indigo-700 px-1.5 py-0.5 border border-indigo-100 rounded text-[10px] font-bold",children:[e.jsx(_,{size:10,className:"text-indigo-500"}),s.enrollment_count||0]})]})]}),e.jsx("div",{className:"text-sm text-gray-500 line-clamp-3 mb-4 flex-1",children:e.jsx(q,{children:s.content})}),e.jsxs("div",{className:"flex justify-between items-center mt-auto",children:[e.jsxs("div",{className:"text-xs text-gray-400",children:["ID: ",s.id.substring(0,8),"..."]}),e.jsxs("div",{className:"flex items-center gap-0.5",children:[e.jsx("button",{onClick:()=>f(s.id),className:"p-1.5 text-gray-400 hover:text-indigo-600 hover:bg-indigo-50 rounded transition-colors cursor-pointer",title:b?t==="zh"?"查看与编辑":"View & Edit":t==="zh"?"查看只读 (他人课程)":"View Read-Only",children:b?e.jsx(Y,{size:15}):e.jsx(Q,{size:15})}),e.jsx("button",{onClick:()=>I(s.id),className:"p-1.5 text-gray-400 hover:text-emerald-600 hover:bg-emerald-50 rounded transition-colors cursor-pointer",title:t==="zh"?"克隆为我的备课":"Clone Course",children:e.jsx(ee,{size:14})}),b?e.jsx("button",{onClick:()=>Z(s),className:"p-1.5 text-gray-400 hover:text-red-600 hover:bg-red-50 rounded transition-colors cursor-pointer",title:t==="zh"?"删除课程":"Delete Course",children:e.jsx(D,{size:14})}):e.jsx("span",{className:"p-1.5 text-gray-300 cursor-not-allowed",title:t==="zh"?"仅创建教师或管理员可删除":"Only creator or admin can delete",children:e.jsx(D,{size:14})})]})]})]},s.id)})})})]}),a&&e.jsx("div",{className:"fixed inset-0 bg-black/40 backdrop-blur-[2px] flex items-center justify-center z-[9999] p-4",children:e.jsxs("div",{className:"bg-white rounded-xl shadow-2xl max-w-md w-full border border-gray-100 overflow-hidden",children:[e.jsxs("div",{className:"px-5 py-4 border-b border-gray-100 bg-red-50 flex items-center gap-2",children:[e.jsx(te,{size:18,className:"text-red-600"}),e.jsx("h3",{className:"font-bold text-red-800 text-sm",children:t==="zh"?"确认删除课程":"Confirm Course Deletion"})]}),e.jsxs("div",{className:"p-5 space-y-3",children:[e.jsx("p",{className:"text-sm text-gray-700",children:t==="zh"?e.jsxs(e.Fragment,{children:["确定要删除课程 ",e.jsx("span",{className:"font-bold text-red-600",children:a.title})," 吗?"]}):e.jsxs(e.Fragment,{children:["Are you sure you want to delete ",e.jsx("span",{className:"font-bold text-red-600",children:a.title}),"?"]})}),e.jsx("p",{className:"text-xs text-red-600 font-medium",children:t==="zh"?"此操作不可撤销,将删除课程的所有关联数据。":"This action is irreversible and will delete all associated data."}),W?e.jsxs("div",{className:"flex items-center gap-2 text-xs text-gray-500 py-2",children:[e.jsx(A,{size:14,className:"animate-spin"}),t==="zh"?"正在统计关联数据...":"Counting related data..."]}):i?e.jsxs("div",{className:"bg-gray-50 rounded-lg p-3 space-y-1.5 text-xs",children:[e.jsxs("div",{className:"flex justify-between",children:[e.jsx("span",{className:"text-gray-600",children:t==="zh"?"白板元素":"Whiteboard Elements"}),e.jsx("span",{className:"font-bold text-gray-800",children:i.whiteboardCount})]}),e.jsxs("div",{className:"flex justify-between",children:[e.jsx("span",{className:"text-gray-600",children:t==="zh"?"排课记录":"Schedules"}),e.jsx("span",{className:"font-bold text-gray-800",children:i.scheduleCount})]}),e.jsxs("div",{className:"flex justify-between",children:[e.jsx("span",{className:"text-gray-600",children:t==="zh"?"选课学生":"Enrollments"}),e.jsx("span",{className:"font-bold text-gray-800",children:i.enrollmentCount})]}),e.jsxs("div",{className:"flex justify-between",children:[e.jsx("span",{className:"text-gray-600",children:t==="zh"?"作业任务":"Assignments"}),e.jsx("span",{className:"font-bold text-gray-800",children:i.assignmentCount})]})]}):null]}),e.jsxs("div",{className:"px-5 py-3 border-t border-gray-100 bg-gray-50 flex justify-end gap-2",children:[e.jsx("button",{onClick:()=>{u(null),o(null)},className:"px-4 py-2 text-xs font-medium text-gray-600 hover:bg-gray-100 border border-gray-200 rounded-lg transition-colors cursor-pointer",children:t==="zh"?"取消":"Cancel"}),e.jsxs("button",{onClick:J,disabled:w,className:"px-4 py-2 text-xs font-bold text-white bg-red-600 hover:bg-red-700 rounded-lg transition-colors cursor-pointer disabled:opacity-50 flex items-center gap-1.5",children:[w&&e.jsx(A,{size:12,className:"animate-spin"}),t==="zh"?"确认删除":"Confirm Delete"]})]})]})})]})}export{ce as CourseManagement};
|
|
1
|
+
import{r as l,j as e}from"./vendor-react-0Lg0vA-4.js";import{a as X,M as q}from"./index-Cwf8LQbY.js";import{B as p,d as G,ag as k,al as S,X as H,aI as K,U as _,aJ as Y,E as Q,j as ee,T as D,at as te,w as A}from"./vendor-icons-Dq6MhgH9.js";import"./vendor-pdf-Cp-cYteE.js";import"./vendor-utils-BEhuP0Zq.js";import"./vendor-motion-DjY2czvL.js";import"./vendor-pptx-B_NheIKl.js";import"./vendor-charts-CRXa4AlU.js";function ce({lang:t,session:M,lessons:d,lessonsSearchQuery:x,setLessonsSearchQuery:m,lessonsSortOrder:$,setLessonsSortOrder:E,filteredLessons:h,onOpenImportLessons:L,onOpenCourseWizard:y,onViewCourse:f,onDeleteCourse:T,onCopyCourse:I,filterEnrollment:j,setFilterEnrollment:F,filterHasContent:N,setFilterHasContent:O,filterThisMonth:v,setFilterThisMonth:R,copyingLessonId:U}){const B=X(s=>s.session),r=M||B,V=r?.username==="admin"||r?.userId==="usr_admin"||r?.role==="administrator"||r?.subRole==="administrator",[g,P]=l.useState(!1),[a,u]=l.useState(null),[i,o]=l.useState(null),[w,z]=l.useState(!1),[W,C]=l.useState(!1),Z=async s=>{u(s),o(null),C(!0);try{const c=await fetch(`/api/lessons/${s.id}/stats`);if(c.ok){const n=await c.json();o(n)}}catch{o({whiteboardCount:0,scheduleCount:0,enrollmentCount:0,assignmentCount:0})}finally{C(!1)}},J=async()=>{if(a){z(!0);try{await T(a.id),u(null),o(null)}finally{z(!1)}}};return e.jsxs("div",{className:"flex-1 flex flex-col gap-6 h-full overflow-y-auto",children:[e.jsxs("div",{className:"flex-1 bg-white border border-gray-200 rounded-xl shadow-sm flex flex-col min-h-0",children:[e.jsxs("div",{className:"p-4 border-b border-gray-100 flex items-center justify-between shrink-0",children:[e.jsxs("h3",{className:"font-medium text-gray-700 flex items-center gap-2",children:[e.jsx(p,{size:16,className:"text-gray-400"}),t==="zh"?"课程与教学环节管理 (SQLite)":"Courses & Lessons Management"]}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsxs("button",{id:"import-lessons-csv-btn",onClick:L,className:"flex items-center gap-1.5 px-3 py-1.5 text-xs bg-indigo-50 hover:bg-indigo-100 text-indigo-700 border border-indigo-200 font-semibold rounded-lg shadow-3xs transition-all hover:shadow-xs hover:-translate-y-0.5 cursor-pointer",children:[e.jsx(G,{size:14}),t==="zh"?"批量导入课程 (CSV)":"Import Lessons (CSV)"]}),e.jsxs("button",{id:"add-course-wizard-btn",onClick:y,className:"flex items-center gap-1.5 px-3 py-1.5 text-xs bg-indigo-600 hover:bg-indigo-700 text-white font-semibold rounded-lg shadow-sm transition-all hover:shadow-md hover:-translate-y-0.5 cursor-pointer",children:[e.jsx(k,{size:14}),t==="zh"?"手动添加课程 (向导)":"Add Course Wizard"]})]})]}),d.length>0&&e.jsxs("div",{className:"px-5 py-3.5 border-b border-gray-100 bg-gray-50/50 flex flex-col sm:flex-row items-center justify-between gap-3 shrink-0",children:[e.jsxs("div",{className:"flex flex-wrap items-center gap-3 w-full sm:w-auto",children:[e.jsxs("div",{className:"relative w-full sm:w-64",children:[e.jsx("span",{className:"absolute inset-y-0 left-0 flex items-center pl-3 pointer-events-none text-gray-400",children:e.jsx(S,{size:14})}),e.jsx("input",{type:"text",placeholder:"Search courses by title...",value:x,onChange:s=>m(s.target.value),className:"w-full pl-9 pr-8 py-1.5 text-xs bg-white border border-gray-200 rounded-lg focus:outline-none focus:ring-2 focus:ring-indigo-500 text-gray-800 shadow-sm"}),x&&e.jsx("button",{onClick:()=>m(""),className:"absolute inset-y-0 right-0 flex items-center pr-2.5 text-gray-400 hover:text-gray-600",children:e.jsx(H,{size:12,className:"bg-gray-100 hover:bg-gray-200 rounded-full p-0.5"})})]}),e.jsxs("div",{className:"flex items-center gap-1.5",children:[e.jsx("span",{className:"text-[11px] font-bold text-gray-400 uppercase tracking-wider",children:t==="zh"?"排序方式:":"Sort by:"}),e.jsxs("select",{value:$,onChange:s=>E(s.target.value),className:"bg-white border border-gray-200 text-xs text-gray-755 font-bold px-2.5 py-1.5 rounded-lg focus:outline-none focus:ring-2 focus:ring-indigo-500 shadow-sm",id:"courses-sort-select",children:[e.jsx("option",{value:"recent",children:t==="zh"?"最新创建":"Most Recent"}),e.jsx("option",{value:"alphabetical",children:t==="zh"?"按名称 (A-Z)":"Alphabetical (A-Z)"}),e.jsx("option",{value:"enrollment",children:t==="zh"?"学生选课人次":"Student Enrollment Count"})]})]})]}),e.jsxs("div",{className:"flex items-center gap-3 flex-wrap",children:[e.jsxs("div",{className:"flex items-center gap-1.5",children:[e.jsxs("button",{onClick:()=>P(!g),className:`px-2 py-1 text-[10px] font-bold rounded-md border transition-all cursor-pointer ${g?"bg-indigo-600 text-white border-indigo-600 shadow-2xs":"bg-white text-gray-600 border-gray-200 hover:border-gray-300"}`,title:t==="zh"?"只看我创建的课程":"Only show courses created by me",children:[e.jsx(K,{size:11,className:"inline mr-0.5 -mt-0.5"}),t==="zh"?"我的备课":"My Courses"]}),e.jsxs("button",{onClick:()=>F(!j),className:`px-2 py-1 text-[10px] font-bold rounded-md border transition-all cursor-pointer ${j?"bg-emerald-50 text-emerald-700 border-emerald-200":"bg-white text-gray-500 border-gray-200 hover:border-gray-300"}`,children:[e.jsx(_,{size:11,className:"inline mr-0.5 -mt-0.5"}),t==="zh"?"有人选":"Enrolled"]}),e.jsxs("button",{onClick:()=>O(!N),className:`px-2 py-1 text-[10px] font-bold rounded-md border transition-all cursor-pointer ${N?"bg-indigo-50 text-indigo-700 border-indigo-200":"bg-white text-gray-500 border-gray-200 hover:border-gray-300"}`,children:[e.jsx(p,{size:11,className:"inline mr-0.5 -mt-0.5"}),t==="zh"?"有内容":"Has Content"]}),e.jsx("button",{onClick:()=>R(!v),className:`px-2 py-1 text-[10px] font-bold rounded-md border transition-all cursor-pointer ${v?"bg-amber-50 text-amber-700 border-amber-200":"bg-white text-gray-500 border-gray-200 hover:border-gray-300"}`,children:t==="zh"?"本月":"This Month"})]}),e.jsxs("div",{className:"text-xs font-semibold text-gray-500",children:["Found ",e.jsx("span",{className:"text-indigo-650 font-bold",children:h.length})," of ",e.jsx("span",{className:"text-gray-700 font-bold",children:d.length})," course",d.length===1?"":"s"]})]})]}),e.jsx("div",{className:"flex-1 overflow-y-auto p-4",children:d.length===0?e.jsxs("div",{className:"flex flex-col items-center justify-center h-full text-gray-400 min-h-[300px]",children:[e.jsx(p,{size:48,className:"mb-4 opacity-30 text-indigo-500"}),e.jsx("h3",{className:"text-lg font-bold text-gray-800",children:t==="zh"?"暂无可用课程":"No Courses Available"}),e.jsx("p",{className:"mt-2 text-sm text-gray-500 text-center max-w-xs",children:t==="zh"?"系统中暂未部署任何课程。请通过下方按钮启动添加向导指南。":"There are no courses active in the system yet. Build your first curriculum!"}),e.jsxs("button",{id:"empty-add-course-btn",onClick:y,className:"mt-5 flex items-center gap-2 px-5 py-2.5 bg-indigo-600 hover:bg-indigo-700 text-white font-bold rounded-xl shadow-md transition-all cursor-pointer",children:[e.jsx(k,{size:16}),t==="zh"?"使用向导指南来创建新课程":"Create Course via Wizard"]})]}):h.length===0?e.jsxs("div",{className:"flex flex-col items-center justify-center h-full py-12 text-gray-450 text-center",children:[e.jsx(S,{size:44,className:"mb-3 opacity-30 text-gray-450"}),e.jsxs("h4",{className:"font-semibold text-gray-700 text-sm",children:['No Courses Match "',x,'"']}),e.jsx("p",{className:"text-xs text-gray-500 mt-1 max-w-xs",children:"Double-check the spelling or try searching for another curriculum keyword."}),e.jsx("button",{onClick:()=>m(""),className:"mt-3 text-xs bg-indigo-50 hover:bg-indigo-100 text-indigo-700 border border-indigo-200 font-semibold px-3 py-1.5 rounded-lg transition-colors",children:"Clear Search Filter"})]}):e.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 xl:grid-cols-3 gap-4",children:h.filter(s=>g?!s.creator_id||s.creator_id===r?.userId||s.creator_id===r?.username:!0).map(s=>{const c=U===s.id,n=!s.creator_id||s.creator_id===r?.userId||s.creator_id===r?.username,b=V||n;return e.jsxs("div",{className:`border border-gray-200 hover:border-indigo-300 rounded-xl p-4 flex flex-col bg-gray-50/50 hover:shadow-md transition-all ${c?"opacity-60 pointer-events-none":""}`,children:[e.jsxs("div",{className:"flex items-center justify-between mb-2 gap-2",children:[e.jsx("div",{className:"font-semibold text-gray-800 text-lg truncate cursor-pointer hover:text-indigo-600 transition-colors",title:s.title,onClick:()=>f(s.id),children:s.title}),e.jsxs("div",{className:"flex items-center gap-1.5 shrink-0",children:[s.creator_name?e.jsxs("span",{className:`text-[10px] font-medium px-1.5 py-0.5 rounded border flex items-center gap-0.5 ${n?"bg-indigo-50 text-indigo-700 border-indigo-200 font-semibold":"bg-slate-100 text-slate-600 border-slate-200"}`,title:t==="zh"?`创建教师: ${s.creator_name}`:`Created by: ${s.creator_name}`,children:[n?"👑 ":"👤 ",s.creator_name]}):null,e.jsxs("span",{className:"inline-flex items-center gap-1 bg-indigo-50 text-indigo-700 px-1.5 py-0.5 border border-indigo-100 rounded text-[10px] font-bold",children:[e.jsx(_,{size:10,className:"text-indigo-500"}),s.enrollment_count||0]})]})]}),e.jsx("div",{className:"text-sm text-gray-500 line-clamp-3 mb-4 flex-1",children:e.jsx(q,{children:s.content})}),e.jsxs("div",{className:"flex justify-between items-center mt-auto",children:[e.jsxs("div",{className:"text-xs text-gray-400",children:["ID: ",s.id.substring(0,8),"..."]}),e.jsxs("div",{className:"flex items-center gap-0.5",children:[e.jsx("button",{onClick:()=>f(s.id),className:"p-1.5 text-gray-400 hover:text-indigo-600 hover:bg-indigo-50 rounded transition-colors cursor-pointer",title:b?t==="zh"?"查看与编辑":"View & Edit":t==="zh"?"查看只读 (他人课程)":"View Read-Only",children:b?e.jsx(Y,{size:15}):e.jsx(Q,{size:15})}),e.jsx("button",{onClick:()=>I(s.id),className:"p-1.5 text-gray-400 hover:text-emerald-600 hover:bg-emerald-50 rounded transition-colors cursor-pointer",title:t==="zh"?"克隆为我的备课":"Clone Course",children:e.jsx(ee,{size:14})}),b?e.jsx("button",{onClick:()=>Z(s),className:"p-1.5 text-gray-400 hover:text-red-600 hover:bg-red-50 rounded transition-colors cursor-pointer",title:t==="zh"?"删除课程":"Delete Course",children:e.jsx(D,{size:14})}):e.jsx("span",{className:"p-1.5 text-gray-300 cursor-not-allowed",title:t==="zh"?"仅创建教师或管理员可删除":"Only creator or admin can delete",children:e.jsx(D,{size:14})})]})]})]},s.id)})})})]}),a&&e.jsx("div",{className:"fixed inset-0 bg-black/40 backdrop-blur-[2px] flex items-center justify-center z-[9999] p-4",children:e.jsxs("div",{className:"bg-white rounded-xl shadow-2xl max-w-md w-full border border-gray-100 overflow-hidden",children:[e.jsxs("div",{className:"px-5 py-4 border-b border-gray-100 bg-red-50 flex items-center gap-2",children:[e.jsx(te,{size:18,className:"text-red-600"}),e.jsx("h3",{className:"font-bold text-red-800 text-sm",children:t==="zh"?"确认删除课程":"Confirm Course Deletion"})]}),e.jsxs("div",{className:"p-5 space-y-3",children:[e.jsx("p",{className:"text-sm text-gray-700",children:t==="zh"?e.jsxs(e.Fragment,{children:["确定要删除课程 ",e.jsx("span",{className:"font-bold text-red-600",children:a.title})," 吗?"]}):e.jsxs(e.Fragment,{children:["Are you sure you want to delete ",e.jsx("span",{className:"font-bold text-red-600",children:a.title}),"?"]})}),e.jsx("p",{className:"text-xs text-red-600 font-medium",children:t==="zh"?"此操作不可撤销,将删除课程的所有关联数据。":"This action is irreversible and will delete all associated data."}),W?e.jsxs("div",{className:"flex items-center gap-2 text-xs text-gray-500 py-2",children:[e.jsx(A,{size:14,className:"animate-spin"}),t==="zh"?"正在统计关联数据...":"Counting related data..."]}):i?e.jsxs("div",{className:"bg-gray-50 rounded-lg p-3 space-y-1.5 text-xs",children:[e.jsxs("div",{className:"flex justify-between",children:[e.jsx("span",{className:"text-gray-600",children:t==="zh"?"白板元素":"Whiteboard Elements"}),e.jsx("span",{className:"font-bold text-gray-800",children:i.whiteboardCount})]}),e.jsxs("div",{className:"flex justify-between",children:[e.jsx("span",{className:"text-gray-600",children:t==="zh"?"排课记录":"Schedules"}),e.jsx("span",{className:"font-bold text-gray-800",children:i.scheduleCount})]}),e.jsxs("div",{className:"flex justify-between",children:[e.jsx("span",{className:"text-gray-600",children:t==="zh"?"选课学生":"Enrollments"}),e.jsx("span",{className:"font-bold text-gray-800",children:i.enrollmentCount})]}),e.jsxs("div",{className:"flex justify-between",children:[e.jsx("span",{className:"text-gray-600",children:t==="zh"?"作业任务":"Assignments"}),e.jsx("span",{className:"font-bold text-gray-800",children:i.assignmentCount})]})]}):null]}),e.jsxs("div",{className:"px-5 py-3 border-t border-gray-100 bg-gray-50 flex justify-end gap-2",children:[e.jsx("button",{onClick:()=>{u(null),o(null)},className:"px-4 py-2 text-xs font-medium text-gray-600 hover:bg-gray-100 border border-gray-200 rounded-lg transition-colors cursor-pointer",children:t==="zh"?"取消":"Cancel"}),e.jsxs("button",{onClick:J,disabled:w,className:"px-4 py-2 text-xs font-bold text-white bg-red-600 hover:bg-red-700 rounded-lg transition-colors cursor-pointer disabled:opacity-50 flex items-center gap-1.5",children:[w&&e.jsx(A,{size:12,className:"animate-spin"}),t==="zh"?"确认删除":"Confirm Delete"]})]})]})})]})}export{ce as CourseManagement};
|