openlearn-next 0.2.7 → 0.2.8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (56) hide show
  1. package/dist/assets/{AdminDirectoryView-Cai0cQqi.js → AdminDirectoryView-CD7tW4mc.js} +1 -1
  2. package/dist/assets/BatchPickerModal-Bt8Qx0Av.js +1 -0
  3. package/dist/assets/{ClassesView-Cxgfcrx1.js → ClassesView-B1B3wlkx.js} +2 -2
  4. package/dist/assets/CloudDriveModal-BSZaWIex.js +1 -0
  5. package/dist/assets/{ComputerLabView-CUCO2VIV.js → ComputerLabView-B6-twB0u.js} +1 -1
  6. package/dist/assets/CourseManagement-Bnezm9Vv.js +1 -0
  7. package/dist/assets/CourseWizardModal-BvfTvcQT.js +3 -0
  8. package/dist/assets/{CoursewareHubPanel-CAaf22Qm.js → CoursewareHubPanel-Cb1mAqHS.js} +1 -1
  9. package/dist/assets/{Dashboard-vSYAYoji.js → Dashboard-DQ91dQio.js} +2 -2
  10. package/dist/assets/ExportWeightModal-al1iIVxb.js +1 -0
  11. package/dist/assets/{HelpTour-ZgEkRnin.js → HelpTour-DwM9UBiA.js} +1 -1
  12. package/dist/assets/{HelpView-D3WIxMoB.js → HelpView-DLAKVpwf.js} +5 -5
  13. package/dist/assets/ImportLessonsModal-DwhvqzY_.js +1 -0
  14. package/dist/assets/{ImportModal-mkWuDoAN.js → ImportModal-CmUt1YeX.js} +1 -1
  15. package/dist/assets/InteractiveCoursewareViewer-DWnzq20c.js +1 -0
  16. package/dist/assets/{InteractiveWhiteboard-bmT1LKD6.js → InteractiveWhiteboard-CQ-4meYj.js} +12 -12
  17. package/dist/assets/{LazyCourseware-Bcxn_20f.js → LazyCourseware-g7b8EXR_.js} +1 -1
  18. package/dist/assets/{LazyWhiteboard-CJA7aRIM.js → LazyWhiteboard-B6rDWBFb.js} +1 -1
  19. package/dist/assets/{LessonEditorView-hdJblhmb.js → LessonEditorView-DixwX1Kw.js} +1 -1
  20. package/dist/assets/{LiveClassroomView-ByyIOLJC.js → LiveClassroomView-j93YOxSh.js} +1 -1
  21. package/dist/assets/NotificationDetailModal-CQ9PIqkD.js +1 -0
  22. package/dist/assets/{PluginView-B3ZolNGQ.js → PluginView-DCY4yi2h.js} +1 -1
  23. package/dist/assets/{ProcessLogsModal-8mVp07ic.js → ProcessLogsModal-B-PY780w.js} +1 -1
  24. package/dist/assets/QuizGeneratorModal-BvTcmD68.js +1 -0
  25. package/dist/assets/StudentAssignmentView-4R0WxStx.js +1 -0
  26. package/dist/assets/StudentLessonView-DZ0i9-tX.js +1 -0
  27. package/dist/assets/StudentPreviewModal-CfsB1dPY.js +1 -0
  28. package/dist/assets/StudentView-D7GtUiYR.js +2 -0
  29. package/dist/assets/SystemResourceLibraryModal-Ilnthwpw.js +1 -0
  30. package/dist/assets/TeacherView-DjnjsQ_3.js +2 -0
  31. package/dist/assets/{TimetableView-zce3okQn.js → TimetableView-BMsjwi-s.js} +3 -3
  32. package/dist/assets/index-D8x6bUeG.js +150 -0
  33. package/dist/assets/{index-CDTw8wSY.js → index-wdWIWwbg.js} +1 -1
  34. package/dist/assets/{vendor-icons-BvCtGbt1.js → vendor-icons-_c3xpwjZ.js} +1 -1
  35. package/dist/assets/vendor-motion-DjY2czvL.js +1 -0
  36. package/dist/index.html +1 -1
  37. package/dist/server.cjs +72 -20
  38. package/package.json +1 -1
  39. package/dist/assets/BatchPickerModal-CKQyeY6R.js +0 -1
  40. package/dist/assets/CloudDriveModal-TFWlPh8x.js +0 -1
  41. package/dist/assets/CourseManagement-DSCOjuIC.js +0 -1
  42. package/dist/assets/CourseWizardModal-B3QnFxvj.js +0 -3
  43. package/dist/assets/ExportWeightModal-BlS2auLs.js +0 -1
  44. package/dist/assets/ImportLessonsModal-BZZRDBRU.js +0 -1
  45. package/dist/assets/InteractiveCoursewareViewer-01PS40_x.js +0 -1
  46. package/dist/assets/NotificationDetailModal-dndFrE7p.js +0 -1
  47. package/dist/assets/QuizGeneratorModal-DpTFYbVJ.js +0 -1
  48. package/dist/assets/StudentAssignmentView-DDY7C092.js +0 -1
  49. package/dist/assets/StudentLessonView-BcQ7q4QF.js +0 -1
  50. package/dist/assets/StudentPreviewModal-ETJBF1Vc.js +0 -1
  51. package/dist/assets/StudentView-BOqPntx-.js +0 -1
  52. package/dist/assets/SystemResourceLibraryModal-tg8xnblT.js +0 -1
  53. package/dist/assets/TeacherView-CrbllHIm.js +0 -2
  54. package/dist/assets/index-BrEBeWAQ.js +0 -14
  55. package/dist/assets/index-eXp-qZdm.js +0 -129
  56. package/dist/assets/vendor-motion-Dz5URUo4.js +0 -9
@@ -1 +1 @@
1
- import{_ as a}from"./vendor-pdf-CVyNPGVr.js";import{j as e,r as s}from"./vendor-react-0Lg0vA-4.js";const t=s.lazy(()=>a(()=>import("./index-CDTw8wSY.js"),[]).then(r=>({default:r.CoursewareViewer})));function n(r){return e.jsx(s.Suspense,{fallback:e.jsx("div",{className:"flex items-center justify-center h-full bg-gray-50",children:e.jsx("div",{className:"animate-spin rounded-full h-8 w-8 border-b-2 border-indigo-500"})}),children:e.jsx(t,{...r})})}export{n as L};
1
+ import{_ as a}from"./vendor-pdf-CVyNPGVr.js";import{j as e,r as s}from"./vendor-react-0Lg0vA-4.js";const t=s.lazy(()=>a(()=>import("./index-wdWIWwbg.js"),[]).then(r=>({default:r.CoursewareViewer})));function n(r){return e.jsx(s.Suspense,{fallback:e.jsx("div",{className:"flex items-center justify-center h-full bg-gray-50",children:e.jsx("div",{className:"animate-spin rounded-full h-8 w-8 border-b-2 border-indigo-500"})}),children:e.jsx(t,{...r})})}export{n as L};
@@ -1,2 +1,2 @@
1
1
  const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/index-CATki2cp.css","assets/vendor-reveal-DcQQzuI9.css"])))=>i.map(i=>d[i]);
