openlearn-next 0.4.1 → 0.4.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/assets/{BatchPickerModal-DCDKZsrS.js → BatchPickerModal-BpWu0Lil.js} +1 -1
- package/dist/assets/{ClassesView-COk1pTlX.js → ClassesView-KbHEqJto.js} +1 -1
- package/dist/assets/{ClassroomCountdownWidget-CHUvYSrT.js → ClassroomCountdownWidget-96WFRO9A.js} +1 -1
- package/dist/assets/{CloudDriveModal-DY7BSVJN.js → CloudDriveModal-DEQ1nkNk.js} +1 -1
- package/dist/assets/{CourseManagement-DA1m3Div.js → CourseManagement-D3ZpxY0l.js} +1 -1
- package/dist/assets/{CourseWizardModal-yDZpcltW.js → CourseWizardModal-Ck_-M8pk.js} +1 -1
- package/dist/assets/{Dashboard-QTNgTjoi.js → Dashboard-CYbpbofV.js} +1 -1
- package/dist/assets/{ExportWeightModal-Cq3BaikE.js → ExportWeightModal-DW2bu9Zz.js} +1 -1
- package/dist/assets/{HelpView-DY4CA5VA.js → HelpView-CtzdqhBq.js} +1 -1
- package/dist/assets/{ImportLessonsModal-DzeCcQOI.js → ImportLessonsModal-jBuIK453.js} +1 -1
- package/dist/assets/{InteractiveCoursewareViewer-D5py6E0c.js → InteractiveCoursewareViewer-Bj7ahXMs.js} +1 -1
- package/dist/assets/{InteractiveWhiteboard-D5YKM1I6.js → InteractiveWhiteboard-B7JcJvDu.js} +1 -1
- package/dist/assets/{LazyCourseware-DWCx60AO.js → LazyCourseware-CuiPxhDg.js} +2 -2
- package/dist/assets/{LazyWhiteboard-CFn-1ATp.js → LazyWhiteboard-BJwCEZAU.js} +2 -2
- package/dist/assets/{LessonEditorView-CfvhQfzG.js → LessonEditorView-DFrOp2qp.js} +1 -1
- package/dist/assets/{LiveClassroomView-CB_0PN1X.js → LiveClassroomView-BZ5nGee3.js} +1 -1
- package/dist/assets/{NotificationDetailModal-DBg7UPZh.js → NotificationDetailModal-Baqnc5pU.js} +1 -1
- package/dist/assets/{PluginView-wozVlSXQ.js → PluginView-CCbIuZ24.js} +1 -1
- package/dist/assets/{QuizGeneratorModal-DnW-ff7D.js → QuizGeneratorModal-BBEDssp7.js} +1 -1
- package/dist/assets/{StudentAssignmentView-tQiAv5Xn.js → StudentAssignmentView-DgIjUsXz.js} +1 -1
- package/dist/assets/{StudentLessonView-DRwhbGoU.js → StudentLessonView-CBJbI5x6.js} +1 -1
- package/dist/assets/{StudentPreviewModal-BQ_a7sQY.js → StudentPreviewModal-Bh8OZs0t.js} +1 -1
- package/dist/assets/{StudentView-XBaWzGO3.js → StudentView--uGxc5TJ.js} +2 -2
- package/dist/assets/{SystemResourceLibraryModal-Bcak0WSz.js → SystemResourceLibraryModal-BVCclcqA.js} +1 -1
- package/dist/assets/{TeacherView-961tBSMT.js → TeacherView-D4Zsc0eZ.js} +2 -2
- package/dist/assets/{index-BQF_s4QO.js → index-BKBCBKvy.js} +29 -29
- package/dist/index.html +1 -1
- package/dist/server.cjs +87 -16
- package/package.json +1 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{r as l,j as e,R as _t}from"./vendor-react-B0t7H3hh.js";import{L as Ur}from"./LazyWhiteboard-CFn-1ATp.js";import{h as Ks,E as oe,i as Be,j as He,l as Ds,e as Hr,k as qr,n as Ye,r as Vr}from"./index-BQF_s4QO.js";import{ab as $e,am as Re,aD as Kr,C as Js,aI as Qs,_ as tt,aB as ss,U as ke,J as os,b as is,t as Et,i as ls,aM as De,N as st,aW as Ys,aJ as Zs,W as cs,Q as Jr,aX as Qr,aY as Xs,aZ as Yr,ad as Zr,ac as er,X as be,y as ds,r as je,A as ht,O as rt,w as Ge,a_ as xs,a$ as ms,b0 as tr,b1 as Mt,Y as Oe,f as fe,B as ot,b2 as rs,a8 as hs,F as Le,b3 as Xr,b4 as ea,ax as It,p as us,ah as _e,b5 as ta,aL as sa,b6 as sr,b7 as mt,b8 as Dt,b9 as ra,ba as rr,D as Ot,aO as ps,bb as ar,R as ut,bc as aa,bd as na,be as Tt,T as at,n as nr,bf as or,bg as oa,a4 as Se,Z as ia,bh as la,bi as Lt,bj as ca,bk as da,h as pt,K as xa,e as Ve,j as ft,bl as ma,ay as Pt,a2 as ir,bm as lr,bn as fs,u as xt,bo as bs,aF as bt,z as cr,bp as dr,G as ha,bq as ua,br as pa,bs as xr,L as fa,E as Ft,bt as ba,m as mr,ap as ga,ae as gs,a3 as hr,bu as ur,bv as js,bw as ja,bx as pr,by as fr,bz as Na,bA as ya,aQ as as,v as va,S as Os,aw as wa,aG as ka}from"./vendor-icons-BRmhY6fg.js";import{C as za,T as Sa}from"./ClassroomCountdownWidget-CHUvYSrT.js";import{a as Ca,P as $a,h as Aa,g as Ea}from"./vendor-charts-qLbgF1eL.js";import"./vendor-utils-m0Urvtws.js";import"./vendor-pdf-D7rGevI1.js";import"./vendor-motion-BFAPOs-b.js";import"./vendor-pptx-C5-U7ieS.js";function br({lessonId:s,lang:i,addToast:n}){const[o,a]=l.useState(!1),[t,r]=l.useState(!1),[c,x]=l.useState([]),[d,m]=l.useState(60),[u,v]=l.useState(40),[N,g]=l.useState({}),[p,j]=l.useState({}),[k,w]=l.useState({}),[f,b]=l.useState({}),[z,_]=l.useState({}),[C,B]=l.useState({}),R=i==="zh",J=async(I=!1)=>{I?r(!0):a(!0);try{const P=await(await fetch(`/api/lessons/${s}/eval-grades`)).json();if(Array.isArray(P)){x(P);const y={},M={},$={},S={};P.forEach(E=>{E.grade?(y[E.id]=E.grade.teacher_score,M[E.id]=E.grade.teacher_comment,$[E.id]=Math.round(E.grade.teacher_weight*100),S[E.id]=Math.round(E.grade.peer_weight*100)):(y[E.id]=N[E.id]!==void 0?N[E.id]:80,M[E.id]=p[E.id]!==void 0?p[E.id]:"",$[E.id]=k[E.id]!==void 0?k[E.id]:d,S[E.id]=f[E.id]!==void 0?f[E.id]:u)}),g(E=>({...y,...E})),j(E=>({...M,...E})),w(E=>({...$,...E})),b(E=>({...S,...E}))}else throw new Error("Invalid submissions data format")}catch(V){console.error("Error fetching submissions grades:",V),n(R?"数据加载失败":"Failed to Load Data",R?"请检查网络连接或刷新页面。":"Please check your connection and try again.","warning")}finally{a(!1),r(!1)}};l.useEffect(()=>{s&&J()},[s]),l.useEffect(()=>{const I=Ks();if(!I||!s)return;const V=P=>{(!P?.lessonId||P.lessonId===s)&&J()};return I.on("assignment-submitted-toast",V),()=>{typeof I.off=="function"&&I.off("assignment-submitted-toast",V)}},[s]);const O=I=>{m(I),v(100-I),w(V=>{const P={...V};return c.forEach(y=>{(!y.grade||y.grade.status!=="confirmed")&&(P[y.id]=I)}),P}),b(V=>{const P={...V};return c.forEach(y=>{(!y.grade||y.grade.status!=="confirmed")&&(P[y.id]=100-I)}),P})},H=(I,V)=>{w(P=>({...P,[I]:V})),b(P=>({...P,[I]:100-V}))},ee=async(I,V)=>{const P=N[I],y=p[I]||"",M=(k[I]??d)/100,$=(f[I]??u)/100;if(P===void 0||isNaN(P)||P<0||P>100){n(R?"评分无效":"Invalid Score",R?"教师评分必须在 0 到 100 之间!":"Teacher score must be between 0 and 100!","warning");return}if(V==="confirmed"){const S=R?"确认同步后,最终得分将直接同步写入宿主学期成绩库,此后该学生的作业成绩将锁定不可修改。是否确认?":"Once confirmed, the final score will be synced to the host semester reports and locked. Proceed?";if(!window.confirm(S))return}B(S=>({...S,[I]:V}));try{const E=await(await fetch("/api/commands",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({commandType:"assignment.grade",payload:{submissionId:I,teacherScore:Number(P),teacherComment:y,teacherWeight:M,peerWeight:$,status:V}})})).json();if(E.success)n(V==="confirmed"?R?"平时成绩同步成功":"Semester Grade Synced":R?"平时成绩草稿已保存":"Grade Draft Saved",V==="confirmed"?R?`已将平时成绩 ${E.result.calculatedFinalScore} 分同步至学期报告!`:`Successfully synced grade ${E.result.calculatedFinalScore}!`:R?"成功保存了教师打分与评语草稿。":"Successfully saved score and comment draft.","success"),J(!0);else throw new Error(E.error||"Failed to submit grade")}catch(S){n(R?"操作失败":"Operation Failed",S.message,"warning")}finally{B(S=>({...S,[I]:null}))}},se=I=>{_(V=>({...V,[I]:!V[I]}))};return o?e.jsxs("div",{className:"flex-grow flex flex-col items-center justify-center py-12 text-gray-500",children:[e.jsx($e,{className:"animate-spin text-indigo-500 mb-2",size:32}),e.jsx("p",{className:"text-xs",children:R?"正在读取学生作业与成绩状态...":"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(Re,{size:16,className:"text-indigo-655"}),R?"学生作业成绩评定与折算系统":"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:[c.length," ",R?"个提交":"submissions"]})]}),e.jsx("button",{onClick:()=>J(!0),disabled:t,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:R?"刷新数据":"Refresh",children:e.jsx($e,{size:12,className:t?"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(Kr,{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:R?"全局默认折算权重设置":"Default Grading Weights Configuration"}),e.jsx("p",{className:"text-xs text-slate-400 mt-0.5 font-medium",children:R?"调整权重分配,所有尚未锁定成绩的学生将自动应用此默认权重比例。":"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:R?"教师评分:":"Teacher:"}),e.jsx("input",{type:"range",min:"0",max:"100",step:"5",value:d,onChange:I=>O(Number(I.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:[d,"%"]})]}),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:R?"学生互评:":"Peer Review:"}),e.jsxs("span",{className:"text-xs font-bold text-slate-700 w-8",children:[u,"%"]})]})]})]}),e.jsx("div",{className:"flex-grow flex-1 overflow-y-auto space-y-4 pr-1 scrollbar-thin",children:c.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(Js,{size:32,className:"text-slate-350"}),e.jsx("p",{className:"text-xs",children:R?"本节课目前没有任何学生提交作业。":"No students have submitted assignments yet for this lesson."})]}):c.map(I=>{const V=N[I.id]!==void 0?N[I.id]:80,P=p[I.id]||"",y=k[I.id]??d,M=f[I.id]??u,$=I.grade?.status==="confirmed",S=Math.round(V*(y/100)+I.peerAverageScore*(M/100));return e.jsxs("div",{className:`bg-white border rounded-xl shadow-3xs overflow-hidden transition-all ${$?"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:I.studentName?.charAt(0)||"S"}),e.jsxs("div",{children:[e.jsx("div",{className:"text-xs font-bold text-slate-800",children:I.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",I.version]}),e.jsx("span",{children:"•"}),e.jsx("span",{children:new Date(I.updatedAt).toLocaleString()})]})]})]}),e.jsxs("div",{className:"flex items-center gap-2",children:[$?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(Qs,{size:12}),R?"成绩已同步":"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:I.grade?R?"草稿状态":"Draft":R?"未评定":"Ungraded"}),e.jsxs("a",{href:I.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:I.filePath,children:[e.jsx(tt,{size:11}),R?"查看作业":"View File",e.jsx(ss,{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(ke,{size:13,className:"text-slate-400"}),R?"学生互评详情":"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:[R?"互评人数:":"Reviews:"," ",I.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:R?"均分":"Avg"}),e.jsx("span",{className:"text-sm font-extrabold text-slate-700 leading-none mt-0.5",children:I.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:I.peerReviews.length>0?R?"根据同学互评分数得出的平均值。":"Average score computed from classmate evaluations.":R?"暂无同学对此作业给出评分。":"No classmate peer reviews received yet."}),I.peerReviews.length>0&&e.jsx("button",{onClick:()=>se(I.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:z[I.id]?e.jsxs(e.Fragment,{children:[R?"收起互评详情":"Hide Details"," ",e.jsx(os,{size:12})]}):e.jsxs(e.Fragment,{children:[R?"展开互评详情":"Show Details"," ",e.jsx(is,{size:12})]})})]})]}),z[I.id]&&I.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:I.peerReviews.map(E=>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"}),E.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:[E.score," ",R?"分":"pts"]})]}),E.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:['"',E.comment,'"']})]},E.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:R?"教师平时分评分 (0-100)":"Teacher Score (0-100)"}),e.jsxs("div",{className:"flex gap-2",children:[e.jsx("input",{id:`teacher_score_input_${I.id}`,type:"number",min:"0",max:"100",disabled:$,value:V,onChange:E=>g(Q=>({...Q,[I.id]:Math.min(100,Math.max(0,Number(E.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:$,value:V,onChange:E=>g(Q=>({...Q,[I.id]:Number(E.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:R?"打分占比 (教师权重)":"Teacher Score Weight"}),e.jsx("span",{className:"text-xs font-bold text-slate-400",children:R?`学生互评: ${M}%`:`Peer: ${M}%`})]}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("input",{id:`teacher_weight_input_${I.id}`,type:"range",min:"0",max:"100",step:"5",disabled:$,value:y,onChange:E=>H(I.id,Number(E.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:[y,"%"]})]})]})]}),e.jsxs("div",{children:[e.jsx("label",{className:"block text-xs font-bold text-slate-655 mb-1 select-none",children:R?"教师评价评语":"Teacher Comments & Feedback"}),e.jsx("textarea",{id:`teacher_comment_input_${I.id}`,disabled:$,value:P,placeholder:R?"在此输入对学生作业作品的改进指导意见及评语。":"Enter guiding feedback for this student.",onChange:E=>j(Q=>({...Q,[I.id]:E.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 ${$?"bg-emerald-50 text-emerald-600 border-emerald-100":"bg-indigo-50 text-indigo-700 border-indigo-100"}`,children:e.jsx(Et,{size:14})}),e.jsxs("div",{className:"text-xs text-slate-500 font-medium",children:[e.jsxs("div",{children:[R?"平时总分计算公式":"Calculated Final Grade",":"]}),e.jsxs("div",{className:"font-bold text-slate-700 mt-0.5 animate-formula",children:[y,"% × ",e.jsx("span",{className:"text-indigo-650 font-bold",children:V}),I.peerReviews.length>0&&` + ${M}% × ${I.peerAverageScore}`," = ",e.jsx("span",{className:$?"text-emerald-700 font-black text-xs":"text-indigo-700 font-black text-xs",children:$&&I.grade?.calculated_final_score||S}),R?"分":" pts"]})]})]}),!$&&e.jsxs("div",{className:"flex gap-2 justify-end shrink-0",children:[e.jsxs("button",{id:`teacher_draft_btn_${I.id}`,type:"button",disabled:!!C[I.id],onClick:()=>ee(I.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(ls,{size:12}),C[I.id]==="draft"?R?"保存中...":"Saving...":R?"暂存草稿":"Save Draft"]}),e.jsxs("button",{id:`teacher_confirm_btn_${I.id}`,type:"button",disabled:!!C[I.id],onClick:()=>ee(I.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(De,{size:12}),C[I.id]==="confirmed"?R?"同步中...":"Syncing...":R?"确认并同步":"Confirm & Sync"]})]})]})]})]})]},I.id)})})]})}const Ta=({state:s,onToggleAnonymous:i,onOpenRubricModal:n,onToggleVoiceDanmaku:o,onAdvanceStage:a,onAddMinute:t,onTogglePauseTimer:r,isFullscreen:c,onToggleFullscreen:x,onClose:d})=>{const m=v=>{const N=Math.floor(Math.max(0,v)/60),g=Math.max(0,v)%60;return`${String(N).padStart(2,"0")}:${String(g).padStart(2,"0")}`},u=Math.round(s.completedReviews/Math.max(1,s.totalStudents)*100);return e.jsxs("div",{id:"peer-review-telemetry-header",className:"w-full bg-[#131b2e] border-b border-[#2d3449] px-6 py-3 flex flex-wrap items-center justify-between gap-4 select-none shrink-0",children:[e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("span",{className:"px-2 py-0.5 rounded bg-[#171f33] text-[#908fa0] text-[10px] font-mono font-semibold tracking-wider",children:"STAGE 02.4"}),e.jsxs("div",{className:"flex items-center gap-1.5 text-xs text-[#c7c4d7]",children:[e.jsx("span",{children:"随堂巩固"}),e.jsx(st,{size:13,className:"text-[#908fa0]"}),e.jsx("span",{children:"收卷归档"}),e.jsx(st,{size:13,className:"text-[#908fa0]"}),e.jsxs("span",{className:"text-[#4edea3] font-medium flex items-center gap-1",children:[e.jsx("span",{className:"w-1.5 h-1.5 rounded-full bg-[#4edea3] animate-ping"}),"全班大屏协同互评阶段 ",s.isLocked&&"(已锁定全班终端)"]})]})]}),e.jsx("div",{className:"h-4 w-[1px] bg-[#2d3449] hidden md:block"}),e.jsxs("div",{className:"hidden sm:flex items-center gap-1.5 px-2.5 py-1 rounded bg-[#00a572]/20 text-[#4edea3] text-xs font-medium border border-[#00a572]/30",children:[e.jsx(Ys,{size:14,className:"text-[#4edea3]"}),e.jsxs("span",{children:["教室主大屏协同输出 ",s.isDualScreen?"(4K 双屏模式)":"(投影模式)"]})]})]}),e.jsxs("div",{className:"flex items-center gap-4 sm:gap-6",children:[e.jsxs("div",{className:"flex items-center gap-2 bg-[#060e20] px-3 py-1.5 rounded-xl border border-[#2d3449]/60",children:[e.jsx(Zs,{size:18,className:"text-[#ffb95f] animate-pulse"}),e.jsxs("div",{className:"flex flex-col",children:[e.jsxs("div",{className:"flex items-center gap-1.5",children:[e.jsx("span",{className:"text-[10px] font-mono text-[#908fa0] leading-none",children:"COUNTDOWN"}),t&&e.jsx("button",{type:"button",onClick:t,className:"text-[10px] text-[#ffb95f] hover:text-[#ffddb8] font-mono transition-colors",title:"加时 1 分钟",children:"+1m"})]}),e.jsxs("div",{className:"flex items-center gap-1.5 mt-0.5",children:[e.jsxs("span",{className:"text-sm font-semibold font-mono text-[#dae2fd] leading-none",children:[m(s.timeRemainingSeconds),e.jsxs("span",{className:"text-[#908fa0] text-xs font-normal",children:[" / ",m(s.totalTimeSeconds)]})]}),r&&e.jsx("button",{type:"button",onClick:r,className:"text-[#c7c4d7] hover:text-white transition-colors",title:s.isPaused?"恢复倒计时":"暂停倒计时",children:s.isPaused?e.jsx(cs,{size:12,className:"text-[#4edea3]"}):e.jsx(Jr,{size:12})})]})]})]}),e.jsxs("div",{className:"flex items-center gap-2.5",children:[e.jsxs("div",{className:"relative w-8 h-8 flex items-center justify-center",children:[e.jsxs("svg",{className:"w-8 h-8 -rotate-90",viewBox:"0 0 36 36",children:[e.jsx("path",{className:"text-[#2d3449]",d:"M18 2.0845 a 15.9155 15.9155 0 0 1 0 31.831 a 15.9155 15.9155 0 0 1 0 -31.831",fill:"none",stroke:"currentColor",strokeWidth:"3.5"}),e.jsx("path",{className:"text-[#4edea3] transition-all duration-500",d:"M18 2.0845 a 15.9155 15.9155 0 0 1 0 31.831 a 15.9155 15.9155 0 0 1 0 -31.831",fill:"none",stroke:"currentColor",strokeDasharray:`${u}, 100`,strokeLinecap:"round",strokeWidth:"3.5"})]}),e.jsxs("span",{className:"absolute text-[9px] font-mono text-[#dae2fd] font-semibold",children:[u,"%"]})]}),e.jsxs("div",{className:"flex flex-col",children:[e.jsx("span",{className:"text-[10px] font-mono text-[#908fa0] leading-none",children:"SUBMISSIONS"}),e.jsxs("span",{className:"text-xs font-medium text-[#dae2fd] mt-0.5",children:[s.completedReviews," / ",s.totalStudents," 人已评"]})]})]}),e.jsxs("div",{className:"hidden lg:flex items-center gap-2 bg-[#171f33] px-3 py-1.5 rounded-xl border border-[#2d3449]/60",children:[e.jsx(Qr,{size:16,className:"text-[#c0c1ff]"}),e.jsxs("div",{className:"flex flex-col",children:[e.jsx("span",{className:"text-[10px] font-mono text-[#908fa0] leading-none",children:"PEER REACTIONS"}),e.jsxs("span",{className:"text-xs font-mono font-medium text-[#c0c1ff] mt-0.5",children:[s.totalLikes," 次点赞 · ",s.totalNominations," 份提名"]})]})]})]}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsxs("label",{htmlFor:"toggle-anon",className:"flex items-center gap-2 cursor-pointer bg-[#171f33] px-2.5 py-1.5 rounded-xl hover:bg-[#222a3d] transition-colors border border-[#2d3449]/50",title:"开启后隐藏学生真实姓名",children:[e.jsx("input",{id:"toggle-anon",type:"checkbox",checked:s.isAnonymous,onChange:i,className:"sr-only peer"}),e.jsx("div",{className:"w-7 h-4 bg-[#2d3449] peer-checked:bg-[#4edea3] rounded-full relative transition-colors",children:e.jsx("div",{className:`w-3 h-3 bg-white rounded-full absolute top-0.5 left-0.5 transition-transform ${s.isAnonymous?"translate-x-3":""}`})}),e.jsx("span",{className:"text-xs text-[#c7c4d7] font-medium",children:"双盲匿名"})]}),e.jsxs("button",{type:"button",onClick:n,className:"flex items-center gap-1.5 px-3 py-1.5 rounded-xl bg-[#171f33] hover:bg-[#222a3d] text-[#c7c4d7] hover:text-[#dae2fd] transition-colors text-xs font-medium border border-[#2d3449]/50",children:[e.jsx(Xs,{size:15,className:"text-[#ffb95f]"}),e.jsx("span",{children:"互评量规"})]}),e.jsxs("button",{type:"button",onClick:o,className:`flex items-center gap-1.5 px-3 py-1.5 rounded-xl transition-colors text-xs font-medium border ${s.showDanmaku?"bg-[#00a572]/20 border-[#00a572]/40 text-[#4edea3]":"bg-[#171f33] border-[#2d3449]/50 text-[#c7c4d7] hover:text-[#dae2fd]"}`,title:"开关大屏弹幕墙",children:[e.jsx(Yr,{size:15,className:"text-[#4edea3]"}),e.jsx("span",{children:"全员语音弹幕"})]}),e.jsxs("button",{type:"button",onClick:a,className:"flex items-center gap-2 px-3.5 py-1.5 rounded-xl bg-[#c0c1ff] text-[#1000a9] hover:bg-[#8083ff] hover:text-white transition-all shadow-sm text-xs font-semibold",children:[e.jsx(Re,{size:15}),e.jsx("span",{children:"揭晓勋章榜"}),e.jsx("span",{className:"font-mono text-[10px] bg-[#1000a9]/15 px-1 py-0.5 rounded leading-none",children:"Enter"})]}),e.jsx(oe,{slot:"peer_review.action"}),x&&e.jsx("button",{type:"button",onClick:x,className:"p-1.5 rounded-xl text-[#c7c4d7] hover:text-white hover:bg-[#222a3d] transition-colors ml-1",title:c?"退出全屏":"全屏展示",children:c?e.jsx(Zr,{size:16}):e.jsx(er,{size:16})}),d&&e.jsx("button",{type:"button",onClick:d,className:"p-1.5 rounded-xl text-[#ffb4ab] hover:text-white hover:bg-[#93000a]/50 transition-colors ml-1",title:"关闭大屏互评",children:e.jsx(be,{size:16})})]})]})},Pa=({matchingItems:s,badges:i,isAnonymous:n=!1,onSelectMatchingItem:o})=>{const a=(t,r)=>!r||t.length<=1?t:`${t[0]}**`;return e.jsxs("div",{id:"peer-review-matrix-panel",className:"flex flex-col gap-4 w-full select-none",children:[e.jsxs("div",{className:"bg-[#131b2e] p-4 rounded-xl border border-[#2d3449]/60 flex flex-col gap-2.5",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("div",{className:"w-7 h-7 rounded-lg bg-[#c0c1ff]/15 flex items-center justify-center text-[#c0c1ff]",children:e.jsx(ds,{size:16})}),e.jsx("h2",{className:"text-sm font-semibold text-[#dae2fd]",children:"智能交叉互评"})]}),e.jsx("span",{className:"px-2 py-0.5 rounded bg-[#8083ff]/20 text-[#c0c1ff] font-mono text-[10px] font-semibold",children:"1生评2份"})]}),e.jsx("p",{className:"text-xs text-[#c7c4d7] leading-relaxed",children:"分层对调机制:将满分逻辑范本与攻坚调试作业交叉分发,激发逆向审阅与自愈思考。"})]}),e.jsxs("div",{className:"bg-[#131b2e] p-4 rounded-xl border border-[#2d3449]/60 flex flex-col gap-3",children:[e.jsxs("div",{className:"flex items-center justify-between text-xs",children:[e.jsx("span",{className:"text-[#908fa0] font-mono text-[10px] font-semibold",children:"PEER MATCHING REALTIME"}),e.jsxs("span",{className:"text-[#4edea3] font-mono text-[11px] flex items-center gap-1",children:[e.jsx("span",{className:"w-1.5 h-1.5 rounded-full bg-[#4edea3] animate-pulse"})," 实时同步中"]})]}),e.jsx("div",{className:"flex flex-col gap-2.5 max-h-[380px] overflow-y-auto pr-0.5",children:s.map(t=>{const r=a(t.reviewerName,n),c=a(t.targetStudentName,n);return e.jsxs("div",{onClick:()=>o?.(t),className:`p-3 rounded-lg border transition-all cursor-pointer ${t.status==="submitted"?"bg-[#222a3d] border-[#4edea3]/40 shadow-sm":"bg-[#171f33] border-[#2d3449]/60 hover:bg-[#222a3d] hover:border-[#464554]"}`,children:[e.jsxs("div",{className:"flex items-center justify-between mb-1.5",children:[e.jsxs("div",{className:"flex items-center gap-1.5",children:[e.jsx("span",{className:"font-mono text-[11px] text-[#ffb95f] font-semibold",children:t.code}),e.jsxs("span",{className:"text-xs text-[#dae2fd] font-semibold truncate max-w-[130px]",children:[r," ",t.reviewerGroup?`(${t.reviewerGroup})`:""]})]}),t.status==="submitted"&&e.jsx("span",{className:"text-[10px] font-mono px-1.5 py-0.5 rounded bg-[#00a572]/20 text-[#4edea3]",children:"已提交评语"}),t.status==="in_progress"&&e.jsx("span",{className:"text-[10px] font-mono px-1.5 py-0.5 rounded bg-[#ca8100]/20 text-[#ffb95f] animate-pulse",children:"正在推导 (2/3)"}),t.status==="completed"&&e.jsxs("span",{className:"text-[10px] font-mono px-1.5 py-0.5 rounded bg-[#00a572]/20 text-[#4edea3] flex items-center gap-1",children:[e.jsx(je,{size:10})," 已完成"]}),t.status==="improvement"&&e.jsx("span",{className:"text-[10px] font-mono px-1.5 py-0.5 rounded bg-[#c0c1ff]/20 text-[#c0c1ff]",children:"提出改进建议 💡"})]}),e.jsxs("div",{className:"flex items-center gap-1.5 text-xs text-[#c7c4d7] mb-1.5",children:[e.jsx(ht,{size:12,className:"text-[#908fa0] shrink-0"}),e.jsxs("span",{className:"text-[#c0c1ff] font-medium truncate",children:[c," · ",t.targetWorkTitle]})]}),t.comment&&e.jsxs("div",{className:"bg-[#060e20] p-2 rounded text-xs text-[#c7c4d7] italic border border-[#2d3449]/40 mb-1.5 leading-relaxed",children:['"',t.comment,'"']}),t.progressPercent!==void 0&&t.status==="in_progress"&&e.jsx("div",{className:"w-full bg-[#2d3449] h-1 rounded-full mt-2 overflow-hidden",children:e.jsx("div",{className:"bg-[#ffb95f] h-full rounded-full transition-all duration-300",style:{width:`${t.progressPercent}%`}})}),t.stars!==void 0&&e.jsxs("div",{className:"flex items-center justify-between mt-1.5 pt-1.5 border-t border-[#2d3449]/50",children:[e.jsx("div",{className:"flex text-[#ffb95f]",children:Array.from({length:5}).map((x,d)=>e.jsx(rt,{size:13,className:d<t.stars?"text-[#ffb95f] fill-[#ffb95f]":"text-[#464554]"},d))}),e.jsxs("span",{className:"text-[10px] font-mono text-[#908fa0]",children:[t.score?.toFixed(1)||"5.0"," / ",t.maxScore||"5.0"]})]})]},t.id)})})]}),e.jsxs("div",{className:"bg-[#131b2e] p-4 rounded-xl border border-[#2d3449]/60 flex flex-col gap-2.5",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx("span",{className:"text-[10px] font-mono font-semibold text-[#908fa0]",children:"LIVE PEER BADGE STREAM"}),e.jsx(Ge,{size:14,className:"text-[#908fa0]"})]}),e.jsx("div",{className:"flex flex-col gap-2 overflow-hidden",children:i.map(t=>e.jsxs("div",{className:"flex items-center gap-2 p-2 rounded-lg bg-[#171f33] border border-[#2d3449]/50 text-xs text-[#dae2fd]",children:[e.jsx("span",{className:"text-sm shrink-0",children:t.emoji}),e.jsxs("div",{className:"truncate",children:[e.jsx("span",{className:"text-[#4edea3] font-medium",children:a(t.senderName,n)}),e.jsx("span",{className:"text-[#c7c4d7] mx-1",children:"为"}),e.jsx("span",{className:"text-[#c0c1ff] font-medium",children:a(t.receiverName,n)}),e.jsx("span",{className:"ml-1 px-1.5 py-0.5 bg-[#222a3d] rounded text-[10px] font-mono text-[#ffb95f]",children:t.badgeTitle})]})]},t.id))}),e.jsx(oe,{slot:"peer_review.badge"})]})]})},Ra=({workA:s,workB:i,annotations:n,isAnonymous:o=!1,onFullscreenCanvas:a,onSyncSandboxToClass:t,onAddAnnotation:r})=>{const[c,x]=l.useState("visual"),[d,m]=l.useState(!1),[u,v]=l.useState(""),N=(p,j)=>!j||p.length<=1?p:`${p[0]}**`,g=p=>{p.preventDefault(),u.trim()&&(r?.(u.trim()),v(""),m(!1))};return e.jsxs("div",{id:"spotlight-dual-work-arena",className:"flex flex-col gap-4 w-full select-none",children:[e.jsxs("div",{className:"bg-[#131b2e] p-4 rounded-xl border border-[#2d3449]/60 flex flex-wrap items-center justify-between gap-3 shadow-md",children:[e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("div",{className:"w-9 h-9 rounded-xl bg-[#8083ff]/20 flex items-center justify-center text-[#c0c1ff] border border-[#8083ff]/30",children:e.jsx(xs,{size:20})}),e.jsxs("div",{className:"flex flex-col",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("h1",{className:"text-base font-bold text-[#dae2fd]",children:"大屏焦点作品对比赏析"}),e.jsxs("span",{className:"px-2 py-0.5 rounded bg-[#ca8100]/20 text-[#ffb95f] font-mono text-[10px] font-semibold flex items-center gap-1 border border-[#ca8100]/30",children:[e.jsx("span",{className:"w-1.5 h-1.5 rounded-full bg-[#ffb95f] animate-ping"}),"教师激光笔协同标记中"]})]}),e.jsxs("span",{className:"text-xs text-[#c7c4d7] mt-0.5",children:["标杆创新解法 (",N(s.studentName,o),") ⟷ 经典逆风翻盘解法 (",N(i.studentName,o),")"]})]})]}),e.jsxs("div",{className:"flex items-center gap-2",children:[t&&e.jsxs("button",{type:"button",onClick:t,className:"flex items-center gap-1.5 px-3 py-1.5 rounded-lg bg-[#171f33] hover:bg-[#222a3d] text-[#c7c4d7] hover:text-white border border-[#2d3449]/60 transition-colors text-xs font-medium",title:"将对比沙箱推送到全班学生机",children:[e.jsx(ms,{size:14,className:"text-[#4edea3]"}),e.jsx("span",{children:"同步沙箱至全班"})]}),a&&e.jsx("button",{type:"button",onClick:a,className:"p-2 rounded-lg bg-[#171f33] hover:bg-[#222a3d] text-[#c7c4d7] hover:text-white border border-[#2d3449]/60 transition-colors",title:"全屏沉浸投影",children:e.jsx(er,{size:16})})]})]}),e.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[e.jsxs("div",{className:"bg-[#131b2e] rounded-xl p-4 flex flex-col gap-3 border border-[#2d3449]/60 shadow-md relative",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{className:"flex items-center gap-2.5",children:[e.jsx("div",{className:"w-8 h-8 rounded-full bg-[#8083ff] text-white flex items-center justify-center font-bold text-xs shadow-sm",children:o?"A":s.studentInitial}),e.jsxs("div",{className:"flex flex-col",children:[e.jsxs("span",{className:"text-sm font-semibold text-[#dae2fd]",children:[N(s.studentName,o)," (作品 A)"]}),e.jsx("span",{className:"text-[11px] font-mono text-[#908fa0]",children:s.workSubtitle})]})]}),e.jsxs("div",{className:"flex items-center gap-1 px-2 py-0.5 rounded bg-[#ca8100]/20 text-[#ffb95f] border border-[#ca8100]/30",children:[e.jsx(rt,{size:13,className:"text-[#ffb95f] fill-[#ffb95f]"}),e.jsx("span",{className:"font-mono text-xs font-semibold",children:typeof s.rating=="number"?s.rating.toFixed(1):"—"}),e.jsxs("span",{className:"text-[10px] text-[#908fa0]",children:["(",s.reviewCount??0,"评)"]})]})]}),e.jsx("div",{className:"flex flex-wrap gap-1.5",children:s.badges.map((p,j)=>e.jsx("span",{className:`px-2 py-0.5 rounded text-[10px] font-mono font-medium ${p.colorClass}`,children:p.label},j))}),e.jsxs("div",{className:"w-full h-44 rounded-lg bg-[#060e20] flex items-center justify-center relative overflow-hidden border border-[#2d3449]/60 group",children:[e.jsxs("svg",{className:"w-36 h-36 transform -rotate-12 transition-transform duration-700 group-hover:scale-110",viewBox:"0 0 100 100",children:[e.jsx("polygon",{points:"50,10 88,38 73,82 27,82 12,38",fill:"none",stroke:"#c0c1ff",strokeWidth:"1.2",opacity:"0.3"}),e.jsx("polygon",{points:"50,15 84,39 71,78 29,78 16,39",fill:"none",stroke:"#8083ff",strokeWidth:"1.4",opacity:"0.5",transform:"rotate(10 50 50)"}),e.jsx("polygon",{points:"50,20 80,41 68,74 32,74 20,41",fill:"none",stroke:"#4edea3",strokeWidth:"1.6",opacity:"0.7",transform:"rotate(22 50 50)"}),e.jsx("polygon",{points:"50,26 76,43 65,70 35,70 24,43",fill:"none",stroke:"#ffb95f",strokeWidth:"1.8",opacity:"0.85",transform:"rotate(35 50 50)"}),e.jsx("polygon",{points:"50,32 72,45 63,66 37,66 28,45",fill:"none",stroke:"#c0c1ff",strokeWidth:"2.2",opacity:"1.0",transform:"rotate(50 50 50)"}),e.jsx("circle",{cx:"50",cy:"50",r:"3",fill:"#4edea3"})]}),e.jsx("span",{className:"absolute bottom-2 right-2 text-[10px] font-mono text-[#908fa0] bg-[#131b2e]/90 px-1.5 py-0.5 rounded border border-[#2d3449]/50",children:s.visualBadgeText})]}),e.jsxs("div",{className:"bg-[#060e20] rounded-lg p-3 font-mono text-[11px] leading-5 border border-[#2d3449]/60 overflow-x-auto text-[#dae2fd]",children:[e.jsxs("div",{className:"text-[#908fa0] mb-1",children:["# ",s.codeTitle??""]}),(s.codeLines??[]).map((p,j)=>e.jsxs("div",{className:`${p.isHighlight?"bg-[#8083ff]/20 px-1 rounded -mx-1 text-[#dae2fd]":""}`,style:{paddingLeft:`${(p.indent||0)*12}px`},children:[e.jsx("span",{children:p.text}),p.comment&&e.jsx("span",{className:"text-[#908fa0] ml-2",children:p.comment})]},j))]})]}),e.jsxs("div",{className:"bg-[#131b2e] rounded-xl p-4 flex flex-col gap-3 border border-[#2d3449]/60 shadow-md relative",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{className:"flex items-center gap-2.5",children:[e.jsx("div",{className:"w-8 h-8 rounded-full bg-[#00a572] text-white flex items-center justify-center font-bold text-xs shadow-sm",children:o?"B":i.studentInitial}),e.jsxs("div",{className:"flex flex-col",children:[e.jsxs("span",{className:"text-sm font-semibold text-[#dae2fd]",children:[N(i.studentName,o)," (作品 B)"]}),e.jsx("span",{className:"text-[11px] font-mono text-[#908fa0]",children:i.workSubtitle})]})]}),e.jsxs("div",{className:"flex items-center gap-1 px-2 py-0.5 rounded bg-[#ca8100]/20 text-[#ffb95f] border border-[#ca8100]/30",children:[e.jsx(rt,{size:13,className:"text-[#ffb95f] fill-[#ffb95f]"}),e.jsx("span",{className:"font-mono text-xs font-semibold",children:typeof i.rating=="number"?i.rating.toFixed(1):"—"}),e.jsxs("span",{className:"text-[10px] text-[#908fa0]",children:["(",i.reviewCount??0,"评)"]})]})]}),e.jsx("div",{className:"flex flex-wrap gap-1.5",children:i.badges.map((p,j)=>e.jsx("span",{className:`px-2 py-0.5 rounded text-[10px] font-mono font-medium ${p.colorClass}`,children:p.label},j))}),e.jsxs("div",{className:"w-full h-44 rounded-lg bg-[#060e20] flex items-center justify-center relative overflow-hidden border border-[#2d3449]/60 group",children:[e.jsxs("svg",{className:"w-36 h-36 transition-transform duration-700 group-hover:scale-110",viewBox:"0 0 100 100",children:[e.jsx("circle",{cx:"50",cy:"50",r:"42",fill:"none",stroke:"#2d3449",strokeWidth:"1"}),e.jsx("rect",{x:"25",y:"25",width:"50",height:"50",fill:"none",stroke:"#4edea3",strokeWidth:"1.8",transform:"rotate(0 50 50)"}),e.jsx("rect",{x:"25",y:"25",width:"50",height:"50",fill:"none",stroke:"#6ffbbe",strokeWidth:"1.8",opacity:"0.8",transform:"rotate(18 50 50)"}),e.jsx("rect",{x:"25",y:"25",width:"50",height:"50",fill:"none",stroke:"#ffb95f",strokeWidth:"1.8",opacity:"0.7",transform:"rotate(36 50 50)"}),e.jsx("rect",{x:"25",y:"25",width:"50",height:"50",fill:"none",stroke:"#c0c1ff",strokeWidth:"1.8",opacity:"0.6",transform:"rotate(54 50 50)"}),e.jsx("circle",{cx:"50",cy:"50",r:"3",fill:"#ffb95f"})]}),e.jsxs("span",{className:"absolute bottom-2 right-2 text-[10px] font-mono text-[#4edea3] bg-[#131b2e]/90 px-1.5 py-0.5 rounded border border-[#2d3449]/50 flex items-center gap-1",children:[e.jsx("span",{className:"w-1.5 h-1.5 rounded-full bg-[#4edea3]"}),i.visualBadgeText]})]}),e.jsxs("div",{className:"bg-[#060e20] rounded-lg p-3 font-mono text-[11px] leading-5 border border-[#2d3449]/60 overflow-x-auto text-[#dae2fd]",children:[e.jsxs("div",{className:"text-[#908fa0] mb-1",children:["# ",i.codeTitle??""]}),(i.codeLines??[]).map((p,j)=>e.jsxs("div",{className:`${p.isSuccess?"bg-[#00a572]/20 px-1 rounded -mx-1 text-[#4edea3] font-medium":""}`,style:{paddingLeft:`${(p.indent||0)*12}px`},children:[e.jsx("span",{children:p.text}),p.comment&&e.jsx("span",{className:"text-[#4edea3] text-[10px] ml-2",children:p.comment})]},j))]})]})]}),e.jsxs("div",{className:"bg-[#131b2e] rounded-xl p-4 flex flex-col gap-3 border border-[#2d3449]/60 shadow-md",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(tr,{size:16,className:"text-[#ffb95f]"}),e.jsx("span",{className:"text-xs font-semibold text-[#dae2fd]",children:"协同板书标注与点评审阅"})]}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsxs("span",{className:"text-[10px] font-mono text-[#908fa0]",children:[n.length," 条实时批注挂载"]}),r&&e.jsx("button",{type:"button",onClick:()=>m(!d),className:"text-[11px] text-[#c0c1ff] hover:text-white font-medium transition-colors",children:d?"取消批注":"+ 追加教师批注"})]})]}),d&&e.jsxs("form",{onSubmit:g,className:"flex gap-2",children:[e.jsx("input",{type:"text",value:u,onChange:p=>v(p.target.value),placeholder:"输入大屏协同批注要点...",className:"flex-1 px-3 py-1.5 rounded-lg bg-[#060e20] border border-[#2d3449] text-xs text-[#dae2fd] placeholder-[#908fa0] focus:outline-none focus:border-[#8083ff]"}),e.jsx("button",{type:"submit",className:"px-3 py-1.5 rounded-lg bg-[#c0c1ff] text-[#1000a9] font-semibold text-xs hover:bg-[#8083ff] hover:text-white transition-colors",children:"发送批注"})]}),e.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-3",children:n.map(p=>e.jsxs("div",{className:"bg-[#171f33] p-3 rounded-lg flex flex-col gap-1.5 relative overflow-hidden border border-[#2d3449]/50",children:[e.jsx("div",{className:"w-1 absolute left-0 top-0 bottom-0",style:{backgroundColor:p.borderColor}}),e.jsxs("div",{className:"flex items-center justify-between pl-2",children:[e.jsxs("div",{className:"flex items-center gap-1.5",children:[e.jsx("span",{className:`px-1.5 py-0.5 rounded text-[10px] font-mono font-bold ${p.authorType==="teacher"?"bg-[#8083ff] text-white":"bg-[#00a572] text-white"}`,children:p.authorRole}),e.jsx("span",{className:"text-xs font-semibold text-[#dae2fd]",children:N(p.authorName,o)})]}),e.jsx("span",{className:"text-[10px] font-mono text-[#908fa0]",children:p.timeAgo})]}),e.jsx("p",{className:"text-xs text-[#dae2fd] pl-2 leading-relaxed",children:p.content})]},p.id))})]}),e.jsx(oe,{slot:"peer_review.showcase.widget"})]})},_a=({dimensions:s,averagePercentage:i,reactions:n,onReactionClick:o,syncedStudentsCount:a=32})=>e.jsxs("div",{id:"peer-review-rubric-stats",className:"bg-[#131b2e] rounded-xl p-4 flex flex-col gap-4 border border-[#2d3449]/60 shadow-md select-none w-full",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx("span",{className:"text-xs font-semibold text-[#dae2fd]",children:"全班三维量规综合达标率"}),e.jsxs("span",{className:"text-[11px] font-mono text-[#4edea3] font-semibold",children:["AVERAGE: ",i.toFixed(1),"%"]})]}),e.jsx("div",{className:"grid grid-cols-1 sm:grid-cols-3 gap-3",children:s.map(t=>e.jsxs("div",{className:"bg-[#171f33] p-2.5 rounded-lg flex flex-col gap-1.5 border border-[#2d3449]/50",children:[e.jsxs("div",{className:"flex justify-between text-xs",children:[e.jsx("span",{className:"text-[#908fa0] truncate",children:t.label}),e.jsxs("span",{className:`font-mono font-medium ${t.colorClass}`,children:[t.percentage,"%"]})]}),e.jsx("div",{className:"w-full bg-[#2d3449] h-1.5 rounded-full overflow-hidden",children:e.jsx("div",{className:`h-full rounded-full transition-all duration-500 ${t.barColorClass}`,style:{width:`${t.percentage}%`}})})]},t.id))}),e.jsx(oe,{slot:"peer_review.rubric.dimension"}),e.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-3 pt-1 border-t border-[#2d3449]/40",children:[e.jsx("div",{className:"flex items-center gap-2",children:n.map(t=>e.jsxs("button",{type:"button",onClick:()=>o?.(t.id),className:"flex items-center gap-1.5 px-3 py-1 rounded-full bg-[#171f33] hover:bg-[#222a3d] border border-[#2d3449]/60 transition-all text-xs text-[#dae2fd] active:scale-95 group",children:[e.jsx("span",{children:t.emoji}),e.jsx("span",{className:"font-medium group-hover:text-white",children:t.label}),e.jsxs("span",{className:`font-mono font-semibold ${t.colorClass}`,children:["+",t.count]})]},t.id))}),e.jsxs("span",{className:"text-[10px] font-mono text-[#908fa0] flex items-center gap-1",children:[e.jsx(Mt,{size:13,className:"text-[#4edea3]"}),a,"台学生端已同步点赞动画"]})]})]}),Ma=({podiumStudents:s,isAnonymous:i=!1,onAwardPeerReviewPoints:n,onArchiveTopWorks:o,onCallStudentMic:a,onInviteScreenShare:t,onAdvanceToStage3:r})=>{const c=(x,d)=>!d||x.length<=1?x:`${x[0]}**`;return e.jsxs("div",{id:"peer-review-leaderboard-panel",className:"flex flex-col gap-4 w-full select-none",children:[e.jsxs("div",{className:"bg-[#131b2e] p-4 rounded-xl border border-[#2d3449]/60 flex flex-col gap-3 shadow-md",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(Oe,{size:18,className:"text-[#ffb95f]"}),e.jsx("h2",{className:"text-sm font-semibold text-[#dae2fd]",children:"互评推荐先锋榜"})]}),e.jsx("span",{className:"text-[10px] font-mono text-[#908fa0] font-semibold",children:"TOP NOMINATED"})]}),e.jsx("div",{className:"flex flex-col gap-2.5",children:s.map(x=>e.jsxs("div",{className:`p-3 rounded-lg border transition-all ${x.rank===1?"bg-[#222a3d] border-[#ffb95f]/40 shadow-sm":"bg-[#171f33] border-[#2d3449]/50 hover:bg-[#222a3d]"} flex flex-col gap-1.5`,children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("span",{className:`w-5 h-5 rounded-full font-mono text-[11px] font-bold flex items-center justify-center ${x.rankBadgeClass}`,children:x.rank}),e.jsx("span",{className:"text-xs font-semibold text-[#dae2fd]",children:c(x.name,i)})]}),e.jsxs("span",{className:"font-mono text-xs font-semibold text-[#ffb95f]",children:[x.votes," 票推荐"]})]}),e.jsxs("div",{className:"flex items-center justify-between text-xs",children:[e.jsx("span",{className:"text-[#c7c4d7] truncate max-w-[140px]",children:x.workTitle}),e.jsx("span",{className:`px-1.5 py-0.5 rounded text-[10px] font-mono font-medium ${x.tagBadgeClass}`,children:x.honorTitle})]})]},x.rank))})]}),e.jsxs("div",{className:"bg-[#131b2e] p-4 rounded-xl border border-[#2d3449]/60 flex flex-col gap-3 shadow-md",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx("span",{className:"text-xs font-semibold text-[#dae2fd]",children:"随堂微勋章即时分发箱"}),e.jsx(Re,{size:15,className:"text-[#4edea3]"})]}),e.jsxs("div",{className:"flex flex-col gap-2",children:[e.jsxs("button",{type:"button",onClick:n,className:"w-full flex items-center justify-between px-3 py-2 rounded-lg bg-[#171f33] hover:bg-[#222a3d] border border-[#2d3449]/50 text-[#dae2fd] transition-colors text-xs text-left",children:[e.jsxs("span",{className:"flex items-center gap-2",children:[e.jsx(fe,{size:14,className:"text-[#ffb95f]"}),e.jsx("span",{children:"为全员互评认真学生 +2 积分"})]}),e.jsx("span",{className:"font-mono text-[10px] text-[#4edea3] font-semibold bg-[#00a572]/20 px-1.5 py-0.5 rounded",children:"一键发放"})]}),e.jsxs("button",{type:"button",onClick:o,className:"w-full flex items-center justify-between px-3 py-2 rounded-lg bg-[#171f33] hover:bg-[#222a3d] border border-[#2d3449]/50 text-[#dae2fd] transition-colors text-xs text-left",children:[e.jsxs("span",{className:"flex items-center gap-2",children:[e.jsx(ot,{size:14,className:"text-[#c0c1ff]"}),e.jsx("span",{children:"TOP 2 优秀代码入库数字馆"})]}),e.jsx("span",{className:"font-mono text-[10px] text-[#c0c1ff] font-semibold bg-[#8083ff]/20 px-1.5 py-0.5 rounded",children:"入库归档"})]})]})]}),e.jsxs("div",{className:"bg-[#131b2e] p-4 rounded-xl border border-[#2d3449]/60 flex flex-col gap-3 shadow-md",children:[e.jsx("span",{className:"text-[10px] font-mono text-[#908fa0] font-semibold",children:"TEACHER BROADCAST & STAGE TRANSITION"}),e.jsx("div",{className:"flex flex-col gap-2",children:(()=>{const x=s[0]?.name,d=s[1]?.name??x;return e.jsxs(e.Fragment,{children:[e.jsxs("button",{type:"button",disabled:!x,onClick:()=>x&&a(x),className:"w-full flex items-center justify-between px-3 py-2 rounded-lg bg-[#171f33] hover:bg-[#222a3d] border border-[#2d3449]/50 text-[#dae2fd] transition-colors text-xs text-left disabled:opacity-40 disabled:cursor-not-allowed",children:[e.jsxs("span",{className:"flex items-center gap-2",children:[e.jsx(rs,{size:14,className:"text-[#c0c1ff]"}),e.jsx("span",{children:x?`连麦作者 ${c(x,i)} (分享思路)`:"暂无提名,无法连麦"})]}),e.jsx("span",{className:"text-[#908fa0] text-[10px] font-mono",children:"连线"})]}),e.jsxs("button",{type:"button",disabled:!d,onClick:()=>d&&t(d),className:"w-full flex items-center justify-between px-3 py-2 rounded-lg bg-[#171f33] hover:bg-[#222a3d] border border-[#2d3449]/50 text-[#dae2fd] transition-colors text-xs text-left disabled:opacity-40 disabled:cursor-not-allowed",children:[e.jsxs("span",{className:"flex items-center gap-2",children:[e.jsx(Ys,{size:14,className:"text-[#4edea3]"}),e.jsx("span",{children:d?`邀请 ${c(d,i)} 投屏分享`:"暂无提名,无法投屏"})]}),e.jsx("span",{className:"text-[#908fa0] text-[10px] font-mono",children:"邀请"})]})]})})()}),e.jsx(oe,{slot:"peer_review.action"}),e.jsxs("div",{className:"pt-2",children:[e.jsxs("button",{type:"button",onClick:r,className:"w-full flex items-center justify-center gap-2 py-3 px-4 rounded-xl bg-[#c0c1ff] text-[#1000a9] hover:bg-[#8083ff] hover:text-white transition-all shadow-md group font-semibold text-xs text-center",children:[e.jsx("span",{children:"结束互评,公布全堂总积分榜与学情报告"}),e.jsx(ht,{size:14,className:"group-hover:translate-x-1 transition-transform"})]}),e.jsx("div",{className:"text-center mt-2",children:e.jsx("span",{className:"text-[10px] font-mono text-[#908fa0]",children:"HOTKEY: PRESS ENTER TO ADVANCE TO STAGE 03"})})]})]})]})},Ia=({isVisible:s,danmakuList:i,onSendDanmaku:n,isAnonymous:o=!1})=>{const[a,t]=l.useState(""),[r,c]=l.useState(!1);if(!s)return null;const x=m=>{m.preventDefault(),a.trim()&&(n?.(a.trim(),"text"),t(""))},d=()=>{n?.("语音弹幕 · 点赞神仙算法!","voice")};return e.jsxs("div",{id:"peer-review-danmaku-overlay",className:"absolute inset-0 pointer-events-none overflow-hidden z-20",children:[i.map(m=>e.jsx("div",{className:"absolute whitespace-nowrap animate-danmaku-slide pointer-events-auto",style:{top:`${m.topPercent}%`,right:"-100%"},children:e.jsxs("div",{className:"flex items-center gap-1.5 px-3 py-1 rounded-full bg-[#131b2e]/85 backdrop-blur-md border border-[#2d3449] shadow-lg text-xs text-[#dae2fd]",children:[m.type==="voice"?e.jsxs("span",{className:"flex items-center gap-1 text-[#4edea3] font-mono text-[11px]",children:[e.jsx(rs,{size:12,className:"animate-pulse"}),e.jsxs("span",{children:[m.voiceDuration||3,"s"]})]}):e.jsx("span",{className:"text-sm",children:"💬"}),e.jsxs("span",{className:"text-[#c0c1ff] font-medium",children:[o&&m.sender.length>1?`${m.sender[0]}**`:m.sender,":"]}),e.jsx("span",{className:m.color||"text-white",children:m.text})]})},m.id)),e.jsx("div",{className:"absolute bottom-4 right-4 pointer-events-auto flex items-center gap-2",children:r?e.jsxs("form",{onSubmit:x,className:"flex items-center gap-1.5 bg-[#131b2e]/95 backdrop-blur-md border border-[#2d3449] p-1.5 rounded-full shadow-xl",children:[e.jsx("input",{type:"text",value:a,onChange:m=>t(m.target.value),placeholder:"发送大屏实时弹幕...",className:"bg-transparent px-3 py-1 text-xs text-white placeholder-[#908fa0] focus:outline-none w-48"}),e.jsx("button",{type:"submit",className:"p-1.5 rounded-full bg-[#c0c1ff] text-[#1000a9] hover:bg-white transition-colors",title:"发送",children:e.jsx(De,{size:13})}),e.jsx("button",{type:"button",onClick:d,className:"p-1.5 rounded-full bg-[#171f33] hover:bg-[#222a3d] text-[#4edea3] transition-colors",title:"发送语音弹幕",children:e.jsx(rs,{size:13})}),e.jsx("button",{type:"button",onClick:()=>c(!1),className:"px-2 text-xs text-[#908fa0] hover:text-white",children:"收起"})]}):e.jsxs("button",{type:"button",onClick:()=>c(!0),className:"flex items-center gap-1.5 px-3 py-1.5 rounded-full bg-[#131b2e]/90 hover:bg-[#222a3d] backdrop-blur-md border border-[#2d3449] text-xs text-[#c7c4d7] hover:text-white shadow-lg transition-colors cursor-pointer",children:[e.jsx(hs,{size:13,className:"text-[#c0c1ff]"}),e.jsx("span",{children:"发弹幕"})]})})]})},Da=({isOpen:s,onClose:i})=>s?e.jsx("div",{id:"peer-review-rubric-modal",className:"fixed inset-0 z-50 flex items-center justify-center bg-black/70 backdrop-blur-sm p-4 select-none",children:e.jsxs("div",{className:"bg-[#131b2e] border border-[#2d3449] rounded-2xl w-full max-w-2xl shadow-2xl overflow-hidden flex flex-col max-h-[85vh]",children:[e.jsxs("div",{className:"px-6 py-4 bg-[#171f33] border-b border-[#2d3449] flex items-center justify-between",children:[e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("div",{className:"w-8 h-8 rounded-xl bg-[#ca8100]/20 text-[#ffb95f] flex items-center justify-center border border-[#ca8100]/30",children:e.jsx(Xs,{size:18})}),e.jsxs("div",{children:[e.jsx("h2",{className:"text-sm font-bold text-[#dae2fd]",children:"随堂交叉互评量规细则"}),e.jsx("p",{className:"text-[11px] text-[#908fa0]",children:"三维评价基准 · 激励互助逆向思考"})]})]}),e.jsx("button",{type:"button",onClick:i,className:"p-1.5 rounded-lg text-[#908fa0] hover:text-white hover:bg-[#222a3d] transition-colors",children:e.jsx(be,{size:18})})]}),e.jsxs("div",{className:"p-6 flex flex-col gap-4 overflow-y-auto",children:[e.jsxs("div",{className:"bg-[#171f33] rounded-xl p-4 border border-[#2d3449]/60 flex flex-col gap-2",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("span",{className:"w-6 h-6 rounded-lg bg-[#8083ff]/20 text-[#c0c1ff] font-mono text-xs font-bold flex items-center justify-center",children:"1"}),e.jsx("span",{className:"text-sm font-semibold text-[#dae2fd]",children:"算法逻辑正确性 (40% 权重)"})]}),e.jsx("span",{className:"text-[10px] font-mono text-[#4edea3] bg-[#00a572]/20 px-2 py-0.5 rounded",children:"全班达标率 98%"})]}),e.jsxs("ul",{className:"text-xs text-[#c7c4d7] space-y-1.5 pl-8 list-disc",children:[e.jsxs("li",{children:[e.jsx("strong",{className:"text-white",children:"5.0分(优秀):"}),"算法逻辑自适应,无死循环或边界越界,自适应笔触与角度动态计算完全闭合。"]}),e.jsxs("li",{children:[e.jsx("strong",{className:"text-white",children:"4.0分(良好):"}),"核心功能正常,少数极端情况存在未自增或微小卡顿。"]}),e.jsxs("li",{children:[e.jsx("strong",{className:"text-white",children:"3.0分(需改进):"}),"存在语法报错或死循环,需在互评中指明行号与修复要点。"]})]})]}),e.jsxs("div",{className:"bg-[#171f33] rounded-xl p-4 border border-[#2d3449]/60 flex flex-col gap-2",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("span",{className:"w-6 h-6 rounded-lg bg-[#00a572]/20 text-[#4edea3] font-mono text-xs font-bold flex items-center justify-center",children:"2"}),e.jsx("span",{className:"text-sm font-semibold text-[#dae2fd]",children:"代码规范与缩进 (30% 权重)"})]}),e.jsx("span",{className:"text-[10px] font-mono text-[#4edea3] bg-[#00a572]/20 px-2 py-0.5 rounded",children:"全班达标率 96%"})]}),e.jsxs("ul",{className:"text-xs text-[#c7c4d7] space-y-1.5 pl-8 list-disc",children:[e.jsxs("li",{children:[e.jsx("strong",{className:"text-white",children:"5.0分(优秀):"}),"遵循 PEP8 规范,严格对齐 4 空格缩进,变量语义化规范清晰,关键算子附有说明注释。"]}),e.jsxs("li",{children:[e.jsx("strong",{className:"text-white",children:"4.0分(良好):"}),"缩进基本统一,可读性良好。"]}),e.jsxs("li",{children:[e.jsx("strong",{className:"text-white",children:"3.0分(需改进):"}),"Tab 与空格混用,循环体代码未有效缩进。"]})]})]}),e.jsxs("div",{className:"bg-[#171f33] rounded-xl p-4 border border-[#2d3449]/60 flex flex-col gap-2",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("span",{className:"w-6 h-6 rounded-lg bg-[#ca8100]/20 text-[#ffb95f] font-mono text-xs font-bold flex items-center justify-center",children:"3"}),e.jsx("span",{className:"text-sm font-semibold text-[#dae2fd]",children:"创意美感与拓展 (30% 权重)"})]}),e.jsx("span",{className:"text-[10px] font-mono text-[#ffb95f] bg-[#ca8100]/20 px-2 py-0.5 rounded",children:"全班达标率 92%"})]}),e.jsxs("ul",{className:"text-xs text-[#c7c4d7] space-y-1.5 pl-8 list-disc",children:[e.jsxs("li",{children:[e.jsx("strong",{className:"text-white",children:"5.0分(优秀):"}),"巧妙运用数学模运算(`i % 3`)或外角定理,呈现层次丰富的动态发散图形。"]}),e.jsxs("li",{children:[e.jsx("strong",{className:"text-white",children:"4.0分(良好):"}),"图形规则美观,配色和谐。"]}),e.jsxs("li",{children:[e.jsx("strong",{className:"text-white",children:"3.0分(需改进):"}),"单色基础图形,未探索步长或角度变化。"]})]})]}),e.jsx(oe,{slot:"peer_review.rubric.dimension"})]}),e.jsx("div",{className:"px-6 py-3 bg-[#171f33] border-t border-[#2d3449] flex justify-end",children:e.jsx("button",{type:"button",onClick:i,className:"px-4 py-1.5 rounded-xl bg-[#c0c1ff] text-[#1000a9] font-semibold text-xs hover:bg-white transition-colors",children:"我已知晓"})})]})}):null,gr=({isOpen:s,onClose:i,onAdvanceToStage3:n,lessonTitle:o="",addToast:a,workA:t,workB:r,reviewProgress:c,countdownSeconds:x,onAutoAssign:d,autoAssigning:m=!1,matchingItems:u,badges:v,annotations:N,rubricDimensions:g,reactions:p,podiumStudents:j,danmaku:k})=>{const[w,f]=l.useState({stage:"STAGE 02.4",isLocked:!0,isDualScreen:!0,isAnonymous:!0,timeRemainingSeconds:x??0,totalTimeSeconds:x??0,isPaused:!1,completedReviews:c?.completed??0,totalStudents:c?.total??0,totalLikes:0,totalNominations:0,showVoiceDanmaku:!0,showDanmaku:!0}),[b,z]=l.useState(!1),[_,C]=l.useState(!1),[B,R]=l.useState(u??[]),[J,O]=l.useState(v??[]),[H,ee]=l.useState(t??null),[se,I]=l.useState(r??null),[V,P]=l.useState(N??[]),[y]=l.useState(g??[]),[M,$]=l.useState(p??[]),[S]=l.useState(j??[]),[E,Q]=l.useState(k??[]);l.useEffect(()=>{if(!s||w.isPaused)return;const U=setInterval(()=>{f(Z=>Z.timeRemainingSeconds<=1?{...Z,timeRemainingSeconds:0,isPaused:!0}:{...Z,timeRemainingSeconds:Z.timeRemainingSeconds-1})},1e3);return()=>clearInterval(U)},[s,w.isPaused]);const ie=l.useCallback(U=>{s&&(U.key==="Enter"?(U.preventDefault(),te()):U.key==="Escape"?(U.preventDefault(),i()):U.code==="Space"&&U.target===document.body&&(U.preventDefault(),G()))},[s,i]);if(l.useEffect(()=>(window.addEventListener("keydown",ie),()=>window.removeEventListener("keydown",ie)),[ie]),!s)return null;const pe=()=>{f(U=>({...U,isAnonymous:!U.isAnonymous})),a?.("互评模式已切换",w.isAnonymous?"已恢复显示真实学生姓名":"已开启双盲匿名评价模式","info")},ce=()=>{f(U=>({...U,timeRemainingSeconds:U.timeRemainingSeconds+60,totalTimeSeconds:U.totalTimeSeconds+60})),a?.("互评加时","倒计时已增加 1 分钟","success")},G=()=>{f(U=>({...U,isPaused:!U.isPaused}))},K=()=>{document.fullscreenElement?document.exitFullscreen&&(document.exitFullscreen().catch(()=>{}),z(!1)):(document.documentElement.requestFullscreen().catch(()=>{}),z(!0))},le=U=>{$(Z=>Z.map(T=>T.id===U?{...T,count:T.count+1}:T)),f(Z=>({...Z,totalLikes:Z.totalLikes+1}))},de=U=>{const Z={id:`ann-${Date.now()}`,authorType:"teacher",authorRole:"主讲教师",authorName:"陈老师",timeAgo:"刚刚",content:U,borderColor:"#8083ff"};P(T=>[Z,...T]),a?.("批注已挂载","协同板书批注已同步至大屏","success")},ue=(U,Z="text")=>{const T={id:`d-${Date.now()}`,sender:"主讲教师",text:U,type:Z,voiceDuration:Z==="voice"?4:void 0,topPercent:Math.floor(Math.random()*60)+15,color:"text-[#4edea3]"};Q(re=>[...re,T])},ve=()=>{a?.("微勋章已分发","已向全员认真参与互评的学生批量发放 +2 过程性积分!","success")},A=()=>{const U=[H?.studentName,se?.studentName].filter(Boolean);a?.("作品已入库",U.length>0?`${U.join(" 与 ")}的优秀作品已收录进班级数字展览馆。`:"暂无焦点作品可入库(学生尚未提交)。","success")},L=U=>{a?.("连麦请求已发起",`正在向 ${U} 的学生端发起实时语音连麦...`,"info")},Y=U=>{a?.("投屏邀请已下发",`已向 ${U} 发送大屏投屏演示邀请。`,"info")},te=()=>{a?.("互评阶段已结束","正在推进至 Stage 03 结课巡查与全堂总积分榜...","success"),n&&n(),i()};return e.jsxs("div",{id:"peer-review-showcase-modal",className:"fixed inset-0 z-[9999] bg-[#0b1326] text-[#dae2fd] flex flex-col select-none overflow-hidden font-sans",children:[e.jsx(Ta,{state:w,onToggleAnonymous:pe,onOpenRubricModal:()=>C(!0),onToggleVoiceDanmaku:()=>f(U=>({...U,showDanmaku:!U.showDanmaku})),onAdvanceStage:te,onAddMinute:ce,onTogglePauseTimer:G,isFullscreen:b,onToggleFullscreen:K,onClose:i}),e.jsxs("main",{className:"relative flex-1 overflow-y-auto w-full px-6 py-5",children:[!H&&!se&&B.length===0&&S.length===0&&e.jsxs("div",{className:"mb-4 rounded-xl border border-[#2d3449] bg-[#0b1326] px-4 py-2.5 flex items-center gap-3 text-[11px] text-[#908fa0]",children:[e.jsx("span",{className:"w-1.5 h-1.5 rounded-full bg-amber-400 shrink-0"}),e.jsx("span",{className:"flex-1",children:"本节暂无可展示的互评数据(需至少 2 份学生提交作品)。点击右侧按钮按「1 生评 2 份」自动分配。"}),d&&e.jsx("button",{type:"button",disabled:m,onClick:()=>void d(),className:"px-3 py-1 rounded-lg bg-[#8083ff] text-white text-[11px] font-bold hover:bg-[#9497ff] transition-colors disabled:opacity-50 shrink-0",children:m?"分配中…":"一键分配互评"})]}),e.jsx(Ia,{isVisible:w.showDanmaku,danmakuList:E,onSendDanmaku:ue,isAnonymous:w.isAnonymous}),e.jsxs("div",{className:"grid grid-cols-12 gap-5 items-start",children:[e.jsx("div",{className:"col-span-12 lg:col-span-3",children:e.jsx(Pa,{matchingItems:B,badges:J,isAnonymous:w.isAnonymous,onSelectMatchingItem:U=>{a?.(`查看互评明细 ${U.code}`,`${U.reviewerName} 正在审阅 ${U.targetStudentName} 的作业`,"info")}})}),e.jsxs("div",{className:"col-span-12 lg:col-span-6 flex flex-col gap-4",children:[!H&&!se&&e.jsxs("div",{className:"rounded-xl border border-dashed border-[#2d3449] bg-[#0b1326] p-6 text-center",children:[e.jsx("p",{className:"text-xs font-bold text-[#dae2fd]",children:"暂无提交作品可供对比"}),e.jsx("p",{className:"text-[10px] text-[#908fa0] mt-1",children:"学生提交课件作业后,此处将自动展示两份真实作品的并排对比。"})]}),H||se?e.jsx(Ra,{workA:H,workB:se,annotations:V,isAnonymous:w.isAnonymous,onFullscreenCanvas:K,onSyncSandboxToClass:()=>{a?.("沙箱广播已生效",`对比范本已同步至全班 ${w.totalStudents||0} 台学生机控制台`,"success")},onAddAnnotation:de}):null,e.jsx(_a,{dimensions:y,averagePercentage:95.3,reactions:M,onReactionClick:le,syncedStudentsCount:32})]}),e.jsx("div",{className:"col-span-12 lg:col-span-3",children:e.jsx(Ma,{podiumStudents:S,isAnonymous:w.isAnonymous,onAwardPeerReviewPoints:ve,onArchiveTopWorks:A,onCallStudentMic:L,onInviteScreenShare:Y,onAdvanceToStage3:te})})]})]}),e.jsx(Da,{isOpen:_,onClose:()=>C(!1)})]})};function Oa({isOpen:s,onClose:i,lessonId:n,lessonTitle:o="互动课堂",lang:a="zh"}){const[t,r]=l.useState({stage:"IN_CLASS_TEACHING",checkinCode:null,activePoll:null,activeBuzzer:null,pacing:{TOO_FAST:0,CONFUSED:0,CLEAR:0}}),[c,x]=l.useState(!1),[d,m]=l.useState(""),[u,v]=l.useState(!1);if(l.useEffect(()=>{const j=()=>{m(new Date().toLocaleTimeString([],{hour:"2-digit",minute:"2-digit",second:"2-digit"}))};j();const k=setInterval(j,1e3);return()=>clearInterval(k)},[]),l.useEffect(()=>{if(!s||!n)return;let j=!0;const k=async()=>{try{const f=await fetch(`/api/classroom/stage/${n}/data`);if(f.ok&&j){const b=await f.json();r(b)}}catch(f){console.warn("[StageDisplay] Fetch error:",f)}};k();const w=setInterval(k,2e3);return()=>{j=!1,clearInterval(w)}},[s,n]),!s)return null;const N=()=>{document.fullscreenElement?document.exitFullscreen&&(document.exitFullscreen().catch(()=>{}),x(!1)):(document.documentElement.requestFullscreen().catch(()=>{}),x(!0))},g={PRE_CLASS_READY:a==="zh"?"课前就绪 · 准备上课":"Pre-Class Preparation",IN_CLASS_TEACHING:a==="zh"?"课中授课 · 互动探索":"Interactive Teaching",WRAP_UP_EXIT_TICKET:a==="zh"?"总结提升 · 结课通票":"Wrap-Up & Exit Ticket",ARCHIVED_REPORT:a==="zh"?"下课归档 · 学情简报":"Archived Report"},p=(t.pacing.TOO_FAST||0)+(t.pacing.CONFUSED||0)+(t.pacing.CLEAR||0);return e.jsxs("div",{id:"stage-display-modal",className:"fixed inset-0 z-[9999] bg-slate-950 text-slate-100 flex flex-col select-none overflow-hidden",children:[e.jsxs("header",{className:"h-20 px-8 bg-slate-900/80 border-b border-slate-800 flex items-center justify-between backdrop-blur-md",children:[e.jsxs("div",{className:"flex items-center gap-4",children:[e.jsxs("div",{className:"flex items-center gap-2.5 px-3 py-1.5 bg-blue-500/10 border border-blue-500/30 rounded-full text-blue-400 font-semibold text-sm",children:[e.jsx("span",{className:"w-2.5 h-2.5 rounded-full bg-blue-400 animate-ping"}),e.jsx("span",{children:a==="zh"?"大屏教学展台":"Stage Display"})]}),e.jsx("h1",{className:"text-2xl font-bold tracking-tight text-white line-clamp-1",children:o}),e.jsx("span",{className:"px-3 py-1 bg-slate-800 text-slate-300 text-xs font-mono rounded-md border border-slate-700",children:g[t.stage]||g.IN_CLASS_TEACHING})]}),e.jsxs("div",{className:"flex items-center gap-6",children:[e.jsxs("div",{className:"flex items-center gap-2 px-4 py-2 bg-slate-800/60 rounded-xl border border-slate-700/60 font-mono text-xl font-bold text-slate-200",children:[e.jsx(Le,{size:20,className:"text-blue-400"}),e.jsx("span",{children:d})]}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsxs("button",{id:"stage-peer-review-toggle",type:"button",onClick:()=>v(!0),className:"flex items-center gap-1.5 px-3 py-2 bg-teal-500/20 hover:bg-teal-500/30 text-teal-300 rounded-xl transition-colors border border-teal-500/40 text-xs font-semibold cursor-pointer",title:"进入全班大屏作业互评与协同赏析模式 (Stitch 21e2dac1)",children:[e.jsx(xs,{size:15}),e.jsx("span",{children:"作业互评赏析"})]}),e.jsx("button",{id:"stage-fullscreen-toggle",onClick:N,className:"p-3 bg-slate-800 hover:bg-slate-700 text-slate-300 rounded-xl transition-colors border border-slate-700 cursor-pointer",title:c?"退出全屏":"全屏展示",children:c?e.jsx(Xr,{size:20}):e.jsx(ea,{size:20})}),e.jsx("button",{id:"stage-close-button",onClick:i,className:"p-3 bg-rose-900/40 hover:bg-rose-900/70 text-rose-300 rounded-xl transition-colors border border-rose-800/50 cursor-pointer",title:"关闭展台",children:e.jsx(be,{size:20})})]})]})]}),e.jsxs("main",{className:"flex-1 p-8 grid grid-cols-12 gap-8 overflow-y-auto",children:[e.jsxs("section",{className:"col-span-8 flex flex-col gap-6",children:[t.stage==="PRE_CLASS_READY"&&e.jsxs("div",{className:"flex-1 bg-gradient-to-br from-slate-900 to-slate-850 rounded-3xl border border-slate-800 p-10 flex flex-col justify-center items-center text-center shadow-2xl",children:[e.jsx("div",{className:"p-4 bg-blue-500/10 rounded-3xl border border-blue-500/20 text-blue-400 mb-6",children:e.jsx(It,{size:48,className:"animate-pulse"})}),e.jsx("h2",{className:"text-3xl font-extrabold text-white mb-2",children:a==="zh"?"即将开始上课,请同学们准备":"Class Starting Soon"}),e.jsx("p",{className:"text-slate-400 text-lg mb-8 max-w-md",children:a==="zh"?"请打开平板或电脑进入课堂,输入口令加入":"Please join the interactive session using your device"}),t.checkinCode&&e.jsxs("div",{className:"px-10 py-6 bg-slate-800/90 rounded-2xl border border-blue-500/40 shadow-inner flex flex-col items-center",children:[e.jsx("span",{className:"text-xs uppercase tracking-widest text-slate-400 font-bold mb-2",children:a==="zh"?"课堂入课口令":"Class Code"}),e.jsx("span",{className:"text-6xl font-mono font-black tracking-wider text-blue-400",children:t.checkinCode})]})]}),t.activePoll&&e.jsxs("div",{className:"bg-slate-900/90 rounded-3xl border border-slate-800 p-8 shadow-xl flex flex-col gap-6",children:[e.jsxs("div",{className:"flex items-center justify-between border-b border-slate-800/80 pb-4",children:[e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("span",{className:"p-2.5 bg-amber-500/10 text-amber-400 rounded-xl border border-amber-500/20",children:e.jsx(fe,{size:24})}),e.jsxs("div",{children:[e.jsx("span",{className:"text-xs font-bold text-amber-400 uppercase tracking-wide",children:a==="zh"?"课堂极速互动":"Quick Activity"}),e.jsx("h3",{className:"text-xl font-bold text-white",children:t.activePoll.title})]})]}),e.jsxs("div",{className:"text-right",children:[e.jsx("span",{className:"text-3xl font-black text-amber-400 font-mono",children:t.activePoll.totalVotes||0}),e.jsx("span",{className:"text-xs text-slate-400 block",children:a==="zh"?"人已作答":"Responded"})]})]}),e.jsx("div",{className:"grid grid-cols-2 gap-4 my-2",children:(t.activePoll.options||["A","B","C","D"]).map(j=>{const k=t.activePoll.distribution?.[j]||0;t.activePoll.totalVotes;const w=Math.round(k/(t.activePoll.totalVotes||1)*100);return e.jsxs("div",{className:"p-5 bg-slate-800/50 rounded-2xl border border-slate-700/50 flex flex-col gap-3",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("span",{className:"w-10 h-10 rounded-xl bg-blue-500 text-white font-bold text-lg flex items-center justify-center shadow-md",children:j}),e.jsxs("span",{className:"font-semibold text-slate-200 text-lg",children:["选项 ",j]})]}),e.jsxs("span",{className:"font-mono font-bold text-xl text-blue-400",children:[w,"% (",k,")"]})]}),e.jsx("div",{className:"h-4 w-full bg-slate-700/40 rounded-full overflow-hidden",children:e.jsx("div",{className:"h-full bg-gradient-to-r from-blue-500 to-indigo-500 transition-all duration-500 rounded-full",style:{width:`${w}%`}})})]},j)})})]}),t.activeBuzzer&&e.jsxs("div",{className:"bg-slate-900/90 rounded-3xl border border-slate-800 p-8 shadow-xl flex flex-col items-center text-center justify-center",children:[e.jsx("div",{className:"p-4 bg-rose-500/10 rounded-2xl border border-rose-500/20 text-rose-400 mb-4",children:e.jsx(us,{size:36,className:"animate-bounce"})}),e.jsx("h3",{className:"text-2xl font-bold text-white mb-2",children:t.activeBuzzer.title}),t.activeBuzzer.status==="READY"?e.jsxs("div",{className:"my-6 py-6 px-12 bg-rose-950/30 border border-rose-500/30 rounded-2xl",children:[e.jsx("span",{className:"text-4xl font-extrabold text-rose-400 animate-pulse block",children:a==="zh"?"⚡ 全班抢答中...":"⚡ Buzzing in progress..."}),e.jsx("span",{className:"text-sm text-slate-400 mt-2 block",children:a==="zh"?"请按手中的抢答按钮!":"Press your buzzer now!"})]}):e.jsxs("div",{className:"my-6 py-6 px-12 bg-emerald-950/30 border border-emerald-500/40 rounded-2xl flex flex-col items-center",children:[e.jsx(Re,{size:48,className:"text-amber-400 mb-2"}),e.jsx("span",{className:"text-sm text-emerald-400 font-bold tracking-wide uppercase",children:a==="zh"?"🎉 抢答成功!":"🎉 First to Buzz!"}),e.jsx("span",{className:"text-5xl font-black text-white my-2 font-mono",children:t.activeBuzzer.winnerName||"同学"}),t.activeBuzzer.responseTimeMs&&e.jsx("span",{className:"text-sm font-mono text-emerald-300",children:a==="zh"?`响应用时:${t.activeBuzzer.responseTimeMs} 毫秒`:`Reaction time: ${t.activeBuzzer.responseTimeMs} ms`})]})]}),t.stage==="WRAP_UP_EXIT_TICKET"&&e.jsxs("div",{className:"bg-gradient-to-br from-indigo-950/40 to-slate-900 rounded-3xl border border-indigo-800/40 p-8 shadow-xl flex flex-col items-center text-center",children:[e.jsx(Qs,{size:48,className:"text-indigo-400 mb-4"}),e.jsx("h3",{className:"text-3xl font-extrabold text-white mb-2",children:a==="zh"?"60 秒结课通票 (Exit Ticket)":"60s Exit Ticket"}),e.jsx("p",{className:"text-slate-300 text-lg max-w-lg mb-6",children:a==="zh"?"请同学们打开设备完成本次课堂评估:选星级、写下今天最困惑的一个知识点。":"Please complete your 60-second summary ticket on your device."})]}),e.jsx(oe,{slot:"stage.display.card",slotProps:{lessonId:n,stage:t.stage}})]}),e.jsx("aside",{className:"col-span-4 flex flex-col gap-6",children:e.jsxs("div",{className:"bg-slate-900/90 rounded-3xl border border-slate-800 p-6 shadow-xl flex flex-col gap-4",children:[e.jsxs("div",{className:"flex items-center justify-between border-b border-slate-800/80 pb-3",children:[e.jsxs("div",{className:"flex items-center gap-2 text-white font-bold text-base",children:[e.jsx(_e,{size:18,className:"text-blue-400"}),e.jsx("span",{children:a==="zh"?"学习节奏晴雨表":"Pacing Barometer"})]}),e.jsxs("span",{className:"text-xs text-slate-400 font-mono",children:[p," ",a==="zh"?"次反馈":"signals"]})]}),e.jsxs("div",{className:"flex flex-col gap-3 my-1",children:[e.jsxs("div",{className:"flex items-center justify-between text-sm",children:[e.jsxs("span",{className:"flex items-center gap-2 text-emerald-300 font-medium",children:[e.jsx("span",{className:"w-2.5 h-2.5 rounded-full bg-emerald-400"}),a==="zh"?"听懂了 / 节奏合适":"Clear & Smooth"]}),e.jsx("span",{className:"font-mono font-bold text-white",children:t.pacing.CLEAR||0})]}),e.jsx("div",{className:"h-3 w-full bg-slate-800 rounded-full overflow-hidden",children:e.jsx("div",{className:"h-full bg-emerald-500 rounded-full transition-all duration-500",style:{width:`${p>0?(t.pacing.CLEAR||0)/p*100:0}%`}})}),e.jsxs("div",{className:"flex items-center justify-between text-sm pt-2",children:[e.jsxs("span",{className:"flex items-center gap-2 text-amber-300 font-medium",children:[e.jsx("span",{className:"w-2.5 h-2.5 rounded-full bg-amber-400"}),a==="zh"?"有些困惑 / 需点拨":"Confused"]}),e.jsx("span",{className:"font-mono font-bold text-white",children:t.pacing.CONFUSED||0})]}),e.jsx("div",{className:"h-3 w-full bg-slate-800 rounded-full overflow-hidden",children:e.jsx("div",{className:"h-full bg-amber-500 rounded-full transition-all duration-500",style:{width:`${p>0?(t.pacing.CONFUSED||0)/p*100:0}%`}})}),e.jsxs("div",{className:"flex items-center justify-between text-sm pt-2",children:[e.jsxs("span",{className:"flex items-center gap-2 text-rose-300 font-medium",children:[e.jsx("span",{className:"w-2.5 h-2.5 rounded-full bg-rose-400"}),a==="zh"?"讲太快了 / 跟不上":"Too Fast"]}),e.jsx("span",{className:"font-mono font-bold text-white",children:t.pacing.TOO_FAST||0})]}),e.jsx("div",{className:"h-3 w-full bg-slate-800 rounded-full overflow-hidden",children:e.jsx("div",{className:"h-full bg-rose-500 rounded-full transition-all duration-500",style:{width:`${p>0?(t.pacing.TOO_FAST||0)/p*100:0}%`}})})]}),e.jsx("p",{className:"text-xs text-slate-500 text-center mt-2",children:a==="zh"?"提示:此数据来自学生端匿名点击,自动脱敏保护学生自尊。":"Aggregated anonymized signals from student devices."})]})})]}),u&&e.jsx(gr,{isOpen:u,onClose:()=>v(!1),lessonTitle:o})]})}const Qt={CLEAR:{emoji:"💡",zh:"理解",en:"Clear",color:"#10b981"},CONFUSED:{emoji:"❓",zh:"困惑",en:"Confused",color:"#f59e0b"},TOO_FAST:{emoji:"🐇",zh:"慢一点",en:"Slow down",color:"#f43f5e"},SLOW:{emoji:"🐢",zh:"快一点",en:"Speed up",color:"#6366f1"}},La=["CLEAR","CONFUSED","TOO_FAST","SLOW"];function Fa({lessonId:s,lang:i,signals:n,onlineCount:o=0,onClose:a}){const t=i==="zh",[r,c]=l.useState(n);l.useEffect(()=>{const N=Ks();if(!N)return;const g=p=>{p?.lessonId===s&&p?.summary&&c(p.summary)};return N.on("classroom:pacing_updated",g),()=>{typeof N.off=="function"&&N.off("classroom:pacing_updated",g)}},[s]);const x=La.map(N=>({key:N,count:Number(r[N]??0)})),d=x.reduce((N,g)=>N+g.count,0);Number(r.CONFUSED??0)+Number(r.TOO_FAST??0)+Number(r.SLOW??0);const m=d>0?Math.round(Number(r.CLEAR??0)/d*100):null,u=l.useCallback(()=>d===0?{text:t?"暂无学生反馈,等待中…":"No feedback yet",tone:"text-muted"}:Number(r.CONFUSED??0)>=Math.max(2,d*.3)?{text:t?"⚠ 较多学生困惑,建议放慢并重新讲解当前环节":"⚠ Many students are confused — slow down and re-explain",tone:"text-amber-600"}:Number(r.TOO_FAST??0)>=Math.max(2,d*.3)?{text:t?"🐇 较多学生希望放慢节奏":"🐇 Many students want you to slow down",tone:"text-rose-600"}:Number(r.SLOW??0)>=Math.max(2,d*.3)?{text:t?"🐢 较多学生希望加快节奏":"🐢 Many students want you to speed up",tone:"text-indigo-600"}:{text:t?"✓ 节奏反馈健康,可按当前节奏继续":"✓ Pace is healthy — carry on",tone:"text-emerald-600"},[r,d,t]),v=x.filter(N=>N.count>0).map(N=>({name:Qt[N.key][t?"zh":"en"],value:N.count,color:Qt[N.key].color}));return e.jsx("div",{className:"fixed inset-0 z-[90] flex items-center justify-center bg-slate-900/60 backdrop-blur-2xs",onPointerDown:a,children:e.jsxs("div",{className:"bg-surface border border-theme rounded-2xl shadow-2xl w-[560px] max-w-[92vw] max-h-[86vh] overflow-y-auto p-5 font-sans text-main",onPointerDown:N=>N.stopPropagation(),children:[e.jsxs("div",{className:"flex items-center justify-between mb-4",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("div",{className:"p-2 bg-primary-theme/10 text-primary-theme rounded-xl",children:e.jsx(ta,{size:18})}),e.jsxs("div",{children:[e.jsxs("h2",{className:"text-sm font-black text-main flex items-center gap-1.5",children:[t?"课堂反馈情绪仪表盘":"Classroom Feedback Dashboard",e.jsxs("span",{className:"flex items-center gap-1 text-2xs font-bold text-emerald-600 bg-emerald-500/10 px-1.5 py-0.5 rounded-full",children:[e.jsx(_e,{size:10})," ",t?"实时":"LIVE"]})]}),e.jsx("p",{className:"text-2xs text-muted mt-0.5",children:t?"近 5 分钟窗口 · 全班节奏反馈聚合":"Last 5 minutes · aggregated pace feedback"})]})]}),e.jsx("button",{onClick:a,className:"p-1.5 rounded-lg hover:bg-surface-secondary text-muted cursor-pointer",title:t?"关闭":"Close",children:e.jsx(be,{size:16})})]}),e.jsxs("div",{className:"flex flex-col md:flex-row gap-4 items-center",children:[e.jsxs("div",{className:"w-[200px] h-[200px] relative shrink-0",children:[d>0?e.jsx(Ca,{width:"100%",height:"100%",children:e.jsx($a,{children:e.jsx(Aa,{data:v,dataKey:"value",nameKey:"name",innerRadius:52,outerRadius:85,paddingAngle:3,strokeWidth:0,isAnimationActive:!1,children:v.map((N,g)=>e.jsx(Ea,{fill:N.color},g))})})}):e.jsx("div",{className:"w-full h-full flex items-center justify-center text-3xl opacity-30",children:"📊"}),e.jsxs("div",{className:"absolute inset-0 flex flex-col items-center justify-center pointer-events-none",children:[e.jsxs("span",{className:"text-2xs text-muted flex items-center gap-1",children:[e.jsx(ke,{size:10})," ",o," ",t?"在线":"online"]}),e.jsx("span",{className:`text-xl font-black ${m===null?"text-muted":m>=60?"text-emerald-600":m>=30?"text-amber-600":"text-rose-600"}`,children:m===null?"—":`${m}%`}),e.jsx("span",{className:"text-2xs text-muted",children:t?"理解占比":"clear ratio"})]})]}),e.jsxs("div",{className:"flex-1 w-full flex flex-col gap-2.5",children:[x.map(({key:N,count:g})=>{const p=Qt[N],j=d>0?Math.round(g/d*100):0;return e.jsxs("div",{children:[e.jsxs("div",{className:"flex items-center justify-between text-xs mb-0.5",children:[e.jsxs("span",{className:"font-bold text-main",children:[p.emoji," ",t?p.zh:p.en]}),e.jsxs("span",{className:"text-muted font-mono",children:[g," · ",j,"%"]})]}),e.jsx("div",{className:"h-2.5 bg-surface-secondary rounded-full overflow-hidden border border-theme/50",children:e.jsx("div",{className:"h-full rounded-full transition-all duration-500",style:{width:`${j}%`,background:p.color}})})]},N)}),e.jsx("div",{className:`mt-1 text-xs font-bold ${u().tone}`,children:u().text})]})]})]})})}function Ns({isOpen:s,onClose:i,student:n,lessonId:o,classId:a,lang:t="zh",addToast:r,onInspectSandbox:c,onCastStudentScreen:x,onAwardPoints:d}){const[m,u]=l.useState("profile"),[v,N]=l.useState(""),[g,p]=l.useState(!1),j=n?.competencyScores,k=l.useMemo(()=>[{key:"logic",label:t==="zh"?"算法逻辑":"Logic"},{key:"engineering",label:t==="zh"?"代码工程":"Engineering"},{key:"creativity",label:t==="zh"?"创新思维":"Creativity"},{key:"collaboration",label:t==="zh"?"团队协作":"Collaboration"},{key:"focus",label:t==="zh"?"课堂专注":"Focus"}],[t]),w=l.useMemo(()=>k.map($=>{const S=j?.[$.key],E=typeof S=="number"&&Number.isFinite(S);return{key:$.key,label:$.label,score:E?Math.max(0,Math.min(100,Math.round(S))):0,available:E}}),[j,k]),f=w.some($=>$.available),b=w.filter($=>!$.available).map($=>$.label),z=l.useMemo(()=>{const $=t==="zh",S=n?.name??(t==="zh"?"该学生":"This student"),E=w.filter(K=>K.available);if(E.length===0)return $?`${S}本节暂无可用的维度数据(未参与随堂测/课件互动),无法生成掌握度评语。建议下节课关注其参与情况。`:`${S} has no competency data for this session (no quiz/courseware interaction).`;const Q=Math.round(E.reduce((K,le)=>K+le.score,0)/E.length),ie=E.reduce((K,le)=>le.score>K.score?le:K),pe=E.reduce((K,le)=>le.score<K.score?le:K),ce=w.filter(K=>!K.available).map(K=>K.label);return($?[`本节已采集维度:${E.map(K=>`${K.label} ${K.score}`).join("、")},平均 ${Q}。`,`相对优势为${ie.label}(${ie.score}),相对薄弱为${pe.label}(${pe.score})。`,ce.length>0?`未采集维度:${ce.join("、")}。`:""]:[`Collected: ${E.map(K=>`${K.label} ${K.score}`).join(", ")}; average ${Q}.`,`Strongest ${ie.label} (${ie.score}), weakest ${pe.label} (${pe.score}).`,ce.length>0?`Missing: ${ce.join(", ")}.`:""]).filter(Boolean).join(" ")},[w,t,n]),_=l.useMemo(()=>{const $=t==="zh",S=w.filter(Q=>Q.available);if(S.length===0)return $?"数据不足,暂不生成建议":"Insufficient data";const E=S.reduce((Q,ie)=>Q+ie.score,0)/S.length;return E>=85?$?"建议进入算法创新挑战营":"Recommended for Advanced Camp":E>=70?$?"建议保持当前节奏并补强薄弱维度":"Keep pace, strengthen weak areas":$?"建议课后补充基础微练习":"Suggest remedial practice"},[w,t]),C=l.useMemo(()=>{const $=w.filter(E=>E.available);if($.length===0)return"—";const S=$.reduce((E,Q)=>E+Q.score,0)/$.length;return S>=90?"A+":S>=80?"A":S>=70?"B+":S>=60?"B":"C"},[w]),B=l.useMemo(()=>{const Q=(K,le)=>{const de=-Math.PI/2+2*Math.PI/5*le;return{x:100+K*Math.cos(de),y:100+K*Math.sin(de)}},ie=[1,.66,.33].map(K=>{const le=75*K;return Array.from({length:5},(ue,ve)=>{const{x:A,y:L}=Q(le,ve);return`${A.toFixed(1)},${L.toFixed(1)}`}).join(" ")}),pe=Array.from({length:5},(K,le)=>{const{x:de,y:ue}=Q(75,le);return{x1:100,y1:100,x2:de,y2:ue}}),ce=w.map((K,le)=>{const de=75*Math.min(Math.max(K.score/100,.1),1);return Q(de,le)}),G=ce.map(K=>`${K.x.toFixed(1)},${K.y.toFixed(1)}`).join(" ");return{gridLevels:ie,axes:pe,dataPoints:ce,dataPolygonString:G}},[w]);if(!s||!n)return null;const R=n.points??0,J=n.deltaPoints??4,O=n.focusPercentage,H=n.accuracyPercentage,ee=n.helpCount??3,se=n.role||n.student_number||"",I=n.group_name||"",V=n.student_number||n.id.slice(-6),P=n.timeline??[],y=async($,S)=>{p(!0);try{d?d(n.id,$,S):await fetch(`/api/students/${n.id}/points`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({delta:$,dimension:"attribution",reason:S,classId:a,lessonId:o})}),r?.(t==="zh"?"成长积分已发放":"Points Awarded",t==="zh"?`已为学生 [${n.name}] ${$>=0?"+":""}${$} 分(${S})`:`Awarded ${$} pts to [${n.name}]`,"success")}catch(E){r?.("Error",E.message,"error")}finally{p(!1)}},M=()=>{const $=`# 学生个人全景学情与成长档案 (${n.name})
|
|
1
|
+
import{r as l,j as e,R as _t}from"./vendor-react-B0t7H3hh.js";import{L as Ur}from"./LazyWhiteboard-BJwCEZAU.js";import{h as Ks,E as oe,i as Be,j as He,l as Ds,e as Hr,k as qr,n as Ye,r as Vr}from"./index-BKBCBKvy.js";import{ab as $e,am as Re,aD as Kr,C as Js,aI as Qs,_ as tt,aB as ss,U as ke,J as os,b as is,t as Et,i as ls,aM as De,N as st,aW as Ys,aJ as Zs,W as cs,Q as Jr,aX as Qr,aY as Xs,aZ as Yr,ad as Zr,ac as er,X as be,y as ds,r as je,A as ht,O as rt,w as Ge,a_ as xs,a$ as ms,b0 as tr,b1 as Mt,Y as Oe,f as fe,B as ot,b2 as rs,a8 as hs,F as Le,b3 as Xr,b4 as ea,ax as It,p as us,ah as _e,b5 as ta,aL as sa,b6 as sr,b7 as mt,b8 as Dt,b9 as ra,ba as rr,D as Ot,aO as ps,bb as ar,R as ut,bc as aa,bd as na,be as Tt,T as at,n as nr,bf as or,bg as oa,a4 as Se,Z as ia,bh as la,bi as Lt,bj as ca,bk as da,h as pt,K as xa,e as Ve,j as ft,bl as ma,ay as Pt,a2 as ir,bm as lr,bn as fs,u as xt,bo as bs,aF as bt,z as cr,bp as dr,G as ha,bq as ua,br as pa,bs as xr,L as fa,E as Ft,bt as ba,m as mr,ap as ga,ae as gs,a3 as hr,bu as ur,bv as js,bw as ja,bx as pr,by as fr,bz as Na,bA as ya,aQ as as,v as va,S as Os,aw as wa,aG as ka}from"./vendor-icons-BRmhY6fg.js";import{C as za,T as Sa}from"./ClassroomCountdownWidget-96WFRO9A.js";import{a as Ca,P as $a,h as Aa,g as Ea}from"./vendor-charts-qLbgF1eL.js";import"./vendor-utils-m0Urvtws.js";import"./vendor-pdf-D7rGevI1.js";import"./vendor-motion-BFAPOs-b.js";import"./vendor-pptx-C5-U7ieS.js";function br({lessonId:s,lang:i,addToast:n}){const[o,a]=l.useState(!1),[t,r]=l.useState(!1),[c,x]=l.useState([]),[d,m]=l.useState(60),[u,v]=l.useState(40),[N,g]=l.useState({}),[p,j]=l.useState({}),[k,w]=l.useState({}),[f,b]=l.useState({}),[z,_]=l.useState({}),[C,B]=l.useState({}),R=i==="zh",J=async(I=!1)=>{I?r(!0):a(!0);try{const P=await(await fetch(`/api/lessons/${s}/eval-grades`)).json();if(Array.isArray(P)){x(P);const y={},M={},$={},S={};P.forEach(E=>{E.grade?(y[E.id]=E.grade.teacher_score,M[E.id]=E.grade.teacher_comment,$[E.id]=Math.round(E.grade.teacher_weight*100),S[E.id]=Math.round(E.grade.peer_weight*100)):(y[E.id]=N[E.id]!==void 0?N[E.id]:80,M[E.id]=p[E.id]!==void 0?p[E.id]:"",$[E.id]=k[E.id]!==void 0?k[E.id]:d,S[E.id]=f[E.id]!==void 0?f[E.id]:u)}),g(E=>({...y,...E})),j(E=>({...M,...E})),w(E=>({...$,...E})),b(E=>({...S,...E}))}else throw new Error("Invalid submissions data format")}catch(V){console.error("Error fetching submissions grades:",V),n(R?"数据加载失败":"Failed to Load Data",R?"请检查网络连接或刷新页面。":"Please check your connection and try again.","warning")}finally{a(!1),r(!1)}};l.useEffect(()=>{s&&J()},[s]),l.useEffect(()=>{const I=Ks();if(!I||!s)return;const V=P=>{(!P?.lessonId||P.lessonId===s)&&J()};return I.on("assignment-submitted-toast",V),()=>{typeof I.off=="function"&&I.off("assignment-submitted-toast",V)}},[s]);const O=I=>{m(I),v(100-I),w(V=>{const P={...V};return c.forEach(y=>{(!y.grade||y.grade.status!=="confirmed")&&(P[y.id]=I)}),P}),b(V=>{const P={...V};return c.forEach(y=>{(!y.grade||y.grade.status!=="confirmed")&&(P[y.id]=100-I)}),P})},H=(I,V)=>{w(P=>({...P,[I]:V})),b(P=>({...P,[I]:100-V}))},ee=async(I,V)=>{const P=N[I],y=p[I]||"",M=(k[I]??d)/100,$=(f[I]??u)/100;if(P===void 0||isNaN(P)||P<0||P>100){n(R?"评分无效":"Invalid Score",R?"教师评分必须在 0 到 100 之间!":"Teacher score must be between 0 and 100!","warning");return}if(V==="confirmed"){const S=R?"确认同步后,最终得分将直接同步写入宿主学期成绩库,此后该学生的作业成绩将锁定不可修改。是否确认?":"Once confirmed, the final score will be synced to the host semester reports and locked. Proceed?";if(!window.confirm(S))return}B(S=>({...S,[I]:V}));try{const E=await(await fetch("/api/commands",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({commandType:"assignment.grade",payload:{submissionId:I,teacherScore:Number(P),teacherComment:y,teacherWeight:M,peerWeight:$,status:V}})})).json();if(E.success)n(V==="confirmed"?R?"平时成绩同步成功":"Semester Grade Synced":R?"平时成绩草稿已保存":"Grade Draft Saved",V==="confirmed"?R?`已将平时成绩 ${E.result.calculatedFinalScore} 分同步至学期报告!`:`Successfully synced grade ${E.result.calculatedFinalScore}!`:R?"成功保存了教师打分与评语草稿。":"Successfully saved score and comment draft.","success"),J(!0);else throw new Error(E.error||"Failed to submit grade")}catch(S){n(R?"操作失败":"Operation Failed",S.message,"warning")}finally{B(S=>({...S,[I]:null}))}},se=I=>{_(V=>({...V,[I]:!V[I]}))};return o?e.jsxs("div",{className:"flex-grow flex flex-col items-center justify-center py-12 text-gray-500",children:[e.jsx($e,{className:"animate-spin text-indigo-500 mb-2",size:32}),e.jsx("p",{className:"text-xs",children:R?"正在读取学生作业与成绩状态...":"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(Re,{size:16,className:"text-indigo-655"}),R?"学生作业成绩评定与折算系统":"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:[c.length," ",R?"个提交":"submissions"]})]}),e.jsx("button",{onClick:()=>J(!0),disabled:t,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:R?"刷新数据":"Refresh",children:e.jsx($e,{size:12,className:t?"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(Kr,{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:R?"全局默认折算权重设置":"Default Grading Weights Configuration"}),e.jsx("p",{className:"text-xs text-slate-400 mt-0.5 font-medium",children:R?"调整权重分配,所有尚未锁定成绩的学生将自动应用此默认权重比例。":"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:R?"教师评分:":"Teacher:"}),e.jsx("input",{type:"range",min:"0",max:"100",step:"5",value:d,onChange:I=>O(Number(I.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:[d,"%"]})]}),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:R?"学生互评:":"Peer Review:"}),e.jsxs("span",{className:"text-xs font-bold text-slate-700 w-8",children:[u,"%"]})]})]})]}),e.jsx("div",{className:"flex-grow flex-1 overflow-y-auto space-y-4 pr-1 scrollbar-thin",children:c.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(Js,{size:32,className:"text-slate-350"}),e.jsx("p",{className:"text-xs",children:R?"本节课目前没有任何学生提交作业。":"No students have submitted assignments yet for this lesson."})]}):c.map(I=>{const V=N[I.id]!==void 0?N[I.id]:80,P=p[I.id]||"",y=k[I.id]??d,M=f[I.id]??u,$=I.grade?.status==="confirmed",S=Math.round(V*(y/100)+I.peerAverageScore*(M/100));return e.jsxs("div",{className:`bg-white border rounded-xl shadow-3xs overflow-hidden transition-all ${$?"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:I.studentName?.charAt(0)||"S"}),e.jsxs("div",{children:[e.jsx("div",{className:"text-xs font-bold text-slate-800",children:I.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",I.version]}),e.jsx("span",{children:"•"}),e.jsx("span",{children:new Date(I.updatedAt).toLocaleString()})]})]})]}),e.jsxs("div",{className:"flex items-center gap-2",children:[$?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(Qs,{size:12}),R?"成绩已同步":"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:I.grade?R?"草稿状态":"Draft":R?"未评定":"Ungraded"}),e.jsxs("a",{href:I.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:I.filePath,children:[e.jsx(tt,{size:11}),R?"查看作业":"View File",e.jsx(ss,{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(ke,{size:13,className:"text-slate-400"}),R?"学生互评详情":"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:[R?"互评人数:":"Reviews:"," ",I.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:R?"均分":"Avg"}),e.jsx("span",{className:"text-sm font-extrabold text-slate-700 leading-none mt-0.5",children:I.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:I.peerReviews.length>0?R?"根据同学互评分数得出的平均值。":"Average score computed from classmate evaluations.":R?"暂无同学对此作业给出评分。":"No classmate peer reviews received yet."}),I.peerReviews.length>0&&e.jsx("button",{onClick:()=>se(I.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:z[I.id]?e.jsxs(e.Fragment,{children:[R?"收起互评详情":"Hide Details"," ",e.jsx(os,{size:12})]}):e.jsxs(e.Fragment,{children:[R?"展开互评详情":"Show Details"," ",e.jsx(is,{size:12})]})})]})]}),z[I.id]&&I.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:I.peerReviews.map(E=>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"}),E.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:[E.score," ",R?"分":"pts"]})]}),E.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:['"',E.comment,'"']})]},E.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:R?"教师平时分评分 (0-100)":"Teacher Score (0-100)"}),e.jsxs("div",{className:"flex gap-2",children:[e.jsx("input",{id:`teacher_score_input_${I.id}`,type:"number",min:"0",max:"100",disabled:$,value:V,onChange:E=>g(Q=>({...Q,[I.id]:Math.min(100,Math.max(0,Number(E.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:$,value:V,onChange:E=>g(Q=>({...Q,[I.id]:Number(E.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:R?"打分占比 (教师权重)":"Teacher Score Weight"}),e.jsx("span",{className:"text-xs font-bold text-slate-400",children:R?`学生互评: ${M}%`:`Peer: ${M}%`})]}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("input",{id:`teacher_weight_input_${I.id}`,type:"range",min:"0",max:"100",step:"5",disabled:$,value:y,onChange:E=>H(I.id,Number(E.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:[y,"%"]})]})]})]}),e.jsxs("div",{children:[e.jsx("label",{className:"block text-xs font-bold text-slate-655 mb-1 select-none",children:R?"教师评价评语":"Teacher Comments & Feedback"}),e.jsx("textarea",{id:`teacher_comment_input_${I.id}`,disabled:$,value:P,placeholder:R?"在此输入对学生作业作品的改进指导意见及评语。":"Enter guiding feedback for this student.",onChange:E=>j(Q=>({...Q,[I.id]:E.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 ${$?"bg-emerald-50 text-emerald-600 border-emerald-100":"bg-indigo-50 text-indigo-700 border-indigo-100"}`,children:e.jsx(Et,{size:14})}),e.jsxs("div",{className:"text-xs text-slate-500 font-medium",children:[e.jsxs("div",{children:[R?"平时总分计算公式":"Calculated Final Grade",":"]}),e.jsxs("div",{className:"font-bold text-slate-700 mt-0.5 animate-formula",children:[y,"% × ",e.jsx("span",{className:"text-indigo-650 font-bold",children:V}),I.peerReviews.length>0&&` + ${M}% × ${I.peerAverageScore}`," = ",e.jsx("span",{className:$?"text-emerald-700 font-black text-xs":"text-indigo-700 font-black text-xs",children:$&&I.grade?.calculated_final_score||S}),R?"分":" pts"]})]})]}),!$&&e.jsxs("div",{className:"flex gap-2 justify-end shrink-0",children:[e.jsxs("button",{id:`teacher_draft_btn_${I.id}`,type:"button",disabled:!!C[I.id],onClick:()=>ee(I.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(ls,{size:12}),C[I.id]==="draft"?R?"保存中...":"Saving...":R?"暂存草稿":"Save Draft"]}),e.jsxs("button",{id:`teacher_confirm_btn_${I.id}`,type:"button",disabled:!!C[I.id],onClick:()=>ee(I.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(De,{size:12}),C[I.id]==="confirmed"?R?"同步中...":"Syncing...":R?"确认并同步":"Confirm & Sync"]})]})]})]})]})]},I.id)})})]})}const Ta=({state:s,onToggleAnonymous:i,onOpenRubricModal:n,onToggleVoiceDanmaku:o,onAdvanceStage:a,onAddMinute:t,onTogglePauseTimer:r,isFullscreen:c,onToggleFullscreen:x,onClose:d})=>{const m=v=>{const N=Math.floor(Math.max(0,v)/60),g=Math.max(0,v)%60;return`${String(N).padStart(2,"0")}:${String(g).padStart(2,"0")}`},u=Math.round(s.completedReviews/Math.max(1,s.totalStudents)*100);return e.jsxs("div",{id:"peer-review-telemetry-header",className:"w-full bg-[#131b2e] border-b border-[#2d3449] px-6 py-3 flex flex-wrap items-center justify-between gap-4 select-none shrink-0",children:[e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("span",{className:"px-2 py-0.5 rounded bg-[#171f33] text-[#908fa0] text-[10px] font-mono font-semibold tracking-wider",children:"STAGE 02.4"}),e.jsxs("div",{className:"flex items-center gap-1.5 text-xs text-[#c7c4d7]",children:[e.jsx("span",{children:"随堂巩固"}),e.jsx(st,{size:13,className:"text-[#908fa0]"}),e.jsx("span",{children:"收卷归档"}),e.jsx(st,{size:13,className:"text-[#908fa0]"}),e.jsxs("span",{className:"text-[#4edea3] font-medium flex items-center gap-1",children:[e.jsx("span",{className:"w-1.5 h-1.5 rounded-full bg-[#4edea3] animate-ping"}),"全班大屏协同互评阶段 ",s.isLocked&&"(已锁定全班终端)"]})]})]}),e.jsx("div",{className:"h-4 w-[1px] bg-[#2d3449] hidden md:block"}),e.jsxs("div",{className:"hidden sm:flex items-center gap-1.5 px-2.5 py-1 rounded bg-[#00a572]/20 text-[#4edea3] text-xs font-medium border border-[#00a572]/30",children:[e.jsx(Ys,{size:14,className:"text-[#4edea3]"}),e.jsxs("span",{children:["教室主大屏协同输出 ",s.isDualScreen?"(4K 双屏模式)":"(投影模式)"]})]})]}),e.jsxs("div",{className:"flex items-center gap-4 sm:gap-6",children:[e.jsxs("div",{className:"flex items-center gap-2 bg-[#060e20] px-3 py-1.5 rounded-xl border border-[#2d3449]/60",children:[e.jsx(Zs,{size:18,className:"text-[#ffb95f] animate-pulse"}),e.jsxs("div",{className:"flex flex-col",children:[e.jsxs("div",{className:"flex items-center gap-1.5",children:[e.jsx("span",{className:"text-[10px] font-mono text-[#908fa0] leading-none",children:"COUNTDOWN"}),t&&e.jsx("button",{type:"button",onClick:t,className:"text-[10px] text-[#ffb95f] hover:text-[#ffddb8] font-mono transition-colors",title:"加时 1 分钟",children:"+1m"})]}),e.jsxs("div",{className:"flex items-center gap-1.5 mt-0.5",children:[e.jsxs("span",{className:"text-sm font-semibold font-mono text-[#dae2fd] leading-none",children:[m(s.timeRemainingSeconds),e.jsxs("span",{className:"text-[#908fa0] text-xs font-normal",children:[" / ",m(s.totalTimeSeconds)]})]}),r&&e.jsx("button",{type:"button",onClick:r,className:"text-[#c7c4d7] hover:text-white transition-colors",title:s.isPaused?"恢复倒计时":"暂停倒计时",children:s.isPaused?e.jsx(cs,{size:12,className:"text-[#4edea3]"}):e.jsx(Jr,{size:12})})]})]})]}),e.jsxs("div",{className:"flex items-center gap-2.5",children:[e.jsxs("div",{className:"relative w-8 h-8 flex items-center justify-center",children:[e.jsxs("svg",{className:"w-8 h-8 -rotate-90",viewBox:"0 0 36 36",children:[e.jsx("path",{className:"text-[#2d3449]",d:"M18 2.0845 a 15.9155 15.9155 0 0 1 0 31.831 a 15.9155 15.9155 0 0 1 0 -31.831",fill:"none",stroke:"currentColor",strokeWidth:"3.5"}),e.jsx("path",{className:"text-[#4edea3] transition-all duration-500",d:"M18 2.0845 a 15.9155 15.9155 0 0 1 0 31.831 a 15.9155 15.9155 0 0 1 0 -31.831",fill:"none",stroke:"currentColor",strokeDasharray:`${u}, 100`,strokeLinecap:"round",strokeWidth:"3.5"})]}),e.jsxs("span",{className:"absolute text-[9px] font-mono text-[#dae2fd] font-semibold",children:[u,"%"]})]}),e.jsxs("div",{className:"flex flex-col",children:[e.jsx("span",{className:"text-[10px] font-mono text-[#908fa0] leading-none",children:"SUBMISSIONS"}),e.jsxs("span",{className:"text-xs font-medium text-[#dae2fd] mt-0.5",children:[s.completedReviews," / ",s.totalStudents," 人已评"]})]})]}),e.jsxs("div",{className:"hidden lg:flex items-center gap-2 bg-[#171f33] px-3 py-1.5 rounded-xl border border-[#2d3449]/60",children:[e.jsx(Qr,{size:16,className:"text-[#c0c1ff]"}),e.jsxs("div",{className:"flex flex-col",children:[e.jsx("span",{className:"text-[10px] font-mono text-[#908fa0] leading-none",children:"PEER REACTIONS"}),e.jsxs("span",{className:"text-xs font-mono font-medium text-[#c0c1ff] mt-0.5",children:[s.totalLikes," 次点赞 · ",s.totalNominations," 份提名"]})]})]})]}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsxs("label",{htmlFor:"toggle-anon",className:"flex items-center gap-2 cursor-pointer bg-[#171f33] px-2.5 py-1.5 rounded-xl hover:bg-[#222a3d] transition-colors border border-[#2d3449]/50",title:"开启后隐藏学生真实姓名",children:[e.jsx("input",{id:"toggle-anon",type:"checkbox",checked:s.isAnonymous,onChange:i,className:"sr-only peer"}),e.jsx("div",{className:"w-7 h-4 bg-[#2d3449] peer-checked:bg-[#4edea3] rounded-full relative transition-colors",children:e.jsx("div",{className:`w-3 h-3 bg-white rounded-full absolute top-0.5 left-0.5 transition-transform ${s.isAnonymous?"translate-x-3":""}`})}),e.jsx("span",{className:"text-xs text-[#c7c4d7] font-medium",children:"双盲匿名"})]}),e.jsxs("button",{type:"button",onClick:n,className:"flex items-center gap-1.5 px-3 py-1.5 rounded-xl bg-[#171f33] hover:bg-[#222a3d] text-[#c7c4d7] hover:text-[#dae2fd] transition-colors text-xs font-medium border border-[#2d3449]/50",children:[e.jsx(Xs,{size:15,className:"text-[#ffb95f]"}),e.jsx("span",{children:"互评量规"})]}),e.jsxs("button",{type:"button",onClick:o,className:`flex items-center gap-1.5 px-3 py-1.5 rounded-xl transition-colors text-xs font-medium border ${s.showDanmaku?"bg-[#00a572]/20 border-[#00a572]/40 text-[#4edea3]":"bg-[#171f33] border-[#2d3449]/50 text-[#c7c4d7] hover:text-[#dae2fd]"}`,title:"开关大屏弹幕墙",children:[e.jsx(Yr,{size:15,className:"text-[#4edea3]"}),e.jsx("span",{children:"全员语音弹幕"})]}),e.jsxs("button",{type:"button",onClick:a,className:"flex items-center gap-2 px-3.5 py-1.5 rounded-xl bg-[#c0c1ff] text-[#1000a9] hover:bg-[#8083ff] hover:text-white transition-all shadow-sm text-xs font-semibold",children:[e.jsx(Re,{size:15}),e.jsx("span",{children:"揭晓勋章榜"}),e.jsx("span",{className:"font-mono text-[10px] bg-[#1000a9]/15 px-1 py-0.5 rounded leading-none",children:"Enter"})]}),e.jsx(oe,{slot:"peer_review.action"}),x&&e.jsx("button",{type:"button",onClick:x,className:"p-1.5 rounded-xl text-[#c7c4d7] hover:text-white hover:bg-[#222a3d] transition-colors ml-1",title:c?"退出全屏":"全屏展示",children:c?e.jsx(Zr,{size:16}):e.jsx(er,{size:16})}),d&&e.jsx("button",{type:"button",onClick:d,className:"p-1.5 rounded-xl text-[#ffb4ab] hover:text-white hover:bg-[#93000a]/50 transition-colors ml-1",title:"关闭大屏互评",children:e.jsx(be,{size:16})})]})]})},Pa=({matchingItems:s,badges:i,isAnonymous:n=!1,onSelectMatchingItem:o})=>{const a=(t,r)=>!r||t.length<=1?t:`${t[0]}**`;return e.jsxs("div",{id:"peer-review-matrix-panel",className:"flex flex-col gap-4 w-full select-none",children:[e.jsxs("div",{className:"bg-[#131b2e] p-4 rounded-xl border border-[#2d3449]/60 flex flex-col gap-2.5",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("div",{className:"w-7 h-7 rounded-lg bg-[#c0c1ff]/15 flex items-center justify-center text-[#c0c1ff]",children:e.jsx(ds,{size:16})}),e.jsx("h2",{className:"text-sm font-semibold text-[#dae2fd]",children:"智能交叉互评"})]}),e.jsx("span",{className:"px-2 py-0.5 rounded bg-[#8083ff]/20 text-[#c0c1ff] font-mono text-[10px] font-semibold",children:"1生评2份"})]}),e.jsx("p",{className:"text-xs text-[#c7c4d7] leading-relaxed",children:"分层对调机制:将满分逻辑范本与攻坚调试作业交叉分发,激发逆向审阅与自愈思考。"})]}),e.jsxs("div",{className:"bg-[#131b2e] p-4 rounded-xl border border-[#2d3449]/60 flex flex-col gap-3",children:[e.jsxs("div",{className:"flex items-center justify-between text-xs",children:[e.jsx("span",{className:"text-[#908fa0] font-mono text-[10px] font-semibold",children:"PEER MATCHING REALTIME"}),e.jsxs("span",{className:"text-[#4edea3] font-mono text-[11px] flex items-center gap-1",children:[e.jsx("span",{className:"w-1.5 h-1.5 rounded-full bg-[#4edea3] animate-pulse"})," 实时同步中"]})]}),e.jsx("div",{className:"flex flex-col gap-2.5 max-h-[380px] overflow-y-auto pr-0.5",children:s.map(t=>{const r=a(t.reviewerName,n),c=a(t.targetStudentName,n);return e.jsxs("div",{onClick:()=>o?.(t),className:`p-3 rounded-lg border transition-all cursor-pointer ${t.status==="submitted"?"bg-[#222a3d] border-[#4edea3]/40 shadow-sm":"bg-[#171f33] border-[#2d3449]/60 hover:bg-[#222a3d] hover:border-[#464554]"}`,children:[e.jsxs("div",{className:"flex items-center justify-between mb-1.5",children:[e.jsxs("div",{className:"flex items-center gap-1.5",children:[e.jsx("span",{className:"font-mono text-[11px] text-[#ffb95f] font-semibold",children:t.code}),e.jsxs("span",{className:"text-xs text-[#dae2fd] font-semibold truncate max-w-[130px]",children:[r," ",t.reviewerGroup?`(${t.reviewerGroup})`:""]})]}),t.status==="submitted"&&e.jsx("span",{className:"text-[10px] font-mono px-1.5 py-0.5 rounded bg-[#00a572]/20 text-[#4edea3]",children:"已提交评语"}),t.status==="in_progress"&&e.jsx("span",{className:"text-[10px] font-mono px-1.5 py-0.5 rounded bg-[#ca8100]/20 text-[#ffb95f] animate-pulse",children:"正在推导 (2/3)"}),t.status==="completed"&&e.jsxs("span",{className:"text-[10px] font-mono px-1.5 py-0.5 rounded bg-[#00a572]/20 text-[#4edea3] flex items-center gap-1",children:[e.jsx(je,{size:10})," 已完成"]}),t.status==="improvement"&&e.jsx("span",{className:"text-[10px] font-mono px-1.5 py-0.5 rounded bg-[#c0c1ff]/20 text-[#c0c1ff]",children:"提出改进建议 💡"})]}),e.jsxs("div",{className:"flex items-center gap-1.5 text-xs text-[#c7c4d7] mb-1.5",children:[e.jsx(ht,{size:12,className:"text-[#908fa0] shrink-0"}),e.jsxs("span",{className:"text-[#c0c1ff] font-medium truncate",children:[c," · ",t.targetWorkTitle]})]}),t.comment&&e.jsxs("div",{className:"bg-[#060e20] p-2 rounded text-xs text-[#c7c4d7] italic border border-[#2d3449]/40 mb-1.5 leading-relaxed",children:['"',t.comment,'"']}),t.progressPercent!==void 0&&t.status==="in_progress"&&e.jsx("div",{className:"w-full bg-[#2d3449] h-1 rounded-full mt-2 overflow-hidden",children:e.jsx("div",{className:"bg-[#ffb95f] h-full rounded-full transition-all duration-300",style:{width:`${t.progressPercent}%`}})}),t.stars!==void 0&&e.jsxs("div",{className:"flex items-center justify-between mt-1.5 pt-1.5 border-t border-[#2d3449]/50",children:[e.jsx("div",{className:"flex text-[#ffb95f]",children:Array.from({length:5}).map((x,d)=>e.jsx(rt,{size:13,className:d<t.stars?"text-[#ffb95f] fill-[#ffb95f]":"text-[#464554]"},d))}),e.jsxs("span",{className:"text-[10px] font-mono text-[#908fa0]",children:[t.score?.toFixed(1)||"5.0"," / ",t.maxScore||"5.0"]})]})]},t.id)})})]}),e.jsxs("div",{className:"bg-[#131b2e] p-4 rounded-xl border border-[#2d3449]/60 flex flex-col gap-2.5",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx("span",{className:"text-[10px] font-mono font-semibold text-[#908fa0]",children:"LIVE PEER BADGE STREAM"}),e.jsx(Ge,{size:14,className:"text-[#908fa0]"})]}),e.jsx("div",{className:"flex flex-col gap-2 overflow-hidden",children:i.map(t=>e.jsxs("div",{className:"flex items-center gap-2 p-2 rounded-lg bg-[#171f33] border border-[#2d3449]/50 text-xs text-[#dae2fd]",children:[e.jsx("span",{className:"text-sm shrink-0",children:t.emoji}),e.jsxs("div",{className:"truncate",children:[e.jsx("span",{className:"text-[#4edea3] font-medium",children:a(t.senderName,n)}),e.jsx("span",{className:"text-[#c7c4d7] mx-1",children:"为"}),e.jsx("span",{className:"text-[#c0c1ff] font-medium",children:a(t.receiverName,n)}),e.jsx("span",{className:"ml-1 px-1.5 py-0.5 bg-[#222a3d] rounded text-[10px] font-mono text-[#ffb95f]",children:t.badgeTitle})]})]},t.id))}),e.jsx(oe,{slot:"peer_review.badge"})]})]})},Ra=({workA:s,workB:i,annotations:n,isAnonymous:o=!1,onFullscreenCanvas:a,onSyncSandboxToClass:t,onAddAnnotation:r})=>{const[c,x]=l.useState("visual"),[d,m]=l.useState(!1),[u,v]=l.useState(""),N=(p,j)=>!j||p.length<=1?p:`${p[0]}**`,g=p=>{p.preventDefault(),u.trim()&&(r?.(u.trim()),v(""),m(!1))};return e.jsxs("div",{id:"spotlight-dual-work-arena",className:"flex flex-col gap-4 w-full select-none",children:[e.jsxs("div",{className:"bg-[#131b2e] p-4 rounded-xl border border-[#2d3449]/60 flex flex-wrap items-center justify-between gap-3 shadow-md",children:[e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("div",{className:"w-9 h-9 rounded-xl bg-[#8083ff]/20 flex items-center justify-center text-[#c0c1ff] border border-[#8083ff]/30",children:e.jsx(xs,{size:20})}),e.jsxs("div",{className:"flex flex-col",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("h1",{className:"text-base font-bold text-[#dae2fd]",children:"大屏焦点作品对比赏析"}),e.jsxs("span",{className:"px-2 py-0.5 rounded bg-[#ca8100]/20 text-[#ffb95f] font-mono text-[10px] font-semibold flex items-center gap-1 border border-[#ca8100]/30",children:[e.jsx("span",{className:"w-1.5 h-1.5 rounded-full bg-[#ffb95f] animate-ping"}),"教师激光笔协同标记中"]})]}),e.jsxs("span",{className:"text-xs text-[#c7c4d7] mt-0.5",children:["标杆创新解法 (",N(s.studentName,o),") ⟷ 经典逆风翻盘解法 (",N(i.studentName,o),")"]})]})]}),e.jsxs("div",{className:"flex items-center gap-2",children:[t&&e.jsxs("button",{type:"button",onClick:t,className:"flex items-center gap-1.5 px-3 py-1.5 rounded-lg bg-[#171f33] hover:bg-[#222a3d] text-[#c7c4d7] hover:text-white border border-[#2d3449]/60 transition-colors text-xs font-medium",title:"将对比沙箱推送到全班学生机",children:[e.jsx(ms,{size:14,className:"text-[#4edea3]"}),e.jsx("span",{children:"同步沙箱至全班"})]}),a&&e.jsx("button",{type:"button",onClick:a,className:"p-2 rounded-lg bg-[#171f33] hover:bg-[#222a3d] text-[#c7c4d7] hover:text-white border border-[#2d3449]/60 transition-colors",title:"全屏沉浸投影",children:e.jsx(er,{size:16})})]})]}),e.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[e.jsxs("div",{className:"bg-[#131b2e] rounded-xl p-4 flex flex-col gap-3 border border-[#2d3449]/60 shadow-md relative",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{className:"flex items-center gap-2.5",children:[e.jsx("div",{className:"w-8 h-8 rounded-full bg-[#8083ff] text-white flex items-center justify-center font-bold text-xs shadow-sm",children:o?"A":s.studentInitial}),e.jsxs("div",{className:"flex flex-col",children:[e.jsxs("span",{className:"text-sm font-semibold text-[#dae2fd]",children:[N(s.studentName,o)," (作品 A)"]}),e.jsx("span",{className:"text-[11px] font-mono text-[#908fa0]",children:s.workSubtitle})]})]}),e.jsxs("div",{className:"flex items-center gap-1 px-2 py-0.5 rounded bg-[#ca8100]/20 text-[#ffb95f] border border-[#ca8100]/30",children:[e.jsx(rt,{size:13,className:"text-[#ffb95f] fill-[#ffb95f]"}),e.jsx("span",{className:"font-mono text-xs font-semibold",children:typeof s.rating=="number"?s.rating.toFixed(1):"—"}),e.jsxs("span",{className:"text-[10px] text-[#908fa0]",children:["(",s.reviewCount??0,"评)"]})]})]}),e.jsx("div",{className:"flex flex-wrap gap-1.5",children:s.badges.map((p,j)=>e.jsx("span",{className:`px-2 py-0.5 rounded text-[10px] font-mono font-medium ${p.colorClass}`,children:p.label},j))}),e.jsxs("div",{className:"w-full h-44 rounded-lg bg-[#060e20] flex items-center justify-center relative overflow-hidden border border-[#2d3449]/60 group",children:[e.jsxs("svg",{className:"w-36 h-36 transform -rotate-12 transition-transform duration-700 group-hover:scale-110",viewBox:"0 0 100 100",children:[e.jsx("polygon",{points:"50,10 88,38 73,82 27,82 12,38",fill:"none",stroke:"#c0c1ff",strokeWidth:"1.2",opacity:"0.3"}),e.jsx("polygon",{points:"50,15 84,39 71,78 29,78 16,39",fill:"none",stroke:"#8083ff",strokeWidth:"1.4",opacity:"0.5",transform:"rotate(10 50 50)"}),e.jsx("polygon",{points:"50,20 80,41 68,74 32,74 20,41",fill:"none",stroke:"#4edea3",strokeWidth:"1.6",opacity:"0.7",transform:"rotate(22 50 50)"}),e.jsx("polygon",{points:"50,26 76,43 65,70 35,70 24,43",fill:"none",stroke:"#ffb95f",strokeWidth:"1.8",opacity:"0.85",transform:"rotate(35 50 50)"}),e.jsx("polygon",{points:"50,32 72,45 63,66 37,66 28,45",fill:"none",stroke:"#c0c1ff",strokeWidth:"2.2",opacity:"1.0",transform:"rotate(50 50 50)"}),e.jsx("circle",{cx:"50",cy:"50",r:"3",fill:"#4edea3"})]}),e.jsx("span",{className:"absolute bottom-2 right-2 text-[10px] font-mono text-[#908fa0] bg-[#131b2e]/90 px-1.5 py-0.5 rounded border border-[#2d3449]/50",children:s.visualBadgeText})]}),e.jsxs("div",{className:"bg-[#060e20] rounded-lg p-3 font-mono text-[11px] leading-5 border border-[#2d3449]/60 overflow-x-auto text-[#dae2fd]",children:[e.jsxs("div",{className:"text-[#908fa0] mb-1",children:["# ",s.codeTitle??""]}),(s.codeLines??[]).map((p,j)=>e.jsxs("div",{className:`${p.isHighlight?"bg-[#8083ff]/20 px-1 rounded -mx-1 text-[#dae2fd]":""}`,style:{paddingLeft:`${(p.indent||0)*12}px`},children:[e.jsx("span",{children:p.text}),p.comment&&e.jsx("span",{className:"text-[#908fa0] ml-2",children:p.comment})]},j))]})]}),e.jsxs("div",{className:"bg-[#131b2e] rounded-xl p-4 flex flex-col gap-3 border border-[#2d3449]/60 shadow-md relative",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{className:"flex items-center gap-2.5",children:[e.jsx("div",{className:"w-8 h-8 rounded-full bg-[#00a572] text-white flex items-center justify-center font-bold text-xs shadow-sm",children:o?"B":i.studentInitial}),e.jsxs("div",{className:"flex flex-col",children:[e.jsxs("span",{className:"text-sm font-semibold text-[#dae2fd]",children:[N(i.studentName,o)," (作品 B)"]}),e.jsx("span",{className:"text-[11px] font-mono text-[#908fa0]",children:i.workSubtitle})]})]}),e.jsxs("div",{className:"flex items-center gap-1 px-2 py-0.5 rounded bg-[#ca8100]/20 text-[#ffb95f] border border-[#ca8100]/30",children:[e.jsx(rt,{size:13,className:"text-[#ffb95f] fill-[#ffb95f]"}),e.jsx("span",{className:"font-mono text-xs font-semibold",children:typeof i.rating=="number"?i.rating.toFixed(1):"—"}),e.jsxs("span",{className:"text-[10px] text-[#908fa0]",children:["(",i.reviewCount??0,"评)"]})]})]}),e.jsx("div",{className:"flex flex-wrap gap-1.5",children:i.badges.map((p,j)=>e.jsx("span",{className:`px-2 py-0.5 rounded text-[10px] font-mono font-medium ${p.colorClass}`,children:p.label},j))}),e.jsxs("div",{className:"w-full h-44 rounded-lg bg-[#060e20] flex items-center justify-center relative overflow-hidden border border-[#2d3449]/60 group",children:[e.jsxs("svg",{className:"w-36 h-36 transition-transform duration-700 group-hover:scale-110",viewBox:"0 0 100 100",children:[e.jsx("circle",{cx:"50",cy:"50",r:"42",fill:"none",stroke:"#2d3449",strokeWidth:"1"}),e.jsx("rect",{x:"25",y:"25",width:"50",height:"50",fill:"none",stroke:"#4edea3",strokeWidth:"1.8",transform:"rotate(0 50 50)"}),e.jsx("rect",{x:"25",y:"25",width:"50",height:"50",fill:"none",stroke:"#6ffbbe",strokeWidth:"1.8",opacity:"0.8",transform:"rotate(18 50 50)"}),e.jsx("rect",{x:"25",y:"25",width:"50",height:"50",fill:"none",stroke:"#ffb95f",strokeWidth:"1.8",opacity:"0.7",transform:"rotate(36 50 50)"}),e.jsx("rect",{x:"25",y:"25",width:"50",height:"50",fill:"none",stroke:"#c0c1ff",strokeWidth:"1.8",opacity:"0.6",transform:"rotate(54 50 50)"}),e.jsx("circle",{cx:"50",cy:"50",r:"3",fill:"#ffb95f"})]}),e.jsxs("span",{className:"absolute bottom-2 right-2 text-[10px] font-mono text-[#4edea3] bg-[#131b2e]/90 px-1.5 py-0.5 rounded border border-[#2d3449]/50 flex items-center gap-1",children:[e.jsx("span",{className:"w-1.5 h-1.5 rounded-full bg-[#4edea3]"}),i.visualBadgeText]})]}),e.jsxs("div",{className:"bg-[#060e20] rounded-lg p-3 font-mono text-[11px] leading-5 border border-[#2d3449]/60 overflow-x-auto text-[#dae2fd]",children:[e.jsxs("div",{className:"text-[#908fa0] mb-1",children:["# ",i.codeTitle??""]}),(i.codeLines??[]).map((p,j)=>e.jsxs("div",{className:`${p.isSuccess?"bg-[#00a572]/20 px-1 rounded -mx-1 text-[#4edea3] font-medium":""}`,style:{paddingLeft:`${(p.indent||0)*12}px`},children:[e.jsx("span",{children:p.text}),p.comment&&e.jsx("span",{className:"text-[#4edea3] text-[10px] ml-2",children:p.comment})]},j))]})]})]}),e.jsxs("div",{className:"bg-[#131b2e] rounded-xl p-4 flex flex-col gap-3 border border-[#2d3449]/60 shadow-md",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(tr,{size:16,className:"text-[#ffb95f]"}),e.jsx("span",{className:"text-xs font-semibold text-[#dae2fd]",children:"协同板书标注与点评审阅"})]}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsxs("span",{className:"text-[10px] font-mono text-[#908fa0]",children:[n.length," 条实时批注挂载"]}),r&&e.jsx("button",{type:"button",onClick:()=>m(!d),className:"text-[11px] text-[#c0c1ff] hover:text-white font-medium transition-colors",children:d?"取消批注":"+ 追加教师批注"})]})]}),d&&e.jsxs("form",{onSubmit:g,className:"flex gap-2",children:[e.jsx("input",{type:"text",value:u,onChange:p=>v(p.target.value),placeholder:"输入大屏协同批注要点...",className:"flex-1 px-3 py-1.5 rounded-lg bg-[#060e20] border border-[#2d3449] text-xs text-[#dae2fd] placeholder-[#908fa0] focus:outline-none focus:border-[#8083ff]"}),e.jsx("button",{type:"submit",className:"px-3 py-1.5 rounded-lg bg-[#c0c1ff] text-[#1000a9] font-semibold text-xs hover:bg-[#8083ff] hover:text-white transition-colors",children:"发送批注"})]}),e.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-3",children:n.map(p=>e.jsxs("div",{className:"bg-[#171f33] p-3 rounded-lg flex flex-col gap-1.5 relative overflow-hidden border border-[#2d3449]/50",children:[e.jsx("div",{className:"w-1 absolute left-0 top-0 bottom-0",style:{backgroundColor:p.borderColor}}),e.jsxs("div",{className:"flex items-center justify-between pl-2",children:[e.jsxs("div",{className:"flex items-center gap-1.5",children:[e.jsx("span",{className:`px-1.5 py-0.5 rounded text-[10px] font-mono font-bold ${p.authorType==="teacher"?"bg-[#8083ff] text-white":"bg-[#00a572] text-white"}`,children:p.authorRole}),e.jsx("span",{className:"text-xs font-semibold text-[#dae2fd]",children:N(p.authorName,o)})]}),e.jsx("span",{className:"text-[10px] font-mono text-[#908fa0]",children:p.timeAgo})]}),e.jsx("p",{className:"text-xs text-[#dae2fd] pl-2 leading-relaxed",children:p.content})]},p.id))})]}),e.jsx(oe,{slot:"peer_review.showcase.widget"})]})},_a=({dimensions:s,averagePercentage:i,reactions:n,onReactionClick:o,syncedStudentsCount:a=32})=>e.jsxs("div",{id:"peer-review-rubric-stats",className:"bg-[#131b2e] rounded-xl p-4 flex flex-col gap-4 border border-[#2d3449]/60 shadow-md select-none w-full",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx("span",{className:"text-xs font-semibold text-[#dae2fd]",children:"全班三维量规综合达标率"}),e.jsxs("span",{className:"text-[11px] font-mono text-[#4edea3] font-semibold",children:["AVERAGE: ",i.toFixed(1),"%"]})]}),e.jsx("div",{className:"grid grid-cols-1 sm:grid-cols-3 gap-3",children:s.map(t=>e.jsxs("div",{className:"bg-[#171f33] p-2.5 rounded-lg flex flex-col gap-1.5 border border-[#2d3449]/50",children:[e.jsxs("div",{className:"flex justify-between text-xs",children:[e.jsx("span",{className:"text-[#908fa0] truncate",children:t.label}),e.jsxs("span",{className:`font-mono font-medium ${t.colorClass}`,children:[t.percentage,"%"]})]}),e.jsx("div",{className:"w-full bg-[#2d3449] h-1.5 rounded-full overflow-hidden",children:e.jsx("div",{className:`h-full rounded-full transition-all duration-500 ${t.barColorClass}`,style:{width:`${t.percentage}%`}})})]},t.id))}),e.jsx(oe,{slot:"peer_review.rubric.dimension"}),e.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-3 pt-1 border-t border-[#2d3449]/40",children:[e.jsx("div",{className:"flex items-center gap-2",children:n.map(t=>e.jsxs("button",{type:"button",onClick:()=>o?.(t.id),className:"flex items-center gap-1.5 px-3 py-1 rounded-full bg-[#171f33] hover:bg-[#222a3d] border border-[#2d3449]/60 transition-all text-xs text-[#dae2fd] active:scale-95 group",children:[e.jsx("span",{children:t.emoji}),e.jsx("span",{className:"font-medium group-hover:text-white",children:t.label}),e.jsxs("span",{className:`font-mono font-semibold ${t.colorClass}`,children:["+",t.count]})]},t.id))}),e.jsxs("span",{className:"text-[10px] font-mono text-[#908fa0] flex items-center gap-1",children:[e.jsx(Mt,{size:13,className:"text-[#4edea3]"}),a,"台学生端已同步点赞动画"]})]})]}),Ma=({podiumStudents:s,isAnonymous:i=!1,onAwardPeerReviewPoints:n,onArchiveTopWorks:o,onCallStudentMic:a,onInviteScreenShare:t,onAdvanceToStage3:r})=>{const c=(x,d)=>!d||x.length<=1?x:`${x[0]}**`;return e.jsxs("div",{id:"peer-review-leaderboard-panel",className:"flex flex-col gap-4 w-full select-none",children:[e.jsxs("div",{className:"bg-[#131b2e] p-4 rounded-xl border border-[#2d3449]/60 flex flex-col gap-3 shadow-md",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(Oe,{size:18,className:"text-[#ffb95f]"}),e.jsx("h2",{className:"text-sm font-semibold text-[#dae2fd]",children:"互评推荐先锋榜"})]}),e.jsx("span",{className:"text-[10px] font-mono text-[#908fa0] font-semibold",children:"TOP NOMINATED"})]}),e.jsx("div",{className:"flex flex-col gap-2.5",children:s.map(x=>e.jsxs("div",{className:`p-3 rounded-lg border transition-all ${x.rank===1?"bg-[#222a3d] border-[#ffb95f]/40 shadow-sm":"bg-[#171f33] border-[#2d3449]/50 hover:bg-[#222a3d]"} flex flex-col gap-1.5`,children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("span",{className:`w-5 h-5 rounded-full font-mono text-[11px] font-bold flex items-center justify-center ${x.rankBadgeClass}`,children:x.rank}),e.jsx("span",{className:"text-xs font-semibold text-[#dae2fd]",children:c(x.name,i)})]}),e.jsxs("span",{className:"font-mono text-xs font-semibold text-[#ffb95f]",children:[x.votes," 票推荐"]})]}),e.jsxs("div",{className:"flex items-center justify-between text-xs",children:[e.jsx("span",{className:"text-[#c7c4d7] truncate max-w-[140px]",children:x.workTitle}),e.jsx("span",{className:`px-1.5 py-0.5 rounded text-[10px] font-mono font-medium ${x.tagBadgeClass}`,children:x.honorTitle})]})]},x.rank))})]}),e.jsxs("div",{className:"bg-[#131b2e] p-4 rounded-xl border border-[#2d3449]/60 flex flex-col gap-3 shadow-md",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx("span",{className:"text-xs font-semibold text-[#dae2fd]",children:"随堂微勋章即时分发箱"}),e.jsx(Re,{size:15,className:"text-[#4edea3]"})]}),e.jsxs("div",{className:"flex flex-col gap-2",children:[e.jsxs("button",{type:"button",onClick:n,className:"w-full flex items-center justify-between px-3 py-2 rounded-lg bg-[#171f33] hover:bg-[#222a3d] border border-[#2d3449]/50 text-[#dae2fd] transition-colors text-xs text-left",children:[e.jsxs("span",{className:"flex items-center gap-2",children:[e.jsx(fe,{size:14,className:"text-[#ffb95f]"}),e.jsx("span",{children:"为全员互评认真学生 +2 积分"})]}),e.jsx("span",{className:"font-mono text-[10px] text-[#4edea3] font-semibold bg-[#00a572]/20 px-1.5 py-0.5 rounded",children:"一键发放"})]}),e.jsxs("button",{type:"button",onClick:o,className:"w-full flex items-center justify-between px-3 py-2 rounded-lg bg-[#171f33] hover:bg-[#222a3d] border border-[#2d3449]/50 text-[#dae2fd] transition-colors text-xs text-left",children:[e.jsxs("span",{className:"flex items-center gap-2",children:[e.jsx(ot,{size:14,className:"text-[#c0c1ff]"}),e.jsx("span",{children:"TOP 2 优秀代码入库数字馆"})]}),e.jsx("span",{className:"font-mono text-[10px] text-[#c0c1ff] font-semibold bg-[#8083ff]/20 px-1.5 py-0.5 rounded",children:"入库归档"})]})]})]}),e.jsxs("div",{className:"bg-[#131b2e] p-4 rounded-xl border border-[#2d3449]/60 flex flex-col gap-3 shadow-md",children:[e.jsx("span",{className:"text-[10px] font-mono text-[#908fa0] font-semibold",children:"TEACHER BROADCAST & STAGE TRANSITION"}),e.jsx("div",{className:"flex flex-col gap-2",children:(()=>{const x=s[0]?.name,d=s[1]?.name??x;return e.jsxs(e.Fragment,{children:[e.jsxs("button",{type:"button",disabled:!x,onClick:()=>x&&a(x),className:"w-full flex items-center justify-between px-3 py-2 rounded-lg bg-[#171f33] hover:bg-[#222a3d] border border-[#2d3449]/50 text-[#dae2fd] transition-colors text-xs text-left disabled:opacity-40 disabled:cursor-not-allowed",children:[e.jsxs("span",{className:"flex items-center gap-2",children:[e.jsx(rs,{size:14,className:"text-[#c0c1ff]"}),e.jsx("span",{children:x?`连麦作者 ${c(x,i)} (分享思路)`:"暂无提名,无法连麦"})]}),e.jsx("span",{className:"text-[#908fa0] text-[10px] font-mono",children:"连线"})]}),e.jsxs("button",{type:"button",disabled:!d,onClick:()=>d&&t(d),className:"w-full flex items-center justify-between px-3 py-2 rounded-lg bg-[#171f33] hover:bg-[#222a3d] border border-[#2d3449]/50 text-[#dae2fd] transition-colors text-xs text-left disabled:opacity-40 disabled:cursor-not-allowed",children:[e.jsxs("span",{className:"flex items-center gap-2",children:[e.jsx(Ys,{size:14,className:"text-[#4edea3]"}),e.jsx("span",{children:d?`邀请 ${c(d,i)} 投屏分享`:"暂无提名,无法投屏"})]}),e.jsx("span",{className:"text-[#908fa0] text-[10px] font-mono",children:"邀请"})]})]})})()}),e.jsx(oe,{slot:"peer_review.action"}),e.jsxs("div",{className:"pt-2",children:[e.jsxs("button",{type:"button",onClick:r,className:"w-full flex items-center justify-center gap-2 py-3 px-4 rounded-xl bg-[#c0c1ff] text-[#1000a9] hover:bg-[#8083ff] hover:text-white transition-all shadow-md group font-semibold text-xs text-center",children:[e.jsx("span",{children:"结束互评,公布全堂总积分榜与学情报告"}),e.jsx(ht,{size:14,className:"group-hover:translate-x-1 transition-transform"})]}),e.jsx("div",{className:"text-center mt-2",children:e.jsx("span",{className:"text-[10px] font-mono text-[#908fa0]",children:"HOTKEY: PRESS ENTER TO ADVANCE TO STAGE 03"})})]})]})]})},Ia=({isVisible:s,danmakuList:i,onSendDanmaku:n,isAnonymous:o=!1})=>{const[a,t]=l.useState(""),[r,c]=l.useState(!1);if(!s)return null;const x=m=>{m.preventDefault(),a.trim()&&(n?.(a.trim(),"text"),t(""))},d=()=>{n?.("语音弹幕 · 点赞神仙算法!","voice")};return e.jsxs("div",{id:"peer-review-danmaku-overlay",className:"absolute inset-0 pointer-events-none overflow-hidden z-20",children:[i.map(m=>e.jsx("div",{className:"absolute whitespace-nowrap animate-danmaku-slide pointer-events-auto",style:{top:`${m.topPercent}%`,right:"-100%"},children:e.jsxs("div",{className:"flex items-center gap-1.5 px-3 py-1 rounded-full bg-[#131b2e]/85 backdrop-blur-md border border-[#2d3449] shadow-lg text-xs text-[#dae2fd]",children:[m.type==="voice"?e.jsxs("span",{className:"flex items-center gap-1 text-[#4edea3] font-mono text-[11px]",children:[e.jsx(rs,{size:12,className:"animate-pulse"}),e.jsxs("span",{children:[m.voiceDuration||3,"s"]})]}):e.jsx("span",{className:"text-sm",children:"💬"}),e.jsxs("span",{className:"text-[#c0c1ff] font-medium",children:[o&&m.sender.length>1?`${m.sender[0]}**`:m.sender,":"]}),e.jsx("span",{className:m.color||"text-white",children:m.text})]})},m.id)),e.jsx("div",{className:"absolute bottom-4 right-4 pointer-events-auto flex items-center gap-2",children:r?e.jsxs("form",{onSubmit:x,className:"flex items-center gap-1.5 bg-[#131b2e]/95 backdrop-blur-md border border-[#2d3449] p-1.5 rounded-full shadow-xl",children:[e.jsx("input",{type:"text",value:a,onChange:m=>t(m.target.value),placeholder:"发送大屏实时弹幕...",className:"bg-transparent px-3 py-1 text-xs text-white placeholder-[#908fa0] focus:outline-none w-48"}),e.jsx("button",{type:"submit",className:"p-1.5 rounded-full bg-[#c0c1ff] text-[#1000a9] hover:bg-white transition-colors",title:"发送",children:e.jsx(De,{size:13})}),e.jsx("button",{type:"button",onClick:d,className:"p-1.5 rounded-full bg-[#171f33] hover:bg-[#222a3d] text-[#4edea3] transition-colors",title:"发送语音弹幕",children:e.jsx(rs,{size:13})}),e.jsx("button",{type:"button",onClick:()=>c(!1),className:"px-2 text-xs text-[#908fa0] hover:text-white",children:"收起"})]}):e.jsxs("button",{type:"button",onClick:()=>c(!0),className:"flex items-center gap-1.5 px-3 py-1.5 rounded-full bg-[#131b2e]/90 hover:bg-[#222a3d] backdrop-blur-md border border-[#2d3449] text-xs text-[#c7c4d7] hover:text-white shadow-lg transition-colors cursor-pointer",children:[e.jsx(hs,{size:13,className:"text-[#c0c1ff]"}),e.jsx("span",{children:"发弹幕"})]})})]})},Da=({isOpen:s,onClose:i})=>s?e.jsx("div",{id:"peer-review-rubric-modal",className:"fixed inset-0 z-50 flex items-center justify-center bg-black/70 backdrop-blur-sm p-4 select-none",children:e.jsxs("div",{className:"bg-[#131b2e] border border-[#2d3449] rounded-2xl w-full max-w-2xl shadow-2xl overflow-hidden flex flex-col max-h-[85vh]",children:[e.jsxs("div",{className:"px-6 py-4 bg-[#171f33] border-b border-[#2d3449] flex items-center justify-between",children:[e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("div",{className:"w-8 h-8 rounded-xl bg-[#ca8100]/20 text-[#ffb95f] flex items-center justify-center border border-[#ca8100]/30",children:e.jsx(Xs,{size:18})}),e.jsxs("div",{children:[e.jsx("h2",{className:"text-sm font-bold text-[#dae2fd]",children:"随堂交叉互评量规细则"}),e.jsx("p",{className:"text-[11px] text-[#908fa0]",children:"三维评价基准 · 激励互助逆向思考"})]})]}),e.jsx("button",{type:"button",onClick:i,className:"p-1.5 rounded-lg text-[#908fa0] hover:text-white hover:bg-[#222a3d] transition-colors",children:e.jsx(be,{size:18})})]}),e.jsxs("div",{className:"p-6 flex flex-col gap-4 overflow-y-auto",children:[e.jsxs("div",{className:"bg-[#171f33] rounded-xl p-4 border border-[#2d3449]/60 flex flex-col gap-2",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("span",{className:"w-6 h-6 rounded-lg bg-[#8083ff]/20 text-[#c0c1ff] font-mono text-xs font-bold flex items-center justify-center",children:"1"}),e.jsx("span",{className:"text-sm font-semibold text-[#dae2fd]",children:"算法逻辑正确性 (40% 权重)"})]}),e.jsx("span",{className:"text-[10px] font-mono text-[#4edea3] bg-[#00a572]/20 px-2 py-0.5 rounded",children:"全班达标率 98%"})]}),e.jsxs("ul",{className:"text-xs text-[#c7c4d7] space-y-1.5 pl-8 list-disc",children:[e.jsxs("li",{children:[e.jsx("strong",{className:"text-white",children:"5.0分(优秀):"}),"算法逻辑自适应,无死循环或边界越界,自适应笔触与角度动态计算完全闭合。"]}),e.jsxs("li",{children:[e.jsx("strong",{className:"text-white",children:"4.0分(良好):"}),"核心功能正常,少数极端情况存在未自增或微小卡顿。"]}),e.jsxs("li",{children:[e.jsx("strong",{className:"text-white",children:"3.0分(需改进):"}),"存在语法报错或死循环,需在互评中指明行号与修复要点。"]})]})]}),e.jsxs("div",{className:"bg-[#171f33] rounded-xl p-4 border border-[#2d3449]/60 flex flex-col gap-2",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("span",{className:"w-6 h-6 rounded-lg bg-[#00a572]/20 text-[#4edea3] font-mono text-xs font-bold flex items-center justify-center",children:"2"}),e.jsx("span",{className:"text-sm font-semibold text-[#dae2fd]",children:"代码规范与缩进 (30% 权重)"})]}),e.jsx("span",{className:"text-[10px] font-mono text-[#4edea3] bg-[#00a572]/20 px-2 py-0.5 rounded",children:"全班达标率 96%"})]}),e.jsxs("ul",{className:"text-xs text-[#c7c4d7] space-y-1.5 pl-8 list-disc",children:[e.jsxs("li",{children:[e.jsx("strong",{className:"text-white",children:"5.0分(优秀):"}),"遵循 PEP8 规范,严格对齐 4 空格缩进,变量语义化规范清晰,关键算子附有说明注释。"]}),e.jsxs("li",{children:[e.jsx("strong",{className:"text-white",children:"4.0分(良好):"}),"缩进基本统一,可读性良好。"]}),e.jsxs("li",{children:[e.jsx("strong",{className:"text-white",children:"3.0分(需改进):"}),"Tab 与空格混用,循环体代码未有效缩进。"]})]})]}),e.jsxs("div",{className:"bg-[#171f33] rounded-xl p-4 border border-[#2d3449]/60 flex flex-col gap-2",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("span",{className:"w-6 h-6 rounded-lg bg-[#ca8100]/20 text-[#ffb95f] font-mono text-xs font-bold flex items-center justify-center",children:"3"}),e.jsx("span",{className:"text-sm font-semibold text-[#dae2fd]",children:"创意美感与拓展 (30% 权重)"})]}),e.jsx("span",{className:"text-[10px] font-mono text-[#ffb95f] bg-[#ca8100]/20 px-2 py-0.5 rounded",children:"全班达标率 92%"})]}),e.jsxs("ul",{className:"text-xs text-[#c7c4d7] space-y-1.5 pl-8 list-disc",children:[e.jsxs("li",{children:[e.jsx("strong",{className:"text-white",children:"5.0分(优秀):"}),"巧妙运用数学模运算(`i % 3`)或外角定理,呈现层次丰富的动态发散图形。"]}),e.jsxs("li",{children:[e.jsx("strong",{className:"text-white",children:"4.0分(良好):"}),"图形规则美观,配色和谐。"]}),e.jsxs("li",{children:[e.jsx("strong",{className:"text-white",children:"3.0分(需改进):"}),"单色基础图形,未探索步长或角度变化。"]})]})]}),e.jsx(oe,{slot:"peer_review.rubric.dimension"})]}),e.jsx("div",{className:"px-6 py-3 bg-[#171f33] border-t border-[#2d3449] flex justify-end",children:e.jsx("button",{type:"button",onClick:i,className:"px-4 py-1.5 rounded-xl bg-[#c0c1ff] text-[#1000a9] font-semibold text-xs hover:bg-white transition-colors",children:"我已知晓"})})]})}):null,gr=({isOpen:s,onClose:i,onAdvanceToStage3:n,lessonTitle:o="",addToast:a,workA:t,workB:r,reviewProgress:c,countdownSeconds:x,onAutoAssign:d,autoAssigning:m=!1,matchingItems:u,badges:v,annotations:N,rubricDimensions:g,reactions:p,podiumStudents:j,danmaku:k})=>{const[w,f]=l.useState({stage:"STAGE 02.4",isLocked:!0,isDualScreen:!0,isAnonymous:!0,timeRemainingSeconds:x??0,totalTimeSeconds:x??0,isPaused:!1,completedReviews:c?.completed??0,totalStudents:c?.total??0,totalLikes:0,totalNominations:0,showVoiceDanmaku:!0,showDanmaku:!0}),[b,z]=l.useState(!1),[_,C]=l.useState(!1),[B,R]=l.useState(u??[]),[J,O]=l.useState(v??[]),[H,ee]=l.useState(t??null),[se,I]=l.useState(r??null),[V,P]=l.useState(N??[]),[y]=l.useState(g??[]),[M,$]=l.useState(p??[]),[S]=l.useState(j??[]),[E,Q]=l.useState(k??[]);l.useEffect(()=>{if(!s||w.isPaused)return;const U=setInterval(()=>{f(Z=>Z.timeRemainingSeconds<=1?{...Z,timeRemainingSeconds:0,isPaused:!0}:{...Z,timeRemainingSeconds:Z.timeRemainingSeconds-1})},1e3);return()=>clearInterval(U)},[s,w.isPaused]);const ie=l.useCallback(U=>{s&&(U.key==="Enter"?(U.preventDefault(),te()):U.key==="Escape"?(U.preventDefault(),i()):U.code==="Space"&&U.target===document.body&&(U.preventDefault(),G()))},[s,i]);if(l.useEffect(()=>(window.addEventListener("keydown",ie),()=>window.removeEventListener("keydown",ie)),[ie]),!s)return null;const pe=()=>{f(U=>({...U,isAnonymous:!U.isAnonymous})),a?.("互评模式已切换",w.isAnonymous?"已恢复显示真实学生姓名":"已开启双盲匿名评价模式","info")},ce=()=>{f(U=>({...U,timeRemainingSeconds:U.timeRemainingSeconds+60,totalTimeSeconds:U.totalTimeSeconds+60})),a?.("互评加时","倒计时已增加 1 分钟","success")},G=()=>{f(U=>({...U,isPaused:!U.isPaused}))},K=()=>{document.fullscreenElement?document.exitFullscreen&&(document.exitFullscreen().catch(()=>{}),z(!1)):(document.documentElement.requestFullscreen().catch(()=>{}),z(!0))},le=U=>{$(Z=>Z.map(T=>T.id===U?{...T,count:T.count+1}:T)),f(Z=>({...Z,totalLikes:Z.totalLikes+1}))},de=U=>{const Z={id:`ann-${Date.now()}`,authorType:"teacher",authorRole:"主讲教师",authorName:"陈老师",timeAgo:"刚刚",content:U,borderColor:"#8083ff"};P(T=>[Z,...T]),a?.("批注已挂载","协同板书批注已同步至大屏","success")},ue=(U,Z="text")=>{const T={id:`d-${Date.now()}`,sender:"主讲教师",text:U,type:Z,voiceDuration:Z==="voice"?4:void 0,topPercent:Math.floor(Math.random()*60)+15,color:"text-[#4edea3]"};Q(re=>[...re,T])},ve=()=>{a?.("微勋章已分发","已向全员认真参与互评的学生批量发放 +2 过程性积分!","success")},A=()=>{const U=[H?.studentName,se?.studentName].filter(Boolean);a?.("作品已入库",U.length>0?`${U.join(" 与 ")}的优秀作品已收录进班级数字展览馆。`:"暂无焦点作品可入库(学生尚未提交)。","success")},L=U=>{a?.("连麦请求已发起",`正在向 ${U} 的学生端发起实时语音连麦...`,"info")},Y=U=>{a?.("投屏邀请已下发",`已向 ${U} 发送大屏投屏演示邀请。`,"info")},te=()=>{a?.("互评阶段已结束","正在推进至 Stage 03 结课巡查与全堂总积分榜...","success"),n&&n(),i()};return e.jsxs("div",{id:"peer-review-showcase-modal",className:"fixed inset-0 z-[9999] bg-[#0b1326] text-[#dae2fd] flex flex-col select-none overflow-hidden font-sans",children:[e.jsx(Ta,{state:w,onToggleAnonymous:pe,onOpenRubricModal:()=>C(!0),onToggleVoiceDanmaku:()=>f(U=>({...U,showDanmaku:!U.showDanmaku})),onAdvanceStage:te,onAddMinute:ce,onTogglePauseTimer:G,isFullscreen:b,onToggleFullscreen:K,onClose:i}),e.jsxs("main",{className:"relative flex-1 overflow-y-auto w-full px-6 py-5",children:[!H&&!se&&B.length===0&&S.length===0&&e.jsxs("div",{className:"mb-4 rounded-xl border border-[#2d3449] bg-[#0b1326] px-4 py-2.5 flex items-center gap-3 text-[11px] text-[#908fa0]",children:[e.jsx("span",{className:"w-1.5 h-1.5 rounded-full bg-amber-400 shrink-0"}),e.jsx("span",{className:"flex-1",children:"本节暂无可展示的互评数据(需至少 2 份学生提交作品)。点击右侧按钮按「1 生评 2 份」自动分配。"}),d&&e.jsx("button",{type:"button",disabled:m,onClick:()=>void d(),className:"px-3 py-1 rounded-lg bg-[#8083ff] text-white text-[11px] font-bold hover:bg-[#9497ff] transition-colors disabled:opacity-50 shrink-0",children:m?"分配中…":"一键分配互评"})]}),e.jsx(Ia,{isVisible:w.showDanmaku,danmakuList:E,onSendDanmaku:ue,isAnonymous:w.isAnonymous}),e.jsxs("div",{className:"grid grid-cols-12 gap-5 items-start",children:[e.jsx("div",{className:"col-span-12 lg:col-span-3",children:e.jsx(Pa,{matchingItems:B,badges:J,isAnonymous:w.isAnonymous,onSelectMatchingItem:U=>{a?.(`查看互评明细 ${U.code}`,`${U.reviewerName} 正在审阅 ${U.targetStudentName} 的作业`,"info")}})}),e.jsxs("div",{className:"col-span-12 lg:col-span-6 flex flex-col gap-4",children:[!H&&!se&&e.jsxs("div",{className:"rounded-xl border border-dashed border-[#2d3449] bg-[#0b1326] p-6 text-center",children:[e.jsx("p",{className:"text-xs font-bold text-[#dae2fd]",children:"暂无提交作品可供对比"}),e.jsx("p",{className:"text-[10px] text-[#908fa0] mt-1",children:"学生提交课件作业后,此处将自动展示两份真实作品的并排对比。"})]}),H||se?e.jsx(Ra,{workA:H,workB:se,annotations:V,isAnonymous:w.isAnonymous,onFullscreenCanvas:K,onSyncSandboxToClass:()=>{a?.("沙箱广播已生效",`对比范本已同步至全班 ${w.totalStudents||0} 台学生机控制台`,"success")},onAddAnnotation:de}):null,e.jsx(_a,{dimensions:y,averagePercentage:95.3,reactions:M,onReactionClick:le,syncedStudentsCount:32})]}),e.jsx("div",{className:"col-span-12 lg:col-span-3",children:e.jsx(Ma,{podiumStudents:S,isAnonymous:w.isAnonymous,onAwardPeerReviewPoints:ve,onArchiveTopWorks:A,onCallStudentMic:L,onInviteScreenShare:Y,onAdvanceToStage3:te})})]})]}),e.jsx(Da,{isOpen:_,onClose:()=>C(!1)})]})};function Oa({isOpen:s,onClose:i,lessonId:n,lessonTitle:o="互动课堂",lang:a="zh"}){const[t,r]=l.useState({stage:"IN_CLASS_TEACHING",checkinCode:null,activePoll:null,activeBuzzer:null,pacing:{TOO_FAST:0,CONFUSED:0,CLEAR:0}}),[c,x]=l.useState(!1),[d,m]=l.useState(""),[u,v]=l.useState(!1);if(l.useEffect(()=>{const j=()=>{m(new Date().toLocaleTimeString([],{hour:"2-digit",minute:"2-digit",second:"2-digit"}))};j();const k=setInterval(j,1e3);return()=>clearInterval(k)},[]),l.useEffect(()=>{if(!s||!n)return;let j=!0;const k=async()=>{try{const f=await fetch(`/api/classroom/stage/${n}/data`);if(f.ok&&j){const b=await f.json();r(b)}}catch(f){console.warn("[StageDisplay] Fetch error:",f)}};k();const w=setInterval(k,2e3);return()=>{j=!1,clearInterval(w)}},[s,n]),!s)return null;const N=()=>{document.fullscreenElement?document.exitFullscreen&&(document.exitFullscreen().catch(()=>{}),x(!1)):(document.documentElement.requestFullscreen().catch(()=>{}),x(!0))},g={PRE_CLASS_READY:a==="zh"?"课前就绪 · 准备上课":"Pre-Class Preparation",IN_CLASS_TEACHING:a==="zh"?"课中授课 · 互动探索":"Interactive Teaching",WRAP_UP_EXIT_TICKET:a==="zh"?"总结提升 · 结课通票":"Wrap-Up & Exit Ticket",ARCHIVED_REPORT:a==="zh"?"下课归档 · 学情简报":"Archived Report"},p=(t.pacing.TOO_FAST||0)+(t.pacing.CONFUSED||0)+(t.pacing.CLEAR||0);return e.jsxs("div",{id:"stage-display-modal",className:"fixed inset-0 z-[9999] bg-slate-950 text-slate-100 flex flex-col select-none overflow-hidden",children:[e.jsxs("header",{className:"h-20 px-8 bg-slate-900/80 border-b border-slate-800 flex items-center justify-between backdrop-blur-md",children:[e.jsxs("div",{className:"flex items-center gap-4",children:[e.jsxs("div",{className:"flex items-center gap-2.5 px-3 py-1.5 bg-blue-500/10 border border-blue-500/30 rounded-full text-blue-400 font-semibold text-sm",children:[e.jsx("span",{className:"w-2.5 h-2.5 rounded-full bg-blue-400 animate-ping"}),e.jsx("span",{children:a==="zh"?"大屏教学展台":"Stage Display"})]}),e.jsx("h1",{className:"text-2xl font-bold tracking-tight text-white line-clamp-1",children:o}),e.jsx("span",{className:"px-3 py-1 bg-slate-800 text-slate-300 text-xs font-mono rounded-md border border-slate-700",children:g[t.stage]||g.IN_CLASS_TEACHING})]}),e.jsxs("div",{className:"flex items-center gap-6",children:[e.jsxs("div",{className:"flex items-center gap-2 px-4 py-2 bg-slate-800/60 rounded-xl border border-slate-700/60 font-mono text-xl font-bold text-slate-200",children:[e.jsx(Le,{size:20,className:"text-blue-400"}),e.jsx("span",{children:d})]}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsxs("button",{id:"stage-peer-review-toggle",type:"button",onClick:()=>v(!0),className:"flex items-center gap-1.5 px-3 py-2 bg-teal-500/20 hover:bg-teal-500/30 text-teal-300 rounded-xl transition-colors border border-teal-500/40 text-xs font-semibold cursor-pointer",title:"进入全班大屏作业互评与协同赏析模式 (Stitch 21e2dac1)",children:[e.jsx(xs,{size:15}),e.jsx("span",{children:"作业互评赏析"})]}),e.jsx("button",{id:"stage-fullscreen-toggle",onClick:N,className:"p-3 bg-slate-800 hover:bg-slate-700 text-slate-300 rounded-xl transition-colors border border-slate-700 cursor-pointer",title:c?"退出全屏":"全屏展示",children:c?e.jsx(Xr,{size:20}):e.jsx(ea,{size:20})}),e.jsx("button",{id:"stage-close-button",onClick:i,className:"p-3 bg-rose-900/40 hover:bg-rose-900/70 text-rose-300 rounded-xl transition-colors border border-rose-800/50 cursor-pointer",title:"关闭展台",children:e.jsx(be,{size:20})})]})]})]}),e.jsxs("main",{className:"flex-1 p-8 grid grid-cols-12 gap-8 overflow-y-auto",children:[e.jsxs("section",{className:"col-span-8 flex flex-col gap-6",children:[t.stage==="PRE_CLASS_READY"&&e.jsxs("div",{className:"flex-1 bg-gradient-to-br from-slate-900 to-slate-850 rounded-3xl border border-slate-800 p-10 flex flex-col justify-center items-center text-center shadow-2xl",children:[e.jsx("div",{className:"p-4 bg-blue-500/10 rounded-3xl border border-blue-500/20 text-blue-400 mb-6",children:e.jsx(It,{size:48,className:"animate-pulse"})}),e.jsx("h2",{className:"text-3xl font-extrabold text-white mb-2",children:a==="zh"?"即将开始上课,请同学们准备":"Class Starting Soon"}),e.jsx("p",{className:"text-slate-400 text-lg mb-8 max-w-md",children:a==="zh"?"请打开平板或电脑进入课堂,输入口令加入":"Please join the interactive session using your device"}),t.checkinCode&&e.jsxs("div",{className:"px-10 py-6 bg-slate-800/90 rounded-2xl border border-blue-500/40 shadow-inner flex flex-col items-center",children:[e.jsx("span",{className:"text-xs uppercase tracking-widest text-slate-400 font-bold mb-2",children:a==="zh"?"课堂入课口令":"Class Code"}),e.jsx("span",{className:"text-6xl font-mono font-black tracking-wider text-blue-400",children:t.checkinCode})]})]}),t.activePoll&&e.jsxs("div",{className:"bg-slate-900/90 rounded-3xl border border-slate-800 p-8 shadow-xl flex flex-col gap-6",children:[e.jsxs("div",{className:"flex items-center justify-between border-b border-slate-800/80 pb-4",children:[e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("span",{className:"p-2.5 bg-amber-500/10 text-amber-400 rounded-xl border border-amber-500/20",children:e.jsx(fe,{size:24})}),e.jsxs("div",{children:[e.jsx("span",{className:"text-xs font-bold text-amber-400 uppercase tracking-wide",children:a==="zh"?"课堂极速互动":"Quick Activity"}),e.jsx("h3",{className:"text-xl font-bold text-white",children:t.activePoll.title})]})]}),e.jsxs("div",{className:"text-right",children:[e.jsx("span",{className:"text-3xl font-black text-amber-400 font-mono",children:t.activePoll.totalVotes||0}),e.jsx("span",{className:"text-xs text-slate-400 block",children:a==="zh"?"人已作答":"Responded"})]})]}),e.jsx("div",{className:"grid grid-cols-2 gap-4 my-2",children:(t.activePoll.options||["A","B","C","D"]).map(j=>{const k=t.activePoll.distribution?.[j]||0;t.activePoll.totalVotes;const w=Math.round(k/(t.activePoll.totalVotes||1)*100);return e.jsxs("div",{className:"p-5 bg-slate-800/50 rounded-2xl border border-slate-700/50 flex flex-col gap-3",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("span",{className:"w-10 h-10 rounded-xl bg-blue-500 text-white font-bold text-lg flex items-center justify-center shadow-md",children:j}),e.jsxs("span",{className:"font-semibold text-slate-200 text-lg",children:["选项 ",j]})]}),e.jsxs("span",{className:"font-mono font-bold text-xl text-blue-400",children:[w,"% (",k,")"]})]}),e.jsx("div",{className:"h-4 w-full bg-slate-700/40 rounded-full overflow-hidden",children:e.jsx("div",{className:"h-full bg-gradient-to-r from-blue-500 to-indigo-500 transition-all duration-500 rounded-full",style:{width:`${w}%`}})})]},j)})})]}),t.activeBuzzer&&e.jsxs("div",{className:"bg-slate-900/90 rounded-3xl border border-slate-800 p-8 shadow-xl flex flex-col items-center text-center justify-center",children:[e.jsx("div",{className:"p-4 bg-rose-500/10 rounded-2xl border border-rose-500/20 text-rose-400 mb-4",children:e.jsx(us,{size:36,className:"animate-bounce"})}),e.jsx("h3",{className:"text-2xl font-bold text-white mb-2",children:t.activeBuzzer.title}),t.activeBuzzer.status==="READY"?e.jsxs("div",{className:"my-6 py-6 px-12 bg-rose-950/30 border border-rose-500/30 rounded-2xl",children:[e.jsx("span",{className:"text-4xl font-extrabold text-rose-400 animate-pulse block",children:a==="zh"?"⚡ 全班抢答中...":"⚡ Buzzing in progress..."}),e.jsx("span",{className:"text-sm text-slate-400 mt-2 block",children:a==="zh"?"请按手中的抢答按钮!":"Press your buzzer now!"})]}):e.jsxs("div",{className:"my-6 py-6 px-12 bg-emerald-950/30 border border-emerald-500/40 rounded-2xl flex flex-col items-center",children:[e.jsx(Re,{size:48,className:"text-amber-400 mb-2"}),e.jsx("span",{className:"text-sm text-emerald-400 font-bold tracking-wide uppercase",children:a==="zh"?"🎉 抢答成功!":"🎉 First to Buzz!"}),e.jsx("span",{className:"text-5xl font-black text-white my-2 font-mono",children:t.activeBuzzer.winnerName||"同学"}),t.activeBuzzer.responseTimeMs&&e.jsx("span",{className:"text-sm font-mono text-emerald-300",children:a==="zh"?`响应用时:${t.activeBuzzer.responseTimeMs} 毫秒`:`Reaction time: ${t.activeBuzzer.responseTimeMs} ms`})]})]}),t.stage==="WRAP_UP_EXIT_TICKET"&&e.jsxs("div",{className:"bg-gradient-to-br from-indigo-950/40 to-slate-900 rounded-3xl border border-indigo-800/40 p-8 shadow-xl flex flex-col items-center text-center",children:[e.jsx(Qs,{size:48,className:"text-indigo-400 mb-4"}),e.jsx("h3",{className:"text-3xl font-extrabold text-white mb-2",children:a==="zh"?"60 秒结课通票 (Exit Ticket)":"60s Exit Ticket"}),e.jsx("p",{className:"text-slate-300 text-lg max-w-lg mb-6",children:a==="zh"?"请同学们打开设备完成本次课堂评估:选星级、写下今天最困惑的一个知识点。":"Please complete your 60-second summary ticket on your device."})]}),e.jsx(oe,{slot:"stage.display.card",slotProps:{lessonId:n,stage:t.stage}})]}),e.jsx("aside",{className:"col-span-4 flex flex-col gap-6",children:e.jsxs("div",{className:"bg-slate-900/90 rounded-3xl border border-slate-800 p-6 shadow-xl flex flex-col gap-4",children:[e.jsxs("div",{className:"flex items-center justify-between border-b border-slate-800/80 pb-3",children:[e.jsxs("div",{className:"flex items-center gap-2 text-white font-bold text-base",children:[e.jsx(_e,{size:18,className:"text-blue-400"}),e.jsx("span",{children:a==="zh"?"学习节奏晴雨表":"Pacing Barometer"})]}),e.jsxs("span",{className:"text-xs text-slate-400 font-mono",children:[p," ",a==="zh"?"次反馈":"signals"]})]}),e.jsxs("div",{className:"flex flex-col gap-3 my-1",children:[e.jsxs("div",{className:"flex items-center justify-between text-sm",children:[e.jsxs("span",{className:"flex items-center gap-2 text-emerald-300 font-medium",children:[e.jsx("span",{className:"w-2.5 h-2.5 rounded-full bg-emerald-400"}),a==="zh"?"听懂了 / 节奏合适":"Clear & Smooth"]}),e.jsx("span",{className:"font-mono font-bold text-white",children:t.pacing.CLEAR||0})]}),e.jsx("div",{className:"h-3 w-full bg-slate-800 rounded-full overflow-hidden",children:e.jsx("div",{className:"h-full bg-emerald-500 rounded-full transition-all duration-500",style:{width:`${p>0?(t.pacing.CLEAR||0)/p*100:0}%`}})}),e.jsxs("div",{className:"flex items-center justify-between text-sm pt-2",children:[e.jsxs("span",{className:"flex items-center gap-2 text-amber-300 font-medium",children:[e.jsx("span",{className:"w-2.5 h-2.5 rounded-full bg-amber-400"}),a==="zh"?"有些困惑 / 需点拨":"Confused"]}),e.jsx("span",{className:"font-mono font-bold text-white",children:t.pacing.CONFUSED||0})]}),e.jsx("div",{className:"h-3 w-full bg-slate-800 rounded-full overflow-hidden",children:e.jsx("div",{className:"h-full bg-amber-500 rounded-full transition-all duration-500",style:{width:`${p>0?(t.pacing.CONFUSED||0)/p*100:0}%`}})}),e.jsxs("div",{className:"flex items-center justify-between text-sm pt-2",children:[e.jsxs("span",{className:"flex items-center gap-2 text-rose-300 font-medium",children:[e.jsx("span",{className:"w-2.5 h-2.5 rounded-full bg-rose-400"}),a==="zh"?"讲太快了 / 跟不上":"Too Fast"]}),e.jsx("span",{className:"font-mono font-bold text-white",children:t.pacing.TOO_FAST||0})]}),e.jsx("div",{className:"h-3 w-full bg-slate-800 rounded-full overflow-hidden",children:e.jsx("div",{className:"h-full bg-rose-500 rounded-full transition-all duration-500",style:{width:`${p>0?(t.pacing.TOO_FAST||0)/p*100:0}%`}})})]}),e.jsx("p",{className:"text-xs text-slate-500 text-center mt-2",children:a==="zh"?"提示:此数据来自学生端匿名点击,自动脱敏保护学生自尊。":"Aggregated anonymized signals from student devices."})]})})]}),u&&e.jsx(gr,{isOpen:u,onClose:()=>v(!1),lessonTitle:o})]})}const Qt={CLEAR:{emoji:"💡",zh:"理解",en:"Clear",color:"#10b981"},CONFUSED:{emoji:"❓",zh:"困惑",en:"Confused",color:"#f59e0b"},TOO_FAST:{emoji:"🐇",zh:"慢一点",en:"Slow down",color:"#f43f5e"},SLOW:{emoji:"🐢",zh:"快一点",en:"Speed up",color:"#6366f1"}},La=["CLEAR","CONFUSED","TOO_FAST","SLOW"];function Fa({lessonId:s,lang:i,signals:n,onlineCount:o=0,onClose:a}){const t=i==="zh",[r,c]=l.useState(n);l.useEffect(()=>{const N=Ks();if(!N)return;const g=p=>{p?.lessonId===s&&p?.summary&&c(p.summary)};return N.on("classroom:pacing_updated",g),()=>{typeof N.off=="function"&&N.off("classroom:pacing_updated",g)}},[s]);const x=La.map(N=>({key:N,count:Number(r[N]??0)})),d=x.reduce((N,g)=>N+g.count,0);Number(r.CONFUSED??0)+Number(r.TOO_FAST??0)+Number(r.SLOW??0);const m=d>0?Math.round(Number(r.CLEAR??0)/d*100):null,u=l.useCallback(()=>d===0?{text:t?"暂无学生反馈,等待中…":"No feedback yet",tone:"text-muted"}:Number(r.CONFUSED??0)>=Math.max(2,d*.3)?{text:t?"⚠ 较多学生困惑,建议放慢并重新讲解当前环节":"⚠ Many students are confused — slow down and re-explain",tone:"text-amber-600"}:Number(r.TOO_FAST??0)>=Math.max(2,d*.3)?{text:t?"🐇 较多学生希望放慢节奏":"🐇 Many students want you to slow down",tone:"text-rose-600"}:Number(r.SLOW??0)>=Math.max(2,d*.3)?{text:t?"🐢 较多学生希望加快节奏":"🐢 Many students want you to speed up",tone:"text-indigo-600"}:{text:t?"✓ 节奏反馈健康,可按当前节奏继续":"✓ Pace is healthy — carry on",tone:"text-emerald-600"},[r,d,t]),v=x.filter(N=>N.count>0).map(N=>({name:Qt[N.key][t?"zh":"en"],value:N.count,color:Qt[N.key].color}));return e.jsx("div",{className:"fixed inset-0 z-[90] flex items-center justify-center bg-slate-900/60 backdrop-blur-2xs",onPointerDown:a,children:e.jsxs("div",{className:"bg-surface border border-theme rounded-2xl shadow-2xl w-[560px] max-w-[92vw] max-h-[86vh] overflow-y-auto p-5 font-sans text-main",onPointerDown:N=>N.stopPropagation(),children:[e.jsxs("div",{className:"flex items-center justify-between mb-4",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("div",{className:"p-2 bg-primary-theme/10 text-primary-theme rounded-xl",children:e.jsx(ta,{size:18})}),e.jsxs("div",{children:[e.jsxs("h2",{className:"text-sm font-black text-main flex items-center gap-1.5",children:[t?"课堂反馈情绪仪表盘":"Classroom Feedback Dashboard",e.jsxs("span",{className:"flex items-center gap-1 text-2xs font-bold text-emerald-600 bg-emerald-500/10 px-1.5 py-0.5 rounded-full",children:[e.jsx(_e,{size:10})," ",t?"实时":"LIVE"]})]}),e.jsx("p",{className:"text-2xs text-muted mt-0.5",children:t?"近 5 分钟窗口 · 全班节奏反馈聚合":"Last 5 minutes · aggregated pace feedback"})]})]}),e.jsx("button",{onClick:a,className:"p-1.5 rounded-lg hover:bg-surface-secondary text-muted cursor-pointer",title:t?"关闭":"Close",children:e.jsx(be,{size:16})})]}),e.jsxs("div",{className:"flex flex-col md:flex-row gap-4 items-center",children:[e.jsxs("div",{className:"w-[200px] h-[200px] relative shrink-0",children:[d>0?e.jsx(Ca,{width:"100%",height:"100%",children:e.jsx($a,{children:e.jsx(Aa,{data:v,dataKey:"value",nameKey:"name",innerRadius:52,outerRadius:85,paddingAngle:3,strokeWidth:0,isAnimationActive:!1,children:v.map((N,g)=>e.jsx(Ea,{fill:N.color},g))})})}):e.jsx("div",{className:"w-full h-full flex items-center justify-center text-3xl opacity-30",children:"📊"}),e.jsxs("div",{className:"absolute inset-0 flex flex-col items-center justify-center pointer-events-none",children:[e.jsxs("span",{className:"text-2xs text-muted flex items-center gap-1",children:[e.jsx(ke,{size:10})," ",o," ",t?"在线":"online"]}),e.jsx("span",{className:`text-xl font-black ${m===null?"text-muted":m>=60?"text-emerald-600":m>=30?"text-amber-600":"text-rose-600"}`,children:m===null?"—":`${m}%`}),e.jsx("span",{className:"text-2xs text-muted",children:t?"理解占比":"clear ratio"})]})]}),e.jsxs("div",{className:"flex-1 w-full flex flex-col gap-2.5",children:[x.map(({key:N,count:g})=>{const p=Qt[N],j=d>0?Math.round(g/d*100):0;return e.jsxs("div",{children:[e.jsxs("div",{className:"flex items-center justify-between text-xs mb-0.5",children:[e.jsxs("span",{className:"font-bold text-main",children:[p.emoji," ",t?p.zh:p.en]}),e.jsxs("span",{className:"text-muted font-mono",children:[g," · ",j,"%"]})]}),e.jsx("div",{className:"h-2.5 bg-surface-secondary rounded-full overflow-hidden border border-theme/50",children:e.jsx("div",{className:"h-full rounded-full transition-all duration-500",style:{width:`${j}%`,background:p.color}})})]},N)}),e.jsx("div",{className:`mt-1 text-xs font-bold ${u().tone}`,children:u().text})]})]})]})})}function Ns({isOpen:s,onClose:i,student:n,lessonId:o,classId:a,lang:t="zh",addToast:r,onInspectSandbox:c,onCastStudentScreen:x,onAwardPoints:d}){const[m,u]=l.useState("profile"),[v,N]=l.useState(""),[g,p]=l.useState(!1),j=n?.competencyScores,k=l.useMemo(()=>[{key:"logic",label:t==="zh"?"算法逻辑":"Logic"},{key:"engineering",label:t==="zh"?"代码工程":"Engineering"},{key:"creativity",label:t==="zh"?"创新思维":"Creativity"},{key:"collaboration",label:t==="zh"?"团队协作":"Collaboration"},{key:"focus",label:t==="zh"?"课堂专注":"Focus"}],[t]),w=l.useMemo(()=>k.map($=>{const S=j?.[$.key],E=typeof S=="number"&&Number.isFinite(S);return{key:$.key,label:$.label,score:E?Math.max(0,Math.min(100,Math.round(S))):0,available:E}}),[j,k]),f=w.some($=>$.available),b=w.filter($=>!$.available).map($=>$.label),z=l.useMemo(()=>{const $=t==="zh",S=n?.name??(t==="zh"?"该学生":"This student"),E=w.filter(K=>K.available);if(E.length===0)return $?`${S}本节暂无可用的维度数据(未参与随堂测/课件互动),无法生成掌握度评语。建议下节课关注其参与情况。`:`${S} has no competency data for this session (no quiz/courseware interaction).`;const Q=Math.round(E.reduce((K,le)=>K+le.score,0)/E.length),ie=E.reduce((K,le)=>le.score>K.score?le:K),pe=E.reduce((K,le)=>le.score<K.score?le:K),ce=w.filter(K=>!K.available).map(K=>K.label);return($?[`本节已采集维度:${E.map(K=>`${K.label} ${K.score}`).join("、")},平均 ${Q}。`,`相对优势为${ie.label}(${ie.score}),相对薄弱为${pe.label}(${pe.score})。`,ce.length>0?`未采集维度:${ce.join("、")}。`:""]:[`Collected: ${E.map(K=>`${K.label} ${K.score}`).join(", ")}; average ${Q}.`,`Strongest ${ie.label} (${ie.score}), weakest ${pe.label} (${pe.score}).`,ce.length>0?`Missing: ${ce.join(", ")}.`:""]).filter(Boolean).join(" ")},[w,t,n]),_=l.useMemo(()=>{const $=t==="zh",S=w.filter(Q=>Q.available);if(S.length===0)return $?"数据不足,暂不生成建议":"Insufficient data";const E=S.reduce((Q,ie)=>Q+ie.score,0)/S.length;return E>=85?$?"建议进入算法创新挑战营":"Recommended for Advanced Camp":E>=70?$?"建议保持当前节奏并补强薄弱维度":"Keep pace, strengthen weak areas":$?"建议课后补充基础微练习":"Suggest remedial practice"},[w,t]),C=l.useMemo(()=>{const $=w.filter(E=>E.available);if($.length===0)return"—";const S=$.reduce((E,Q)=>E+Q.score,0)/$.length;return S>=90?"A+":S>=80?"A":S>=70?"B+":S>=60?"B":"C"},[w]),B=l.useMemo(()=>{const Q=(K,le)=>{const de=-Math.PI/2+2*Math.PI/5*le;return{x:100+K*Math.cos(de),y:100+K*Math.sin(de)}},ie=[1,.66,.33].map(K=>{const le=75*K;return Array.from({length:5},(ue,ve)=>{const{x:A,y:L}=Q(le,ve);return`${A.toFixed(1)},${L.toFixed(1)}`}).join(" ")}),pe=Array.from({length:5},(K,le)=>{const{x:de,y:ue}=Q(75,le);return{x1:100,y1:100,x2:de,y2:ue}}),ce=w.map((K,le)=>{const de=75*Math.min(Math.max(K.score/100,.1),1);return Q(de,le)}),G=ce.map(K=>`${K.x.toFixed(1)},${K.y.toFixed(1)}`).join(" ");return{gridLevels:ie,axes:pe,dataPoints:ce,dataPolygonString:G}},[w]);if(!s||!n)return null;const R=n.points??0,J=n.deltaPoints??4,O=n.focusPercentage,H=n.accuracyPercentage,ee=n.helpCount??3,se=n.role||n.student_number||"",I=n.group_name||"",V=n.student_number||n.id.slice(-6),P=n.timeline??[],y=async($,S)=>{p(!0);try{d?d(n.id,$,S):await fetch(`/api/students/${n.id}/points`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({delta:$,dimension:"attribution",reason:S,classId:a,lessonId:o})}),r?.(t==="zh"?"成长积分已发放":"Points Awarded",t==="zh"?`已为学生 [${n.name}] ${$>=0?"+":""}${$} 分(${S})`:`Awarded ${$} pts to [${n.name}]`,"success")}catch(E){r?.("Error",E.message,"error")}finally{p(!1)}},M=()=>{const $=`# 学生个人全景学情与成长档案 (${n.name})
|
|
2
2
|
- **学生姓名**: ${n.name}
|
|
3
3
|
- **学号**: ${V}
|
|
4
4
|
- **所属班级**: ${n.className||a||"默认班级"}
|
package/dist/assets/{NotificationDetailModal-DBg7UPZh.js → NotificationDetailModal-Baqnc5pU.js}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{j as e}from"./vendor-react-B0t7H3hh.js";import{m as n}from"./index-
|
|
1
|
+
import{j as e}from"./vendor-react-B0t7H3hh.js";import{m as n}from"./index-BKBCBKvy.js";import{p as d,r as o,F as l,at as i}from"./vendor-icons-BRmhY6fg.js";import"./vendor-utils-m0Urvtws.js";import"./vendor-pdf-D7rGevI1.js";import"./vendor-motion-BFAPOs-b.js";import"./vendor-pptx-C5-U7ieS.js";import"./vendor-charts-qLbgF1eL.js";function f({notification:s,onClose:t,lang:r,onOpenWorkspace:a}){return s?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(n.div,{initial:{opacity:0,scale:.95},animate:{opacity:1,scale:1},exit:{opacity:0,scale:.95},className:"bg-white border text-gray-900 border-gray-200 rounded-2xl shadow-2xl w-full max-w-xl flex flex-col overflow-hidden max-h-[85vh] font-sans",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(d,{className:"text-indigo-600 font-sans shrink-0",size:20}),e.jsx("h2",{className:"font-bold text-gray-800 text-base font-sans truncate",children:s.title})]}),e.jsx("button",{onClick:t,className:"text-gray-400 hover:text-gray-600 font-bold p-1 hover:bg-gray-200 rounded transition-colors text-lg",children:"×"})]}),e.jsxs("div",{className:"flex-1 overflow-y-auto p-6 space-y-4",children:[e.jsx("div",{className:"p-4 bg-indigo-50/50 rounded-xl border border-indigo-100 text-sm text-gray-700 leading-relaxed font-sans",children:s.message}),s.assignment&&e.jsxs("div",{className:"space-y-4 font-sans",children:[e.jsxs("div",{className:"border border-gray-150 rounded-xl p-4 bg-gray-50/50 space-y-3",children:[e.jsxs("div",{className:"flex justify-between items-center",children:[e.jsx("span",{className:"text-xs text-gray-400 uppercase tracking-wider font-semibold font-sans",children:r==="zh"?"关联作业":"Associated Assignment"}),s.assignment.submission_status==="graded"&&e.jsx("span",{className:"bg-green-100 border border-green-200 text-green-800 text-xs font-bold px-2.5 py-1 rounded-full shadow-sm font-mono",children:r==="zh"?`得分:${s.assignment.score}%`:`Score: ${s.assignment.score}%`})]}),e.jsxs("div",{children:[e.jsx("h4",{className:"font-bold text-base text-indigo-900 font-sans",children:s.assignment.title}),e.jsx("p",{className:"text-xs text-gray-500 mt-1 font-sans",children:s.assignment.class_name})]}),s.assignment.feedback&&e.jsxs("div",{className:"mt-3 bg-white p-3 rounded-lg border border-gray-150 space-y-1 font-sans",children:[e.jsxs("div",{className:"text-xs font-bold text-green-700 flex items-center justify-between gap-2 font-sans",children:[e.jsxs("div",{className:"flex items-center gap-1",children:[e.jsx(o,{size:14,className:"font-sans"}),e.jsx("span",{children:r==="zh"?"教师评审意见与反馈":"Teacher Feedback & Recommendations"})]}),s.assignment.graded_at&&e.jsxs("div",{className:"text-xs text-gray-400 font-mono flex items-center gap-1 font-normal select-none",children:[e.jsx(l,{size:11,className:"text-neutral-400"}),e.jsx("span",{children:new Date(s.assignment.graded_at).toLocaleString(r==="zh"?"zh-CN":"en-US",{month:"short",day:"numeric",hour:"2-digit",minute:"2-digit"})})]})]}),e.jsx("div",{className:"text-xs text-gray-600 italic bg-green-50/30 p-2 rounded border border-green-50 mt-1 leading-relaxed whitespace-pre-wrap font-sans",children:s.assignment.feedback})]})]}),s.assignment.submission_content&&e.jsxs("div",{className:"space-y-1.5 font-sans",children:[e.jsx("div",{className:"text-xs text-gray-400 font-bold uppercase tracking-wider font-sans",children:r==="zh"?"我提交的内容":"My Submission Content"}),e.jsx("div",{className:"bg-gray-900 text-gray-100 p-4 rounded-xl border border-gray-800 overflow-x-auto max-h-40 overflow-y-auto text-xs font-mono leading-relaxed whitespace-pre-wrap",children:s.assignment.submission_content})]})]})]}),e.jsxs("div",{className:"p-4 border-t border-gray-100 bg-gray-50/85 flex justify-end gap-2.5 shrink-0 font-sans",children:[e.jsx("button",{type:"button",onClick:t,className:"px-4 py-2 text-xs font-semibold border border-gray-200 text-gray-700 bg-white rounded-lg hover:bg-gray-100 transition-colors cursor-pointer",children:r==="zh"?"关闭":"Close"}),s.assignment&&e.jsxs("button",{type:"button",onClick:()=>a(s.assignment),className:"px-4 py-2 text-xs font-bold bg-indigo-600 text-white border border-indigo-700 rounded-lg hover:bg-indigo-700 hover:shadow shadow-sm transition-all cursor-pointer flex items-center gap-1.5 font-sans",children:[e.jsx(i,{size:14,className:"font-sans"}),r==="zh"?"打开画布 / 查看详情":"Open Workspace Canvas"]})]})]})}):null}export{f as NotificationDetailModal};
|