openlearn-next 0.3.21 → 0.3.22

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.
Files changed (43) hide show
  1. package/README.md +161 -38
  2. package/dist/assets/{AdminDirectoryView-CGo33RNh.js → AdminDirectoryView-D-AOtp1o.js} +1 -1
  3. package/dist/assets/{BatchPickerModal-CPmu_uF8.js → BatchPickerModal-C9FH3J57.js} +1 -1
  4. package/dist/assets/{ClassesView-TVobZ_Vs.js → ClassesView-DTuyCvYd.js} +1 -1
  5. package/dist/assets/{CloudDriveModal-ul9v6wHK.js → CloudDriveModal-Bi-aMuax.js} +1 -1
  6. package/dist/assets/{ComputerLabView-DGha_J8B.js → ComputerLabView-DWMtMSHV.js} +1 -1
  7. package/dist/assets/{CourseManagement-DFQsUxE1.js → CourseManagement-CeelAyst.js} +1 -1
  8. package/dist/assets/{CourseWizardModal-D92teHMD.js → CourseWizardModal-m7TDgcB2.js} +1 -1
  9. package/dist/assets/{CoursewareHubPanel-CEK_QEc5.js → CoursewareHubPanel-C4LQjt4v.js} +1 -1
  10. package/dist/assets/{Dashboard-CY138ODd.js → Dashboard-CiBtG7Ge.js} +2 -2
  11. package/dist/assets/{ExportWeightModal-BvoODxwp.js → ExportWeightModal-C4d-0uTM.js} +1 -1
  12. package/dist/assets/{HelpTour-Dlc1vvy3.js → HelpTour-00eT17Vg.js} +1 -1
  13. package/dist/assets/{HelpView-CHkXbtfB.js → HelpView-B9Pny6u9.js} +4 -4
  14. package/dist/assets/{ImportLessonsModal-YuTV3mnv.js → ImportLessonsModal-hKRuw9p4.js} +1 -1
  15. package/dist/assets/{ImportModal-B2acbUT8.js → ImportModal-CVXHZ1Ei.js} +1 -1
  16. package/dist/assets/{InteractiveCoursewareViewer-BBeuViik.js → InteractiveCoursewareViewer-DMMAs2k_.js} +1 -1
  17. package/dist/assets/InteractiveWhiteboard-jpweQ094.js +77 -0
  18. package/dist/assets/{LazyCourseware-Du9MgZyH.js → LazyCourseware-DVgyrg3r.js} +2 -2
  19. package/dist/assets/{LazyWhiteboard-CpSzdON0.js → LazyWhiteboard-BSzsAPXC.js} +2 -2
  20. package/dist/assets/{LessonEditorView-D9YYZQyP.js → LessonEditorView-D4g48fr5.js} +1 -1
  21. package/dist/assets/LiveClassroomView-HQGhVwd_.js +1 -0
  22. package/dist/assets/{NotificationDetailModal-BthQNwyd.js → NotificationDetailModal-1MOkBDr_.js} +1 -1
  23. package/dist/assets/{PluginView-CQLEVURc.js → PluginView-D8cQ8mLM.js} +3 -3
  24. package/dist/assets/{ProcessLogsModal-MtK-Pe4R.js → ProcessLogsModal-gZ9LILYM.js} +1 -1
  25. package/dist/assets/{QuizGeneratorModal-Bp4pUx-H.js → QuizGeneratorModal-BFCJe1cm.js} +1 -1
  26. package/dist/assets/{StudentAssignmentView-B-jN_m_B.js → StudentAssignmentView-C34nleZT.js} +1 -1
  27. package/dist/assets/{StudentLessonView-8-zC7BLx.js → StudentLessonView-DNbu2o04.js} +1 -1
  28. package/dist/assets/{StudentPreviewModal-DZdcKy1x.js → StudentPreviewModal-BXbKzQgo.js} +1 -1
  29. package/dist/assets/{StudentView-Cg5G4Guz.js → StudentView-BF2WjF4_.js} +2 -2
  30. package/dist/assets/{SystemResourceLibraryModal-CJ16MGxn.js → SystemResourceLibraryModal-Ce-Dis6M.js} +1 -1
  31. package/dist/assets/TeacherView-BySyCiZG.js +2 -0
  32. package/dist/assets/{TimetableView-Do_LWpV2.js → TimetableView-0VaTfpz3.js} +4 -4
  33. package/dist/assets/index-C7jMgry5.js +216 -0
  34. package/dist/assets/index-huP36ZNf.css +1 -0
  35. package/dist/assets/{vendor-icons-B2DRJfZU.js → vendor-icons-30iiuCQb.js} +1 -1
  36. package/dist/index.html +2 -2
  37. package/dist/server.cjs +2689 -341
  38. package/package.json +21 -22
  39. package/dist/assets/InteractiveWhiteboard-BASy3Ak8.js +0 -78
  40. package/dist/assets/LiveClassroomView-B2lKKiZK.js +0 -1
  41. package/dist/assets/TeacherView-_n9QWf7y.js +0 -2
  42. package/dist/assets/index-BApV4fuy.js +0 -202
  43. package/dist/assets/index-Ch_mD6B0.css +0 -1