2
- import{_ as s}from"./vendor-pdf-CVyNPGVr.js";import{r as t,j as e}from"./vendor-react-0Lg0vA-4.js";const i=t.lazy(()=>s(()=>import("./InteractiveWhiteboard-bmT1LKD6.js"),__vite__mapDeps([0,1])).then(r=>({default:r.InteractiveWhiteboard}))),n=t.forwardRef((r,a)=>e.jsx(t.Suspense,{fallback:e.jsx("div",{className:"flex items-center justify-center h-full bg-gray-50",children:e.jsx("div",{className:"animate-spin rounded-full h-8 w-8 border-b-2 border-indigo-500"})}),children:e.jsx(i,{ref:a,...r})}));export{n as L};
2
+ import{_ as s}from"./vendor-pdf-CVyNPGVr.js";import{r as t,j as e}from"./vendor-react-0Lg0vA-4.js";const i=t.lazy(()=>s(()=>import("./InteractiveWhiteboard-CQ-4meYj.js"),__vite__mapDeps([0,1])).then(r=>({default:r.InteractiveWhiteboard}))),n=t.forwardRef((r,a)=>e.jsx(t.Suspense,{fallback:e.jsx("div",{className:"flex items-center justify-center h-full bg-gray-50",children:e.jsx("div",{className:"animate-spin rounded-full h-8 w-8 border-b-2 border-indigo-500"})}),children:e.jsx(i,{ref:a,...r})}));export{n as L};
@@ -1 +1 @@
1
- import{j as e,r as C,R as U}from"./vendor-react-0Lg0vA-4.js";import{L as V}from"./LazyWhiteboard-CJA7aRIM.js";import{C as T,P as W,b as q,c as _}from"./index-eXp-qZdm.js";import{aj as R,aq as X,ad as Y,X as G,m as Q,f as I,Z as B,b as K,y as S,P as ee,ar as te,s as re,g as Z,as as se,at as ae,F as J,a6 as oe,ab as le,aa as ne,W as ie,l as de,D as ce,J as xe,a0 as pe}from"./vendor-icons-BvCtGbt1.js";import"./vendor-pdf-CVyNPGVr.js";import"./vendor-utils-4FcTwKPj.js";import"./vendor-motion-Dz5URUo4.js";import"./vendor-charts-B7ViBL9w.js";function F({config:t,lang:o,onActivate:l,isFavorite:h=!1,onToggleFavorite:s}){const x=t.icon,n=T[t.color]||T.indigo;return e.jsxs("div",{draggable:!0,onDragStart:b=>{const g={type:t.type,...t.defaultData},N=JSON.stringify(g);b.dataTransfer.effectAllowed="copy",b.dataTransfer.setData("application/json",N),b.dataTransfer.setData("text/plain",N)},onClick:()=>l(t.type),title:o==="zh"?"点击编辑并添加到画板,或拖拽到画板":"Click to edit & add, or drag onto the board",className:`group relative bg-white border border-slate-200/80 rounded-xl p-2.5 shadow-sm transition-all duration-200 cursor-grab active:cursor-grabbing hover:shadow-md hover:-translate-y-0.5 ${n.cardHoverBorder} ${n.cardHoverRing} ${n.cardHoverShadow} flex flex-col justify-between min-h-[92px]`,children:[e.jsxs("div",{className:"flex items-center justify-between gap-1",children:[e.jsx("div",{className:`p-2 rounded-lg ${n.iconBg} ${n.iconText} transition-transform group-hover:scale-105 shrink-0`,children:e.jsx(x,{size:16})}),s&&e.jsx("button",{type:"button",onClick:b=>{b.stopPropagation(),s(t.type,b)},className:`p-1 rounded-md transition-colors ${h?"text-amber-400 opacity-100":"text-slate-300 opacity-0 group-hover:opacity-100 hover:text-amber-400 hover:bg-slate-100"}`,title:h?o==="zh"?"取消收藏":"Remove favorite":o==="zh"?"收藏组件":"Add favorite",children:e.jsx(R,{size:13,className:h?"fill-amber-400":""})})]}),e.jsxs("div",{className:"flex flex-col min-w-0 mt-1.5",children:[e.jsx("span",{className:"font-semibold text-xs text-slate-800 truncate group-hover:text-indigo-600 transition-colors",children:o==="zh"?t.labelZh:t.labelEn}),e.jsx("span",{className:"text-[10px] text-slate-400 leading-tight mt-0.5 truncate",children:o==="zh"?t.descriptionZh:t.descriptionEn})]}),e.jsx("div",{className:"absolute top-1.5 right-1.5 opacity-0 group-hover:opacity-100 transition-opacity pointer-events-none",children:e.jsx("span",{className:"text-[9px] font-bold text-indigo-500 bg-indigo-50 px-1 py-0.5 rounded border border-indigo-100",children:"+ Drag"})})]})}function he({lang:t,onActivate:o}){const[l,h]=C.useState(""),[s,x]=C.useState("all"),[n,b]=C.useState(()=>{try{const r=localStorage.getItem("openlearn_palette_favs");return r?JSON.parse(r):[]}catch{return[]}}),[g,N]=C.useState(()=>{try{const r=localStorage.getItem("openlearn_palette_recent");return r?JSON.parse(r):[]}catch{return[]}}),[f,z]=C.useState({}),d=r=>{N(i=>{const m=[r,...i.filter(j=>j!==r)].slice(0,6);try{localStorage.setItem("openlearn_palette_recent",JSON.stringify(m))}catch{}return m}),o(r)},u=(r,i)=>{i.stopPropagation(),b(m=>{const y=m.includes(r)?m.filter($=>$!==r):[...m,r];try{localStorage.setItem("openlearn_palette_favs",JSON.stringify(y))}catch{}return y})},p=r=>{z(i=>({...i,[r]:!i[r]}))},a=W.filter(r=>{if(l.trim()){const i=l.toLowerCase(),m=r.labelZh.toLowerCase().includes(i)||r.descriptionZh.toLowerCase().includes(i),j=r.labelEn.toLowerCase().includes(i)||r.descriptionEn.toLowerCase().includes(i);if(!m&&!j)return!1}return s==="favorites"?n.includes(r.type):s==="recent"?g.includes(r.type):!0});return e.jsxs("div",{className:"w-[240px] shrink-0 border-r border-slate-200/80 bg-slate-50/90 p-3 overflow-y-auto flex flex-col gap-3 font-sans select-none",children:[e.jsxs("div",{children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("h3",{className:"flex items-center gap-1.5 text-xs font-bold text-slate-800 uppercase tracking-wider",children:[e.jsx(X,{size:15,className:"text-indigo-600"}),t==="zh"?"备课画板组件":"Components"]}),e.jsx("span",{className:"text-[10px] font-semibold text-slate-400 bg-slate-200/60 px-1.5 py-0.5 rounded-full",children:a.length})]}),e.jsx("p",{className:"text-[10px] text-slate-400 leading-tight mt-0.5",children:t==="zh"?"拖拽到右侧白板,或点击配置添加到画板。":"Drag to whiteboard or click to configure."})]}),e.jsxs("div",{className:"relative",children:[e.jsx(Y,{size:13,className:"absolute left-2.5 top-1/2 -translate-y-1/2 text-slate-400"}),e.jsx("input",{type:"text",value:l,onChange:r=>h(r.target.value),placeholder:t==="zh"?"搜索画板组件...":"Search components...",className:"w-full pl-8 pr-7 py-1.5 bg-white border border-slate-200 rounded-lg text-xs text-slate-700 placeholder-slate-400 focus:outline-none focus:ring-1 focus:ring-indigo-500 focus:border-indigo-500 transition-all shadow-2xs"}),l&&e.jsx("button",{onClick:()=>h(""),className:"absolute right-2 top-1/2 -translate-y-1/2 text-slate-400 hover:text-slate-600",children:e.jsx(G,{size:12})})]}),e.jsxs("div",{className:"flex items-center gap-1 bg-slate-200/50 p-1 rounded-lg",children:[e.jsx("button",{onClick:()=>x("all"),className:`flex-1 py-1 text-[11px] font-medium rounded-md transition-all ${s==="all"?"bg-white text-slate-800 shadow-2xs font-bold":"text-slate-500 hover:text-slate-800"}`,children:t==="zh"?"全部":"All"}),e.jsxs("button",{onClick:()=>x("favorites"),className:`flex-1 py-1 text-[11px] font-medium rounded-md transition-all flex items-center justify-center gap-1 ${s==="favorites"?"bg-white text-amber-600 shadow-2xs font-bold":"text-slate-500 hover:text-amber-600"}`,children:[e.jsx(R,{size:11,className:s==="favorites"?"fill-amber-500":""}),e.jsx("span",{children:t==="zh"?"收藏":"Favs"})]}),e.jsxs("button",{onClick:()=>x("recent"),className:`flex-1 py-1 text-[11px] font-medium rounded-md transition-all flex items-center justify-center gap-1 ${s==="recent"?"bg-white text-indigo-600 shadow-2xs font-bold":"text-slate-500 hover:text-indigo-600"}`,children:[e.jsx(Q,{size:11}),e.jsx("span",{children:t==="zh"?"最近":"Recent"})]})]}),e.jsx("div",{className:"flex-1 flex flex-col gap-3 overflow-y-auto pr-0.5",children:a.length===0?e.jsxs("div",{className:"text-center py-8 text-slate-400 text-xs",children:[e.jsx(I,{size:24,className:"mx-auto mb-2 opacity-30 text-indigo-500"}),e.jsx("p",{className:"font-medium text-slate-500",children:t==="zh"?"未找到相关组件":"No components found"}),e.jsx("p",{className:"text-[10px] mt-1 text-slate-400",children:s!=="all"?t==="zh"?"尝试切换到全部组件":"Try switching to All tab":t==="zh"?"更换搜索关键词":"Try a different search term"})]}):s!=="all"||l.trim()?e.jsx("div",{className:"grid grid-cols-2 gap-2",children:a.map(r=>e.jsx(F,{config:r,lang:t,onActivate:d,isFavorite:n.includes(r.type),onToggleFavorite:u},r.type))}):q.map(r=>{const i=a.filter(y=>y.group===r.id);if(i.length===0)return null;const m=T[i[0].color]||T.indigo,j=f[r.id];return e.jsxs("div",{className:"flex flex-col gap-1.5",children:[e.jsxs("button",{type:"button",onClick:()=>p(r.id),className:"flex items-center justify-between px-1 py-0.5 text-left group/grp cursor-pointer hover:bg-slate-200/40 rounded transition-colors",children:[e.jsxs("div",{className:"flex items-center gap-1.5",children:[e.jsx("span",{className:`w-1.5 h-1.5 rounded-full ${m.groupAccent}`}),e.jsx("span",{className:`text-[10px] font-bold uppercase tracking-wider ${m.groupText}`,children:t==="zh"?r.labelZh:r.labelEn})]}),e.jsxs("div",{className:"flex items-center gap-1 text-slate-400 group-hover/grp:text-slate-600",children:[e.jsxs("span",{className:"text-[9px] font-mono font-medium opacity-70",children:["(",i.length,")"]}),j?e.jsx(B,{size:12}):e.jsx(K,{size:12})]})]}),!j&&e.jsx("div",{className:"grid grid-cols-2 gap-2",children:i.map(y=>e.jsx(F,{config:y,lang:t,onActivate:d,isFavorite:n.includes(y.type),onToggleFavorite:u},y.type))})]},r.id)})})]})}const O=[{id:"intro",labelZh:"准备环节",labelEn:"Intro",icon:S},{id:"lecture",labelZh:"讲授新课",labelEn:"Lecture",icon:ee},{id:"practice",labelZh:"互动练习",labelEn:"Practice",icon:te},{id:"quiz",labelZh:"随堂测试",labelEn:"Quiz",icon:re},{id:"summary",labelZh:"要点总结",labelEn:"Summary",icon:Z}],E=[{name:"Blue",color:"bg-blue-50 text-blue-700 border-blue-200 hover:bg-blue-100",solid:"bg-blue-500 text-white border-blue-500 shadow-md ring-2 ring-blue-200",rail:"bg-blue-400"},{name:"Indigo",color:"bg-indigo-50 text-indigo-700 border-indigo-200 hover:bg-indigo-100",solid:"bg-indigo-500 text-white border-indigo-500 shadow-md ring-2 ring-indigo-200",rail:"bg-indigo-400"},{name:"Green",color:"bg-green-50 text-green-700 border-green-200 hover:bg-green-100",solid:"bg-green-500 text-white border-green-500 shadow-md ring-2 ring-green-200",rail:"bg-green-400"},{name:"Purple",color:"bg-purple-50 text-purple-700 border-purple-200 hover:bg-purple-100",solid:"bg-purple-500 text-white border-purple-500 shadow-md ring-2 ring-purple-200",rail:"bg-purple-400"},{name:"Amber",color:"bg-amber-50 text-amber-700 border-amber-200 hover:bg-amber-100",solid:"bg-amber-500 text-white border-amber-500 shadow-md ring-2 ring-amber-200",rail:"bg-amber-400"}],me=E[1].color;function be(t){return O.find(o=>o.id===t)||O[1]}function M(t){return E.find(o=>o.color===t)||E[1]}function ue({lang:t,segments:o,activeSegmentId:l,setActiveSegmentId:h,draggedSegmentIdx:s,setDraggedSegmentIdx:x,selectedLesson:n,saveTimeline:b,editorPanelsExpanded:g,setEditorPanelsExpanded:N}){const f=o.findIndex(a=>a.id===l),z=o.length>1&&f>=0?f/(o.length-1):0,d=f>=0?M(o[f].color):null,u=a=>{if(s===null||s===a){x(null);return}const r=[...o],[i]=r.splice(s,1);r.splice(a,0,i),x(null),n&&b(n,r)},p=()=>{if(!n)return;const a="seg-"+Math.random().toString(36).slice(2,9),r={id:a,title:t==="zh"?`新环节 ${o.length+1}`:`Segment ${o.length+1}`,notes:"",type:"lecture",duration:"10m",color:me};b(n,[...o,r]),h(a)};return e.jsxs("div",{className:"relative flex items-center gap-3 px-3 py-1.5 border-b border-slate-200/80 bg-slate-50/70 shrink-0 overflow-x-auto select-none",children:[e.jsxs("div",{className:"flex items-center gap-1.5 shrink-0 pl-1 border-r border-slate-200/80 pr-2.5",children:[e.jsx(se,{size:15,className:"text-indigo-600 shrink-0"}),e.jsx("span",{className:"text-xs font-extrabold uppercase tracking-wider text-slate-600 whitespace-nowrap",children:t==="zh"?"教学流程":"Lesson Flow"})]}),e.jsxs("div",{className:"relative flex items-center gap-1.5 py-0.5 min-w-0 flex-1",children:[e.jsx("div",{className:"absolute left-2 right-2 top-1/2 h-0.5 -translate-y-1/2 bg-slate-200 rounded-full"}),f>=0&&e.jsx("div",{className:`absolute left-2 top-1/2 h-0.5 -translate-y-1/2 rounded-full transition-all duration-300 ${d?.rail||"bg-indigo-500"}`,style:{width:`calc(${z*100}% - 0.5rem)`}}),o.map((a,r)=>{const i=a.id===l,m=f>=0&&r<f,j=s===r,y=be(a.type),$=M(a.color),k=y.icon,A=i?$.solid+" shadow-md shadow-indigo-500/20 ring-2 ring-indigo-400/30":m?"bg-slate-100 border-slate-300 text-slate-700 hover:bg-slate-200/80":`${a.color} hover:shadow-sm hover:brightness-105`;return e.jsxs(U.Fragment,{children:[e.jsxs("button",{draggable:!0,onDragStart:w=>{x(r),w.dataTransfer.effectAllowed="move",w.dataTransfer.setData("text/plain",r.toString())},onDragOver:w=>w.preventDefault(),onDrop:w=>{w.preventDefault(),u(r)},onClick:()=>h(a.id),title:`${a.title} · ${a.duration}${a.notes?" · 📝":""}`+(t==="zh"?"(点击编辑 / 拖拽排序)":" (click to edit / drag to reorder)"),className:`relative z-10 group flex items-center gap-1.5 pl-1.5 pr-2.5 py-1 rounded-full border text-xs font-semibold cursor-grab active:cursor-grabbing transition-all duration-200 ${j?"opacity-40 border-dashed scale-95":""} ${A}`,children:[e.jsx(ae,{size:11,className:`opacity-0 group-hover:opacity-60 transition-opacity -mr-1 ${i?"text-white":"text-slate-400"}`}),e.jsx("span",{className:`flex items-center justify-center w-4 h-4 rounded-full text-[10px] font-bold shrink-0 ${i?"bg-white/25 text-white":m?"bg-emerald-500 text-white":"bg-white text-slate-600 border border-slate-200"}`,children:m?e.jsx(Z,{size:11}):r+1}),e.jsx(k,{size:13,className:"shrink-0"}),e.jsx("span",{className:"max-w-[110px] truncate font-medium",children:a.title}),a.duration&&e.jsxs("span",{className:`text-[10px] px-1 py-0.2 rounded font-mono font-normal flex items-center gap-0.5 ${i?"bg-black/20 text-white":"bg-black/5 text-slate-500"}`,children:[e.jsx(Q,{size:9}),a.duration]}),a.notes&&e.jsx(J,{size:10,className:`shrink-0 ${i?"text-white/90":"text-amber-500"}`}),i&&e.jsxs("span",{className:"flex items-center gap-1 ml-0.5 pl-1.5 border-l border-white/30 text-[10px] font-extrabold uppercase tracking-wide shrink-0",children:[e.jsx("span",{className:"w-1.5 h-1.5 rounded-full bg-white animate-pulse"}),t==="zh"?"进行中":"LIVE"]})]}),r<o.length-1&&e.jsx(B,{size:12,className:"text-slate-300 shrink-0 z-10"})]},a.id)}),n&&e.jsxs("button",{onClick:p,className:"relative z-10 shrink-0 ml-1 px-2.5 py-1 rounded-full border border-dashed border-slate-300 text-xs font-semibold text-slate-500 hover:border-indigo-400 hover:text-indigo-600 hover:bg-indigo-50/50 transition-all flex items-center gap-1 cursor-pointer shadow-2xs",title:t==="zh"?"新增教学环节":"Add flow segment",children:[e.jsx(oe,{size:13}),e.jsx("span",{className:"text-[11px]",children:t==="zh"?"添加环节":"Add Step"})]})]}),e.jsxs("button",{onClick:()=>N(a=>!a),className:"ml-auto shrink-0 px-2.5 py-1 bg-white hover:bg-slate-100 border border-slate-200 text-slate-700 text-xs font-semibold rounded-lg shadow-2xs transition-all cursor-pointer flex items-center gap-1.5",children:[e.jsx(le,{size:13,className:g?"text-indigo-600":"text-slate-400"}),e.jsx("span",{children:g?t==="zh"?"隐藏环节编辑":"Hide Details":t==="zh"?"展开环节编辑":"Edit Step"})]})]})}function ge({lang:t,segment:o,onPatch:l,onDelete:h}){return e.jsxs("div",{className:"flex flex-col gap-2 p-2 bg-slate-50/80 border-b border-gray-100 shrink-0",children:[e.jsxs("div",{className:"flex items-center gap-1.5",children:[e.jsx("span",{className:"w-1.5 h-1.5 rounded-full bg-indigo-500"}),e.jsx("span",{className:"text-xs font-bold text-gray-700",children:t==="zh"?`环节设置:${o.title}`:`Segment: ${o.title}`})]}),e.jsxs("div",{className:"grid grid-cols-2 sm:grid-cols-4 gap-2",children:[e.jsxs("label",{className:"flex flex-col gap-1",children:[e.jsx("span",{className:"text-[10px] font-semibold uppercase tracking-wide text-gray-400",children:t==="zh"?"名称":"Title"}),e.jsx("input",{type:"text",value:o.title||"",onChange:s=>l({title:s.target.value}),className:"border border-gray-200 px-2 py-1 rounded-lg bg-white text-[13px] outline-none focus:border-indigo-400 focus:ring-2 focus:ring-indigo-100"})]}),e.jsxs("label",{className:"flex flex-col gap-1",children:[e.jsx("span",{className:"text-[10px] font-semibold uppercase tracking-wide text-gray-400",children:t==="zh"?"时长":"Duration"}),e.jsx("input",{type:"text",value:o.duration||"10m",onChange:s=>l({duration:s.target.value}),className:"border border-gray-200 px-2 py-1 rounded-lg bg-white text-[13px] outline-none focus:border-indigo-400 focus:ring-2 focus:ring-indigo-100"})]}),e.jsxs("label",{className:"flex flex-col gap-1",children:[e.jsx("span",{className:"text-[10px] font-semibold uppercase tracking-wide text-gray-400",children:t==="zh"?"类型":"Type"}),e.jsx("select",{value:o.type||"lecture",onChange:s=>l({type:s.target.value}),className:"border border-gray-200 px-2 py-1 rounded-lg bg-white text-[13px] outline-none focus:border-indigo-400 focus:ring-2 focus:ring-indigo-100",children:O.map(s=>e.jsx("option",{value:s.id,children:t==="zh"?s.labelZh:s.labelEn},s.id))})]}),e.jsxs("div",{className:"flex flex-col gap-1",children:[e.jsx("span",{className:"text-[10px] font-semibold uppercase tracking-wide text-gray-400",children:t==="zh"?"配色":"Color"}),e.jsx("div",{className:"flex items-center gap-1.5 pt-1",children:E.map(s=>e.jsx("button",{onClick:()=>l({color:s.color}),className:`w-5 h-5 rounded-full border transition-transform hover:scale-110 ${s.color.split(" ")[0]} ${o.color===s.color?"ring-2 ring-indigo-500 ring-offset-1":""}`,title:s.name},s.name))})]})]}),e.jsxs("div",{className:"flex flex-col gap-1",children:[e.jsxs("span",{className:"text-[10px] font-semibold uppercase tracking-wide text-gray-400 flex items-center gap-1",children:[e.jsx(J,{size:12,className:"text-amber-500"}),t==="zh"?"环节备注 & 教学提示":"Instructional Notes"]}),e.jsx("textarea",{rows:2,value:o.notes||"",onChange:s=>l({notes:s.target.value}),placeholder:t==="zh"?"教学要点、学生互动提示、教学设计分配…":"Teaching points, student interaction hints…",className:"w-full border border-gray-200 px-2 py-1 rounded-lg bg-white text-[13px] outline-none focus:border-indigo-400 focus:ring-2 focus:ring-indigo-100 placeholder:text-gray-400 placeholder:italic resize-y"})]}),e.jsx("div",{className:"flex justify-end",children:e.jsxs("button",{onClick:h,className:"text-red-500 hover:text-red-700 font-semibold hover:underline flex items-center gap-1 cursor-pointer text-xs",children:[e.jsx(ne,{size:12})," ",t==="zh"?"删除此环节":"Delete segment"]})})]})}function fe({config:t,lang:o,initialData:l,onConfirm:h,onCancel:s}){const[x,n]=C.useState(()=>({...l})),b=t.icon,g=T[t.color],N=(d,u)=>{n(p=>({...p,[d]:u}))},f=Array.isArray(x.options)?x.options:[],z=(d,u)=>{n(p=>({...p,options:f.map((a,r)=>r===d?u:a)}))};return e.jsx("div",{className:"fixed inset-0 bg-gray-900/40 backdrop-blur-sm flex items-center justify-center p-6 z-50",children:e.jsxs("div",{className:"bg-white border text-gray-900 border-gray-200 rounded-2xl shadow-2xl w-full max-w-md flex flex-col overflow-hidden",children:[e.jsxs("div",{className:"p-4 border-b border-gray-100 flex items-center justify-between bg-gray-50/80",children:[e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("div",{className:`p-2 rounded-xl ${g.iconBg} ${g.iconText}`,children:e.jsx(b,{size:18})}),e.jsx("h2",{className:"font-bold text-gray-800 text-base",children:o==="zh"?`编辑:${t.labelZh}`:`Edit: ${t.labelEn}`})]}),e.jsx("button",{onClick:s,className:"text-gray-400 hover:text-gray-600 font-bold p-1 hover:bg-gray-200 rounded transition-colors text-lg",children:"×"})]}),e.jsx("div",{className:"p-5 space-y-4",children:t.editFields.length===0?e.jsx("p",{className:"text-sm text-gray-500 leading-relaxed",children:o==="zh"?"该组件无需预编辑内容,确认后即可添加到画板。":"No content to edit for this component. Confirm to add it to the board."}):t.editFields.map(d=>e.jsxs("div",{className:"space-y-1.5",children:[e.jsx("label",{className:"text-xs font-semibold text-gray-600",children:o==="zh"?d.labelZh:d.labelEn}),d.kind==="options"?e.jsx("div",{className:"grid grid-cols-2 gap-2",children:f.map((u,p)=>e.jsx("input",{value:u,onChange:a=>z(p,a.target.value),placeholder:`${String.fromCharCode(65+p)}`,className:"border border-gray-200 rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-indigo-500"},p))}):d.kind==="textarea"?e.jsx("textarea",{value:x[d.key]??"",onChange:u=>N(d.key,u.target.value),placeholder:o==="zh"?d.placeholderZh:d.placeholderEn,rows:5,className:`w-full border border-gray-200 rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-indigo-500 resize-y ${d.key==="code"||d.key==="markdown"?"font-mono text-[12px]":""}`}):e.jsx("input",{type:"text",value:x[d.key]??"",onChange:u=>N(d.key,u.target.value),placeholder:o==="zh"?d.placeholderZh:d.placeholderEn,className:"w-full border border-gray-200 rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-indigo-500"})]},d.key))}),e.jsxs("div",{className:"p-4 border-t border-gray-100 flex justify-end gap-2",children:[e.jsx("button",{onClick:s,className:"px-4 py-2 text-sm rounded-lg border border-gray-200 text-gray-600 hover:bg-gray-100 cursor-pointer",children:o==="zh"?"取消":"Cancel"}),e.jsx("button",{onClick:()=>h(x),className:"px-4 py-2 text-sm rounded-lg bg-indigo-600 text-white hover:bg-indigo-700 cursor-pointer",children:o==="zh"?"添加到画板":"Add to Board"})]})]})})}function $e({lang:t,lessons:o,selectedLesson:l,activeRole:h,setActiveRole:s,editorSaveStatus:x,setEditorSaveStatus:n,editorLastSavedTime:b,setEditorLastSavedTime:g,setIsLessonPreviewVisible:N,setPreviewLessonTab:f,setPreviewSelectedCourseware:z,setTeacherTab:d,handlePaletteActivate:u,timelineSegments:p,activeSegmentId:a,setActiveSegmentId:r,draggedSegmentIdx:i,setDraggedSegmentIdx:m,saveTimeline:j,editorPanelsExpanded:y,setEditorPanelsExpanded:$,fetchElements:k,whiteboardRef:A,elements:w,paletteEdit:D,handlePaletteConfirm:H,setPaletteEdit:L}){return e.jsxs("div",{className:"flex-1 flex flex-col min-h-0 min-w-0 bg-white rounded-2xl border border-gray-200 overflow-hidden shadow-sm",children:[e.jsxs("div",{className:"px-3.5 py-2 border-b border-slate-200/80 flex items-center justify-between shrink-0 bg-slate-50/80 backdrop-blur-xs",children:[e.jsxs("div",{className:"flex items-center gap-2.5 min-w-0",children:[e.jsxs("h3",{className:"font-bold text-slate-800 text-xs sm:text-sm flex items-center gap-2 truncate",children:[e.jsx(ie,{size:16,className:"text-indigo-600 shrink-0"}),e.jsxs("span",{className:"truncate",children:[t==="zh"?"课程编辑器: ":"Lesson Editor: ",o.find(c=>c.id===l)?.title||(t==="zh"?"未选择课程":"No Lesson Selected")]})]}),e.jsxs("div",{className:"bg-slate-200/80 p-0.5 rounded-lg flex items-center gap-0.5 border border-slate-300/60 shadow-3xs",children:[e.jsxs("button",{onClick:()=>s("teacher"),className:`px-2.5 py-1 text-[11px] font-bold rounded transition-all cursor-pointer ${h==="teacher"?"bg-white text-indigo-700 shadow-2xs font-extrabold":"text-slate-600 hover:text-slate-900"}`,children:["👨‍🏫 ",t==="zh"?"教师模式":"Teacher Mode"]}),e.jsxs("button",{onClick:()=>s("student"),className:`px-2.5 py-1 text-[11px] font-bold rounded transition-all cursor-pointer ${h==="student"?"bg-pink-600 text-white shadow-2xs font-extrabold":"text-slate-600 hover:text-slate-900"}`,children:["🎓 ",t==="zh"?"学生模式":"Student Mode"]})]}),l&&e.jsxs("div",{className:"hidden sm:flex items-center gap-1.5 shrink-0 ml-1",children:[x==="saving"&&e.jsxs("div",{className:"flex items-center gap-1 text-[10px] font-semibold text-amber-700 bg-amber-50 border border-amber-200 px-2 py-0.5 rounded-full animate-pulse",children:[e.jsx(de,{size:10,className:"animate-spin text-amber-600"}),e.jsx("span",{children:t==="zh"?"同步 SQLite...":"Saving..."})]}),x==="saved"&&e.jsxs("div",{className:"flex items-center gap-1 text-[10px] font-semibold text-emerald-700 bg-emerald-50 border border-emerald-250 px-2 py-0.5 rounded-full",children:[e.jsx(Z,{size:10,className:"text-emerald-600"}),e.jsx("span",{children:t==="zh"?"已同步 SQLite":"Saved to SQLite"}),b&&e.jsx("span",{className:"text-emerald-600/70 text-[9px] font-mono",children:b.toLocaleTimeString([],{hour:"2-digit",minute:"2-digit",second:"2-digit"})})]}),x==="error"&&e.jsxs("div",{className:"flex items-center gap-1 text-[10px] font-semibold text-rose-700 bg-rose-50 border border-rose-250 px-2 py-0.5 rounded-full",children:[e.jsx(G,{size:10,className:"text-rose-600"}),e.jsx("span",{children:t==="zh"?"写入失败":"Failed to save"})]}),x==="none"&&e.jsxs("div",{className:"flex items-center gap-1 text-[10px] font-semibold text-slate-500 bg-slate-100 border border-slate-200 px-2 py-0.5 rounded-full",children:[e.jsx(ce,{size:10,className:"text-slate-400"}),e.jsx("span",{children:t==="zh"?"SQLite 就绪":"SQLite Ready"})]})]})]}),e.jsxs("div",{className:"flex items-center gap-2 shrink-0",children:[l&&e.jsxs("button",{onClick:()=>{N(!0),f("whiteboard"),z(null)},className:"px-2.5 py-1 bg-indigo-600 hover:bg-indigo-700 text-white text-xs font-semibold rounded-lg flex items-center gap-1.5 shadow-2xs transition-all cursor-pointer",children:[e.jsx(xe,{size:13}),e.jsx("span",{children:t==="zh"?"学生视角预览":"Student View"})]}),e.jsx("button",{onClick:()=>d("courses"),className:"px-2.5 py-1 bg-slate-100 hover:bg-slate-200 text-slate-600 text-xs font-medium rounded-lg transition-colors cursor-pointer",children:t==="zh"?"返回课程库":"Back to Courses"})]})]}),e.jsxs("div",{className:"flex-1 flex overflow-hidden",children:[e.jsx(he,{lang:t,onActivate:u}),e.jsxs("div",{className:"flex-1 relative bg-white flex flex-col min-w-0 overflow-y-auto",children:[e.jsx(ue,{lang:t,segments:p,activeSegmentId:a,setActiveSegmentId:r,draggedSegmentIdx:i,setDraggedSegmentIdx:m,selectedLesson:l,saveTimeline:j,editorPanelsExpanded:y,setEditorPanelsExpanded:$}),l&&a&&y&&p.some(c=>c.id===a)&&e.jsx(ge,{lang:t,segment:p.find(c=>c.id===a),onPatch:c=>j(l,p.map(v=>v.id===a?{...v,...c}:v)),onDelete:()=>{if(p.length<=1){alert("无法删除!课程必须包含至少一个环节。");return}if(window.confirm(`确定要删除环节"${p.find(c=>c.id===a)?.title}"吗?`)){const c=p.filter(v=>v.id!==a);j(l,c),r(c[0]?.id||null)}}}),e.jsx("div",{className:"flex-1 min-h-[500px] relative flex flex-col min-w-0",children:l?e.jsxs(e.Fragment,{children:[e.jsx(V,{ref:A,lessonId:l,userRole:h,elements:w,activeSegmentId:a,onSegmentSync:c=>r(c),onElementAdd:async(c,v)=>{n("saving");try{(await fetch(`/api/lessons/${l}/whiteboard`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({type:c,data:v})})).ok?(n("saved"),g(new Date),k(l)):n("error")}catch{n("error")}},onElementUpdate:async(c,v)=>{n("saving");try{(await fetch(`/api/lessons/${l}/whiteboard/${c}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({data:v})})).ok?(n("saved"),g(new Date),k(l)):n("error")}catch{n("error")}},onElementDelete:async c=>{n("saving");try{(await fetch(`/api/lessons/${l}/whiteboard/${c}`,{method:"DELETE"})).ok?(n("saved"),g(new Date),k(l)):n("error")}catch{n("error")}},onClearBoard:async()=>{n("saving");try{(await fetch(`/api/lessons/${l}/whiteboard`,{method:"DELETE"})).ok?(n("saved"),g(new Date),k(l)):n("error")}catch{n("error")}},onRefresh:()=>k(l)}),D&&_[D.type]&&e.jsx(fe,{config:_[D.type],lang:t,initialData:D.data,onConfirm:H,onCancel:()=>L(null)})]}):e.jsx("div",{className:"absolute inset-0 flex items-center justify-center text-gray-400 p-8 text-center bg-gray-50",children:e.jsxs("div",{children:[e.jsx(pe,{size:48,className:"mx-auto mb-4 opacity-30"}),e.jsx("p",{className:"font-medium text-lg text-gray-500 mb-2",children:"No active lesson selected"}),e.jsx("p",{className:"text-sm",children:"Please select a lesson from the Dashboard to orchestrate."})]})})})]})]})]})}export{$e as LessonEditorView};
1
+ import{j as e,r as C,R as U}from"./vendor-react-0Lg0vA-4.js";import{L as V}from"./LazyWhiteboard-B6rDWBFb.js";import{C as T,P as W,b as q,c as F}from"./index-D8x6bUeG.js";import{aj as R,aq as X,ad as Y,X as G,m as Q,f as I,_ as B,b as K,z as S,P as ee,ar as te,s as re,g as O,as as se,at as ae,F as J,a7 as oe,ab as le,aa as ne,W as ie,l as de,D as ce,N as xe,a1 as pe}from"./vendor-icons-_c3xpwjZ.js";import"./vendor-pdf-CVyNPGVr.js";import"./vendor-utils-4FcTwKPj.js";import"./vendor-motion-DjY2czvL.js";import"./vendor-charts-B7ViBL9w.js";function Z({config:t,lang:o,onActivate:l,isFavorite:h=!1,onToggleFavorite:s}){const x=t.icon,n=T[t.color]||T.indigo;return e.jsxs("div",{draggable:!0,onDragStart:b=>{const g={type:t.type,...t.defaultData},N=JSON.stringify(g);b.dataTransfer.effectAllowed="copy",b.dataTransfer.setData("application/json",N),b.dataTransfer.setData("text/plain",N)},onClick:()=>l(t.type),title:o==="zh"?"点击编辑并添加到画板,或拖拽到画板":"Click to edit & add, or drag onto the board",className:`group relative bg-white border border-slate-200/80 rounded-xl p-2.5 shadow-sm transition-all duration-200 cursor-grab active:cursor-grabbing hover:shadow-md hover:-translate-y-0.5 ${n.cardHoverBorder} ${n.cardHoverRing} ${n.cardHoverShadow} flex flex-col justify-between min-h-[92px]`,children:[e.jsxs("div",{className:"flex items-center justify-between gap-1",children:[e.jsx("div",{className:`p-2 rounded-lg ${n.iconBg} ${n.iconText} transition-transform group-hover:scale-105 shrink-0`,children:e.jsx(x,{size:16})}),s&&e.jsx("button",{type:"button",onClick:b=>{b.stopPropagation(),s(t.type,b)},className:`p-1 rounded-md transition-colors ${h?"text-amber-400 opacity-100":"text-slate-300 opacity-0 group-hover:opacity-100 hover:text-amber-400 hover:bg-slate-100"}`,title:h?o==="zh"?"取消收藏":"Remove favorite":o==="zh"?"收藏组件":"Add favorite",children:e.jsx(R,{size:13,className:h?"fill-amber-400":""})})]}),e.jsxs("div",{className:"flex flex-col min-w-0 mt-1.5",children:[e.jsx("span",{className:"font-semibold text-xs text-slate-800 truncate group-hover:text-indigo-600 transition-colors",children:o==="zh"?t.labelZh:t.labelEn}),e.jsx("span",{className:"text-[10px] text-slate-400 leading-tight mt-0.5 truncate",children:o==="zh"?t.descriptionZh:t.descriptionEn})]}),e.jsx("div",{className:"absolute top-1.5 right-1.5 opacity-0 group-hover:opacity-100 transition-opacity pointer-events-none",children:e.jsx("span",{className:"text-[9px] font-bold text-indigo-500 bg-indigo-50 px-1 py-0.5 rounded border border-indigo-100",children:"+ Drag"})})]})}function he({lang:t,onActivate:o}){const[l,h]=C.useState(""),[s,x]=C.useState("all"),[n,b]=C.useState(()=>{try{const r=localStorage.getItem("openlearn_palette_favs");return r?JSON.parse(r):[]}catch{return[]}}),[g,N]=C.useState(()=>{try{const r=localStorage.getItem("openlearn_palette_recent");return r?JSON.parse(r):[]}catch{return[]}}),[f,z]=C.useState({}),d=r=>{N(i=>{const m=[r,...i.filter(j=>j!==r)].slice(0,6);try{localStorage.setItem("openlearn_palette_recent",JSON.stringify(m))}catch{}return m}),o(r)},u=(r,i)=>{i.stopPropagation(),b(m=>{const y=m.includes(r)?m.filter($=>$!==r):[...m,r];try{localStorage.setItem("openlearn_palette_favs",JSON.stringify(y))}catch{}return y})},p=r=>{z(i=>({...i,[r]:!i[r]}))},a=W.filter(r=>{if(l.trim()){const i=l.toLowerCase(),m=r.labelZh.toLowerCase().includes(i)||r.descriptionZh.toLowerCase().includes(i),j=r.labelEn.toLowerCase().includes(i)||r.descriptionEn.toLowerCase().includes(i);if(!m&&!j)return!1}return s==="favorites"?n.includes(r.type):s==="recent"?g.includes(r.type):!0});return e.jsxs("div",{className:"w-[240px] shrink-0 border-r border-slate-200/80 bg-slate-50/90 p-3 overflow-y-auto flex flex-col gap-3 font-sans select-none",children:[e.jsxs("div",{children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("h3",{className:"flex items-center gap-1.5 text-xs font-bold text-slate-800 uppercase tracking-wider",children:[e.jsx(X,{size:15,className:"text-indigo-600"}),t==="zh"?"备课画板组件":"Components"]}),e.jsx("span",{className:"text-[10px] font-semibold text-slate-400 bg-slate-200/60 px-1.5 py-0.5 rounded-full",children:a.length})]}),e.jsx("p",{className:"text-[10px] text-slate-400 leading-tight mt-0.5",children:t==="zh"?"拖拽到右侧白板,或点击配置添加到画板。":"Drag to whiteboard or click to configure."})]}),e.jsxs("div",{className:"relative",children:[e.jsx(Y,{size:13,className:"absolute left-2.5 top-1/2 -translate-y-1/2 text-slate-400"}),e.jsx("input",{type:"text",value:l,onChange:r=>h(r.target.value),placeholder:t==="zh"?"搜索画板组件...":"Search components...",className:"w-full pl-8 pr-7 py-1.5 bg-white border border-slate-200 rounded-lg text-xs text-slate-700 placeholder-slate-400 focus:outline-none focus:ring-1 focus:ring-indigo-500 focus:border-indigo-500 transition-all shadow-2xs"}),l&&e.jsx("button",{onClick:()=>h(""),className:"absolute right-2 top-1/2 -translate-y-1/2 text-slate-400 hover:text-slate-600",children:e.jsx(G,{size:12})})]}),e.jsxs("div",{className:"flex items-center gap-1 bg-slate-200/50 p-1 rounded-lg",children:[e.jsx("button",{onClick:()=>x("all"),className:`flex-1 py-1 text-[11px] font-medium rounded-md transition-all ${s==="all"?"bg-white text-slate-800 shadow-2xs font-bold":"text-slate-500 hover:text-slate-800"}`,children:t==="zh"?"全部":"All"}),e.jsxs("button",{onClick:()=>x("favorites"),className:`flex-1 py-1 text-[11px] font-medium rounded-md transition-all flex items-center justify-center gap-1 ${s==="favorites"?"bg-white text-amber-600 shadow-2xs font-bold":"text-slate-500 hover:text-amber-600"}`,children:[e.jsx(R,{size:11,className:s==="favorites"?"fill-amber-500":""}),e.jsx("span",{children:t==="zh"?"收藏":"Favs"})]}),e.jsxs("button",{onClick:()=>x("recent"),className:`flex-1 py-1 text-[11px] font-medium rounded-md transition-all flex items-center justify-center gap-1 ${s==="recent"?"bg-white text-indigo-600 shadow-2xs font-bold":"text-slate-500 hover:text-indigo-600"}`,children:[e.jsx(Q,{size:11}),e.jsx("span",{children:t==="zh"?"最近":"Recent"})]})]}),e.jsx("div",{className:"flex-1 flex flex-col gap-3 overflow-y-auto pr-0.5",children:a.length===0?e.jsxs("div",{className:"text-center py-8 text-slate-400 text-xs",children:[e.jsx(I,{size:24,className:"mx-auto mb-2 opacity-30 text-indigo-500"}),e.jsx("p",{className:"font-medium text-slate-500",children:t==="zh"?"未找到相关组件":"No components found"}),e.jsx("p",{className:"text-[10px] mt-1 text-slate-400",children:s!=="all"?t==="zh"?"尝试切换到全部组件":"Try switching to All tab":t==="zh"?"更换搜索关键词":"Try a different search term"})]}):s!=="all"||l.trim()?e.jsx("div",{className:"grid grid-cols-2 gap-2",children:a.map(r=>e.jsx(Z,{config:r,lang:t,onActivate:d,isFavorite:n.includes(r.type),onToggleFavorite:u},r.type))}):q.map(r=>{const i=a.filter(y=>y.group===r.id);if(i.length===0)return null;const m=T[i[0].color]||T.indigo,j=f[r.id];return e.jsxs("div",{className:"flex flex-col gap-1.5",children:[e.jsxs("button",{type:"button",onClick:()=>p(r.id),className:"flex items-center justify-between px-1 py-0.5 text-left group/grp cursor-pointer hover:bg-slate-200/40 rounded transition-colors",children:[e.jsxs("div",{className:"flex items-center gap-1.5",children:[e.jsx("span",{className:`w-1.5 h-1.5 rounded-full ${m.groupAccent}`}),e.jsx("span",{className:`text-[10px] font-bold uppercase tracking-wider ${m.groupText}`,children:t==="zh"?r.labelZh:r.labelEn})]}),e.jsxs("div",{className:"flex items-center gap-1 text-slate-400 group-hover/grp:text-slate-600",children:[e.jsxs("span",{className:"text-[9px] font-mono font-medium opacity-70",children:["(",i.length,")"]}),j?e.jsx(B,{size:12}):e.jsx(K,{size:12})]})]}),!j&&e.jsx("div",{className:"grid grid-cols-2 gap-2",children:i.map(y=>e.jsx(Z,{config:y,lang:t,onActivate:d,isFavorite:n.includes(y.type),onToggleFavorite:u},y.type))})]},r.id)})})]})}const _=[{id:"intro",labelZh:"准备环节",labelEn:"Intro",icon:S},{id:"lecture",labelZh:"讲授新课",labelEn:"Lecture",icon:ee},{id:"practice",labelZh:"互动练习",labelEn:"Practice",icon:te},{id:"quiz",labelZh:"随堂测试",labelEn:"Quiz",icon:re},{id:"summary",labelZh:"要点总结",labelEn:"Summary",icon:O}],E=[{name:"Blue",color:"bg-blue-50 text-blue-700 border-blue-200 hover:bg-blue-100",solid:"bg-blue-500 text-white border-blue-500 shadow-md ring-2 ring-blue-200",rail:"bg-blue-400"},{name:"Indigo",color:"bg-indigo-50 text-indigo-700 border-indigo-200 hover:bg-indigo-100",solid:"bg-indigo-500 text-white border-indigo-500 shadow-md ring-2 ring-indigo-200",rail:"bg-indigo-400"},{name:"Green",color:"bg-green-50 text-green-700 border-green-200 hover:bg-green-100",solid:"bg-green-500 text-white border-green-500 shadow-md ring-2 ring-green-200",rail:"bg-green-400"},{name:"Purple",color:"bg-purple-50 text-purple-700 border-purple-200 hover:bg-purple-100",solid:"bg-purple-500 text-white border-purple-500 shadow-md ring-2 ring-purple-200",rail:"bg-purple-400"},{name:"Amber",color:"bg-amber-50 text-amber-700 border-amber-200 hover:bg-amber-100",solid:"bg-amber-500 text-white border-amber-500 shadow-md ring-2 ring-amber-200",rail:"bg-amber-400"}],me=E[1].color;function be(t){return _.find(o=>o.id===t)||_[1]}function M(t){return E.find(o=>o.color===t)||E[1]}function ue({lang:t,segments:o,activeSegmentId:l,setActiveSegmentId:h,draggedSegmentIdx:s,setDraggedSegmentIdx:x,selectedLesson:n,saveTimeline:b,editorPanelsExpanded:g,setEditorPanelsExpanded:N}){const f=o.findIndex(a=>a.id===l),z=o.length>1&&f>=0?f/(o.length-1):0,d=f>=0?M(o[f].color):null,u=a=>{if(s===null||s===a){x(null);return}const r=[...o],[i]=r.splice(s,1);r.splice(a,0,i),x(null),n&&b(n,r)},p=()=>{if(!n)return;const a="seg-"+Math.random().toString(36).slice(2,9),r={id:a,title:t==="zh"?`新环节 ${o.length+1}`:`Segment ${o.length+1}`,notes:"",type:"lecture",duration:"10m",color:me};b(n,[...o,r]),h(a)};return e.jsxs("div",{className:"relative flex items-center gap-3 px-3 py-1.5 border-b border-slate-200/80 bg-slate-50/70 shrink-0 overflow-x-auto select-none",children:[e.jsxs("div",{className:"flex items-center gap-1.5 shrink-0 pl-1 border-r border-slate-200/80 pr-2.5",children:[e.jsx(se,{size:15,className:"text-indigo-600 shrink-0"}),e.jsx("span",{className:"text-xs font-extrabold uppercase tracking-wider text-slate-600 whitespace-nowrap",children:t==="zh"?"教学流程":"Lesson Flow"})]}),e.jsxs("div",{className:"relative flex items-center gap-1.5 py-0.5 min-w-0 flex-1",children:[e.jsx("div",{className:"absolute left-2 right-2 top-1/2 h-0.5 -translate-y-1/2 bg-slate-200 rounded-full"}),f>=0&&e.jsx("div",{className:`absolute left-2 top-1/2 h-0.5 -translate-y-1/2 rounded-full transition-all duration-300 ${d?.rail||"bg-indigo-500"}`,style:{width:`calc(${z*100}% - 0.5rem)`}}),o.map((a,r)=>{const i=a.id===l,m=f>=0&&r<f,j=s===r,y=be(a.type),$=M(a.color),k=y.icon,A=i?$.solid+" shadow-md shadow-indigo-500/20 ring-2 ring-indigo-400/30":m?"bg-slate-100 border-slate-300 text-slate-700 hover:bg-slate-200/80":`${a.color} hover:shadow-sm hover:brightness-105`;return e.jsxs(U.Fragment,{children:[e.jsxs("button",{draggable:!0,onDragStart:w=>{x(r),w.dataTransfer.effectAllowed="move",w.dataTransfer.setData("text/plain",r.toString())},onDragOver:w=>w.preventDefault(),onDrop:w=>{w.preventDefault(),u(r)},onClick:()=>h(a.id),title:`${a.title} · ${a.duration}${a.notes?" · 📝":""}`+(t==="zh"?"(点击编辑 / 拖拽排序)":" (click to edit / drag to reorder)"),className:`relative z-10 group flex items-center gap-1.5 pl-1.5 pr-2.5 py-1 rounded-full border text-xs font-semibold cursor-grab active:cursor-grabbing transition-all duration-200 ${j?"opacity-40 border-dashed scale-95":""} ${A}`,children:[e.jsx(ae,{size:11,className:`opacity-0 group-hover:opacity-60 transition-opacity -mr-1 ${i?"text-white":"text-slate-400"}`}),e.jsx("span",{className:`flex items-center justify-center w-4 h-4 rounded-full text-[10px] font-bold shrink-0 ${i?"bg-white/25 text-white":m?"bg-emerald-500 text-white":"bg-white text-slate-600 border border-slate-200"}`,children:m?e.jsx(O,{size:11}):r+1}),e.jsx(k,{size:13,className:"shrink-0"}),e.jsx("span",{className:"max-w-[110px] truncate font-medium",children:a.title}),a.duration&&e.jsxs("span",{className:`text-[10px] px-1 py-0.2 rounded font-mono font-normal flex items-center gap-0.5 ${i?"bg-black/20 text-white":"bg-black/5 text-slate-500"}`,children:[e.jsx(Q,{size:9}),a.duration]}),a.notes&&e.jsx(J,{size:10,className:`shrink-0 ${i?"text-white/90":"text-amber-500"}`}),i&&e.jsxs("span",{className:"flex items-center gap-1 ml-0.5 pl-1.5 border-l border-white/30 text-[10px] font-extrabold uppercase tracking-wide shrink-0",children:[e.jsx("span",{className:"w-1.5 h-1.5 rounded-full bg-white animate-pulse"}),t==="zh"?"进行中":"LIVE"]})]}),r<o.length-1&&e.jsx(B,{size:12,className:"text-slate-300 shrink-0 z-10"})]},a.id)}),n&&e.jsxs("button",{onClick:p,className:"relative z-10 shrink-0 ml-1 px-2.5 py-1 rounded-full border border-dashed border-slate-300 text-xs font-semibold text-slate-500 hover:border-indigo-400 hover:text-indigo-600 hover:bg-indigo-50/50 transition-all flex items-center gap-1 cursor-pointer shadow-2xs",title:t==="zh"?"新增教学环节":"Add flow segment",children:[e.jsx(oe,{size:13}),e.jsx("span",{className:"text-[11px]",children:t==="zh"?"添加环节":"Add Step"})]})]}),e.jsxs("button",{onClick:()=>N(a=>!a),className:"ml-auto shrink-0 px-2.5 py-1 bg-white hover:bg-slate-100 border border-slate-200 text-slate-700 text-xs font-semibold rounded-lg shadow-2xs transition-all cursor-pointer flex items-center gap-1.5",children:[e.jsx(le,{size:13,className:g?"text-indigo-600":"text-slate-400"}),e.jsx("span",{children:g?t==="zh"?"隐藏环节编辑":"Hide Details":t==="zh"?"展开环节编辑":"Edit Step"})]})]})}function ge({lang:t,segment:o,onPatch:l,onDelete:h}){return e.jsxs("div",{className:"flex flex-col gap-2 p-2 bg-slate-50/80 border-b border-gray-100 shrink-0",children:[e.jsxs("div",{className:"flex items-center gap-1.5",children:[e.jsx("span",{className:"w-1.5 h-1.5 rounded-full bg-indigo-500"}),e.jsx("span",{className:"text-xs font-bold text-gray-700",children:t==="zh"?`环节设置:${o.title}`:`Segment: ${o.title}`})]}),e.jsxs("div",{className:"grid grid-cols-2 sm:grid-cols-4 gap-2",children:[e.jsxs("label",{className:"flex flex-col gap-1",children:[e.jsx("span",{className:"text-[10px] font-semibold uppercase tracking-wide text-gray-400",children:t==="zh"?"名称":"Title"}),e.jsx("input",{type:"text",value:o.title||"",onChange:s=>l({title:s.target.value}),className:"border border-gray-200 px-2 py-1 rounded-lg bg-white text-[13px] outline-none focus:border-indigo-400 focus:ring-2 focus:ring-indigo-100"})]}),e.jsxs("label",{className:"flex flex-col gap-1",children:[e.jsx("span",{className:"text-[10px] font-semibold uppercase tracking-wide text-gray-400",children:t==="zh"?"时长":"Duration"}),e.jsx("input",{type:"text",value:o.duration||"10m",onChange:s=>l({duration:s.target.value}),className:"border border-gray-200 px-2 py-1 rounded-lg bg-white text-[13px] outline-none focus:border-indigo-400 focus:ring-2 focus:ring-indigo-100"})]}),e.jsxs("label",{className:"flex flex-col gap-1",children:[e.jsx("span",{className:"text-[10px] font-semibold uppercase tracking-wide text-gray-400",children:t==="zh"?"类型":"Type"}),e.jsx("select",{value:o.type||"lecture",onChange:s=>l({type:s.target.value}),className:"border border-gray-200 px-2 py-1 rounded-lg bg-white text-[13px] outline-none focus:border-indigo-400 focus:ring-2 focus:ring-indigo-100",children:_.map(s=>e.jsx("option",{value:s.id,children:t==="zh"?s.labelZh:s.labelEn},s.id))})]}),e.jsxs("div",{className:"flex flex-col gap-1",children:[e.jsx("span",{className:"text-[10px] font-semibold uppercase tracking-wide text-gray-400",children:t==="zh"?"配色":"Color"}),e.jsx("div",{className:"flex items-center gap-1.5 pt-1",children:E.map(s=>e.jsx("button",{onClick:()=>l({color:s.color}),className:`w-5 h-5 rounded-full border transition-transform hover:scale-110 ${s.color.split(" ")[0]} ${o.color===s.color?"ring-2 ring-indigo-500 ring-offset-1":""}`,title:s.name},s.name))})]})]}),e.jsxs("div",{className:"flex flex-col gap-1",children:[e.jsxs("span",{className:"text-[10px] font-semibold uppercase tracking-wide text-gray-400 flex items-center gap-1",children:[e.jsx(J,{size:12,className:"text-amber-500"}),t==="zh"?"环节备注 & 教学提示":"Instructional Notes"]}),e.jsx("textarea",{rows:2,value:o.notes||"",onChange:s=>l({notes:s.target.value}),placeholder:t==="zh"?"教学要点、学生互动提示、教学设计分配…":"Teaching points, student interaction hints…",className:"w-full border border-gray-200 px-2 py-1 rounded-lg bg-white text-[13px] outline-none focus:border-indigo-400 focus:ring-2 focus:ring-indigo-100 placeholder:text-gray-400 placeholder:italic resize-y"})]}),e.jsx("div",{className:"flex justify-end",children:e.jsxs("button",{onClick:h,className:"text-red-500 hover:text-red-700 font-semibold hover:underline flex items-center gap-1 cursor-pointer text-xs",children:[e.jsx(ne,{size:12})," ",t==="zh"?"删除此环节":"Delete segment"]})})]})}function fe({config:t,lang:o,initialData:l,onConfirm:h,onCancel:s}){const[x,n]=C.useState(()=>({...l})),b=t.icon,g=T[t.color],N=(d,u)=>{n(p=>({...p,[d]:u}))},f=Array.isArray(x.options)?x.options:[],z=(d,u)=>{n(p=>({...p,options:f.map((a,r)=>r===d?u:a)}))};return e.jsx("div",{className:"fixed inset-0 bg-gray-900/40 backdrop-blur-sm flex items-center justify-center p-6 z-50",children:e.jsxs("div",{className:"bg-white border text-gray-900 border-gray-200 rounded-2xl shadow-2xl w-full max-w-md flex flex-col overflow-hidden",children:[e.jsxs("div",{className:"p-4 border-b border-gray-100 flex items-center justify-between bg-gray-50/80",children:[e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("div",{className:`p-2 rounded-xl ${g.iconBg} ${g.iconText}`,children:e.jsx(b,{size:18})}),e.jsx("h2",{className:"font-bold text-gray-800 text-base",children:o==="zh"?`编辑:${t.labelZh}`:`Edit: ${t.labelEn}`})]}),e.jsx("button",{onClick:s,className:"text-gray-400 hover:text-gray-600 font-bold p-1 hover:bg-gray-200 rounded transition-colors text-lg",children:"×"})]}),e.jsx("div",{className:"p-5 space-y-4",children:t.editFields.length===0?e.jsx("p",{className:"text-sm text-gray-500 leading-relaxed",children:o==="zh"?"该组件无需预编辑内容,确认后即可添加到画板。":"No content to edit for this component. Confirm to add it to the board."}):t.editFields.map(d=>e.jsxs("div",{className:"space-y-1.5",children:[e.jsx("label",{className:"text-xs font-semibold text-gray-600",children:o==="zh"?d.labelZh:d.labelEn}),d.kind==="options"?e.jsx("div",{className:"grid grid-cols-2 gap-2",children:f.map((u,p)=>e.jsx("input",{value:u,onChange:a=>z(p,a.target.value),placeholder:`${String.fromCharCode(65+p)}`,className:"border border-gray-200 rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-indigo-500"},p))}):d.kind==="textarea"?e.jsx("textarea",{value:x[d.key]??"",onChange:u=>N(d.key,u.target.value),placeholder:o==="zh"?d.placeholderZh:d.placeholderEn,rows:5,className:`w-full border border-gray-200 rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-indigo-500 resize-y ${d.key==="code"||d.key==="markdown"?"font-mono text-[12px]":""}`}):e.jsx("input",{type:"text",value:x[d.key]??"",onChange:u=>N(d.key,u.target.value),placeholder:o==="zh"?d.placeholderZh:d.placeholderEn,className:"w-full border border-gray-200 rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-indigo-500"})]},d.key))}),e.jsxs("div",{className:"p-4 border-t border-gray-100 flex justify-end gap-2",children:[e.jsx("button",{onClick:s,className:"px-4 py-2 text-sm rounded-lg border border-gray-200 text-gray-600 hover:bg-gray-100 cursor-pointer",children:o==="zh"?"取消":"Cancel"}),e.jsx("button",{onClick:()=>h(x),className:"px-4 py-2 text-sm rounded-lg bg-indigo-600 text-white hover:bg-indigo-700 cursor-pointer",children:o==="zh"?"添加到画板":"Add to Board"})]})]})})}function $e({lang:t,lessons:o,selectedLesson:l,activeRole:h,setActiveRole:s,editorSaveStatus:x,setEditorSaveStatus:n,editorLastSavedTime:b,setEditorLastSavedTime:g,setIsLessonPreviewVisible:N,setPreviewLessonTab:f,setPreviewSelectedCourseware:z,setTeacherTab:d,handlePaletteActivate:u,timelineSegments:p,activeSegmentId:a,setActiveSegmentId:r,draggedSegmentIdx:i,setDraggedSegmentIdx:m,saveTimeline:j,editorPanelsExpanded:y,setEditorPanelsExpanded:$,fetchElements:k,whiteboardRef:A,elements:w,paletteEdit:D,handlePaletteConfirm:H,setPaletteEdit:L}){return e.jsxs("div",{className:"flex-1 flex flex-col min-h-0 min-w-0 bg-white rounded-2xl border border-gray-200 overflow-hidden shadow-sm",children:[e.jsxs("div",{className:"px-3.5 py-2 border-b border-slate-200/80 flex items-center justify-between shrink-0 bg-slate-50/80 backdrop-blur-xs",children:[e.jsxs("div",{className:"flex items-center gap-2.5 min-w-0",children:[e.jsxs("h3",{className:"font-bold text-slate-800 text-xs sm:text-sm flex items-center gap-2 truncate",children:[e.jsx(ie,{size:16,className:"text-indigo-600 shrink-0"}),e.jsxs("span",{className:"truncate",children:[t==="zh"?"课程编辑器: ":"Lesson Editor: ",o.find(c=>c.id===l)?.title||(t==="zh"?"未选择课程":"No Lesson Selected")]})]}),e.jsxs("div",{className:"bg-slate-200/80 p-0.5 rounded-lg flex items-center gap-0.5 border border-slate-300/60 shadow-3xs",children:[e.jsxs("button",{onClick:()=>s("teacher"),className:`px-2.5 py-1 text-[11px] font-bold rounded transition-all cursor-pointer ${h==="teacher"?"bg-white text-indigo-700 shadow-2xs font-extrabold":"text-slate-600 hover:text-slate-900"}`,children:["👨‍🏫 ",t==="zh"?"教师模式":"Teacher Mode"]}),e.jsxs("button",{onClick:()=>s("student"),className:`px-2.5 py-1 text-[11px] font-bold rounded transition-all cursor-pointer ${h==="student"?"bg-pink-600 text-white shadow-2xs font-extrabold":"text-slate-600 hover:text-slate-900"}`,children:["🎓 ",t==="zh"?"学生模式":"Student Mode"]})]}),l&&e.jsxs("div",{className:"hidden sm:flex items-center gap-1.5 shrink-0 ml-1",children:[x==="saving"&&e.jsxs("div",{className:"flex items-center gap-1 text-[10px] font-semibold text-amber-700 bg-amber-50 border border-amber-200 px-2 py-0.5 rounded-full animate-pulse",children:[e.jsx(de,{size:10,className:"animate-spin text-amber-600"}),e.jsx("span",{children:t==="zh"?"同步 SQLite...":"Saving..."})]}),x==="saved"&&e.jsxs("div",{className:"flex items-center gap-1 text-[10px] font-semibold text-emerald-700 bg-emerald-50 border border-emerald-250 px-2 py-0.5 rounded-full",children:[e.jsx(O,{size:10,className:"text-emerald-600"}),e.jsx("span",{children:t==="zh"?"已同步 SQLite":"Saved to SQLite"}),b&&e.jsx("span",{className:"text-emerald-600/70 text-[9px] font-mono",children:b.toLocaleTimeString([],{hour:"2-digit",minute:"2-digit",second:"2-digit"})})]}),x==="error"&&e.jsxs("div",{className:"flex items-center gap-1 text-[10px] font-semibold text-rose-700 bg-rose-50 border border-rose-250 px-2 py-0.5 rounded-full",children:[e.jsx(G,{size:10,className:"text-rose-600"}),e.jsx("span",{children:t==="zh"?"写入失败":"Failed to save"})]}),x==="none"&&e.jsxs("div",{className:"flex items-center gap-1 text-[10px] font-semibold text-slate-500 bg-slate-100 border border-slate-200 px-2 py-0.5 rounded-full",children:[e.jsx(ce,{size:10,className:"text-slate-400"}),e.jsx("span",{children:t==="zh"?"SQLite 就绪":"SQLite Ready"})]})]})]}),e.jsxs("div",{className:"flex items-center gap-2 shrink-0",children:[l&&e.jsxs("button",{onClick:()=>{N(!0),f("whiteboard"),z(null)},className:"px-2.5 py-1 bg-indigo-600 hover:bg-indigo-700 text-white text-xs font-semibold rounded-lg flex items-center gap-1.5 shadow-2xs transition-all cursor-pointer",children:[e.jsx(xe,{size:13}),e.jsx("span",{children:t==="zh"?"学生视角预览":"Student View"})]}),e.jsx("button",{onClick:()=>d("courses"),className:"px-2.5 py-1 bg-slate-100 hover:bg-slate-200 text-slate-600 text-xs font-medium rounded-lg transition-colors cursor-pointer",children:t==="zh"?"返回课程库":"Back to Courses"})]})]}),e.jsxs("div",{className:"flex-1 flex overflow-hidden",children:[e.jsx(he,{lang:t,onActivate:u}),e.jsxs("div",{className:"flex-1 relative bg-white flex flex-col min-w-0 overflow-y-auto",children:[e.jsx(ue,{lang:t,segments:p,activeSegmentId:a,setActiveSegmentId:r,draggedSegmentIdx:i,setDraggedSegmentIdx:m,selectedLesson:l,saveTimeline:j,editorPanelsExpanded:y,setEditorPanelsExpanded:$}),l&&a&&y&&p.some(c=>c.id===a)&&e.jsx(ge,{lang:t,segment:p.find(c=>c.id===a),onPatch:c=>j(l,p.map(v=>v.id===a?{...v,...c}:v)),onDelete:()=>{if(p.length<=1){alert("无法删除!课程必须包含至少一个环节。");return}if(window.confirm(`确定要删除环节"${p.find(c=>c.id===a)?.title}"吗?`)){const c=p.filter(v=>v.id!==a);j(l,c),r(c[0]?.id||null)}}}),e.jsx("div",{className:"flex-1 min-h-[500px] relative flex flex-col min-w-0",children:l?e.jsxs(e.Fragment,{children:[e.jsx(V,{ref:A,lessonId:l,userRole:h,elements:w,activeSegmentId:a,onSegmentSync:c=>r(c),onElementAdd:async(c,v)=>{n("saving");try{(await fetch(`/api/lessons/${l}/whiteboard`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({type:c,data:v})})).ok?(n("saved"),g(new Date),k(l)):n("error")}catch{n("error")}},onElementUpdate:async(c,v)=>{n("saving");try{(await fetch(`/api/lessons/${l}/whiteboard/${c}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({data:v})})).ok?(n("saved"),g(new Date),k(l)):n("error")}catch{n("error")}},onElementDelete:async c=>{n("saving");try{(await fetch(`/api/lessons/${l}/whiteboard/${c}`,{method:"DELETE"})).ok?(n("saved"),g(new Date),k(l)):n("error")}catch{n("error")}},onClearBoard:async()=>{n("saving");try{(await fetch(`/api/lessons/${l}/whiteboard`,{method:"DELETE"})).ok?(n("saved"),g(new Date),k(l)):n("error")}catch{n("error")}},onRefresh:()=>k(l)}),D&&F[D.type]&&e.jsx(fe,{config:F[D.type],lang:t,initialData:D.data,onConfirm:H,onCancel:()=>L(null)})]}):e.jsx("div",{className:"absolute inset-0 flex items-center justify-center text-gray-400 p-8 text-center bg-gray-50",children:e.jsxs("div",{children:[e.jsx(pe,{size:48,className:"mx-auto mb-4 opacity-30"}),e.jsx("p",{className:"font-medium text-lg text-gray-500 mb-2",children:"No active lesson selected"}),e.jsx("p",{className:"text-sm",children:"Please select a lesson from the Dashboard to orchestrate."})]})})})]})]})]})}export{$e as LessonEditorView};
@@ -1 +1 @@
1
- import{r as c,j as e,R as Xe}from"./vendor-react-0Lg0vA-4.js";import{ae as X,N as Ee,ab as Ye,C as Ze,ai as et,F as we,au as tt,U as st,ap as rt,b as at,D as Me,av as it,ao as Ae,ag as Pe,S as De,a2 as nt,m as lt,n as ot,o as dt,aw as ct,P as Te,Z as xt,i as Ne,k as Ce,ad as mt,J as ht,x as pt,af as ft,s as ut,I as gt}from"./vendor-icons-BvCtGbt1.js";import{L as bt}from"./LazyWhiteboard-CJA7aRIM.js";import{l as jt,r as Nt}from"./index-eXp-qZdm.js";import"./vendor-pdf-CVyNPGVr.js";import"./vendor-utils-4FcTwKPj.js";import"./vendor-motion-Dz5URUo4.js";import"./vendor-charts-B7ViBL9w.js";function wt({lessonId:d,lang:L,addToast:T}){const[oe,N]=c.useState(!1),[Y,s]=c.useState(!1),[w,M]=c.useState([]),[A,f]=c.useState(60),[U,S]=c.useState(40),[$,_]=c.useState({}),[R,Z]=c.useState({}),[y,V]=c.useState({}),[q,I]=c.useState({}),[C,G]=c.useState({}),[g,O]=c.useState({}),o=L==="zh",F=async(a=!1)=>{a?s(!0):N(!0);try{const h=await(await fetch(`/api/lessons/${d}/eval-grades`)).json();if(Array.isArray(h)){M(h);const u={},v={},b={},j={};h.forEach(n=>{n.grade?(u[n.id]=n.grade.teacher_score,v[n.id]=n.grade.teacher_comment,b[n.id]=Math.round(n.grade.teacher_weight*100),j[n.id]=Math.round(n.grade.peer_weight*100)):(u[n.id]=$[n.id]!==void 0?$[n.id]:80,v[n.id]=R[n.id]!==void 0?R[n.id]:"",b[n.id]=y[n.id]!==void 0?y[n.id]:A,j[n.id]=q[n.id]!==void 0?q[n.id]:U)}),_(n=>({...u,...n})),Z(n=>({...v,...n})),V(n=>({...b,...n})),I(n=>({...j,...n}))}else throw new Error("Invalid submissions data format")}catch(m){console.error("Error fetching submissions grades:",m),T(o?"数据加载失败":"Failed to Load Data",o?"请检查网络连接或刷新页面。":"Please check your connection and try again.","warning")}finally{N(!1),s(!1)}};c.useEffect(()=>{d&&F()},[d]);const ee=a=>{f(a),S(100-a),V(m=>{const h={...m};return w.forEach(u=>{(!u.grade||u.grade.status!=="confirmed")&&(h[u.id]=a)}),h}),I(m=>{const h={...m};return w.forEach(u=>{(!u.grade||u.grade.status!=="confirmed")&&(h[u.id]=100-a)}),h})},te=(a,m)=>{V(h=>({...h,[a]:m})),I(h=>({...h,[a]:100-m}))},Q=async(a,m)=>{const h=$[a],u=R[a]||"",v=(y[a]??A)/100,b=(q[a]??U)/100;if(h===void 0||isNaN(h)||h<0||h>100){T(o?"评分无效":"Invalid Score",o?"教师评分必须在 0 到 100 之间!":"Teacher score must be between 0 and 100!","warning");return}if(m==="confirmed"){const j=o?"确认同步后,最终得分将直接同步写入宿主学期成绩库,此后该学生的作业成绩将锁定不可修改。是否确认?":"Once confirmed, the final score will be synced to the host semester reports and locked. Proceed?";if(!window.confirm(j))return}O(j=>({...j,[a]:m}));try{const n=await(await fetch("/api/commands",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({commandType:"assignment.grade",payload:{submissionId:a,teacherScore:Number(h),teacherComment:u,teacherWeight:v,peerWeight:b,status:m}})})).json();if(n.success)T(m==="confirmed"?o?"平时成绩同步成功":"Semester Grade Synced":o?"平时成绩草稿已保存":"Grade Draft Saved",m==="confirmed"?o?`已将平时成绩 ${n.result.calculatedFinalScore} 分同步至学期报告!`:`Successfully synced grade ${n.result.calculatedFinalScore}!`:o?"成功保存了教师打分与评语草稿。":"Successfully saved score and comment draft.","success"),F(!0);else throw new Error(n.error||"Failed to submit grade")}catch(j){T(o?"操作失败":"Operation Failed",j.message,"warning")}finally{O(j=>({...j,[a]:null}))}},K=a=>{G(m=>({...m,[a]:!m[a]}))};return oe?e.jsxs("div",{className:"flex-grow flex flex-col items-center justify-center py-12 text-gray-500",children:[e.jsx(X,{className:"animate-spin text-indigo-500 mb-2",size:32}),e.jsx("p",{className:"text-xs",children:o?"正在读取学生作业与成绩状态...":"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(Ee,{size:16,className:"text-indigo-655"}),o?"学生作业成绩评定与折算系统":"Student Assignment Grading & Sync"]}),e.jsxs("span",{className:"text-[9px] bg-indigo-50 text-indigo-750 px-2 py-0.5 rounded-full border border-indigo-100 font-bold",children:[w.length," ",o?"个提交":"submissions"]})]}),e.jsx("button",{onClick:()=>F(!0),disabled:Y,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:o?"刷新数据":"Refresh",children:e.jsx(X,{size:12,className:Y?"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(Ye,{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:o?"全局默认折算权重设置":"Default Grading Weights Configuration"}),e.jsx("p",{className:"text-[10px] text-slate-400 mt-0.5 font-medium",children:o?"调整权重分配,所有尚未锁定成绩的学生将自动应用此默认权重比例。":"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-[11px] font-bold text-slate-500",children:o?"教师评分:":"Teacher:"}),e.jsx("input",{type:"range",min:"0",max:"100",step:"5",value:A,onChange:a=>ee(Number(a.target.value)),className:"w-20 accent-indigo-650 cursor-pointer"}),e.jsxs("span",{className:"text-xs font-bold text-indigo-700 w-8 text-right",children:[A,"%"]})]}),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-[11px] font-bold text-slate-500",children:o?"学生互评:":"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:w.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(Ze,{size:32,className:"text-slate-350"}),e.jsx("p",{className:"text-xs",children:o?"本节课目前没有任何学生提交作业。":"No students have submitted assignments yet for this lesson."})]}):w.map(a=>{const m=$[a.id]!==void 0?$[a.id]:80,h=R[a.id]||"",u=y[a.id]??A,v=q[a.id]??U,b=a.grade?.status==="confirmed",j=Math.round(m*(u/100)+a.peerAverageScore*(v/100));return e.jsxs("div",{className:`bg-white border rounded-xl shadow-3xs overflow-hidden transition-all ${b?"border-emerald-200 bg-emerald-50/5":"border-slate-200"}`,children:[e.jsxs("div",{className:"px-4 py-3 bg-slate-50/50 border-b border-slate-100 flex flex-col md:flex-row md:items-center justify-between gap-3",children:[e.jsxs("div",{className:"flex items-center gap-2.5",children:[e.jsx("div",{className:"w-8 h-8 rounded-full bg-indigo-50 border border-indigo-100 flex items-center justify-center text-indigo-700 font-bold text-xs select-none",children:a.studentName?.charAt(0)||"S"}),e.jsxs("div",{children:[e.jsx("div",{className:"text-xs font-bold text-slate-800",children:a.studentName}),e.jsxs("div",{className:"text-[9px] text-slate-400 font-mono mt-0.5 flex items-center gap-1.5",children:[e.jsxs("span",{children:["V",a.version]}),e.jsx("span",{children:"•"}),e.jsx("span",{children:new Date(a.updatedAt).toLocaleString()})]})]})]}),e.jsxs("div",{className:"flex items-center gap-2",children:[b?e.jsxs("span",{className:"bg-emerald-55 text-emerald-700 text-[10px] 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(et,{size:12}),o?"成绩已同步":"Synced to Reports"]}):e.jsx("span",{className:"bg-amber-50 text-amber-805 text-[10px] font-bold px-2 py-0.5 rounded-full border border-amber-200/60 select-none",children:a.grade?o?"草稿状态":"Draft":o?"未评定":"Ungraded"}),e.jsxs("a",{href:a.filePath,target:"_blank",rel:"noopener noreferrer",className:"text-[10px] text-indigo-600 hover:text-indigo-850 font-medium hover:underline flex items-center gap-1 bg-white border border-slate-200 px-2 py-1 rounded-lg shadow-4xs",title:a.filePath,children:[e.jsx(we,{size:11}),o?"查看作业":"View File",e.jsx(tt,{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-[11px] font-bold text-slate-650 flex items-center gap-1 select-none",children:[e.jsx(st,{size:13,className:"text-slate-400"}),o?"学生互评详情":"Peer Review Details"]}),e.jsxs("span",{className:"text-[10px] font-bold text-slate-500 bg-slate-100 px-2 py-0.5 rounded-md",children:[o?"互评人数:":"Reviews:"," ",a.peerReviews.length]})]}),e.jsxs("div",{className:"bg-slate-50 border border-slate-100 rounded-xl p-3 flex items-center gap-3",children:[e.jsxs("div",{className:"bg-white border border-slate-200 w-12 h-12 rounded-lg flex flex-col items-center justify-center shrink-0 shadow-3xs",children:[e.jsx("span",{className:"text-[9px] text-slate-405 select-none font-bold",children:o?"均分":"Avg"}),e.jsx("span",{className:"text-sm font-extrabold text-slate-700 leading-none mt-0.5",children:a.peerAverageScore})]}),e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsx("p",{className:"text-[10px] text-slate-450 leading-normal font-medium",children:a.peerReviews.length>0?o?"根据同学互评分数得出的平均值。":"Average score computed from classmate evaluations.":o?"暂无同学对此作业给出评分。":"No classmate peer reviews received yet."}),a.peerReviews.length>0&&e.jsx("button",{onClick:()=>K(a.id),className:"text-[10px] text-indigo-650 hover:text-indigo-800 font-bold mt-1.5 flex items-center gap-0.5 cursor-pointer outline-none",children:C[a.id]?e.jsxs(e.Fragment,{children:[o?"收起互评详情":"Hide Details"," ",e.jsx(rt,{size:12})]}):e.jsxs(e.Fragment,{children:[o?"展开互评详情":"Show Details"," ",e.jsx(at,{size:12})]})})]})]}),C[a.id]&&a.peerReviews.length>0&&e.jsx("div",{className:"mt-2 space-y-2 border-t border-slate-100 pt-2.5 max-h-40 overflow-y-auto scrollbar-thin",children:a.peerReviews.map(n=>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"}),n.reviewer_name]}),e.jsxs("span",{className:"text-indigo-650 bg-indigo-50 border border-indigo-100 rounded px-1.5 py-0.5 text-[10px]",children:[n.score," ",o?"分":"pts"]})]}),n.comment&&e.jsxs("p",{className:"text-[10px] text-slate-550 mt-1 italic pl-2.5 border-l-2 border-slate-100 font-medium",children:['"',n.comment,'"']})]},n.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-[10px] font-bold text-slate-650 mb-1 select-none",children:o?"教师平时分评分 (0-100)":"Teacher Score (0-100)"}),e.jsxs("div",{className:"flex gap-2",children:[e.jsx("input",{id:`teacher_score_input_${a.id}`,type:"number",min:"0",max:"100",disabled:b,value:m,onChange:n=>_(J=>({...J,[a.id]:Math.min(100,Math.max(0,Number(n.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:b,value:m,onChange:n=>_(J=>({...J,[a.id]:Number(n.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-[10px] font-bold text-slate-600 select-none",children:o?"打分占比 (教师权重)":"Teacher Score Weight"}),e.jsx("span",{className:"text-[10px] font-bold text-slate-400",children:o?`学生互评: ${v}%`:`Peer: ${v}%`})]}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("input",{id:`teacher_weight_input_${a.id}`,type:"range",min:"0",max:"100",step:"5",disabled:b,value:u,onChange:n=>te(a.id,Number(n.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:[u,"%"]})]})]})]}),e.jsxs("div",{children:[e.jsx("label",{className:"block text-[10px] font-bold text-slate-655 mb-1 select-none",children:o?"教师评价评语":"Teacher Comments & Feedback"}),e.jsx("textarea",{id:`teacher_comment_input_${a.id}`,disabled:b,value:h,placeholder:o?"在此输入对学生作业作品的改进指导意见及评语。":"Enter guiding feedback for this student.",onChange:n=>Z(J=>({...J,[a.id]:n.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 ${b?"bg-emerald-50 text-emerald-600 border-emerald-100":"bg-indigo-50 text-indigo-700 border-indigo-100"}`,children:e.jsx(Me,{size:14})}),e.jsxs("div",{className:"text-[10px] text-slate-500 font-medium",children:[e.jsxs("div",{children:[o?"平时总分计算公式":"Calculated Final Grade",":"]}),e.jsxs("div",{className:"font-bold text-slate-700 mt-0.5 animate-formula",children:[u,"% × ",e.jsx("span",{className:"text-indigo-650 font-bold",children:m}),a.peerReviews.length>0&&` + ${v}% × ${a.peerAverageScore}`," = ",e.jsx("span",{className:b?"text-emerald-700 font-black text-xs":"text-indigo-700 font-black text-xs",children:b&&a.grade?.calculated_final_score||j}),o?"分":" pts"]})]})]}),!b&&e.jsxs("div",{className:"flex gap-2 justify-end shrink-0",children:[e.jsxs("button",{id:`teacher_draft_btn_${a.id}`,type:"button",disabled:!!g[a.id],onClick:()=>Q(a.id,"draft"),className:"px-3 py-1.5 bg-white border border-slate-350 rounded-lg text-xs font-bold text-slate-700 hover:bg-slate-55 flex items-center gap-1.5 shadow-4xs cursor-pointer select-none disabled:opacity-50",children:[e.jsx(it,{size:12}),g[a.id]==="draft"?o?"保存中...":"Saving...":o?"暂存草稿":"Save Draft"]}),e.jsxs("button",{id:`teacher_confirm_btn_${a.id}`,type:"button",disabled:!!g[a.id],onClick:()=>Q(a.id,"confirmed"),className:"px-3.5 py-1.5 bg-indigo-600 border border-indigo-700 rounded-lg text-xs font-bold text-white hover:bg-indigo-700 flex items-center gap-1.5 shadow-3xs cursor-pointer select-none disabled:opacity-50",children:[e.jsx(Ae,{size:12}),g[a.id]==="confirmed"?o?"同步中...":"Syncing...":o?"确认并同步":"Confirm & Sync"]})]})]})]})]})]},a.id)})})]})}function yt({name:d,...L}){const T=gt[d];return T?Xe.createElement(T,L):e.jsx(ut,{...L})}function Tt({selectedLesson:d,setSelectedLesson:L,lessons:T,classes:oe,students:N,plugins:Y,lang:s,timelineSegments:w,activeSegmentId:M,setActiveSegmentId:A,liveClassSelectedClassId:f,setLiveClassSelectedClassId:U,liveClassIsActive:S,setLiveClassIsActive:$,liveClassTimeRemaining:_,setLiveClassTimeRemaining:R,liveClassFeed:Z,setLiveClassFeed:y,liveClassAcknowledgedMap:V,setLiveClassAcknowledgedMap:q,elements:I,fetchElements:C,fetchStudents:G,addToast:g,onlineStudentIds:O,activeStudentLessons:o,liveClassStudentProgress:F,onPingStudent:ee,onOpenCoursewareHub:te,activeRole:Q,setActiveRole:K}){const[a,m]=c.useState(!1),[h,u]=c.useState(!1),[v,b]=c.useState(null),[j,n]=c.useState(!1),[J,ye]=c.useState(null),[Re,ve]=c.useState([]),de=c.useRef(null),se=c.useRef({lesson:null,classId:null}),[B,ce]=c.useState("whiteboard"),[re,Oe]=c.useState([]),[xe,ze]=c.useState(!1),[E,me]=c.useState(null),[he,ae]=c.useState(null),[We,ke]=c.useState(!1),[ie,Fe]=c.useState("all"),[pe,Je]=c.useState(""),ne=async()=>{ze(!0);try{const t=await fetch("/api/courseware/attempts");if(t.ok){const r=await t.json();Oe(r)}}catch(t){console.error("Failed to fetch attempts",t)}finally{ze(!1)}};c.useEffect(()=>{B==="submissions"&&ne()},[B]),c.useEffect(()=>{const t=jt();return t.on("courseware-attempt-updated",()=>{ne()}),()=>{t.disconnect()}},[]);const Be=async t=>{if(!d||!f){g(s==="zh"?"⚠️ 无法操作":"⚠️ Action Prevented",s==="zh"?"请先在顶部栏选择要绑定的课节和班级。":"Please select lesson and class first.","warning");return}try{const r=await fetch(`/api/courseware/attempts/${t}/promote`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({lessonId:d,classId:f})});if(r.ok){const l=await r.json();g(s==="zh"?"✓ 学习数据已保存":"✓ Data Recorded",s==="zh"?`成功将该数据存入数据库!分数: ${l.score},已同步更新至学生学习进度。`:`Successfully recorded submission! Score: ${l.score}.`,"success"),ne(),G&&G()}else{const l=await r.json();throw new Error(l.error||"Server error")}}catch(r){g(s==="zh"?"❌ 保存失败":"❌ Save Failed",r.message||"Error occurred while saving.","warning")}},Le=async t=>{me(t),ke(!0),ae(null);try{const r=await fetch(`/api/courseware/attempts/${t.attemptId}/raw`);if(r.ok){const l=await r.json();ae(l)}else ae({error:"Failed to load raw data"})}catch(r){ae({error:r.message||"Error loading data"})}finally{ke(!1)}},le=!!(f&&N.filter(t=>t.locked_lesson_id===d).length>0),Ue=Y.filter(t=>t.status==="active"),fe=Array.from(new Map(Ue.flatMap(t=>{try{const r=typeof t.manifest=="string"?JSON.parse(t.manifest):t.manifest,l=r.classroomTools||[],i=r.contributes?.["classroom.tool"]||[];return[...l,...i].map(x=>({...x,pluginId:t.id,manifestId:r.id}))}catch{return[]}}).map(t=>[t.id,t])).values());c.useEffect(()=>(S&&_>0?de.current=setInterval(()=>{R(_-1)},1e3):_===0&&S&&(g(s==="zh"?"⏰ 环节时间到":"⏰ Phase Timer Ended",s==="zh"?"当前教学环节设定的时间已耗尽,建议转入下一环节。":"The current segment duration has elapsed. Transition recommended.","warning"),$(!1)),()=>{de.current&&clearInterval(de.current)}),[S,_]),c.useEffect(()=>{if(!d||!f){se.current={lesson:null,classId:null};return}(se.current.lesson!==d||se.current.classId!==f)&&(se.current={lesson:d,classId:f},Se(!0))},[d,f]);const Ge=t=>{const r=parseInt(t.replace(/[^0-9]/g,""));return isNaN(r)?300:t.includes("s")?r:r*60},Ve=t=>{A(t.id);const r=Ge(t.duration);R(r),$(!0),y(l=>[{id:Math.random().toString(),time:new Date().toLocaleTimeString([],{hour:"2-digit",minute:"2-digit",second:"2-digit"}),type:"info",message:`教学环节切换并广播:进入 [${t.title}] 环节,设定时间 ${t.duration}。`},...l]),g(s==="zh"?"📢 环节已广播":"📢 Phase Synchronized",s==="zh"?`已同步广播 [${t.title}] 环节至所有在线学生端。`:`Broadcasted phase [${t.title}] to all active students.`,"success")},Se=async t=>{if(!f||!d){g(s==="zh"?"⚠️ 无法操作":"⚠️ Action Prevented",s==="zh"?"请先选择需要授课的课节及班级。":"Please select a lesson and class first.","warning");return}m(!0);try{const r=t?`/api/classes/${f}/lock_lesson`:`/api/classes/${f}/unlock_lesson`;(await fetch(r,{method:"POST",headers:{"Content-Type":"application/json"},body:t?JSON.stringify({lessonId:d}):void 0})).ok&&(await G(),y(i=>[{id:Math.random().toString(),time:new Date().toLocaleTimeString([],{hour:"2-digit",minute:"2-digit",second:"2-digit"}),type:t?"warning":"info",message:t?"已对全班学生强制锁定专注模式(限定当前课程)。":"已解锁全班学生专注模式限制。"},...i]),g(s==="zh"?"🔒 锁状态更新":"🔒 Class Status Updated",t?"全班专注锁定成功,学生将无法切回主页。":"全班屏幕解锁成功,学生已恢复自由浏览。","success"))}catch(r){console.error("Failed to toggle class focus lock",r)}finally{m(!1)}},qe=async(t,r)=>{const l=r?null:d;try{if((await fetch(`/api/students/${t}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({locked_lesson_id:l})})).ok){await G();const x=N.find(p=>p.id===t)?.name||t;y(p=>[{id:Math.random().toString(),time:new Date().toLocaleTimeString([],{hour:"2-digit",minute:"2-digit",second:"2-digit"}),type:l?"warning":"info",message:l?`已针对学生 [${x}] 单独开启专注限制锁定。`:`已解锁学生 [${x}] 的专注限制。`},...p])}}catch(i){console.error("Failed to toggle student lock",i)}},Ie=async t=>{if(!d){g(s==="zh"?"⚠️ 请选择课节":"⚠️ Select Lesson",s==="zh"?"请先选择要授课的课节。":"Please select a lesson first.","warning");return}if(JSON.stringify(t.payload||"").includes("$classId")&&!f){g(s==="zh"?"⚠️ 请选择班级":"⚠️ Select Class",s==="zh"?"该工具需要指定上课班级,请在顶部先选择班级。":"Please select class first for this tool.","warning");return}y(l=>[{id:Math.random().toString(),time:new Date().toLocaleTimeString([],{hour:"2-digit",minute:"2-digit",second:"2-digit"}),type:"info",message:`正在运行插件工具 [${t.name}]...`},...l]);try{const l=JSON.parse(JSON.stringify(t.payload||{}).replace(/\$classId/g,f||"").replace(/\$lessonId/g,d||""));if(l.type==="plugin"&&l.data)try{const z=JSON.parse(l.data);!z.segmentId&&M&&(z.segmentId=M,l.data=JSON.stringify(z))}catch{}const x=!/^(whiteboard|lesson|assignment|class|student|vfs|plugin|ai|agent|system)\./.test(t.commandType)&&t.manifestId?Nt(t.commandType,t.manifestId):t.commandType,p=await fetch("/api/commands",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({commandType:x,payload:l})});if(p.ok)te&&(t.id==="courseware-hub-teacher"||t.commandType==="courseware.open_panel")&&te(),y(z=>[{id:Math.random().toString(),time:new Date().toLocaleTimeString([],{hour:"2-digit",minute:"2-digit",second:"2-digit"}),type:"success",message:`插件工具 [${t.name}] 执行完毕,数据成功下发。`},...z]),g(s==="zh"?"✓ 工具下发成功":"✓ Tool Synchronized",s==="zh"?`工具 [${t.name}] 已成功在当前白板上部署并投射。`:`Tool [${t.name}] synchronized successfully.`,"success"),await C(d);else{const z=await p.json();throw new Error(z.error||"Server error")}}catch(l){y(i=>[{id:Math.random().toString(),time:new Date().toLocaleTimeString([],{hour:"2-digit",minute:"2-digit",second:"2-digit"}),type:"error",message:`运行插件工具 [${t.name}] 失败: ${l.message}`},...i]),g(s==="zh"?"❌ 运行失败":"❌ Tool Failed",l.message||"Execution error","warning")}},Qe=()=>{if(N.length===0||j)return;const t=N.filter(p=>O.includes(p.id)&&o[p.id]===d);if(t.length===0){g(s==="zh"?"⚠️ 无法抽问":"⚠️ Cannot Draw",s==="zh"?"当前课堂中没有已进入的活跃学生。":"No students have entered the classroom yet.","warning");return}n(!0);let r=0;const l=18;let i=75;const x=()=>{const p=Math.floor(Math.random()*t.length),z=t[p];if(ye(z.id),r++,r<l)r>l-5&&(i+=45),setTimeout(x,i);else{const k=t[p];ye(null),n(!1),ve(P=>P.includes(k.id)?P:[...P,k.id]),y(P=>[{id:Math.random().toString(),time:new Date().toLocaleTimeString([],{hour:"2-digit",minute:"2-digit",second:"2-digit"}),type:"success",message:`🎯 随机提问抽选:学生 [${k.name}] 被抽中回答问题!`},...P]),g(s==="zh"?"🎯 随机提问抽选":"🎯 Student Drawn",s==="zh"?`恭喜学生 [${k.name}] 被抽中回答问题!`:`Student [${k.name}] was selected to answer!`,"success"),setTimeout(()=>{ve(P=>P.filter(ue=>ue!==k.id))},8e3)}};setTimeout(x,i)},Ke=t=>{const r=Math.floor(t/60),l=t%60;return`${r.toString().padStart(2,"0")}:${l.toString().padStart(2,"0")}`};return e.jsxs("div",{className:"flex-grow flex-1 flex flex-col min-h-0 bg-white border border-slate-200 rounded-2xl shadow-xl text-slate-800 overflow-hidden font-sans",children:[e.jsxs("div",{className:"bg-slate-50 p-4 border-b border-slate-200 flex flex-wrap items-center justify-between gap-4 shrink-0",children:[e.jsxs("div",{className:"flex items-center gap-3 select-none",children:[e.jsxs("div",{className:"relative flex items-center justify-center",children:[e.jsx("span",{className:`w-3 h-3 rounded-full ${S?"bg-emerald-500 animate-ping":"bg-rose-500"} absolute`}),e.jsx("span",{className:`w-2 h-2 rounded-full ${S?"bg-emerald-500":"bg-rose-500"} relative`})]}),e.jsx("h2",{className:"text-sm font-extrabold tracking-tight text-slate-800 flex items-center gap-2",children:s==="zh"?"🔴 智能授课工作流控制中心":"🔴 Active Lesson control center"})]}),e.jsxs("div",{className:"flex items-center gap-2.5 flex-wrap",children:[e.jsx("div",{children:e.jsxs("select",{value:d||"",onChange:t=>{const r=t.target.value===""?null:t.target.value;L(r),r&&C(r)},className:"bg-white border border-slate-200 rounded-lg text-xs font-semibold px-3 py-1.5 focus:ring-1 focus:ring-indigo-500 text-slate-700 outline-none cursor-pointer hover:bg-slate-100 transition-colors",children:[e.jsx("option",{value:"",children:s==="zh"?"-- 选择授课课节 --":"-- Select Lesson --"}),T.map(t=>e.jsx("option",{value:t.id,children:t.title},t.id))]})}),e.jsx("div",{children:e.jsxs("select",{value:f||"",onChange:t=>U(t.target.value===""?null:t.target.value),className:"bg-white border border-slate-200 rounded-lg text-xs font-semibold px-3 py-1.5 focus:ring-1 focus:ring-indigo-500 text-slate-700 outline-none cursor-pointer hover:bg-slate-100 transition-colors",children:[e.jsx("option",{value:"",children:s==="zh"?"-- 选择授课班级 --":"-- Select Class --"}),oe.map(t=>e.jsx("option",{value:t.id,children:t.name},t.id))]})}),e.jsxs("div",{className:"flex items-center gap-2",children:[K&&e.jsxs("div",{className:"bg-slate-200/80 p-0.5 rounded-lg flex items-center gap-0.5 border border-slate-300/60 shadow-3xs",children:[e.jsxs("button",{onClick:()=>K("teacher"),className:`px-2.5 py-1 text-[11px] font-bold rounded transition-all cursor-pointer ${Q==="teacher"?"bg-white text-indigo-700 shadow-2xs font-extrabold":"text-slate-600 hover:text-slate-900"}`,children:["👨‍🏫 ",s==="zh"?"教师模式":"Teacher Mode"]}),e.jsxs("button",{onClick:()=>K("student"),className:`px-2.5 py-1 text-[11px] font-bold rounded transition-all cursor-pointer ${Q==="student"?"bg-pink-600 text-white shadow-2xs font-extrabold":"text-slate-600 hover:text-slate-900"}`,children:["🎓 ",s==="zh"?"学生模式":"Student Mode"]})]}),e.jsxs("button",{onClick:()=>Se(!le),disabled:a||!d||!f,className:`px-3 py-1.5 rounded-lg font-bold text-[11px] uppercase tracking-wider flex items-center gap-1.5 shadow-sm transition-all active:scale-95 disabled:opacity-50 cursor-pointer ${le?"bg-rose-500 hover:bg-rose-600 text-white":"bg-indigo-600 hover:bg-indigo-700 text-white"}`,children:[le?e.jsx(Pe,{size:12}):e.jsx(De,{size:12}),e.jsx("span",{children:le?s==="zh"?"一键解锁全班":"Unlock Entire Class":s==="zh"?"全班专注锁定":"Lock Class Screen"})]})]})]})]}),e.jsxs("div",{className:"flex-1 flex overflow-hidden min-h-0 bg-slate-50/30",children:[!h&&e.jsxs("div",{className:"w-[220px] shrink-0 bg-white p-3.5 border-r border-slate-200/80 flex flex-col gap-4 overflow-y-auto",children:[e.jsxs("div",{children:[e.jsxs("div",{className:"flex items-center justify-between mb-2 select-none",children:[e.jsx("h3",{className:"text-[10px] font-black uppercase text-slate-400 tracking-wider",children:s==="zh"?"教学步骤与时间管理":"Lesson Segments & Phases"}),e.jsx("button",{onClick:()=>u(!0),className:"p-1 rounded bg-slate-50 hover:bg-slate-100 border border-slate-200 text-slate-500 hover:text-slate-700 transition-colors cursor-pointer",title:s==="zh"?"折叠导航栏":"Collapse Sidebar",children:e.jsx(nt,{size:10})})]}),e.jsxs("div",{className:"bg-slate-50 border border-slate-150 rounded-xl p-3 flex flex-col items-center justify-center gap-1 shadow-sm",children:[e.jsxs("span",{className:"text-[9.5px] uppercase tracking-widest text-slate-505 font-semibold flex items-center gap-1",children:[e.jsx(lt,{size:11,className:S?"animate-spin":"",style:{animationDuration:"4s"}}),s==="zh"?"当前步骤剩余时间":"Phase Remaining"]}),e.jsx("div",{className:`text-2xl font-black font-mono tracking-widest ${S?"text-indigo-650":"text-slate-450"}`,children:Ke(_)}),e.jsxs("div",{className:"flex gap-1.5 w-full mt-2 shrink-0",children:[e.jsxs("button",{onClick:()=>$(!S),disabled:_<=0,className:"flex-1 py-1 rounded bg-slate-100 hover:bg-slate-205 text-[10px] font-bold text-slate-700 transition-all disabled:opacity-40 flex items-center justify-center gap-1 border border-slate-200",children:[S?e.jsx(ot,{size:10}):e.jsx(dt,{size:10}),e.jsx("span",{children:S?s==="zh"?"暂停":"Pause":s==="zh"?"开始":"Start"})]}),e.jsx("button",{onClick:()=>{$(!1),R(0)},className:"py-1 px-2.5 rounded bg-slate-100 hover:bg-rose-50 text-[10px] font-bold text-rose-600 hover:text-rose-700 transition-all flex items-center justify-center border border-slate-200",title:"重置",children:e.jsx(ct,{size:10})})]})]})]}),e.jsxs("div",{className:"flex-1 flex flex-col gap-2 min-h-0",children:[e.jsx("h4",{className:"text-[10px] font-black uppercase text-slate-400 tracking-wider select-none",children:s==="zh"?"教学环节进度表":"Timeline Segments"}),d?e.jsx("div",{className:"space-y-2 overflow-y-auto flex-1 pr-1.5 scrollbar-thin",children:w.map((t,r)=>{const l=M===t.id;return e.jsxs("div",{className:`p-2.5 rounded-xl border transition-all flex flex-col gap-1.5 ${l?"bg-indigo-50/50 border-indigo-250 shadow-sm":"bg-white border-slate-200 hover:bg-slate-50 hover:border-slate-300"}`,children:[e.jsxs("div",{className:"flex justify-between items-start",children:[e.jsxs("span",{className:`text-[11.5px] font-bold ${l?"text-indigo-900":"text-slate-800"}`,children:[r+1,". ",t.title]}),e.jsx("span",{className:"text-[9px] font-mono px-1 py-0.5 rounded bg-slate-100 text-slate-550 border border-slate-200/50",children:t.duration})]}),e.jsx("div",{className:`text-[9.5px] line-clamp-2 leading-relaxed ${l?"text-indigo-750":"text-slate-450"}`,children:t.notes||"无步骤描述备注信息。"}),e.jsxs("button",{onClick:()=>Ve(t),className:`w-full py-1 rounded text-[10px] font-bold transition-all cursor-pointer flex items-center justify-center gap-1 ${l?"bg-indigo-600 text-white hover:bg-indigo-700 shadow-sm":"bg-slate-100 text-slate-600 hover:bg-slate-200 border border-slate-200/60"}`,children:[e.jsx(Te,{size:10}),e.jsx("span",{children:l?s==="zh"?"同步演示中":"Broadcasting":s==="zh"?"广播此环节":"Broadcast Step"})]})]},t.id)})}):e.jsx("div",{className:"text-xs text-slate-400 italic py-4 text-center",children:s==="zh"?"请选择一个课节加载流程表":"Select a lesson to view schedule."})]})]}),e.jsx("div",{className:"flex-1 flex flex-col min-w-0 bg-slate-100 p-3 gap-3 relative",children:d?e.jsxs("div",{className:"w-full h-full relative flex flex-col min-h-0",children:[e.jsxs("div",{className:"flex justify-between items-center px-1.5 py-1 select-none text-slate-500 text-[10px] uppercase font-extrabold tracking-wide shrink-0 mb-1",children:[e.jsxs("div",{className:"flex items-center gap-3",children:[h&&e.jsxs("button",{onClick:()=>u(!1),className:"p-1 rounded-lg bg-white hover:bg-slate-100 border border-slate-205 text-indigo-650 hover:text-indigo-700 transition-colors cursor-pointer mr-1.5 flex items-center gap-1 shadow-sm",title:s==="zh"?"展开环节大纲":"Expand Sidebar",children:[e.jsx(xt,{size:10}),e.jsx("span",{className:"text-[9px] font-bold tracking-wider",children:s==="zh"?"展开":"Expand"})]}),e.jsxs("div",{className:"bg-slate-200/60 p-0.5 rounded-lg flex items-center gap-1",children:[e.jsx("button",{onClick:()=>ce("whiteboard"),className:`px-3 py-1 rounded-md text-[10px] font-bold transition-all cursor-pointer ${B==="whiteboard"?"bg-white text-indigo-700 shadow-sm":"text-slate-500 hover:text-slate-700"}`,children:s==="zh"?"💻 演示白板":"💻 Whiteboard"}),e.jsx("button",{onClick:()=>ce("submissions"),className:`px-3 py-1 rounded-md text-[10px] font-bold transition-all cursor-pointer ${B==="submissions"?"bg-white text-indigo-700 shadow-sm":"text-slate-500 hover:text-slate-700"}`,children:s==="zh"?"📊 学生提交数据":"📊 Student Submissions"}),e.jsx("button",{id:"teacher_assignment_eval_tab_btn",onClick:()=>ce("assignment"),className:`px-3 py-1 rounded-md text-[10px] font-bold transition-all cursor-pointer ${B==="assignment"?"bg-white text-indigo-700 shadow-sm":"text-slate-500 hover:text-slate-700"}`,children:s==="zh"?"🎓 作业成绩评定":"🎓 Assignment Grades"})]})]}),e.jsxs("span",{className:"text-indigo-655 font-mono tracking-widest animate-pulse flex items-center gap-1",children:[e.jsx(Ne,{size:10})," Live Broadcaster Connected"]})]}),B==="whiteboard"?e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"flex-grow flex-1 min-h-0 w-full relative rounded-xl overflow-hidden border border-slate-200 shadow-md bg-white flex flex-col",children:e.jsx(bt,{lessonId:d,userRole:"teacher",isEditMode:!1,elements:I,activeSegmentId:M,onSegmentSync:t=>A(t),onElementAdd:async(t,r)=>{await fetch(`/api/lessons/${d}/whiteboard`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({type:t,data:r})}),C(d)},onElementUpdate:async(t,r)=>{await fetch(`/api/lessons/${d}/whiteboard/${t}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({data:r})}),C(d)},onElementDelete:async t=>{await fetch(`/api/lessons/${d}/whiteboard/${t}`,{method:"DELETE"}),C(d)},onRefresh:()=>C(d)})}),e.jsxs("div",{className:"mt-3 bg-white border border-slate-200 rounded-xl p-3 shadow-sm shrink-0 flex flex-col gap-2 relative z-30",children:[e.jsxs("div",{className:"flex items-center justify-between text-[10px] uppercase font-black text-slate-555 tracking-wider select-none",children:[e.jsxs("span",{className:"flex items-center gap-1.5 text-indigo-655",children:[e.jsx(Ce,{size:12,className:"text-indigo-600 animate-pulse"}),e.jsx("span",{children:s==="zh"?"互动工具 (插件扩展)":"Classroom Interactive Tools"})]}),e.jsxs("span",{className:"text-[8.5px] text-slate-400 font-mono",children:["Plugins: ",fe.length," Active"]})]}),fe.length>0?e.jsx("div",{className:"flex gap-2.5 overflow-x-auto py-0.5 pr-2 scrollbar-thin",children:fe.map(t=>e.jsxs("button",{onClick:()=>Ie(t),disabled:!d,className:"p-2 bg-slate-50 hover:bg-slate-105 border border-slate-205 hover:border-indigo-200 rounded-xl text-left transition-all active:scale-[0.98] disabled:opacity-40 flex items-center gap-2.5 w-44 shrink-0 group cursor-pointer",title:t.description,children:[e.jsx("div",{className:"p-1.5 bg-indigo-50 text-indigo-650 group-hover:bg-indigo-100 group-hover:text-indigo-700 rounded-lg border border-indigo-100 shrink-0 transition-colors",children:e.jsx(yt,{name:t.icon,size:14})}),e.jsxs("div",{className:"min-w-0 flex-1",children:[e.jsx("div",{className:"text-xs font-bold text-slate-700 group-hover:text-slate-900 truncate",children:t.name}),e.jsx("div",{className:"text-[9px] text-slate-400 group-hover:text-slate-555 truncate mt-0.5",children:t.description})]})]},t.id))}):e.jsx("div",{className:"text-center py-2 text-[10px] text-slate-400 italic",children:s==="zh"?"暂无可用的互动工具。请在应用商店启用插件。":"No plugin tools loaded."})]})]}):B==="submissions"?e.jsxs("div",{className:"flex-grow flex-1 min-h-0 w-full relative rounded-xl overflow-hidden border border-slate-200 shadow-md bg-white flex flex-col p-4",children:[e.jsxs("div",{className:"flex justify-between items-center mb-4 gap-3 shrink-0",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("span",{className:"text-xs font-bold text-slate-700",children:s==="zh"?"学生互动提交数据列表":"Student Submissions"}),re.length>0&&e.jsxs("span",{className:"text-[9px] bg-indigo-50 text-indigo-750 px-2 py-0.5 rounded-full border border-indigo-100 font-bold",children:[re.length," ",s==="zh"?"条记录":"records"]})]}),e.jsxs("div",{className:"flex items-center gap-2 flex-wrap",children:[e.jsxs("div",{className:"relative",children:[e.jsx("input",{type:"text",placeholder:s==="zh"?"搜索学生或课件...":"Search student or courseware...",value:pe,onChange:t=>Je(t.target.value),className:"bg-white border border-slate-200 rounded-lg text-xs pl-8 pr-3 py-1.5 focus:ring-1 focus:ring-indigo-500 text-slate-700 outline-none w-44 transition-all"}),e.jsx(mt,{size:12,className:"absolute left-2.5 top-2.5 text-slate-400"})]}),e.jsxs("select",{value:ie,onChange:t=>Fe(t.target.value),className:"bg-white border border-slate-200 rounded-lg text-xs px-3 py-1.5 focus:ring-1 focus:ring-indigo-500 text-slate-700 outline-none cursor-pointer hover:bg-slate-50 transition-colors",children:[e.jsx("option",{value:"all",children:s==="zh"?"全部状态":"All Status"}),e.jsx("option",{value:"submitted",children:s==="zh"?"已提交/完成":"Submitted/Finished"}),e.jsx("option",{value:"started",children:s==="zh"?"进行中":"In Progress"})]}),e.jsx("button",{onClick:ne,disabled:xe,className:"p-1.5 bg-white hover:bg-slate-50 border border-slate-205 rounded-lg text-slate-605 hover:text-slate-800 transition-colors cursor-pointer flex items-center justify-center shadow-sm disabled:opacity-50",title:s==="zh"?"刷新数据":"Refresh",children:e.jsx(X,{size:12,className:xe?"animate-spin":""})})]})]}),e.jsx("div",{className:"flex-1 overflow-y-auto border border-slate-100 rounded-xl scrollbar-thin",children:xe?e.jsxs("div",{className:"h-full flex flex-col items-center justify-center text-slate-400 gap-2",children:[e.jsx(X,{size:24,className:"animate-spin text-indigo-600 mb-2"}),e.jsx("span",{className:"text-xs",children:s==="zh"?"正在加载学生提交数据...":"Loading submissions..."})]}):(()=>{const t=f?N.map(i=>i.id):[],l=(f?re.filter(i=>t.includes(i.studentId)):re).filter(i=>{const x=i.studentName?.toLowerCase().includes(pe.toLowerCase())||i.coursewareName?.toLowerCase().includes(pe.toLowerCase()),p=ie==="all"||ie==="submitted"&&(i.status==="submitted"||i.status==="finished")||ie==="started"&&i.status==="started";return x&&p});return l.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(we,{size:32,className:"text-slate-300"}),e.jsx("span",{className:"text-xs",children:s==="zh"?"暂无匹配的提交数据。":"No matching submissions found."}),!f&&e.jsx("span",{className:"text-[10px] text-slate-400 italic",children:s==="zh"?"提示:请在顶部选择一个班级进行筛选。":"Tip: Select a class at the top to filter."})]}):e.jsxs("table",{className:"w-full border-collapse text-left text-xs text-slate-700",children:[e.jsx("thead",{children:e.jsxs("tr",{className:"bg-slate-50 border-b border-slate-100 font-bold text-slate-550 select-none",children:[e.jsx("th",{className:"p-3",children:s==="zh"?"学生姓名":"Student Name"}),e.jsx("th",{className:"p-3",children:s==="zh"?"交互课件":"Courseware"}),e.jsx("th",{className:"p-3",children:s==="zh"?"状态":"Status"}),e.jsx("th",{className:"p-3 text-center",children:s==="zh"?"成绩":"Score"}),e.jsx("th",{className:"p-3 text-center",children:s==="zh"?"完成度":"Completion"}),e.jsx("th",{className:"p-3 text-right",children:s==="zh"?"操作":"Actions"})]})}),e.jsx("tbody",{className:"divide-y divide-slate-100",children:l.map(i=>{const x=i.status==="finished"||i.status==="submitted",p=i.started_at?new Date(i.started_at).toLocaleTimeString([],{hour:"2-digit",minute:"2-digit"}):"N/A";return e.jsxs("tr",{className:"hover:bg-slate-50/50 transition-colors group",children:[e.jsxs("td",{className:"p-3",children:[e.jsx("div",{className:"font-semibold text-slate-800",children:i.studentName}),e.jsxs("div",{className:"text-[10px] text-slate-400 mt-0.5",children:[s==="zh"?"时间":"Time",": ",p]})]}),e.jsx("td",{className:"p-3 font-medium text-slate-600 max-w-[150px] truncate",title:i.coursewareName,children:i.coursewareName}),e.jsx("td",{className:"p-3",children:e.jsx("span",{className:`px-2 py-0.5 rounded-full border text-[10px] font-bold ${x?"bg-emerald-50 text-emerald-700 border-emerald-100":"bg-blue-50 text-blue-700 border-blue-100 animate-pulse"}`,children:x?s==="zh"?"已提交":"Finished":s==="zh"?"进行中":"Running"})}),e.jsx("td",{className:"p-3 text-center font-bold font-mono",children:i.score!==null?e.jsxs("span",{className:"text-indigo-650 bg-indigo-50 border border-indigo-100 px-1.5 py-0.5 rounded-md",children:[i.score,"分"]}):e.jsx("span",{className:"text-slate-400 font-medium",children:"-"})}),e.jsx("td",{className:"p-3 text-center font-semibold font-mono",children:i.completion!==null?`${Math.round(i.completion*100)}%`:"0%"}),e.jsx("td",{className:"p-3 text-right",children:e.jsxs("div",{className:"flex justify-end gap-2",children:[e.jsxs("button",{onClick:()=>Le(i),className:"p-1 text-slate-500 hover:text-indigo-600 hover:bg-slate-100 border border-transparent hover:border-slate-200 rounded-lg transition-colors cursor-pointer flex items-center gap-1 text-[10px]",title:s==="zh"?"查看提交轨迹事件数据":"View Raw Data",children:[e.jsx(ht,{size:12}),e.jsx("span",{children:s==="zh"?"轨迹":"Events"})]}),i.isPromoted>0?e.jsxs("span",{className:"px-2 py-1 text-emerald-650 font-bold text-[10px] flex items-center gap-0.5 bg-emerald-50/50 rounded-lg border border-emerald-100",children:[e.jsx(pt,{size:11}),s==="zh"?"已归档":"Saved"]}):e.jsxs("button",{onClick:()=>Be(i.attemptId),disabled:!x,className:`px-2 py-1 text-[10px] font-bold rounded-lg flex items-center gap-1 shadow-sm transition-all active:scale-95 cursor-pointer border ${x?"bg-indigo-600 hover:bg-indigo-700 text-white border-indigo-600":"bg-slate-55 text-slate-400 border-slate-200 cursor-not-allowed opacity-60"}`,title:s==="zh"?"将分数和进度作为随堂学习数据存入数据库,记入学期成绩":"Save to DB & Semester grade",children:[e.jsx(Me,{size:11}),e.jsx("span",{children:s==="zh"?"录入成绩":"Record"})]})]})})]},i.attemptId)})})]})})()})]}):e.jsx(wt,{lessonId:d||"",lang:s==="zh"?"zh":"en",addToast:g})]}):e.jsxs("div",{className:"flex-1 flex flex-col items-center justify-center text-slate-455 gap-2.5 select-none",children:[e.jsx(Te,{size:38,className:"text-slate-300 animate-bounce",style:{animationDuration:"2.5s"}}),e.jsx("div",{className:"text-sm font-bold text-slate-655",children:s==="zh"?"请在顶部栏选择一个授课课节":"Please select a lesson to start teaching"}),e.jsx("p",{className:"text-[10px] text-slate-400",children:"白板及环节控制面板将在课节载入后自动生成"})]})}),e.jsxs("div",{className:"w-[260px] shrink-0 bg-white p-3.5 border-l border-slate-200/80 flex flex-col gap-3.5 overflow-hidden",children:[e.jsxs("div",{className:"flex-1 flex flex-col min-h-0 gap-2",children:[e.jsxs("h3",{className:"text-[10px] font-black uppercase text-slate-555 tracking-wider select-none flex justify-between items-center shrink-0",children:[e.jsxs("span",{className:"flex items-center gap-1",children:[e.jsx("span",{children:s==="zh"?"学生专注力监控":"Student Status Console"}),f&&e.jsxs("button",{onClick:Qe,disabled:N.length===0||j,className:"ml-2 text-[9px] font-bold bg-indigo-50 text-indigo-600 border border-indigo-200 px-1.5 py-0.5 rounded hover:bg-indigo-105 transition-colors flex items-center gap-1 active:scale-95 disabled:opacity-50 cursor-pointer shrink-0",title:s==="zh"?"随机抽取一名学生提问":"Pick a student randomly",children:[e.jsx(Ce,{size:8.5,className:j?"animate-spin":""}),e.jsx("span",{children:s==="zh"?"随机抽问":"Pick Student"})]})]}),e.jsxs("span",{className:"text-[9px] bg-slate-100 border border-slate-200 text-slate-555 font-mono px-1.5 py-0.5 rounded-md",children:[N.filter(t=>t.locked_lesson_id===d).length," / ",N.length," Locked"]})]}),f?e.jsx("div",{className:"overflow-y-auto flex-1 pr-1 grid grid-cols-3 gap-2 justify-items-center auto-rows-max scrollbar-thin py-2",children:N.map(t=>{const r=t.locked_lesson_id===d,l=V.get(t.id),i=O.includes(t.id),p=o[t.id]===d,k=F.find(H=>H.student_id===t.id)?.progress_percent??0,P=M?w.findIndex(H=>H.id===M):-1,ue=w.length>0?Math.round((P+1)/w.length*100):0,$e=P>=0&&k<ue,D=Re.includes(t.id),ge=J===t.id,be=22,_e=3,je=2*Math.PI*be,He=je-k/100*je;let W="stroke-indigo-650";return D?W="stroke-amber-500 stroke-[3.5px]":ge?W="stroke-indigo-500 stroke-[3.5px] animate-pulse":i?r?W="stroke-rose-500 animate-pulse":$e?W="stroke-amber-500 animate-pulse":p?k===100&&(W="stroke-emerald-500"):W="stroke-blue-400":W="stroke-slate-200",e.jsxs("div",{onMouseEnter:()=>b(t.id),onMouseLeave:()=>b(null),className:`group relative flex flex-col items-center justify-center p-1 rounded-xl transition-all cursor-default ${D?"z-20 duration-300":ge?"z-20":"hover:bg-slate-50"}`,children:[e.jsxs("div",{className:`relative w-14 h-14 flex items-center justify-center rounded-full transition-all duration-300 ${D?"shadow-[0_0_15px_#f59e0b] scale-110 z-10 bg-amber-50 ring-2 ring-amber-400 ring-offset-1":ge?"shadow-[0_0_10px_#6366f1] scale-105 z-10 bg-indigo-50 ring-1 ring-indigo-400":""}`,children:[D&&e.jsx("div",{className:"absolute inset-0 rounded-full bg-amber-400/30 animate-ping",style:{animationDuration:"2s"}}),e.jsxs("svg",{className:"absolute w-full h-full transform -rotate-90",viewBox:"0 0 50 50",children:[e.jsx("circle",{cx:"25",cy:"25",r:be,className:"stroke-slate-100 fill-white",strokeWidth:_e}),e.jsx("circle",{cx:"25",cy:"25",r:be,className:`fill-transparent transition-all duration-300 ${W}`,strokeWidth:_e,strokeDasharray:je,strokeDashoffset:He,strokeLinecap:"round"})]}),e.jsxs("div",{className:`relative z-10 w-10 h-10 rounded-full flex items-center justify-center overflow-hidden transition-colors ${D?"bg-amber-100/90":""}`,children:[e.jsx("span",{className:`text-[10px] font-bold tracking-tight truncate max-w-[34px] group-hover:scale-0 group-hover:opacity-0 transition-all duration-200 select-none ${D?"text-amber-900 font-extrabold":i?"text-slate-700":"text-slate-400"}`,children:t.name}),e.jsxs("div",{className:"absolute inset-0 flex items-center justify-center gap-1 opacity-0 scale-50 group-hover:opacity-100 group-hover:scale-100 transition-all duration-200 bg-white/95 rounded-full shadow-inner",children:[d&&ee&&e.jsx("button",{onClick:()=>{const H=s==="zh"?`⚠️ 学习进度预警:您当前的进度 (${k}%) 落后于老师的讲解进度。请专注课堂,跟上讲解!`:`⚠️ Progress Alert: Your progress (${k}%) is behind.`;ee(t.id,H),g(s==="zh"?"🔔 已发送提醒":"🔔 Alert Sent",`已向学生 ${t.name} 发送进度提醒。`,"success")},className:`p-0.5 rounded-md hover:bg-slate-105 transition-colors shrink-0 cursor-pointer ${$e?"text-amber-500 hover:text-amber-600 animate-pulse":"text-slate-400 hover:text-slate-650"}`,title:"提醒",children:e.jsx(Ae,{size:10})}),e.jsx("button",{onClick:()=>qe(t.id,t.locked_lesson_id),disabled:!d,className:`p-0.5 rounded-md hover:bg-slate-105 transition-colors shrink-0 cursor-pointer ${r?"text-rose-500 hover:text-rose-600":"text-slate-400 hover:text-slate-655"}`,title:r?"解锁":"锁定",children:r?e.jsx(Pe,{size:10}):e.jsx(De,{size:10})})]})]}),D?e.jsx("span",{className:"absolute -top-1.5 -right-1.5 z-20 text-[9px] bg-amber-500 text-white rounded-full w-4 h-4 flex items-center justify-center font-bold shadow-md animate-bounce",children:"🎯"}):i&&e.jsx("span",{className:`absolute top-0 right-0 w-2.5 h-2.5 rounded-full border-2 border-white shrink-0 ${p?"bg-emerald-500":"bg-blue-400"}`,title:p?"正在上课":"在线(但未进课堂)"}),l===!0&&!D&&e.jsx("span",{className:"absolute bottom-0 right-0 w-2.5 h-2.5 rounded-full border-2 border-white bg-amber-500 shrink-0 animate-bounce",title:"已确认/就位"})]}),e.jsx("span",{className:`text-[8.5px] mt-1 truncate max-w-[48px] select-none font-medium ${D?"text-amber-600 font-extrabold animate-bounce":i?"text-slate-505":"text-slate-350"}`,children:D?"🎯 抽中":`${k}%`})]},t.id)})}):e.jsx("div",{className:"text-xs text-slate-400 italic py-4 text-center flex-1 flex items-center justify-center",children:s==="zh"?"请选择班级以显示学生":"Select class to show student monitors."})]}),e.jsx("div",{className:"bg-slate-50 border border-slate-150 rounded-xl p-3 flex flex-col gap-1.5 h-[135px] shrink-0 shadow-sm select-none justify-center",children:v?(()=>{const t=N.find(x=>x.id===v);if(!t)return null;const r=F.find(x=>x.student_id===t.id),l=r?.progress_percent??0,i=(()=>{if(!r||!r.completed_segments)return[];try{return typeof r.completed_segments=="string"?JSON.parse(r.completed_segments):r.completed_segments}catch{return[]}})();return e.jsxs("div",{className:"flex flex-col gap-1.5 text-xs text-slate-705",children:[e.jsxs("div",{className:"font-extrabold text-slate-800 border-b border-slate-200 pb-1 flex justify-between items-center shrink-0",children:[e.jsxs("span",{className:"flex items-center gap-1.5 truncate",children:[e.jsx("span",{className:`w-2 h-2 rounded-full shrink-0 ${O.includes(t.id)?"bg-emerald-500 animate-pulse":"bg-slate-300"}`}),e.jsxs("span",{className:"truncate max-w-[130px]",children:[t.name," (",t.student_number||"N/A",")"]})]}),e.jsxs("span",{className:"text-[10px] text-indigo-655 font-mono font-black shrink-0",children:[l,"%"]})]}),e.jsxs("div",{className:"grid grid-cols-2 gap-1.5 text-[9.5px] leading-tight shrink-0",children:[e.jsxs("div",{className:"flex flex-col gap-0.5 bg-white p-1 rounded-lg border border-slate-150",children:[e.jsx("span",{className:"text-slate-400 font-bold",children:"随堂测验"}),e.jsx("span",{className:`font-bold font-mono text-[10px] ${r!=null&&r.quiz_score!==null?"text-indigo-600":"text-slate-400"}`,children:r!=null&&r.quiz_score!==null?`${r.quiz_score} / 100`:"未提交"})]}),e.jsxs("div",{className:"flex flex-col gap-0.5 bg-white p-1 rounded-lg border border-slate-150",children:[e.jsx("span",{className:"text-slate-400 font-bold",children:"教学环节进度"}),e.jsxs("span",{className:"font-bold text-slate-655 text-[10px]",children:[Array.isArray(i)?i.length:0," / ",w.length]})]})]}),e.jsxs("div",{className:"text-[9px] text-slate-500 leading-relaxed truncate mt-0.5 shrink-0",children:["环节: ",w.length>0?w.map((x,p)=>{const z=Array.isArray(i)&&i.includes(x.id);return e.jsxs("span",{className:`mr-1 px-1 py-0.2 rounded ${z?"bg-emerald-50 text-emerald-600 border border-emerald-100":"bg-slate-105 text-slate-400 border border-slate-150"}`,title:x.title,children:[p+1,":",z?"✓":"✗"]},x.id)}):e.jsx("span",{className:"italic text-slate-400",children:"暂无步骤"})]})]})})():e.jsxs("div",{className:"flex flex-col gap-1 text-xs text-slate-700 h-full justify-center",children:[e.jsxs("div",{className:"font-extrabold text-slate-800 border-b border-slate-200 pb-1.5 flex items-center gap-1.5 shrink-0",children:[e.jsx(Ne,{size:12,className:"text-indigo-655 animate-pulse"}),e.jsx("span",{children:s==="zh"?"班级学情概况":"Class Overview"})]}),e.jsxs("div",{className:"grid grid-cols-3 gap-1.5 text-[9.5px] leading-tight mt-1.5 shrink-0",children:[e.jsxs("div",{className:"flex flex-col items-center bg-white py-1 rounded-lg border border-slate-150",children:[e.jsx("span",{className:"text-slate-400 font-medium",children:"在线/总数"}),e.jsxs("span",{className:"font-bold font-mono text-emerald-600 text-[11px] mt-0.5",children:[N.filter(t=>O.includes(t.id)).length,"/",N.length]})]}),e.jsxs("div",{className:"flex flex-col items-center bg-white py-1 rounded-lg border border-slate-150",children:[e.jsx("span",{className:"text-slate-400 font-medium",children:"屏幕锁定"}),e.jsx("span",{className:"font-bold font-mono text-rose-500 text-[11px] mt-0.5",children:N.filter(t=>t.locked_lesson_id===d).length})]}),e.jsxs("div",{className:"flex flex-col items-center bg-white py-1 rounded-lg border border-slate-150",children:[e.jsx("span",{className:"text-slate-400 font-medium",children:"平均进度"}),e.jsx("span",{className:"font-bold font-mono text-indigo-650 text-[11px] mt-0.5",children:(()=>{const t=N.filter(l=>O.includes(l.id));if(t.length===0)return"0%";const r=t.reduce((l,i)=>{const x=F.find(p=>p.student_id===i.id);return l+(x?.progress_percent??0)},0);return`${Math.round(r/t.length)}%`})()})]})]})]})}),e.jsxs("div",{className:"h-[160px] flex flex-col border-t border-slate-150 pt-3 min-h-0 gap-2 shrink-0",children:[e.jsxs("h3",{className:"text-[10px] font-black uppercase text-slate-550 tracking-wider select-none flex justify-between items-center",children:[e.jsx("span",{children:s==="zh"?"课堂互动反馈流":"Live Classroom Feed"}),e.jsx("button",{onClick:()=>y([{id:"clear",time:new Date().toLocaleTimeString([],{hour:"2-digit",minute:"2-digit",second:"2-digit"}),type:"info",message:"反馈流已清空。"}]),className:"text-[9px] hover:text-slate-700 text-slate-400 underline transition-all",children:"Clear"})]}),e.jsx("div",{className:"flex-1 bg-white border border-slate-200 rounded-xl p-2.5 font-mono text-[9px] leading-relaxed overflow-y-auto space-y-2 select-text text-left text-slate-600 shadow-inner scrollbar-thin",children:Z.map(t=>e.jsxs("div",{className:"border-b border-slate-100 pb-1.5 last:border-b-0",children:[e.jsxs("div",{className:"flex justify-between items-center text-slate-400 font-bold mb-0.5",children:[e.jsx("span",{children:t.time}),e.jsx("span",{className:`px-1 rounded uppercase tracking-wide text-[7px] ${t.type==="success"?"bg-emerald-50 text-emerald-600 border border-emerald-100":t.type==="warning"?"bg-amber-50 text-amber-600 border border-amber-100":"bg-slate-100 text-slate-500 border border-slate-200"}`,children:t.type})]}),e.jsx("p",{className:t.type==="success"?"text-emerald-700 font-medium":t.type==="warning"?"text-amber-700 font-medium":"text-slate-655",children:t.message})]},t.id))})]})]})]}),E&&e.jsx("div",{className:"fixed inset-0 bg-slate-900/60 backdrop-blur-sm z-50 flex items-center justify-center p-4",children:e.jsxs("div",{className:"bg-white rounded-2xl shadow-2xl max-w-2xl w-full max-h-[85vh] flex flex-col overflow-hidden border border-slate-100 animate-in fade-in zoom-in duration-200",children:[e.jsxs("div",{className:"bg-slate-50 px-6 py-4 border-b border-slate-100 flex items-center justify-between",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(we,{className:"text-indigo-600",size:18}),e.jsx("h3",{className:"text-sm font-bold text-slate-800",children:s==="zh"?`[${E.studentName}] 的互动提交轨迹详情`:`Submission Details - ${E.studentName}`})]}),e.jsx("button",{onClick:()=>me(null),className:"text-slate-400 hover:text-slate-600 p-1.5 hover:bg-slate-100 rounded-lg transition-colors cursor-pointer",children:e.jsx(ft,{size:18})})]}),e.jsxs("div",{className:"p-6 overflow-y-auto space-y-4 flex-1 scrollbar-thin",children:[e.jsxs("div",{className:"grid grid-cols-3 gap-3",children:[e.jsxs("div",{className:"bg-slate-50 p-3 rounded-xl border border-slate-100",children:[e.jsx("div",{className:"text-[10px] text-slate-400 font-bold uppercase tracking-wider",children:s==="zh"?"课件名称":"Courseware"}),e.jsx("div",{className:"text-xs font-semibold text-slate-700 mt-1 truncate",title:E.coursewareName,children:E.coursewareName})]}),e.jsxs("div",{className:"bg-slate-50 p-3 rounded-xl border border-slate-100",children:[e.jsx("div",{className:"text-[10px] text-slate-400 font-bold uppercase tracking-wider",children:s==="zh"?"提交成绩":"Score"}),e.jsx("div",{className:"text-xs font-bold text-indigo-600 mt-1",children:E.score!==null?`${E.score} 分`:s==="zh"?"未打分":"N/A"})]}),e.jsxs("div",{className:"bg-slate-50 p-3 rounded-xl border border-slate-100",children:[e.jsx("div",{className:"text-[10px] text-slate-400 font-bold uppercase tracking-wider",children:s==="zh"?"课件完成度":"Completion"}),e.jsx("div",{className:"text-xs font-bold text-emerald-600 mt-1",children:E.completion!==null?`${Math.round(E.completion*100)}%`:"0%"})]})]}),e.jsxs("div",{className:"space-y-3",children:[e.jsxs("h4",{className:"text-xs font-bold text-slate-700 border-b border-slate-100 pb-1.5 flex items-center gap-1.5 flex-wrap",children:[e.jsx(Ne,{size:13,className:"text-indigo-650"}),e.jsx("span",{children:s==="zh"?"实时捕获轨迹事件流 (LMS Bridge)":"LMS Event Captures"})]}),We?e.jsxs("div",{className:"py-12 flex flex-col items-center justify-center text-slate-400 gap-2",children:[e.jsx(X,{size:20,className:"animate-spin text-indigo-600"}),e.jsx("span",{className:"text-xs",children:s==="zh"?"正在查询原始数据...":"Loading raw data..."})]}):Array.isArray(he)&&he.length>0?e.jsx("div",{className:"space-y-3 font-mono text-[11px] max-h-[40vh] overflow-y-auto pr-1 scrollbar-thin",children:he.map((t,r)=>{let l={};try{l=typeof t.payload_json=="string"?JSON.parse(t.payload_json):t.payload_json}catch{}return e.jsxs("div",{className:"p-3 bg-slate-900 text-slate-200 rounded-xl border border-slate-800 flex flex-col gap-1.5",children:[e.jsxs("div",{className:"flex justify-between items-center text-[10px] text-slate-400 border-b border-slate-800 pb-1",children:[e.jsx("span",{className:"font-bold text-indigo-400 bg-indigo-950/50 border border-indigo-900/50 px-1.5 py-0.5 rounded",children:t.event_type}),e.jsx("span",{children:new Date(t.created_at).toLocaleTimeString()})]}),e.jsx("pre",{className:"overflow-x-auto text-[10px] leading-relaxed p-1 text-emerald-400/90 whitespace-pre-wrap word-break-all",children:JSON.stringify(l,null,2)})]},t.id||r)})}):e.jsx("div",{className:"py-8 text-center text-xs text-slate-400 italic",children:s==="zh"?"该学生未产生任何轨迹事件数据。":"No trace events captured."})]})]}),e.jsxs("div",{className:"bg-slate-50 px-6 py-4 border-t border-slate-100 flex justify-between gap-3 shrink-0",children:[e.jsxs("div",{className:"text-[10px] text-slate-400 flex items-center gap-1",children:[e.jsx(Ee,{size:10}),e.jsx("span",{children:"Powered by LMS Bridge API v1"})]}),e.jsx("button",{onClick:()=>me(null),className:"px-4 py-1.5 bg-slate-200 hover:bg-slate-300 text-slate-700 font-bold rounded-lg text-xs transition-all cursor-pointer shadow-sm active:scale-95",children:s==="zh"?"关闭窗口":"Close"})]})]})})]})}export{Tt as LiveClassroomView};
1
+ import{r as c,j as e,R as Xe}from"./vendor-react-0Lg0vA-4.js";import{ae as X,O as Ee,ab as Ye,C as Ze,ai as et,F as we,au as tt,U as st,ap as rt,b as at,D as Me,av as it,ao as Ae,ag as Pe,S as De,a3 as nt,m as lt,n as ot,o as dt,aw as ct,P as Te,_ as xt,i as Ne,k as Ce,ad as mt,N as ht,y as pt,af as ft,s as ut,I as gt}from"./vendor-icons-_c3xpwjZ.js";import{L as bt}from"./LazyWhiteboard-B6rDWBFb.js";import{l as jt,r as Nt}from"./index-D8x6bUeG.js";import"./vendor-pdf-CVyNPGVr.js";import"./vendor-utils-4FcTwKPj.js";import"./vendor-motion-DjY2czvL.js";import"./vendor-charts-B7ViBL9w.js";function wt({lessonId:d,lang:L,addToast:T}){const[oe,N]=c.useState(!1),[Y,s]=c.useState(!1),[w,M]=c.useState([]),[A,f]=c.useState(60),[U,S]=c.useState(40),[$,_]=c.useState({}),[R,Z]=c.useState({}),[y,V]=c.useState({}),[q,I]=c.useState({}),[C,G]=c.useState({}),[g,O]=c.useState({}),o=L==="zh",F=async(a=!1)=>{a?s(!0):N(!0);try{const h=await(await fetch(`/api/lessons/${d}/eval-grades`)).json();if(Array.isArray(h)){M(h);const u={},v={},b={},j={};h.forEach(n=>{n.grade?(u[n.id]=n.grade.teacher_score,v[n.id]=n.grade.teacher_comment,b[n.id]=Math.round(n.grade.teacher_weight*100),j[n.id]=Math.round(n.grade.peer_weight*100)):(u[n.id]=$[n.id]!==void 0?$[n.id]:80,v[n.id]=R[n.id]!==void 0?R[n.id]:"",b[n.id]=y[n.id]!==void 0?y[n.id]:A,j[n.id]=q[n.id]!==void 0?q[n.id]:U)}),_(n=>({...u,...n})),Z(n=>({...v,...n})),V(n=>({...b,...n})),I(n=>({...j,...n}))}else throw new Error("Invalid submissions data format")}catch(m){console.error("Error fetching submissions grades:",m),T(o?"数据加载失败":"Failed to Load Data",o?"请检查网络连接或刷新页面。":"Please check your connection and try again.","warning")}finally{N(!1),s(!1)}};c.useEffect(()=>{d&&F()},[d]);const ee=a=>{f(a),S(100-a),V(m=>{const h={...m};return w.forEach(u=>{(!u.grade||u.grade.status!=="confirmed")&&(h[u.id]=a)}),h}),I(m=>{const h={...m};return w.forEach(u=>{(!u.grade||u.grade.status!=="confirmed")&&(h[u.id]=100-a)}),h})},te=(a,m)=>{V(h=>({...h,[a]:m})),I(h=>({...h,[a]:100-m}))},Q=async(a,m)=>{const h=$[a],u=R[a]||"",v=(y[a]??A)/100,b=(q[a]??U)/100;if(h===void 0||isNaN(h)||h<0||h>100){T(o?"评分无效":"Invalid Score",o?"教师评分必须在 0 到 100 之间!":"Teacher score must be between 0 and 100!","warning");return}if(m==="confirmed"){const j=o?"确认同步后,最终得分将直接同步写入宿主学期成绩库,此后该学生的作业成绩将锁定不可修改。是否确认?":"Once confirmed, the final score will be synced to the host semester reports and locked. Proceed?";if(!window.confirm(j))return}O(j=>({...j,[a]:m}));try{const n=await(await fetch("/api/commands",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({commandType:"assignment.grade",payload:{submissionId:a,teacherScore:Number(h),teacherComment:u,teacherWeight:v,peerWeight:b,status:m}})})).json();if(n.success)T(m==="confirmed"?o?"平时成绩同步成功":"Semester Grade Synced":o?"平时成绩草稿已保存":"Grade Draft Saved",m==="confirmed"?o?`已将平时成绩 ${n.result.calculatedFinalScore} 分同步至学期报告!`:`Successfully synced grade ${n.result.calculatedFinalScore}!`:o?"成功保存了教师打分与评语草稿。":"Successfully saved score and comment draft.","success"),F(!0);else throw new Error(n.error||"Failed to submit grade")}catch(j){T(o?"操作失败":"Operation Failed",j.message,"warning")}finally{O(j=>({...j,[a]:null}))}},K=a=>{G(m=>({...m,[a]:!m[a]}))};return oe?e.jsxs("div",{className:"flex-grow flex flex-col items-center justify-center py-12 text-gray-500",children:[e.jsx(X,{className:"animate-spin text-indigo-500 mb-2",size:32}),e.jsx("p",{className:"text-xs",children:o?"正在读取学生作业与成绩状态...":"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(Ee,{size:16,className:"text-indigo-655"}),o?"学生作业成绩评定与折算系统":"Student Assignment Grading & Sync"]}),e.jsxs("span",{className:"text-[9px] bg-indigo-50 text-indigo-750 px-2 py-0.5 rounded-full border border-indigo-100 font-bold",children:[w.length," ",o?"个提交":"submissions"]})]}),e.jsx("button",{onClick:()=>F(!0),disabled:Y,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:o?"刷新数据":"Refresh",children:e.jsx(X,{size:12,className:Y?"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(Ye,{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:o?"全局默认折算权重设置":"Default Grading Weights Configuration"}),e.jsx("p",{className:"text-[10px] text-slate-400 mt-0.5 font-medium",children:o?"调整权重分配,所有尚未锁定成绩的学生将自动应用此默认权重比例。":"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-[11px] font-bold text-slate-500",children:o?"教师评分:":"Teacher:"}),e.jsx("input",{type:"range",min:"0",max:"100",step:"5",value:A,onChange:a=>ee(Number(a.target.value)),className:"w-20 accent-indigo-650 cursor-pointer"}),e.jsxs("span",{className:"text-xs font-bold text-indigo-700 w-8 text-right",children:[A,"%"]})]}),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-[11px] font-bold text-slate-500",children:o?"学生互评:":"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:w.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(Ze,{size:32,className:"text-slate-350"}),e.jsx("p",{className:"text-xs",children:o?"本节课目前没有任何学生提交作业。":"No students have submitted assignments yet for this lesson."})]}):w.map(a=>{const m=$[a.id]!==void 0?$[a.id]:80,h=R[a.id]||"",u=y[a.id]??A,v=q[a.id]??U,b=a.grade?.status==="confirmed",j=Math.round(m*(u/100)+a.peerAverageScore*(v/100));return e.jsxs("div",{className:`bg-white border rounded-xl shadow-3xs overflow-hidden transition-all ${b?"border-emerald-200 bg-emerald-50/5":"border-slate-200"}`,children:[e.jsxs("div",{className:"px-4 py-3 bg-slate-50/50 border-b border-slate-100 flex flex-col md:flex-row md:items-center justify-between gap-3",children:[e.jsxs("div",{className:"flex items-center gap-2.5",children:[e.jsx("div",{className:"w-8 h-8 rounded-full bg-indigo-50 border border-indigo-100 flex items-center justify-center text-indigo-700 font-bold text-xs select-none",children:a.studentName?.charAt(0)||"S"}),e.jsxs("div",{children:[e.jsx("div",{className:"text-xs font-bold text-slate-800",children:a.studentName}),e.jsxs("div",{className:"text-[9px] text-slate-400 font-mono mt-0.5 flex items-center gap-1.5",children:[e.jsxs("span",{children:["V",a.version]}),e.jsx("span",{children:"•"}),e.jsx("span",{children:new Date(a.updatedAt).toLocaleString()})]})]})]}),e.jsxs("div",{className:"flex items-center gap-2",children:[b?e.jsxs("span",{className:"bg-emerald-55 text-emerald-700 text-[10px] 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(et,{size:12}),o?"成绩已同步":"Synced to Reports"]}):e.jsx("span",{className:"bg-amber-50 text-amber-805 text-[10px] font-bold px-2 py-0.5 rounded-full border border-amber-200/60 select-none",children:a.grade?o?"草稿状态":"Draft":o?"未评定":"Ungraded"}),e.jsxs("a",{href:a.filePath,target:"_blank",rel:"noopener noreferrer",className:"text-[10px] text-indigo-600 hover:text-indigo-850 font-medium hover:underline flex items-center gap-1 bg-white border border-slate-200 px-2 py-1 rounded-lg shadow-4xs",title:a.filePath,children:[e.jsx(we,{size:11}),o?"查看作业":"View File",e.jsx(tt,{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-[11px] font-bold text-slate-650 flex items-center gap-1 select-none",children:[e.jsx(st,{size:13,className:"text-slate-400"}),o?"学生互评详情":"Peer Review Details"]}),e.jsxs("span",{className:"text-[10px] font-bold text-slate-500 bg-slate-100 px-2 py-0.5 rounded-md",children:[o?"互评人数:":"Reviews:"," ",a.peerReviews.length]})]}),e.jsxs("div",{className:"bg-slate-50 border border-slate-100 rounded-xl p-3 flex items-center gap-3",children:[e.jsxs("div",{className:"bg-white border border-slate-200 w-12 h-12 rounded-lg flex flex-col items-center justify-center shrink-0 shadow-3xs",children:[e.jsx("span",{className:"text-[9px] text-slate-405 select-none font-bold",children:o?"均分":"Avg"}),e.jsx("span",{className:"text-sm font-extrabold text-slate-700 leading-none mt-0.5",children:a.peerAverageScore})]}),e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsx("p",{className:"text-[10px] text-slate-450 leading-normal font-medium",children:a.peerReviews.length>0?o?"根据同学互评分数得出的平均值。":"Average score computed from classmate evaluations.":o?"暂无同学对此作业给出评分。":"No classmate peer reviews received yet."}),a.peerReviews.length>0&&e.jsx("button",{onClick:()=>K(a.id),className:"text-[10px] text-indigo-650 hover:text-indigo-800 font-bold mt-1.5 flex items-center gap-0.5 cursor-pointer outline-none",children:C[a.id]?e.jsxs(e.Fragment,{children:[o?"收起互评详情":"Hide Details"," ",e.jsx(rt,{size:12})]}):e.jsxs(e.Fragment,{children:[o?"展开互评详情":"Show Details"," ",e.jsx(at,{size:12})]})})]})]}),C[a.id]&&a.peerReviews.length>0&&e.jsx("div",{className:"mt-2 space-y-2 border-t border-slate-100 pt-2.5 max-h-40 overflow-y-auto scrollbar-thin",children:a.peerReviews.map(n=>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"}),n.reviewer_name]}),e.jsxs("span",{className:"text-indigo-650 bg-indigo-50 border border-indigo-100 rounded px-1.5 py-0.5 text-[10px]",children:[n.score," ",o?"分":"pts"]})]}),n.comment&&e.jsxs("p",{className:"text-[10px] text-slate-550 mt-1 italic pl-2.5 border-l-2 border-slate-100 font-medium",children:['"',n.comment,'"']})]},n.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-[10px] font-bold text-slate-650 mb-1 select-none",children:o?"教师平时分评分 (0-100)":"Teacher Score (0-100)"}),e.jsxs("div",{className:"flex gap-2",children:[e.jsx("input",{id:`teacher_score_input_${a.id}`,type:"number",min:"0",max:"100",disabled:b,value:m,onChange:n=>_(J=>({...J,[a.id]:Math.min(100,Math.max(0,Number(n.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:b,value:m,onChange:n=>_(J=>({...J,[a.id]:Number(n.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-[10px] font-bold text-slate-600 select-none",children:o?"打分占比 (教师权重)":"Teacher Score Weight"}),e.jsx("span",{className:"text-[10px] font-bold text-slate-400",children:o?`学生互评: ${v}%`:`Peer: ${v}%`})]}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("input",{id:`teacher_weight_input_${a.id}`,type:"range",min:"0",max:"100",step:"5",disabled:b,value:u,onChange:n=>te(a.id,Number(n.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:[u,"%"]})]})]})]}),e.jsxs("div",{children:[e.jsx("label",{className:"block text-[10px] font-bold text-slate-655 mb-1 select-none",children:o?"教师评价评语":"Teacher Comments & Feedback"}),e.jsx("textarea",{id:`teacher_comment_input_${a.id}`,disabled:b,value:h,placeholder:o?"在此输入对学生作业作品的改进指导意见及评语。":"Enter guiding feedback for this student.",onChange:n=>Z(J=>({...J,[a.id]:n.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 ${b?"bg-emerald-50 text-emerald-600 border-emerald-100":"bg-indigo-50 text-indigo-700 border-indigo-100"}`,children:e.jsx(Me,{size:14})}),e.jsxs("div",{className:"text-[10px] text-slate-500 font-medium",children:[e.jsxs("div",{children:[o?"平时总分计算公式":"Calculated Final Grade",":"]}),e.jsxs("div",{className:"font-bold text-slate-700 mt-0.5 animate-formula",children:[u,"% × ",e.jsx("span",{className:"text-indigo-650 font-bold",children:m}),a.peerReviews.length>0&&` + ${v}% × ${a.peerAverageScore}`," = ",e.jsx("span",{className:b?"text-emerald-700 font-black text-xs":"text-indigo-700 font-black text-xs",children:b&&a.grade?.calculated_final_score||j}),o?"分":" pts"]})]})]}),!b&&e.jsxs("div",{className:"flex gap-2 justify-end shrink-0",children:[e.jsxs("button",{id:`teacher_draft_btn_${a.id}`,type:"button",disabled:!!g[a.id],onClick:()=>Q(a.id,"draft"),className:"px-3 py-1.5 bg-white border border-slate-350 rounded-lg text-xs font-bold text-slate-700 hover:bg-slate-55 flex items-center gap-1.5 shadow-4xs cursor-pointer select-none disabled:opacity-50",children:[e.jsx(it,{size:12}),g[a.id]==="draft"?o?"保存中...":"Saving...":o?"暂存草稿":"Save Draft"]}),e.jsxs("button",{id:`teacher_confirm_btn_${a.id}`,type:"button",disabled:!!g[a.id],onClick:()=>Q(a.id,"confirmed"),className:"px-3.5 py-1.5 bg-indigo-600 border border-indigo-700 rounded-lg text-xs font-bold text-white hover:bg-indigo-700 flex items-center gap-1.5 shadow-3xs cursor-pointer select-none disabled:opacity-50",children:[e.jsx(Ae,{size:12}),g[a.id]==="confirmed"?o?"同步中...":"Syncing...":o?"确认并同步":"Confirm & Sync"]})]})]})]})]})]},a.id)})})]})}function yt({name:d,...L}){const T=gt[d];return T?Xe.createElement(T,L):e.jsx(ut,{...L})}function Tt({selectedLesson:d,setSelectedLesson:L,lessons:T,classes:oe,students:N,plugins:Y,lang:s,timelineSegments:w,activeSegmentId:M,setActiveSegmentId:A,liveClassSelectedClassId:f,setLiveClassSelectedClassId:U,liveClassIsActive:S,setLiveClassIsActive:$,liveClassTimeRemaining:_,setLiveClassTimeRemaining:R,liveClassFeed:Z,setLiveClassFeed:y,liveClassAcknowledgedMap:V,setLiveClassAcknowledgedMap:q,elements:I,fetchElements:C,fetchStudents:G,addToast:g,onlineStudentIds:O,activeStudentLessons:o,liveClassStudentProgress:F,onPingStudent:ee,onOpenCoursewareHub:te,activeRole:Q,setActiveRole:K}){const[a,m]=c.useState(!1),[h,u]=c.useState(!1),[v,b]=c.useState(null),[j,n]=c.useState(!1),[J,ye]=c.useState(null),[Re,ve]=c.useState([]),de=c.useRef(null),se=c.useRef({lesson:null,classId:null}),[B,ce]=c.useState("whiteboard"),[re,Oe]=c.useState([]),[xe,ze]=c.useState(!1),[E,me]=c.useState(null),[he,ae]=c.useState(null),[We,ke]=c.useState(!1),[ie,Fe]=c.useState("all"),[pe,Je]=c.useState(""),ne=async()=>{ze(!0);try{const t=await fetch("/api/courseware/attempts");if(t.ok){const r=await t.json();Oe(r)}}catch(t){console.error("Failed to fetch attempts",t)}finally{ze(!1)}};c.useEffect(()=>{B==="submissions"&&ne()},[B]),c.useEffect(()=>{const t=jt();return t.on("courseware-attempt-updated",()=>{ne()}),()=>{t.disconnect()}},[]);const Be=async t=>{if(!d||!f){g(s==="zh"?"⚠️ 无法操作":"⚠️ Action Prevented",s==="zh"?"请先在顶部栏选择要绑定的课节和班级。":"Please select lesson and class first.","warning");return}try{const r=await fetch(`/api/courseware/attempts/${t}/promote`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({lessonId:d,classId:f})});if(r.ok){const l=await r.json();g(s==="zh"?"✓ 学习数据已保存":"✓ Data Recorded",s==="zh"?`成功将该数据存入数据库!分数: ${l.score},已同步更新至学生学习进度。`:`Successfully recorded submission! Score: ${l.score}.`,"success"),ne(),G&&G()}else{const l=await r.json();throw new Error(l.error||"Server error")}}catch(r){g(s==="zh"?"❌ 保存失败":"❌ Save Failed",r.message||"Error occurred while saving.","warning")}},Le=async t=>{me(t),ke(!0),ae(null);try{const r=await fetch(`/api/courseware/attempts/${t.attemptId}/raw`);if(r.ok){const l=await r.json();ae(l)}else ae({error:"Failed to load raw data"})}catch(r){ae({error:r.message||"Error loading data"})}finally{ke(!1)}},le=!!(f&&N.filter(t=>t.locked_lesson_id===d).length>0),Ue=Y.filter(t=>t.status==="active"),fe=Array.from(new Map(Ue.flatMap(t=>{try{const r=typeof t.manifest=="string"?JSON.parse(t.manifest):t.manifest,l=r.classroomTools||[],i=r.contributes?.["classroom.tool"]||[];return[...l,...i].map(x=>({...x,pluginId:t.id,manifestId:r.id}))}catch{return[]}}).map(t=>[t.id,t])).values());c.useEffect(()=>(S&&_>0?de.current=setInterval(()=>{R(_-1)},1e3):_===0&&S&&(g(s==="zh"?"⏰ 环节时间到":"⏰ Phase Timer Ended",s==="zh"?"当前教学环节设定的时间已耗尽,建议转入下一环节。":"The current segment duration has elapsed. Transition recommended.","warning"),$(!1)),()=>{de.current&&clearInterval(de.current)}),[S,_]),c.useEffect(()=>{if(!d||!f){se.current={lesson:null,classId:null};return}(se.current.lesson!==d||se.current.classId!==f)&&(se.current={lesson:d,classId:f},Se(!0))},[d,f]);const Ge=t=>{const r=parseInt(t.replace(/[^0-9]/g,""));return isNaN(r)?300:t.includes("s")?r:r*60},Ve=t=>{A(t.id);const r=Ge(t.duration);R(r),$(!0),y(l=>[{id:Math.random().toString(),time:new Date().toLocaleTimeString([],{hour:"2-digit",minute:"2-digit",second:"2-digit"}),type:"info",message:`教学环节切换并广播:进入 [${t.title}] 环节,设定时间 ${t.duration}。`},...l]),g(s==="zh"?"📢 环节已广播":"📢 Phase Synchronized",s==="zh"?`已同步广播 [${t.title}] 环节至所有在线学生端。`:`Broadcasted phase [${t.title}] to all active students.`,"success")},Se=async t=>{if(!f||!d){g(s==="zh"?"⚠️ 无法操作":"⚠️ Action Prevented",s==="zh"?"请先选择需要授课的课节及班级。":"Please select a lesson and class first.","warning");return}m(!0);try{const r=t?`/api/classes/${f}/lock_lesson`:`/api/classes/${f}/unlock_lesson`;(await fetch(r,{method:"POST",headers:{"Content-Type":"application/json"},body:t?JSON.stringify({lessonId:d}):void 0})).ok&&(await G(),y(i=>[{id:Math.random().toString(),time:new Date().toLocaleTimeString([],{hour:"2-digit",minute:"2-digit",second:"2-digit"}),type:t?"warning":"info",message:t?"已对全班学生强制锁定专注模式(限定当前课程)。":"已解锁全班学生专注模式限制。"},...i]),g(s==="zh"?"🔒 锁状态更新":"🔒 Class Status Updated",t?"全班专注锁定成功,学生将无法切回主页。":"全班屏幕解锁成功,学生已恢复自由浏览。","success"))}catch(r){console.error("Failed to toggle class focus lock",r)}finally{m(!1)}},qe=async(t,r)=>{const l=r?null:d;try{if((await fetch(`/api/students/${t}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({locked_lesson_id:l})})).ok){await G();const x=N.find(p=>p.id===t)?.name||t;y(p=>[{id:Math.random().toString(),time:new Date().toLocaleTimeString([],{hour:"2-digit",minute:"2-digit",second:"2-digit"}),type:l?"warning":"info",message:l?`已针对学生 [${x}] 单独开启专注限制锁定。`:`已解锁学生 [${x}] 的专注限制。`},...p])}}catch(i){console.error("Failed to toggle student lock",i)}},Ie=async t=>{if(!d){g(s==="zh"?"⚠️ 请选择课节":"⚠️ Select Lesson",s==="zh"?"请先选择要授课的课节。":"Please select a lesson first.","warning");return}if(JSON.stringify(t.payload||"").includes("$classId")&&!f){g(s==="zh"?"⚠️ 请选择班级":"⚠️ Select Class",s==="zh"?"该工具需要指定上课班级,请在顶部先选择班级。":"Please select class first for this tool.","warning");return}y(l=>[{id:Math.random().toString(),time:new Date().toLocaleTimeString([],{hour:"2-digit",minute:"2-digit",second:"2-digit"}),type:"info",message:`正在运行插件工具 [${t.name}]...`},...l]);try{const l=JSON.parse(JSON.stringify(t.payload||{}).replace(/\$classId/g,f||"").replace(/\$lessonId/g,d||""));if(l.type==="plugin"&&l.data)try{const z=JSON.parse(l.data);!z.segmentId&&M&&(z.segmentId=M,l.data=JSON.stringify(z))}catch{}const x=!/^(whiteboard|lesson|assignment|class|student|vfs|plugin|ai|agent|system)\./.test(t.commandType)&&t.manifestId?Nt(t.commandType,t.manifestId):t.commandType,p=await fetch("/api/commands",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({commandType:x,payload:l})});if(p.ok)te&&(t.id==="courseware-hub-teacher"||t.commandType==="courseware.open_panel")&&te(),y(z=>[{id:Math.random().toString(),time:new Date().toLocaleTimeString([],{hour:"2-digit",minute:"2-digit",second:"2-digit"}),type:"success",message:`插件工具 [${t.name}] 执行完毕,数据成功下发。`},...z]),g(s==="zh"?"✓ 工具下发成功":"✓ Tool Synchronized",s==="zh"?`工具 [${t.name}] 已成功在当前白板上部署并投射。`:`Tool [${t.name}] synchronized successfully.`,"success"),await C(d);else{const z=await p.json();throw new Error(z.error||"Server error")}}catch(l){y(i=>[{id:Math.random().toString(),time:new Date().toLocaleTimeString([],{hour:"2-digit",minute:"2-digit",second:"2-digit"}),type:"error",message:`运行插件工具 [${t.name}] 失败: ${l.message}`},...i]),g(s==="zh"?"❌ 运行失败":"❌ Tool Failed",l.message||"Execution error","warning")}},Qe=()=>{if(N.length===0||j)return;const t=N.filter(p=>O.includes(p.id)&&o[p.id]===d);if(t.length===0){g(s==="zh"?"⚠️ 无法抽问":"⚠️ Cannot Draw",s==="zh"?"当前课堂中没有已进入的活跃学生。":"No students have entered the classroom yet.","warning");return}n(!0);let r=0;const l=18;let i=75;const x=()=>{const p=Math.floor(Math.random()*t.length),z=t[p];if(ye(z.id),r++,r<l)r>l-5&&(i+=45),setTimeout(x,i);else{const k=t[p];ye(null),n(!1),ve(P=>P.includes(k.id)?P:[...P,k.id]),y(P=>[{id:Math.random().toString(),time:new Date().toLocaleTimeString([],{hour:"2-digit",minute:"2-digit",second:"2-digit"}),type:"success",message:`🎯 随机提问抽选:学生 [${k.name}] 被抽中回答问题!`},...P]),g(s==="zh"?"🎯 随机提问抽选":"🎯 Student Drawn",s==="zh"?`恭喜学生 [${k.name}] 被抽中回答问题!`:`Student [${k.name}] was selected to answer!`,"success"),setTimeout(()=>{ve(P=>P.filter(ue=>ue!==k.id))},8e3)}};setTimeout(x,i)},Ke=t=>{const r=Math.floor(t/60),l=t%60;return`${r.toString().padStart(2,"0")}:${l.toString().padStart(2,"0")}`};return e.jsxs("div",{className:"flex-grow flex-1 flex flex-col min-h-0 bg-white border border-slate-200 rounded-2xl shadow-xl text-slate-800 overflow-hidden font-sans",children:[e.jsxs("div",{className:"bg-slate-50 p-4 border-b border-slate-200 flex flex-wrap items-center justify-between gap-4 shrink-0",children:[e.jsxs("div",{className:"flex items-center gap-3 select-none",children:[e.jsxs("div",{className:"relative flex items-center justify-center",children:[e.jsx("span",{className:`w-3 h-3 rounded-full ${S?"bg-emerald-500 animate-ping":"bg-rose-500"} absolute`}),e.jsx("span",{className:`w-2 h-2 rounded-full ${S?"bg-emerald-500":"bg-rose-500"} relative`})]}),e.jsx("h2",{className:"text-sm font-extrabold tracking-tight text-slate-800 flex items-center gap-2",children:s==="zh"?"🔴 智能授课工作流控制中心":"🔴 Active Lesson control center"})]}),e.jsxs("div",{className:"flex items-center gap-2.5 flex-wrap",children:[e.jsx("div",{children:e.jsxs("select",{value:d||"",onChange:t=>{const r=t.target.value===""?null:t.target.value;L(r),r&&C(r)},className:"bg-white border border-slate-200 rounded-lg text-xs font-semibold px-3 py-1.5 focus:ring-1 focus:ring-indigo-500 text-slate-700 outline-none cursor-pointer hover:bg-slate-100 transition-colors",children:[e.jsx("option",{value:"",children:s==="zh"?"-- 选择授课课节 --":"-- Select Lesson --"}),T.map(t=>e.jsx("option",{value:t.id,children:t.title},t.id))]})}),e.jsx("div",{children:e.jsxs("select",{value:f||"",onChange:t=>U(t.target.value===""?null:t.target.value),className:"bg-white border border-slate-200 rounded-lg text-xs font-semibold px-3 py-1.5 focus:ring-1 focus:ring-indigo-500 text-slate-700 outline-none cursor-pointer hover:bg-slate-100 transition-colors",children:[e.jsx("option",{value:"",children:s==="zh"?"-- 选择授课班级 --":"-- Select Class --"}),oe.map(t=>e.jsx("option",{value:t.id,children:t.name},t.id))]})}),e.jsxs("div",{className:"flex items-center gap-2",children:[K&&e.jsxs("div",{className:"bg-slate-200/80 p-0.5 rounded-lg flex items-center gap-0.5 border border-slate-300/60 shadow-3xs",children:[e.jsxs("button",{onClick:()=>K("teacher"),className:`px-2.5 py-1 text-[11px] font-bold rounded transition-all cursor-pointer ${Q==="teacher"?"bg-white text-indigo-700 shadow-2xs font-extrabold":"text-slate-600 hover:text-slate-900"}`,children:["👨‍🏫 ",s==="zh"?"教师模式":"Teacher Mode"]}),e.jsxs("button",{onClick:()=>K("student"),className:`px-2.5 py-1 text-[11px] font-bold rounded transition-all cursor-pointer ${Q==="student"?"bg-pink-600 text-white shadow-2xs font-extrabold":"text-slate-600 hover:text-slate-900"}`,children:["🎓 ",s==="zh"?"学生模式":"Student Mode"]})]}),e.jsxs("button",{onClick:()=>Se(!le),disabled:a||!d||!f,className:`px-3 py-1.5 rounded-lg font-bold text-[11px] uppercase tracking-wider flex items-center gap-1.5 shadow-sm transition-all active:scale-95 disabled:opacity-50 cursor-pointer ${le?"bg-rose-500 hover:bg-rose-600 text-white":"bg-indigo-600 hover:bg-indigo-700 text-white"}`,children:[le?e.jsx(Pe,{size:12}):e.jsx(De,{size:12}),e.jsx("span",{children:le?s==="zh"?"一键解锁全班":"Unlock Entire Class":s==="zh"?"全班专注锁定":"Lock Class Screen"})]})]})]})]}),e.jsxs("div",{className:"flex-1 flex overflow-hidden min-h-0 bg-slate-50/30",children:[!h&&e.jsxs("div",{className:"w-[220px] shrink-0 bg-white p-3.5 border-r border-slate-200/80 flex flex-col gap-4 overflow-y-auto",children:[e.jsxs("div",{children:[e.jsxs("div",{className:"flex items-center justify-between mb-2 select-none",children:[e.jsx("h3",{className:"text-[10px] font-black uppercase text-slate-400 tracking-wider",children:s==="zh"?"教学步骤与时间管理":"Lesson Segments & Phases"}),e.jsx("button",{onClick:()=>u(!0),className:"p-1 rounded bg-slate-50 hover:bg-slate-100 border border-slate-200 text-slate-500 hover:text-slate-700 transition-colors cursor-pointer",title:s==="zh"?"折叠导航栏":"Collapse Sidebar",children:e.jsx(nt,{size:10})})]}),e.jsxs("div",{className:"bg-slate-50 border border-slate-150 rounded-xl p-3 flex flex-col items-center justify-center gap-1 shadow-sm",children:[e.jsxs("span",{className:"text-[9.5px] uppercase tracking-widest text-slate-505 font-semibold flex items-center gap-1",children:[e.jsx(lt,{size:11,className:S?"animate-spin":"",style:{animationDuration:"4s"}}),s==="zh"?"当前步骤剩余时间":"Phase Remaining"]}),e.jsx("div",{className:`text-2xl font-black font-mono tracking-widest ${S?"text-indigo-650":"text-slate-450"}`,children:Ke(_)}),e.jsxs("div",{className:"flex gap-1.5 w-full mt-2 shrink-0",children:[e.jsxs("button",{onClick:()=>$(!S),disabled:_<=0,className:"flex-1 py-1 rounded bg-slate-100 hover:bg-slate-205 text-[10px] font-bold text-slate-700 transition-all disabled:opacity-40 flex items-center justify-center gap-1 border border-slate-200",children:[S?e.jsx(ot,{size:10}):e.jsx(dt,{size:10}),e.jsx("span",{children:S?s==="zh"?"暂停":"Pause":s==="zh"?"开始":"Start"})]}),e.jsx("button",{onClick:()=>{$(!1),R(0)},className:"py-1 px-2.5 rounded bg-slate-100 hover:bg-rose-50 text-[10px] font-bold text-rose-600 hover:text-rose-700 transition-all flex items-center justify-center border border-slate-200",title:"重置",children:e.jsx(ct,{size:10})})]})]})]}),e.jsxs("div",{className:"flex-1 flex flex-col gap-2 min-h-0",children:[e.jsx("h4",{className:"text-[10px] font-black uppercase text-slate-400 tracking-wider select-none",children:s==="zh"?"教学环节进度表":"Timeline Segments"}),d?e.jsx("div",{className:"space-y-2 overflow-y-auto flex-1 pr-1.5 scrollbar-thin",children:w.map((t,r)=>{const l=M===t.id;return e.jsxs("div",{className:`p-2.5 rounded-xl border transition-all flex flex-col gap-1.5 ${l?"bg-indigo-50/50 border-indigo-250 shadow-sm":"bg-white border-slate-200 hover:bg-slate-50 hover:border-slate-300"}`,children:[e.jsxs("div",{className:"flex justify-between items-start",children:[e.jsxs("span",{className:`text-[11.5px] font-bold ${l?"text-indigo-900":"text-slate-800"}`,children:[r+1,". ",t.title]}),e.jsx("span",{className:"text-[9px] font-mono px-1 py-0.5 rounded bg-slate-100 text-slate-550 border border-slate-200/50",children:t.duration})]}),e.jsx("div",{className:`text-[9.5px] line-clamp-2 leading-relaxed ${l?"text-indigo-750":"text-slate-450"}`,children:t.notes||"无步骤描述备注信息。"}),e.jsxs("button",{onClick:()=>Ve(t),className:`w-full py-1 rounded text-[10px] font-bold transition-all cursor-pointer flex items-center justify-center gap-1 ${l?"bg-indigo-600 text-white hover:bg-indigo-700 shadow-sm":"bg-slate-100 text-slate-600 hover:bg-slate-200 border border-slate-200/60"}`,children:[e.jsx(Te,{size:10}),e.jsx("span",{children:l?s==="zh"?"同步演示中":"Broadcasting":s==="zh"?"广播此环节":"Broadcast Step"})]})]},t.id)})}):e.jsx("div",{className:"text-xs text-slate-400 italic py-4 text-center",children:s==="zh"?"请选择一个课节加载流程表":"Select a lesson to view schedule."})]})]}),e.jsx("div",{className:"flex-1 flex flex-col min-w-0 bg-slate-100 p-3 gap-3 relative",children:d?e.jsxs("div",{className:"w-full h-full relative flex flex-col min-h-0",children:[e.jsxs("div",{className:"flex justify-between items-center px-1.5 py-1 select-none text-slate-500 text-[10px] uppercase font-extrabold tracking-wide shrink-0 mb-1",children:[e.jsxs("div",{className:"flex items-center gap-3",children:[h&&e.jsxs("button",{onClick:()=>u(!1),className:"p-1 rounded-lg bg-white hover:bg-slate-100 border border-slate-205 text-indigo-650 hover:text-indigo-700 transition-colors cursor-pointer mr-1.5 flex items-center gap-1 shadow-sm",title:s==="zh"?"展开环节大纲":"Expand Sidebar",children:[e.jsx(xt,{size:10}),e.jsx("span",{className:"text-[9px] font-bold tracking-wider",children:s==="zh"?"展开":"Expand"})]}),e.jsxs("div",{className:"bg-slate-200/60 p-0.5 rounded-lg flex items-center gap-1",children:[e.jsx("button",{onClick:()=>ce("whiteboard"),className:`px-3 py-1 rounded-md text-[10px] font-bold transition-all cursor-pointer ${B==="whiteboard"?"bg-white text-indigo-700 shadow-sm":"text-slate-500 hover:text-slate-700"}`,children:s==="zh"?"💻 演示白板":"💻 Whiteboard"}),e.jsx("button",{onClick:()=>ce("submissions"),className:`px-3 py-1 rounded-md text-[10px] font-bold transition-all cursor-pointer ${B==="submissions"?"bg-white text-indigo-700 shadow-sm":"text-slate-500 hover:text-slate-700"}`,children:s==="zh"?"📊 学生提交数据":"📊 Student Submissions"}),e.jsx("button",{id:"teacher_assignment_eval_tab_btn",onClick:()=>ce("assignment"),className:`px-3 py-1 rounded-md text-[10px] font-bold transition-all cursor-pointer ${B==="assignment"?"bg-white text-indigo-700 shadow-sm":"text-slate-500 hover:text-slate-700"}`,children:s==="zh"?"🎓 作业成绩评定":"🎓 Assignment Grades"})]})]}),e.jsxs("span",{className:"text-indigo-655 font-mono tracking-widest animate-pulse flex items-center gap-1",children:[e.jsx(Ne,{size:10})," Live Broadcaster Connected"]})]}),B==="whiteboard"?e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"flex-grow flex-1 min-h-0 w-full relative rounded-xl overflow-hidden border border-slate-200 shadow-md bg-white flex flex-col",children:e.jsx(bt,{lessonId:d,userRole:"teacher",isEditMode:!1,elements:I,activeSegmentId:M,onSegmentSync:t=>A(t),onElementAdd:async(t,r)=>{await fetch(`/api/lessons/${d}/whiteboard`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({type:t,data:r})}),C(d)},onElementUpdate:async(t,r)=>{await fetch(`/api/lessons/${d}/whiteboard/${t}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({data:r})}),C(d)},onElementDelete:async t=>{await fetch(`/api/lessons/${d}/whiteboard/${t}`,{method:"DELETE"}),C(d)},onRefresh:()=>C(d)})}),e.jsxs("div",{className:"mt-3 bg-white border border-slate-200 rounded-xl p-3 shadow-sm shrink-0 flex flex-col gap-2 relative z-30",children:[e.jsxs("div",{className:"flex items-center justify-between text-[10px] uppercase font-black text-slate-555 tracking-wider select-none",children:[e.jsxs("span",{className:"flex items-center gap-1.5 text-indigo-655",children:[e.jsx(Ce,{size:12,className:"text-indigo-600 animate-pulse"}),e.jsx("span",{children:s==="zh"?"互动工具 (插件扩展)":"Classroom Interactive Tools"})]}),e.jsxs("span",{className:"text-[8.5px] text-slate-400 font-mono",children:["Plugins: ",fe.length," Active"]})]}),fe.length>0?e.jsx("div",{className:"flex gap-2.5 overflow-x-auto py-0.5 pr-2 scrollbar-thin",children:fe.map(t=>e.jsxs("button",{onClick:()=>Ie(t),disabled:!d,className:"p-2 bg-slate-50 hover:bg-slate-105 border border-slate-205 hover:border-indigo-200 rounded-xl text-left transition-all active:scale-[0.98] disabled:opacity-40 flex items-center gap-2.5 w-44 shrink-0 group cursor-pointer",title:t.description,children:[e.jsx("div",{className:"p-1.5 bg-indigo-50 text-indigo-650 group-hover:bg-indigo-100 group-hover:text-indigo-700 rounded-lg border border-indigo-100 shrink-0 transition-colors",children:e.jsx(yt,{name:t.icon,size:14})}),e.jsxs("div",{className:"min-w-0 flex-1",children:[e.jsx("div",{className:"text-xs font-bold text-slate-700 group-hover:text-slate-900 truncate",children:t.name}),e.jsx("div",{className:"text-[9px] text-slate-400 group-hover:text-slate-555 truncate mt-0.5",children:t.description})]})]},t.id))}):e.jsx("div",{className:"text-center py-2 text-[10px] text-slate-400 italic",children:s==="zh"?"暂无可用的互动工具。请在应用商店启用插件。":"No plugin tools loaded."})]})]}):B==="submissions"?e.jsxs("div",{className:"flex-grow flex-1 min-h-0 w-full relative rounded-xl overflow-hidden border border-slate-200 shadow-md bg-white flex flex-col p-4",children:[e.jsxs("div",{className:"flex justify-between items-center mb-4 gap-3 shrink-0",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("span",{className:"text-xs font-bold text-slate-700",children:s==="zh"?"学生互动提交数据列表":"Student Submissions"}),re.length>0&&e.jsxs("span",{className:"text-[9px] bg-indigo-50 text-indigo-750 px-2 py-0.5 rounded-full border border-indigo-100 font-bold",children:[re.length," ",s==="zh"?"条记录":"records"]})]}),e.jsxs("div",{className:"flex items-center gap-2 flex-wrap",children:[e.jsxs("div",{className:"relative",children:[e.jsx("input",{type:"text",placeholder:s==="zh"?"搜索学生或课件...":"Search student or courseware...",value:pe,onChange:t=>Je(t.target.value),className:"bg-white border border-slate-200 rounded-lg text-xs pl-8 pr-3 py-1.5 focus:ring-1 focus:ring-indigo-500 text-slate-700 outline-none w-44 transition-all"}),e.jsx(mt,{size:12,className:"absolute left-2.5 top-2.5 text-slate-400"})]}),e.jsxs("select",{value:ie,onChange:t=>Fe(t.target.value),className:"bg-white border border-slate-200 rounded-lg text-xs px-3 py-1.5 focus:ring-1 focus:ring-indigo-500 text-slate-700 outline-none cursor-pointer hover:bg-slate-50 transition-colors",children:[e.jsx("option",{value:"all",children:s==="zh"?"全部状态":"All Status"}),e.jsx("option",{value:"submitted",children:s==="zh"?"已提交/完成":"Submitted/Finished"}),e.jsx("option",{value:"started",children:s==="zh"?"进行中":"In Progress"})]}),e.jsx("button",{onClick:ne,disabled:xe,className:"p-1.5 bg-white hover:bg-slate-50 border border-slate-205 rounded-lg text-slate-605 hover:text-slate-800 transition-colors cursor-pointer flex items-center justify-center shadow-sm disabled:opacity-50",title:s==="zh"?"刷新数据":"Refresh",children:e.jsx(X,{size:12,className:xe?"animate-spin":""})})]})]}),e.jsx("div",{className:"flex-1 overflow-y-auto border border-slate-100 rounded-xl scrollbar-thin",children:xe?e.jsxs("div",{className:"h-full flex flex-col items-center justify-center text-slate-400 gap-2",children:[e.jsx(X,{size:24,className:"animate-spin text-indigo-600 mb-2"}),e.jsx("span",{className:"text-xs",children:s==="zh"?"正在加载学生提交数据...":"Loading submissions..."})]}):(()=>{const t=f?N.map(i=>i.id):[],l=(f?re.filter(i=>t.includes(i.studentId)):re).filter(i=>{const x=i.studentName?.toLowerCase().includes(pe.toLowerCase())||i.coursewareName?.toLowerCase().includes(pe.toLowerCase()),p=ie==="all"||ie==="submitted"&&(i.status==="submitted"||i.status==="finished")||ie==="started"&&i.status==="started";return x&&p});return l.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(we,{size:32,className:"text-slate-300"}),e.jsx("span",{className:"text-xs",children:s==="zh"?"暂无匹配的提交数据。":"No matching submissions found."}),!f&&e.jsx("span",{className:"text-[10px] text-slate-400 italic",children:s==="zh"?"提示:请在顶部选择一个班级进行筛选。":"Tip: Select a class at the top to filter."})]}):e.jsxs("table",{className:"w-full border-collapse text-left text-xs text-slate-700",children:[e.jsx("thead",{children:e.jsxs("tr",{className:"bg-slate-50 border-b border-slate-100 font-bold text-slate-550 select-none",children:[e.jsx("th",{className:"p-3",children:s==="zh"?"学生姓名":"Student Name"}),e.jsx("th",{className:"p-3",children:s==="zh"?"交互课件":"Courseware"}),e.jsx("th",{className:"p-3",children:s==="zh"?"状态":"Status"}),e.jsx("th",{className:"p-3 text-center",children:s==="zh"?"成绩":"Score"}),e.jsx("th",{className:"p-3 text-center",children:s==="zh"?"完成度":"Completion"}),e.jsx("th",{className:"p-3 text-right",children:s==="zh"?"操作":"Actions"})]})}),e.jsx("tbody",{className:"divide-y divide-slate-100",children:l.map(i=>{const x=i.status==="finished"||i.status==="submitted",p=i.started_at?new Date(i.started_at).toLocaleTimeString([],{hour:"2-digit",minute:"2-digit"}):"N/A";return e.jsxs("tr",{className:"hover:bg-slate-50/50 transition-colors group",children:[e.jsxs("td",{className:"p-3",children:[e.jsx("div",{className:"font-semibold text-slate-800",children:i.studentName}),e.jsxs("div",{className:"text-[10px] text-slate-400 mt-0.5",children:[s==="zh"?"时间":"Time",": ",p]})]}),e.jsx("td",{className:"p-3 font-medium text-slate-600 max-w-[150px] truncate",title:i.coursewareName,children:i.coursewareName}),e.jsx("td",{className:"p-3",children:e.jsx("span",{className:`px-2 py-0.5 rounded-full border text-[10px] font-bold ${x?"bg-emerald-50 text-emerald-700 border-emerald-100":"bg-blue-50 text-blue-700 border-blue-100 animate-pulse"}`,children:x?s==="zh"?"已提交":"Finished":s==="zh"?"进行中":"Running"})}),e.jsx("td",{className:"p-3 text-center font-bold font-mono",children:i.score!==null?e.jsxs("span",{className:"text-indigo-650 bg-indigo-50 border border-indigo-100 px-1.5 py-0.5 rounded-md",children:[i.score,"分"]}):e.jsx("span",{className:"text-slate-400 font-medium",children:"-"})}),e.jsx("td",{className:"p-3 text-center font-semibold font-mono",children:i.completion!==null?`${Math.round(i.completion*100)}%`:"0%"}),e.jsx("td",{className:"p-3 text-right",children:e.jsxs("div",{className:"flex justify-end gap-2",children:[e.jsxs("button",{onClick:()=>Le(i),className:"p-1 text-slate-500 hover:text-indigo-600 hover:bg-slate-100 border border-transparent hover:border-slate-200 rounded-lg transition-colors cursor-pointer flex items-center gap-1 text-[10px]",title:s==="zh"?"查看提交轨迹事件数据":"View Raw Data",children:[e.jsx(ht,{size:12}),e.jsx("span",{children:s==="zh"?"轨迹":"Events"})]}),i.isPromoted>0?e.jsxs("span",{className:"px-2 py-1 text-emerald-650 font-bold text-[10px] flex items-center gap-0.5 bg-emerald-50/50 rounded-lg border border-emerald-100",children:[e.jsx(pt,{size:11}),s==="zh"?"已归档":"Saved"]}):e.jsxs("button",{onClick:()=>Be(i.attemptId),disabled:!x,className:`px-2 py-1 text-[10px] font-bold rounded-lg flex items-center gap-1 shadow-sm transition-all active:scale-95 cursor-pointer border ${x?"bg-indigo-600 hover:bg-indigo-700 text-white border-indigo-600":"bg-slate-55 text-slate-400 border-slate-200 cursor-not-allowed opacity-60"}`,title:s==="zh"?"将分数和进度作为随堂学习数据存入数据库,记入学期成绩":"Save to DB & Semester grade",children:[e.jsx(Me,{size:11}),e.jsx("span",{children:s==="zh"?"录入成绩":"Record"})]})]})})]},i.attemptId)})})]})})()})]}):e.jsx(wt,{lessonId:d||"",lang:s==="zh"?"zh":"en",addToast:g})]}):e.jsxs("div",{className:"flex-1 flex flex-col items-center justify-center text-slate-455 gap-2.5 select-none",children:[e.jsx(Te,{size:38,className:"text-slate-300 animate-bounce",style:{animationDuration:"2.5s"}}),e.jsx("div",{className:"text-sm font-bold text-slate-655",children:s==="zh"?"请在顶部栏选择一个授课课节":"Please select a lesson to start teaching"}),e.jsx("p",{className:"text-[10px] text-slate-400",children:"白板及环节控制面板将在课节载入后自动生成"})]})}),e.jsxs("div",{className:"w-[260px] shrink-0 bg-white p-3.5 border-l border-slate-200/80 flex flex-col gap-3.5 overflow-hidden",children:[e.jsxs("div",{className:"flex-1 flex flex-col min-h-0 gap-2",children:[e.jsxs("h3",{className:"text-[10px] font-black uppercase text-slate-555 tracking-wider select-none flex justify-between items-center shrink-0",children:[e.jsxs("span",{className:"flex items-center gap-1",children:[e.jsx("span",{children:s==="zh"?"学生专注力监控":"Student Status Console"}),f&&e.jsxs("button",{onClick:Qe,disabled:N.length===0||j,className:"ml-2 text-[9px] font-bold bg-indigo-50 text-indigo-600 border border-indigo-200 px-1.5 py-0.5 rounded hover:bg-indigo-105 transition-colors flex items-center gap-1 active:scale-95 disabled:opacity-50 cursor-pointer shrink-0",title:s==="zh"?"随机抽取一名学生提问":"Pick a student randomly",children:[e.jsx(Ce,{size:8.5,className:j?"animate-spin":""}),e.jsx("span",{children:s==="zh"?"随机抽问":"Pick Student"})]})]}),e.jsxs("span",{className:"text-[9px] bg-slate-100 border border-slate-200 text-slate-555 font-mono px-1.5 py-0.5 rounded-md",children:[N.filter(t=>t.locked_lesson_id===d).length," / ",N.length," Locked"]})]}),f?e.jsx("div",{className:"overflow-y-auto flex-1 pr-1 grid grid-cols-3 gap-2 justify-items-center auto-rows-max scrollbar-thin py-2",children:N.map(t=>{const r=t.locked_lesson_id===d,l=V.get(t.id),i=O.includes(t.id),p=o[t.id]===d,k=F.find(H=>H.student_id===t.id)?.progress_percent??0,P=M?w.findIndex(H=>H.id===M):-1,ue=w.length>0?Math.round((P+1)/w.length*100):0,$e=P>=0&&k<ue,D=Re.includes(t.id),ge=J===t.id,be=22,_e=3,je=2*Math.PI*be,He=je-k/100*je;let W="stroke-indigo-650";return D?W="stroke-amber-500 stroke-[3.5px]":ge?W="stroke-indigo-500 stroke-[3.5px] animate-pulse":i?r?W="stroke-rose-500 animate-pulse":$e?W="stroke-amber-500 animate-pulse":p?k===100&&(W="stroke-emerald-500"):W="stroke-blue-400":W="stroke-slate-200",e.jsxs("div",{onMouseEnter:()=>b(t.id),onMouseLeave:()=>b(null),className:`group relative flex flex-col items-center justify-center p-1 rounded-xl transition-all cursor-default ${D?"z-20 duration-300":ge?"z-20":"hover:bg-slate-50"}`,children:[e.jsxs("div",{className:`relative w-14 h-14 flex items-center justify-center rounded-full transition-all duration-300 ${D?"shadow-[0_0_15px_#f59e0b] scale-110 z-10 bg-amber-50 ring-2 ring-amber-400 ring-offset-1":ge?"shadow-[0_0_10px_#6366f1] scale-105 z-10 bg-indigo-50 ring-1 ring-indigo-400":""}`,children:[D&&e.jsx("div",{className:"absolute inset-0 rounded-full bg-amber-400/30 animate-ping",style:{animationDuration:"2s"}}),e.jsxs("svg",{className:"absolute w-full h-full transform -rotate-90",viewBox:"0 0 50 50",children:[e.jsx("circle",{cx:"25",cy:"25",r:be,className:"stroke-slate-100 fill-white",strokeWidth:_e}),e.jsx("circle",{cx:"25",cy:"25",r:be,className:`fill-transparent transition-all duration-300 ${W}`,strokeWidth:_e,strokeDasharray:je,strokeDashoffset:He,strokeLinecap:"round"})]}),e.jsxs("div",{className:`relative z-10 w-10 h-10 rounded-full flex items-center justify-center overflow-hidden transition-colors ${D?"bg-amber-100/90":""}`,children:[e.jsx("span",{className:`text-[10px] font-bold tracking-tight truncate max-w-[34px] group-hover:scale-0 group-hover:opacity-0 transition-all duration-200 select-none ${D?"text-amber-900 font-extrabold":i?"text-slate-700":"text-slate-400"}`,children:t.name}),e.jsxs("div",{className:"absolute inset-0 flex items-center justify-center gap-1 opacity-0 scale-50 group-hover:opacity-100 group-hover:scale-100 transition-all duration-200 bg-white/95 rounded-full shadow-inner",children:[d&&ee&&e.jsx("button",{onClick:()=>{const H=s==="zh"?`⚠️ 学习进度预警:您当前的进度 (${k}%) 落后于老师的讲解进度。请专注课堂,跟上讲解!`:`⚠️ Progress Alert: Your progress (${k}%) is behind.`;ee(t.id,H),g(s==="zh"?"🔔 已发送提醒":"🔔 Alert Sent",`已向学生 ${t.name} 发送进度提醒。`,"success")},className:`p-0.5 rounded-md hover:bg-slate-105 transition-colors shrink-0 cursor-pointer ${$e?"text-amber-500 hover:text-amber-600 animate-pulse":"text-slate-400 hover:text-slate-650"}`,title:"提醒",children:e.jsx(Ae,{size:10})}),e.jsx("button",{onClick:()=>qe(t.id,t.locked_lesson_id),disabled:!d,className:`p-0.5 rounded-md hover:bg-slate-105 transition-colors shrink-0 cursor-pointer ${r?"text-rose-500 hover:text-rose-600":"text-slate-400 hover:text-slate-655"}`,title:r?"解锁":"锁定",children:r?e.jsx(Pe,{size:10}):e.jsx(De,{size:10})})]})]}),D?e.jsx("span",{className:"absolute -top-1.5 -right-1.5 z-20 text-[9px] bg-amber-500 text-white rounded-full w-4 h-4 flex items-center justify-center font-bold shadow-md animate-bounce",children:"🎯"}):i&&e.jsx("span",{className:`absolute top-0 right-0 w-2.5 h-2.5 rounded-full border-2 border-white shrink-0 ${p?"bg-emerald-500":"bg-blue-400"}`,title:p?"正在上课":"在线(但未进课堂)"}),l===!0&&!D&&e.jsx("span",{className:"absolute bottom-0 right-0 w-2.5 h-2.5 rounded-full border-2 border-white bg-amber-500 shrink-0 animate-bounce",title:"已确认/就位"})]}),e.jsx("span",{className:`text-[8.5px] mt-1 truncate max-w-[48px] select-none font-medium ${D?"text-amber-600 font-extrabold animate-bounce":i?"text-slate-505":"text-slate-350"}`,children:D?"🎯 抽中":`${k}%`})]},t.id)})}):e.jsx("div",{className:"text-xs text-slate-400 italic py-4 text-center flex-1 flex items-center justify-center",children:s==="zh"?"请选择班级以显示学生":"Select class to show student monitors."})]}),e.jsx("div",{className:"bg-slate-50 border border-slate-150 rounded-xl p-3 flex flex-col gap-1.5 h-[135px] shrink-0 shadow-sm select-none justify-center",children:v?(()=>{const t=N.find(x=>x.id===v);if(!t)return null;const r=F.find(x=>x.student_id===t.id),l=r?.progress_percent??0,i=(()=>{if(!r||!r.completed_segments)return[];try{return typeof r.completed_segments=="string"?JSON.parse(r.completed_segments):r.completed_segments}catch{return[]}})();return e.jsxs("div",{className:"flex flex-col gap-1.5 text-xs text-slate-705",children:[e.jsxs("div",{className:"font-extrabold text-slate-800 border-b border-slate-200 pb-1 flex justify-between items-center shrink-0",children:[e.jsxs("span",{className:"flex items-center gap-1.5 truncate",children:[e.jsx("span",{className:`w-2 h-2 rounded-full shrink-0 ${O.includes(t.id)?"bg-emerald-500 animate-pulse":"bg-slate-300"}`}),e.jsxs("span",{className:"truncate max-w-[130px]",children:[t.name," (",t.student_number||"N/A",")"]})]}),e.jsxs("span",{className:"text-[10px] text-indigo-655 font-mono font-black shrink-0",children:[l,"%"]})]}),e.jsxs("div",{className:"grid grid-cols-2 gap-1.5 text-[9.5px] leading-tight shrink-0",children:[e.jsxs("div",{className:"flex flex-col gap-0.5 bg-white p-1 rounded-lg border border-slate-150",children:[e.jsx("span",{className:"text-slate-400 font-bold",children:"随堂测验"}),e.jsx("span",{className:`font-bold font-mono text-[10px] ${r!=null&&r.quiz_score!==null?"text-indigo-600":"text-slate-400"}`,children:r!=null&&r.quiz_score!==null?`${r.quiz_score} / 100`:"未提交"})]}),e.jsxs("div",{className:"flex flex-col gap-0.5 bg-white p-1 rounded-lg border border-slate-150",children:[e.jsx("span",{className:"text-slate-400 font-bold",children:"教学环节进度"}),e.jsxs("span",{className:"font-bold text-slate-655 text-[10px]",children:[Array.isArray(i)?i.length:0," / ",w.length]})]})]}),e.jsxs("div",{className:"text-[9px] text-slate-500 leading-relaxed truncate mt-0.5 shrink-0",children:["环节: ",w.length>0?w.map((x,p)=>{const z=Array.isArray(i)&&i.includes(x.id);return e.jsxs("span",{className:`mr-1 px-1 py-0.2 rounded ${z?"bg-emerald-50 text-emerald-600 border border-emerald-100":"bg-slate-105 text-slate-400 border border-slate-150"}`,title:x.title,children:[p+1,":",z?"✓":"✗"]},x.id)}):e.jsx("span",{className:"italic text-slate-400",children:"暂无步骤"})]})]})})():e.jsxs("div",{className:"flex flex-col gap-1 text-xs text-slate-700 h-full justify-center",children:[e.jsxs("div",{className:"font-extrabold text-slate-800 border-b border-slate-200 pb-1.5 flex items-center gap-1.5 shrink-0",children:[e.jsx(Ne,{size:12,className:"text-indigo-655 animate-pulse"}),e.jsx("span",{children:s==="zh"?"班级学情概况":"Class Overview"})]}),e.jsxs("div",{className:"grid grid-cols-3 gap-1.5 text-[9.5px] leading-tight mt-1.5 shrink-0",children:[e.jsxs("div",{className:"flex flex-col items-center bg-white py-1 rounded-lg border border-slate-150",children:[e.jsx("span",{className:"text-slate-400 font-medium",children:"在线/总数"}),e.jsxs("span",{className:"font-bold font-mono text-emerald-600 text-[11px] mt-0.5",children:[N.filter(t=>O.includes(t.id)).length,"/",N.length]})]}),e.jsxs("div",{className:"flex flex-col items-center bg-white py-1 rounded-lg border border-slate-150",children:[e.jsx("span",{className:"text-slate-400 font-medium",children:"屏幕锁定"}),e.jsx("span",{className:"font-bold font-mono text-rose-500 text-[11px] mt-0.5",children:N.filter(t=>t.locked_lesson_id===d).length})]}),e.jsxs("div",{className:"flex flex-col items-center bg-white py-1 rounded-lg border border-slate-150",children:[e.jsx("span",{className:"text-slate-400 font-medium",children:"平均进度"}),e.jsx("span",{className:"font-bold font-mono text-indigo-650 text-[11px] mt-0.5",children:(()=>{const t=N.filter(l=>O.includes(l.id));if(t.length===0)return"0%";const r=t.reduce((l,i)=>{const x=F.find(p=>p.student_id===i.id);return l+(x?.progress_percent??0)},0);return`${Math.round(r/t.length)}%`})()})]})]})]})}),e.jsxs("div",{className:"h-[160px] flex flex-col border-t border-slate-150 pt-3 min-h-0 gap-2 shrink-0",children:[e.jsxs("h3",{className:"text-[10px] font-black uppercase text-slate-550 tracking-wider select-none flex justify-between items-center",children:[e.jsx("span",{children:s==="zh"?"课堂互动反馈流":"Live Classroom Feed"}),e.jsx("button",{onClick:()=>y([{id:"clear",time:new Date().toLocaleTimeString([],{hour:"2-digit",minute:"2-digit",second:"2-digit"}),type:"info",message:"反馈流已清空。"}]),className:"text-[9px] hover:text-slate-700 text-slate-400 underline transition-all",children:"Clear"})]}),e.jsx("div",{className:"flex-1 bg-white border border-slate-200 rounded-xl p-2.5 font-mono text-[9px] leading-relaxed overflow-y-auto space-y-2 select-text text-left text-slate-600 shadow-inner scrollbar-thin",children:Z.map(t=>e.jsxs("div",{className:"border-b border-slate-100 pb-1.5 last:border-b-0",children:[e.jsxs("div",{className:"flex justify-between items-center text-slate-400 font-bold mb-0.5",children:[e.jsx("span",{children:t.time}),e.jsx("span",{className:`px-1 rounded uppercase tracking-wide text-[7px] ${t.type==="success"?"bg-emerald-50 text-emerald-600 border border-emerald-100":t.type==="warning"?"bg-amber-50 text-amber-600 border border-amber-100":"bg-slate-100 text-slate-500 border border-slate-200"}`,children:t.type})]}),e.jsx("p",{className:t.type==="success"?"text-emerald-700 font-medium":t.type==="warning"?"text-amber-700 font-medium":"text-slate-655",children:t.message})]},t.id))})]})]})]}),E&&e.jsx("div",{className:"fixed inset-0 bg-slate-900/60 backdrop-blur-sm z-50 flex items-center justify-center p-4",children:e.jsxs("div",{className:"bg-white rounded-2xl shadow-2xl max-w-2xl w-full max-h-[85vh] flex flex-col overflow-hidden border border-slate-100 animate-in fade-in zoom-in duration-200",children:[e.jsxs("div",{className:"bg-slate-50 px-6 py-4 border-b border-slate-100 flex items-center justify-between",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(we,{className:"text-indigo-600",size:18}),e.jsx("h3",{className:"text-sm font-bold text-slate-800",children:s==="zh"?`[${E.studentName}] 的互动提交轨迹详情`:`Submission Details - ${E.studentName}`})]}),e.jsx("button",{onClick:()=>me(null),className:"text-slate-400 hover:text-slate-600 p-1.5 hover:bg-slate-100 rounded-lg transition-colors cursor-pointer",children:e.jsx(ft,{size:18})})]}),e.jsxs("div",{className:"p-6 overflow-y-auto space-y-4 flex-1 scrollbar-thin",children:[e.jsxs("div",{className:"grid grid-cols-3 gap-3",children:[e.jsxs("div",{className:"bg-slate-50 p-3 rounded-xl border border-slate-100",children:[e.jsx("div",{className:"text-[10px] text-slate-400 font-bold uppercase tracking-wider",children:s==="zh"?"课件名称":"Courseware"}),e.jsx("div",{className:"text-xs font-semibold text-slate-700 mt-1 truncate",title:E.coursewareName,children:E.coursewareName})]}),e.jsxs("div",{className:"bg-slate-50 p-3 rounded-xl border border-slate-100",children:[e.jsx("div",{className:"text-[10px] text-slate-400 font-bold uppercase tracking-wider",children:s==="zh"?"提交成绩":"Score"}),e.jsx("div",{className:"text-xs font-bold text-indigo-600 mt-1",children:E.score!==null?`${E.score} 分`:s==="zh"?"未打分":"N/A"})]}),e.jsxs("div",{className:"bg-slate-50 p-3 rounded-xl border border-slate-100",children:[e.jsx("div",{className:"text-[10px] text-slate-400 font-bold uppercase tracking-wider",children:s==="zh"?"课件完成度":"Completion"}),e.jsx("div",{className:"text-xs font-bold text-emerald-600 mt-1",children:E.completion!==null?`${Math.round(E.completion*100)}%`:"0%"})]})]}),e.jsxs("div",{className:"space-y-3",children:[e.jsxs("h4",{className:"text-xs font-bold text-slate-700 border-b border-slate-100 pb-1.5 flex items-center gap-1.5 flex-wrap",children:[e.jsx(Ne,{size:13,className:"text-indigo-650"}),e.jsx("span",{children:s==="zh"?"实时捕获轨迹事件流 (LMS Bridge)":"LMS Event Captures"})]}),We?e.jsxs("div",{className:"py-12 flex flex-col items-center justify-center text-slate-400 gap-2",children:[e.jsx(X,{size:20,className:"animate-spin text-indigo-600"}),e.jsx("span",{className:"text-xs",children:s==="zh"?"正在查询原始数据...":"Loading raw data..."})]}):Array.isArray(he)&&he.length>0?e.jsx("div",{className:"space-y-3 font-mono text-[11px] max-h-[40vh] overflow-y-auto pr-1 scrollbar-thin",children:he.map((t,r)=>{let l={};try{l=typeof t.payload_json=="string"?JSON.parse(t.payload_json):t.payload_json}catch{}return e.jsxs("div",{className:"p-3 bg-slate-900 text-slate-200 rounded-xl border border-slate-800 flex flex-col gap-1.5",children:[e.jsxs("div",{className:"flex justify-between items-center text-[10px] text-slate-400 border-b border-slate-800 pb-1",children:[e.jsx("span",{className:"font-bold text-indigo-400 bg-indigo-950/50 border border-indigo-900/50 px-1.5 py-0.5 rounded",children:t.event_type}),e.jsx("span",{children:new Date(t.created_at).toLocaleTimeString()})]}),e.jsx("pre",{className:"overflow-x-auto text-[10px] leading-relaxed p-1 text-emerald-400/90 whitespace-pre-wrap word-break-all",children:JSON.stringify(l,null,2)})]},t.id||r)})}):e.jsx("div",{className:"py-8 text-center text-xs text-slate-400 italic",children:s==="zh"?"该学生未产生任何轨迹事件数据。":"No trace events captured."})]})]}),e.jsxs("div",{className:"bg-slate-50 px-6 py-4 border-t border-slate-100 flex justify-between gap-3 shrink-0",children:[e.jsxs("div",{className:"text-[10px] text-slate-400 flex items-center gap-1",children:[e.jsx(Ee,{size:10}),e.jsx("span",{children:"Powered by LMS Bridge API v1"})]}),e.jsx("button",{onClick:()=>me(null),className:"px-4 py-1.5 bg-slate-200 hover:bg-slate-300 text-slate-700 font-bold rounded-lg text-xs transition-all cursor-pointer shadow-sm active:scale-95",children:s==="zh"?"关闭窗口":"Close"})]})]})})]})}export{Tt as LiveClassroomView};
@@ -0,0 +1 @@
1
+ import{j as e}from"./vendor-react-0Lg0vA-4.js";import{m as n}from"./index-D8x6bUeG.js";import{B as d,g as o,m as l,a1 as i}from"./vendor-icons-_c3xpwjZ.js";import"./vendor-utils-4FcTwKPj.js";import"./vendor-pdf-CVyNPGVr.js";import"./vendor-motion-DjY2czvL.js";import"./vendor-charts-B7ViBL9w.js";function y({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-[10px] 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{y as NotificationDetailModal};