@@ -1 +0,0 @@
1
- import{r as c,j as e,R as nt}from"./vendor-react-B0t7H3hh.js";import{a5 as X,ad as Fe,ar as it,C as ot,aw as lt,O as Ne,ap as ve,U as dt,aD as ct,b as mt,t as We,i as xt,aB as Je,aC as Re,S as Ae,an as ht,F as ut,I as pt,J as ft,aI as bt,u as Oe,a4 as gt,w as we,y as Me,at as jt,E as yt,e as wt,au as Nt,Y as vt,a9 as zt}from"./vendor-icons-B2DRJfZU.js";import{L as St}from"./LazyWhiteboard-CpSzdON0.js";import{l as kt,d as $t,r as _t}from"./index-BApV4fuy.js";import"./vendor-utils-m0Urvtws.js";import"./vendor-pdf-Bw0ZQZtM.js";import"./vendor-motion-DjY2czvL.js";import"./vendor-pptx-C5-U7ieS.js";import"./vendor-charts-U9fLlNC_.js";function Pt({lessonId:l,lang:L,addToast:C}){const[le,g]=c.useState(!1),[Z,s]=c.useState(!1),[k,P]=c.useState([]),[M,u]=c.useState(60),[V,v]=c.useState(40),[T,z]=c.useState({}),[F,ee]=c.useState({}),[S,Q]=c.useState({}),[K,H]=c.useState({}),[R,q]=c.useState({}),[p,W]=c.useState({}),d=L==="zh",B=async(a=!1)=>{a?s(!0):g(!0);try{const f=await(await fetch(`/api/lessons/${l}/eval-grades`)).json();if(Array.isArray(f)){P(f);const b={},$={},y={},w={};f.forEach(o=>{o.grade?(b[o.id]=o.grade.teacher_score,$[o.id]=o.grade.teacher_comment,y[o.id]=Math.round(o.grade.teacher_weight*100),w[o.id]=Math.round(o.grade.peer_weight*100)):(b[o.id]=T[o.id]!==void 0?T[o.id]:80,$[o.id]=F[o.id]!==void 0?F[o.id]:"",y[o.id]=S[o.id]!==void 0?S[o.id]:M,w[o.id]=K[o.id]!==void 0?K[o.id]:V)}),z(o=>({...b,...o})),ee(o=>({...$,...o})),Q(o=>({...y,...o})),H(o=>({...w,...o}))}else throw new Error("Invalid submissions data format")}catch(h){console.error("Error fetching submissions grades:",h),C(d?"数据加载失败":"Failed to Load Data",d?"请检查网络连接或刷新页面。":"Please check your connection and try again.","warning")}finally{g(!1),s(!1)}};c.useEffect(()=>{l&&B()},[l]);const te=a=>{u(a),v(100-a),Q(h=>{const f={...h};return k.forEach(b=>{(!b.grade||b.grade.status!=="confirmed")&&(f[b.id]=a)}),f}),H(h=>{const f={...h};return k.forEach(b=>{(!b.grade||b.grade.status!=="confirmed")&&(f[b.id]=100-a)}),f})},se=(a,h)=>{Q(f=>({...f,[a]:h})),H(f=>({...f,[a]:100-h}))},de=async(a,h)=>{const f=T[a],b=F[a]||"",$=(S[a]??M)/100,y=(K[a]??V)/100;if(f===void 0||isNaN(f)||f<0||f>100){C(d?"评分无效":"Invalid Score",d?"教师评分必须在 0 到 100 之间!":"Teacher score must be between 0 and 100!","warning");return}if(h==="confirmed"){const w=d?"确认同步后,最终得分将直接同步写入宿主学期成绩库,此后该学生的作业成绩将锁定不可修改。是否确认?":"Once confirmed, the final score will be synced to the host semester reports and locked. Proceed?";if(!window.confirm(w))return}W(w=>({...w,[a]:h}));try{const o=await(await fetch("/api/commands",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({commandType:"assignment.grade",payload:{submissionId:a,teacherScore:Number(f),teacherComment:b,teacherWeight:$,peerWeight:y,status:h}})})).json();if(o.success)C(h==="confirmed"?d?"平时成绩同步成功":"Semester Grade Synced":d?"平时成绩草稿已保存":"Grade Draft Saved",h==="confirmed"?d?`已将平时成绩 ${o.result.calculatedFinalScore} 分同步至学期报告!`:`Successfully synced grade ${o.result.calculatedFinalScore}!`:d?"成功保存了教师打分与评语草稿。":"Successfully saved score and comment draft.","success"),B(!0);else throw new Error(o.error||"Failed to submit grade")}catch(w){C(d?"操作失败":"Operation Failed",w.message,"warning")}finally{W(w=>({...w,[a]:null}))}},ze=a=>{q(h=>({...h,[a]:!h[a]}))};return le?e.jsxs("div",{className:"flex-grow flex flex-col items-center justify-center py-12 text-gray-500",children:[e.jsx(X,{className:"animate-spin text-indigo-500 mb-2",size:32}),e.jsx("p",{className:"text-xs",children:d?"正在读取学生作业与成绩状态...":"Loading student submissions and grades..."})]}):e.jsxs("div",{className:"flex-1 flex flex-col min-h-0 w-full relative rounded-xl overflow-hidden border border-slate-200 shadow-md bg-white p-5 text-left",children:[e.jsxs("div",{className:"flex justify-between items-center pb-4 border-b border-slate-100 mb-4 gap-3 shrink-0",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsxs("h3",{className:"text-sm font-bold text-slate-800 flex items-center gap-1.5 select-none",children:[e.jsx(Fe,{size:16,className:"text-indigo-655"}),d?"学生作业成绩评定与折算系统":"Student Assignment Grading & Sync"]}),e.jsxs("span",{className:"text-xs bg-indigo-50 text-indigo-750 px-2 py-0.5 rounded-full border border-indigo-100 font-bold",children:[k.length," ",d?"个提交":"submissions"]})]}),e.jsx("button",{onClick:()=>B(!0),disabled:Z,className:"p-1.5 bg-white hover:bg-slate-55 border border-slate-200 rounded-lg text-slate-600 transition-colors flex items-center justify-center cursor-pointer shadow-4xs",title:d?"刷新数据":"Refresh",children:e.jsx(X,{size:12,className:Z?"animate-spin":""})})]}),e.jsxs("div",{className:"bg-slate-50 border border-slate-200 rounded-xl p-4 mb-5 shrink-0 flex flex-col md:flex-row md:items-center justify-between gap-4",children:[e.jsxs("div",{className:"flex items-start gap-2.5",children:[e.jsx(it,{className:"text-indigo-500 shrink-0 mt-0.5",size:16}),e.jsxs("div",{children:[e.jsx("h4",{className:"text-xs font-bold text-slate-700",children:d?"全局默认折算权重设置":"Default Grading Weights Configuration"}),e.jsx("p",{className:"text-xs text-slate-400 mt-0.5 font-medium",children:d?"调整权重分配,所有尚未锁定成绩的学生将自动应用此默认权重比例。":"Setting global default weights. Changes will automatically apply to non-confirmed grades."})]})]}),e.jsxs("div",{className:"flex items-center gap-4 shrink-0 bg-white px-3.5 py-2 rounded-lg border border-slate-200 shadow-3xs",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("span",{className:"text-xs font-bold text-slate-500",children:d?"教师评分:":"Teacher:"}),e.jsx("input",{type:"range",min:"0",max:"100",step:"5",value:M,onChange:a=>te(Number(a.target.value)),className:"w-20 accent-indigo-650 cursor-pointer"}),e.jsxs("span",{className:"text-xs font-bold text-indigo-700 w-8 text-right",children:[M,"%"]})]}),e.jsx("div",{className:"h-4 w-[1px] bg-slate-200"}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("span",{className:"text-xs font-bold text-slate-500",children:d?"学生互评:":"Peer Review:"}),e.jsxs("span",{className:"text-xs font-bold text-slate-700 w-8",children:[V,"%"]})]})]})]}),e.jsx("div",{className:"flex-grow flex-1 overflow-y-auto space-y-4 pr-1 scrollbar-thin",children:k.length===0?e.jsxs("div",{className:"h-full flex flex-col items-center justify-center py-12 text-slate-400 gap-2",children:[e.jsx(ot,{size:32,className:"text-slate-350"}),e.jsx("p",{className:"text-xs",children:d?"本节课目前没有任何学生提交作业。":"No students have submitted assignments yet for this lesson."})]}):k.map(a=>{const h=T[a.id]!==void 0?T[a.id]:80,f=F[a.id]||"",b=S[a.id]??M,$=K[a.id]??V,y=a.grade?.status==="confirmed",w=Math.round(h*(b/100)+a.peerAverageScore*($/100));return e.jsxs("div",{className:`bg-white border rounded-xl shadow-3xs overflow-hidden transition-all ${y?"border-emerald-200 bg-emerald-50/5":"border-slate-200"}`,children:[e.jsxs("div",{className:"px-4 py-3 bg-slate-50/50 border-b border-slate-100 flex flex-col md:flex-row md:items-center justify-between gap-3",children:[e.jsxs("div",{className:"flex items-center gap-2.5",children:[e.jsx("div",{className:"w-8 h-8 rounded-full bg-indigo-50 border border-indigo-100 flex items-center justify-center text-indigo-700 font-bold text-xs select-none",children:a.studentName?.charAt(0)||"S"}),e.jsxs("div",{children:[e.jsx("div",{className:"text-xs font-bold text-slate-800",children:a.studentName}),e.jsxs("div",{className:"text-xs text-slate-400 font-mono mt-0.5 flex items-center gap-1.5",children:[e.jsxs("span",{children:["V",a.version]}),e.jsx("span",{children:"•"}),e.jsx("span",{children:new Date(a.updatedAt).toLocaleString()})]})]})]}),e.jsxs("div",{className:"flex items-center gap-2",children:[y?e.jsxs("span",{className:"bg-emerald-55 text-emerald-700 text-xs font-black px-2.5 py-1 rounded-full border border-emerald-150 flex items-center gap-1 shadow-3xs select-none",children:[e.jsx(lt,{size:12}),d?"成绩已同步":"Synced to Reports"]}):e.jsx("span",{className:"bg-amber-50 text-amber-805 text-xs font-bold px-2 py-0.5 rounded-full border border-amber-200/60 select-none",children:a.grade?d?"草稿状态":"Draft":d?"未评定":"Ungraded"}),e.jsxs("a",{href:a.filePath,target:"_blank",rel:"noopener noreferrer",className:"text-xs text-indigo-600 hover:text-indigo-850 font-medium hover:underline flex items-center gap-1 bg-white border border-slate-200 px-2 py-1 rounded-lg shadow-4xs",title:a.filePath,children:[e.jsx(Ne,{size:11}),d?"查看作业":"View File",e.jsx(ve,{size:8})]})]})]}),e.jsxs("div",{className:"p-4 grid grid-cols-1 lg:grid-cols-12 gap-5",children:[e.jsxs("div",{className:"lg:col-span-5 flex flex-col gap-2.5 border-r border-slate-100 pr-0 lg:pr-5 text-left",children:[e.jsxs("div",{className:"flex justify-between items-center",children:[e.jsxs("span",{className:"text-xs font-bold text-slate-650 flex items-center gap-1 select-none",children:[e.jsx(dt,{size:13,className:"text-slate-400"}),d?"学生互评详情":"Peer Review Details"]}),e.jsxs("span",{className:"text-xs font-bold text-slate-500 bg-slate-100 px-2 py-0.5 rounded-md",children:[d?"互评人数:":"Reviews:"," ",a.peerReviews.length]})]}),e.jsxs("div",{className:"bg-slate-50 border border-slate-100 rounded-xl p-3 flex items-center gap-3",children:[e.jsxs("div",{className:"bg-white border border-slate-200 w-12 h-12 rounded-lg flex flex-col items-center justify-center shrink-0 shadow-3xs",children:[e.jsx("span",{className:"text-xs text-slate-405 select-none font-bold",children:d?"均分":"Avg"}),e.jsx("span",{className:"text-sm font-extrabold text-slate-700 leading-none mt-0.5",children:a.peerAverageScore})]}),e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsx("p",{className:"text-xs text-slate-450 leading-normal font-medium",children:a.peerReviews.length>0?d?"根据同学互评分数得出的平均值。":"Average score computed from classmate evaluations.":d?"暂无同学对此作业给出评分。":"No classmate peer reviews received yet."}),a.peerReviews.length>0&&e.jsx("button",{onClick:()=>ze(a.id),className:"text-xs text-indigo-650 hover:text-indigo-800 font-bold mt-1.5 flex items-center gap-0.5 cursor-pointer outline-none",children:R[a.id]?e.jsxs(e.Fragment,{children:[d?"收起互评详情":"Hide Details"," ",e.jsx(ct,{size:12})]}):e.jsxs(e.Fragment,{children:[d?"展开互评详情":"Show Details"," ",e.jsx(mt,{size:12})]})})]})]}),R[a.id]&&a.peerReviews.length>0&&e.jsx("div",{className:"mt-2 space-y-2 border-t border-slate-100 pt-2.5 max-h-40 overflow-y-auto scrollbar-thin",children:a.peerReviews.map(o=>e.jsxs("div",{className:"bg-white border border-slate-200 rounded-lg p-2.5 text-xs text-left shadow-4xs",children:[e.jsxs("div",{className:"flex justify-between items-center font-bold text-slate-700",children:[e.jsxs("span",{className:"flex items-center gap-1 font-semibold text-slate-655",children:[e.jsx("span",{className:"w-1.5 h-1.5 rounded-full bg-slate-300"}),o.reviewer_name]}),e.jsxs("span",{className:"text-indigo-650 bg-indigo-50 border border-indigo-100 rounded px-1.5 py-0.5 text-xs",children:[o.score," ",d?"分":"pts"]})]}),o.comment&&e.jsxs("p",{className:"text-xs text-slate-550 mt-1 italic pl-2.5 border-l-2 border-slate-100 font-medium",children:['"',o.comment,'"']})]},o.id))})]}),e.jsxs("div",{className:"lg:col-span-7 flex flex-col gap-3 justify-between",children:[e.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[e.jsxs("div",{children:[e.jsx("label",{className:"block text-xs font-bold text-slate-650 mb-1 select-none",children:d?"教师平时分评分 (0-100)":"Teacher Score (0-100)"}),e.jsxs("div",{className:"flex gap-2",children:[e.jsx("input",{id:`teacher_score_input_${a.id}`,type:"number",min:"0",max:"100",disabled:y,value:h,onChange:o=>z(I=>({...I,[a.id]:Math.min(100,Math.max(0,Number(o.target.value)))})),className:"bg-white border border-slate-250 rounded-lg text-xs font-bold text-slate-700 px-3 py-1.5 focus:ring-1 focus:ring-indigo-500 outline-none w-20 shadow-4xs disabled:opacity-50 disabled:bg-slate-50"}),e.jsx("input",{type:"range",min:"0",max:"100",disabled:y,value:h,onChange:o=>z(I=>({...I,[a.id]:Number(o.target.value)})),className:"flex-1 accent-indigo-650 disabled:opacity-40 cursor-pointer"})]})]}),e.jsxs("div",{children:[e.jsxs("div",{className:"flex justify-between items-center mb-1",children:[e.jsx("label",{className:"block text-xs font-bold text-slate-600 select-none",children:d?"打分占比 (教师权重)":"Teacher Score Weight"}),e.jsx("span",{className:"text-xs font-bold text-slate-400",children:d?`学生互评: ${$}%`:`Peer: ${$}%`})]}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("input",{id:`teacher_weight_input_${a.id}`,type:"range",min:"0",max:"100",step:"5",disabled:y,value:b,onChange:o=>se(a.id,Number(o.target.value)),className:"flex-1 accent-indigo-650 disabled:opacity-40 cursor-pointer"}),e.jsxs("span",{className:"text-xs font-extrabold text-indigo-750 w-9 text-right",children:[b,"%"]})]})]})]}),e.jsxs("div",{children:[e.jsx("label",{className:"block text-xs font-bold text-slate-655 mb-1 select-none",children:d?"教师评价评语":"Teacher Comments & Feedback"}),e.jsx("textarea",{id:`teacher_comment_input_${a.id}`,disabled:y,value:f,placeholder:d?"在此输入对学生作业作品的改进指导意见及评语。":"Enter guiding feedback for this student.",onChange:o=>ee(I=>({...I,[a.id]:o.target.value})),rows:2,className:"w-full bg-white border border-slate-250 rounded-lg text-xs p-2 focus:ring-1 focus:ring-indigo-500 outline-none shadow-4xs disabled:opacity-50 disabled:bg-slate-50 resize-none font-medium text-slate-700"})]}),e.jsxs("div",{className:"flex flex-col md:flex-row md:items-center justify-between gap-4 pt-2 border-t border-slate-100 mt-1",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("div",{className:`p-1.5 rounded-lg border flex items-center justify-center shrink-0 ${y?"bg-emerald-50 text-emerald-600 border-emerald-100":"bg-indigo-50 text-indigo-700 border-indigo-100"}`,children:e.jsx(We,{size:14})}),e.jsxs("div",{className:"text-xs text-slate-500 font-medium",children:[e.jsxs("div",{children:[d?"平时总分计算公式":"Calculated Final Grade",":"]}),e.jsxs("div",{className:"font-bold text-slate-700 mt-0.5 animate-formula",children:[b,"% × ",e.jsx("span",{className:"text-indigo-650 font-bold",children:h}),a.peerReviews.length>0&&` + ${$}% × ${a.peerAverageScore}`," = ",e.jsx("span",{className:y?"text-emerald-700 font-black text-xs":"text-indigo-700 font-black text-xs",children:y&&a.grade?.calculated_final_score||w}),d?"分":" pts"]})]})]}),!y&&e.jsxs("div",{className:"flex gap-2 justify-end shrink-0",children:[e.jsxs("button",{id:`teacher_draft_btn_${a.id}`,type:"button",disabled:!!p[a.id],onClick:()=>de(a.id,"draft"),className:"px-3 py-1.5 bg-white border border-slate-350 rounded-lg text-xs font-bold text-slate-700 hover:bg-slate-55 flex items-center gap-1.5 shadow-4xs cursor-pointer select-none disabled:opacity-50",children:[e.jsx(xt,{size:12}),p[a.id]==="draft"?d?"保存中...":"Saving...":d?"暂存草稿":"Save Draft"]}),e.jsxs("button",{id:`teacher_confirm_btn_${a.id}`,type:"button",disabled:!!p[a.id],onClick:()=>de(a.id,"confirmed"),className:"px-3.5 py-1.5 bg-indigo-600 border border-indigo-700 rounded-lg text-xs font-bold text-white hover:bg-indigo-700 flex items-center gap-1.5 shadow-3xs cursor-pointer select-none disabled:opacity-50",children:[e.jsx(Je,{size:12}),p[a.id]==="confirmed"?d?"同步中...":"Syncing...":d?"确认并同步":"Confirm & Sync"]})]})]})]})]})]},a.id)})})]})}function Tt({name:l,...L}){const C=zt[l];return C?nt.createElement(C,L):e.jsx(vt,{...L})}function Jt({selectedLesson:l,setSelectedLesson:L,lessons:C,classes:le,students:g,plugins:Z,lang:s,timelineSegments:k,activeSegmentId:P,setActiveSegmentId:M,liveClassSelectedClassId:u,setLiveClassSelectedClassId:V,liveClassIsActive:v,setLiveClassIsActive:T,liveClassTimeRemaining:z,setLiveClassTimeRemaining:F,liveClassFeed:ee,setLiveClassFeed:S,liveClassAcknowledgedMap:Q,setLiveClassAcknowledgedMap:K,elements:H,fetchElements:R,fetchStudents:q,addToast:p,onlineStudentIds:W,activeStudentLessons:d,liveClassStudentProgress:B,onPingStudent:te,onOpenCoursewareHub:se,activeRole:de,setActiveRole:ze}){const[a,h]=c.useState(!1),[f,b]=c.useState(!1),[$,y]=c.useState(null),[w,o]=c.useState(!1),[I,Se]=c.useState(null),[Ue,ke]=c.useState([]),ce=c.useRef(null),re=c.useRef({lesson:null,classId:null}),G=c.useRef(null),[$e,_e]=c.useState(!1),A=c.useRef(null),[Be,Ie]=c.useState(null),[_,me]=c.useState("whiteboard"),[ae,Ge]=c.useState([]),[xe,Pe]=c.useState(!1),[O,he]=c.useState(null),[ue,ne]=c.useState(null),[Le,Te]=c.useState(!1),[ie,Ve]=c.useState("all"),[pe,Ke]=c.useState(""),oe=async()=>{Pe(!0);try{const t=await fetch("/api/courseware/attempts");if(t.ok){const r=await t.json();Ge(r)}}catch(t){console.error("Failed to fetch attempts",t)}finally{Pe(!1)}};c.useEffect(()=>{_==="submissions"&&oe()},[_]),c.useEffect(()=>{const t=kt();return t.on("courseware-attempt-updated",()=>{oe()}),()=>{t.disconnect()}},[]);const qe=async t=>{if(!l||!u){p(s==="zh"?"⚠️ 无法操作":"⚠️ Action Prevented",s==="zh"?"请先在顶部栏选择要绑定的课节和班级。":"Please select lesson and class first.","warning");return}try{const r=await fetch(`/api/courseware/attempts/${t}/promote`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({lessonId:l,classId:u})});if(r.ok){const i=await r.json();p(s==="zh"?"✓ 学习数据已保存":"✓ Data Recorded",s==="zh"?`成功将该数据存入数据库!分数: ${i.score},已同步更新至学生学习进度。`:`Successfully recorded submission! Score: ${i.score}.`,"success"),oe(),q&&q()}else{const i=await r.json();throw new Error(i.error||"Server error")}}catch(r){p(s==="zh"?"❌ 保存失败":"❌ Save Failed",r.message||"Error occurred while saving.","warning")}},Qe=async t=>{he(t),Te(!0),ne(null);try{const r=await fetch(`/api/courseware/attempts/${t.attemptId}/raw`);if(r.ok){const i=await r.json();ne(i)}else ne({error:"Failed to load raw data"})}catch(r){ne({error:r.message||"Error loading data"})}finally{Te(!1)}},J=!!(u&&g.filter(t=>t.locked_lesson_id===l).length>0),He=()=>{if(G.current&&!G.current.closed){G.current.focus(),p(s==="zh"?"🎓 学生Tab已激活":"🎓 Student Tab Focused",s==="zh"?"已将联动学生端浏览器Tab置顶激活。":"Focused the student browser tab.","info");return}const t=g[0],r=t?.id||"student-demo",i=t?.name||(s==="zh"?"演示学生":"Demo Student"),n=l||"",m=u||"",x=`${window.location.origin}${window.location.pathname}?mode=student_live&studentId=${encodeURIComponent(r)}&lessonId=${encodeURIComponent(n)}&classId=${encodeURIComponent(m)}#/student_live`,j=window.open(x,"_blank");if(!j||j.closed){p(s==="zh"?"⚠️ 新Tab打开被拦截":"⚠️ Tab Open Blocked",s==="zh"?"请在浏览器设置中允许打开新标签页,以查看联动学生端。":"Please allow new tabs in browser settings.","warning");return}G.current=j,_e(!0);const N=setInterval(()=>{(!G.current||G.current.closed)&&(_e(!1),G.current=null,clearInterval(N))},1e3);p(s==="zh"?"🎓 学生端新Tab已打开":"🎓 Student Tab Opened",s==="zh"?`已在独立浏览器Tab中打开【${i}】学生端,教师端所有操作将实时同步!`:`Opened student tab for ${i}. Operations are syncing in real time!`,"success")};c.useEffect(()=>{const t=new $t;A.current=t;const r=t.onMessage(i=>{if(i.type==="STUDENT_HANDSHAKE_REQUEST")t.broadcastInitState({selectedLesson:l,activeSegmentId:P,activeTab:_==="submissions"?"courseware":_,isClassLocked:J,liveClassTimeRemaining:z,liveClassSelectedClassId:u,liveClassIsActive:v,fullscreenElementId:Be});else if(i.type==="STUDENT_ACKNOWLEDGE_PICK"){const n=i.payload.studentId,m=g.find(x=>x.id===n)?.name||n;K(x=>{const j=new Map(x);return j.set(n,!0),j}),S(x=>[{id:`feed-ack-${n}-${Date.now()}`,time:new Date().toLocaleTimeString(),type:"checkin",message:s==="zh"?`学生【${m}】已在独立视窗中确认点名并举手答到!`:`Student "${m}" acknowledged classroom pick from student window!`},...x]),p(s==="zh"?"🙋‍♂️ 学生已举手应答":"🙋‍♂️ Student Acknowledged",s==="zh"?`学生【${m}】已在独立视窗中确认收到点名!`:`Student "${m}" acknowledged!`,"success")}});return()=>{r(),t.destroy(),A.current=null}},[l,P,_,J,z,u,v,g,s]),c.useEffect(()=>{A.current?.broadcastChangeLesson(l)},[l]),c.useEffect(()=>{A.current?.broadcastChangeSegment(P)},[P]),c.useEffect(()=>{A.current?.broadcastChangeTab(_==="submissions"?"courseware":_)},[_]),c.useEffect(()=>{A.current?.broadcastLockClass(J)},[J]),c.useEffect(()=>{A.current?.broadcastSyncTimer(z,v)},[z,v]);const Ye=Z.filter(t=>t.status==="active"),fe=Array.from(new Map(Ye.flatMap(t=>{try{const r=typeof t.manifest=="string"?JSON.parse(t.manifest):t.manifest,i=r.classroomTools||[],n=r.contributes?.["classroom.tool"]||[];return[...i,...n].map(m=>({...m,pluginId:t.id,manifestId:r.id}))}catch{return[]}}).map(t=>[t.id,t])).values());c.useEffect(()=>(v&&z>0?ce.current=setInterval(()=>{F(z-1)},1e3):z===0&&v&&(p(s==="zh"?"⏰ 环节时间到":"⏰ Phase Timer Ended",s==="zh"?"当前教学环节设定的时间已耗尽,建议转入下一环节。":"The current segment duration has elapsed. Transition recommended.","warning"),T(!1)),()=>{ce.current&&clearInterval(ce.current)}),[v,z]),c.useEffect(()=>{if(!l||!u){re.current={lesson:null,classId:null};return}(re.current.lesson!==l||re.current.classId!==u)&&(re.current={lesson:l,classId:u},De(!0))},[l,u]);const Xe=t=>{const r=parseInt(t.replace(/[^0-9]/g,""));return isNaN(r)?300:t.includes("s")?r:r*60},Ze=t=>{M(t.id);const r=Xe(t.duration);F(r),T(!0),S(i=>[{id:Math.random().toString(),time:new Date().toLocaleTimeString([],{hour:"2-digit",minute:"2-digit",second:"2-digit"}),type:"info",message:`教学环节切换并广播:进入 [${t.title}] 环节,设定时间 ${t.duration}。`},...i]),p(s==="zh"?"📢 环节已广播":"📢 Phase Synchronized",s==="zh"?`已同步广播 [${t.title}] 环节至所有在线学生端。`:`Broadcasted phase [${t.title}] to all active students.`,"success")},De=async t=>{if(!u||!l){p(s==="zh"?"⚠️ 无法操作":"⚠️ Action Prevented",s==="zh"?"请先选择需要授课的课节及班级。":"Please select a lesson and class first.","warning");return}h(!0);try{const r=t?`/api/classes/${u}/lock_lesson`:`/api/classes/${u}/unlock_lesson`;(await fetch(r,{method:"POST",headers:{"Content-Type":"application/json"},body:t?JSON.stringify({lessonId:l}):void 0})).ok&&(await q(),S(n=>[{id:Math.random().toString(),time:new Date().toLocaleTimeString([],{hour:"2-digit",minute:"2-digit",second:"2-digit"}),type:t?"warning":"info",message:t?"已对全班学生强制锁定专注模式(限定当前课程)。":"已解锁全班学生专注模式限制。"},...n]),p(s==="zh"?"🔒 锁状态更新":"🔒 Class Status Updated",t?"全班专注锁定成功,学生将无法切回主页。":"全班屏幕解锁成功,学生已恢复自由浏览。","success"))}catch(r){console.error("Failed to toggle class focus lock",r)}finally{h(!1)}},et=async(t,r)=>{const i=r?null:l;try{if((await fetch(`/api/students/${t}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({locked_lesson_id:i})})).ok){await q();const m=g.find(x=>x.id===t)?.name||t;S(x=>[{id:Math.random().toString(),time:new Date().toLocaleTimeString([],{hour:"2-digit",minute:"2-digit",second:"2-digit"}),type:i?"warning":"info",message:i?`已针对学生 [${m}] 单独开启专注限制锁定。`:`已解锁学生 [${m}] 的专注限制。`},...x])}}catch(n){console.error("Failed to toggle student lock",n)}},tt=async t=>{if(!l){p(s==="zh"?"⚠️ 请选择课节":"⚠️ Select Lesson",s==="zh"?"请先选择要授课的课节。":"Please select a lesson first.","warning");return}if(JSON.stringify(t.payload||"").includes("$classId")&&!u){p(s==="zh"?"⚠️ 请选择班级":"⚠️ Select Class",s==="zh"?"该工具需要指定上课班级,请在顶部先选择班级。":"Please select class first for this tool.","warning");return}S(i=>[{id:Math.random().toString(),time:new Date().toLocaleTimeString([],{hour:"2-digit",minute:"2-digit",second:"2-digit"}),type:"info",message:`正在运行插件工具 [${t.name}]...`},...i]);try{const i=JSON.parse(JSON.stringify(t.payload||{}).replace(/\$classId/g,u||"").replace(/\$lessonId/g,l||""));if(i.type==="plugin"&&i.data)try{const j=JSON.parse(i.data);!j.segmentId&&P&&(j.segmentId=P,i.data=JSON.stringify(j))}catch{}const m=!/^(whiteboard|lesson|assignment|class|student|vfs|plugin|ai|agent|system)\./.test(t.commandType)&&t.manifestId?_t(t.commandType,t.manifestId):t.commandType,x=await fetch("/api/commands",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({commandType:m,payload:i})});if(x.ok)se&&(t.id==="courseware-hub-teacher"||t.commandType==="courseware.open_panel")&&se(),S(j=>[{id:Math.random().toString(),time:new Date().toLocaleTimeString([],{hour:"2-digit",minute:"2-digit",second:"2-digit"}),type:"success",message:`插件工具 [${t.name}] 执行完毕,数据成功下发。`},...j]),p(s==="zh"?"✓ 工具下发成功":"✓ Tool Synchronized",s==="zh"?`工具 [${t.name}] 已成功在当前白板上部署并投射。`:`Tool [${t.name}] synchronized successfully.`,"success"),await R(l);else{const j=await x.json();throw new Error(j.error||"Server error")}}catch(i){S(n=>[{id:Math.random().toString(),time:new Date().toLocaleTimeString([],{hour:"2-digit",minute:"2-digit",second:"2-digit"}),type:"error",message:`运行插件工具 [${t.name}] 失败: ${i.message}`},...n]),p(s==="zh"?"❌ 运行失败":"❌ Tool Failed",i.message||"Execution error","warning")}},st=()=>{if(g.length===0||w)return;const t=g.filter(x=>W.includes(x.id)&&d[x.id]===l);if(t.length===0){p(s==="zh"?"⚠️ 无法抽问":"⚠️ Cannot Draw",s==="zh"?"当前课堂中没有已进入的活跃学生。":"No students have entered the classroom yet.","warning");return}o(!0);let r=0;const i=18;let n=75;const m=()=>{const x=Math.floor(Math.random()*t.length),j=t[x];if(Se(j.id),r++,r<i)r>i-5&&(n+=45),setTimeout(m,n);else{const N=t[x];Se(null),o(!1),ke(D=>D.includes(N.id)?D:[...D,N.id]),S(D=>[{id:Math.random().toString(),time:new Date().toLocaleTimeString([],{hour:"2-digit",minute:"2-digit",second:"2-digit"}),type:"success",message:`🎯 随机提问抽选:学生 [${N.name}] 被抽中回答问题!`},...D]),p(s==="zh"?"🎯 随机提问抽选":"🎯 Student Drawn",s==="zh"?`恭喜学生 [${N.name}] 被抽中回答问题!`:`Student [${N.name}] was selected to answer!`,"success"),A.current?.broadcastPickStudent(N.id,N.name),setTimeout(()=>{ke(D=>D.filter(be=>be!==N.id))},8e3)}};setTimeout(m,n)},rt=t=>{const r=Math.floor(t/60),i=t%60;return`${r.toString().padStart(2,"0")}:${i.toString().padStart(2,"0")}`};return e.jsxs("div",{className:"flex-grow flex-1 flex flex-col min-h-0 bg-surface border border-theme rounded-2xl shadow-xl text-main overflow-hidden font-sans",children:[e.jsxs("div",{className:"bg-surface-secondary p-4 border-b border-theme flex flex-wrap items-center justify-between gap-4 shrink-0",children:[e.jsxs("div",{className:"flex items-center gap-3 select-none",children:[e.jsxs("div",{className:"relative flex items-center justify-center",children:[e.jsx("span",{className:`w-3 h-3 rounded-full ${v?"bg-emerald-500 animate-ping":"bg-rose-500"} absolute`}),e.jsx("span",{className:`w-2 h-2 rounded-full ${v?"bg-emerald-500":"bg-rose-500"} relative`})]}),e.jsx("h2",{className:"text-sm font-extrabold tracking-tight text-main flex items-center gap-2",children:s==="zh"?"🔴 智能授课工作流控制中心":"🔴 Active Lesson control center"})]}),e.jsxs("div",{className:"flex items-center gap-2.5 flex-wrap",children:[e.jsx("div",{children:e.jsxs("select",{value:l||"",onChange:t=>{const r=t.target.value===""?null:t.target.value;L(r),r&&R(r)},className:"bg-surface border border-theme rounded-lg text-xs font-semibold px-3 py-1.5 focus:ring-1 focus:ring-primary-theme text-main outline-none cursor-pointer hover:bg-surface-secondary transition-colors",children:[e.jsx("option",{value:"",children:s==="zh"?"-- 选择授课课节 --":"-- Select Lesson --"}),C.map(t=>e.jsx("option",{value:t.id,children:t.title},t.id))]})}),e.jsx("div",{children:e.jsxs("select",{value:u||"",onChange:t=>V(t.target.value===""?null:t.target.value),className:"bg-surface border border-theme rounded-lg text-xs font-semibold px-3 py-1.5 focus:ring-1 focus:ring-primary-theme text-main outline-none cursor-pointer hover:bg-surface-secondary transition-colors",children:[e.jsx("option",{value:"",children:s==="zh"?"-- 选择授课班级 --":"-- Select Class --"}),le.map(t=>e.jsx("option",{value:t.id,children:t.name},t.id))]})}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("button",{onClick:He,className:`px-3 py-1.5 text-xs font-bold rounded-lg transition-all cursor-pointer flex items-center gap-1.5 shadow-sm active:scale-95 ${$e?"bg-emerald-600 hover:bg-emerald-700 text-white ring-2 ring-emerald-400/50 shadow-emerald-500/20":"bg-gradient-to-r from-pink-600 to-rose-600 hover:from-pink-700 hover:to-rose-700 text-white"}`,title:s==="zh"?"在独立浏览器新Tab中打开学生端预览,可与当前教师端分屏实时操作联动":"Open student preview in a new browser tab to sync with teacher operations side-by-side",children:$e?e.jsxs(e.Fragment,{children:[e.jsxs("span",{className:"relative flex h-2 w-2",children:[e.jsx("span",{className:"animate-ping absolute inline-flex h-full w-full rounded-full bg-emerald-300 opacity-75"}),e.jsx("span",{className:"relative inline-flex rounded-full h-2 w-2 bg-emerald-200"})]}),e.jsxs("span",{children:["🎓 ",s==="zh"?"学生端已联动 (激活Tab)":"Student Linked (Focus Tab)"]}),e.jsx(ve,{size:12,className:"opacity-90"})]}):e.jsxs(e.Fragment,{children:[e.jsxs("span",{children:["🎓 ",s==="zh"?"学生视角预览 (独立Tab)":"Student Preview (New Tab)"]}),e.jsx(ve,{size:12,className:"opacity-90"})]})}),e.jsxs("button",{onClick:()=>De(!J),disabled:a||!l||!u,className:`px-3 py-1.5 rounded-lg font-bold text-xs uppercase tracking-wider flex items-center gap-1.5 shadow-sm transition-all active:scale-95 disabled:opacity-50 cursor-pointer ${J?"bg-rose-500 hover:bg-rose-600 text-white":"bg-indigo-600 hover:bg-indigo-700 text-white"}`,children:[J?e.jsx(Re,{size:12}):e.jsx(Ae,{size:12}),e.jsx("span",{children:J?s==="zh"?"一键解锁全班":"Unlock Entire Class":s==="zh"?"全班专注锁定":"Lock Class Screen"})]})]})]})]}),e.jsxs("div",{className:"flex-1 flex overflow-hidden min-h-0 bg-surface-secondary/30",children:[!f&&e.jsxs("div",{className:"w-[220px] shrink-0 bg-surface p-3.5 border-r border-theme flex flex-col gap-4 overflow-y-auto",children:[e.jsxs("div",{children:[e.jsxs("div",{className:"flex items-center justify-between mb-2 select-none",children:[e.jsx("h3",{className:"text-xs font-black uppercase text-muted tracking-wider",children:s==="zh"?"教学步骤与时间管理":"Lesson Segments & Phases"}),e.jsx("button",{onClick:()=>b(!0),className:"p-1 rounded bg-surface-secondary hover:bg-surface border border-theme text-muted hover:text-main transition-colors cursor-pointer",title:s==="zh"?"折叠导航栏":"Collapse Sidebar",children:e.jsx(ht,{size:10})})]}),e.jsxs("div",{className:"bg-surface-secondary border border-theme rounded-xl p-3 flex flex-col items-center justify-center gap-1 shadow-sm",children:[e.jsxs("span",{className:"text-xs uppercase tracking-widest text-muted font-semibold flex items-center gap-1",children:[e.jsx(ut,{size:11,className:v?"animate-spin":"",style:{animationDuration:"4s"}}),s==="zh"?"当前步骤剩余时间":"Phase Remaining"]}),e.jsx("div",{className:`text-2xl font-black font-mono tracking-widest ${v?"text-primary-theme":"text-muted"}`,children:rt(z)}),e.jsxs("div",{className:"flex gap-1.5 w-full mt-2 shrink-0",children:[e.jsxs("button",{onClick:()=>T(!v),disabled:z<=0,className:"flex-1 py-1 rounded bg-surface hover:bg-surface-secondary text-xs font-bold text-main transition-all disabled:opacity-40 flex items-center justify-center gap-1 border border-theme",children:[v?e.jsx(pt,{size:10}):e.jsx(ft,{size:10}),e.jsx("span",{children:v?s==="zh"?"暂停":"Pause":s==="zh"?"开始":"Start"})]}),e.jsx("button",{onClick:()=>{T(!1),F(0)},className:"py-1 px-2.5 rounded bg-surface hover:bg-rose-500/10 text-xs font-bold text-rose-500 hover:text-rose-600 transition-all flex items-center justify-center border border-theme",title:"重置",children:e.jsx(bt,{size:10})})]})]})]}),e.jsxs("div",{className:"flex-1 flex flex-col gap-2 min-h-0",children:[e.jsx("h4",{className:"text-xs font-black uppercase text-muted tracking-wider select-none",children:s==="zh"?"教学环节进度表":"Timeline Segments"}),l?e.jsx("div",{className:"space-y-2 overflow-y-auto flex-1 pr-1.5 scrollbar-thin",children:k.map((t,r)=>{const i=P===t.id;return e.jsxs("div",{className:`p-2.5 rounded-xl border transition-all flex flex-col gap-1.5 ${i?"bg-primary-theme/10 border-primary-theme/40 shadow-sm":"bg-surface border-theme hover:bg-surface-secondary"}`,children:[e.jsxs("div",{className:"flex justify-between items-start",children:[e.jsxs("span",{className:`text-xs font-bold ${i?"text-primary-theme":"text-main"}`,children:[r+1,". ",t.title]}),e.jsx("span",{className:"text-xs font-mono px-1 py-0.5 rounded bg-surface-secondary text-muted border border-theme",children:t.duration})]}),e.jsx("div",{className:`text-xs line-clamp-2 leading-relaxed ${i?"text-primary-theme":"text-muted"}`,children:t.notes||"无步骤描述备注信息。"}),e.jsxs("button",{onClick:()=>Ze(t),className:`w-full py-1 rounded text-xs font-bold transition-all cursor-pointer flex items-center justify-center gap-1 ${i?"bg-primary-theme text-white hover:bg-primary-theme-hover shadow-sm":"bg-surface-secondary text-muted hover:text-main hover:bg-surface border border-theme"}`,children:[e.jsx(Oe,{size:10}),e.jsx("span",{children:i?s==="zh"?"同步演示中":"Broadcasting":s==="zh"?"广播此环节":"Broadcast Step"})]})]},t.id)})}):e.jsx("div",{className:"text-xs text-muted italic py-4 text-center",children:s==="zh"?"请选择一个课节加载流程表":"Select a lesson to view schedule."})]})]}),e.jsx("div",{className:"flex-1 flex flex-col min-w-0 bg-surface-secondary/40 p-3 gap-3 relative",children:l?e.jsxs("div",{className:"w-full h-full relative flex flex-col min-h-0",children:[e.jsxs("div",{className:"flex justify-between items-center px-1.5 py-1 select-none text-muted text-xs uppercase font-extrabold tracking-wide shrink-0 mb-1",children:[e.jsxs("div",{className:"flex items-center gap-3",children:[f&&e.jsxs("button",{onClick:()=>b(!1),className:"p-1 rounded-lg bg-surface hover:bg-surface-secondary border border-theme text-primary-theme hover:text-primary-theme-hover transition-colors cursor-pointer mr-1.5 flex items-center gap-1 shadow-sm",title:s==="zh"?"展开环节大纲":"Expand Sidebar",children:[e.jsx(gt,{size:10}),e.jsx("span",{className:"text-xs font-bold tracking-wider",children:s==="zh"?"展开":"Expand"})]}),e.jsxs("div",{className:"bg-surface-secondary p-0.5 rounded-lg flex items-center gap-1 border border-theme",children:[e.jsx("button",{onClick:()=>me("whiteboard"),className:`px-3 py-1 rounded-md text-xs font-bold transition-all cursor-pointer ${_==="whiteboard"?"bg-surface text-primary-theme shadow-sm":"text-muted hover:text-main"}`,children:s==="zh"?"💻 演示白板":"💻 Whiteboard"}),e.jsx("button",{onClick:()=>me("submissions"),className:`px-3 py-1 rounded-md text-xs font-bold transition-all cursor-pointer ${_==="submissions"?"bg-surface text-primary-theme shadow-sm":"text-muted hover:text-main"}`,children:s==="zh"?"📊 学生提交数据":"📊 Student Submissions"}),e.jsx("button",{id:"teacher_assignment_eval_tab_btn",onClick:()=>me("assignment"),className:`px-3 py-1 rounded-md text-xs font-bold transition-all cursor-pointer ${_==="assignment"?"bg-surface text-primary-theme shadow-sm":"text-muted hover:text-main"}`,children:s==="zh"?"🎓 作业成绩评定":"🎓 Assignment Grades"})]})]}),e.jsxs("span",{className:"text-primary-theme font-mono tracking-widest animate-pulse flex items-center gap-1",children:[e.jsx(we,{size:10})," Live Broadcaster Connected"]})]}),_==="whiteboard"?e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"flex-grow flex-1 min-h-0 w-full relative rounded-xl overflow-hidden border border-theme shadow-md bg-surface flex flex-col",children:e.jsx(St,{lessonId:l,userRole:"teacher",isEditMode:!1,broadcastFullscreen:!0,fullscreenBroadcastClassId:u,onFullscreenSync:t=>{Ie(t),A.current?.broadcastFullscreen(t,l||void 0)},elements:H,activeSegmentId:P,onSegmentSync:t=>M(t),onElementAdd:async(t,r)=>{await fetch(`/api/lessons/${l}/whiteboard`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({type:t,data:r})}),R(l)},onElementUpdate:async(t,r)=>{await fetch(`/api/lessons/${l}/whiteboard/${t}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({data:r})}),R(l)},onElementDelete:async t=>{await fetch(`/api/lessons/${l}/whiteboard/${t}`,{method:"DELETE"}),R(l)},onRefresh:()=>R(l)})}),e.jsxs("div",{className:"mt-3 bg-surface border border-theme rounded-xl p-3 shadow-sm shrink-0 flex flex-col gap-2 relative z-30",children:[e.jsxs("div",{className:"flex items-center justify-between text-xs uppercase font-black text-muted tracking-wider select-none",children:[e.jsxs("span",{className:"flex items-center gap-1.5 text-primary-theme",children:[e.jsx(Me,{size:12,className:"text-primary-theme animate-pulse"}),e.jsx("span",{children:s==="zh"?"互动工具 (插件扩展)":"Classroom Interactive Tools"})]}),e.jsxs("span",{className:"text-xs text-muted font-mono",children:["Plugins: ",fe.length," Active"]})]}),fe.length>0?e.jsx("div",{className:"flex gap-2.5 overflow-x-auto py-0.5 pr-2 scrollbar-thin",children:fe.map(t=>e.jsxs("button",{onClick:()=>tt(t),disabled:!l,className:"p-2 bg-surface-secondary hover:bg-surface border border-theme hover:border-primary-theme/50 rounded-xl text-left transition-all active:scale-[0.98] disabled:opacity-40 flex items-center gap-2.5 w-44 shrink-0 group cursor-pointer",title:t.description,children:[e.jsx("div",{className:"p-1.5 bg-primary-theme/10 text-primary-theme group-hover:bg-primary-theme/20 rounded-lg border border-primary-theme/20 shrink-0 transition-colors",children:e.jsx(Tt,{name:t.icon,size:14})}),e.jsxs("div",{className:"min-w-0 flex-1",children:[e.jsx("div",{className:"text-xs font-bold text-main truncate",children:t.name}),e.jsx("div",{className:"text-xs text-muted truncate mt-0.5",children:t.description})]})]},t.id))}):e.jsx("div",{className:"text-center py-2 text-xs text-muted italic",children:s==="zh"?"暂无可用的互动工具。请在应用商店启用插件。":"No plugin tools loaded."})]})]}):_==="submissions"?e.jsxs("div",{className:"flex-grow flex-1 min-h-0 w-full relative rounded-xl overflow-hidden border border-theme shadow-md bg-surface flex flex-col p-4",children:[e.jsxs("div",{className:"flex justify-between items-center mb-4 gap-3 shrink-0",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("span",{className:"text-xs font-bold text-main",children:s==="zh"?"学生互动提交数据列表":"Student Submissions"}),ae.length>0&&e.jsxs("span",{className:"text-xs bg-primary-theme/10 text-primary-theme px-2 py-0.5 rounded-full border border-primary-theme/20 font-bold",children:[ae.length," ",s==="zh"?"条记录":"records"]})]}),e.jsxs("div",{className:"flex items-center gap-2 flex-wrap",children:[e.jsxs("div",{className:"relative",children:[e.jsx("input",{type:"text",placeholder:s==="zh"?"搜索学生或课件...":"Search student or courseware...",value:pe,onChange:t=>Ke(t.target.value),className:"bg-surface border border-theme rounded-lg text-xs pl-8 pr-3 py-1.5 focus:ring-1 focus:ring-primary-theme text-main outline-none w-44 transition-all"}),e.jsx(jt,{size:12,className:"absolute left-2.5 top-2.5 text-muted"})]}),e.jsxs("select",{value:ie,onChange:t=>Ve(t.target.value),className:"bg-surface border border-theme rounded-lg text-xs px-3 py-1.5 focus:ring-1 focus:ring-primary-theme text-main outline-none cursor-pointer hover:bg-surface-secondary transition-colors",children:[e.jsx("option",{value:"all",children:s==="zh"?"全部状态":"All Status"}),e.jsx("option",{value:"submitted",children:s==="zh"?"已提交/完成":"Submitted/Finished"}),e.jsx("option",{value:"started",children:s==="zh"?"进行中":"In Progress"})]}),e.jsx("button",{onClick:oe,disabled:xe,className:"p-1.5 bg-surface hover:bg-surface-secondary border border-theme rounded-lg text-muted hover:text-main transition-colors cursor-pointer flex items-center justify-center shadow-sm disabled:opacity-50",title:s==="zh"?"刷新数据":"Refresh",children:e.jsx(X,{size:12,className:xe?"animate-spin":""})})]})]}),e.jsx("div",{className:"flex-1 overflow-y-auto border border-theme rounded-xl scrollbar-thin",children:xe?e.jsxs("div",{className:"h-full flex flex-col items-center justify-center text-muted gap-2",children:[e.jsx(X,{size:24,className:"animate-spin text-primary-theme mb-2"}),e.jsx("span",{className:"text-xs",children:s==="zh"?"正在加载学生提交数据...":"Loading submissions..."})]}):(()=>{const t=u?g.map(n=>n.id):[],i=(u?ae.filter(n=>t.includes(n.studentId)):ae).filter(n=>{const m=n.studentName?.toLowerCase().includes(pe.toLowerCase())||n.coursewareName?.toLowerCase().includes(pe.toLowerCase()),x=ie==="all"||ie==="submitted"&&(n.status==="submitted"||n.status==="finished")||ie==="started"&&n.status==="started";return m&&x});return i.length===0?e.jsxs("div",{className:"h-full flex flex-col items-center justify-center py-12 text-muted gap-2",children:[e.jsx(Ne,{size:32,className:"text-muted/60"}),e.jsx("span",{className:"text-xs",children:s==="zh"?"暂无匹配的提交数据。":"No matching submissions found."}),!u&&e.jsx("span",{className:"text-xs text-muted italic",children:s==="zh"?"提示:请在顶部选择一个班级进行筛选。":"Tip: Select a class at the top to filter."})]}):e.jsxs("table",{className:"w-full border-collapse text-left text-xs text-main",children:[e.jsx("thead",{children:e.jsxs("tr",{className:"bg-surface-secondary border-b border-theme font-bold text-muted select-none",children:[e.jsx("th",{className:"p-3",children:s==="zh"?"学生姓名":"Student Name"}),e.jsx("th",{className:"p-3",children:s==="zh"?"交互课件":"Courseware"}),e.jsx("th",{className:"p-3",children:s==="zh"?"状态":"Status"}),e.jsx("th",{className:"p-3 text-center",children:s==="zh"?"成绩":"Score"}),e.jsx("th",{className:"p-3 text-center",children:s==="zh"?"完成度":"Completion"}),e.jsx("th",{className:"p-3 text-right",children:s==="zh"?"操作":"Actions"})]})}),e.jsx("tbody",{className:"divide-y divide-border-theme",children:i.map(n=>{const m=n.status==="finished"||n.status==="submitted",x=n.started_at?new Date(n.started_at).toLocaleTimeString([],{hour:"2-digit",minute:"2-digit"}):"N/A";return e.jsxs("tr",{className:"hover:bg-surface-secondary/50 transition-colors group",children:[e.jsxs("td",{className:"p-3",children:[e.jsx("div",{className:"font-semibold text-main",children:n.studentName}),e.jsxs("div",{className:"text-xs text-muted mt-0.5",children:[s==="zh"?"时间":"Time",": ",x]})]}),e.jsx("td",{className:"p-3 font-medium text-main max-w-[150px] truncate",title:n.coursewareName,children:n.coursewareName}),e.jsx("td",{className:"p-3",children:e.jsx("span",{className:`px-2 py-0.5 rounded-full border text-xs font-bold ${m?"bg-emerald-50 text-emerald-700 border-emerald-100":"bg-blue-50 text-blue-700 border-blue-100 animate-pulse"}`,children:m?s==="zh"?"已提交":"Finished":s==="zh"?"进行中":"Running"})}),e.jsx("td",{className:"p-3 text-center font-bold font-mono",children:n.score!==null?e.jsxs("span",{className:"text-primary-theme bg-primary-theme/10 border border-primary-theme/20 px-1.5 py-0.5 rounded-md",children:[n.score,"分"]}):e.jsx("span",{className:"text-muted font-medium",children:"-"})}),e.jsx("td",{className:"p-3 text-center font-semibold font-mono",children:n.completion!==null?`${Math.round(n.completion*100)}%`:"0%"}),e.jsx("td",{className:"p-3 text-right",children:e.jsxs("div",{className:"flex justify-end gap-2",children:[e.jsxs("button",{onClick:()=>Qe(n),className:"p-1 text-muted hover:text-primary-theme hover:bg-surface-secondary border border-transparent hover:border-theme rounded-lg transition-colors cursor-pointer flex items-center gap-1 text-xs",title:s==="zh"?"查看提交轨迹事件数据":"View Raw Data",children:[e.jsx(yt,{size:12}),e.jsx("span",{children:s==="zh"?"轨迹":"Events"})]}),n.isPromoted>0?e.jsxs("span",{className:"px-2 py-1 text-emerald-650 font-bold text-xs flex items-center gap-0.5 bg-emerald-50/50 rounded-lg border border-emerald-100",children:[e.jsx(wt,{size:11}),s==="zh"?"已归档":"Saved"]}):e.jsxs("button",{onClick:()=>qe(n.attemptId),disabled:!m,className:`px-2 py-1 text-xs font-bold rounded-lg flex items-center gap-1 shadow-sm transition-all active:scale-95 cursor-pointer border ${m?"bg-primary-theme hover:bg-primary-theme-hover text-white border-primary-theme":"bg-surface-secondary text-muted border-theme cursor-not-allowed opacity-60"}`,title:s==="zh"?"将分数和进度作为随堂学习数据存入数据库,记入学期成绩":"Save to DB & Semester grade",children:[e.jsx(We,{size:11}),e.jsx("span",{children:s==="zh"?"录入成绩":"Record"})]})]})})]},n.attemptId)})})]})})()})]}):e.jsx(Pt,{lessonId:l||"",lang:s==="zh"?"zh":"en",addToast:p})]}):e.jsxs("div",{className:"flex-1 flex flex-col items-center justify-center text-slate-455 gap-2.5 select-none",children:[e.jsx(Oe,{size:38,className:"text-slate-300 animate-bounce",style:{animationDuration:"2.5s"}}),e.jsx("div",{className:"text-sm font-bold text-slate-655",children:s==="zh"?"请在顶部栏选择一个授课课节":"Please select a lesson to start teaching"}),e.jsx("p",{className:"text-xs text-slate-400",children:"白板及环节控制面板将在课节载入后自动生成"})]})}),e.jsxs("div",{className:"w-[260px] shrink-0 bg-surface p-3.5 border-l border-theme flex flex-col gap-3.5 overflow-hidden",children:[e.jsxs("div",{className:"flex-1 flex flex-col min-h-0 gap-2",children:[e.jsxs("h3",{className:"text-xs font-black uppercase text-muted tracking-wider select-none flex justify-between items-center shrink-0",children:[e.jsxs("span",{className:"flex items-center gap-1",children:[e.jsx("span",{children:s==="zh"?"学生专注力监控":"Student Status Console"}),u&&e.jsxs("button",{onClick:st,disabled:g.length===0||w,className:"ml-2 text-xs font-bold bg-primary-theme/10 text-primary-theme border border-primary-theme/20 px-1.5 py-0.5 rounded hover:bg-primary-theme/20 transition-colors flex items-center gap-1 active:scale-95 disabled:opacity-50 cursor-pointer shrink-0",title:s==="zh"?"随机抽取一名学生提问":"Pick a student randomly",children:[e.jsx(Me,{size:8.5,className:w?"animate-spin":""}),e.jsx("span",{children:s==="zh"?"随机抽问":"Pick Student"})]})]}),e.jsxs("span",{className:"text-xs bg-surface-secondary border border-theme text-muted font-mono px-1.5 py-0.5 rounded-md",children:[g.filter(t=>t.locked_lesson_id===l).length," / ",g.length," Locked"]})]}),u?e.jsx("div",{className:"overflow-y-auto flex-1 pr-1 grid grid-cols-3 gap-2 justify-items-center auto-rows-max scrollbar-thin py-2",children:g.map(t=>{const r=t.locked_lesson_id===l,i=Q.get(t.id),n=W.includes(t.id),x=d[t.id]===l,N=B.find(Y=>Y.student_id===t.id)?.progress_percent??0,D=P?k.findIndex(Y=>Y.id===P):-1,be=k.length>0?Math.round((D+1)/k.length*100):0,Ee=D>=0&&N<be,E=Ue.includes(t.id),ge=I===t.id,je=22,Ce=3,ye=2*Math.PI*je,at=ye-N/100*ye;let U="stroke-indigo-650";return E?U="stroke-amber-500 stroke-[3.5px]":ge?U="stroke-indigo-500 stroke-[3.5px] animate-pulse":n?r?U="stroke-rose-500 animate-pulse":Ee?U="stroke-amber-500 animate-pulse":x?N===100&&(U="stroke-emerald-500"):U="stroke-blue-400":U="stroke-slate-200",e.jsxs("div",{onMouseEnter:()=>y(t.id),onMouseLeave:()=>y(null),className:`group relative flex flex-col items-center justify-center p-1 rounded-xl transition-all cursor-default ${E?"z-20 duration-300":ge?"z-20":"hover:bg-slate-50"}`,children:[e.jsxs("div",{className:`relative w-14 h-14 flex items-center justify-center rounded-full transition-all duration-300 ${E?"shadow-[0_0_15px_#f59e0b] scale-110 z-10 bg-amber-50 ring-2 ring-amber-400 ring-offset-1":ge?"shadow-[0_0_10px_#6366f1] scale-105 z-10 bg-indigo-50 ring-1 ring-indigo-400":""}`,children:[E&&e.jsx("div",{className:"absolute inset-0 rounded-full bg-amber-400/30 animate-ping",style:{animationDuration:"2s"}}),e.jsxs("svg",{className:"absolute w-full h-full transform -rotate-90",viewBox:"0 0 50 50",children:[e.jsx("circle",{cx:"25",cy:"25",r:je,className:"stroke-slate-100 fill-white",strokeWidth:Ce}),e.jsx("circle",{cx:"25",cy:"25",r:je,className:`fill-transparent transition-all duration-300 ${U}`,strokeWidth:Ce,strokeDasharray:ye,strokeDashoffset:at,strokeLinecap:"round"})]}),e.jsxs("div",{className:`relative z-10 w-10 h-10 rounded-full flex items-center justify-center overflow-hidden transition-colors ${E?"bg-amber-100/90":""}`,children:[e.jsx("span",{className:`text-xs font-bold tracking-tight truncate max-w-[34px] group-hover:scale-0 group-hover:opacity-0 transition-all duration-200 select-none ${E?"text-amber-900 font-extrabold":n?"text-slate-700":"text-slate-400"}`,children:t.name}),e.jsxs("div",{className:"absolute inset-0 flex items-center justify-center gap-1 opacity-0 scale-50 group-hover:opacity-100 group-hover:scale-100 transition-all duration-200 bg-white/95 rounded-full shadow-inner",children:[l&&te&&e.jsx("button",{onClick:()=>{const Y=s==="zh"?`⚠️ 学习进度预警:您当前的进度 (${N}%) 落后于老师的讲解进度。请专注课堂,跟上讲解!`:`⚠️ Progress Alert: Your progress (${N}%) is behind.`;te(t.id,Y),p(s==="zh"?"🔔 已发送提醒":"🔔 Alert Sent",`已向学生 ${t.name} 发送进度提醒。`,"success")},className:`p-0.5 rounded-md hover:bg-slate-105 transition-colors shrink-0 cursor-pointer ${Ee?"text-amber-500 hover:text-amber-600 animate-pulse":"text-slate-400 hover:text-slate-650"}`,title:"提醒",children:e.jsx(Je,{size:10})}),e.jsx("button",{onClick:()=>et(t.id,t.locked_lesson_id),disabled:!l,className:`p-0.5 rounded-md hover:bg-slate-105 transition-colors shrink-0 cursor-pointer ${r?"text-rose-500 hover:text-rose-600":"text-slate-400 hover:text-slate-655"}`,title:r?"解锁":"锁定",children:r?e.jsx(Re,{size:10}):e.jsx(Ae,{size:10})})]})]}),E?e.jsx("span",{className:"absolute -top-1.5 -right-1.5 z-20 text-xs bg-amber-500 text-white rounded-full w-4 h-4 flex items-center justify-center font-bold shadow-md animate-bounce",children:"🎯"}):n&&e.jsx("span",{className:`absolute top-0 right-0 w-2.5 h-2.5 rounded-full border-2 border-white shrink-0 ${x?"bg-emerald-500":"bg-blue-400"}`,title:x?"正在上课":"在线(但未进课堂)"}),i===!0&&!E&&e.jsx("span",{className:"absolute bottom-0 right-0 w-2.5 h-2.5 rounded-full border-2 border-white bg-amber-500 shrink-0 animate-bounce",title:"已确认/就位"})]}),e.jsx("span",{className:`text-xs mt-1 truncate max-w-[48px] select-none font-medium ${E?"text-amber-600 font-extrabold animate-bounce":n?"text-slate-505":"text-slate-350"}`,children:E?"🎯 抽中":`${N}%`})]},t.id)})}):e.jsx("div",{className:"text-xs text-slate-400 italic py-4 text-center flex-1 flex items-center justify-center",children:s==="zh"?"请选择班级以显示学生":"Select class to show student monitors."})]}),e.jsx("div",{className:"bg-surface-secondary border border-theme rounded-xl p-3 flex flex-col gap-1.5 h-[135px] shrink-0 shadow-sm select-none justify-center",children:$?(()=>{const t=g.find(m=>m.id===$);if(!t)return null;const r=B.find(m=>m.student_id===t.id),i=r?.progress_percent??0,n=(()=>{if(!r||!r.completed_segments)return[];try{return typeof r.completed_segments=="string"?JSON.parse(r.completed_segments):r.completed_segments}catch{return[]}})();return e.jsxs("div",{className:"flex flex-col gap-1.5 text-xs text-main",children:[e.jsxs("div",{className:"font-extrabold text-main border-b border-theme pb-1 flex justify-between items-center shrink-0",children:[e.jsxs("span",{className:"flex items-center gap-1.5 truncate",children:[e.jsx("span",{className:`w-2 h-2 rounded-full shrink-0 ${W.includes(t.id)?"bg-emerald-500 animate-pulse":"bg-slate-300"}`}),e.jsxs("span",{className:"truncate max-w-[130px]",children:[t.name," (",t.student_number||"N/A",")"]})]}),e.jsxs("span",{className:"text-xs text-primary-theme font-mono font-black shrink-0",children:[i,"%"]})]}),e.jsxs("div",{className:"grid grid-cols-2 gap-1.5 text-xs leading-tight shrink-0",children:[e.jsxs("div",{className:"flex flex-col gap-0.5 bg-surface p-1 rounded-lg border border-theme",children:[e.jsx("span",{className:"text-muted font-bold",children:"随堂测验"}),e.jsx("span",{className:`font-bold font-mono text-xs ${r!=null&&r.quiz_score!==null?"text-primary-theme":"text-muted"}`,children:r!=null&&r.quiz_score!==null?`${r.quiz_score} / 100`:"未提交"})]}),e.jsxs("div",{className:"flex flex-col gap-0.5 bg-surface p-1 rounded-lg border border-theme",children:[e.jsx("span",{className:"text-muted font-bold",children:"教学环节进度"}),e.jsxs("span",{className:"font-bold text-main text-xs",children:[Array.isArray(n)?n.length:0," / ",k.length]})]})]}),e.jsxs("div",{className:"text-xs text-muted leading-relaxed truncate mt-0.5 shrink-0",children:["环节:"," ",k.length>0?k.map((m,x)=>{const j=Array.isArray(n)&&n.includes(m.id);return e.jsxs("span",{className:`mr-1 px-1 py-0.2 rounded ${j?"bg-emerald-50 text-emerald-600 border border-emerald-100":"bg-surface text-muted border border-theme"}`,title:m.title,children:[x+1,":",j?"✓":"✗"]},m.id)}):e.jsx("span",{className:"italic text-muted",children:"暂无步骤"})]})]})})():e.jsxs("div",{className:"flex flex-col gap-1 text-xs text-main h-full justify-center",children:[e.jsxs("div",{className:"font-extrabold text-main border-b border-theme pb-1.5 flex items-center gap-1.5 shrink-0",children:[e.jsx(we,{size:12,className:"text-primary-theme animate-pulse"}),e.jsx("span",{children:s==="zh"?"班级学情概况":"Class Overview"})]}),e.jsxs("div",{className:"grid grid-cols-3 gap-1.5 text-xs leading-tight mt-1.5 shrink-0",children:[e.jsxs("div",{className:"flex flex-col items-center bg-surface py-1 rounded-lg border border-theme",children:[e.jsx("span",{className:"text-muted font-medium",children:"在线/总数"}),e.jsxs("span",{className:"font-bold font-mono text-emerald-600 text-xs mt-0.5",children:[g.filter(t=>W.includes(t.id)).length,"/",g.length]})]}),e.jsxs("div",{className:"flex flex-col items-center bg-surface py-1 rounded-lg border border-theme",children:[e.jsx("span",{className:"text-muted font-medium",children:"屏幕锁定"}),e.jsx("span",{className:"font-bold font-mono text-rose-500 text-xs mt-0.5",children:g.filter(t=>t.locked_lesson_id===l).length})]}),e.jsxs("div",{className:"flex flex-col items-center bg-surface py-1 rounded-lg border border-theme",children:[e.jsx("span",{className:"text-muted font-medium",children:"平均进度"}),e.jsx("span",{className:"font-bold font-mono text-primary-theme text-xs mt-0.5",children:(()=>{const t=g.filter(i=>W.includes(i.id));if(t.length===0)return"0%";const r=t.reduce((i,n)=>{const m=B.find(x=>x.student_id===n.id);return i+(m?.progress_percent??0)},0);return`${Math.round(r/t.length)}%`})()})]})]})]})}),e.jsxs("div",{className:"h-[160px] flex flex-col border-t border-theme pt-3 min-h-0 gap-2 shrink-0",children:[e.jsxs("h3",{className:"text-xs font-black uppercase text-muted tracking-wider select-none flex justify-between items-center",children:[e.jsx("span",{children:s==="zh"?"课堂互动反馈流":"Live Classroom Feed"}),e.jsx("button",{onClick:()=>S([{id:"clear",time:new Date().toLocaleTimeString([],{hour:"2-digit",minute:"2-digit",second:"2-digit"}),type:"info",message:"反馈流已清空。"}]),className:"text-xs hover:text-main text-muted underline transition-all",children:"Clear"})]}),e.jsx("div",{className:"flex-1 bg-surface-secondary border border-theme rounded-xl p-2.5 font-mono text-xs leading-relaxed overflow-y-auto space-y-2 select-text text-left text-main shadow-inner scrollbar-thin",children:ee.map(t=>e.jsxs("div",{className:"border-b border-theme pb-1.5 last:border-b-0",children:[e.jsxs("div",{className:"flex justify-between items-center text-muted font-bold mb-0.5",children:[e.jsx("span",{children:t.time}),e.jsx("span",{className:`px-1 rounded uppercase tracking-wide text-xs ${t.type==="success"?"bg-emerald-50 text-emerald-600 border border-emerald-100":t.type==="warning"?"bg-amber-50 text-amber-600 border border-amber-100":"bg-surface text-muted border border-theme"}`,children:t.type})]}),e.jsx("p",{className:t.type==="success"?"text-emerald-700 font-medium":t.type==="warning"?"text-amber-700 font-medium":"text-main",children:t.message})]},t.id))})]})]})]}),O&&e.jsx("div",{className:"fixed inset-0 bg-slate-900/60 backdrop-blur-sm z-50 flex items-center justify-center p-4",children:e.jsxs("div",{className:"bg-surface rounded-2xl shadow-2xl max-w-2xl w-full max-h-[85vh] flex flex-col overflow-hidden border border-theme animate-in fade-in zoom-in duration-200 text-main",children:[e.jsxs("div",{className:"bg-surface-secondary px-6 py-4 border-b border-theme flex items-center justify-between",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(Ne,{className:"text-primary-theme",size:18}),e.jsx("h3",{className:"text-sm font-bold text-main",children:s==="zh"?`[${O.studentName}] 的互动提交轨迹详情`:`Submission Details - ${O.studentName}`})]}),e.jsx("button",{onClick:()=>he(null),className:"text-muted hover:text-main p-1.5 hover:bg-surface-secondary rounded-lg transition-colors cursor-pointer",children:e.jsx(Nt,{size:18})})]}),e.jsxs("div",{className:"p-6 overflow-y-auto space-y-4 flex-1 scrollbar-thin",children:[e.jsxs("div",{className:"grid grid-cols-3 gap-3",children:[e.jsxs("div",{className:"bg-surface-secondary p-3 rounded-xl border border-theme",children:[e.jsx("div",{className:"text-xs text-muted font-bold uppercase tracking-wider",children:s==="zh"?"课件名称":"Courseware"}),e.jsx("div",{className:"text-xs font-semibold text-main mt-1 truncate",title:O.coursewareName,children:O.coursewareName})]}),e.jsxs("div",{className:"bg-surface-secondary p-3 rounded-xl border border-theme",children:[e.jsx("div",{className:"text-xs text-muted font-bold uppercase tracking-wider",children:s==="zh"?"提交成绩":"Score"}),e.jsx("div",{className:"text-xs font-bold text-primary-theme mt-1",children:O.score!==null?`${O.score} 分`:s==="zh"?"未打分":"N/A"})]}),e.jsxs("div",{className:"bg-surface-secondary p-3 rounded-xl border border-theme",children:[e.jsx("div",{className:"text-xs text-muted font-bold uppercase tracking-wider",children:s==="zh"?"课件完成度":"Completion"}),e.jsx("div",{className:"text-xs font-bold text-emerald-600 mt-1",children:O.completion!==null?`${Math.round(O.completion*100)}%`:"0%"})]})]}),e.jsxs("div",{className:"space-y-3",children:[e.jsxs("h4",{className:"text-xs font-bold text-main border-b border-theme pb-1.5 flex items-center gap-1.5 flex-wrap",children:[e.jsx(we,{size:13,className:"text-primary-theme"}),e.jsx("span",{children:s==="zh"?"实时捕获轨迹事件流 (LMS Bridge)":"LMS Event Captures"})]}),Le?e.jsxs("div",{className:"py-12 flex flex-col items-center justify-center text-muted gap-2",children:[e.jsx(X,{size:20,className:"animate-spin text-primary-theme"}),e.jsx("span",{className:"text-xs",children:s==="zh"?"正在查询原始数据...":"Loading raw data..."})]}):Array.isArray(ue)&&ue.length>0?e.jsx("div",{className:"space-y-3 font-mono text-xs max-h-[40vh] overflow-y-auto pr-1 scrollbar-thin",children:ue.map((t,r)=>{let i={};try{i=typeof t.payload_json=="string"?JSON.parse(t.payload_json):t.payload_json}catch{}return e.jsxs("div",{className:"p-3 bg-slate-900 text-slate-200 rounded-xl border border-slate-800 flex flex-col gap-1.5",children:[e.jsxs("div",{className:"flex justify-between items-center text-xs text-slate-400 border-b border-slate-800 pb-1",children:[e.jsx("span",{className:"font-bold text-indigo-400 bg-indigo-950/50 border border-indigo-900/50 px-1.5 py-0.5 rounded",children:t.event_type}),e.jsx("span",{children:new Date(t.created_at).toLocaleTimeString()})]}),e.jsx("pre",{className:"overflow-x-auto text-xs leading-relaxed p-1 text-emerald-400/90 whitespace-pre-wrap word-break-all",children:JSON.stringify(i,null,2)})]},t.id||r)})}):e.jsx("div",{className:"py-8 text-center text-xs text-muted italic",children:s==="zh"?"该学生未产生任何轨迹事件数据。":"No trace events captured."})]})]}),e.jsxs("div",{className:"bg-surface-secondary px-6 py-4 border-t border-theme flex justify-between gap-3 shrink-0",children:[e.jsxs("div",{className:"text-xs text-muted flex items-center gap-1",children:[e.jsx(Fe,{size:10}),e.jsx("span",{children:"Powered by LMS Bridge API v1"})]}),e.jsx("button",{onClick:()=>he(null),className:"px-4 py-1.5 bg-surface hover:bg-surface-secondary border border-theme text-main font-bold rounded-lg text-xs transition-all cursor-pointer shadow-sm active:scale-95",children:s==="zh"?"关闭窗口":"Close"})]})]})})]})}export{Jt as LiveClassroomView};
@@ -1,2 +0,0 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/index-Ch_mD6B0.css"])))=>i.map(i=>d[i]);
2
- import{_ as h}from"./vendor-pdf-Bw0ZQZtM.js";import{r as u,j as e}from"./vendor-react-B0t7H3hh.js";import{u as w,a as y,E as te,D as se}from"./index-BApV4fuy.js";import{am as ne,an as ie,B as re,u as oe,U as le,ae,o as de,x as S,S as ce,Y as ue,F as xe,b as me,z as he}from"./vendor-icons-B2DRJfZU.js";import"./vendor-utils-m0Urvtws.js";import"./vendor-motion-DjY2czvL.js";import"./vendor-pptx-C5-U7ieS.js";import"./vendor-charts-U9fLlNC_.js";const v="openlearn_nav_collapsed_groups",pe=t=>{if(t.status==="cancelled"||t.status==="holiday")return!1;if(!t.time_slot)return!0;try{const o=t.time_slot.split("-");if(o.length<2)return!0;const i=o[1].trim(),[s,n]=i.split(":").map(Number),r=new Date,c=r.getHours(),d=r.getMinutes();return!(c>s||c===s&&d>=n)}catch{return!0}};function fe({mainNavCollapsed:t,setMainNavCollapsed:o,teacherTab:i,setTeacherTab:s,lang:n,session:r,todaySchedules:c}){const a=w(l=>l.extensionPoints).get("teacher.tab")||[];y(l=>l.siteInfo);const[m,j]=u.useState(()=>{try{const l=localStorage.getItem(v);return l?JSON.parse(l):{}}catch{return{}}}),g=l=>{j(p=>{const x={...p,[l]:!p[l]};try{localStorage.setItem(v,JSON.stringify(x))}catch{}return x})};return e.jsxs("div",{id:"navigation_sidebar",className:`${t?"w-16":"w-16 md:w-44"} bg-surface border-r border-theme text-main flex flex-col transition-all duration-300`,children:[e.jsxs("div",{className:`p-2 flex border-b border-theme-subtle ${t?"justify-center":"justify-between items-center px-3"} min-h-[48px] shrink-0`,children:[!t&&e.jsx("span",{className:"hidden md:inline text-xs font-black tracking-widest text-muted uppercase select-none",children:n==="zh"?"系统导航":"NAVIGATION"}),e.jsx("button",{onClick:()=>o(!t),className:"p-1.5 rounded-lg hover:bg-surface-secondary text-muted hover:text-primary-theme transition-colors cursor-pointer flex items-center justify-center shrink-0",title:t?n==="zh"?"展开导航":"Expand Sidebar":n==="zh"?"折叠导航":"Collapse Sidebar",children:t?e.jsx(ne,{size:18}):e.jsx(ie,{size:18})})]}),e.jsxs("div",{className:`p-2 ${t?"md:p-2":"md:p-2.5"} flex flex-col gap-2 overflow-y-auto flex-1`,children:[e.jsx(_,{label:n==="zh"?"教学工具":"TEACHING",groupKey:"teaching",mainNavCollapsed:t,isCollapsed:!!m.teaching,onToggle:()=>g("teaching"),lang:n}),(!m.teaching||t)&&e.jsxs("div",{className:"flex flex-col gap-1",children:[e.jsx(f,{icon:re,label:n==="zh"?"课程管理":"Courses",tab:"courses",teacherTab:i,setTeacherTab:s,mainNavCollapsed:t}),e.jsx(f,{icon:oe,label:n==="zh"?"互动课堂":"Live Class",tab:"live_class",teacherTab:i,setTeacherTab:s,mainNavCollapsed:t,highlight:!0}),e.jsx(f,{icon:le,label:n==="zh"?"班级管理":"Classes & Students",tab:"classes",teacherTab:i,setTeacherTab:s,mainNavCollapsed:t})]}),e.jsx(_,{label:n==="zh"?"系统管理":"SYSTEM MANAGEMENT",groupKey:"system",mainNavCollapsed:t,isCollapsed:!!m.system,onToggle:()=>g("system"),lang:n}),(!m.system||t)&&e.jsxs("div",{className:"flex flex-col gap-1",children:[e.jsx(f,{icon:ae,label:n==="zh"?"课表管理":"Timetable Routine",tab:"timetable",teacherTab:i,setTeacherTab:s,mainNavCollapsed:t}),e.jsx(f,{icon:de,label:n==="zh"?"机房管理":"Computer Lab Seating",tab:"computer_labs",teacherTab:i,setTeacherTab:s,mainNavCollapsed:t}),e.jsx(f,{icon:S,label:n==="zh"?"插件中心":"App Store / Plugins",tab:"plugins",teacherTab:i,setTeacherTab:s,mainNavCollapsed:t}),r?.subRole==="administrator"&&e.jsxs("button",{onClick:()=>s("admin_directory"),id:"nav_btn_admin_directory",className:`flex items-center gap-2.5 px-2.5 py-2 transition-colors text-sm font-medium text-indigo-700 hover:bg-indigo-50 border border-indigo-100/80 dark:border-indigo-950/40 rounded-xl ${i==="admin_directory"?"bg-indigo-50/70 border-indigo-200":"bg-slate-50/50 dark:bg-slate-900/30"} ${t?"justify-center px-2":""}`,title:n==="zh"?"管理后台":"⭐ Admin Center",children:[e.jsx(ce,{size:18,className:"shrink-0 text-indigo-600 animate-pulse"}),e.jsx("span",{className:t?"hidden":"hidden md:block font-bold text-indigo-850 truncate",children:n==="zh"?"管理后台":"⭐ Admin Center"})]})]}),a.length>0&&e.jsxs(e.Fragment,{children:[e.jsx(_,{label:n==="zh"?"扩展应用":"EXTENSIONS",groupKey:"extensions",mainNavCollapsed:t,isCollapsed:!!m.extensions,onToggle:()=>g("extensions"),lang:n}),(!m.extensions||t)&&e.jsx("div",{className:"flex flex-col gap-1",children:e.jsx(te,{slot:"teacher.tab",slotProps:{renderType:"button",mainNavCollapsed:t,teacherTab:i,setTeacherTab:s}})})]}),e.jsx(_,{label:n==="zh"?"帮助支持":"HELP & SUPPORT",groupKey:"support",mainNavCollapsed:t,isCollapsed:!!m.support,onToggle:()=>g("support"),lang:n}),(!m.support||t)&&e.jsx("div",{className:"flex flex-col gap-1",children:e.jsx(f,{icon:ue,label:n==="zh"?"帮助文档":"System Commands / Help",tab:"help",teacherTab:i,setTeacherTab:s,mainNavCollapsed:t})})]}),(()=>{const l=c.filter(pe),p=l.length;return t||c.length===0?null:e.jsxs("div",{className:"mt-auto p-2.5 m-2 bg-indigo-50/55 dark:bg-indigo-950/20 rounded-xl border border-indigo-100 dark:border-indigo-900/30 hidden md:block select-none shadow-3xs",id:"today_schedule_sidebar_panel",children:[e.jsxs("div",{className:"flex items-center gap-1.5 text-xs font-bold text-indigo-700 mb-1",children:[e.jsx(xe,{size:12,className:"text-indigo-600 animate-pulse shrink-0"}),e.jsx("span",{className:"truncate",children:n==="zh"?"本堂余课":"Classes Remaining"})]}),e.jsx("div",{className:"text-xs text-gray-500 mb-1.5 truncate",children:n==="zh"?`今天还有 ${p} 节课`:`${p} more classes left`}),l.length>0&&e.jsx("div",{className:"max-h-[130px] overflow-y-auto space-y-1 pr-0.5",children:l.map(x=>e.jsxs("div",{className:"text-xs p-1.5 bg-white rounded border border-indigo-100/60 shadow-3xs hover:border-indigo-200 transition-colors",children:[e.jsx("div",{className:"font-bold text-gray-750 truncate",title:x.lesson_title,children:x.lesson_title}),e.jsxs("div",{className:"text-xs text-gray-450 truncate flex justify-between items-center mt-0.5 gap-1",children:[e.jsx("span",{className:"font-medium text-slate-500 truncate max-w-[55px]",children:x.class_name}),e.jsx("span",{className:"font-mono text-indigo-700 font-semibold shrink-0",children:x.time_slot})]})]},x.id))})]})})()]})}function _({label:t,groupKey:o,mainNavCollapsed:i,isCollapsed:s,onToggle:n,lang:r}){return i?e.jsx("div",{className:"h-px bg-border-theme-subtle my-1 w-full opacity-60"}):e.jsxs("button",{type:"button",onClick:n,"aria-expanded":!s,"data-testid":`nav_group_${o}`,className:"w-full flex items-center justify-between px-2.5 py-1.5 rounded-lg bg-surface-secondary/40 hover:bg-surface-secondary/80 border-0 text-xs font-semibold text-muted hover:text-main cursor-pointer transition-all duration-150 select-none group mt-1.5",title:`${t} (${s?r==="zh"?"点击展开":"Click to expand":r==="zh"?"点击折叠":"Click to collapse"})`,children:[e.jsxs("div",{className:"flex items-center gap-2 min-w-0",children:[e.jsx("span",{className:"w-1 h-3 rounded-full bg-primary-theme/75 group-hover:bg-primary-theme transition-colors shrink-0"}),e.jsx("span",{className:"truncate tracking-wide text-xs",children:t})]}),e.jsx(me,{size:13,className:`text-muted/60 group-hover:text-main transition-transform duration-200 shrink-0 ${s?"-rotate-90":"rotate-0"}`})]})}function f({icon:t,label:o,tab:i,teacherTab:s,setTeacherTab:n,mainNavCollapsed:r,highlight:c}){const d=s===i;return e.jsxs("button",{onClick:()=>n(i),id:`nav_btn_${i}`,className:`flex items-center gap-2.5 px-2.5 py-2 transition-colors text-sm font-medium rounded-xl cursor-pointer ${d?"bg-primary-theme-light text-primary-theme font-bold"+(c?" shadow-xs border border-theme":""):"text-muted hover:bg-surface-secondary hover:text-main"} ${r?"justify-center px-2":""}`,title:o,children:[e.jsx(t,{size:18,className:`shrink-0 ${c&&!d?"text-primary-theme":""}`}),e.jsx("span",{className:r?"hidden":"hidden md:block truncate",children:o})]})}function ge({component:t,lessonId:o,classId:i}){const s=t;return e.jsx(s,{renderType:"panel",lessonId:o,classId:i})}function be({activeNavPlugin:t}){const o=w(a=>a.extensionPoints),i=y(a=>a.lang),s=y(a=>a.selectedLesson),n=y(a=>a.liveClassSelectedClassId),r=o.get("teacher.tab")||[],c=t||(r.length>0?r[0].pluginId:null),d=r.find(a=>a.pluginId===c);return e.jsx("div",{className:"flex-1 flex flex-col min-h-0",children:e.jsx("div",{className:"flex-1 overflow-auto",children:d?.component?e.jsx(ge,{component:d.component,lessonId:s,classId:n}):d&&typeof d.render=="function"?e.jsx(se,{ext:d,slot:"teacher.tab",slotProps:{renderType:"panel",lessonId:s,classId:n}}):e.jsx("div",{className:"flex items-center justify-center h-full",children:e.jsxs("div",{className:"text-center",children:[e.jsx(S,{size:48,className:"mx-auto text-gray-300 mb-3"}),e.jsx("p",{className:"text-sm text-gray-400 font-medium",children:i==="zh"?"此插件未提供页面组件":"This plugin has no page component"}),e.jsx("p",{className:"text-xs text-gray-300 mt-1",children:i==="zh"?"插件已注册导航条目,但未提供对应的界面渲染逻辑。":"The plugin registered a navigation entry but did not provide a render component."})]})})})})}const je=u.lazy(()=>h(()=>import("./Dashboard-CY138ODd.js"),__vite__mapDeps([0])).then(t=>({default:t.Dashboard}))),_e=u.lazy(()=>h(()=>import("./LessonEditorView-D9YYZQyP.js"),__vite__mapDeps([0])).then(t=>({default:t.LessonEditorView}))),ye=u.lazy(()=>h(()=>import("./LiveClassroomView-B2lKKiZK.js"),__vite__mapDeps([0])).then(t=>({default:t.LiveClassroomView}))),ve=u.lazy(()=>h(()=>import("./PluginView-CQLEVURc.js"),__vite__mapDeps([0])).then(t=>({default:t.PluginView}))),we=u.lazy(()=>h(()=>import("./CourseManagement-DFQsUxE1.js"),__vite__mapDeps([0])).then(t=>({default:t.CourseManagement}))),Se=u.lazy(()=>h(()=>import("./ClassesView-TVobZ_Vs.js"),__vite__mapDeps([0])).then(t=>({default:t.ClassesView}))),ze=u.lazy(()=>h(()=>import("./TimetableView-Do_LWpV2.js"),[]).then(t=>({default:t.TimetableView}))),Ee=u.lazy(()=>h(()=>import("./AdminDirectoryView-CGo33RNh.js"),[]).then(t=>({default:t.AdminDirectoryView}))),Ne=u.lazy(()=>h(()=>import("./ComputerLabView-DGha_J8B.js"),[]).then(t=>({default:t.ComputerLabView}))),Pe=u.lazy(()=>h(()=>import("./HelpView-CHkXbtfB.js"),__vite__mapDeps([0])).then(t=>({default:t.HelpView})));function Te(t){const{mainNavCollapsed:o,setMainNavCollapsed:i,teacherTab:s,setTeacherTab:n,lang:r,session:c,todaySchedules:d,socketRef:a,setShowCoursewareHub:m,selectedLesson:j,setSelectedLesson:g,classStudentsMap:l,lessons:p,classes:x,plugins:z,timelineSegments:E,activeSegmentId:N,setActiveSegmentId:P,liveClassSelectedClassId:b,setLiveClassSelectedClassId:L,liveClassIsActive:k,setLiveClassIsActive:A,liveClassTimeRemaining:C,setLiveClassTimeRemaining:I,liveClassFeed:V,setLiveClassFeed:R,liveClassAcknowledgedMap:O,setLiveClassAcknowledgedMap:T,elements:D,fetchElements:M,addToast:$,onlineStudentIds:H,activeStudentLessons:G,liveClassStudentProgress:U,fetchStudents:F,fetchClassStudents:K,activeRole:B,setActiveRole:Y,onRefresh:J,computerLabs:Q,fetchTodaySchedules:W,fetchRegisteredCommands:X,registeredCommands:q}=t;return e.jsxs("div",{className:"flex-1 overflow-hidden flex bg-gray-50",children:[e.jsx(fe,{mainNavCollapsed:o,setMainNavCollapsed:i,teacherTab:s,setTeacherTab:n,lang:r,session:c,todaySchedules:d}),e.jsxs("div",{className:"flex-1 p-6 overflow-hidden flex gap-6 relative",children:[["dashboard","lesson_editor","live_class","plugins","courses","classes","timetable","admin_directory","help","computer_labs"].includes(s)?null:e.jsx(be,{activeNavPlugin:s.includes("/")?s.split("/")[0]:null}),e.jsx(u.Suspense,{fallback:e.jsxs("div",{className:"flex-1 flex flex-col items-center justify-center min-h-[400px] text-slate-400 gap-3",children:[e.jsx(he,{className:"w-8 h-8 animate-spin text-indigo-500"}),e.jsx("span",{className:"text-sm font-medium",children:"加载视图中..."})]}),children:s==="dashboard"?e.jsx(je,{...t}):s==="lesson_editor"?e.jsx(_e,{...t}):s==="live_class"?e.jsx("div",{className:"flex-grow flex-1 flex flex-col min-h-0 min-w-0",children:e.jsx(ye,{selectedLesson:j,setSelectedLesson:g,lessons:p,classes:x,students:b?l[b]||[]:[],plugins:z,lang:r,timelineSegments:E,activeSegmentId:N,setActiveSegmentId:P,liveClassSelectedClassId:b,setLiveClassSelectedClassId:L,liveClassIsActive:k,setLiveClassIsActive:A,liveClassTimeRemaining:C,setLiveClassTimeRemaining:I,liveClassFeed:V,setLiveClassFeed:R,liveClassAcknowledgedMap:O,setLiveClassAcknowledgedMap:T,elements:D,fetchElements:M,fetchStudents:async()=>{await F(),b&&await K(b)},addToast:$,onlineStudentIds:H,activeStudentLessons:G,liveClassStudentProgress:U,onPingStudent:(Z,ee)=>{a.current&&a.current.emit("teacher-ping-student",{studentId:Z,lessonId:j,message:ee})},onOpenCoursewareHub:()=>m(!0),activeRole:B,setActiveRole:Y})}):s==="plugins"?e.jsx(ve,{...t}):s==="courses"?e.jsx(we,{...t}):s==="classes"?e.jsx(Se,{...t}):s==="timetable"?e.jsx(ze,{classes:x,lessons:p,lang:r,onSchedulesUpdated:W}):s==="admin_directory"?e.jsx(Ee,{...t}):s==="computer_labs"?e.jsx(Ne,{computerLabs:Q,onRefresh:J,lang:r}):s==="help"?e.jsx(Pe,{registeredCommands:q,onRefresh:X}):null})]})]})}export{Te as TeacherView};