wrong-notebook 2026.11.10 → 2026.11.11-2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.next/BUILD_ID +1 -1
- package/.next/app-path-routes-manifest.json +5 -0
- package/.next/build-manifest.json +14 -3
- package/.next/prerender-manifest.json +3 -3
- package/.next/routes-manifest.json +35 -0
- package/.next/server/app/_global-error/page.js.nft.json +1 -1
- package/.next/server/app/_global-error.html +1 -1
- package/.next/server/app/_global-error.rsc +1 -1
- package/.next/server/app/_global-error.segments/__PAGE__.segment.rsc +1 -1
- package/.next/server/app/_global-error.segments/_full.segment.rsc +1 -1
- package/.next/server/app/_global-error.segments/_tree.segment.rsc +1 -1
- package/.next/server/app/_not-found/page.js.nft.json +1 -1
- package/.next/server/app/_not-found/page_client-reference-manifest.js +1 -1
- package/.next/server/app/admin/page.js.nft.json +1 -1
- package/.next/server/app/admin/page_client-reference-manifest.js +1 -1
- package/.next/server/app/admin/user/[id]/page.js.nft.json +1 -1
- package/.next/server/app/admin/user/[id]/page_client-reference-manifest.js +1 -1
- package/.next/server/app/api/admin/cnm-tags/route.js +1 -1
- package/.next/server/app/api/admin/cnm-tags/route.js.nft.json +1 -1
- package/.next/server/app/api/admin/dashboard/route.js +3 -3
- package/.next/server/app/api/admin/dashboard/route.js.nft.json +1 -1
- package/.next/server/app/api/admin/debug-logs/export/route.js +1 -1
- package/.next/server/app/api/admin/debug-logs/export/route.js.nft.json +1 -1
- package/.next/server/app/api/admin/debug-logs/route.js +1 -1
- package/.next/server/app/api/admin/debug-logs/route.js.nft.json +1 -1
- package/.next/server/app/api/admin/eula/accept/route.js +1 -1
- package/.next/server/app/api/admin/eula/accept/route.js.nft.json +1 -1
- package/.next/server/app/api/admin/migrate-tags/route.js +1 -1
- package/.next/server/app/api/admin/migrate-tags/route.js.nft.json +1 -1
- package/.next/server/app/api/admin/system-reset/route.js +1 -1
- package/.next/server/app/api/admin/system-reset/route.js.nft.json +1 -1
- package/.next/server/app/api/admin/telemetry/route.js +1 -1
- package/.next/server/app/api/admin/telemetry/route.js.nft.json +1 -1
- package/.next/server/app/api/admin/users/[id]/detail/route.js +3 -3
- package/.next/server/app/api/admin/users/[id]/detail/route.js.nft.json +1 -1
- package/.next/server/app/api/admin/users/[id]/route.js +1 -1
- package/.next/server/app/api/admin/users/[id]/route.js.nft.json +1 -1
- package/.next/server/app/api/admin/users/route.js +1 -1
- package/.next/server/app/api/admin/users/route.js.nft.json +1 -1
- package/.next/server/app/api/ai/models/route.js +3 -3
- package/.next/server/app/api/ai/models/route.js.nft.json +1 -1
- package/.next/server/app/api/ai/test/route.js +3 -3
- package/.next/server/app/api/ai/test/route.js.nft.json +1 -1
- package/.next/server/app/api/analytics/route.js +3 -3
- package/.next/server/app/api/analytics/route.js.nft.json +1 -1
- package/.next/server/app/api/analyze/route.js +3 -3
- package/.next/server/app/api/analyze/route.js.nft.json +1 -1
- package/.next/server/app/api/auth/[...nextauth]/route.js +1 -1
- package/.next/server/app/api/auth/[...nextauth]/route.js.nft.json +1 -1
- package/.next/server/app/api/error-items/[id]/delete/route.js +1 -1
- package/.next/server/app/api/error-items/[id]/delete/route.js.nft.json +1 -1
- package/.next/server/app/api/error-items/[id]/figure/route.js +3 -3
- package/.next/server/app/api/error-items/[id]/figure/route.js.nft.json +1 -1
- package/.next/server/app/api/error-items/[id]/fix-latex/route.js +3 -3
- package/.next/server/app/api/error-items/[id]/fix-latex/route.js.nft.json +1 -1
- package/.next/server/app/api/error-items/[id]/geogebra/route.js +3 -3
- package/.next/server/app/api/error-items/[id]/geogebra/route.js.nft.json +1 -1
- package/.next/server/app/api/error-items/[id]/image/route.js +1 -1
- package/.next/server/app/api/error-items/[id]/image/route.js.nft.json +1 -1
- package/.next/server/app/api/error-items/[id]/notes/route.js +1 -1
- package/.next/server/app/api/error-items/[id]/notes/route.js.nft.json +1 -1
- package/.next/server/app/api/error-items/[id]/practice-records/route.js +1 -1
- package/.next/server/app/api/error-items/[id]/practice-records/route.js.nft.json +1 -1
- package/.next/server/app/api/error-items/[id]/reanswer/route.js +3 -3
- package/.next/server/app/api/error-items/[id]/reanswer/route.js.nft.json +1 -1
- package/.next/server/app/api/error-items/[id]/retag/route.js +3 -3
- package/.next/server/app/api/error-items/[id]/retag/route.js.nft.json +1 -1
- package/.next/server/app/api/error-items/[id]/route.js +1 -1
- package/.next/server/app/api/error-items/[id]/route.js.nft.json +1 -1
- package/.next/server/app/api/error-items/[id]/svg-animation/narration/route.js +3 -3
- package/.next/server/app/api/error-items/[id]/svg-animation/narration/route.js.nft.json +1 -1
- package/.next/server/app/api/error-items/[id]/svg-animation/route.js +3 -3
- package/.next/server/app/api/error-items/[id]/svg-animation/route.js.nft.json +1 -1
- package/.next/server/app/api/error-items/answer-space/route.js +1 -1
- package/.next/server/app/api/error-items/answer-space/route.js.nft.json +1 -1
- package/.next/server/app/api/error-items/batch-delete/route.js +1 -1
- package/.next/server/app/api/error-items/batch-delete/route.js.nft.json +1 -1
- package/.next/server/app/api/error-items/batch-move/route.js +1 -1
- package/.next/server/app/api/error-items/batch-move/route.js.nft.json +1 -1
- package/.next/server/app/api/error-items/clear/route.js +1 -1
- package/.next/server/app/api/error-items/clear/route.js.nft.json +1 -1
- package/.next/server/app/api/error-items/export-questions/route.js +1 -1
- package/.next/server/app/api/error-items/export-questions/route.js.nft.json +1 -1
- package/.next/server/app/api/error-items/list/route.js +8 -7
- package/.next/server/app/api/error-items/list/route.js.nft.json +1 -1
- package/.next/server/app/api/error-items/route.js +3 -3
- package/.next/server/app/api/error-items/route.js.nft.json +1 -1
- package/.next/server/app/api/error-items/short/[shortId]/route.js +1 -1
- package/.next/server/app/api/error-items/short/[shortId]/route.js.nft.json +1 -1
- package/.next/server/app/api/error-items/similarity/route.js +1 -1
- package/.next/server/app/api/error-items/similarity/route.js.nft.json +1 -1
- package/.next/server/app/api/eula/status/route.js +1 -1
- package/.next/server/app/api/eula/status/route.js.nft.json +1 -1
- package/.next/server/app/api/exams/[id]/questions/[questionId]/regenerate/route.js +3 -3
- package/.next/server/app/api/exams/[id]/questions/[questionId]/regenerate/route.js.nft.json +1 -1
- package/.next/server/app/api/exams/[id]/results/route.js +3 -3
- package/.next/server/app/api/exams/[id]/results/route.js.nft.json +1 -1
- package/.next/server/app/api/exams/[id]/retry/route.js +3 -3
- package/.next/server/app/api/exams/[id]/retry/route.js.nft.json +1 -1
- package/.next/server/app/api/exams/[id]/route.js +3 -3
- package/.next/server/app/api/exams/[id]/route.js.nft.json +1 -1
- package/.next/server/app/api/exams/route.js +3 -3
- package/.next/server/app/api/exams/route.js.nft.json +1 -1
- package/.next/server/app/api/export/route.js +7 -7
- package/.next/server/app/api/export/route.js.nft.json +1 -1
- package/.next/server/app/api/geogebra-analyze/route.js +3 -3
- package/.next/server/app/api/geogebra-analyze/route.js.nft.json +1 -1
- package/.next/server/app/api/health/route.js.nft.json +1 -1
- package/.next/server/app/api/import/route.js +17 -17
- package/.next/server/app/api/import/route.js.nft.json +1 -1
- package/.next/server/app/api/import-batches/[id]/confirm-all/route.js +19 -19
- package/.next/server/app/api/import-batches/[id]/confirm-all/route.js.nft.json +1 -1
- package/.next/server/app/api/import-batches/[id]/fix-text/route.js +3 -3
- package/.next/server/app/api/import-batches/[id]/fix-text/route.js.nft.json +1 -1
- package/.next/server/app/api/import-batches/[id]/read/route.js +20 -20
- package/.next/server/app/api/import-batches/[id]/read/route.js.nft.json +1 -1
- package/.next/server/app/api/import-batches/[id]/retry/route.js +19 -19
- package/.next/server/app/api/import-batches/[id]/retry/route.js.nft.json +1 -1
- package/.next/server/app/api/import-batches/[id]/route.js +20 -20
- package/.next/server/app/api/import-batches/[id]/route.js.nft.json +1 -1
- package/.next/server/app/api/import-batches/[id]/start/route.js +20 -20
- package/.next/server/app/api/import-batches/[id]/start/route.js.nft.json +1 -1
- package/.next/server/app/api/import-batches/route.js +20 -20
- package/.next/server/app/api/import-batches/route.js.nft.json +1 -1
- package/.next/server/app/api/import-tasks/[id]/confirm/route.js +19 -19
- package/.next/server/app/api/import-tasks/[id]/confirm/route.js.nft.json +1 -1
- package/.next/server/app/api/import-tasks/[id]/read/route.js +19 -19
- package/.next/server/app/api/import-tasks/[id]/read/route.js.nft.json +1 -1
- package/.next/server/app/api/import-tasks/[id]/retry/route.js +20 -20
- package/.next/server/app/api/import-tasks/[id]/retry/route.js.nft.json +1 -1
- package/.next/server/app/api/import-tasks/[id]/route.js +19 -19
- package/.next/server/app/api/import-tasks/[id]/route.js.nft.json +1 -1
- package/.next/server/app/api/import-tasks/route.js +20 -20
- package/.next/server/app/api/import-tasks/route.js.nft.json +1 -1
- package/.next/server/app/api/initialize/route.js +2 -2
- package/.next/server/app/api/initialize/route.js.nft.json +1 -1
- package/.next/server/app/api/logs/frontend/route.js +1 -1
- package/.next/server/app/api/logs/frontend/route.js.nft.json +1 -1
- package/.next/server/app/api/mcp/route/app-paths-manifest.json +3 -0
- package/.next/server/app/api/mcp/route/build-manifest.json +12 -0
- package/.next/server/app/api/mcp/route/server-reference-manifest.json +4 -0
- package/.next/server/app/api/mcp/route.js +33 -0
- package/.next/server/app/api/mcp/route.js.map +5 -0
- package/.next/server/app/api/mcp/route.js.nft.json +1 -0
- package/.next/server/app/api/mcp/route_client-reference-manifest.js +3 -0
- package/.next/server/app/api/minimax-code/checkin/route.js +1 -1
- package/.next/server/app/api/minimax-code/checkin/route.js.nft.json +1 -1
- package/.next/server/app/api/minimax-code/login/route.js +1 -1
- package/.next/server/app/api/minimax-code/login/route.js.nft.json +1 -1
- package/.next/server/app/api/minimax-code/route.js +1 -1
- package/.next/server/app/api/minimax-code/route.js.nft.json +1 -1
- package/.next/server/app/api/notebooks/[id]/retag/route.js +3 -3
- package/.next/server/app/api/notebooks/[id]/retag/route.js.nft.json +1 -1
- package/.next/server/app/api/notebooks/[id]/route.js +1 -1
- package/.next/server/app/api/notebooks/[id]/route.js.nft.json +1 -1
- package/.next/server/app/api/notebooks/route.js +1 -1
- package/.next/server/app/api/notebooks/route.js.nft.json +1 -1
- package/.next/server/app/api/openclaw/batch-upload/route.js +3 -3
- package/.next/server/app/api/openclaw/batch-upload/route.js.nft.json +1 -1
- package/.next/server/app/api/paper-groups/[id]/route.js +1 -1
- package/.next/server/app/api/paper-groups/[id]/route.js.nft.json +1 -1
- package/.next/server/app/api/paper-groups/route.js +1 -1
- package/.next/server/app/api/paper-groups/route.js.nft.json +1 -1
- package/.next/server/app/api/practice/generate/route.js +23 -17
- package/.next/server/app/api/practice/generate/route.js.nft.json +1 -1
- package/.next/server/app/api/practice/grade/route.js +3 -3
- package/.next/server/app/api/practice/grade/route.js.nft.json +1 -1
- package/.next/server/app/api/practice/record/[id]/route.js +3 -3
- package/.next/server/app/api/practice/record/[id]/route.js.nft.json +1 -1
- package/.next/server/app/api/practice/record/route.js +3 -3
- package/.next/server/app/api/practice/record/route.js.nft.json +1 -1
- package/.next/server/app/api/question-banks/[id]/questions/[qid]/route/app-paths-manifest.json +3 -0
- package/.next/server/app/api/question-banks/[id]/questions/[qid]/route/build-manifest.json +12 -0
- package/.next/server/app/api/question-banks/[id]/questions/[qid]/route/server-reference-manifest.json +4 -0
- package/.next/server/app/api/question-banks/[id]/questions/[qid]/route.js +35 -0
- package/.next/server/app/api/question-banks/[id]/questions/[qid]/route.js.map +5 -0
- package/.next/server/app/api/question-banks/[id]/questions/[qid]/route.js.nft.json +1 -0
- package/.next/server/app/api/question-banks/[id]/questions/[qid]/route_client-reference-manifest.js +3 -0
- package/.next/server/app/api/question-banks/[id]/route/app-paths-manifest.json +3 -0
- package/.next/server/app/api/question-banks/[id]/route/build-manifest.json +12 -0
- package/.next/server/app/api/question-banks/[id]/route/server-reference-manifest.json +4 -0
- package/.next/server/app/api/question-banks/[id]/route.js +17 -0
- package/.next/server/app/api/question-banks/[id]/route.js.map +5 -0
- package/.next/server/app/api/question-banks/[id]/route.js.nft.json +1 -0
- package/.next/server/app/api/question-banks/[id]/route_client-reference-manifest.js +3 -0
- package/.next/server/app/api/question-banks/route/app-paths-manifest.json +3 -0
- package/.next/server/app/api/question-banks/route/build-manifest.json +12 -0
- package/.next/server/app/api/question-banks/route/server-reference-manifest.json +4 -0
- package/.next/server/app/api/question-banks/route.js +35 -0
- package/.next/server/app/api/question-banks/route.js.map +5 -0
- package/.next/server/app/api/question-banks/route.js.nft.json +1 -0
- package/.next/server/app/api/question-banks/route_client-reference-manifest.js +3 -0
- package/.next/server/app/api/reanswer/route.js +3 -3
- package/.next/server/app/api/reanswer/route.js.nft.json +1 -1
- package/.next/server/app/api/register/route.js.nft.json +1 -1
- package/.next/server/app/api/register/status/route.js.nft.json +1 -1
- package/.next/server/app/api/requests/[id]/route.js +1 -1
- package/.next/server/app/api/requests/[id]/route.js.nft.json +1 -1
- package/.next/server/app/api/review/due/route.js +13 -13
- package/.next/server/app/api/review/due/route.js.nft.json +1 -1
- package/.next/server/app/api/settings/route.js +1 -1
- package/.next/server/app/api/settings/route.js.nft.json +1 -1
- package/.next/server/app/api/setup/route.js +1 -1
- package/.next/server/app/api/setup/route.js.nft.json +1 -1
- package/.next/server/app/api/stats/activity/route.js +1 -1
- package/.next/server/app/api/stats/activity/route.js.nft.json +1 -1
- package/.next/server/app/api/stats/practice/clear/route.js +1 -1
- package/.next/server/app/api/stats/practice/clear/route.js.nft.json +1 -1
- package/.next/server/app/api/stats/practice/route.js +1 -1
- package/.next/server/app/api/stats/practice/route.js.nft.json +1 -1
- package/.next/server/app/api/stats/repeated-mistakes/route.js +3 -3
- package/.next/server/app/api/stats/repeated-mistakes/route.js.nft.json +1 -1
- package/.next/server/app/api/stats/weak-tags/route.js +16 -15
- package/.next/server/app/api/stats/weak-tags/route.js.nft.json +1 -1
- package/.next/server/app/api/tags/route.js +1 -1
- package/.next/server/app/api/tags/route.js.nft.json +1 -1
- package/.next/server/app/api/tags/stats/route.js +1 -1
- package/.next/server/app/api/tags/stats/route.js.nft.json +1 -1
- package/.next/server/app/api/tags/suggestions/route.js +1 -1
- package/.next/server/app/api/tags/suggestions/route.js.nft.json +1 -1
- package/.next/server/app/api/tasks/route.js +1 -1
- package/.next/server/app/api/tasks/route.js.nft.json +1 -1
- package/.next/server/app/api/telemetry/route.js.nft.json +1 -1
- package/.next/server/app/api/tts/[id]/route.js +1 -1
- package/.next/server/app/api/tts/[id]/route.js.nft.json +1 -1
- package/.next/server/app/api/tts/batch/route.js +1 -1
- package/.next/server/app/api/tts/batch/route.js.nft.json +1 -1
- package/.next/server/app/api/tts/route.js +1 -1
- package/.next/server/app/api/tts/route.js.nft.json +1 -1
- package/.next/server/app/api/tts/status/route.js +1 -1
- package/.next/server/app/api/tts/status/route.js.nft.json +1 -1
- package/.next/server/app/api/user/ai-consent/route.js +1 -1
- package/.next/server/app/api/user/ai-consent/route.js.nft.json +1 -1
- package/.next/server/app/api/user/route.js +3 -3
- package/.next/server/app/api/user/route.js.nft.json +1 -1
- package/.next/server/app/api/version/route.js.nft.json +1 -1
- package/.next/server/app/banks/page/app-paths-manifest.json +3 -0
- package/.next/server/app/banks/page/build-manifest.json +22 -0
- package/.next/server/app/banks/page/next-font-manifest.json +11 -0
- package/.next/server/app/banks/page/react-loadable-manifest.json +1 -0
- package/.next/server/app/banks/page/server-reference-manifest.json +4 -0
- package/.next/server/app/banks/page.js +15 -0
- package/.next/server/app/banks/page.js.map +5 -0
- package/.next/server/app/banks/page.js.nft.json +1 -0
- package/.next/server/app/banks/page_client-reference-manifest.js +3 -0
- package/.next/server/app/error-items/[id]/page.js.nft.json +1 -1
- package/.next/server/app/error-items/[id]/page_client-reference-manifest.js +1 -1
- package/.next/server/app/eula/page.js.nft.json +1 -1
- package/.next/server/app/eula/page_client-reference-manifest.js +1 -1
- package/.next/server/app/exams/[id]/page.js.nft.json +1 -1
- package/.next/server/app/exams/[id]/page_client-reference-manifest.js +1 -1
- package/.next/server/app/exams/[id]/print/page.js.nft.json +1 -1
- package/.next/server/app/exams/[id]/print/page_client-reference-manifest.js +1 -1
- package/.next/server/app/exams/page.js.nft.json +1 -1
- package/.next/server/app/exams/page_client-reference-manifest.js +1 -1
- package/.next/server/app/import-batches/[id]/page.js.nft.json +1 -1
- package/.next/server/app/import-batches/[id]/page_client-reference-manifest.js +1 -1
- package/.next/server/app/import-tasks/[id]/page.js.nft.json +1 -1
- package/.next/server/app/import-tasks/[id]/page_client-reference-manifest.js +1 -1
- package/.next/server/app/import-tasks/page.js.nft.json +1 -1
- package/.next/server/app/import-tasks/page_client-reference-manifest.js +1 -1
- package/.next/server/app/initialize/page.js.nft.json +1 -1
- package/.next/server/app/initialize/page_client-reference-manifest.js +1 -1
- package/.next/server/app/login/page.js.nft.json +1 -1
- package/.next/server/app/login/page_client-reference-manifest.js +1 -1
- package/.next/server/app/notebooks/[id]/add/page.js.nft.json +1 -1
- package/.next/server/app/notebooks/[id]/add/page_client-reference-manifest.js +1 -1
- package/.next/server/app/notebooks/[id]/page.js.nft.json +1 -1
- package/.next/server/app/notebooks/[id]/page_client-reference-manifest.js +1 -1
- package/.next/server/app/notebooks/page.js.nft.json +1 -1
- package/.next/server/app/notebooks/page_client-reference-manifest.js +1 -1
- package/.next/server/app/page.js.nft.json +1 -1
- package/.next/server/app/page_client-reference-manifest.js +1 -1
- package/.next/server/app/practice/page.js.nft.json +1 -1
- package/.next/server/app/practice/page_client-reference-manifest.js +1 -1
- package/.next/server/app/print-preview/page.js.nft.json +1 -1
- package/.next/server/app/print-preview/page_client-reference-manifest.js +1 -1
- package/.next/server/app/register/page.js.nft.json +1 -1
- package/.next/server/app/register/page_client-reference-manifest.js +1 -1
- package/.next/server/app/review/page.js.nft.json +1 -1
- package/.next/server/app/review/page_client-reference-manifest.js +1 -1
- package/.next/server/app/setup/page.js.nft.json +1 -1
- package/.next/server/app/setup/page_client-reference-manifest.js +1 -1
- package/.next/server/app/stats/page.js.nft.json +1 -1
- package/.next/server/app/stats/page_client-reference-manifest.js +1 -1
- package/.next/server/app/tags/page.js.nft.json +1 -1
- package/.next/server/app/tags/page_client-reference-manifest.js +1 -1
- package/.next/server/app-paths-manifest.json +5 -0
- package/.next/server/chunks/1oeh_server_app_api_question-banks_[id]_questions_[qid]_route_actions_0cut200tgdhrg.js +3 -0
- package/.next/server/chunks/{[root-of-the-server]__007euzraef-1_._.js → [root-of-the-server]__003zs5cdrhp0h._.js} +1 -1
- package/.next/server/chunks/{[root-of-the-server]__046l8-2oecq5e._.js → [root-of-the-server]__0095ttqaxkura._.js} +1 -1
- package/.next/server/chunks/{[root-of-the-server]__00d4vtmsmiyd_._.js → [root-of-the-server]__00gh00nfppv7c._.js} +1 -1
- package/.next/server/chunks/{[root-of-the-server]__1ld7m10shogtt._.js → [root-of-the-server]__02cwazw3laf8n._.js} +2 -2
- package/.next/server/chunks/[root-of-the-server]__02p_mpxidnu0x._.js +3 -0
- package/.next/server/chunks/{[root-of-the-server]__12u2irl6e293j._.js → [root-of-the-server]__03mzwpgmelgxq._.js} +2 -2
- package/.next/server/chunks/[root-of-the-server]__04g1e8vi5hfmd._.js +1 -1
- package/.next/server/chunks/{[root-of-the-server]__06t523lsa-xt5._.js → [root-of-the-server]__04k-j5q4c3fxh._.js} +1 -1
- package/.next/server/chunks/[root-of-the-server]__06g_4_o5xkej2._.js +3 -0
- package/.next/server/chunks/[root-of-the-server]__074shufbnm6ni._.js +3 -0
- package/.next/server/chunks/{[root-of-the-server]__02m42nibzxxmr._.js → [root-of-the-server]__07dbynh_bs54x._.js} +1 -1
- package/.next/server/chunks/{[root-of-the-server]__06g0t8zt3udt7._.js → [root-of-the-server]__0afxho639gukq._.js} +1 -1
- package/.next/server/chunks/{[root-of-the-server]__17tyjwy7wmx2z._.js → [root-of-the-server]__0as_tqxtximnv._.js} +2 -2
- package/.next/server/chunks/{[root-of-the-server]__13cki3v6cufcx._.js → [root-of-the-server]__0b110dxj2qk5d._.js} +2 -2
- package/.next/server/chunks/{[root-of-the-server]__0r3grb-nk-tkn._.js → [root-of-the-server]__0bey3smu2frko._.js} +2 -2
- package/.next/server/chunks/{[root-of-the-server]__00lpxd_gni_y7._.js → [root-of-the-server]__0clg30mkk8i71._.js} +1 -1
- package/.next/server/chunks/{[root-of-the-server]__0zj60abydj_ho._.js → [root-of-the-server]__0cyq3g7ztpx7w._.js} +2 -2
- package/.next/server/chunks/[root-of-the-server]__0dxid01zcz8sh._.js +3 -0
- package/.next/server/chunks/[root-of-the-server]__0evv12a34qcy6._.js +4 -4
- package/.next/server/chunks/{[root-of-the-server]__0d_63r679gzzq._.js → [root-of-the-server]__0gj0qch0bepug._.js} +1 -1
- package/.next/server/chunks/[root-of-the-server]__0gspnsyl2sr50._.js +3 -0
- package/.next/server/chunks/{[root-of-the-server]__1i70uvkdts-q1._.js → [root-of-the-server]__0h7v77lf4fj2l._.js} +2 -2
- package/.next/server/chunks/{[root-of-the-server]__0m1vmtwh8l5-k._.js → [root-of-the-server]__0hfzltniz674f._.js} +2 -2
- package/.next/server/chunks/[root-of-the-server]__0i0wx-z-qadeh._.js +3 -0
- package/.next/server/chunks/{[root-of-the-server]__1gkabltrjg-t4._.js → [root-of-the-server]__0iw2v5f6ccxl0._.js} +2 -2
- package/.next/server/chunks/{[root-of-the-server]__0o5b_c35hufmg._.js → [root-of-the-server]__0iz5qf7p--9io._.js} +2 -2
- package/.next/server/chunks/[root-of-the-server]__0llcnfms-yrs4._.js +1 -1
- package/.next/server/chunks/[root-of-the-server]__0lrgjyg38b9j1._.js +3 -0
- package/.next/server/chunks/[root-of-the-server]__0nmxuavodh1jp._.js +3 -0
- package/.next/server/chunks/[root-of-the-server]__0o64d13on6cmz._.js +3 -0
- package/.next/server/chunks/{[root-of-the-server]__1ln0042a-s6yz._.js → [root-of-the-server]__0oou2pf7_339_._.js} +2 -2
- package/.next/server/chunks/[root-of-the-server]__0pfjf0rwvysy7._.js +3 -0
- package/.next/server/chunks/[root-of-the-server]__0pzhwzricdm-8._.js +3 -0
- package/.next/server/chunks/[root-of-the-server]__0q7tfn1jdwvpx._.js +3 -0
- package/.next/server/chunks/[root-of-the-server]__0qcuz-9of1fv5._.js +3 -0
- package/.next/server/chunks/[root-of-the-server]__0r0zkh318us2a._.js +3 -0
- package/.next/server/chunks/[root-of-the-server]__0sr8vnpwvch60._.js +1 -1
- package/.next/server/chunks/{[root-of-the-server]__1ege7h8tb5rk0._.js → [root-of-the-server]__0sthzz27i2a2z._.js} +2 -2
- package/.next/server/chunks/{[root-of-the-server]__1jwj83lfyd4sd._.js → [root-of-the-server]__0svsyv06lv5b6._.js} +2 -2
- package/.next/server/chunks/{[root-of-the-server]__1w6vhjjteqg1c._.js → [root-of-the-server]__0u5ilae_0p228._.js} +2 -2
- package/.next/server/chunks/[root-of-the-server]__0ve9pg6dcdyog._.js +3 -0
- package/.next/server/chunks/[root-of-the-server]__0vf7un104o30d._.js +3 -0
- package/.next/server/chunks/{[root-of-the-server]__1ya8xaf2pmzqp._.js → [root-of-the-server]__0wb0hryzh-40d._.js} +2 -2
- package/.next/server/chunks/[root-of-the-server]__0xryaobvas7wn._.js +3 -0
- package/.next/server/chunks/[root-of-the-server]__0y88hdobvv_cu._.js +3 -0
- package/.next/server/chunks/{[root-of-the-server]__1pdsfjtgtncsg._.js → [root-of-the-server]__0ykbbyo6dhbr6._.js} +2 -2
- package/.next/server/chunks/{[root-of-the-server]__1v3kta6bd_kv9._.js → [root-of-the-server]__0yqilo886f-ap._.js} +2 -2
- package/.next/server/chunks/[root-of-the-server]__10gksjgitow13._.js +3 -0
- package/.next/server/chunks/{[root-of-the-server]__1i_tefn2lhztv._.js → [root-of-the-server]__11abvzxq0gnxd._.js} +2 -2
- package/.next/server/chunks/[root-of-the-server]__11k2f-h9fwj0r._.js +3 -0
- package/.next/server/chunks/[root-of-the-server]__132wdxrrngo1f._.js +3 -0
- package/.next/server/chunks/[root-of-the-server]__1338_d0rrpmqi._.js +3 -0
- package/.next/server/chunks/[root-of-the-server]__13k69ibnw4thj._.js +3 -0
- package/.next/server/chunks/[root-of-the-server]__14971xq-txgd-._.js +3 -0
- package/.next/server/chunks/[root-of-the-server]__159kla6_fcldu._.js +3 -0
- package/.next/server/chunks/[root-of-the-server]__167-list_13wk._.js +3 -0
- package/.next/server/chunks/{[root-of-the-server]__1m2fnptuk23jt._.js → [root-of-the-server]__16lnqkbxm2wvd._.js} +2 -2
- package/.next/server/chunks/[root-of-the-server]__190kzk1zqnnnh._.js +3 -0
- package/.next/server/chunks/{[root-of-the-server]__0fxflgag7lsn4._.js → [root-of-the-server]__1_n49ooywukvu._.js} +2 -2
- package/.next/server/chunks/[root-of-the-server]__1assq-8cgzn69._.js +1 -1
- package/.next/server/chunks/[root-of-the-server]__1bc2146vwwx0n._.js +3 -0
- package/.next/server/chunks/[root-of-the-server]__1chl_j6-66d0z._.js +3 -0
- package/.next/server/chunks/{[root-of-the-server]__14_mjy9lqgp99._.js → [root-of-the-server]__1d_eia02z8s27._.js} +2 -2
- package/.next/server/chunks/[root-of-the-server]__1dg09yxfyy2d-._.js +3 -0
- package/.next/server/chunks/[root-of-the-server]__1e8_j43j1t1m3._.js +4 -4
- package/.next/server/chunks/{[root-of-the-server]__0wpt1mx3kryp7._.js → [root-of-the-server]__1expjjxwlr3rv._.js} +1 -1
- package/.next/server/chunks/[root-of-the-server]__1fp_biblbk1dj._.js +3 -0
- package/.next/server/chunks/[root-of-the-server]__1goozrpjh5dhf._.js +1 -1
- package/.next/server/chunks/[root-of-the-server]__1h4469dzsx9y_._.js +3 -0
- package/.next/server/chunks/[root-of-the-server]__1hg-nksvhu11h._.js +3 -0
- package/.next/server/chunks/[root-of-the-server]__1hq4b2pmltb_l._.js +3 -0
- package/.next/server/chunks/[root-of-the-server]__1hr87f6mg8xi6._.js +3 -0
- package/.next/server/chunks/{[root-of-the-server]__1xpcaqsei77n2._.js → [root-of-the-server]__1i04dsau7foki._.js} +2 -2
- package/.next/server/chunks/{[root-of-the-server]__0obmdl7r6pt9d._.js → [root-of-the-server]__1i4c418rordji._.js} +1 -1
- package/.next/server/chunks/[root-of-the-server]__1i8ob9ye9_osl._.js +3 -0
- package/.next/server/chunks/[root-of-the-server]__1ii2yvizq9zx8._.js +1 -1
- package/.next/server/chunks/[root-of-the-server]__1jcv8k2sx2ptr._.js +3 -0
- package/.next/server/chunks/[root-of-the-server]__1juyqvp5sctaz._.js +3 -0
- package/.next/server/chunks/[root-of-the-server]__1k67g4w53li1h._.js +3 -0
- package/.next/server/chunks/[root-of-the-server]__1kqyyoqumu2k3._.js +3 -0
- package/.next/server/chunks/[root-of-the-server]__1ktelnqkakjyk._.js +3 -0
- package/.next/server/chunks/[root-of-the-server]__1kucx2jgzzdfv._.js +1 -1
- package/.next/server/chunks/[root-of-the-server]__1l63lc79i6lzk._.js +1 -1
- package/.next/server/chunks/[root-of-the-server]__1nmtvzuc1uv-5._.js +3 -0
- package/.next/server/chunks/[root-of-the-server]__1oaxm5scx4anf._.js +3 -0
- package/.next/server/chunks/[root-of-the-server]__1oc9d5av5hr08._.js +3 -0
- package/.next/server/chunks/[root-of-the-server]__1opijjenrark5._.js +3 -0
- package/.next/server/chunks/[root-of-the-server]__1otoj-v6_5y0o._.js +3 -0
- package/.next/server/chunks/[root-of-the-server]__1qbwy5a1mwohf._.js +3 -0
- package/.next/server/chunks/{[root-of-the-server]__0y82146_dftio._.js → [root-of-the-server]__1qch4uwoe4jbl._.js} +1 -1
- package/.next/server/chunks/[root-of-the-server]__1qh6ja_35h8e9._.js +3 -0
- package/.next/server/chunks/[root-of-the-server]__1qmbbudn1-e1n._.js +1 -1
- package/.next/server/chunks/[root-of-the-server]__1rfpsbaml9gvv._.js +3 -0
- package/.next/server/chunks/[root-of-the-server]__1rzzqjvucnhdy._.js +3 -0
- package/.next/server/chunks/[root-of-the-server]__1s9wsfyjfjfsw._.js +3 -0
- package/.next/server/chunks/[root-of-the-server]__1svy-pnpe1pwu._.js +3 -0
- package/.next/server/chunks/[root-of-the-server]__1t6v0c67wrtj7._.js +3 -0
- package/.next/server/chunks/{[root-of-the-server]__0ztucyaloy2ub._.js → [root-of-the-server]__1tcmfyputqswh._.js} +2 -2
- package/.next/server/chunks/[root-of-the-server]__1ttyfy9dd2omo._.js +3 -0
- package/.next/server/chunks/[root-of-the-server]__1uk_9g9b1wxp5._.js +3 -0
- package/.next/server/chunks/[root-of-the-server]__1v5j-xo97hloh._.js +3 -0
- package/.next/server/chunks/[root-of-the-server]__1wt1lpxbrwtyt._.js +3 -0
- package/.next/server/chunks/[root-of-the-server]__1y7j4fig86u8c._.js +3 -0
- package/.next/server/chunks/{[root-of-the-server]__0q520ovb9262s._.js → [root-of-the-server]__1z61l-vv1munx._.js} +2 -2
- package/.next/server/chunks/{_02qwqg9i39x4_._.js → _0-4_eys63g0m9._.js} +6 -6
- package/.next/server/chunks/_020v6nmfgswzk._.js +1 -1
- package/.next/server/chunks/_06iu5mmu8wlcc._.js +3 -0
- package/.next/server/chunks/{_0tz5wpjdgntj3._.js → _09trvgfs0zumw._.js} +2 -2
- package/.next/server/chunks/_0c25unp5_llaq._.js +3 -0
- package/.next/server/chunks/{_1csx8ckltgali._.js → _0fsupxpep5knb._.js} +6 -6
- package/.next/server/chunks/{_0oppr1mpoh25l._.js → _0j_08_iij6lec._.js} +1 -1
- package/.next/server/chunks/_0pivjcgtfkjfw._.js +3 -0
- package/.next/server/chunks/_0rse5-saodpeb._.js +30 -0
- package/.next/server/chunks/{_1gtuhmdu6udof._.js → _0sreqb-d5c0h6._.js} +6 -6
- package/.next/server/chunks/_0vidw039o5x0k._.js +3 -0
- package/.next/server/chunks/_10xn2rcd87yd5._.js +3 -0
- package/.next/server/chunks/_12w5k19rc45j_._.js +1 -1
- package/.next/server/chunks/{_1yvd01woddaxt._.js → _1c-nysoxl9gha._.js} +6 -6
- package/.next/server/chunks/_1eqnx6dcz6a03._.js +1 -1
- package/.next/server/chunks/_1ooq1_fguyb4w._.js +1 -1
- package/.next/server/chunks/_1re5pp9fn2sv7._.js +3 -0
- package/.next/server/chunks/_1v6bg00q81vb-._.js +3 -0
- package/.next/server/chunks/_1y2rcqvbb2_-4._.js +3 -0
- package/.next/server/chunks/_1yx16tn5391kx._.js +1 -1
- package/.next/server/chunks/_1z_ujac_e_65s._.js +1 -1
- package/.next/server/chunks/_next-internal_server_app_api_mcp_route_actions_1thtlukwlrce1.js +3 -0
- package/.next/server/chunks/_next-internal_server_app_api_question-banks_[id]_route_actions_06y5t4oimtusv.js +3 -0
- package/.next/server/chunks/_next-internal_server_app_api_question-banks_route_actions_0h4hz83b0yf8g.js +3 -0
- package/.next/server/chunks/node_modules_zod_v4_classic_external_0yua5dbpvcjkf.js +5 -5
- package/.next/server/chunks/src_lib_078zldkqc-a67._.js +1 -1
- package/.next/server/chunks/src_lib_09_k-7vv0sy-e._.js +3 -0
- package/.next/server/chunks/src_lib_0clsw_ng7x3ih._.js +1 -1
- package/.next/server/chunks/src_lib_0gonw_e9wzfyz._.js +1 -1
- package/.next/server/chunks/src_lib_0whd_w99i5vmm._.js +1 -1
- package/.next/server/chunks/src_lib_1_m3-y2t3e4xi._.js +28 -19
- package/.next/server/chunks/src_lib_1b_d9xsuzjp3e._.js +1 -1
- package/.next/server/chunks/src_lib_1hw1dokd0kaxo._.js +3 -0
- package/.next/server/chunks/src_lib_1o3tjd1o5cimp._.js +1 -1
- package/.next/server/chunks/src_lib_error-list_1o9rfcd_k01kv._.js +3 -0
- package/.next/server/chunks/src_lib_import_import-batches_ts_0nq3mn0v5uj28._.js +1 -1
- package/.next/server/chunks/src_lib_import_import-tasks_ts_01f-g_upv7llt._.js +1 -1
- package/.next/server/chunks/src_lib_notebook-scope_ts_06eipvr6xztlf._.js +1 -1
- package/.next/server/chunks/src_lib_question-bank_import_ts_023xoc-kyom7m._.js +3 -0
- package/.next/server/chunks/src_lib_question_question-deduplication_ts_0gumctesi3szc._.js +1 -1
- package/.next/server/chunks/src_lib_tags_seed_1_ej3w-2450a0._.js +1 -1
- package/.next/server/chunks/ssr/[root-of-the-server]__032-uso7x2eqk._.js +1 -1
- package/.next/server/chunks/ssr/[root-of-the-server]__0ekyw4b9xrrfl._.js +3 -0
- package/.next/server/chunks/ssr/{[root-of-the-server]__04nhi0374i4dp._.js → [root-of-the-server]__0l72nsu73r1ie._.js} +1 -1
- package/.next/server/chunks/ssr/{[root-of-the-server]__0xjcdrflb40xr._.js → [root-of-the-server]__0q4fkp0gm5j49._.js} +1 -1
- package/.next/server/chunks/ssr/[root-of-the-server]__127jl-l56wp65._.js +3 -0
- package/.next/server/chunks/ssr/[root-of-the-server]__13a530hbs-5o-._.js +1 -1
- package/.next/server/chunks/ssr/[root-of-the-server]__1abszuh7g1t6l._.js +3 -0
- package/.next/server/chunks/ssr/[root-of-the-server]__1czdp-cv_3o0y._.js +3 -0
- package/.next/server/chunks/ssr/[root-of-the-server]__1u1nyl__o71y7._.js +3 -0
- package/.next/server/chunks/ssr/[root-of-the-server]__1w_b5karqfj4p._.js +3 -0
- package/.next/server/chunks/ssr/{[root-of-the-server]__01z2m5q6l60fn._.js → [root-of-the-server]__1z7574v_ikkfm._.js} +1 -1
- package/.next/server/chunks/ssr/_0-nyc5xhnkj97._.js +3 -0
- package/.next/server/chunks/ssr/_00bsw28n2tkm8._.js +3 -0
- package/.next/server/chunks/ssr/_017305t8j_d1y._.js +3 -0
- package/.next/server/chunks/ssr/_02_avk2sj3zf5._.js +1 -1
- package/.next/server/chunks/ssr/_081vr-pfkkxm1._.js +3 -0
- package/.next/server/chunks/ssr/{_1h4fhwg03wbzm._.js → _08d_9wlphi_z1._.js} +1 -1
- package/.next/server/chunks/ssr/_093l-s8jylydj._.js +3 -0
- package/.next/server/chunks/ssr/_09np4pgpwe7dt._.js +3 -0
- package/.next/server/chunks/ssr/_09o1qheyspd5d._.js +3 -0
- package/.next/server/chunks/ssr/{_0ajvgy4u-t-py._.js → _0_6a-7_isz4ox._.js} +1 -1
- package/.next/server/chunks/ssr/_0p3bqrojxwfs0._.js +1 -1
- package/.next/server/chunks/ssr/_0rd-teluypcd2._.js +1 -1
- package/.next/server/chunks/ssr/_13546ppmec5po._.js +4 -0
- package/.next/server/chunks/ssr/{_0is6rtsx_9ka7._.js → _1bpiiswbxudjs._.js} +1 -1
- package/.next/server/chunks/ssr/_1ctycpq4tb8xw._.js +1 -1
- package/.next/server/chunks/ssr/_1gdar99uip6w4._.js +3 -0
- package/.next/server/chunks/ssr/_1m-8w6s67a81a._.js +3 -0
- package/.next/server/chunks/ssr/_1s1ithxs1-28e._.js +3 -0
- package/.next/server/chunks/ssr/_1ywwrbmzxhzuj._.js +3 -0
- package/.next/server/chunks/ssr/_207sw-k8wjyua._.js +4 -0
- package/.next/server/chunks/ssr/_next-internal_server_app_banks_page_actions_02im6pq6s__f4.js +3 -0
- package/.next/server/chunks/ssr/node_modules_0_n_aglnnr_pe._.js +3 -0
- package/.next/server/chunks/ssr/{node_modules_1i644g-kqgnm_._.js → node_modules_0h9ta63mxl6gx._.js} +1 -1
- package/.next/server/chunks/ssr/node_modules_0howjysrkg79j._.js +3 -0
- package/.next/server/chunks/ssr/node_modules_1gehjcp51qewp._.js +3 -0
- package/.next/server/chunks/ssr/{node_modules_05hncuf8243qe._.js → node_modules_@radix-ui_1c09orgee1uhq._.js} +2 -2
- package/.next/server/chunks/ssr/{node_modules_heic-to_dist_csp_heic-to_0sz_snu3yd_63.js → node_modules_heic-to_dist_csp_heic-to_0lnmp65mgz816.js} +1 -1
- package/.next/server/chunks/ssr/node_modules_next_dist_0rsvep-qefr2x._.js +1 -1
- package/.next/server/chunks/ssr/node_modules_next_dist_1khq67j4vo9y4._.js +1 -1
- package/.next/server/chunks/ssr/node_modules_next_dist_esm_build_templates_app-page_1v3-7fv6473ff.js +3 -0
- package/.next/server/chunks/ssr/src_0qrp0l9l_33ze._.js +3 -0
- package/.next/server/chunks/ssr/{src_0e73j7l6j__rh._.js → src_11my1u2jnbp_c._.js} +2 -2
- package/.next/server/chunks/ssr/src_18crt94jrdkoz._.js +3 -0
- package/.next/server/chunks/ssr/src_1m8frpkuirkx8._.js +1 -1
- package/.next/server/chunks/ssr/src_app_banks_page_tsx_0ln3jwg20xg0f._.js +3 -0
- package/.next/server/chunks/ssr/src_app_notebooks_[id]_page_tsx_08njm-5-txm8_._.js +1 -1
- package/.next/server/chunks/ssr/src_app_notebooks_page_tsx_1p9src5gnz_40._.js +1 -1
- package/.next/server/chunks/ssr/src_app_page_tsx_1chiuahujsxm1._.js +2 -2
- package/.next/server/chunks/ssr/src_app_practice_page_tsx_10gnx53v3kpzb._.js +1 -1
- package/.next/server/chunks/ssr/src_app_review_page_tsx_1rq4ygvo_szv0._.js +1 -1
- package/.next/server/chunks/ssr/src_components_error-list_error-item-card_tsx_1zsiqsrj-jjd7._.js +1 -1
- package/.next/server/chunks/ssr/src_components_mastery-panel_tsx_1--j5c7mhomdp._.js +1 -1
- package/.next/server/chunks/ssr/src_components_providers_tsx_09kw-mv3nb6xs._.js +20 -20
- package/.next/server/chunks/ssr/src_contexts_LanguageContext_tsx_0r6xucmeu1k5z._.js +1 -1
- package/.next/server/chunks/ssr/src_lib_0rd9w12yo--s3._.js +3 -0
- package/.next/server/chunks/ssr/src_lib_130aann40fb28._.js +3 -0
- package/.next/server/chunks/ssr/src_lib_api-client_ts_04r2_ex-gua5i._.js +1 -1
- package/.next/server/chunks/ssr/src_lib_i18n_en_ts_08zkpwnoqey5s._.js +1 -1
- package/.next/server/functions-config-manifest.json +2 -1
- package/.next/server/middleware-build-manifest.js +14 -3
- package/.next/server/next-font-manifest.js +1 -1
- package/.next/server/next-font-manifest.json +4 -0
- package/.next/server/pages/500.html +1 -1
- package/.next/server/preview-props.json +3 -3
- package/.next/server/server-reference-manifest.js +1 -1
- package/.next/server/server-reference-manifest.json +1 -1
- package/.next/static/chunks/{3j92h-4k4_o_f.js → 01du700kl9vpy.js} +1 -1
- package/.next/static/chunks/0296boczx9jzp.js +1 -0
- package/.next/static/chunks/0ce17zvy849pt.js +1 -0
- package/.next/static/chunks/0jujm58tnoh6g.js +1 -0
- package/.next/static/chunks/{1rlw59dtd-wn9.js → 0l7p1okxbynzl.js} +2 -2
- package/.next/static/chunks/0q-ubzpc3zt00.js +264 -0
- package/.next/static/chunks/0q3d845nwr3t9.js +1 -0
- package/.next/static/chunks/{2s65brxj4r_r8.js → 0qp2dju3vke54.js} +1 -1
- package/.next/static/chunks/0wf-6-2_vym2v.js +1 -0
- package/.next/static/chunks/11-wz53_clo14.js +1 -0
- package/.next/static/chunks/{0_ysyni00uuve.js → 1inmkqwqys755.js} +1 -1
- package/.next/static/chunks/{2_0xdmmmic5_l.js → 1s6os79cobfn_.js} +1 -1
- package/.next/static/chunks/1vyad-frr447h.js +2 -0
- package/.next/static/chunks/1xe6wsozi5dph.js +9 -0
- package/.next/static/chunks/{1-p-0kczwnip9.js → 2-_veplkr98_e.js} +1 -1
- package/.next/static/chunks/{3f9t8cne6yfyl.js → 229eh2g7m2yeo.js} +1 -1
- package/.next/static/chunks/2bh5ydfa-1ijv.js +2 -0
- package/.next/static/chunks/{28qc_d51g0z--.js → 2g9sfd_hxpx8t.js} +1 -1
- package/.next/static/chunks/{13aykr4b9nzmt.js → 2pg8rnt3z7y03.js} +4 -4
- package/.next/static/chunks/2vka298e6x3mn.js +13 -0
- package/.next/static/chunks/2wwddiemqx680.js +1 -0
- package/.next/static/chunks/2xm7gxq5_ot8y.js +1 -0
- package/.next/static/chunks/{1joajsaunlqm-.js → 32feki_k6eulj.js} +1 -1
- package/.next/static/chunks/{3h3a7lg3-9cbn.js → 348vc_z8o0lz1.js} +1 -1
- package/.next/static/chunks/3_xu3ke2zp8fv.js +1 -0
- package/.next/static/chunks/3ghbptbmig2g6.js +1 -0
- package/.next/static/chunks/3pn9o00oxw1jh.js +1 -0
- package/.next/static/chunks/3pu4qklwvr6i6.js +1 -0
- package/.next/static/chunks/3t23a8b3wz2sp.css +3 -0
- package/.next/static/chunks/{3t9tbm4atwmw8.js → 3vdtiexr8nj05.js} +1 -1
- package/.next/static/chunks/3xonrwoptfy0c.js +1 -0
- package/dist-scripts/src/lib/tags/data/university.js +1 -1
- package/package.json +1 -1
- package/prisma/migrations/20261111000000_add_question_bank/migration.sql +54 -0
- package/prisma/schema.prisma +50 -0
- package/prisma/seed.db +0 -0
- package/.next/server/chunks/[root-of-the-server]__00ry5fb1607z0._.js +0 -3
- package/.next/server/chunks/[root-of-the-server]__0191d7zm1bh5y._.js +0 -3
- package/.next/server/chunks/[root-of-the-server]__0_3i3iyk5i5fu._.js +0 -3
- package/.next/server/chunks/[root-of-the-server]__0d3nasp559369._.js +0 -3
- package/.next/server/chunks/[root-of-the-server]__0ddx0pk-g57hh._.js +0 -3
- package/.next/server/chunks/[root-of-the-server]__0euaxkmzk9kv8._.js +0 -3
- package/.next/server/chunks/[root-of-the-server]__0evnxpsv44y-s._.js +0 -3
- package/.next/server/chunks/[root-of-the-server]__0g2y0mex0x8zf._.js +0 -3
- package/.next/server/chunks/[root-of-the-server]__0gjk0_s945vrt._.js +0 -3
- package/.next/server/chunks/[root-of-the-server]__0gkhutsleo1es._.js +0 -3
- package/.next/server/chunks/[root-of-the-server]__0gvfx4rsinijb._.js +0 -3
- package/.next/server/chunks/[root-of-the-server]__0jutgg41pd-47._.js +0 -3
- package/.next/server/chunks/[root-of-the-server]__0kc9gy1644-op._.js +0 -3
- package/.next/server/chunks/[root-of-the-server]__0medeb4h2gk5t._.js +0 -3
- package/.next/server/chunks/[root-of-the-server]__0prgnysrc2l5k._.js +0 -3
- package/.next/server/chunks/[root-of-the-server]__0qwtk85kstlpq._.js +0 -3
- package/.next/server/chunks/[root-of-the-server]__0rwbb97vk-mfk._.js +0 -3
- package/.next/server/chunks/[root-of-the-server]__0smp3m3n89xs_._.js +0 -3
- package/.next/server/chunks/[root-of-the-server]__0zsd45jad6b40._.js +0 -3
- package/.next/server/chunks/[root-of-the-server]__0zux7hsnes_j2._.js +0 -3
- package/.next/server/chunks/[root-of-the-server]__10--fi__uy8y7._.js +0 -3
- package/.next/server/chunks/[root-of-the-server]__14b8pj1sucy1-._.js +0 -3
- package/.next/server/chunks/[root-of-the-server]__16t85d4p3aldo._.js +0 -3
- package/.next/server/chunks/[root-of-the-server]__1_do4zybj0nvi._.js +0 -3
- package/.next/server/chunks/[root-of-the-server]__1bz0s-wy2cxhl._.js +0 -3
- package/.next/server/chunks/[root-of-the-server]__1d7_aw9ogigrd._.js +0 -3
- package/.next/server/chunks/[root-of-the-server]__1gb1x1ubkdwig._.js +0 -3
- package/.next/server/chunks/[root-of-the-server]__1gsm8s81ac08k._.js +0 -3
- package/.next/server/chunks/[root-of-the-server]__1hc1bcnovtwo2._.js +0 -3
- package/.next/server/chunks/[root-of-the-server]__1jwd70xukhvz4._.js +0 -3
- package/.next/server/chunks/[root-of-the-server]__1ms_0h40h2rbg._.js +0 -3
- package/.next/server/chunks/[root-of-the-server]__1nw9nkdb5uv4i._.js +0 -3
- package/.next/server/chunks/[root-of-the-server]__1ogeha9-ljbre._.js +0 -3
- package/.next/server/chunks/[root-of-the-server]__1p5s772lt24dg._.js +0 -3
- package/.next/server/chunks/[root-of-the-server]__1pxyy29_t_ru1._.js +0 -3
- package/.next/server/chunks/[root-of-the-server]__1s_ky5a7nhgas._.js +0 -3
- package/.next/server/chunks/[root-of-the-server]__1txu2n-l6c6yu._.js +0 -3
- package/.next/server/chunks/[root-of-the-server]__1ulrsdu0e8fjb._.js +0 -3
- package/.next/server/chunks/[root-of-the-server]__1vg4na3a-hvwi._.js +0 -3
- package/.next/server/chunks/[root-of-the-server]__1wi-k0dtwwxx3._.js +0 -3
- package/.next/server/chunks/[root-of-the-server]__1wvm4n7d69s3x._.js +0 -3
- package/.next/server/chunks/[root-of-the-server]__1x-u1u9mrt630._.js +0 -3
- package/.next/server/chunks/[root-of-the-server]__1xx_3auad-kml._.js +0 -3
- package/.next/server/chunks/[root-of-the-server]__1y0omyblg9j35._.js +0 -3
- package/.next/server/chunks/[root-of-the-server]__1z2d4j9-oei44._.js +0 -3
- package/.next/server/chunks/[root-of-the-server]__1znqtfuuspj0w._.js +0 -3
- package/.next/server/chunks/[root-of-the-server]__205o-7lep9jth._.js +0 -3
- package/.next/server/chunks/[root-of-the-server]__20c3hyqykubh2._.js +0 -3
- package/.next/server/chunks/[root-of-the-server]__20pn9h3od2anc._.js +0 -3
- package/.next/server/chunks/_0b9gke5b17vzh._.js +0 -3
- package/.next/server/chunks/_0ta62b-tktnk8._.js +0 -3
- package/.next/server/chunks/_12xi_xqvtrn3k._.js +0 -3
- package/.next/server/chunks/_14l8uqb__fhx_._.js +0 -3
- package/.next/server/chunks/_18hm5aaxkr500._.js +0 -3
- package/.next/server/chunks/_1b-7g4thtxfnp._.js +0 -3
- package/.next/server/chunks/ssr/[root-of-the-server]__0l0hz47yn1ku_._.js +0 -3
- package/.next/server/chunks/ssr/[root-of-the-server]__0w77craeuuak9._.js +0 -3
- package/.next/server/chunks/ssr/[root-of-the-server]__1rrcp_77jpv98._.js +0 -3
- package/.next/server/chunks/ssr/[root-of-the-server]__1xgyz8jfhhs4j._.js +0 -3
- package/.next/server/chunks/ssr/_07igsu8xjloky._.js +0 -3
- package/.next/server/chunks/ssr/_090e6vf_k0pe9._.js +0 -3
- package/.next/server/chunks/ssr/_09y2uhjubswp4._.js +0 -3
- package/.next/server/chunks/ssr/_0htmdb0udewwn._.js +0 -3
- package/.next/server/chunks/ssr/_0lzeodofsq9pe._.js +0 -3
- package/.next/server/chunks/ssr/_0mp06uu5odp8m._.js +0 -4
- package/.next/server/chunks/ssr/_0ozptnii2nxuw._.js +0 -3
- package/.next/server/chunks/ssr/_0r_8p9g00106y._.js +0 -3
- package/.next/server/chunks/ssr/_0znwyf0_b8ia6._.js +0 -3
- package/.next/server/chunks/ssr/_127aw5h992s9d._.js +0 -4
- package/.next/server/chunks/ssr/_1dx7u1_w4db4k._.js +0 -3
- package/.next/server/chunks/ssr/node_modules_0nslyotwav52f._.js +0 -3
- package/.next/server/chunks/ssr/node_modules_lucide-react_dist_esm_icons_0mg8mlclupjv-._.js +0 -3
- package/.next/server/chunks/ssr/src_0_qzoo_03n_v-._.js +0 -3
- package/.next/server/chunks/ssr/src_0atwwo6buvs3b._.js +0 -3
- package/.next/server/chunks/ssr/src_1o5f_wr8vv-x0._.js +0 -3
- package/.next/server/chunks/ssr/src_lib_short-id_short-id-client_ts_03nnd3s0tat3l._.js +0 -3
- package/.next/static/chunks/08pb1_yl7fhsw.js +0 -1
- package/.next/static/chunks/0alfkmfoq-e76.js +0 -1
- package/.next/static/chunks/0c3tf7izst9o8.js +0 -1
- package/.next/static/chunks/0gs3bacq7z36z.js +0 -1
- package/.next/static/chunks/13oi1micj1ewp.js +0 -1
- package/.next/static/chunks/14zevcjua-k8z.js +0 -1
- package/.next/static/chunks/1797q5c62e7um.js +0 -1
- package/.next/static/chunks/1_4nz7m2jathb.js +0 -1
- package/.next/static/chunks/1ey5h3_143nwz.js +0 -2
- package/.next/static/chunks/23h8i_poncr7i.js +0 -1
- package/.next/static/chunks/26is31yphg3a0.css +0 -3
- package/.next/static/chunks/2e4y6sq3k0g-g.js +0 -1
- package/.next/static/chunks/2hl9d1rdb9hkq.js +0 -1
- package/.next/static/chunks/315-5a18eawtj.js +0 -13
- package/.next/static/chunks/33vv8ujyvnonj.js +0 -1
- package/.next/static/chunks/3keaieh9lgnr3.js +0 -2
- package/.next/static/chunks/3ls9d-zeu8xdr.js +0 -264
- package/.next/static/chunks/3m_jfkz23whuc.js +0 -1
- package/.next/static/chunks/431ssxm5rrwz9.js +0 -1
- /package/.next/static/{HqqfOtkWGYtFERkBGxueA → S4q1xCvMlvuYeRE4fI2-s}/_buildManifest.js +0 -0
- /package/.next/static/{HqqfOtkWGYtFERkBGxueA → S4q1xCvMlvuYeRE4fI2-s}/_clientMiddlewareManifest.js +0 -0
- /package/.next/static/{HqqfOtkWGYtFERkBGxueA → S4q1xCvMlvuYeRE4fI2-s}/_ssgManifest.js +0 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
(()=>{"use strict";(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,711241,e=>{var t=e.i(456420);let a={name:"arrow-left",size:24,node:[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]]};a.node;let s=(0,t.f)(a);e.s(["f",0,s],711241)},576248,e=>{var t=e.i(456420);let a={name:"circle-question-mark",size:24,node:[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M9.09 9a3 3 0 0 1 5.83 1c0 2-3 3-3 3",key:"1u773s"}],["path",{d:"M12 17h.01",key:"p32p05"}]],aliases:["help-circle","circle-help"]};a.node;let s=(0,t.f)(a);e.s(["f",0,s],576248)},77043,e=>{var t=e.i(456420);let a={name:"printer",size:24,node:[["path",{d:"M6 18H4a2 2 0 0 1-2-2v-5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2v5a2 2 0 0 1-2 2h-2",key:"143wyd"}],["path",{d:"M6 9V3a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v6",key:"1itne7"}],["rect",{x:"6",y:"14",width:"12",height:"8",rx:"1",key:"1ue0tg"}]]};a.node;let s=(0,t.f)(a);e.s(["f",0,s],77043)},856522,e=>{var t=e.i(456420);let a={name:"save",size:24,node:[["path",{d:"M15.2 3a2 2 0 0 1 1.4.6l3.8 3.8a2 2 0 0 1 .6 1.4V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2z",key:"1c8476"}],["path",{d:"M17 21v-7a1 1 0 0 0-1-1H8a1 1 0 0 0-1 1v7",key:"1ydtos"}],["path",{d:"M7 3v4a1 1 0 0 0 1 1h7",key:"t51u73"}]]};a.node;let s=(0,t.f)(a);e.s(["f",0,s],856522)},591124,e=>{var t=e.i(843476),a=e.i(271645),s=e.i(522016),r=e.i(618566),l=e.i(215519),i=e.i(306831),n=e.i(456420);let o={name:"clipboard-check",size:24,node:[["rect",{width:"8",height:"4",x:"8",y:"2",rx:"1",ry:"1",key:"tgr4d6"}],["path",{d:"M16 4h2a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V6a2 2 0 0 1 2-2h2",key:"116196"}],["path",{d:"m9 14 2 2 4-4",key:"df797q"}]]};o.node;let c=(0,n.f)(o);var d=e.i(632781),u=e.i(77043),m=e.i(395925),x=e.i(856522),f=e.i(759659),g=e.i(487486),h=e.i(519455),p=e.i(793479),b=e.i(590546),y=e.i(86963),j=e.i(339023),v=e.i(663661),N=e.i(257428),w=e.i(716327),S=e.i(456539),k=e.i(263676),_=e.i(515288),I=e.i(511445),C=e.i(991686),q=e.i(393733),A=e.i(149704),$=e.i(520732),R=e.i(741120),T=e.i(931454),z=e.i(111110),F=e.i(41931),M=e.i(132411),D=e.i(201276),E=e.i(294114);function V({paperId:e,paperMode:s,question:r,onDone:l}){let{t:i,language:n}=(0,z.b)(),[o,c]=(0,a.useState)(null),u=`exam-question:${r.id}:regenerate`,{running:m,refresh:x}=(0,M.f)(u),f=(0,a.useRef)(!1);(0,a.useEffect)(()=>{if(m){f.current=!0;return}f.current&&(f.current=!1,l({}))},[m,l]);let g="original"!==s&&0===r.attempts.length&&!!r.errorItemId&&"pending"!==r.status,p="ready"===r.status&&!!r.questionText?.trim();if(!g&&!p)return null;let b=async t=>{let a="question"===t?i.exam.regenerateQuestionConfirm:i.exam.regenerateAnswerConfirm;if(await (0,E.u)(a)){c(t);try{let a=await F.k.post(`/api/exams/${e}/questions/${r.id}/regenerate`,{mode:t,language:n},{timeout:6e5,recoverable:!0});l(a)}catch(e){if(e instanceof F.a&&409===e.status&&e.data?.code==="TASK_ALREADY_RUNNING")E.c.info(i.errors.TASK_ALREADY_RUNNING),await x();else{let a=e?.data?.message||"",s=i.errors[a];D.V.error("[ExamRegenerate]","Failed to regenerate exam question",{mode:t,code:a}),E.c.error("HAS_RESULTS"===a?i.exam.regenerateHasResults:"string"==typeof s?s:i.exam.regenerateFailed)}}finally{c(null)}}},y=null!==o||!!m;return(0,t.jsxs)("div",{className:"flex flex-wrap gap-1",children:[g&&(0,t.jsxs)(h.f,{variant:"ghost",size:"sm",onClick:()=>b("question"),disabled:y,children:[y?(0,t.jsx)(d.f,{className:"mr-1 h-4 w-4 animate-spin"}):(0,t.jsx)(R.f,{className:"mr-1 h-4 w-4"}),y?i.exam.regenerating:i.exam.regenerateQuestion]}),p&&(0,t.jsxs)(h.f,{variant:"ghost",size:"sm",onClick:()=>b("answer"),disabled:y,children:[y?(0,t.jsx)(d.f,{className:"mr-1 h-4 w-4 animate-spin"}):(0,t.jsx)(T.f,{className:"mr-1 h-4 w-4"}),y?i.exam.regenerating:i.exam.regenerateAnswer]})]})}var H=e.i(763896);function U({questionId:e,score:s,disabled:r,onSave:l}){let{t:i}=(0,z.b)(),[n,o]=(0,a.useState)(null),[c,d]=(0,a.useState)(!1),u=n??(null!==s?String(s):""),m=u.trim(),x=""===m?null:(0,H.H)(Number(m)),f=""===m||null!==x,g=x!==s,h=async()=>{if(!f||!g||c){if(null!==n&&!f)return;o(null);return}d(!0);try{await l(e,x),o(null)}catch(e){D.V.error("[ExamQuestionScore]","保存单题分值失败",{error:e}),E.c.error(i.exam.saveQuestionScoreFailed)}finally{d(!1)}};return(0,t.jsxs)("span",{className:"inline-flex items-center gap-1.5",children:[(0,t.jsx)("label",{className:"text-xs text-muted-foreground",htmlFor:`exam-score-${e}`,children:i.exam.questionScore}),(0,t.jsx)(p.f,{id:`exam-score-${e}`,type:"number",min:.1,max:H.D,step:.1,value:u,disabled:c||r,"aria-invalid":!f,placeholder:i.exam.questionScorePlaceholder,title:i.exam.questionScoreHint,onChange:e=>o(e.target.value),onBlur:()=>void h(),onKeyDown:e=>{"Enter"===e.key&&(e.preventDefault(),h())},className:"h-7 w-20 text-sm"})]})}function X({paperId:e,paperMode:r,question:n,displayNumber:o,editingResult:c,onResultChange:u,onDeleteAttempt:m,onRegenerated:x,previewFigureScale:f,previewFigureAlign:h,onSaveFigureScale:p,onSaveScore:b}){let{t:y}=(0,z.b)(),{timeZone:j}=(0,l.M)(),[v,N]=(0,a.useState)(!1),R=void 0!==c,T=(()=>{if(!n.error)return"";if("SOURCE_DELETED"===n.error)return y.exam.sourceDeleted;let e=n.error.split(":")[0].trim(),t=y.errors[e];return"string"==typeof t?t:n.error})();return(0,t.jsx)(_.N,{children:(0,t.jsxs)(_.O,{className:"space-y-3 pt-4",children:[(0,t.jsxs)("div",{className:"flex flex-wrap items-center gap-2 text-sm",children:[(0,t.jsxs)("span",{className:"font-semibold",children:[o??n.order,"."]}),n.errorItemId?(0,t.jsxs)(s.default,{href:`/error-items/${n.errorItemId}`,className:"font-mono text-xs text-primary hover:underline",children:[y.exam.source," ",n.sourceShortId]}):(0,t.jsxs)("span",{className:"font-mono text-xs text-muted-foreground",children:[n.sourceShortId," · ",y.exam.sourceDeleted]}),n.notebookName&&(0,t.jsx)(g.f,{variant:"secondary",children:n.notebookName}),b&&(0,t.jsx)("span",{className:"ml-auto",children:(0,t.jsx)(U,{questionId:n.id,score:n.score??null,disabled:R,onSave:b})})]}),n.attempts.length>0&&(0,t.jsx)("div",{className:"flex flex-wrap items-center gap-2 text-xs",children:n.attempts.map((e,a)=>(0,t.jsxs)(g.f,{variant:"outline",className:`gap-1 font-normal ${C.x[e.result]||""}`,children:[(0,t.jsx)("span",{children:y.exam.attemptLabel.replace("{n}",String(a+1))}),(0,t.jsx)("span",{className:"tabular-nums",children:(0,i.r)(e.createdAt,"MM-dd",j)}),(0,t.jsx)("span",{className:"font-semibold",children:y.mastery.results[e.result]}),R&&m&&(0,t.jsx)("button",{type:"button","aria-label":y.mastery.deleteRecord,className:"-mr-1 rounded hover:bg-black/10",onClick:()=>m(e.id),children:(0,t.jsx)(k.X,{className:"h-3 w-3"})})]},e.id))}),"pending"===n.status&&(0,t.jsxs)("p",{className:"flex items-center gap-2 text-sm text-muted-foreground",children:[(0,t.jsx)(d.f,{className:"h-4 w-4 animate-spin"}),y.exam.questionPending]}),"failed"===n.status&&(0,t.jsxs)("p",{className:"text-sm text-destructive",children:[y.exam.questionFailed,T?`${y.common.colon}${T}`:""]}),"ready"===n.status&&n.questionText&&(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(I.f,{content:n.questionText}),p?(0,t.jsx)($.f,{svg:n.figureSvg,scale:n.figureScale,align:n.figureAlign,previewScaleOverride:f,previewAlignOverride:h,onSave:(e,t)=>p(n.id,e,t)},`${n.id}-${n.figureScale??100}-${n.figureAlign??"center"}`):(0,t.jsx)(A.f,{svg:n.figureSvg,scale:f??n.figureScale,align:h??n.figureAlign}),(0,t.jsxs)("button",{type:"button",className:"flex items-center gap-1 text-xs text-muted-foreground hover:text-foreground",onClick:()=>N(!v),children:[v?(0,t.jsx)(S.f,{className:"h-3 w-3"}):(0,t.jsx)(w.f,{className:"h-3 w-3"}),y.exam.showAnswer]}),v&&(0,t.jsxs)("div",{className:"space-y-2 rounded-md bg-muted/40 p-3",children:[n.answerText&&(0,t.jsx)(I.f,{content:n.answerText,className:"font-semibold"}),n.analysis&&(0,t.jsx)(I.f,{content:n.analysis})]})]}),!R&&x&&(0,t.jsx)(V,{paperId:e,paperMode:r,question:n,onDone:x}),R&&"ready"===n.status&&n.errorItemId&&u&&(0,t.jsx)(q.f,{value:c,onChange:u,size:"sm"})]})})}function P({scores:e,disabled:s,onSave:r}){let{t:l}=(0,z.b)(),i=e.filter(e=>"number"==typeof e),n=i.length===e.length&&new Set(i).size<=1,o=n?i[0]??null:null,[c,d]=(0,a.useState)(null),[u,m]=(0,a.useState)(!1);if(0===e.length)return null;let x=c??(null!==o?String(o):""),f=""===x.trim()?null:(0,H.H)(Number(x)),g=""===x.trim()||null!==f,b=null!==c&&(f??null)!==o,y=async e=>{if(e.preventDefault(),g&&b&&!u){m(!0);try{await r(f),d(null),E.c.success(l.common.messages.saveSuccess)}catch(e){D.V.error("[ExamScoreBar]","统一保存试卷分值失败",{error:e}),E.c.error(l.exam.saveQuestionScoreFailed)}finally{m(!1)}}};return(0,t.jsxs)("form",{onSubmit:y,className:"flex flex-wrap items-center gap-2 rounded-md border bg-background p-3 text-sm",children:[(0,t.jsx)("span",{className:"font-medium",children:l.exam.uniformScore}),(0,t.jsx)(p.f,{type:"number",min:.1,max:H.D,step:.1,value:x,disabled:u||s,"aria-invalid":!g,"aria-label":l.exam.uniformScore,placeholder:l.exam.questionScorePlaceholder,onChange:e=>d(e.target.value),className:"h-8 w-24"}),(0,t.jsx)(h.f,{type:"submit",size:"sm",disabled:u||s||!b||!g,children:u?l.common.progress.saving:l.common.save}),null!==o&&!n&&(0,t.jsx)("span",{className:"text-xs text-muted-foreground",children:l.exam.totalScoreUnscored.replace("{count}",String(e.length-i.length))}),(0,t.jsx)("p",{className:"w-full text-xs text-muted-foreground",children:l.exam.uniformScoreHint}),!g&&(0,t.jsx)("p",{className:"w-full text-xs text-destructive",children:l.exam.questionScoreInvalid})]})}var B=e.i(336653);function L({section:e}){let{t:a}=(0,z.b)(),s=null!==e.scoreTotal?a.exam.sectionSummaryScored.replace("{count}",String(e.count)).replace("{total}",String(e.scoreTotal)):a.exam.sectionSummary.replace("{count}",String(e.count));return(0,t.jsxs)("div",{className:"flex flex-wrap items-baseline gap-x-3 gap-y-1 border-b pb-2 pt-4",children:[(0,t.jsx)("h2",{className:"text-base font-bold",children:e.title}),(0,t.jsxs)("span",{className:"text-sm text-muted-foreground",children:[s,null!==e.scoreTotal&&e.unscored>0&&(0,t.jsxs)("span",{children:["(",a.exam.sectionSummaryUnscored.replace("{count}",String(e.unscored)),")"]})]})]})}function K({paperId:e,paperMode:a,sections:s,draft:r,onResultChange:l,onDeleteAttempt:i,onRegenerated:n,uniformPreview:o,onSaveFigureScale:c,onSaveScore:d}){let u=s=>(0,t.jsx)(X,{paperId:e,paperMode:a,question:s.question,displayNumber:s.displayNumber,editingResult:r?r[s.question.id]??null:void 0,onResultChange:e=>l(s.question.id,e),onDeleteAttempt:i,onRegenerated:n,previewFigureScale:o.scale,previewFigureAlign:o.align,onSaveFigureScale:c,onSaveScore:d},s.question.id);return(0,t.jsx)("div",{className:"space-y-3",children:s.map(e=>(0,t.jsxs)("section",{className:"space-y-3",children:[(0,t.jsx)(L,{section:e}),e.items.map(u)]},e.title))})}function O({paperId:e,paperMode:a,groupByType:s,questions:r,draft:l,onResultChange:i,onDeleteAttempt:n,onRegenerated:o,uniformPreview:c,onSaveFigureScale:d,onSaveScore:u,onSaveUniformScore:m,onSaveGroupByType:x}){let{t:f,language:g}=(0,z.b)(),h=s?(0,B.f)(r,g):null;return(0,t.jsxs)("div",{className:"space-y-3",children:[(0,t.jsxs)("div",{className:"flex flex-wrap items-center gap-x-6 gap-y-2",children:[(0,t.jsx)(P,{scores:r.map(e=>e.score??null),disabled:!!l,onSave:m}),(0,t.jsxs)("label",{className:"flex items-center gap-2 text-sm",title:f.exam.groupByTypeHint,children:[(0,t.jsx)(N.f,{checked:s,disabled:!!l,onCheckedChange:e=>void x(!0===e)}),f.exam.groupByType]})]}),h?(0,t.jsx)(K,{paperId:e,paperMode:a,sections:h,draft:l,onResultChange:i,onDeleteAttempt:n,onRegenerated:o,uniformPreview:c,onSaveFigureScale:d,onSaveScore:u}):r.map(s=>(0,t.jsx)(X,{paperId:e,paperMode:a,question:s,editingResult:l?l[s.id]??null:void 0,onResultChange:e=>i(s.id,e),onDeleteAttempt:n,onRegenerated:o,previewFigureScale:c.scale,previewFigureAlign:c.align,onSaveFigureScale:d,onSaveScore:u},s.id))]})}var Q=e.i(35209);e.s(["default",0,function(){let{timeZone:e}=(0,l.M)(),n=(0,r.useParams)(),o=(0,r.useRouter)(),{t:N,language:w}=(0,z.b)(),S=n.id,[k,_]=(0,a.useState)(null);(0,Q.f)(N.exam.title,k?.title);let[I,C]=(0,a.useState)(!1),[q,A]=(0,a.useState)(null),[$,R]=(0,a.useState)((0,i.r)(new Date,"yyyy-MM-dd",e)),[T,D]=(0,a.useState)(!1),[V,U]=(0,a.useState)(null),[X,P]=(0,a.useState)({scale:null,align:null}),B=`exam-paper:${S}:generate`,{running:L,refresh:K}=(0,M.f)(B),G=(0,a.useCallback)(async()=>{try{_(await F.k.get(`/api/exams/${S}`))}catch{C(!0)}},[S]);if((0,a.useEffect)(()=>{G()},[G]),(0,a.useEffect)(()=>{if(k?.status!=="generating")return;let e=setTimeout(G,3e3);return()=>clearTimeout(e)},[k,G]),I)return(0,t.jsx)("div",{className:"p-8 text-center",children:N.exam.notFound});if(!k)return(0,t.jsx)(y.f,{label:N.common.loading});let Y=k.questions.filter(e=>"ready"===e.status).length,W=k.questions.some(e=>e.attempts.length>0),J=k.questions.some(e=>"failed"===e.status),Z=k.questions.filter(e=>"ready"===e.status&&e.errorItemId),ee=k.questions.filter(e=>"ready"===e.status&&!!e.figureSvg),et=q?Z.filter(e=>q[e.id]).length:0,ea=async()=>{if(q&&0!==et){D(!0),U(null);try{await F.k.post(`/api/exams/${k.id}/results`,{takenAt:(0,i.$)($,e),results:Z.filter(e=>q[e.id]).map(e=>({questionId:e.id,result:q[e.id]}))}),A(null),U(N.exam.resultsSaved),await G()}catch{U(N.exam.resultsSaveFailed)}finally{D(!1)}}},es=async e=>{if(await (0,E.u)(N.mastery.deleteRecordConfirm,{destructive:!0}))try{await F.k.delete(`/api/practice/record/${e}`),await G()}catch{U(N.mastery.deleteRecordFailed)}},er=async()=>{try{await F.k.post(`/api/exams/${k.id}/retry`,{language:w})}catch(e){if(e instanceof F.a&&409===e.status&&e.data?.code==="TASK_ALREADY_RUNNING")E.c.info(N.errors.TASK_ALREADY_RUNNING),await K();else throw e}await G()},el=async()=>{await (0,E.u)(N.exam.deleteConfirm,{destructive:!0})&&(await F.k.delete(`/api/exams/${k.id}`),o.push("/exams"))},ei=async(e,t,a)=>{await F.k.patch(`/api/exams/${k.id}`,{questionId:e,figureScale:t,figureAlign:a}),_(s=>s?{...s,questions:s.questions.map(s=>s.id===e?{...s,figureScale:t,figureAlign:a}:s)}:s)},en=async e=>{await F.k.patch(`/api/exams/${k.id}`,e),_(t=>t?{...t,questions:t.questions.map(t=>({...t,...e}))}:t)},eo=async(e,t)=>{await F.k.patch(`/api/exams/${k.id}`,{questionId:e,score:t}),_(a=>a?{...a,questions:a.questions.map(a=>a.id===e?{...a,score:t}:a)}:a)},ec=async e=>{await F.k.patch(`/api/exams/${k.id}`,{score:e}),_(t=>t?{...t,questions:t.questions.map(t=>({...t,score:e}))}:t)},ed=async e=>{await F.k.patch(`/api/exams/${k.id}`,{groupByType:e}),_(t=>t?{...t,groupByType:e}:t)},eu=(0,H.n)(k.questions.filter(e=>"ready"===e.status).map(e=>e.score??null));return(0,t.jsx)("main",{className:"mx-auto min-h-screen max-w-6xl px-4 py-6 md:px-8 md:py-8",children:(0,t.jsxs)("div",{className:"space-y-6 pb-24",children:[(0,t.jsxs)("div",{className:"flex items-start gap-3",children:[(0,t.jsx)(b.f,{fallbackUrl:"/exams",className:"-ml-2 shrink-0"}),(0,t.jsxs)("div",{className:"flex-1 min-w-0 space-y-2",children:[(0,t.jsx)("h1",{className:"text-xl sm:text-2xl font-bold tracking-tight break-words",children:k.title}),(0,t.jsxs)("div",{className:"flex flex-wrap items-center gap-2 text-sm text-muted-foreground",children:[(0,t.jsx)(v.f,{status:k.status,recorded:W}),"original"===k.mode&&(0,t.jsx)(g.f,{variant:"secondary",children:N.exam.modes.original}),(0,t.jsx)("span",{children:N.exam.progress.replace("{ready}",String(Y)).replace("{total}",String(k.questions.length))}),null!==eu.total&&(0,t.jsxs)("span",{children:[N.exam.totalScore.replace("{total}",(0,H.s)(eu.total)),eu.unscored>0&&(0,t.jsxs)("span",{className:"text-xs",children:["(",N.exam.totalScoreUnscored.replace("{count}",String(eu.unscored)),")"]})]}),(0,t.jsx)("span",{children:(0,i.r)(k.createdAt,"yyyy-MM-dd HH:mm",e)})]})]})]}),(0,t.jsxs)("div",{className:"flex flex-wrap gap-2",children:[(0,t.jsx)(s.default,{href:`/exams/${k.id}/print`,children:(0,t.jsxs)(h.f,{variant:"outline",size:"sm",disabled:0===Y,children:[(0,t.jsx)(u.f,{className:"mr-2 h-4 w-4"}),N.exam.print]})}),!q&&Z.length>0&&(0,t.jsxs)(h.f,{size:"sm",onClick:()=>{U(null),A({}),R((0,i.r)(new Date,"yyyy-MM-dd",e))},children:[(0,t.jsx)(c,{className:"mr-2 h-4 w-4"}),N.exam.recordResults]}),J&&"generating"!==k.status&&(0,t.jsxs)(h.f,{variant:"outline",size:"sm",onClick:er,disabled:!!L,children:[L?(0,t.jsx)(d.f,{className:"mr-2 h-4 w-4 animate-spin"}):(0,t.jsx)(m.f,{className:"mr-2 h-4 w-4"}),L?N.exam.questionPending:N.exam.retryFailed]}),(0,t.jsxs)(h.f,{variant:"ghost",size:"sm",onClick:el,className:"text-red-600 dark:text-red-400 hover:text-red-700 dark:hover:text-red-300 hover:bg-red-50 dark:hover:bg-red-950/40 sm:ml-auto",children:[(0,t.jsx)(f.f,{className:"mr-2 h-4 w-4"}),N.exam.delete]})]}),k.questions.length<k.requestedCount&&(0,t.jsx)("p",{className:"rounded-md border border-amber-200 dark:border-amber-900 bg-amber-50 dark:bg-amber-950/40 p-3 text-sm text-amber-800 dark:text-amber-200",children:N.exam.fewerThanRequested.replaceAll("{actual}",String(k.questions.length))}),V&&(0,t.jsx)("p",{className:"rounded-md border p-3 text-sm",children:V}),q&&(0,t.jsxs)("div",{className:"space-y-2 rounded-md border bg-muted/30 p-3",children:[(0,t.jsxs)("div",{className:"flex flex-col sm:flex-row sm:items-center gap-2",children:[(0,t.jsx)("label",{htmlFor:"exam-taken-at",className:"text-sm font-medium",children:N.exam.takenAt}),(0,t.jsx)(p.f,{id:"exam-taken-at",type:"date",value:$,onChange:e=>R(e.target.value),className:"sm:w-48"})]}),(0,t.jsx)("p",{className:"text-xs text-muted-foreground",children:N.exam.recordHint})]}),ee.length>0&&(0,t.jsx)(j.f,{scales:ee.map(e=>e.figureScale),aligns:ee.map(e=>e.figureAlign),onPreviewChange:P,onSave:en}),(0,t.jsx)(O,{paperId:k.id,paperMode:k.mode,groupByType:k.groupByType,questions:k.questions,draft:q,onResultChange:(e,t)=>A(a=>a?{...a,[e]:t}:a),onDeleteAttempt:es,onRegenerated:G,uniformPreview:X,onSaveFigureScale:ei,onSaveScore:eo,onSaveUniformScore:ec,onSaveGroupByType:ed}),q&&(0,t.jsx)("div",{className:"fixed inset-x-0 bottom-16 z-30 border-t bg-background/95 p-3 backdrop-blur md:bottom-0",children:(0,t.jsxs)("div",{className:"max-w-4xl mx-auto flex items-center justify-end gap-2",children:[0===et&&(0,t.jsx)("span",{className:"mr-auto text-xs text-muted-foreground",children:N.exam.noResultSelected}),(0,t.jsx)(h.f,{variant:"outline",onClick:()=>A(null),disabled:T,children:N.exam.cancel}),(0,t.jsxs)(h.f,{onClick:ea,disabled:T||!$||0===et,children:[T?(0,t.jsx)(d.f,{className:"mr-2 h-4 w-4 animate-spin"}):(0,t.jsx)(x.f,{className:"mr-2 h-4 w-4"}),N.exam.saveResults]})]})})]})})}],591124)},520732,e=>{var t=e.i(843476),a=e.i(271645),s=e.i(149704),r=e.i(519455),l=e.i(793479),i=e.i(111110),n=e.i(294114),o=e.i(184110),c=e.i(201276);e.s(["f",0,function({svg:e,scale:d,align:u,previewScaleOverride:m,previewAlignOverride:x,onSave:f}){let{t:g}=(0,i.b)(),h=(0,a.useId)(),p=(0,o.V)(d),b=(0,o.o)(u),[y,j]=(0,a.useState)(null),[v,N]=(0,a.useState)(null),[w,S]=(0,a.useState)(!1),k=y??String(p),_=""!==k.trim()&&(0,o.x)(Number(k)),I=_?Number(k):p,C=v??b,q=m??I,A=x??C,$=null!==y&&(!_||Number(k)!==p)||null!==v&&v!==b;if(!e)return null;let R=async e=>{if(e.preventDefault(),_&&$&&!w){S(!0);try{await f(I,C),j(null),N(null),n.c.success(g.common.messages.saveSuccess)}catch(e){c.V.error("[FigureScale]","保存配图比例失败",{error:e}),n.c.error(g.common.messages.saveFailed)}finally{S(!1)}}};return(0,t.jsxs)("div",{children:[(0,t.jsx)(s.f,{svg:e,scale:q,align:A}),(0,t.jsxs)("form",{onSubmit:R,className:"figure-scale-editor-controls space-y-2 rounded-md border p-3 print:hidden",children:[(0,t.jsxs)("div",{className:"flex flex-wrap items-center gap-2 text-sm",children:[(0,t.jsx)("label",{htmlFor:h,children:g.figure.scale}),(0,t.jsx)(l.f,{id:h,type:"number",min:o._,max:o.a,step:1,value:k,disabled:w,"aria-describedby":`${h}-hint`,"aria-invalid":!_,onChange:e=>j(e.target.value),className:"h-8 w-20"}),(0,t.jsx)("span",{children:"%"}),(0,t.jsx)(r.f,{type:"button",variant:"outline",size:"sm",disabled:w||_&&I===o.n,onClick:()=>j(String(o.n)),children:g.figure.resetScale}),(0,t.jsxs)("div",{role:"group","aria-label":g.figure.align,className:"inline-flex items-center gap-1",children:[(0,t.jsx)("span",{className:"text-muted-foreground",children:g.figure.align}),o.j.map(e=>(0,t.jsx)(r.f,{type:"button",variant:C===e?"default":"outline",size:"sm",disabled:w,"aria-pressed":C===e,onClick:()=>N(e===b?null:e),children:g.figure.aligns[e]},e))]}),(0,t.jsx)(r.f,{type:"submit",size:"sm",disabled:w||!$||!_,children:w?g.common.progress.saving:g.common.save}),$&&(0,t.jsx)(r.f,{type:"button",variant:"ghost",size:"sm",disabled:w,onClick:()=>{j(null),N(null)},children:g.common.cancel})]}),(0,t.jsx)("input",{type:"range",min:o._,max:o.a,step:1,value:I,disabled:w,"aria-label":g.figure.scaleSlider,"aria-describedby":`${h}-hint`,onChange:e=>j(e.target.value),className:"block h-6 w-full max-w-sm accent-primary"}),(0,t.jsx)("p",{id:`${h}-hint`,className:"text-xs text-muted-foreground",children:g.figure.scaleHint})]})]})}])},339023,763896,336653,e=>{var t=e.i(843476),a=e.i(271645),s=e.i(519455),r=e.i(793479),l=e.i(111110),i=e.i(294114),n=e.i(184110),o=e.i(201276);function c(e){let t=0,a=0;for(let s of e)"number"==typeof s&&Number.isFinite(s)&&(t+=1,a+=s);return{scored:t,unscored:e.length-t,total:t>0?Math.round(10*a)/10:null}}e.s(["f",0,function({scales:e,aligns:c,onPreviewChange:d,onSave:u}){let{t:m}=(0,l.b)(),x=(0,a.useId)(),f=e.map(n.V),g=new Set(f).size<=1,h=f[0]??n.n,p=(c??e.map(()=>n.E)).map(n.o),b=new Set(p).size<=1,y=p[0]??n.E,[j,v]=(0,a.useState)(null),[N,w]=(0,a.useState)(null),[S,k]=(0,a.useState)(!1);if(0===e.length)return null;let _=j??String(h),I=""!==_.trim()&&(0,n.x)(Number(_)),C=I?Number(_):h,q=N??y,A=null!==j||null!==N,$=null!==j?!I||!g||Number(_)!==h:!A&&!g,R=null!==N?!b||N!==y:!A&&!b,T=$||R,z=(e,t)=>{let a=null!==e&&""!==e.trim()&&(0,n.x)(Number(e))?Number(e):null;d?.({scale:a,align:t})},F=e=>{v(e),z(e,N)},M=async e=>{if(e.preventDefault(),I&&T&&!S){k(!0);try{let e={};null===j&&(A||g)||(e.figureScale=C),null===N&&(A||b)||(e.figureAlign=q),await u(e),v(null),w(null),d?.({scale:null,align:null}),i.c.success(m.common.messages.saveSuccess)}catch(e){o.V.error("[ExamFigureScale]","统一保存试卷配图设置失败",{error:e}),i.c.error(m.common.messages.saveFailed)}finally{k(!1)}}};return(0,t.jsxs)("form",{onSubmit:M,className:"figure-scale-editor-controls w-full space-y-2 rounded-md border bg-background p-3 print:hidden",children:[(0,t.jsxs)("div",{className:"flex flex-wrap items-center gap-2 text-sm",children:[(0,t.jsx)("label",{htmlFor:x,className:"font-medium",children:m.exam.uniformFigureScale}),(0,t.jsx)(r.f,{id:x,type:"number",min:n._,max:n.a,step:1,value:_,disabled:S,"aria-describedby":`${x}-hint`,"aria-invalid":!I,onChange:e=>F(e.target.value),className:"h-8 w-20"}),(0,t.jsx)("span",{children:"%"}),(0,t.jsx)(s.f,{type:"button",variant:"outline",size:"sm",disabled:S||g&&I&&C===n.n,onClick:()=>F(String(n.n)),children:m.figure.resetScale}),(0,t.jsxs)("div",{role:"group","aria-label":m.exam.uniformFigureAlign,className:"inline-flex items-center gap-1",children:[(0,t.jsx)("span",{className:"text-muted-foreground",children:m.exam.uniformFigureAlign}),n.j.map(e=>(0,t.jsx)(s.f,{type:"button",variant:q===e&&(null!==N||b)?"default":"outline",size:"sm",disabled:S,"aria-pressed":q===e&&(null!==N||b),onClick:()=>{var t;w(t=b&&e===y?null:e),z(j,t)},children:m.figure.aligns[e]},e))]}),(0,t.jsx)(s.f,{type:"submit",size:"sm",disabled:S||!T||!I,children:S?m.common.progress.saving:m.common.save}),A&&(0,t.jsx)(s.f,{type:"button",variant:"ghost",size:"sm",disabled:S,onClick:()=>{v(null),w(null),d?.({scale:null,align:null})},children:m.common.cancel})]}),(0,t.jsx)("input",{type:"range",min:n._,max:n.a,step:1,value:C,disabled:S,"aria-label":m.exam.uniformFigureScaleSlider,"aria-describedby":`${x}-hint`,onChange:e=>F(e.target.value),className:"block h-6 w-full max-w-sm accent-primary"}),(0,t.jsx)("p",{id:`${x}-hint`,className:"text-xs text-muted-foreground",children:m.exam.uniformFigureScaleHint})]})}],339023),e.s(["D",0,1e3,"s",0,function(e){return Number.isInteger(e)?String(e):e.toFixed(1)},"H",0,function(e){return null===e||"number"!=typeof e||!Number.isFinite(e)||e<.001||e>1e3||Math.abs(10*e-Math.round(10*e))>1e-6?null:Math.round(10*e)/10},"n",0,c],763896);var d=e.i(401280);let u=["一","二","三","四","五","六","七","八","九","十","十一","十二","十三","十四","十五","十六","十七","十八","十九","二十"],m=["I","II","III","IV","V","VI","VII","VIII","IX","X","XI","XII","XIII","XIV","XV","XVI","XVII","XVIII","XIX","XX"];e.s(["f",0,function(e,t){let a=new Map;for(let e of d.V)a.set(e,[]);for(let t of[...e].sort((e,t)=>e.order-t.order))a.get(function(e){let t=e.questionType??e.errorItemQuestionType??null;return d.V.includes(t??"")?t:"other"}(t)).push(t);let s=[],r=1,l=0;for(let e of d.V){let i=a.get(e);if(0===i.length)continue;let n=c(i.map(e=>e.score??null));s.push({type:"other"===e?null:e,title:function(e,t,a){let s="zh"===a?d.H[e]:d.u[e];return"zh"===a?`${u[t]}、${s}`:`Part ${m[t]}. ${s}`}(e,l,t),items:i.map(e=>({question:e,displayNumber:r++})),count:i.length,scoreTotal:n.total,unscored:n.unscored}),l+=1}return s}],336653)},663661,e=>{var t=e.i(843476),a=e.i(487486),s=e.i(111110);let r={generating:"bg-blue-100 dark:bg-blue-900/40 text-blue-700 dark:text-blue-300 border-blue-200 dark:border-blue-900",ready:"bg-indigo-100 dark:bg-indigo-900/40 text-indigo-700 dark:text-indigo-300 border-indigo-200 dark:border-indigo-900",partial:"bg-amber-100 dark:bg-amber-900/40 text-amber-700 dark:text-amber-300 border-amber-200 dark:border-amber-900",failed:"bg-red-100 dark:bg-red-900/40 text-red-700 dark:text-red-300 border-red-200 dark:border-red-900",completed:"bg-green-100 dark:bg-green-900/40 text-green-700 dark:text-green-300 border-green-200 dark:border-green-900"};e.s(["f",0,function({status:e,recorded:l}){let{t:i}=(0,s.b)(),n=l&&("ready"===e||"partial"===e)?"completed":e;return(0,t.jsx)(a.f,{variant:"outline",className:r[n],children:i.exam.status[n]})}])},991686,931454,e=>{var t=e.i(843476),a=e.i(271645),s=e.i(522016),r=e.i(215519),l=e.i(306831),i=e.i(716327),n=e.i(456539),o=e.i(632781),c=e.i(77071),d=e.i(328623),u=e.i(759659),m=e.i(487486),x=e.i(519455),f=e.i(515288),g=e.i(511445),h=e.i(856522),p=e.i(793479),b=e.i(393733),y=e.i(111110),j=e.i(41931);function v({errorItemId:e,onSaved:s,onCancel:i}){let{t:n}=(0,y.b)(),{timeZone:c}=(0,r.M)(),d=(0,l.r)(new Date,"yyyy-MM-dd",c),[u,m]=(0,a.useState)(null),[f,g]=(0,a.useState)(d),[N,w]=(0,a.useState)(!1),[S,k]=(0,a.useState)(null),_=async()=>{if(u&&f){w(!0),k(null);try{await j.k.post("/api/practice/record",{errorItemId:e,result:u,source:"manual",takenAt:(0,l.$)(f,c)}),s()}catch{k(n.mastery.resultSaveFailed)}finally{w(!1)}}};return(0,t.jsxs)("div",{className:"space-y-3 rounded-md border bg-muted/30 p-3",children:[(0,t.jsx)(b.f,{value:u,onChange:m,disabled:N}),(0,t.jsxs)("div",{className:"flex flex-col sm:flex-row sm:items-center gap-2",children:[(0,t.jsx)("label",{htmlFor:`practice-date-${e}`,className:"text-sm font-medium",children:n.mastery.recordDate}),(0,t.jsx)(p.f,{id:`practice-date-${e}`,type:"date",value:f,max:d,onChange:e=>g(e.target.value),className:"sm:w-48"}),(0,t.jsxs)("div",{className:"flex gap-2 sm:ml-auto",children:[(0,t.jsx)(x.f,{variant:"outline",size:"sm",onClick:i,disabled:N,className:"flex-1 sm:flex-none",children:n.exam.cancel}),(0,t.jsxs)(x.f,{size:"sm",onClick:_,disabled:N||!u||!f,className:"flex-1 sm:flex-none",children:[N?(0,t.jsx)(o.f,{className:"mr-2 h-4 w-4 animate-spin"}):(0,t.jsx)(h.f,{className:"mr-2 h-4 w-4"}),n.mastery.saveResult]})]})]}),S&&(0,t.jsx)("p",{className:"text-sm text-destructive",children:S})]})}var N=e.i(149704),w=e.i(294114),S=e.i(905110);let k={correct:"bg-green-100 dark:bg-green-900/40 text-green-700 dark:text-green-300 border-green-200 dark:border-green-900",wrong:"bg-red-100 dark:bg-red-900/40 text-red-700 dark:text-red-300 border-red-200 dark:border-red-900",not_attempted:"bg-amber-100 dark:bg-amber-900/40 text-amber-700 dark:text-amber-300 border-amber-200 dark:border-amber-900"};e.s(["K",0,function({errorItemId:e,onMasteryStatusChange:h}){let{timeZone:p}=(0,r.M)(),{t:b}=(0,y.b)(),[_,I]=(0,a.useState)(null),[C,q]=(0,a.useState)(null),[A,$]=(0,a.useState)(0),[R,T]=(0,a.useState)(!1),z=(0,a.useCallback)(()=>{j.k.get(`/api/error-items/${e}/practice-records`).then(e=>{I(e),h?.(e.masteryStatus)}).catch(()=>void 0)},[e,h]);(0,a.useEffect)(z,[z]);let F=()=>{$(0),z()},M=async e=>{if(await (0,w.u)(b.mastery.deleteRecordConfirm,{destructive:!0}))try{await j.k.delete(`/api/practice/record/${e}`),F()}catch{w.c.error(b.mastery.deleteRecordFailed)}},D=_?.records[0],E=!!D&&(!_?.masteryEvaluatedAt||new Date(D.createdAt)>new Date(_.masteryEvaluatedAt));if((0,a.useEffect)(()=>{if(!E||A>=20)return;let e=setTimeout(()=>{$(e=>e+1),z()},4e3);return()=>clearTimeout(e)},[E,A,z]),!_)return null;let V=_.masteryProbability,H=null===V?null:Math.round(100*V),U=null===H?"":(0,S.m)(V,_.masteryThreshold)?"bg-green-500":H>=30?"bg-amber-500":"bg-red-500",X=b.practice.difficulty;return(0,t.jsxs)(f.N,{children:[(0,t.jsx)(f.Y,{children:(0,t.jsxs)(f.v,{className:"flex items-center gap-2 text-base",children:[(0,t.jsx)(d.f,{className:"h-4 w-4 text-primary"}),b.mastery.probability]})}),(0,t.jsxs)(f.O,{className:"space-y-4",children:[null===H?(0,t.jsx)("p",{className:"text-sm text-muted-foreground",children:E?b.mastery.pending:b.mastery.notEvaluated}):(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsxs)("div",{className:"flex items-baseline justify-between gap-2",children:[(0,t.jsxs)("span",{className:"text-3xl font-bold",children:[H,"%"]}),(0,t.jsxs)("span",{className:"flex items-center gap-2 text-xs text-muted-foreground",children:[E&&(0,t.jsx)(o.f,{className:"h-3 w-3 animate-spin"}),(0,t.jsx)(m.f,{variant:"outline",children:"ai"===_.masterySource?b.mastery.aiEvaluated:b.mastery.estimated})]})]}),(0,t.jsx)("div",{className:"h-2 w-full rounded-full bg-muted overflow-hidden",children:(0,t.jsx)("div",{className:`h-full ${U} transition-all`,style:{width:`${H}%`}})}),_.masteryReason&&(0,t.jsx)("p",{className:"text-sm text-muted-foreground",children:_.masteryReason}),(0,t.jsx)("p",{className:"text-xs text-muted-foreground",children:b.mastery.thresholdHint.replace("{threshold}",String(_.masteryThreshold))})]}),(0,t.jsxs)("div",{className:"space-y-2 border-t pt-4",children:[(0,t.jsxs)("div",{className:"flex items-center justify-between gap-2",children:[(0,t.jsx)("h4",{className:"text-sm font-semibold",children:b.mastery.history}),!R&&(0,t.jsxs)(x.f,{variant:"outline",size:"sm",onClick:()=>T(!0),children:[(0,t.jsx)(c.f,{className:"mr-1 h-4 w-4"}),b.mastery.addRecord]})]}),R&&(0,t.jsx)(v,{errorItemId:e,onCancel:()=>T(!1),onSaved:()=>{T(!1),F()}}),0===_.records.length?(0,t.jsx)("p",{className:"text-sm text-muted-foreground italic",children:b.mastery.noHistory}):(0,t.jsx)("ul",{className:"divide-y rounded-md border",children:_.records.map(e=>(0,t.jsxs)("li",{className:"p-3 text-sm space-y-2",children:[(0,t.jsxs)("div",{className:"flex items-start gap-2",children:[(0,t.jsxs)("button",{type:"button",className:"flex min-w-0 flex-1 flex-wrap items-center gap-2 text-left",onClick:()=>q(C===e.id?null:e.id),children:[(0,t.jsx)("span",{className:"text-muted-foreground tabular-nums",children:(0,l.r)(e.createdAt,"yyyy-MM-dd HH:mm",p)}),(0,t.jsx)(m.f,{variant:"outline",className:k[e.result]||"",children:b.mastery.results[e.result]||e.result}),e.difficulty&&(0,t.jsx)(m.f,{variant:"secondary",children:X[e.difficulty]||e.difficulty}),(0,t.jsx)("span",{className:"text-xs text-muted-foreground",children:e.exam?`${b.mastery.sources.exam} \xb7 ${e.exam.title}`:b.mastery.sources[e.source]||b.mastery.sources.practice}),e.questionText&&(0,t.jsx)("span",{className:"ml-auto text-muted-foreground",children:C===e.id?(0,t.jsx)(n.f,{className:"h-4 w-4"}):(0,t.jsx)(i.f,{className:"h-4 w-4"})})]}),(0,t.jsx)("button",{type:"button","aria-label":b.mastery.deleteRecord,title:b.mastery.deleteRecord,className:"shrink-0 rounded p-1 text-muted-foreground hover:bg-red-50 dark:hover:bg-red-950/40 hover:text-red-600 dark:hover:text-red-400",onClick:()=>M(e.id),children:(0,t.jsx)(u.f,{className:"h-4 w-4"})})]}),C===e.id&&e.questionText&&(0,t.jsxs)("div",{className:"space-y-2 rounded-md bg-muted/40 p-3",children:[(0,t.jsx)(g.f,{content:e.questionText}),(0,t.jsx)(N.f,{svg:e.figureSvg}),e.wrongAnswerText&&(0,t.jsxs)("div",{className:"border-t pt-2",children:[(0,t.jsx)("p",{className:"mb-1 font-medium",children:b.editor.wrongAnswerText}),(0,t.jsx)(g.f,{content:e.wrongAnswerText})]}),e.mistakeAnalysis&&(0,t.jsxs)("div",{className:"border-t pt-2",children:[(0,t.jsx)("p",{className:"mb-1 font-medium",children:b.editor.mistakeAnalysis}),(0,t.jsx)(g.f,{content:e.mistakeAnalysis})]}),e.originalImageUrl&&(0,t.jsx)("img",{src:e.originalImageUrl,alt:b.editor.wrongAnswerText,className:"max-h-96 max-w-full rounded object-contain"}),e.answerText&&(0,t.jsx)("div",{className:"border-t pt-2",children:(0,t.jsx)(g.f,{content:e.answerText,className:"font-semibold"})}),e.exam&&(0,t.jsx)(s.default,{href:`/exams/${e.exam.paperId}`,className:"text-xs text-primary hover:underline",children:e.exam.title})]})]},e.id))})]})]})]})},"x",0,k],991686);var _=e.i(534693);e.s(["f",()=>_.f],931454)},393733,e=>{var t=e.i(843476),a=e.i(548161),s=e.i(576248),r=e.i(583967),l=e.i(111110);let i=[{value:"correct",icon:a.f,active:"border-green-600 bg-green-50 dark:bg-green-950/40 text-green-700 dark:text-green-300"},{value:"wrong",icon:r.f,active:"border-red-600 bg-red-50 dark:bg-red-950/40 text-red-700 dark:text-red-300"},{value:"not_attempted",icon:s.f,active:"border-amber-600 bg-amber-50 dark:bg-amber-950/40 text-amber-700 dark:text-amber-300"}];e.s(["f",0,function({value:e,onChange:a,disabled:s,size:r="md"}){let{t:n}=(0,l.b)(),o="sm"===r?"px-2 py-1 text-xs":"px-3 py-2 text-sm";return(0,t.jsx)("div",{className:"grid grid-cols-3 gap-2",role:"radiogroup",children:i.map(({value:l,icon:i,active:c})=>(0,t.jsxs)("button",{type:"button",role:"radio","aria-checked":e===l,disabled:s,onClick:()=>a(l),className:`flex items-center justify-center gap-1 rounded-md border font-medium transition-colors disabled:opacity-60 ${o} ${e===l?c:"border-input hover:bg-muted"}`,children:[(0,t.jsx)(i,{className:"sm"===r?"h-3 w-3":"h-4 w-4"}),n.mastery.results[l]]},l))})}])},149704,e=>{var t=e.i(843476),a=e.i(111110),s=e.i(398019),r=e.i(184110),l=e.i(975157);let i={left:"mr-auto",center:"mx-auto",right:"ml-auto"};e.s(["f",0,function({svg:e,scale:n,align:o,className:c}){let{t:d}=(0,a.b)();if(!e)return null;let u=(0,r.V)(n),m=(0,r.o)(o);return(0,t.jsx)("figure",{className:(0,l.f)("question-figure my-3",c),children:(0,t.jsx)("img",{src:(0,s.d)(e),alt:d.figure.alt,className:(0,l.f)(i[m],"block h-auto max-w-full rounded border bg-white p-2"),style:{..."left"===m?{marginLeft:0,marginRight:"auto"}:"right"===m?{marginLeft:"auto",marginRight:0}:{},maxHeight:360,zoom:u/100,maxWidth:`${Math.min(u,100)}%`}})})}])},590546,e=>{var t=e.i(843476),a=e.i(618566),s=e.i(519455),r=e.i(711241);e.s(["f",0,function({fallbackUrl:e,className:l}){let i=(0,a.useRouter)();return(0,t.jsx)(s.f,{variant:"ghost",size:"icon",onClick:()=>{i.push(e)},className:l,children:(0,t.jsx)(r.f,{className:"h-5 w-5"})})}])},86963,e=>{var t=e.i(843476),a=e.i(632781);e.s(["f",0,function({label:e}){return(0,t.jsxs)("div",{className:"flex min-h-[50vh] flex-col items-center justify-center gap-3 text-muted-foreground",children:[(0,t.jsx)(a.f,{className:"h-7 w-7 animate-spin text-primary"}),e&&(0,t.jsx)("p",{className:"text-sm",children:e})]})}])},184110,e=>{let t=["left","center","right"],a="center";function s(e){return"number"==typeof e&&Number.isInteger(e)&&e>=10&&e<=200}e.s(["E",0,a,"n",0,100,"j",0,t,"a",0,200,"_",0,10,"x",0,s,"o",0,function(e){return"string"==typeof e&&t.includes(e)?e:a},"V",0,function(e){return s(e)?e:100}])},398019,e=>{e.s(["K",0,1e5,"d",0,function(e){return`data:image/svg+xml;charset=utf-8,${encodeURIComponent(e)}`}])},35209,e=>{var t=e.i(271645),a=e.i(111110);e.s(["f",0,function(...e){let{t:s}=(0,a.b)(),r=[s.pageTitle.base,...e.map(e=>"string"==typeof e?e.trim():"").filter(e=>e.length>0)].join("-");(0,t.useEffect)(()=>{document.title=r},[r])}])},401280,e=>{let t={single_choice:"single_choice",singlechoice:"single_choice","single choice":"single_choice","single-choice":"single_choice",multiple_choice:"multiple_choice",multiplechoice:"multiple_choice","multiple choice":"multiple_choice","multiple-choice":"multiple_choice",multichoice:"multiple_choice","multi choice":"multiple_choice",true_false:"true_false",truefalse:"true_false","true/false":"true_false","true false":"true_false","true-false":"true_false","true / false":"true_false",fill_blank:"fill_blank",fillblank:"fill_blank","fill in the blank":"fill_blank","fill-in-the-blank":"fill_blank",fillintheblank:"fill_blank",calculation:"calculation",solution:"solution",reading:"reading",cloze:"cloze",writing:"writing",other:"other",选择题:"single_choice",单项选择:"single_choice",单选:"single_choice",单选题:"single_choice",不定项:"multiple_choice",不定项选择:"multiple_choice",多项选择:"multiple_choice",多选:"multiple_choice",多选题:"multiple_choice",判断:"true_false",判断题:"true_false",是非:"true_false",是非题:"true_false",填空:"fill_blank",填空题:"fill_blank",口算:"calculation",计算:"calculation",计算题:"calculation",解答:"solution",解答题:"solution",应用:"solution",应用题:"solution",证明:"solution",证明题:"solution",简答:"solution",简答题:"solution",阅读:"reading",阅读理解:"reading",完形:"cloze",完形填空:"cloze",作文:"writing",写作:"writing",书面表达:"writing",其他:"other"};e.s(["O",0,"__none__","V",0,["single_choice","multiple_choice","true_false","fill_blank","calculation","solution","reading","cloze","writing","other"],"u",0,{single_choice:"Single Choice",multiple_choice:"Multiple Choice",true_false:"True / False",fill_blank:"Fill in the Blank",calculation:"Calculation",solution:"Solution",reading:"Reading Comprehension",cloze:"Cloze",writing:"Writing",other:"Other"},"H",0,{single_choice:"单选题",multiple_choice:"多选题",true_false:"判断题",fill_blank:"填空题",calculation:"计算题",solution:"解答题",reading:"阅读理解",cloze:"完形填空",writing:"写作",other:"其他"},"P",0,function(e){if("string"!=typeof e)return null;let a=e.trim().toLowerCase();return a?t[a]??null:null}])}])})();
|
|
1
|
+
(()=>{"use strict";(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,711241,e=>{var t=e.i(456420);let a={name:"arrow-left",size:24,node:[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]]};a.node;let s=(0,t.f)(a);e.s(["f",0,s],711241)},576248,e=>{var t=e.i(456420);let a={name:"circle-question-mark",size:24,node:[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M9.09 9a3 3 0 0 1 5.83 1c0 2-3 3-3 3",key:"1u773s"}],["path",{d:"M12 17h.01",key:"p32p05"}]],aliases:["help-circle","circle-help"]};a.node;let s=(0,t.f)(a);e.s(["f",0,s],576248)},77043,e=>{var t=e.i(456420);let a={name:"printer",size:24,node:[["path",{d:"M6 18H4a2 2 0 0 1-2-2v-5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2v5a2 2 0 0 1-2 2h-2",key:"143wyd"}],["path",{d:"M6 9V3a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v6",key:"1itne7"}],["rect",{x:"6",y:"14",width:"12",height:"8",rx:"1",key:"1ue0tg"}]]};a.node;let s=(0,t.f)(a);e.s(["f",0,s],77043)},856522,e=>{var t=e.i(456420);let a={name:"save",size:24,node:[["path",{d:"M15.2 3a2 2 0 0 1 1.4.6l3.8 3.8a2 2 0 0 1 .6 1.4V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2z",key:"1c8476"}],["path",{d:"M17 21v-7a1 1 0 0 0-1-1H8a1 1 0 0 0-1 1v7",key:"1ydtos"}],["path",{d:"M7 3v4a1 1 0 0 0 1 1h7",key:"t51u73"}]]};a.node;let s=(0,t.f)(a);e.s(["f",0,s],856522)},591124,e=>{var t=e.i(843476),a=e.i(271645),s=e.i(522016),r=e.i(618566),l=e.i(215519),i=e.i(306831),n=e.i(456420);let o={name:"clipboard-check",size:24,node:[["rect",{width:"8",height:"4",x:"8",y:"2",rx:"1",ry:"1",key:"tgr4d6"}],["path",{d:"M16 4h2a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V6a2 2 0 0 1 2-2h2",key:"116196"}],["path",{d:"m9 14 2 2 4-4",key:"df797q"}]]};o.node;let c=(0,n.f)(o);var d=e.i(632781),u=e.i(77043),m=e.i(395925),x=e.i(856522),f=e.i(759659),g=e.i(487486),h=e.i(519455),p=e.i(793479),b=e.i(590546),y=e.i(86963),j=e.i(339023),v=e.i(663661),N=e.i(257428),w=e.i(716327),k=e.i(456539),S=e.i(263676),_=e.i(515288),I=e.i(511445),C=e.i(991686),q=e.i(393733),A=e.i(149704),$=e.i(520732),R=e.i(741120),T=e.i(931454),z=e.i(111110),F=e.i(41931),M=e.i(132411),D=e.i(201276),E=e.i(294114);function V({paperId:e,paperMode:s,question:r,onDone:l}){let{t:i,language:n}=(0,z.b)(),[o,c]=(0,a.useState)(null),u=`exam-question:${r.id}:regenerate`,{running:m,refresh:x}=(0,M.f)(u),f=(0,a.useRef)(!1);(0,a.useEffect)(()=>{if(m){f.current=!0;return}f.current&&(f.current=!1,l({}))},[m,l]);let g="original"!==s&&0===r.attempts.length&&!!r.errorItemId&&"pending"!==r.status,p="ready"===r.status&&!!r.questionText?.trim();if(!g&&!p)return null;let b=async t=>{let a="question"===t?i.exam.regenerateQuestionConfirm:i.exam.regenerateAnswerConfirm;if(await (0,E.u)(a)){c(t);try{let a=await F.k.post(`/api/exams/${e}/questions/${r.id}/regenerate`,{mode:t,language:n},{timeout:6e5,recoverable:!0});l(a)}catch(e){if(e instanceof F.a&&409===e.status&&e.data?.code==="TASK_ALREADY_RUNNING")E.c.info(i.errors.TASK_ALREADY_RUNNING),await x();else{let a=e?.data?.message||"",s=i.errors[a];D.V.error("[ExamRegenerate]","Failed to regenerate exam question",{mode:t,code:a}),E.c.error("HAS_RESULTS"===a?i.exam.regenerateHasResults:"string"==typeof s?s:i.exam.regenerateFailed)}}finally{c(null)}}},y=null!==o||!!m;return(0,t.jsxs)("div",{className:"flex flex-wrap gap-1",children:[g&&(0,t.jsxs)(h.f,{variant:"ghost",size:"sm",onClick:()=>b("question"),disabled:y,children:[y?(0,t.jsx)(d.f,{className:"mr-1 h-4 w-4 animate-spin"}):(0,t.jsx)(R.f,{className:"mr-1 h-4 w-4"}),y?i.exam.regenerating:i.exam.regenerateQuestion]}),p&&(0,t.jsxs)(h.f,{variant:"ghost",size:"sm",onClick:()=>b("answer"),disabled:y,children:[y?(0,t.jsx)(d.f,{className:"mr-1 h-4 w-4 animate-spin"}):(0,t.jsx)(T.f,{className:"mr-1 h-4 w-4"}),y?i.exam.regenerating:i.exam.regenerateAnswer]})]})}var H=e.i(763896);function U({questionId:e,score:s,disabled:r,onSave:l}){let{t:i}=(0,z.b)(),[n,o]=(0,a.useState)(null),[c,d]=(0,a.useState)(!1),u=n??(null!==s?String(s):""),m=u.trim(),x=""===m?null:(0,H.H)(Number(m)),f=""===m||null!==x,g=x!==s,h=async()=>{if(!f||!g||c){if(null!==n&&!f)return;o(null);return}d(!0);try{await l(e,x),o(null)}catch(e){D.V.error("[ExamQuestionScore]","保存单题分值失败",{error:e}),E.c.error(i.exam.saveQuestionScoreFailed)}finally{d(!1)}};return(0,t.jsxs)("span",{className:"inline-flex items-center gap-1.5",children:[(0,t.jsx)("label",{className:"text-xs text-muted-foreground",htmlFor:`exam-score-${e}`,children:i.exam.questionScore}),(0,t.jsx)(p.f,{id:`exam-score-${e}`,type:"number",min:.1,max:H.D,step:.1,value:u,disabled:c||r,"aria-invalid":!f,placeholder:i.exam.questionScorePlaceholder,title:i.exam.questionScoreHint,onChange:e=>o(e.target.value),onBlur:()=>void h(),onKeyDown:e=>{"Enter"===e.key&&(e.preventDefault(),h())},className:"h-7 w-20 text-sm"})]})}function X({paperId:e,paperMode:r,question:n,displayNumber:o,editingResult:c,onResultChange:u,onDeleteAttempt:m,onRegenerated:x,previewFigureScale:f,previewFigureAlign:h,onSaveFigureScale:p,onSaveScore:b}){let{t:y}=(0,z.b)(),{timeZone:j}=(0,l.M)(),[v,N]=(0,a.useState)(!1),R=void 0!==c,T=(()=>{if(!n.error)return"";if("SOURCE_DELETED"===n.error)return y.exam.sourceDeleted;let e=n.error.split(":")[0].trim(),t=y.errors[e];return"string"==typeof t?t:n.error})();return(0,t.jsx)(_.N,{children:(0,t.jsxs)(_.O,{className:"space-y-3 pt-4",children:[(0,t.jsxs)("div",{className:"flex flex-wrap items-center gap-2 text-sm",children:[(0,t.jsxs)("span",{className:"font-semibold",children:[o??n.order,"."]}),n.errorItemId?(0,t.jsxs)(s.default,{href:`/error-items/${n.errorItemId}`,className:"font-mono text-xs text-primary hover:underline",children:[y.exam.source," ",n.sourceShortId]}):(0,t.jsxs)("span",{className:"font-mono text-xs text-muted-foreground",children:[n.sourceShortId," · ",y.exam.sourceDeleted]}),n.notebookName&&(0,t.jsx)(g.f,{variant:"secondary",children:n.notebookName}),b&&(0,t.jsx)("span",{className:"ml-auto",children:(0,t.jsx)(U,{questionId:n.id,score:n.score??null,disabled:R,onSave:b})})]}),n.attempts.length>0&&(0,t.jsx)("div",{className:"flex flex-wrap items-center gap-2 text-xs",children:n.attempts.map((e,a)=>(0,t.jsxs)(g.f,{variant:"outline",className:`gap-1 font-normal ${C.x[e.result]||""}`,children:[(0,t.jsx)("span",{children:y.exam.attemptLabel.replace("{n}",String(a+1))}),(0,t.jsx)("span",{className:"tabular-nums",children:(0,i.r)(e.createdAt,"MM-dd",j)}),(0,t.jsx)("span",{className:"font-semibold",children:y.mastery.results[e.result]}),R&&m&&(0,t.jsx)("button",{type:"button","aria-label":y.mastery.deleteRecord,className:"-mr-1 rounded hover:bg-black/10",onClick:()=>m(e.id),children:(0,t.jsx)(S.X,{className:"h-3 w-3"})})]},e.id))}),"pending"===n.status&&(0,t.jsxs)("p",{className:"flex items-center gap-2 text-sm text-muted-foreground",children:[(0,t.jsx)(d.f,{className:"h-4 w-4 animate-spin"}),y.exam.questionPending]}),"failed"===n.status&&(0,t.jsxs)("p",{className:"text-sm text-destructive",children:[y.exam.questionFailed,T?`${y.common.colon}${T}`:""]}),"ready"===n.status&&n.questionText&&(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(I.f,{content:n.questionText}),p?(0,t.jsx)($.f,{svg:n.figureSvg,scale:n.figureScale,align:n.figureAlign,previewScaleOverride:f,previewAlignOverride:h,onSave:(e,t)=>p(n.id,e,t)},`${n.id}-${n.figureScale??100}-${n.figureAlign??"center"}`):(0,t.jsx)(A.f,{svg:n.figureSvg,scale:f??n.figureScale,align:h??n.figureAlign}),(0,t.jsxs)("button",{type:"button",className:"flex items-center gap-1 text-xs text-muted-foreground hover:text-foreground",onClick:()=>N(!v),children:[v?(0,t.jsx)(k.f,{className:"h-3 w-3"}):(0,t.jsx)(w.f,{className:"h-3 w-3"}),y.exam.showAnswer]}),v&&(0,t.jsxs)("div",{className:"space-y-2 rounded-md bg-muted/40 p-3",children:[n.answerText&&(0,t.jsx)(I.f,{content:n.answerText,className:"font-semibold"}),n.analysis&&(0,t.jsx)(I.f,{content:n.analysis})]})]}),!R&&x&&(0,t.jsx)(V,{paperId:e,paperMode:r,question:n,onDone:x}),R&&"ready"===n.status&&n.errorItemId&&u&&(0,t.jsx)(q.f,{value:c,onChange:u,size:"sm"})]})})}function P({scores:e,disabled:s,onSave:r}){let{t:l}=(0,z.b)(),i=e.filter(e=>"number"==typeof e),n=i.length===e.length&&new Set(i).size<=1,o=n?i[0]??null:null,[c,d]=(0,a.useState)(null),[u,m]=(0,a.useState)(!1);if(0===e.length)return null;let x=c??(null!==o?String(o):""),f=""===x.trim()?null:(0,H.H)(Number(x)),g=""===x.trim()||null!==f,b=null!==c&&(f??null)!==o,y=async e=>{if(e.preventDefault(),g&&b&&!u){m(!0);try{await r(f),d(null),E.c.success(l.common.messages.saveSuccess)}catch(e){D.V.error("[ExamScoreBar]","统一保存试卷分值失败",{error:e}),E.c.error(l.exam.saveQuestionScoreFailed)}finally{m(!1)}}};return(0,t.jsxs)("form",{onSubmit:y,className:"flex flex-wrap items-center gap-2 rounded-md border bg-background p-3 text-sm",children:[(0,t.jsx)("span",{className:"font-medium",children:l.exam.uniformScore}),(0,t.jsx)(p.f,{type:"number",min:.1,max:H.D,step:.1,value:x,disabled:u||s,"aria-invalid":!g,"aria-label":l.exam.uniformScore,placeholder:l.exam.questionScorePlaceholder,onChange:e=>d(e.target.value),className:"h-8 w-24"}),(0,t.jsx)(h.f,{type:"submit",size:"sm",disabled:u||s||!b||!g,children:u?l.common.progress.saving:l.common.save}),null!==o&&!n&&(0,t.jsx)("span",{className:"text-xs text-muted-foreground",children:l.exam.totalScoreUnscored.replace("{count}",String(e.length-i.length))}),(0,t.jsx)("p",{className:"w-full text-xs text-muted-foreground",children:l.exam.uniformScoreHint}),!g&&(0,t.jsx)("p",{className:"w-full text-xs text-destructive",children:l.exam.questionScoreInvalid})]})}var B=e.i(336653);function L({section:e}){let{t:a}=(0,z.b)(),s=null!==e.scoreTotal?a.exam.sectionSummaryScored.replace("{count}",String(e.count)).replace("{total}",String(e.scoreTotal)):a.exam.sectionSummary.replace("{count}",String(e.count));return(0,t.jsxs)("div",{className:"flex flex-wrap items-baseline gap-x-3 gap-y-1 border-b pb-2 pt-4",children:[(0,t.jsx)("h2",{className:"text-base font-bold",children:e.title}),(0,t.jsxs)("span",{className:"text-sm text-muted-foreground",children:[s,null!==e.scoreTotal&&e.unscored>0&&(0,t.jsxs)("span",{children:["(",a.exam.sectionSummaryUnscored.replace("{count}",String(e.unscored)),")"]})]})]})}function K({paperId:e,paperMode:a,sections:s,draft:r,onResultChange:l,onDeleteAttempt:i,onRegenerated:n,uniformPreview:o,onSaveFigureScale:c,onSaveScore:d}){let u=s=>(0,t.jsx)(X,{paperId:e,paperMode:a,question:s.question,displayNumber:s.displayNumber,editingResult:r?r[s.question.id]??null:void 0,onResultChange:e=>l(s.question.id,e),onDeleteAttempt:i,onRegenerated:n,previewFigureScale:o.scale,previewFigureAlign:o.align,onSaveFigureScale:c,onSaveScore:d},s.question.id);return(0,t.jsx)("div",{className:"space-y-3",children:s.map(e=>(0,t.jsxs)("section",{className:"space-y-3",children:[(0,t.jsx)(L,{section:e}),e.items.map(u)]},e.title))})}function O({paperId:e,paperMode:a,groupByType:s,questions:r,draft:l,onResultChange:i,onDeleteAttempt:n,onRegenerated:o,uniformPreview:c,onSaveFigureScale:d,onSaveScore:u,onSaveUniformScore:m,onSaveGroupByType:x}){let{t:f,language:g}=(0,z.b)(),h=s?(0,B.f)(r,g):null;return(0,t.jsxs)("div",{className:"space-y-3",children:[(0,t.jsxs)("div",{className:"flex flex-wrap items-center gap-x-6 gap-y-2",children:[(0,t.jsx)(P,{scores:r.map(e=>e.score??null),disabled:!!l,onSave:m}),(0,t.jsxs)("label",{className:"flex items-center gap-2 text-sm",title:f.exam.groupByTypeHint,children:[(0,t.jsx)(N.f,{checked:s,disabled:!!l,onCheckedChange:e=>void x(!0===e)}),f.exam.groupByType]})]}),h?(0,t.jsx)(K,{paperId:e,paperMode:a,sections:h,draft:l,onResultChange:i,onDeleteAttempt:n,onRegenerated:o,uniformPreview:c,onSaveFigureScale:d,onSaveScore:u}):r.map(s=>(0,t.jsx)(X,{paperId:e,paperMode:a,question:s,editingResult:l?l[s.id]??null:void 0,onResultChange:e=>i(s.id,e),onDeleteAttempt:n,onRegenerated:o,previewFigureScale:c.scale,previewFigureAlign:c.align,onSaveFigureScale:d,onSaveScore:u},s.id))]})}var Q=e.i(35209);e.s(["default",0,function(){let{timeZone:e}=(0,l.M)(),n=(0,r.useParams)(),o=(0,r.useRouter)(),{t:N,language:w}=(0,z.b)(),k=n.id,[S,_]=(0,a.useState)(null);(0,Q.f)(N.exam.title,S?.title);let[I,C]=(0,a.useState)(!1),[q,A]=(0,a.useState)(null),[$,R]=(0,a.useState)((0,i.r)(new Date,"yyyy-MM-dd",e)),[T,D]=(0,a.useState)(!1),[V,U]=(0,a.useState)(null),[X,P]=(0,a.useState)({scale:null,align:null}),B=`exam-paper:${k}:generate`,{running:L,refresh:K}=(0,M.f)(B),G=(0,a.useCallback)(async()=>{try{_(await F.k.get(`/api/exams/${k}`))}catch{C(!0)}},[k]);if((0,a.useEffect)(()=>{G()},[G]),(0,a.useEffect)(()=>{if(S?.status!=="generating")return;let e=setTimeout(G,3e3);return()=>clearTimeout(e)},[S,G]),I)return(0,t.jsx)("div",{className:"p-8 text-center",children:N.exam.notFound});if(!S)return(0,t.jsx)(y.f,{label:N.common.loading});let Y=S.questions.filter(e=>"ready"===e.status).length,W=S.questions.some(e=>e.attempts.length>0),J=S.questions.some(e=>"failed"===e.status),Z=S.questions.filter(e=>"ready"===e.status&&e.errorItemId),ee=S.questions.filter(e=>"ready"===e.status&&!!e.figureSvg),et=q?Z.filter(e=>q[e.id]).length:0,ea=async()=>{if(q&&0!==et){D(!0),U(null);try{await F.k.post(`/api/exams/${S.id}/results`,{takenAt:(0,i.$)($,e),results:Z.filter(e=>q[e.id]).map(e=>({questionId:e.id,result:q[e.id]}))}),A(null),U(N.exam.resultsSaved),await G()}catch{U(N.exam.resultsSaveFailed)}finally{D(!1)}}},es=async e=>{if(await (0,E.u)(N.mastery.deleteRecordConfirm,{destructive:!0}))try{await F.k.delete(`/api/practice/record/${e}`),await G()}catch{U(N.mastery.deleteRecordFailed)}},er=async()=>{try{await F.k.post(`/api/exams/${S.id}/retry`,{language:w})}catch(e){if(e instanceof F.a&&409===e.status&&e.data?.code==="TASK_ALREADY_RUNNING")E.c.info(N.errors.TASK_ALREADY_RUNNING),await K();else throw e}await G()},el=async()=>{await (0,E.u)(N.exam.deleteConfirm,{destructive:!0})&&(await F.k.delete(`/api/exams/${S.id}`),o.push("/exams"))},ei=async(e,t,a)=>{await F.k.patch(`/api/exams/${S.id}`,{questionId:e,figureScale:t,figureAlign:a}),_(s=>s?{...s,questions:s.questions.map(s=>s.id===e?{...s,figureScale:t,figureAlign:a}:s)}:s)},en=async e=>{await F.k.patch(`/api/exams/${S.id}`,e),_(t=>t?{...t,questions:t.questions.map(t=>({...t,...e}))}:t)},eo=async(e,t)=>{await F.k.patch(`/api/exams/${S.id}`,{questionId:e,score:t}),_(a=>a?{...a,questions:a.questions.map(a=>a.id===e?{...a,score:t}:a)}:a)},ec=async e=>{await F.k.patch(`/api/exams/${S.id}`,{score:e}),_(t=>t?{...t,questions:t.questions.map(t=>({...t,score:e}))}:t)},ed=async e=>{await F.k.patch(`/api/exams/${S.id}`,{groupByType:e}),_(t=>t?{...t,groupByType:e}:t)},eu=(0,H.n)(S.questions.filter(e=>"ready"===e.status).map(e=>e.score??null));return(0,t.jsx)("main",{className:"mx-auto min-h-screen max-w-6xl px-4 py-6 md:px-8 md:py-8",children:(0,t.jsxs)("div",{className:"space-y-6 pb-24",children:[(0,t.jsxs)("div",{className:"flex items-start gap-3",children:[(0,t.jsx)(b.f,{fallbackUrl:"/exams",className:"-ml-2 shrink-0"}),(0,t.jsxs)("div",{className:"flex-1 min-w-0 space-y-2",children:[(0,t.jsx)("h1",{className:"text-xl sm:text-2xl font-bold tracking-tight break-words",children:S.title}),(0,t.jsxs)("div",{className:"flex flex-wrap items-center gap-2 text-sm text-muted-foreground",children:[(0,t.jsx)(v.f,{status:S.status,recorded:W}),"original"===S.mode&&(0,t.jsx)(g.f,{variant:"secondary",children:N.exam.modes.original}),(0,t.jsx)("span",{children:N.exam.progress.replace("{ready}",String(Y)).replace("{total}",String(S.questions.length))}),null!==eu.total&&(0,t.jsxs)("span",{children:[N.exam.totalScore.replace("{total}",(0,H.s)(eu.total)),eu.unscored>0&&(0,t.jsxs)("span",{className:"text-xs",children:["(",N.exam.totalScoreUnscored.replace("{count}",String(eu.unscored)),")"]})]}),(0,t.jsx)("span",{children:(0,i.r)(S.createdAt,"yyyy-MM-dd HH:mm",e)})]})]})]}),(0,t.jsxs)("div",{className:"flex flex-wrap gap-2",children:[(0,t.jsx)(s.default,{href:`/exams/${S.id}/print`,children:(0,t.jsxs)(h.f,{variant:"outline",size:"sm",disabled:0===Y,children:[(0,t.jsx)(u.f,{className:"mr-2 h-4 w-4"}),N.exam.print]})}),!q&&Z.length>0&&(0,t.jsxs)(h.f,{size:"sm",onClick:()=>{U(null),A({}),R((0,i.r)(new Date,"yyyy-MM-dd",e))},children:[(0,t.jsx)(c,{className:"mr-2 h-4 w-4"}),N.exam.recordResults]}),J&&"generating"!==S.status&&(0,t.jsxs)(h.f,{variant:"outline",size:"sm",onClick:er,disabled:!!L,children:[L?(0,t.jsx)(d.f,{className:"mr-2 h-4 w-4 animate-spin"}):(0,t.jsx)(m.f,{className:"mr-2 h-4 w-4"}),L?N.exam.questionPending:N.exam.retryFailed]}),(0,t.jsxs)(h.f,{variant:"ghost",size:"sm",onClick:el,className:"text-red-600 dark:text-red-400 hover:text-red-700 dark:hover:text-red-300 hover:bg-red-50 dark:hover:bg-red-950/40 sm:ml-auto",children:[(0,t.jsx)(f.f,{className:"mr-2 h-4 w-4"}),N.exam.delete]})]}),S.questions.length<S.requestedCount&&(0,t.jsx)("p",{className:"rounded-md border border-amber-200 dark:border-amber-900 bg-amber-50 dark:bg-amber-950/40 p-3 text-sm text-amber-800 dark:text-amber-200",children:N.exam.fewerThanRequested.replaceAll("{actual}",String(S.questions.length))}),V&&(0,t.jsx)("p",{className:"rounded-md border p-3 text-sm",children:V}),q&&(0,t.jsxs)("div",{className:"space-y-2 rounded-md border bg-muted/30 p-3",children:[(0,t.jsxs)("div",{className:"flex flex-col sm:flex-row sm:items-center gap-2",children:[(0,t.jsx)("label",{htmlFor:"exam-taken-at",className:"text-sm font-medium",children:N.exam.takenAt}),(0,t.jsx)(p.f,{id:"exam-taken-at",type:"date",value:$,onChange:e=>R(e.target.value),className:"sm:w-48"})]}),(0,t.jsx)("p",{className:"text-xs text-muted-foreground",children:N.exam.recordHint})]}),ee.length>0&&(0,t.jsx)(j.f,{scales:ee.map(e=>e.figureScale),aligns:ee.map(e=>e.figureAlign),onPreviewChange:P,onSave:en}),(0,t.jsx)(O,{paperId:S.id,paperMode:S.mode,groupByType:S.groupByType,questions:S.questions,draft:q,onResultChange:(e,t)=>A(a=>a?{...a,[e]:t}:a),onDeleteAttempt:es,onRegenerated:G,uniformPreview:X,onSaveFigureScale:ei,onSaveScore:eo,onSaveUniformScore:ec,onSaveGroupByType:ed}),q&&(0,t.jsx)("div",{className:"fixed inset-x-0 bottom-16 z-30 border-t bg-background/95 p-3 backdrop-blur md:bottom-0",children:(0,t.jsxs)("div",{className:"max-w-4xl mx-auto flex items-center justify-end gap-2",children:[0===et&&(0,t.jsx)("span",{className:"mr-auto text-xs text-muted-foreground",children:N.exam.noResultSelected}),(0,t.jsx)(h.f,{variant:"outline",onClick:()=>A(null),disabled:T,children:N.exam.cancel}),(0,t.jsxs)(h.f,{onClick:ea,disabled:T||!$||0===et,children:[T?(0,t.jsx)(d.f,{className:"mr-2 h-4 w-4 animate-spin"}):(0,t.jsx)(x.f,{className:"mr-2 h-4 w-4"}),N.exam.saveResults]})]})})]})})}],591124)},520732,e=>{var t=e.i(843476),a=e.i(271645),s=e.i(149704),r=e.i(519455),l=e.i(793479),i=e.i(111110),n=e.i(294114),o=e.i(184110),c=e.i(201276);e.s(["f",0,function({svg:e,scale:d,align:u,previewScaleOverride:m,previewAlignOverride:x,onSave:f}){let{t:g}=(0,i.b)(),h=(0,a.useId)(),p=(0,o.V)(d),b=(0,o.o)(u),[y,j]=(0,a.useState)(null),[v,N]=(0,a.useState)(null),[w,k]=(0,a.useState)(!1),S=y??String(p),_=""!==S.trim()&&(0,o.x)(Number(S)),I=_?Number(S):p,C=v??b,q=m??I,A=x??C,$=null!==y&&(!_||Number(S)!==p)||null!==v&&v!==b;if(!e)return null;let R=async e=>{if(e.preventDefault(),_&&$&&!w){k(!0);try{await f(I,C),j(null),N(null),n.c.success(g.common.messages.saveSuccess)}catch(e){c.V.error("[FigureScale]","保存配图比例失败",{error:e}),n.c.error(g.common.messages.saveFailed)}finally{k(!1)}}};return(0,t.jsxs)("div",{children:[(0,t.jsx)(s.f,{svg:e,scale:q,align:A}),(0,t.jsxs)("form",{onSubmit:R,className:"figure-scale-editor-controls space-y-2 rounded-md border p-3 print:hidden",children:[(0,t.jsxs)("div",{className:"flex flex-wrap items-center gap-2 text-sm",children:[(0,t.jsx)("label",{htmlFor:h,children:g.figure.scale}),(0,t.jsx)(l.f,{id:h,type:"number",min:o._,max:o.a,step:1,value:S,disabled:w,"aria-describedby":`${h}-hint`,"aria-invalid":!_,onChange:e=>j(e.target.value),className:"h-8 w-20"}),(0,t.jsx)("span",{children:"%"}),(0,t.jsx)(r.f,{type:"button",variant:"outline",size:"sm",disabled:w||_&&I===o.n,onClick:()=>j(String(o.n)),children:g.figure.resetScale}),(0,t.jsxs)("div",{role:"group","aria-label":g.figure.align,className:"inline-flex items-center gap-1",children:[(0,t.jsx)("span",{className:"text-muted-foreground",children:g.figure.align}),o.j.map(e=>(0,t.jsx)(r.f,{type:"button",variant:C===e?"default":"outline",size:"sm",disabled:w,"aria-pressed":C===e,onClick:()=>N(e===b?null:e),children:g.figure.aligns[e]},e))]}),(0,t.jsx)(r.f,{type:"submit",size:"sm",disabled:w||!$||!_,children:w?g.common.progress.saving:g.common.save}),$&&(0,t.jsx)(r.f,{type:"button",variant:"ghost",size:"sm",disabled:w,onClick:()=>{j(null),N(null)},children:g.common.cancel})]}),(0,t.jsx)("input",{type:"range",min:o._,max:o.a,step:1,value:I,disabled:w,"aria-label":g.figure.scaleSlider,"aria-describedby":`${h}-hint`,onChange:e=>j(e.target.value),className:"block h-6 w-full max-w-sm accent-primary"}),(0,t.jsx)("p",{id:`${h}-hint`,className:"text-xs text-muted-foreground",children:g.figure.scaleHint})]})]})}])},339023,763896,336653,e=>{var t=e.i(843476),a=e.i(271645),s=e.i(519455),r=e.i(793479),l=e.i(111110),i=e.i(294114),n=e.i(184110),o=e.i(201276);function c(e){let t=0,a=0;for(let s of e)"number"==typeof s&&Number.isFinite(s)&&(t+=1,a+=s);return{scored:t,unscored:e.length-t,total:t>0?Math.round(10*a)/10:null}}e.s(["f",0,function({scales:e,aligns:c,onPreviewChange:d,onSave:u}){let{t:m}=(0,l.b)(),x=(0,a.useId)(),f=e.map(n.V),g=new Set(f).size<=1,h=f[0]??n.n,p=(c??e.map(()=>n.E)).map(n.o),b=new Set(p).size<=1,y=p[0]??n.E,[j,v]=(0,a.useState)(null),[N,w]=(0,a.useState)(null),[k,S]=(0,a.useState)(!1);if(0===e.length)return null;let _=j??String(h),I=""!==_.trim()&&(0,n.x)(Number(_)),C=I?Number(_):h,q=N??y,A=null!==j||null!==N,$=null!==j?!I||!g||Number(_)!==h:!A&&!g,R=null!==N?!b||N!==y:!A&&!b,T=$||R,z=(e,t)=>{let a=null!==e&&""!==e.trim()&&(0,n.x)(Number(e))?Number(e):null;d?.({scale:a,align:t})},F=e=>{v(e),z(e,N)},M=async e=>{if(e.preventDefault(),I&&T&&!k){S(!0);try{let e={};null===j&&(A||g)||(e.figureScale=C),null===N&&(A||b)||(e.figureAlign=q),await u(e),v(null),w(null),d?.({scale:null,align:null}),i.c.success(m.common.messages.saveSuccess)}catch(e){o.V.error("[ExamFigureScale]","统一保存试卷配图设置失败",{error:e}),i.c.error(m.common.messages.saveFailed)}finally{S(!1)}}};return(0,t.jsxs)("form",{onSubmit:M,className:"figure-scale-editor-controls w-full space-y-2 rounded-md border bg-background p-3 print:hidden",children:[(0,t.jsxs)("div",{className:"flex flex-wrap items-center gap-2 text-sm",children:[(0,t.jsx)("label",{htmlFor:x,className:"font-medium",children:m.exam.uniformFigureScale}),(0,t.jsx)(r.f,{id:x,type:"number",min:n._,max:n.a,step:1,value:_,disabled:k,"aria-describedby":`${x}-hint`,"aria-invalid":!I,onChange:e=>F(e.target.value),className:"h-8 w-20"}),(0,t.jsx)("span",{children:"%"}),(0,t.jsx)(s.f,{type:"button",variant:"outline",size:"sm",disabled:k||g&&I&&C===n.n,onClick:()=>F(String(n.n)),children:m.figure.resetScale}),(0,t.jsxs)("div",{role:"group","aria-label":m.exam.uniformFigureAlign,className:"inline-flex items-center gap-1",children:[(0,t.jsx)("span",{className:"text-muted-foreground",children:m.exam.uniformFigureAlign}),n.j.map(e=>(0,t.jsx)(s.f,{type:"button",variant:q===e&&(null!==N||b)?"default":"outline",size:"sm",disabled:k,"aria-pressed":q===e&&(null!==N||b),onClick:()=>{var t;w(t=b&&e===y?null:e),z(j,t)},children:m.figure.aligns[e]},e))]}),(0,t.jsx)(s.f,{type:"submit",size:"sm",disabled:k||!T||!I,children:k?m.common.progress.saving:m.common.save}),A&&(0,t.jsx)(s.f,{type:"button",variant:"ghost",size:"sm",disabled:k,onClick:()=>{v(null),w(null),d?.({scale:null,align:null})},children:m.common.cancel})]}),(0,t.jsx)("input",{type:"range",min:n._,max:n.a,step:1,value:C,disabled:k,"aria-label":m.exam.uniformFigureScaleSlider,"aria-describedby":`${x}-hint`,onChange:e=>F(e.target.value),className:"block h-6 w-full max-w-sm accent-primary"}),(0,t.jsx)("p",{id:`${x}-hint`,className:"text-xs text-muted-foreground",children:m.exam.uniformFigureScaleHint})]})}],339023),e.s(["D",0,1e3,"s",0,function(e){return Number.isInteger(e)?String(e):e.toFixed(1)},"H",0,function(e){return null===e||"number"!=typeof e||!Number.isFinite(e)||e<.001||e>1e3||Math.abs(10*e-Math.round(10*e))>1e-6?null:Math.round(10*e)/10},"n",0,c],763896);var d=e.i(401280);let u=["一","二","三","四","五","六","七","八","九","十","十一","十二","十三","十四","十五","十六","十七","十八","十九","二十"],m=["I","II","III","IV","V","VI","VII","VIII","IX","X","XI","XII","XIII","XIV","XV","XVI","XVII","XVIII","XIX","XX"];e.s(["f",0,function(e,t){let a=new Map;for(let e of d.V)a.set(e,[]);for(let t of[...e].sort((e,t)=>e.order-t.order))a.get(function(e){let t=e.questionType??e.errorItemQuestionType??null;return d.V.includes(t??"")?t:"other"}(t)).push(t);let s=[],r=1,l=0;for(let e of d.V){let i=a.get(e);if(0===i.length)continue;let n=c(i.map(e=>e.score??null));s.push({type:"other"===e?null:e,title:function(e,t,a){let s="zh"===a?d.H[e]:d.u[e];return"zh"===a?`${u[t]}、${s}`:`Part ${m[t]}. ${s}`}(e,l,t),items:i.map(e=>({question:e,displayNumber:r++})),count:i.length,scoreTotal:n.total,unscored:n.unscored}),l+=1}return s}],336653)},663661,e=>{var t=e.i(843476),a=e.i(487486),s=e.i(111110);let r={generating:"bg-blue-100 dark:bg-blue-900/40 text-blue-700 dark:text-blue-300 border-blue-200 dark:border-blue-900",ready:"bg-indigo-100 dark:bg-indigo-900/40 text-indigo-700 dark:text-indigo-300 border-indigo-200 dark:border-indigo-900",partial:"bg-amber-100 dark:bg-amber-900/40 text-amber-700 dark:text-amber-300 border-amber-200 dark:border-amber-900",failed:"bg-red-100 dark:bg-red-900/40 text-red-700 dark:text-red-300 border-red-200 dark:border-red-900",completed:"bg-green-100 dark:bg-green-900/40 text-green-700 dark:text-green-300 border-green-200 dark:border-green-900"};e.s(["f",0,function({status:e,recorded:l}){let{t:i}=(0,s.b)(),n=l&&("ready"===e||"partial"===e)?"completed":e;return(0,t.jsx)(a.f,{variant:"outline",className:r[n],children:i.exam.status[n]})}])},991686,e=>{var t=e.i(843476),a=e.i(271645),s=e.i(522016),r=e.i(215519),l=e.i(306831),i=e.i(716327),n=e.i(456539),o=e.i(632781),c=e.i(77071),d=e.i(328623),u=e.i(759659),m=e.i(487486),x=e.i(519455),f=e.i(515288),g=e.i(511445),h=e.i(856522),p=e.i(793479),b=e.i(393733),y=e.i(111110),j=e.i(41931);function v({errorItemId:e,onSaved:s,onCancel:i}){let{t:n}=(0,y.b)(),{timeZone:c}=(0,r.M)(),d=(0,l.r)(new Date,"yyyy-MM-dd",c),[u,m]=(0,a.useState)(null),[f,g]=(0,a.useState)(d),[N,w]=(0,a.useState)(!1),[k,S]=(0,a.useState)(null),_=async()=>{if(u&&f){w(!0),S(null);try{await j.k.post("/api/practice/record",{errorItemId:e,result:u,source:"manual",takenAt:(0,l.$)(f,c)}),s()}catch{S(n.mastery.resultSaveFailed)}finally{w(!1)}}};return(0,t.jsxs)("div",{className:"space-y-3 rounded-md border bg-muted/30 p-3",children:[(0,t.jsx)(b.f,{value:u,onChange:m,disabled:N}),(0,t.jsxs)("div",{className:"flex flex-col sm:flex-row sm:items-center gap-2",children:[(0,t.jsx)("label",{htmlFor:`practice-date-${e}`,className:"text-sm font-medium",children:n.mastery.recordDate}),(0,t.jsx)(p.f,{id:`practice-date-${e}`,type:"date",value:f,max:d,onChange:e=>g(e.target.value),className:"sm:w-48"}),(0,t.jsxs)("div",{className:"flex gap-2 sm:ml-auto",children:[(0,t.jsx)(x.f,{variant:"outline",size:"sm",onClick:i,disabled:N,className:"flex-1 sm:flex-none",children:n.exam.cancel}),(0,t.jsxs)(x.f,{size:"sm",onClick:_,disabled:N||!u||!f,className:"flex-1 sm:flex-none",children:[N?(0,t.jsx)(o.f,{className:"mr-2 h-4 w-4 animate-spin"}):(0,t.jsx)(h.f,{className:"mr-2 h-4 w-4"}),n.mastery.saveResult]})]})]}),k&&(0,t.jsx)("p",{className:"text-sm text-destructive",children:k})]})}var N=e.i(149704),w=e.i(294114),k=e.i(905110);let S={correct:"bg-green-100 dark:bg-green-900/40 text-green-700 dark:text-green-300 border-green-200 dark:border-green-900",wrong:"bg-red-100 dark:bg-red-900/40 text-red-700 dark:text-red-300 border-red-200 dark:border-red-900",not_attempted:"bg-amber-100 dark:bg-amber-900/40 text-amber-700 dark:text-amber-300 border-amber-200 dark:border-amber-900"};e.s(["K",0,function({errorItemId:e,onMasteryStatusChange:h}){let{timeZone:p}=(0,r.M)(),{t:b}=(0,y.b)(),[_,I]=(0,a.useState)(null),[C,q]=(0,a.useState)(null),[A,$]=(0,a.useState)(0),[R,T]=(0,a.useState)(!1),z=(0,a.useCallback)(()=>{j.k.get(`/api/error-items/${e}/practice-records`).then(e=>{I(e),h?.(e.masteryStatus)}).catch(()=>void 0)},[e,h]);(0,a.useEffect)(z,[z]);let F=()=>{$(0),z()},M=async e=>{if(await (0,w.u)(b.mastery.deleteRecordConfirm,{destructive:!0}))try{await j.k.delete(`/api/practice/record/${e}`),F()}catch{w.c.error(b.mastery.deleteRecordFailed)}},D=_?.records[0],E=!!D&&(!_?.masteryEvaluatedAt||new Date(D.createdAt)>new Date(_.masteryEvaluatedAt));if((0,a.useEffect)(()=>{if(!E||A>=20)return;let e=setTimeout(()=>{$(e=>e+1),z()},4e3);return()=>clearTimeout(e)},[E,A,z]),!_)return null;let V=_.masteryProbability,H=null===V?null:Math.round(100*V),U=null===H?"":(0,k.m)(V,_.masteryThreshold)?"bg-green-500":H>=30?"bg-amber-500":"bg-red-500",X=b.practice.difficulty;return(0,t.jsxs)(f.N,{children:[(0,t.jsx)(f.Y,{children:(0,t.jsxs)(f.v,{className:"flex items-center gap-2 text-base",children:[(0,t.jsx)(d.f,{className:"h-4 w-4 text-primary"}),b.mastery.probability]})}),(0,t.jsxs)(f.O,{className:"space-y-4",children:[null===H?(0,t.jsx)("p",{className:"text-sm text-muted-foreground",children:E?b.mastery.pending:b.mastery.notEvaluated}):(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsxs)("div",{className:"flex items-baseline justify-between gap-2",children:[(0,t.jsxs)("span",{className:"text-3xl font-bold",children:[H,"%"]}),(0,t.jsxs)("span",{className:"flex items-center gap-2 text-xs text-muted-foreground",children:[E&&(0,t.jsx)(o.f,{className:"h-3 w-3 animate-spin"}),(0,t.jsx)(m.f,{variant:"outline",children:"ai"===_.masterySource?b.mastery.aiEvaluated:b.mastery.estimated})]})]}),(0,t.jsx)("div",{className:"h-2 w-full rounded-full bg-muted overflow-hidden",children:(0,t.jsx)("div",{className:`h-full ${U} transition-all`,style:{width:`${H}%`}})}),_.masteryReason&&(0,t.jsx)("p",{className:"text-sm text-muted-foreground",children:_.masteryReason}),(0,t.jsx)("p",{className:"text-xs text-muted-foreground",children:b.mastery.thresholdHint.replace("{threshold}",String(_.masteryThreshold))})]}),(0,t.jsxs)("div",{className:"space-y-2 border-t pt-4",children:[(0,t.jsxs)("div",{className:"flex items-center justify-between gap-2",children:[(0,t.jsx)("h4",{className:"text-sm font-semibold",children:b.mastery.history}),!R&&(0,t.jsxs)(x.f,{variant:"outline",size:"sm",onClick:()=>T(!0),children:[(0,t.jsx)(c.f,{className:"mr-1 h-4 w-4"}),b.mastery.addRecord]})]}),R&&(0,t.jsx)(v,{errorItemId:e,onCancel:()=>T(!1),onSaved:()=>{T(!1),F()}}),0===_.records.length?(0,t.jsx)("p",{className:"text-sm text-muted-foreground italic",children:b.mastery.noHistory}):(0,t.jsx)("ul",{className:"divide-y rounded-md border",children:_.records.map(e=>(0,t.jsxs)("li",{className:"p-3 text-sm space-y-2",children:[(0,t.jsxs)("div",{className:"flex items-start gap-2",children:[(0,t.jsxs)("button",{type:"button",className:"flex min-w-0 flex-1 flex-wrap items-center gap-2 text-left",onClick:()=>q(C===e.id?null:e.id),children:[(0,t.jsx)("span",{className:"text-muted-foreground tabular-nums",children:(0,l.r)(e.createdAt,"yyyy-MM-dd HH:mm",p)}),(0,t.jsx)(m.f,{variant:"outline",className:S[e.result]||"",children:b.mastery.results[e.result]||e.result}),e.difficulty&&(0,t.jsx)(m.f,{variant:"secondary",children:X[e.difficulty]||e.difficulty}),(0,t.jsx)("span",{className:"text-xs text-muted-foreground",children:e.exam?`${b.mastery.sources.exam} \xb7 ${e.exam.title}`:b.mastery.sources[e.source]||b.mastery.sources.practice}),(e.questionText||e.mistakeAnalysis||e.wrongAnswerText)&&(0,t.jsx)("span",{className:"ml-auto text-muted-foreground",children:C===e.id?(0,t.jsx)(n.f,{className:"h-4 w-4"}):(0,t.jsx)(i.f,{className:"h-4 w-4"})})]}),(0,t.jsx)("button",{type:"button","aria-label":b.mastery.deleteRecord,title:b.mastery.deleteRecord,className:"shrink-0 rounded p-1 text-muted-foreground hover:bg-red-50 dark:hover:bg-red-950/40 hover:text-red-600 dark:hover:text-red-400",onClick:()=>M(e.id),children:(0,t.jsx)(u.f,{className:"h-4 w-4"})})]}),C===e.id&&(e.questionText||e.mistakeAnalysis||e.wrongAnswerText)&&(0,t.jsxs)("div",{className:"space-y-2 rounded-md bg-muted/40 p-3",children:[(0,t.jsx)(g.f,{content:e.questionText}),(0,t.jsx)(N.f,{svg:e.figureSvg}),e.wrongAnswerText&&(0,t.jsxs)("div",{className:"border-t pt-2",children:[(0,t.jsx)("p",{className:"mb-1 font-medium",children:b.editor.wrongAnswerText}),(0,t.jsx)(g.f,{content:e.wrongAnswerText})]}),e.mistakeAnalysis&&(0,t.jsxs)("div",{className:"border-t pt-2",children:[(0,t.jsx)("p",{className:"mb-1 font-medium",children:b.editor.mistakeAnalysis}),(0,t.jsx)(g.f,{content:e.mistakeAnalysis})]}),e.originalImageUrl&&(0,t.jsx)("img",{src:e.originalImageUrl,alt:b.editor.wrongAnswerText,className:"max-h-96 max-w-full rounded object-contain"}),e.answerText&&(0,t.jsx)("div",{className:"border-t pt-2",children:(0,t.jsx)(g.f,{content:e.answerText,className:"font-semibold"})}),e.exam&&(0,t.jsx)(s.default,{href:`/exams/${e.exam.paperId}`,className:"text-xs text-primary hover:underline",children:e.exam.title})]})]},e.id))})]})]})]})},"x",0,S],991686)},393733,931454,e=>{var t=e.i(843476),a=e.i(548161),s=e.i(576248),r=e.i(583967),l=e.i(111110);let i=[{value:"correct",icon:a.f,active:"border-green-600 bg-green-50 dark:bg-green-950/40 text-green-700 dark:text-green-300"},{value:"wrong",icon:r.f,active:"border-red-600 bg-red-50 dark:bg-red-950/40 text-red-700 dark:text-red-300"},{value:"not_attempted",icon:s.f,active:"border-amber-600 bg-amber-50 dark:bg-amber-950/40 text-amber-700 dark:text-amber-300"}];e.s(["f",0,function({value:e,onChange:a,disabled:s,size:r="md"}){let{t:n}=(0,l.b)(),o="sm"===r?"px-2 py-1 text-xs":"px-3 py-2 text-sm";return(0,t.jsx)("div",{className:"grid grid-cols-3 gap-2",role:"radiogroup",children:i.map(({value:l,icon:i,active:c})=>(0,t.jsxs)("button",{type:"button",role:"radio","aria-checked":e===l,disabled:s,onClick:()=>a(l),className:`flex items-center justify-center gap-1 rounded-md border font-medium transition-colors disabled:opacity-60 ${o} ${e===l?c:"border-input hover:bg-muted"}`,children:[(0,t.jsx)(i,{className:"sm"===r?"h-3 w-3":"h-4 w-4"}),n.mastery.results[l]]},l))})}],393733);var n=e.i(534693);e.s(["f",()=>n.f],931454)},149704,e=>{var t=e.i(843476),a=e.i(111110),s=e.i(398019),r=e.i(184110),l=e.i(975157);let i={left:"mr-auto",center:"mx-auto",right:"ml-auto"};e.s(["f",0,function({svg:e,scale:n,align:o,className:c}){let{t:d}=(0,a.b)();if(!e)return null;let u=(0,r.V)(n),m=(0,r.o)(o);return(0,t.jsx)("figure",{className:(0,l.f)("question-figure my-3",c),children:(0,t.jsx)("img",{src:(0,s.d)(e),alt:d.figure.alt,className:(0,l.f)(i[m],"block h-auto max-w-full rounded border bg-white p-2"),style:{..."left"===m?{marginLeft:0,marginRight:"auto"}:"right"===m?{marginLeft:"auto",marginRight:0}:{},maxHeight:360,zoom:u/100,maxWidth:`${Math.min(u,100)}%`}})})}])},590546,e=>{var t=e.i(843476),a=e.i(618566),s=e.i(519455),r=e.i(711241);e.s(["f",0,function({fallbackUrl:e,className:l}){let i=(0,a.useRouter)();return(0,t.jsx)(s.f,{variant:"ghost",size:"icon",onClick:()=>{i.push(e)},className:l,children:(0,t.jsx)(r.f,{className:"h-5 w-5"})})}])},86963,e=>{var t=e.i(843476),a=e.i(632781);e.s(["f",0,function({label:e}){return(0,t.jsxs)("div",{className:"flex min-h-[50vh] flex-col items-center justify-center gap-3 text-muted-foreground",children:[(0,t.jsx)(a.f,{className:"h-7 w-7 animate-spin text-primary"}),e&&(0,t.jsx)("p",{className:"text-sm",children:e})]})}])},184110,e=>{let t=["left","center","right"],a="center";function s(e){return"number"==typeof e&&Number.isInteger(e)&&e>=10&&e<=200}e.s(["E",0,a,"n",0,100,"j",0,t,"a",0,200,"_",0,10,"x",0,s,"o",0,function(e){return"string"==typeof e&&t.includes(e)?e:a},"V",0,function(e){return s(e)?e:100}])},398019,e=>{e.s(["K",0,1e5,"d",0,function(e){return`data:image/svg+xml;charset=utf-8,${encodeURIComponent(e)}`}])},35209,e=>{var t=e.i(271645),a=e.i(111110);e.s(["f",0,function(...e){let{t:s}=(0,a.b)(),r=[s.pageTitle.base,...e.map(e=>"string"==typeof e?e.trim():"").filter(e=>e.length>0)].join("-");(0,t.useEffect)(()=>{document.title=r},[r])}])},401280,e=>{let t={single_choice:"single_choice",singlechoice:"single_choice","single choice":"single_choice","single-choice":"single_choice",multiple_choice:"multiple_choice",multiplechoice:"multiple_choice","multiple choice":"multiple_choice","multiple-choice":"multiple_choice",multichoice:"multiple_choice","multi choice":"multiple_choice",true_false:"true_false",truefalse:"true_false","true/false":"true_false","true false":"true_false","true-false":"true_false","true / false":"true_false",fill_blank:"fill_blank",fillblank:"fill_blank","fill in the blank":"fill_blank","fill-in-the-blank":"fill_blank",fillintheblank:"fill_blank",calculation:"calculation",solution:"solution",reading:"reading",cloze:"cloze",writing:"writing",other:"other",选择题:"single_choice",单项选择:"single_choice",单选:"single_choice",单选题:"single_choice",不定项:"multiple_choice",不定项选择:"multiple_choice",多项选择:"multiple_choice",多选:"multiple_choice",多选题:"multiple_choice",判断:"true_false",判断题:"true_false",是非:"true_false",是非题:"true_false",填空:"fill_blank",填空题:"fill_blank",口算:"calculation",计算:"calculation",计算题:"calculation",解答:"solution",解答题:"solution",应用:"solution",应用题:"solution",证明:"solution",证明题:"solution",简答:"solution",简答题:"solution",阅读:"reading",阅读理解:"reading",完形:"cloze",完形填空:"cloze",作文:"writing",写作:"writing",书面表达:"writing",其他:"other"};e.s(["O",0,"__none__","V",0,["single_choice","multiple_choice","true_false","fill_blank","calculation","solution","reading","cloze","writing","other"],"u",0,{single_choice:"Single Choice",multiple_choice:"Multiple Choice",true_false:"True / False",fill_blank:"Fill in the Blank",calculation:"Calculation",solution:"Solution",reading:"Reading Comprehension",cloze:"Cloze",writing:"Writing",other:"Other"},"H",0,{single_choice:"单选题",multiple_choice:"多选题",true_false:"判断题",fill_blank:"填空题",calculation:"计算题",solution:"解答题",reading:"阅读理解",cloze:"完形填空",writing:"写作",other:"其他"},"P",0,function(e){if("string"!=typeof e)return null;let a=e.trim().toLowerCase();return a?t[a]??null:null}])}])})();
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,[842727,e=>{var t=e.i(271645),n=e.i(981140),o=e.i(75830),r=e.i(820783),i=e.i(30030),a=e.i(610772),s=e.i(248425),c=e.i(30207),l=e.i(369340),d=e.i(586318),u=e.i(934620),p=Object.defineProperty,f=(e,t)=>p(e,"name",{value:t,configurable:!0}),m=!1;function h(){let[e,n]=t.useState(m);return t.useEffect(()=>{m||(m=!0,n(!0))},[]),e}f(h,"useIsHydrated");var g=t[" useSyncExternalStore ".trim().toString()];function v(){return()=>{}}function b(){return g(v,()=>!0,()=>!1)}f(v,"subscribe"),f(b,"useIsHydratedModern");var y="function"==typeof g?b:h,w=e.i(843476),k=Object.defineProperty,x=(e,t)=>k(e,"name",{value:t,configurable:!0}),E="rovingFocusGroup.onEntryFocus",j={bubbles:!1,cancelable:!0},M="RovingFocusGroup",[I,A,C]=(0,o.f)(M),[z,S]=(0,i.f)(M,[C]),[T,R]=z(M),P=t.forwardRef(x(function(e,t){return(0,w.jsx)(I.Provider,{scope:e.__scopeRovingFocusGroup,children:(0,w.jsx)(I.Slot,{scope:e.__scopeRovingFocusGroup,children:(0,w.jsx)(U,{...e,ref:t})})})},"RovingFocusGroup")),U=t.forwardRef(x(function(e,o){let{__scopeRovingFocusGroup:i,orientation:a,loop:u=!1,dir:p,currentTabStopId:f,defaultCurrentTabStopId:m,onCurrentTabStopIdChange:h,onEntryFocus:g,preventScrollOnEntryFocus:v=!1,...b}=e,y=t.useRef(null),k=(0,r.f)(o,y),x=(0,d.f)(p),[I,C]=(0,l.f)({prop:f,defaultProp:m??null,onChange:h,caller:M}),[z,S]=t.useState(!1),R=(0,c.f)(g),P=A(i),U=t.useRef(!1),[N,_]=t.useState(0);return t.useEffect(()=>{let e=y.current;if(e)return e.addEventListener(E,R),()=>e.removeEventListener(E,R)},[R]),(0,w.jsx)(T,{scope:i,orientation:a,dir:x,loop:u,currentTabStopId:I,onItemFocus:t.useCallback(e=>C(e),[C]),onItemShiftTab:t.useCallback(()=>S(!0),[]),onFocusableItemAdd:t.useCallback(()=>_(e=>e+1),[]),onFocusableItemRemove:t.useCallback(()=>_(e=>e-1),[]),children:(0,w.jsx)(s.V.div,{tabIndex:z||0===N?-1:0,"data-orientation":a,...b,ref:k,style:{outline:"none",...e.style},onMouseDown:(0,n.f)(e.onMouseDown,()=>{U.current=!0}),onFocus:(0,n.f)(e.onFocus,e=>{let t=!U.current;if(e.target===e.currentTarget&&t&&!z){let t=new CustomEvent(E,j);if(e.currentTarget.dispatchEvent(t),!t.defaultPrevented){let e=P().filter(e=>e.focusable);q([e.find(e=>e.active),e.find(e=>e.id===I),...e].filter(Boolean).map(e=>e.ref.current),v)}}U.current=!1}),onBlur:(0,n.f)(e.onBlur,()=>S(!1))})})},"RovingFocusGroupImpl")),N=t.forwardRef(x(function(e,o){let{__scopeRovingFocusGroup:r,focusable:i=!0,active:c=!1,tabStopId:l,children:d,...p}=e,f=(0,a.f)(),m=l||f,h=R("RovingFocusGroupItem",r),g=h.currentTabStopId===m,v=A(r),{onFocusableItemAdd:b,onFocusableItemRemove:k,currentTabStopId:x}=h,E=y();return(0,u.f)(()=>{if(E&&i)return b(),()=>k()},[E,i,b,k]),t.useEffect(()=>{if(!E&&i)return b(),()=>k()},[E,i,b,k]),(0,w.jsx)(I.ItemSlot,{scope:r,id:m,focusable:i,active:c,children:(0,w.jsx)(s.V.span,{tabIndex:g?0:-1,"data-orientation":h.orientation,...p,ref:o,onMouseDown:(0,n.f)(e.onMouseDown,e=>{i?h.onItemFocus(m):e.preventDefault()}),onFocus:(0,n.f)(e.onFocus,()=>h.onItemFocus(m)),onKeyDown:(0,n.f)(e.onKeyDown,e=>{if("Tab"===e.key&&e.shiftKey)return void h.onItemShiftTab();if(e.target!==e.currentTarget)return;let t=D(e,h.orientation,h.dir);if(void 0!==t){if(e.metaKey||e.ctrlKey||e.altKey||e.shiftKey)return;e.preventDefault();let n=v().filter(e=>e.focusable).map(e=>e.ref.current);if("last"===t)n.reverse();else if("prev"===t||"next"===t){"prev"===t&&n.reverse();let o=n.indexOf(e.currentTarget);n=h.loop?O(n,o+1):n.slice(o+1)}setTimeout(()=>q(n))}}),children:"function"==typeof d?d({isCurrentTabStop:g,hasTabStop:null!=x}):d})})},"RovingFocusGroupItem")),_={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function F(e,t){return"rtl"!==t?e:"ArrowLeft"===e?"ArrowRight":"ArrowRight"===e?"ArrowLeft":e}function D(e,t,n){let o=F(e.key,n);if(!("vertical"===t&&["ArrowLeft","ArrowRight"].includes(o))&&!("horizontal"===t&&["ArrowUp","ArrowDown"].includes(o)))return _[o]}function q(e,t=!1){let n=document.activeElement;for(let o of e)if(o===n||(o.focus({preventScroll:t}),document.activeElement!==n))return}function O(e,t){return e.map((n,o)=>e[(t+o)%e.length])}x(F,"getDirectionAwareKey"),x(D,"getFocusIntent"),x(q,"focusFirst"),x(O,"wrapArray"),e.s(["M",0,N,"F",0,P,"B",0,S],842727)},749803,e=>{var t=e.i(456420);let n={name:"chart-column",size:24,node:[["path",{d:"M3 3v16a2 2 0 0 0 2 2h16",key:"c24i48"}],["path",{d:"M18 17V9",key:"2bz60n"}],["path",{d:"M13 17V5",key:"1frdt8"}],["path",{d:"M8 17v-3",key:"17ska0"}]],aliases:["bar-chart-3"]};n.node;let o=(0,t.f)(n);e.s(["f",0,o],749803)},867927,e=>{var t=e.i(456420);let n={name:"chevron-right",size:24,node:[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]]};n.node;let o=(0,t.f)(n);e.s(["f",0,o],867927)},508734,e=>{var t=e.i(456420);let n={name:"copy",size:24,node:[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]]};n.node;let o=(0,t.f)(n);e.s(["f",0,o],508734)},762368,e=>{var t=e.i(456420);let n={name:"download",size:24,node:[["path",{d:"M12 15V3",key:"m9g1x1"}],["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}],["path",{d:"m7 10 5 5 5-5",key:"brsn70"}]]};n.node;let o=(0,t.f)(n);e.s(["f",0,o],762368)},580860,e=>{var t=e.i(456420);let n={name:"eye-off",size:24,node:[["path",{d:"M10.733 5.076a10.744 10.744 0 0 1 11.205 6.575 1 1 0 0 1 0 .696 10.747 10.747 0 0 1-1.444 2.49",key:"ct8e1f"}],["path",{d:"M14.084 14.158a3 3 0 0 1-4.242-4.242",key:"151rxh"}],["path",{d:"M17.479 17.499a10.75 10.75 0 0 1-15.417-5.151 1 1 0 0 1 0-.696 10.75 10.75 0 0 1 4.446-5.143",key:"13bj9a"}],["path",{d:"m2 2 20 20",key:"1ooewy"}]]};n.node;let o=(0,t.f)(n);e.s(["f",0,o],580860)},226091,e=>{var t=e.i(456420);let n={name:"file-text",size:24,node:[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["path",{d:"M10 9H8",key:"b1mrlr"}],["path",{d:"M16 13H8",key:"t4e002"}],["path",{d:"M16 17H8",key:"z1uh3a"}]]};n.node;let o=(0,t.f)(n);e.s(["f",0,o],226091)},999092,e=>{var t=e.i(456420);let n={name:"languages",size:24,node:[["path",{d:"m5 8 6 6",key:"1wu5hv"}],["path",{d:"m4 14 6-6 2-3",key:"1k1g8d"}],["path",{d:"M2 5h12",key:"or177f"}],["path",{d:"M7 2h1",key:"1t2jsx"}],["path",{d:"m22 22-5-10-5 10",key:"don7ne"}],["path",{d:"M14 18h6",key:"1m8k6r"}]]};n.node;let o=(0,t.f)(n);e.s(["f",0,o],999092)},795228,e=>{var t=e.i(456420);let n={name:"library-big",size:24,node:[["rect",{width:"8",height:"18",x:"3",y:"3",rx:"1",key:"oynpb5"}],["path",{d:"M7 3v18",key:"bbkbws"}],["path",{d:"M20.4 18.9c.2.5-.1 1.1-.6 1.3l-1.9.7c-.5.2-1.1-.1-1.3-.6L11.1 5.1c-.2-.5.1-1.1.6-1.3l1.9-.7c.5-.2 1.1.1 1.3.6Z",key:"1qboyk"}]]};n.node;let o=(0,t.f)(n);e.s(["f",0,o],795228)},632781,e=>{var t=e.i(456420);let n={name:"loader-circle",size:24,node:[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]],aliases:["loader-2"]};n.node;let o=(0,t.f)(n);e.s(["f",0,o],632781)},21357,495178,79058,e=>{var t=e.i(456420);let n={name:"play",size:24,node:[["path",{d:"M5 5a2 2 0 0 1 3.008-1.728l11.997 6.998a2 2 0 0 1 .003 3.458l-12 7A2 2 0 0 1 5 19z",key:"10ikf1"}]]};n.node;let o=(0,t.f)(n);e.s(["f",0,o],21357);var r=e.i(41931),i=e.i(983761),a=e.i(128093);let s=["browser","minimax","qwen","glm","stepfun","volcengine","volcengine-agent","openai"];function c(e){return"string"==typeof e&&s.includes(e)}s.filter(e=>"browser"!==e),e.s(["C",0,{minimax:{model:"speech-2.8-hd",voice:"male-qn-jingying"},qwen:{model:"qwen-audio-3.0-tts-plus",voice:"longanlufeng"},glm:{model:"glm-tts",voice:"xiaochen"},stepfun:{model:"stepaudio-2.5-tts",voice:"qingniandaxuesheng"},volcengine:{model:"seed-tts-2.0",voice:"zh_male_yangguangqingnian_uranus_bigtts"},"volcengine-agent":{model:"seed-tts-2.0",voice:"zh_male_yangguangqingnian_uranus_bigtts"},openai:{model:"gpt-4o-mini-tts",voice:"cedar"}},"r",0,{minimax:{apiKey:"https://platform.minimax.cn/docs/guides/quickstart-preparation",model:"https://platform.minimax.cn/docs/api-reference/speech-t2a-http",voice:"https://platform.minimax.cn/docs/faq/system-voice-id",endpoint:"https://platform.minimax.cn/docs/api-reference/speech-t2a-http"},qwen:{apiKey:"https://help.aliyun.com/zh/model-studio/token-plan-personal-quick-start",model:"https://help.aliyun.com/zh/model-studio/non-realtime-tts-user-guide",voice:"https://help.aliyun.com/zh/model-studio/qwen-audio-tts-voice-list",endpoint:"https://help.aliyun.com/zh/model-studio/non-realtime-tts-user-guide"},glm:{apiKey:"https://docs.bigmodel.cn/cn/guide/start/quick-start",model:"https://docs.bigmodel.cn/api-reference/%E6%A8%A1%E5%9E%8B-api/%E6%96%87%E6%9C%AC%E8%BD%AC%E8%AF%AD%E9%9F%B3",voice:"https://docs.bigmodel.cn/api-reference/%E6%A8%A1%E5%9E%8B-api/%E6%96%87%E6%9C%AC%E8%BD%AC%E8%AF%AD%E9%9F%B3",endpoint:"https://docs.bigmodel.cn/api-reference/%E6%A8%A1%E5%9E%8B-api/%E6%96%87%E6%9C%AC%E8%BD%AC%E8%AF%AD%E9%9F%B3"},stepfun:{apiKey:"https://platform.stepfun.com/docs/zh/step-plan/integrations/audio-api",model:"https://platform.stepfun.com/docs/zh/api-reference/audio/create-audio",voice:"https://platform.stepfun.com/docs/zh/guides/developer/tts",endpoint:"https://platform.stepfun.com/docs/zh/api-reference/audio/create-audio"},volcengine:{apiKey:"https://www.volcengine.com/docs/6561/196768",model:"https://www.volcengine.com/docs/6561/1598757",voice:"https://www.volcengine.com/docs/6561/1257544",endpoint:"https://www.volcengine.com/docs/6561/1598757"},openai:{apiKey:"https://platform.openai.com/docs/quickstart",model:"https://developers.openai.com/api/docs/guides/text-to-speech",voice:"https://developers.openai.com/api/docs/guides/text-to-speech",endpoint:"https://developers.openai.com/api/docs/guides/text-to-speech"},"volcengine-agent":{apiKey:"https://ark.volcengine.com/region:cn-beijing/docs/82379/2160841?lang=zh",model:"https://docs.volcengine.com/docs/ark/agent-plan-personal-voice-model?lang=zh",voice:"https://www.volcengine.com/docs/6561/1257544",endpoint:"https://docs.volcengine.com/docs/ark/agent-plan-personal-voice-model?lang=zh"}},"D",0,{volcengine:"https://docs.volcengine.com/docs/ark/free-inference-quota?lang=zh"},"l",0,s,"E",0,function(e,t){if("volcengine"===e)return"https://openspeech.bytedance.com/api/v3/tts/unidirectional";if("volcengine-agent"===e)return"https://openspeech.bytedance.com/api/v3/plan/tts/unidirectional";if("openai"===e)return`${(t?.baseUrl||"https://api.openai.com/v1").replace(/\/+$/,"")}/audio/speech`;let{baseUrl:n}=(0,a.k)(e,t);if("minimax"===e)return`${n.replace(/\/+$/,"")}/t2a_v2`;if("glm"===e||"stepfun"===e)return`${n.replace(/\/+$/,"")}/audio/speech`;try{return`${new URL(n).origin}/api/v1/services/audio/tts/SpeechSynthesizer`}catch{return""}},"L",0,function(e,t){if("openai"===t){let t=e.openai?.instances?.find(t=>t.id===e.openai?.activeInstanceId);return t?{apiKey:t.apiKey,baseUrl:t.baseUrl}:void 0}return e[t]},"S",0,function(e){return"volcengine"===e||"openai"===e},"y",0,function(e){return"browser"!==e&&c(e)},"Z",0,c],495178);let l=null;function d(){return l??=r.k.get("/api/tts").then(e=>({mode:"cloud"===e.mode?"cloud":"browser",ttsMode:c(e.ttsMode)?e.ttsMode:null})).catch(()=>({mode:"browser",ttsMode:null}))}let u=null,p=!1;function f(){return"u"<typeof Audio?null:u??=new Audio}let m=new Map,h=(e,t)=>`${t}
|
|
2
|
+
${e}`;function g(e,t,n,o){return r.k.post("/api/tts/batch",{texts:e,language:t,...n?{regenerate:n}:{},...o?{errorItemId:o}:{}},{timeout:6e5,recoverable:!0}).then(({items:e})=>e.map(({id:e,version:t})=>`/api/tts/${e}?v=${t}`))}async function v(e,t,n){let o=await g(e,t,!0,n);e.forEach((e,n)=>m.set(h(e,t),Promise.resolve(o[n])))}e.s(["l",0,f,"v",0,function(){return d().then(e=>e.mode)},"h",0,function(){return p},"z",0,function(e,t){return r.k.post("/api/tts/status",{texts:e,language:t}).then(e=>!0===e.ready).catch(()=>!1)},"w",0,function(e,t,n){let o=[...new Set(e)].filter(e=>!m.has(h(e,t)));if(!o.length)return Promise.resolve();let r=g(o,t,!1,n);return o.forEach((e,n)=>{let o=h(e,t),i=r.then(e=>e[n]);i.catch(()=>m.delete(o)),m.set(o,i)}),r.then(()=>void 0)},"H",0,v,"U",0,function(e,t){let n=h(e,t),o=m.get(n);!o&&((o=r.k.post("/api/tts",{text:e,language:t},{timeout:12e4,recoverable:!0}).then(({id:e,version:t})=>`/api/tts/${e}?v=${t}`)).catch(()=>m.delete(n)),m.set(n,o));return o},"E",0,function(){d().then(({mode:e,ttsMode:t})=>{let n="browser"===e?"browser":t;n&&(0,i.E)(`tts:${n}`)&&(0,i.z)("tts_used",{mode:n})}).catch(()=>void 0)},"p",0,function(){let e=f();if(e&&!p){let t,n,o;p=!0,t=new DataView(new ArrayBuffer(1644)),(n=(e,n)=>[...n].forEach((n,o)=>t.setUint8(e+o,n.charCodeAt(0))))(0,"RIFF"),t.setUint32(4,1636,!0),n(8,"WAVE"),n(12,"fmt "),t.setUint32(16,16,!0),t.setUint16(20,1,!0),t.setUint16(22,1,!0),t.setUint32(24,8e3,!0),t.setUint32(28,16e3,!0),t.setUint16(32,2,!0),t.setUint16(34,16,!0),n(36,"data"),t.setUint32(40,1600,!0),o="",new Uint8Array(t.buffer).forEach(e=>{o+=String.fromCharCode(e)}),e.src=`data:audio/wav;base64,${btoa(o)}`,e.play().catch(()=>{p=!1})}}],79058)},77071,e=>{var t=e.i(456420);let n={name:"plus",size:24,node:[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]]};n.node;let o=(0,t.f)(n);e.s(["f",0,o],77071)},741120,e=>{var t=e.i(456420);let n={name:"refresh-cw",size:24,node:[["path",{d:"M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8",key:"v9h5vc"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}],["path",{d:"M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16",key:"3uifl3"}],["path",{d:"M8 16H3v5",key:"1cv678"}]]};n.node;let o=(0,t.f)(n);e.s(["f",0,o],741120)},980105,e=>{var t=e.i(456420);let n={name:"scan-text",size:24,node:[["path",{d:"M3 7V5a2 2 0 0 1 2-2h2",key:"aa7l1z"}],["path",{d:"M17 3h2a2 2 0 0 1 2 2v2",key:"4qcy5o"}],["path",{d:"M21 17v2a2 2 0 0 1-2 2h-2",key:"6vwrx8"}],["path",{d:"M7 21H5a2 2 0 0 1-2-2v-2",key:"ioqczr"}],["path",{d:"M7 8h8",key:"1jbsf9"}],["path",{d:"M7 12h10",key:"b7w52i"}],["path",{d:"M7 16h6",key:"1vyc9m"}]]};n.node;let o=(0,t.f)(n);e.s(["f",0,o],980105)},759659,e=>{var t=e.i(456420);let n={name:"trash",size:24,node:[["path",{d:"M10 11v6",key:"nco0om"}],["path",{d:"M14 11v6",key:"outv1u"}],["path",{d:"M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6",key:"miytrc"}],["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2",key:"e791ji"}]],aliases:["trash-2"]};n.node;let o=(0,t.f)(n);e.s(["f",0,o],759659)},725981,e=>{var t=e.i(456420);let n={name:"upload",size:24,node:[["path",{d:"M12 3v12",key:"1x0j5s"}],["path",{d:"m17 8-5-5-5 5",key:"7q97r8"}],["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}]]};n.node;let o=(0,t.f)(n);e.s(["f",0,o],725981)},901279,e=>{var t=e.i(456420);let n={name:"user",size:24,node:[["path",{d:"M19 21v-2a4 4 0 0 0-4-4H9a4 4 0 0 0-4 4v2",key:"975kel"}],["circle",{cx:"12",cy:"7",r:"4",key:"17ys0d"}]]};n.node;let o=(0,t.f)(n);e.s(["f",0,o],901279)},534693,e=>{var t=e.i(456420);let n={name:"wand-sparkles",size:24,node:[["path",{d:"m21.64 3.64-1.28-1.28a1.21 1.21 0 0 0-1.72 0L2.36 18.64a1.21 1.21 0 0 0 0 1.72l1.28 1.28a1.2 1.2 0 0 0 1.72 0L21.64 5.36a1.2 1.2 0 0 0 0-1.72",key:"ul74o6"}],["path",{d:"m14 7 3 3",key:"1r5n42"}],["path",{d:"M5 6v4",key:"ilb8ba"}],["path",{d:"M19 14v4",key:"blhpug"}],["path",{d:"M10 2v2",key:"7u0qdc"}],["path",{d:"M7 8H3",key:"zfb6yr"}],["path",{d:"M21 16h-4",key:"1cnmox"}],["path",{d:"M11 3H9",key:"1obp7u"}]],aliases:["wand-2"]};n.node;let o=(0,t.f)(n);e.s(["f",0,o])},994533,e=>{var t=e.i(534693);e.s(["f",()=>t.f])},772325,e=>{var t=e.i(722219);e.s(["z",0,t])},213056,e=>{var t=e.i(722219);e.s(["z",0,t])},282492,e=>{var t=e.i(722219);e.s(["z",0,t])},978056,e=>{var t=e.i(722219);e.s(["z",0,t])},411382,e=>{var t=e.i(722219);e.s(["z",0,t])},54105,e=>{var t=e.i(722219);e.s(["z",0,t])},999593,424553,e=>{var t=e.i(843476),n=e.i(257428),o=e.i(111110);function r(){let{t:e}=(0,o.b)();return(0,t.jsxs)("div",{className:"space-y-2 text-sm",children:[(0,t.jsx)("ul",{className:"list-disc space-y-1 pl-5 text-muted-foreground",children:e.eula.summary.map(e=>(0,t.jsx)("li",{children:e},e))}),(0,t.jsx)("a",{href:"/eula",target:"_blank",rel:"noopener noreferrer",className:"inline-block text-primary hover:underline",children:e.eula.viewFull})]})}e.s(["f",0,r],424553),e.s(["f",0,function({checked:e,onCheckedChange:i,disabled:a}){let{t:s}=(0,o.b)();return(0,t.jsxs)("div",{className:"space-y-3 rounded-lg border p-3",children:[(0,t.jsx)("p",{className:"text-sm font-medium",children:s.eula.title}),(0,t.jsx)(r,{}),(0,t.jsxs)("label",{className:"flex items-start gap-2 text-sm",children:[(0,t.jsx)(n.f,{id:"eula-consent",className:"mt-0.5",checked:e,disabled:a,onCheckedChange:e=>i(!0===e)}),(0,t.jsx)("span",{children:s.eula.consentLabel})]})]})}],999593)},515288,e=>{var t=e.i(843476),n=e.i(975157);e.s(["N",0,function({className:e,...o}){return(0,t.jsx)("div",{"data-slot":"card",className:(0,n.f)("bg-card text-card-foreground flex flex-col gap-6 rounded-xl border py-6 shadow-sm",e),...o})},"O",0,function({className:e,...o}){return(0,t.jsx)("div",{"data-slot":"card-content",className:(0,n.f)("px-6",e),...o})},"u",0,function({className:e,...o}){return(0,t.jsx)("div",{"data-slot":"card-description",className:(0,n.f)("text-muted-foreground text-sm",e),...o})},"Y",0,function({className:e,...o}){return(0,t.jsx)("div",{"data-slot":"card-header",className:(0,n.f)("@container/card-header grid auto-rows-min grid-rows-[auto_auto] items-start gap-2 px-6 has-data-[slot=card-action]:grid-cols-[1fr_auto] [.border-b]:pb-6",e),...o})},"v",0,function({className:e,...o}){return(0,t.jsx)("div",{"data-slot":"card-title",className:(0,n.f)("leading-none font-semibold",e),...o})}])},257428,e=>{var t=e.i(843476),n=e.i(271645),o=e.i(820783),r=e.i(30030),i=e.i(981140),a=e.i(369340),s=e.i(635804),c=e.i(296626),l=e.i(248425),d=Object.defineProperty,u=(e,t)=>d(e,"name",{value:t,configurable:!0}),p="Checkbox",[f,m]=(0,r.f)(p),[h,g]=f(p);function v(e){let{__scopeCheckbox:o,checked:r,children:i,defaultChecked:s,disabled:c,form:l,name:d,onCheckedChange:u,required:f,value:m="on",internal_do_not_use_render:g}=e,[v,b]=(0,a.f)({prop:r,defaultProp:s??!1,onChange:u,caller:p}),[y,w]=n.useState(null),[k,j]=n.useState(null),[M,I]=n.useState(null),A=!y||!!l||!!y.closest("form"),C={checked:v,disabled:c,setChecked:b,control:y,setControl:w,name:d,form:l,value:m,userClick:M,onUserClick:I,required:f,defaultChecked:!E(s)&&s,isFormControl:A,bubbleInput:k,setBubbleInput:j};return(0,t.jsx)(h,{scope:o,...C,children:x(g)?g(C):i})}u(v,"CheckboxProvider");var b=n.forwardRef(u(function({__scopeCheckbox:e,onKeyDown:r,onClick:a,...s},c){let{control:d,value:p,disabled:f,checked:m,required:h,setControl:v,setChecked:b,onUserClick:y,isFormControl:w,bubbleInput:k}=g("CheckboxTrigger",e),x=(0,o.f)(c,v),M=n.useRef(m);return n.useEffect(()=>{let e=d?.form;if(e){let t=u(()=>b(M.current),"reset");return e.addEventListener("reset",t),()=>e.removeEventListener("reset",t)}},[d,b]),(0,t.jsx)(l.V.button,{type:"button",role:"checkbox","aria-checked":E(m)?"mixed":m,"aria-required":h,"data-state":j(m),"data-disabled":f?"":void 0,disabled:f,value:p,...s,ref:x,onKeyDown:(0,i.f)(r,e=>{"Enter"===e.key&&e.preventDefault()}),onClick:(0,i.f)(a,e=>{let t=e.isPropagationStopped();y({requestedChecked:!!E(m)||!m,hasConsumerStoppedPropagation:t}),b(e=>!!E(e)||!e),k&&w&&!t&&e.stopPropagation()})})},"CheckboxTrigger")),y=n.forwardRef(u(function(e,n){let{__scopeCheckbox:o,name:r,checked:i,defaultChecked:a,required:s,disabled:c,value:l,onCheckedChange:d,form:u,...p}=e;return(0,t.jsx)(v,{__scopeCheckbox:o,checked:i,defaultChecked:a,disabled:c,required:s,onCheckedChange:d,name:r,form:u,value:l,internal_do_not_use_render:({isFormControl:e})=>(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(b,{...p,ref:n,__scopeCheckbox:o}),e&&(0,t.jsx)(k,{__scopeCheckbox:o})]})})},"Checkbox")),w=n.forwardRef(u(function(e,n){let{__scopeCheckbox:o,forceMount:r,...i}=e,a=g("CheckboxIndicator",o);return(0,t.jsx)(c.f,{present:r||E(a.checked)||!0===a.checked,children:(0,t.jsx)(l.V.span,{"data-state":j(a.checked),"data-disabled":a.disabled?"":void 0,...i,ref:n,style:{pointerEvents:"none",...e.style}})})},"CheckboxIndicator")),k=n.forwardRef(u(function({__scopeCheckbox:e,onClick:r,...a},c){let{control:d,userClick:u,checked:p,defaultChecked:f,required:m,disabled:h,name:v,value:b,form:y,bubbleInput:w,setBubbleInput:k}=g("CheckboxBubbleInput",e),x=(0,o.f)(c,k),j=(0,s.f)(d),M=n.useRef(!1),I=n.useRef(p),A=n.useRef(u),C=n.useRef(null);n.useEffect(()=>{if(!w)return;let e=Object.getOwnPropertyDescriptor(window.HTMLInputElement.prototype,"checked").set;if(!e)return;let t=I.current!==p;I.current=p;let n=null!==u&&u!==A.current;if(A.current=u,n)C.current=t?null:u,t&&(w.indeterminate=E(p),e.call(w,!E(p)&&p)),w.dispatchEvent(new Event("click",{bubbles:!u.hasConsumerStoppedPropagation}));else if(t){let t=C.current;C.current=null;let n=t?.requestedChecked===p;M.current=!0,w.indeterminate=E(p),e.call(w,!E(p)&&p),w.dispatchEvent(new Event("click",{bubbles:!(n&&t.hasConsumerStoppedPropagation)})),M.current=!1}},[w,p,u]);let z=n.useRef(!E(p)&&p);return(0,t.jsx)(l.V.input,{type:"checkbox","aria-hidden":!0,defaultChecked:f??z.current,required:m,disabled:h,name:v,value:b,form:y,...a,tabIndex:-1,ref:x,onClick:(0,i.f)(r,e=>{M.current&&e.stopPropagation()}),style:{...a.style,...j,position:"absolute",pointerEvents:"none",opacity:0,margin:0,transform:"translateX(-100%)"}})},"CheckboxBubbleInput"));function x(e){return"function"==typeof e}function E(e){return"indeterminate"===e}function j(e){return E(e)?"indeterminate":e?"checked":"unchecked"}u(x,"isFunction"),u(E,"isIndeterminate"),u(j,"getState");var M=e.i(689664),I=e.i(975157);let A=n.forwardRef(({className:e,...n},o)=>(0,t.jsx)(y,{ref:o,className:(0,I.f)("peer h-4 w-4 shrink-0 rounded-sm border border-primary ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground",e),...n,children:(0,t.jsx)(w,{className:(0,I.f)("flex items-center justify-center text-current"),children:(0,t.jsx)(M.f,{className:"h-4 w-4"})})}));A.displayName=y.displayName,e.s(["f",0,A],257428)},699375,e=>{var t=e.i(843476),n=e.i(271645),o=e.i(981140),r=e.i(820783),i=e.i(30030),a=e.i(369340),s=e.i(635804),c=e.i(248425),l=Object.defineProperty,d=(e,t)=>l(e,"name",{value:t,configurable:!0}),u="Switch",[p,f]=(0,i.f)(u),[m,h]=p(u);function g(e){let{__scopeSwitch:o,checked:r,children:i,defaultChecked:s,disabled:c,form:l,name:d,onCheckedChange:p,required:f,value:h="on",internal_do_not_use_render:g}=e,[v,b]=(0,a.f)({prop:r,defaultProp:s??!1,onChange:p,caller:u}),[y,w]=n.useState(null),[x,E]=n.useState(null),[j,M]=n.useState(null),I=!y||!!l||!!y.closest("form"),A={checked:v,setChecked:b,disabled:c,control:y,setControl:w,name:d,form:l,value:h,userClick:j,onUserClick:M,required:f,defaultChecked:s,isFormControl:I,bubbleInput:x,setBubbleInput:E};return(0,t.jsx)(m,{scope:o,...A,children:k(g)?g(A):i})}d(g,"SwitchProvider");var v=n.forwardRef(d(function({__scopeSwitch:e,onClick:i,...a},s){let{control:l,form:u,value:p,disabled:f,checked:m,required:g,setControl:v,setChecked:b,onUserClick:y,isFormControl:w,bubbleInput:k}=h("SwitchTrigger",e),E=(0,r.f)(s,v),j=n.useRef(m);return n.useEffect(()=>{let e=u?l?.ownerDocument.getElementById(u):l?.form;if(e instanceof HTMLFormElement){let t=d(()=>b(j.current),"reset");return e.addEventListener("reset",t),()=>e.removeEventListener("reset",t)}},[l,u,b]),(0,t.jsx)(c.V.button,{type:"button",role:"switch","aria-checked":m,"aria-required":g,"data-state":x(m),"data-disabled":f?"":void 0,disabled:f,value:p,...a,ref:E,onClick:(0,o.f)(i,e=>{let t=e.isPropagationStopped();y({requestedChecked:!m,hasConsumerStoppedPropagation:t}),b(e=>!e),k&&w&&!t&&e.stopPropagation()})})},"SwitchTrigger")),b=n.forwardRef(d(function(e,n){let{__scopeSwitch:o,name:r,checked:i,defaultChecked:a,required:s,disabled:c,value:l,onCheckedChange:d,form:u,...p}=e;return(0,t.jsx)(g,{__scopeSwitch:o,checked:i,defaultChecked:a,disabled:c,required:s,onCheckedChange:d,name:r,form:u,value:l,internal_do_not_use_render:({isFormControl:e})=>(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(v,{...p,ref:n,__scopeSwitch:o}),e&&(0,t.jsx)(w,{__scopeSwitch:o})]})})},"Switch")),y=n.forwardRef(d(function(e,n){let{__scopeSwitch:o,...r}=e,i=h("SwitchThumb",o);return(0,t.jsx)(c.V.span,{"data-state":x(i.checked),"data-disabled":i.disabled?"":void 0,...r,ref:n})},"SwitchThumb")),w=n.forwardRef(d(function({__scopeSwitch:e,onClick:i,...a},l){let{control:d,userClick:u,checked:p,defaultChecked:f,required:m,disabled:g,name:v,value:b,form:y,bubbleInput:w,setBubbleInput:k}=h("SwitchBubbleInput",e),x=(0,r.f)(l,k),E=(0,s.f)(d),j=n.useRef(!1),M=n.useRef(p),I=n.useRef(u),A=n.useRef(null);n.useEffect(()=>{if(!w)return;let e=Object.getOwnPropertyDescriptor(window.HTMLInputElement.prototype,"checked").set;if(!e)return;let t=M.current!==p;M.current=p;let n=null!==u&&u!==I.current;if(I.current=u,n)A.current=t?null:u,t&&e.call(w,p),w.dispatchEvent(new Event("click",{bubbles:!u.hasConsumerStoppedPropagation}));else if(t){let t=A.current;A.current=null;let n=t?.requestedChecked===p;j.current=!0,e.call(w,p),w.dispatchEvent(new Event("click",{bubbles:!(n&&t.hasConsumerStoppedPropagation)})),j.current=!1}},[w,p,u]);let C=n.useRef(p);return(0,t.jsx)(c.V.input,{type:"checkbox","aria-hidden":!0,defaultChecked:f??C.current,required:m,disabled:g,name:v,value:b,form:y,...a,tabIndex:-1,ref:x,onClick:(0,o.f)(i,e=>{j.current&&e.stopPropagation()}),style:{...a.style,...E,position:"absolute",pointerEvents:"none",opacity:0,margin:0,transform:"translateX(-100%)"}})},"SwitchBubbleInput"));function k(e){return"function"==typeof e}function x(e){return e?"checked":"unchecked"}d(k,"isFunction"),d(x,"getState");var E=e.i(975157);let j=n.forwardRef(({className:e,...n},o)=>(0,t.jsx)(b,{className:(0,E.f)("peer inline-flex h-5 w-9 shrink-0 cursor-pointer items-center rounded-full border-2 border-transparent shadow-sm transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-primary data-[state=unchecked]:bg-input",e),...n,ref:o,children:(0,t.jsx)(y,{className:(0,E.f)("pointer-events-none block h-4 w-4 rounded-full bg-background shadow-lg ring-0 transition-transform data-[state=checked]:translate-x-4 data-[state=unchecked]:translate-x-0")})}));j.displayName=b.displayName,e.s(["f",0,j],699375)},677572,e=>{var t=e.i(843476),n=e.i(271645),o=e.i(981140),r=e.i(30030),i=e.i(842727),a=e.i(296626),s=e.i(248425),c=e.i(586318),l=e.i(369340),d=e.i(610772),u=Object.defineProperty,p=(e,t)=>u(e,"name",{value:t,configurable:!0}),f="Tabs",[m,h]=(0,r.f)(f,[i.B]),g=(0,i.B)(),[v,b]=m(f),y=n.forwardRef(p(function(e,n){let{__scopeTabs:o,value:r,onValueChange:i,defaultValue:a,orientation:u="horizontal",dir:p,activationMode:m="automatic",...h}=e,g=(0,c.f)(p),[b,y]=(0,l.f)({prop:r,onChange:i,defaultProp:a??"",caller:f});return(0,t.jsx)(v,{scope:o,baseId:(0,d.f)(),value:b,onValueChange:y,orientation:u,dir:g,activationMode:m,children:(0,t.jsx)(s.V.div,{dir:g,"data-orientation":u,...h,ref:n})})},"Tabs")),w=n.forwardRef(p(function(e,n){let{__scopeTabs:o,loop:r=!0,...a}=e,c=b("TabsList",o),l=g(o);return(0,t.jsx)(i.F,{asChild:!0,...l,orientation:c.orientation,dir:c.dir,loop:r,children:(0,t.jsx)(s.V.div,{role:"tablist","aria-orientation":c.orientation,...a,ref:n})})},"TabsList")),k=n.forwardRef(p(function(e,n){let{__scopeTabs:r,value:a,disabled:c=!1,...l}=e,d=b("TabsTrigger",r),u=g(r),p=E(d.baseId,a),f=j(d.baseId,a),m=a===d.value;return(0,t.jsx)(i.M,{asChild:!0,...u,focusable:!c,active:m,children:(0,t.jsx)(s.V.button,{type:"button",role:"tab","aria-selected":m,"aria-controls":f,"data-state":m?"active":"inactive","data-disabled":c?"":void 0,disabled:c,id:p,...l,ref:n,onMouseDown:(0,o.f)(e.onMouseDown,e=>{c||0!==e.button||!1!==e.ctrlKey?e.preventDefault():(e.currentTarget.focus(),d.onValueChange(a))}),onKeyDown:(0,o.f)(e.onKeyDown,e=>{!c&&e.target===e.currentTarget&&[" ","Enter"].includes(e.key)&&d.onValueChange(a)}),onFocus:(0,o.f)(e.onFocus,()=>{let e="manual"!==d.activationMode;m||c||!e||d.onValueChange(a)})})})},"TabsTrigger")),x=n.forwardRef(p(function(e,o){let{__scopeTabs:r,value:i,forceMount:c,children:l,...d}=e,u=b("TabsContent",r),p=E(u.baseId,i),f=j(u.baseId,i),m=i===u.value,h=n.useRef(m);return n.useEffect(()=>{let e=requestAnimationFrame(()=>h.current=!1);return()=>cancelAnimationFrame(e)},[]),(0,t.jsx)(a.f,{present:c||m,children:({present:n})=>(0,t.jsx)(s.V.div,{"data-state":m?"active":"inactive","data-orientation":u.orientation,role:"tabpanel","aria-labelledby":p,hidden:!n,id:f,tabIndex:0,...d,ref:o,style:{...e.style,animationDuration:h.current?"0s":void 0},children:n&&l})})},"TabsContent"));function E(e,t){return`${e}-trigger-${t}`}function j(e,t){return`${e}-content-${t}`}p(E,"makeTriggerId"),p(j,"makeContentId");var M=e.i(975157);let I=n.forwardRef(({className:e,...n},o)=>(0,t.jsx)(w,{ref:o,className:(0,M.f)("inline-flex h-10 items-center justify-center rounded-md bg-muted p-1 text-muted-foreground",e),...n}));I.displayName=w.displayName;let A=n.forwardRef(({className:e,...n},o)=>(0,t.jsx)(k,{ref:o,className:(0,M.f)("inline-flex items-center justify-center whitespace-nowrap rounded-sm px-3 py-1.5 text-sm font-medium ring-offset-background transition-all focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 data-[state=active]:bg-background data-[state=active]:text-foreground data-[state=active]:shadow-sm",e),...n}));A.displayName=k.displayName;let C=n.forwardRef(({className:e,...n},o)=>(0,t.jsx)(x,{ref:o,className:(0,M.f)("mt-2 ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2",e),...n}));C.displayName=x.displayName,e.s(["i",0,y,"S",0,C,"U",0,I,"k",0,A],677572)},707212,e=>{let t=["AI_DAILY_LIMIT_EXCEEDED","AI_QUOTA_INSUFFICIENT"],n=[...t,"AI_CONSENT_REQUIRED"],o={zh:"今天的 AI 使用次数已达上限,请明天再试,或请管理员调整额度。",en:"You have used up today's AI allowance. Try again tomorrow or ask an administrator to raise the limit."},r={zh:"AI 额度已用完,请补充额度后再试。",en:"Your AI credit has run out. Add more credit and try again."};e.s(["y",0,o,"i",0,{AI_DAILY_LIMIT_EXCEEDED:o,AI_QUOTA_INSUFFICIENT:r},"Q",0,r,"j",0,function(e){return"string"==typeof e&&t.includes(e)},"t",0,function(e){return"string"==typeof e&&n.includes(e)}])},41931,294114,128093,923512,e=>{let t={success:2500,info:3500,warning:4500,error:5e3},n={toasts:[],confirm:null},o=1,r=new Set;function i(e){n=e,r.forEach(e=>e(n))}function a(e){i({...n,toasts:n.toasts.filter(t=>t.id!==e)})}function s(e,r){let s="string"==typeof r?r:String(r??"");if(!s)return;let c=o++;i({...n,toasts:[...n.toasts.slice(-3),{id:c,type:e,message:s}]}),setTimeout(()=>a(c),t[e])}let c={success:e=>s("success",e),error:e=>s("error",e),info:e=>s("info",e),warning:e=>s("warning",e)};e.s(["u",0,function(e,t={}){return 0===r.size?Promise.resolve("function"==typeof window.confirm&&window.confirm(e)):(n.confirm?.resolve(!1),new Promise(r=>{let a=o++;i({...n,confirm:{...t,id:a,message:e,resolve:e=>{n.confirm?.id===a&&i({...n,confirm:null}),r(e)}}})}))},"p",0,a,"M",0,function(e){return r.add(e),e(n),()=>{r.delete(e)}},"c",0,c],294114);var l=e.i(707212);let d={minimax:{name:"MiniMax",nameEn:"MiniMax",baseUrl:"https://api.minimax.cn/v1",model:"MiniMax-M3.1-Flash",envPrefix:"MINIMAX",consoleUrl:"https://platform.minimax.cn",docs:{cn:"https://platform.minimax.cn/docs/api-reference/api-overview",intl:"https://platform.minimax.io/docs/api-reference/api-overview",apiKey:"https://platform.minimax.cn/docs/guides/quickstart-preparation",models:"https://platform.minimax.cn/docs/guides/models-intro"}},glm:{name:"智谱 GLM",nameEn:"Zhipu GLM",baseUrl:"https://open.bigmodel.cn/api/paas/v4",model:"glm-5.3-flash",envPrefix:"GLM",consoleUrl:"https://open.bigmodel.cn",docs:{cn:"https://docs.bigmodel.cn/cn/guide/start/quick-start",intl:"https://docs.z.ai/guides/overview/quick-start",apiKey:"https://docs.bigmodel.cn/cn/guide/start/quick-start",models:"https://docs.bigmodel.cn/cn/guide/start/model-overview"}},deepseek:{name:"DeepSeek",nameEn:"DeepSeek",baseUrl:"https://api.deepseek.com",model:"deepseek-v4-flash",envPrefix:"DEEPSEEK",consoleUrl:"https://platform.deepseek.com",docs:{cn:"https://api-docs.deepseek.com/zh-cn/",apiKey:"https://api-docs.deepseek.com/zh-cn/",models:"https://api-docs.deepseek.com/zh-cn/quick_start/pricing"}},kimi:{name:"Kimi",nameEn:"Kimi",baseUrl:"https://api.moonshot.cn/v1",model:"kimi-k3.1-pro",envPrefix:"KIMI",consoleUrl:"https://platform.kimi.com",docs:{cn:"https://platform.moonshot.cn/docs/introduction",intl:"https://platform.moonshot.ai/docs/introduction",apiKey:"https://platform.moonshot.cn/docs/introduction",models:"https://platform.moonshot.cn/docs/pricing/chat"}},qwen:{name:"千问 Qwen",nameEn:"Qwen",baseUrl:"https://token-plan.cn-beijing.maas.aliyuncs.com/compatible-mode/v1",model:"qwen3.8-max",envPrefix:"QWEN",consoleUrl:"https://bailian.console.aliyun.com",docs:{cn:"https://help.aliyun.com/zh/model-studio/token-plan-personal-quick-start",intl:"https://www.alibabacloud.com/help/en/model-studio/token-plan-personal-quick-start",apiKey:"https://help.aliyun.com/zh/model-studio/token-plan-personal-quick-start",models:"https://help.aliyun.com/zh/model-studio/models"}},stepfun:{name:"阶跃星辰 StepFun",nameEn:"StepFun",baseUrl:"https://api.stepfun.com/step_plan/v1",model:"step-5-preview",envPrefix:"STEPFUN",consoleUrl:"https://platform.stepfun.com",docs:{cn:"https://platform.stepfun.com/docs/zh/guides/developer/openai",intl:"https://platform.stepfun.ai/docs/en/guides/developer/openai",apiKey:"https://platform.stepfun.com/docs/zh/guides/developer/openai",models:"https://platform.stepfun.com/docs/zh/guides/models/list"}},volcengine:{name:"火山引擎 豆包",nameEn:"Volcengine Doubao",baseUrl:"https://ark.cn-beijing.volces.com/api/v3",model:"doubao-seed-evolving",envPrefix:"VOLCENGINE",consoleUrl:"https://console.volcengine.com/ark",docs:{cn:"https://www.volcengine.com/docs/82379/1330626",intl:"https://docs.byteplus.com/en/docs/ModelArk/1330626",apiKey:"https://www.volcengine.com/docs/82379/1541594",models:"https://www.volcengine.com/docs/82379/1330310"}},"volcengine-agent":{name:"火山引擎 Agent Plan",nameEn:"Volcengine Agent Plan",baseUrl:"https://ark.cn-beijing.volces.com/api/plan/v3",model:"doubao-seed-evolving",envPrefix:"VOLCENGINE_AGENT",consoleUrl:"https://console.volcengine.com/ark",docs:{cn:"https://ark.volcengine.com/region:cn-beijing/docs/82379/2160841?lang=zh",apiKey:"https://ark.volcengine.com/region:cn-beijing/docs/82379/2160841?lang=zh",models:"https://www.volcengine.com/docs/82379/2366394"}},"volcengine-coding":{name:"火山引擎 Coding Plan",nameEn:"Volcengine Coding Plan",baseUrl:"https://ark.cn-beijing.volces.com/api/coding/v3",model:"doubao-seed-evolving",envPrefix:"VOLCENGINE_CODING",consoleUrl:"https://console.volcengine.com/ark",docs:{cn:"https://www.volcengine.com/docs/82379/1928261",apiKey:"https://www.volcengine.com/docs/82379/1928261",models:"https://www.volcengine.com/docs/82379/1928261"}},"volcengine-free":{name:"火山引擎(免费试用)",nameEn:"Volcengine (free trial)",baseUrl:"https://ark.cn-beijing.volces.com/api/v3",model:"doubao-seed-evolving",envPrefix:"VOLCENGINE_FREE",consoleUrl:"https://console.volcengine.com/ark",docs:{cn:"https://www.volcengine.com/docs/82379/1399514",apiKey:"https://www.volcengine.com/docs/82379/1541594",models:"https://www.volcengine.com/docs/82379/1330310"}}},u=Object.keys(d);e.s(["$",0,d,"U",0,u,"z",0,function(e,t){let n=d[e];return"zh"===t?n.name:n.nameEn},"j",0,function(e){return"string"==typeof e&&Object.prototype.hasOwnProperty.call(d,e)},"k",0,function(e,t){let n=d[e];return{apiKey:t?.apiKey||"",baseUrl:t?.baseUrl||n.baseUrl,model:t?.model||n.model}}],128093);let p=new Set;function f(e){p.forEach(t=>t(e))}function m(e){return"object"==typeof e&&null!==e&&"code"in e&&"AI_CONSENT_REQUIRED"===e.code}let h={gemini:{zh:"Google Gemini",en:"Google Gemini"},openai:{zh:"OpenAI 或管理员填写的兼容接口",en:"OpenAI or an OpenAI-compatible endpoint set by the administrator"},azure:{zh:"Microsoft Azure OpenAI",en:"Microsoft Azure OpenAI"},anthropic:{zh:"Anthropic Claude",en:"Anthropic Claude"},"minimax-code":{zh:"MiniMax",en:"MiniMax"}};e.s(["K",0,function(e,t){if(!e)return null;let n=h[e];if(n)return n[t];if(!(e in d))return null;let o=d[e];return"en"===t?o.nameEn:o.name},"O",0,m,"L",0,function(e){return"en"===e?"https://wrong-notebook.margrop.net/en/privacy/":"https://wrong-notebook.margrop.net/privacy/"},"u",0,f,"y",0,function(e){return p.add(e),()=>{p.delete(e)}}],923512);class g extends Error{status;statusText;data;constructor(e,t,n){super(`API Error: ${e} ${t}`),this.status=e,this.statusText=t,this.data=n,this.name="ApiError"}}function v(e){if("object"!=typeof e||null===e||!("code"in e)||!(0,l.j)(e.code))return;let t=l.i[e.code],n="zh";try{"en"===localStorage.getItem("app-language")&&(n="en")}catch{}c.warning(t[n])}function b(){let e=new Uint8Array(16);return crypto.getRandomValues(e),Array.from(e,e=>e.toString(16).padStart(2,"0")).join("")}let y=e=>new Promise(t=>setTimeout(t,e));async function w(e,t,n){let o=Date.now();for(;Date.now()<t;){let t=null;try{t=await k(`/api/requests/${e}`,{method:"GET",timeout:15e3})}catch(e){if(e instanceof g&&404===e.status&&Date.now()-o>6e3)throw n}if(t?.state==="done"){if(t.status>=200&&t.status<300)return t.body??{};throw 429===t.status&&v(t.body),403===t.status&&m(t.body)&&f("blocked"),new g(t.status,"",t.body)}await y(3e3)}throw new g(408,"Request Timeout",{message:"AI_TIMEOUT_ERROR"})}async function k(e,t={}){let{params:n,headers:o,timeout:r=6e4,recoverable:i,requestId:a,...s}=t,c=i?a??b():null,l=Date.now(),d=e;if(n){let e=new URLSearchParams(n);d+=`?${e.toString()}`}let u=new AbortController,p=setTimeout(()=>u.abort(),r);try{let e=await fetch(d,{headers:{"Content-Type":"application/json",...c?{"X-Request-Id":c}:{},...o},signal:u.signal,...s});if(clearTimeout(p),!e.ok){let t,n=await e.text();try{t=JSON.parse(n)}catch{t=n}throw 429===e.status&&v(t),403===e.status&&m(t)&&f("blocked"),new g(e.status,e.statusText,t)}if(204===e.status)return{};try{return await e.json()}catch{return{}}}catch(e){if(clearTimeout(p),e instanceof Error&&"AbortError"===e.name)throw new g(408,"Request Timeout",{message:"AI_TIMEOUT_ERROR"});if(c&&e instanceof TypeError)return w(c,l+r,e);throw e}}e.s(["a",0,g,"k",0,{get:(e,t)=>k(e,{...t,method:"GET"}),post:(e,t,n)=>k(e,{...n,method:"POST",body:JSON.stringify(t)}),postRaw:(e,t,n)=>k(e,{...n,method:"POST",body:t}),put:(e,t,n)=>k(e,{...n,method:"PUT",body:JSON.stringify(t)}),patch:(e,t,n)=>k(e,{...n,method:"PATCH",body:JSON.stringify(t)}),delete:(e,t)=>k(e,{...t,method:"DELETE"})},"j",0,b,"u",0,w],41931)},637691,e=>{e.s(["f",0,"https://github.com/margrop/wrong-notebook"])},132411,954846,e=>{let t,n,o,r,i,a,s,c,l;var d=e.i(271645),u=e.i(41931);let p=globalThis,f=p.__backgroundTaskStore??=(t=[],n=new Set,o=!1,r=null,i=null,a=(e=!0)=>r||(e&&"u">typeof document&&"hidden"===document.visibilityState?Promise.resolve():r=(async()=>{try{for(let e of(t=(await u.k.get("/api/tasks")).tasks,n))e(t);s()}catch{}finally{r=null}})()),s=()=>{i&&clearInterval(i),i=setInterval(()=>void a(),t.some(e=>"running"===e.status)?3e3:15e3)},c=()=>{!o&&(o=!0,a().then(s).catch(()=>void 0),"u">typeof document&&document.addEventListener("visibilitychange",l))},l=()=>{"visible"===document.visibilityState&&a().then(s).catch(()=>void 0)},{getSnapshot:()=>t,refresh:async()=>{c(),await a(!1),s()},subscribe:e=>(n.add(e),c(),()=>{n.delete(e)})});e.s(["f",0,f],954846),e.s(["f",0,function(e){let[t,n]=(0,d.useState)(()=>f.getSnapshot());return(0,d.useEffect)(()=>{if(e)return f.subscribe(n)},[e]),{running:e?t.find(t=>"running"===t.status&&t.target===e)??null:null,refresh:()=>f.refresh()}}],132411)},905110,e=>{let t=["new","reviewing","mastered"];e.s(["z",0,50,"o",0,100,"P",0,1,"m",0,function(e,t=50){return"number"==typeof e&&e>=t/100},"A",0,function(e){return"string"==typeof e&&t.includes(e)}])},983761,81968,e=>{function t(){return window.WrongNotebookAndroid??null}e.s(["f",0,t],81968);let n="/api/telemetry";function o(e){try{let t=JSON.stringify(e);if("u">typeof navigator&&"function"==typeof navigator.sendBeacon&&navigator.sendBeacon(n,new Blob([t],{type:"text/plain;charset=UTF-8"})))return;"function"==typeof fetch&&fetch(n,{method:"POST",headers:{"Content-Type":"application/json"},body:t,keepalive:!0,credentials:"same-origin"}).catch(()=>void 0)}catch{}}function r(e){try{let t="wn-telemetry:"+e;if(sessionStorage.getItem(t))return!1;sessionStorage.setItem(t,"1")}catch{}return!0}function i(e,t){o({t:"event",name:e,...t?{payload:t}:{}})}let a=!1;e.s(["E",0,r,"J",0,function(){r("app_opened")&&i("app_opened",{client:function(){if(t())return"android";if(/Electron\//.test(navigator.userAgent))return"desktop";try{if(window.matchMedia?.("(display-mode: standalone)").matches)return"pwa"}catch{}return"browser"}()})},"P",0,function(e){if(!a){a=!0;try{let t=e.error instanceof Error?e.error:null,n=t?.name||"Error",i=t?.message??("string"==typeof e.error?e.error:String(e.error??"")),a=t?.stack??"",s=a.split("\n").find(e=>/^\s*at |@/.test(e))??i;if(!r(`error:${function(e){let t=5381;for(let n=0;n<e.length;n++)t=(t<<5)+t+e.charCodeAt(n)|0;return(t>>>0).toString(36)}([e.kind,e.scope,n,s].join("|"))}`))return;o({t:"error",kind:e.kind,scope:e.scope,name:n.slice(0,200),message:i.slice(0,2e3),stack:a.slice(0,8e3),path:"u">typeof location?location.pathname:void 0,userAgent:"u">typeof navigator?navigator.userAgent.slice(0,500):void 0})}catch{}finally{a=!1}}},"z",0,i],983761)}],618566,(e,t,n)=>{t.exports=e.r(976562)}]);
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
(()=>{"use strict";(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,314381,3198,e=>{var t=e.i(456420);let s={name:"box",size:24,node:[["path",{d:"M21 8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73l7 4a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16Z",key:"hh9hay"}],["path",{d:"m3.3 7 8.7 5 8.7-5",key:"g66t2b"}],["path",{d:"M12 22V12",key:"d0xqtd"}]]};s.node;let r=(0,t.f)(s);e.s(["f",0,r],314381);var a=e.i(843476),i=e.i(271645),n=e.i(632781);let l={name:"maximize-2",size:24,node:[["path",{d:"M15 3h6v6",key:"1q9fwt"}],["path",{d:"m21 3-7 7",key:"1l2asr"}],["path",{d:"m3 21 7-7",key:"tjx5ai"}],["path",{d:"M9 21H3v-6",key:"wtvkvv"}]]};l.node;let o=(0,t.f)(l),d={name:"minimize-2",size:24,node:[["path",{d:"m14 10 7-7",key:"oa77jy"}],["path",{d:"M20 10h-6V4",key:"mjg0md"}],["path",{d:"m3 21 7-7",key:"tjx5ai"}],["path",{d:"M4 14h6v6",key:"rmj7iw"}]]};d.node;let c=(0,t.f)(d);var u=e.i(395925),m=e.i(741120),f=e.i(759659),h=e.i(519455),x=e.i(111110),g=e.i(294114),p=e.i(201276),v=e.i(113381);let j=null;function y(e,t,s){let r=e?.firstElementChild;r&&(r.style.width="100%",r.style.height=`${s}px`,t?.setSize(e?.offsetWidth||r.offsetWidth||800,s))}function b(e,t){let s=(0,v.L)(e,t);for(let e of s)p.V.warn("[GGB]","命令执行失败",{...e});return s.map(e=>e.command+":"+e.message).join("\n")||void 0}e.s(["f",0,function({commands:e,height:t=700,showToolBar:s=!1,showAlgebraInput:r=!1,showMenuBar:l=!1,className:d="",onRegenerate:w,onDelete:k}){let{t:N}=(0,x.b)(),S=(0,i.useRef)(null),_=(0,i.useRef)(null),T=(0,i.useRef)(void 0),A=(0,i.useId)(),E=(0,i.useRef)(`ggb-${A.replace(/[^a-zA-Z0-9_-]/g,"")}`),[I,C]=(0,i.useState)(!0),[R,V]=(0,i.useState)(null),[z,O]=(0,i.useState)(!0),[M,$]=(0,i.useState)(!1),[L,P]=(0,i.useState)(!1),G=(0,i.useMemo)(()=>(0,v.i)(e),[e]);(0,i.useEffect)(()=>{if(0===G.length)return;let e=!1,a=E.current,i=S.current;return(j||(j=new Promise((e,t)=>{if(window.GGBApplet)return void e();let s=document.createElement("script");s.src="https://www.geogebra.org/apps/deployggb.js",s.async=!0,s.onload=()=>e(),s.onerror=()=>{j=null,t(Error("Failed to load GeoGebra"))},document.head.appendChild(s)}))).then(()=>{if(e)return;let n=window.GGBApplet;if(!n){V(N.geogebra.notLoaded),C(!1);return}if(i){i.innerHTML=`<div id="${a}" style="width:100%;height:${t}px"></div>`;try{new n({appName:"classic",width:"100%",height:t,showToolBar:s,showAlgebraInput:r,showMenuBar:l,showResetIcon:!0,enableRightClick:!0,enableShiftDragZoom:!0,language:"zh",appletOnLoad:s=>{e||(_.current=s,y(i,s,t),T.current=b(s,G),C(!1))}},!0).inject(a)}catch(t){p.V.error("[GGB]","Init failed",{error:t}),e||(V(N.geogebra.initFailed),C(!1))}}}).catch(t=>{p.V.error("[GGB]","Script load failed",{error:t}),e||(V(N.geogebra.scriptFailed),C(!1))}),()=>{e=!0;try{let e=_.current;e?.remove&&e.remove()}catch(e){p.V.warn("[GGB]","Cleanup failed",{error:e})}_.current=null,i&&(i.innerHTML="")}},[G,s,r,l]),(0,i.useEffect)(()=>{y(S.current,_.current,z?700:t)},[z,t]);let q=(0,i.useCallback)(()=>{let e=_.current;if(e)try{e.resetConstruction(),setTimeout(()=>{_.current&&(T.current=b(_.current,G))},300)}catch(e){p.V.warn("[GGB]","Reset failed",{error:e})}},[G]),F=(0,i.useCallback)(async()=>{if(w&&!M){$(!0);try{await w(T.current)}finally{$(!1)}}},[w,M]),U=(0,i.useCallback)(async()=>{if(k&&!L&&await (0,g.u)(N.geogebra.confirmDelete,{destructive:!0})){P(!0);try{await k()}catch{g.c.error(N.geogebra.deleteFailed)}finally{P(!1)}}},[k,L,N]);return 0===G.length?null:(0,a.jsxs)("div",{className:`relative rounded-lg border bg-card ${d}`,children:[(0,a.jsxs)("div",{className:"flex items-center justify-between px-3 py-2 border-b bg-muted/30",children:[(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsx)("span",{className:"text-xs font-medium text-muted-foreground",children:N.geogebra.title}),I&&(0,a.jsx)(n.f,{className:"h-3 w-3 animate-spin text-muted-foreground"})]}),(0,a.jsxs)("div",{className:"flex items-center gap-1",children:[w&&(0,a.jsxs)(h.f,{variant:"ghost",size:"sm",className:"h-7 px-2 text-xs gap-1",onClick:F,title:N.geogebra.regenerate,disabled:M||I,children:[M?(0,a.jsx)(n.f,{className:"h-3.5 w-3.5 animate-spin"}):(0,a.jsx)(m.f,{className:"h-3.5 w-3.5"}),(0,a.jsx)("span",{children:N.geogebra.regenerate})]}),k&&(0,a.jsxs)(h.f,{variant:"ghost",size:"sm",className:"h-7 px-2 text-xs gap-1 text-destructive hover:text-destructive",onClick:U,title:N.geogebra.delete,disabled:L||M,children:[L?(0,a.jsx)(n.f,{className:"h-3.5 w-3.5 animate-spin"}):(0,a.jsx)(f.f,{className:"h-3.5 w-3.5"}),(0,a.jsx)("span",{children:N.geogebra.delete})]}),(0,a.jsx)(h.f,{variant:"ghost",size:"sm",className:"h-7 w-7 p-0",onClick:q,title:N.geogebra.reset,disabled:I,children:(0,a.jsx)(u.f,{className:"h-3.5 w-3.5"})}),(0,a.jsx)(h.f,{variant:"ghost",size:"sm",className:"h-7 w-7 p-0",onClick:()=>O(e=>!e),title:z?N.geogebra.shrink:N.geogebra.enlarge,children:z?(0,a.jsx)(c,{className:"h-3.5 w-3.5"}):(0,a.jsx)(o,{className:"h-3.5 w-3.5"})})]})]}),(0,a.jsx)("div",{ref:S,style:{width:"100%"}}),I&&(0,a.jsx)("div",{className:"absolute inset-0 z-10 flex items-center justify-center bg-background/80 rounded-b-lg",style:{top:37},children:(0,a.jsxs)("div",{className:"flex flex-col items-center gap-2",children:[(0,a.jsx)(n.f,{className:"h-6 w-6 animate-spin text-primary"}),(0,a.jsx)("span",{className:"text-sm text-muted-foreground",children:N.geogebra.loading})]})}),R&&(0,a.jsx)("div",{className:"flex items-center justify-center text-sm text-destructive",style:{minHeight:t},children:R})]})}],3198)},615568,168148,e=>{var t=e.i(456420);let s={name:"pencil-line",size:24,node:[["path",{d:"M13 21h8",key:"1jsn5i"}],["path",{d:"m15 5 4 4",key:"1mk7zo"}],["path",{d:"M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z",key:"1a8usu"}]]};s.node;let r=(0,t.f)(s);e.s(["f",0,r],615568);var a=e.i(843476),i=e.i(271645),n=e.i(30030),l=e.i(248425),o=Object.defineProperty,d=(e,t)=>o(e,"name",{value:t,configurable:!0}),c="Progress",[u,m]=(0,n.f)(c),[f,h]=u(c),x=i.forwardRef(d(function(e,t){let{__scopeProgress:s,value:r=null,max:i,getValueLabel:n=p,...o}=e;(i||0===i)&&!y(i)&&console.error(w(`${i}`,"Progress"));let d=y(i)?i:100;null===r||b(r,d)||console.error(k(`${r}`,"Progress"));let c=b(r,d)?r:null,u=j(c)?n(c,d):void 0;return(0,a.jsx)(f,{scope:s,value:c,max:d,children:(0,a.jsx)(l.V.div,{"aria-valuemax":d,"aria-valuemin":0,"aria-valuenow":j(c)?c:void 0,"aria-valuetext":u,role:"progressbar","data-state":v(c,d),"data-value":c??void 0,"data-max":d,...o,ref:t})})},"Progress")),g=i.forwardRef(d(function(e,t){let{__scopeProgress:s,...r}=e,i=h("ProgressIndicator",s);return(0,a.jsx)(l.V.div,{"data-state":v(i.value,i.max),"data-value":i.value??void 0,"data-max":i.max,...r,ref:t})},"ProgressIndicator"));function p(e,t){return`${Math.round(e/t*100)}%`}function v(e,t){return null==e?"indeterminate":e===t?"complete":"loading"}function j(e){return"number"==typeof e}function y(e){return j(e)&&!isNaN(e)&&e>0}function b(e,t){return j(e)&&!isNaN(e)&&e<=t&&e>=0}function w(e,t){return`Invalid prop \`max\` of value \`${e}\` supplied to \`${t}\`. Only numbers greater than 0 are valid max values. Defaulting to \`100\`.`}function k(e,t){return`Invalid prop \`value\` of value \`${e}\` supplied to \`${t}\`. The \`value\` prop must be:
|
|
2
|
+
- a positive number
|
|
3
|
+
- less than the value passed to \`max\` (or 100 if no \`max\` prop is set)
|
|
4
|
+
- \`null\` or \`undefined\` if the progress is indeterminate.
|
|
5
|
+
|
|
6
|
+
Defaulting to \`null\`.`}d(p,"defaultGetValueLabel"),d(v,"getProgressState"),d(j,"isNumber"),d(y,"isValidMaxNumber"),d(b,"isValidValueNumber"),d(w,"getInvalidMaxError"),d(k,"getInvalidValueError");var N=e.i(975157);let S=i.forwardRef(({className:e,value:t,...s},r)=>(0,a.jsx)(x,{ref:r,value:t,className:(0,N.f)("relative h-4 w-full overflow-hidden rounded-full bg-secondary",e),...s,children:(0,a.jsx)(g,{className:"h-full w-full flex-1 bg-primary transition-all",style:{transform:`translateX(-${100-(t||0)}%)`}})}));S.displayName=x.displayName,e.s(["f",0,S],168148)},856522,e=>{var t=e.i(456420);let s={name:"save",size:24,node:[["path",{d:"M15.2 3a2 2 0 0 1 1.4.6l3.8 3.8a2 2 0 0 1 .6 1.4V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2z",key:"1c8476"}],["path",{d:"M17 21v-7a1 1 0 0 0-1-1H8a1 1 0 0 0-1 1v7",key:"1ydtos"}],["path",{d:"M7 3v4a1 1 0 0 0 1 1h7",key:"t51u73"}]]};s.node;let r=(0,t.f)(s);e.s(["f",0,r],856522)},786563,e=>{var t=e.i(456420);let s={name:"star",size:24,node:[["path",{d:"M11.525 2.295a.53.53 0 0 1 .95 0l2.31 4.679a2.123 2.123 0 0 0 1.595 1.16l5.166.756a.53.53 0 0 1 .294.904l-3.736 3.638a2.123 2.123 0 0 0-.611 1.878l.882 5.14a.53.53 0 0 1-.771.56l-4.618-2.428a2.122 2.122 0 0 0-1.973 0L6.396 21.01a.53.53 0 0 1-.77-.56l.881-5.139a2.122 2.122 0 0 0-.611-1.879L2.16 9.795a.53.53 0 0 1 .294-.906l5.165-.755a2.122 2.122 0 0 0 1.597-1.16z",key:"r04s7s"}]]};s.node;let r=(0,t.f)(s);e.s(["f",0,r],786563)},866531,497346,183444,e=>{var t=e.i(843476),s=e.i(271645),r=e.i(632781),a=e.i(741120),i=e.i(856522),n=e.i(314381),l=e.i(3198),o=e.i(519455),d=e.i(111110),c=e.i(41931),u=e.i(294114),m=e.i(201276);function f({data:e,onChange:a}){let{t:i}=(0,d.b)(),[h,x]=(0,s.useState)(!1),[g,p]=(0,s.useState)(null),v=async()=>{if(!e.questionText.trim())return void u.c.warning(i.editor.enterQuestionFirst||"Please enter question text first");if(!e.answerText.trim())return void u.c.warning(i.geogebra.answerRequired);x(!0),p(null);try{let t=await c.k.post("/api/geogebra-analyze",{questionText:e.questionText,answerText:e.answerText,analysis:e.analysis},{timeout:18e4,recoverable:!0});t.suitable&&t.commands&&t.commands.length>0?a({geogebraCommands:JSON.stringify(t.commands)}):p(t.description||i.geogebra.notSuitable)}catch(e){m.V.error("[CorrectionEditor]","GeoGebra analysis failed",{error:e}),p(i.geogebra.analyzeFailed)}finally{x(!1)}};return e.geogebraCommands?(0,t.jsx)(l.f,{commands:e.geogebraCommands,height:350,onRegenerate:v,onDelete:async()=>a({geogebraCommands:void 0})}):e.questionText.trim()&&e.answerText.trim()?(0,t.jsxs)("div",{className:"rounded-lg border border-dashed p-4",children:[(0,t.jsxs)("div",{className:"flex items-center justify-between",children:[(0,t.jsxs)("div",{className:"flex items-center gap-2 text-sm text-muted-foreground",children:[(0,t.jsx)(n.f,{className:"h-4 w-4"}),(0,t.jsx)("span",{children:i.geogebra.title})]}),(0,t.jsx)(o.f,{variant:"outline",size:"sm",onClick:v,disabled:h,children:h?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(r.f,{className:"mr-2 h-4 w-4 animate-spin"}),i.geogebra.analyzing]}):(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(n.f,{className:"mr-2 h-4 w-4"}),i.geogebra.generate]})})]}),g&&(0,t.jsx)("p",{className:"text-xs text-muted-foreground mt-2",children:g}),(0,t.jsx)("p",{className:"text-xs text-muted-foreground mt-2",children:i.geogebra.hint})]}):null}var h=e.i(469937),x=e.i(28342),g=e.i(793479),p=e.i(438465),v=e.i(674166),j=e.i(110204),y=e.i(967489),b=e.i(401280);function w({data:e,paperLevel:s,onChange:r}){let{t:a}=(0,d.b)();return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsx)(j.f,{children:a.editor.selectNotebook||"Select Notebook"}),(0,t.jsx)(p.f,{value:e.subjectId,onChange:e=>r({subjectId:e})})]}),(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsx)(j.f,{htmlFor:"correction-source",children:a.editor.source||"Source"}),(0,t.jsx)(g.f,{id:"correction-source",value:e.source??"",onChange:e=>r({source:e.target.value||null}),placeholder:a.editor.sourcePlaceholder||"e.g. Midterm exam"})]}),(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsx)(j.f,{children:a.questionType.label||"Question Type"}),(0,t.jsxs)(y.d,{value:e.questionType||"",onValueChange:e=>r({questionType:e===b.O?null:e}),children:[(0,t.jsx)(y.P,{children:(0,t.jsx)(y.U,{placeholder:a.questionType.notSet||"Not set"})}),(0,t.jsxs)(y.r,{children:[(0,t.jsx)(y.T,{value:b.O,children:a.questionType.clear||"Clear"}),b.V.map(e=>(0,t.jsx)(y.T,{value:e,children:a.questionType.names?.[e]||e},e))]})]})]}),(0,t.jsxs)("div",{className:"grid grid-cols-2 gap-4",children:[(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsx)(j.f,{htmlFor:"correction-grade-semester",children:a.editor.gradeSemester||"Grade/Semester"}),(0,t.jsx)(x.f,{id:"correction-grade-semester",value:e.gradeSemester||"",onChange:e=>r({gradeSemester:e})})]}),(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsx)(j.f,{children:a.editor.paperLevel||"Paper Level"}),(0,t.jsx)(v.f,{value:s,onChange:e=>r({paperLevel:e})})]})]}),(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsx)(j.f,{children:a.difficulty.label}),(0,t.jsx)("div",{children:(0,t.jsx)(h.f,{size:"md",value:e.difficultyStars,onChange:e=>r({difficultyStars:e})})})]})]})}var k=e.i(141176),N=e.i(515288);function S({data:e,onChange:s}){let{t:r}=(0,d.b)();return(0,t.jsxs)(N.N,{children:[(0,t.jsx)(N.Y,{children:(0,t.jsx)(N.v,{children:r.editor.mistakeAnalysisTitle||"Mistake Analysis"})}),(0,t.jsxs)(N.O,{className:"space-y-4",children:[(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsx)(j.f,{children:r.editor.mistakeStatus||"Attempt Status"}),(0,t.jsxs)(y.d,{value:e.mistakeStatus||"unknown",onValueChange:e=>s({mistakeStatus:e}),children:[(0,t.jsx)(y.P,{children:(0,t.jsx)(y.U,{})}),(0,t.jsxs)(y.r,{children:[(0,t.jsx)(y.T,{value:"not_attempted",children:r.editor.mistakeStatuses?.notAttempted||"Not attempted"}),(0,t.jsx)(y.T,{value:"wrong_attempt",children:r.editor.mistakeStatuses?.wrongAttempt||"Wrong attempt"}),(0,t.jsx)(y.T,{value:"unknown",children:r.editor.mistakeStatuses?.unknown||"Unknown"})]})]})]}),(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsx)(j.f,{children:r.editor.wrongAnswerText||"Wrong Answer / Work"}),(0,t.jsx)(k.f,{value:e.wrongAnswerText||"",onChange:t=>s({wrongAnswerText:t,mistakeStatus:t.trim()?"wrong_attempt":e.mistakeStatus}),className:"min-h-[100px] font-mono text-sm",placeholder:r.editor.wrongAnswerPlaceholder||"Leave blank if no wrong answer is visible"})]}),(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsx)(j.f,{children:r.editor.mistakeAnalysis||"Mistake Cause Analysis"}),(0,t.jsx)(k.f,{value:e.mistakeAnalysis||"",onChange:e=>s({mistakeAnalysis:e}),className:"min-h-[140px] font-mono text-sm",placeholder:r.editor.mistakeAnalysisPlaceholder||"Explain where and why the mistake happened"})]})]})]})}var _=e.i(511445),T=e.i(149704);function A({title:e,children:s,className:r}){return(0,t.jsxs)(N.N,{children:[(0,t.jsx)(N.Y,{children:(0,t.jsx)(N.v,{children:e})}),(0,t.jsx)(N.O,{className:r,children:s})]})}function E({data:e,children:s}){let{t:r}=(0,d.b)(),a={wrong_attempt:r.editor.mistakeStatuses?.wrongAttempt||"Wrong attempt",not_attempted:r.editor.mistakeStatuses?.notAttempted||"Not attempted",unknown:r.editor.mistakeStatuses?.unknown||"Unknown"};return(0,t.jsxs)("div",{className:"space-y-6",children:[(0,t.jsxs)(A,{title:r.editor.preview?.question||"Question Preview",children:[(0,t.jsx)(_.f,{content:e.questionText}),(0,t.jsx)(T.f,{svg:e.figureSvg})]}),s,(0,t.jsx)(A,{title:r.editor.preview?.answer||"Answer Preview",children:(0,t.jsx)(_.f,{content:e.answerText})}),(0,t.jsx)(A,{title:r.editor.preview?.analysis||"Analysis Preview",children:(0,t.jsx)(_.f,{content:e.analysis})}),(0,t.jsxs)(A,{title:r.editor.preview?.mistakeAnalysis||"Mistake Analysis Preview",className:"space-y-3 text-sm",children:[(0,t.jsxs)("div",{className:"text-muted-foreground",children:[r.editor.mistakeStatus||"Attempt Status",r.common.colon,a[e.mistakeStatus]??a.unknown]}),e.wrongAnswerText&&(0,t.jsxs)("div",{children:[(0,t.jsx)("div",{className:"font-medium mb-1",children:r.editor.wrongAnswerText||"Wrong Answer / Work"}),(0,t.jsx)(_.f,{content:e.wrongAnswerText})]}),e.mistakeAnalysis&&(0,t.jsxs)("div",{children:[(0,t.jsx)("div",{className:"font-medium mb-1",children:r.editor.mistakeAnalysis||"Mistake Cause Analysis"}),(0,t.jsx)(_.f,{content:e.mistakeAnalysis})]})]})]})}var I=e.i(574041),C=e.i(215519),R=e.i(306831);e.i(676167);var V=e.i(597138),z=e.i(991722),O=e.i(470279),M=e.i(303163);e.s(["f",0,function({initialData:e,onSave:n,onCancel:l,imagePreview:h,initialSubjectId:x,aiTimeout:g}){let{timeZone:p}=(0,C.M)(),{t:v,language:y}=(0,d.b)(),b=e=>e.trim()?e:"",[_,T]=(0,s.useState)({...e,answerText:b(e.answerText),analysis:b(e.analysis),wrongAnswerText:e.wrongAnswerText||"",mistakeAnalysis:e.mistakeAnalysis||"",mistakeStatus:e.mistakeStatus||"unknown",subjectId:x,gradeSemester:e.gradeSemester||""}),A=(0,s.useRef)(!1),$=e=>{"gradeSemester"in e&&(A.current=!0),T(t=>({...t,...e}))},{groups:L}=(0,O.f)(),P=(()=>{if(_.paperLevel)return _.paperLevel;let e="number"==typeof _.difficultyStars&&_.difficultyStars>=4?"b":"a";return L.find(t=>t.key===e&&t.isActive)?.id||""})(),G=_.paperLevel??P,[q,F]=(0,s.useState)(!1),[U,H]=(0,s.useState)(!1),[D,Q]=(0,s.useState)(!1),[B,W]=(0,s.useState)(void 0),[Z,J]=(0,s.useState)([]);(0,s.useEffect)(()=>{c.k.get("/api/notebooks").then(J).catch(e=>m.V.error("[CorrectionEditor]","Failed to fetch notebooks",{error:e})),c.k.get("/api/user").then(e=>{if(Q(!!e?.enableGeogebra),e){let t=function(e,t=R.J){return"ai"===e.gradeRecognitionMode?null:e.fixedGradeSemester?e.fixedGradeSemester:e.educationStage&&e.enrollmentYear?function(e,t,s=new Date,r="en",a=R.J){let i=(0,R.c)(s,a),n=i.getFullYear(),l=i.getMonth()+1,o=n-t,d="2nd";l>=9?(o+=1,d="1st"):d=l<2?"1st":"2nd";let c="zh"===r,u=c?"1st"===d?"上期":"下期":"1st"===d?"1st Semester":"2nd Semester",m=(c?{primary:["一年级","二年级","三年级","四年级","五年级","六年级"],junior_high:["初一","初二","初三"],senior_high:["高一","高二","高三"],university:["大一","大二","大三","大四"]}:{primary:["Grade 1","Grade 2","Grade 3","Grade 4","Grade 5","Grade 6"],junior_high:["Junior High Grade 1","Junior High Grade 2","Junior High Grade 3"],senior_high:["Senior High Grade 1","Senior High Grade 2","Senior High Grade 3"],university:["Freshman","Sophomore","Junior","Senior"]})[e]||[],f=`${o}`;if(f=o>0&&o<=m.length?m[o-1]:o>m.length?c?"已毕业":"Graduated":c?"学前":"Pre-school",!c)return`${f}, ${u}`;{let e="1st"===d?"上":"下";return`${f}${e}`}}(e.educationStage,e.enrollmentYear,new Date,"zh",t):null}(e,p);T(e=>e.gradeSemester||A.current?e:{...e,gradeSemester:t||""}),W(e.educationStage||void 0)}}).catch(e=>m.V.error("[CorrectionEditor]","Failed to fetch user info for grade calculation",{error:e}))},[y,p]);let Y=async()=>{if(!_.questionText.trim())return void u.c.warning(v.editor.enterQuestionFirst||"Please enter question text first");F(!0);try{let e=function({questionText:e,language:t,subject:s,imagePreview:r,gradeSemester:a,subjectId:i}){let n={questionText:e,language:t,subject:s};return r&&(n.imageBase64=r),a&&(n.gradeSemester=a),i&&(n.subjectId=i),n}({questionText:_.questionText,language:y,subject:_.subject,imagePreview:h,gradeSemester:_.gradeSemester??void 0,subjectId:_.subjectId});m.V.info("[Reanswer]",e.imageBase64?"Sending image + text (image available for mistake analysis)":"Sending text only (no image available)",{timeout:g});let t=await c.k.post("/api/reanswer",e,{timeout:g||18e4,recoverable:!0});T(e=>({...e,answerText:t.answerText,analysis:t.analysis,knowledgePoints:t.knowledgePoints,wrongAnswerText:t.wrongAnswerText||"",mistakeAnalysis:t.mistakeAnalysis||"",mistakeStatus:(0,z.x)(t.mistakeStatus,t.wrongAnswerText),difficultyStars:t.difficultyStars??e.difficultyStars,questionType:t.questionType??e.questionType})),u.c.success(v.editor.reanswerSuccess||"✅ Answer and analysis updated!")}catch(r){let e,t,s;m.V.error("[CorrectionEditor]","Reanswer failed",{error:r}),u.c.error((e=(0,M.d)(r)||"",s=(t=v.errors?.reanswer||{}).default||"Reanswer failed",e.includes("AI_AUTH_ERROR")?t.authError||v.errors?.AI_AUTH_ERROR||s:e.includes("AI_CONNECTION_FAILED")?t.connectionFailed||v.errors?.AI_CONNECTION_FAILED||s:e.includes("AI_RESPONSE_ERROR")&&(t.responseError||v.errors?.AI_RESPONSE_ERROR)||s))}finally{F(!1)}},K=async()=>{if(!_.subjectId)return void u.c.warning(v.editor.messages?.selectNotebook||"Please select a notebook");if(!U){H(!0);try{await n({..._,paperLevel:G,mistakeStatus:(0,z.x)(_.mistakeStatus,_.wrongAnswerText)})}finally{H(!1)}}},X=v.editor.placeholder||"Supports Markdown and LaTeX...",ee=(0,V.f)(Z.find(e=>e.id===_.subjectId)?.name||null)||(0,V.f)(_.subject||null)||void 0;return(0,t.jsxs)("div",{className:"space-y-6",children:[(0,t.jsxs)("div",{className:"flex items-center justify-between",children:[(0,t.jsx)("h2",{className:"text-2xl font-bold",children:v.editor.title}),(0,t.jsxs)("div",{className:"flex gap-2",children:[(0,t.jsx)(o.f,{variant:"outline",onClick:l,children:v.editor.cancel}),(0,t.jsxs)(o.f,{onClick:K,disabled:U,children:[U?(0,t.jsx)(r.f,{className:"mr-2 h-4 w-4 animate-spin"}):(0,t.jsx)(i.f,{className:"mr-2 h-4 w-4"}),U?v.common?.pleaseWait||"Please wait...":v.editor.save]})]})]}),(0,t.jsxs)("div",{className:"grid gap-6 lg:grid-cols-2",children:[(0,t.jsxs)("div",{className:"space-y-6",children:[h&&(0,t.jsx)(N.N,{children:(0,t.jsx)(N.O,{className:"p-4",children:(0,t.jsx)("img",{src:h,alt:"Original",className:"w-full rounded-md"})})}),(0,t.jsx)(w,{data:_,paperLevel:G,onChange:$}),(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsx)(j.f,{children:v.editor.question}),(0,t.jsx)(k.f,{value:_.questionText,onChange:e=>$({questionText:e}),className:"min-h-[150px] font-mono text-sm",placeholder:X}),(0,t.jsx)(o.f,{variant:"default",size:"sm",onClick:Y,disabled:q||!_.questionText.trim(),className:"w-full bg-gradient-to-r from-indigo-600 to-violet-500 hover:from-indigo-700 hover:to-violet-600 text-white font-medium",children:q?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(r.f,{className:"mr-2 h-4 w-4 animate-spin"}),v.editor.reanswering||"AI solving..."]}):(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(a.f,{className:"mr-2 h-4 w-4"}),v.editor.reanswer||"🔄 Reanswer (based on corrected question)"]})}),(0,t.jsx)("p",{className:"text-xs text-muted-foreground",children:v.editor.reanswerHint||"💡 If the question was misrecognized, correct it and click to regenerate answer"})]}),(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsx)(j.f,{children:v.editor.tags}),(0,t.jsx)(I.f,{value:_.knowledgePoints,onChange:e=>$({knowledgePoints:e}),placeholder:v.editor.tagsPlaceholder||"Enter knowledge tags...",enterHint:v.editor.createTagHint,subject:ee,gradeStage:B}),(0,t.jsx)("p",{className:"text-xs text-muted-foreground",children:v.editor.tagsHint||"💡 Tag suggestions will appear as you type"})]}),(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsx)(j.f,{children:v.editor.answer}),(0,t.jsx)(k.f,{value:_.answerText,onChange:e=>$({answerText:e}),className:"min-h-[100px] font-mono text-sm",placeholder:X})]}),(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsx)(j.f,{children:v.editor.analysis}),(0,t.jsx)(k.f,{value:_.analysis,onChange:e=>$({analysis:e}),className:"min-h-[200px] font-mono text-sm",placeholder:X})]}),(0,t.jsx)(S,{data:_,onChange:$})]}),(0,t.jsx)(E,{data:_,children:D&&(0,t.jsx)(f,{data:_,onChange:$})})]})]})}],866531);var $=e.i(853138),L=e.i(263676);e.s(["f",0,function({message:e,onDismiss:s}){let{t:r}=(0,d.b)();return e?(0,t.jsxs)("div",{role:"alert",className:"flex items-start gap-3 rounded-xl border border-destructive/30 bg-destructive/5 p-4 text-sm text-destructive",children:[(0,t.jsx)($.f,{"aria-hidden":"true",className:"mt-0.5 h-4 w-4 shrink-0"}),(0,t.jsx)("p",{className:"min-w-0 flex-1 whitespace-pre-line break-words leading-relaxed",children:e}),(0,t.jsx)("button",{type:"button",onClick:s,"aria-label":r.common.close,className:"shrink-0 rounded p-1 hover:bg-destructive/10",children:(0,t.jsx)(L.X,{"aria-hidden":"true",className:"h-4 w-4"})})]}):null}],497346);var P=e.i(618566),G=e.i(707212);function q(e){return"object"!=typeof e||null===e||Array.isArray(e)?void 0:e}function F(e,t){if("string"!=typeof e||!/^(QUESTION_SAVE_|AI_)[A-Z_]+$/.test(e))return;let s=t.errors[e];return"string"==typeof s?s:void 0}e.s(["f",0,function(e){let{t}=(0,d.b)(),r=(0,P.useRouter)(),[a,i]=(0,s.useState)(null),n=async(s,a,n=!0)=>{i(null);try{let e=await s();return u.c.success(e.duplicate?t.importFlow.duplicate:t.common.messages.saveSuccess),n&&(e.duplicate?r.push(`/error-items/${e.id}`):a&&r.push(`/notebooks/${a}`)),!0}catch(r){m.V.error(e,"Save failed",{errorMessage:(0,M.d)(r)??(0,M.Z)(r)});let s=function(e,t){let s=q(e),r=q(s?.data),a="number"==typeof s?.status?s.status:void 0,i=(0,M.d)(e),n=F(i,t)??F(r?.code,t),l={400:t.errors.QUESTION_SAVE_INVALID_INPUT,401:t.errors.QUESTION_SAVE_UNAUTHORIZED,403:t.errors.QUESTION_SAVE_FORBIDDEN,408:t.errors.QUESTION_SAVE_TIMEOUT,409:t.errors.QUESTION_SAVE_CONFLICT,413:t.errors.QUESTION_SAVE_TOO_LARGE,429:t.errors.QUESTION_SAVE_RATE_LIMITED,502:t.errors.QUESTION_SAVE_SERVER_UNAVAILABLE,503:t.errors.QUESTION_SAVE_SERVER_UNAVAILABLE,504:t.errors.QUESTION_SAVE_TIMEOUT},o=n??(a?l[a]:void 0)??t.errors.QUESTION_SAVE_FAILED;!a&&(e instanceof TypeError||/fetch|network|load failed/i.test((0,M.Z)(e)))&&(o=t.errors.QUESTION_SAVE_NETWORK_ERROR);let d=q(r?.details);if("QUESTION_SAVE_GRADE_FAILED"===i){let e=F(d?.reason,t);e&&(o+=`
|
|
7
|
+
${e}`)}return 400===a&&(o+=(function(e,t){if(!Array.isArray(e))return[];let s={questionText:t.editor.question,answerText:t.editor.answer,analysis:t.editor.analysis,wrongAnswerText:t.editor.wrongAnswerText,mistakeAnalysis:t.editor.mistakeAnalysis,knowledgePoints:t.editor.tags,subjectId:t.editor.selectNotebook,gradeSemester:t.editor.gradeSemester,paperLevel:t.editor.paperLevel};return e.slice(0,3).flatMap(e=>{let r=q(e),a=r?.path,i=Array.isArray(a)&&"string"==typeof a[0]?s[a[0]]:void 0;if(!i)return[];let n=r?.maximum,l=t.questionSave.invalidField;return r?.code==="too_big"&&"number"==typeof n&&Number.isSafeInteger(n)&&n>=0&&(l="array"===r.origin?t.questionSave.tooMany:t.questionSave.tooLong),[l.replace("{field}",i).replace("{maximum}",String(n))]})})(r?.details,t).map(e=>`
|
|
8
|
+
${e}`).join("")),"string"==typeof d?.databaseCode&&/^P\d{4}$/.test(d.databaseCode)&&(o+=`
|
|
9
|
+
${t.questionSave.databaseCode.replace("{code}",d.databaseCode)}`),a&&(o+=` (HTTP ${a})`),o}(r,t);return i(s),(0,G.t)((0,M.d)(r))||u.c.error(s),!1}};return{saveError:a,setSaveError:i,dismissSaveError:()=>i(null),run:n}}],183444)},469937,e=>{var t=e.i(843476),s=e.i(786563),r=e.i(111110),a=e.i(975157);let i=[1,2,3,4,5];e.s(["f",0,function({value:e,onChange:n,disabled:l,size:o="sm",showUnrated:d=!0,className:c}){let{t:u}=(0,r.b)(),m=e??0,f="sm"===o?"h-3.5 w-3.5":"h-5 w-5",h=m?u.difficulty.starsLabel.replace("{n}",String(m)):u.difficulty.unrated;return n?(0,t.jsxs)("span",{className:(0,a.f)("inline-flex items-center gap-0.5",c),role:"group","aria-label":`${u.difficulty.label}${u.common.colon}${h}`,title:u.difficulty.clearHint,children:[i.map(e=>(0,t.jsx)("button",{type:"button",disabled:l,onClick:()=>n(e===m?null:e),"aria-label":u.difficulty.setStars.replace("{n}",String(e)),"aria-pressed":e<=m,className:"rounded p-0.5 hover:bg-muted disabled:opacity-50 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring",children:(0,t.jsx)(s.f,{className:(0,a.f)(f,e<=m?"fill-amber-400 text-amber-400":"text-muted-foreground/40")})},e)),!m&&d&&(0,t.jsx)("span",{className:"ml-1 text-xs text-muted-foreground",children:u.difficulty.unrated})]}):m?(0,t.jsx)("span",{className:(0,a.f)("inline-flex items-center",c),role:"img","aria-label":`${u.difficulty.label}${u.common.colon}${h}`,title:h,children:i.map(e=>(0,t.jsx)(s.f,{className:(0,a.f)(f,e<=m?"fill-amber-400 text-amber-400":"text-muted-foreground/30"),"aria-hidden":!0},e))}):d?(0,t.jsx)("span",{className:(0,a.f)("text-xs text-muted-foreground",c),children:u.difficulty.unrated}):null}])},731335,532377,339501,e=>{var t=e.i(843476),s=e.i(399847),r=e.i(551757),a=e.i(456420);let i={name:"clock-3",size:24,node:[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 6v6h4",key:"135r8i"}]]};i.node;let n=(0,a.f)(i);var l=e.i(632781),o=e.i(615568),d=e.i(487486),c=e.i(519455),u=e.i(168148),m=e.i(111110),f=e.i(215519),h=e.i(306831);let x=["read","convert","crop","compress","upload"],g=["receive","analyze","save"];function p(e){if(!Number.isFinite(e)||e<0)return"-";if(e<1e3)return`${Math.round(e)}ms`;let t=e/1e3;if(t<60)return`${t.toFixed(+(t<10))}s`;let s=Math.round(t);return`${Math.floor(s/60)}:${String(s%60).padStart(2,"0")}`}var v=e.i(975157);let j={analyzing:50,saving:90},y={analyzing:l.f,saving:l.f,review:o.f,saved:r.f,failed:s.f};e.s(["f",0,function({task:e,now:s,onReview:r,onViewItem:a,onRetry:i,onDiscard:l}){let{t:o}=(0,m.b)(),{timeZone:b}=(0,f.M)(),w=y[e.status],k="analyzing"===e.status||"saving"===e.status,N=o.errors,S=e.error?"string"==typeof N[e.error]?N[e.error]:e.error:null,_=function(e){let t=[];for(let s of x){let r=e?.client?.[s];"number"==typeof r&&t.push({stage:s,ms:r})}for(let s of g){let r=e?.server?.[s];"number"==typeof r&&t.push({stage:s,ms:r})}return t}(e.timings),T=k&&s?s-Date.parse(e.createdAt):null;return(0,t.jsxs)("div",{className:(0,v.f)("space-y-2 rounded-lg border p-3 text-sm",e.unread&&"border-primary/50 bg-primary/5"),"data-testid":"import-task-card","data-status":e.status,children:[(0,t.jsxs)("div",{className:"flex items-start gap-2",children:[(0,t.jsx)(w,{className:(0,v.f)("mt-0.5 h-4 w-4 shrink-0",k&&"animate-spin text-primary","saved"===e.status&&"text-green-600","failed"===e.status&&"text-destructive","review"===e.status&&"text-primary")}),(0,t.jsxs)("div",{className:"min-w-0 flex-1 space-y-1",children:[(0,t.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[(0,t.jsx)("span",{className:"font-medium",children:o.importTasks.status[e.status]}),(0,t.jsx)("span",{className:"text-xs text-muted-foreground",children:o.importTasks.mode[e.mode]}),e.unread&&(0,t.jsx)(d.f,{children:o.importTasks.unread})]}),k&&(0,t.jsx)(u.f,{value:j[e.status],"aria-label":o.importTasks.stageEstimate,"aria-valuetext":o.common.progress.estimated.replace("{percent}",String(j[e.status])),className:"h-1.5"}),e.excerpt&&(0,t.jsx)("p",{className:"break-words text-muted-foreground",children:e.excerpt}),"saved"===e.status&&!e.errorItemId&&(0,t.jsx)("p",{className:"text-xs text-muted-foreground",children:o.importTasks.itemDeleted}),"saved"===e.status&&e.errorItemId&&(0,t.jsx)("p",{className:"text-xs text-green-700 dark:text-green-300",children:e.duplicate?o.importTasks.duplicateSaved:o.importTasks.savedTo.replace("{notebook}",e.notebookName||"-").replace("{id}",e.errorItemShortId||"-")}),S&&(0,t.jsx)("p",{className:"text-xs text-destructive",children:S}),(0,t.jsxs)("div",{className:"flex flex-wrap items-center gap-x-3 gap-y-1 text-xs text-muted-foreground",children:[(0,t.jsxs)("span",{className:"flex items-center gap-1",children:[(0,t.jsx)(n,{className:"h-3 w-3"}),o.importTasks.createdAt.replace("{time}",(0,h.r)(e.createdAt,"MM-dd HH:mm",b))]}),null!==T&&(0,t.jsx)("span",{children:o.importTasks.elapsed.replace("{time}",p(T))}),e.attempts>1&&(0,t.jsx)("span",{children:o.importTasks.attempts.replace("{count}",String(e.attempts))})]}),_.length>0&&(0,t.jsx)("ul",{className:"flex flex-wrap gap-x-3 gap-y-1 text-xs text-muted-foreground tabular-nums","aria-label":"timings",children:_.map(({stage:e,ms:s})=>(0,t.jsxs)("li",{children:[o.importTasks.timings[e]," ",p(s)]},e))})]})]}),(0,t.jsxs)("div",{className:"flex flex-wrap justify-end gap-2",children:["review"===e.status&&r&&(0,t.jsx)(c.f,{size:"sm",onClick:r,children:o.importTasks.continueReview}),"saved"===e.status&&e.errorItemId&&a&&(0,t.jsx)(c.f,{size:"sm",variant:"outline",onClick:a,children:o.importTasks.viewItem}),"failed"===e.status&&i&&(0,t.jsx)(c.f,{size:"sm",onClick:i,children:o.importTasks.retry}),"saving"!==e.status&&"saved"!==e.status&&l&&(0,t.jsx)(c.f,{size:"sm",variant:"ghost",onClick:l,children:o.importTasks.discard})]})]})}],731335);var b=e.i(618566),w=e.i(767077),k=e.i(294114),N=e.i(201276),S=e.i(127175);e.s(["f",0,function(e){let{t}=(0,m.b)(),s=(0,b.useRouter)(),r=e=>{e.unread&&(0,S.N)(e.id).catch(e=>N.V.warn("[ImportTasks]","Mark read failed",{error:e}))};return{openReview:e=>{r(e),s.push(`/import-tasks/${e.id}`)},viewItem:e=>{e.errorItemId&&(r(e),s.push(`/error-items/${e.errorItemId}`))},markRead:r,retry:async s=>{try{await (0,S.R)(s.id),k.c.info(t.importTasks.retried)}catch(e){k.c.error((0,w.f)(e,t))}e?.()},discard:async s=>{if(!await (0,k.u)(t.importTasks.discardConfirm))return!1;let r=!1;try{await (0,S.x)(s.id),k.c.success(t.importTasks.discarded),r=!0}catch(e){k.c.error((0,w.f)(e,t))}return e?.(),r}}}],532377);var _=e.i(271645);e.s(["f",0,function(e,t=1e3){let[s,r]=(0,_.useState)(()=>Date.now());return(0,_.useEffect)(()=>{if(!e)return;let s=setInterval(()=>r(Date.now()),t);return()=>clearInterval(s)},[e,t]),s}],339501)},141176,e=>{var t=e.i(843476),s=e.i(271645),r=e.i(456420);let a={name:"code-xml",size:24,node:[["path",{d:"m18 16 4-4-4-4",key:"1inbqp"}],["path",{d:"m6 8-4 4 4 4",key:"15zrgr"}],["path",{d:"m14.5 4-5 16",key:"e7oirm"}]],aliases:["code-2"]};a.node;let i=(0,r.f)(a);var n=e.i(772382),l=e.i(511445),o=e.i(624687),d=e.i(111110),c=e.i(975157);e.s(["f",0,function({value:e,onChange:r,className:a,...u}){let{t:m}=(0,d.b)(),[f,h]=(0,s.useState)("source"),x=(0,s.useId)(),g=[{mode:"source",label:m.markdownEditor.source,icon:i},{mode:"preview",label:m.markdownEditor.preview,icon:n.f}];return(0,t.jsxs)("div",{className:"space-y-1.5",children:[(0,t.jsx)("div",{role:"tablist","aria-label":m.markdownEditor.modeLabel,className:"flex justify-end",children:(0,t.jsx)("div",{className:"inline-flex rounded-md border bg-muted/40 p-0.5",children:g.map(({mode:e,label:s,icon:r})=>(0,t.jsxs)("button",{type:"button",role:"tab","aria-selected":f===e,"aria-controls":x,onClick:()=>h(e),className:(0,c.f)("flex items-center gap-1 rounded px-2.5 py-1 text-xs transition-colors",f===e?"bg-background font-medium shadow-sm":"text-muted-foreground hover:text-foreground"),children:[(0,t.jsx)(r,{className:"h-3.5 w-3.5"}),s]},e))})}),(0,t.jsx)("div",{id:x,role:"tabpanel",children:"source"===f?(0,t.jsx)(o.f,{value:e,onChange:e=>r(e.target.value),className:a,...u}):(0,t.jsx)("div",{className:"min-h-24 cursor-text rounded-md border bg-muted/20 px-3 py-2",onDoubleClick:()=>h("source"),title:m.markdownEditor.doubleClickToEdit,children:e.trim()?(0,t.jsx)(l.f,{content:e}):(0,t.jsx)("p",{className:"text-sm italic text-muted-foreground",children:m.markdownEditor.empty})})})]})}],141176)},438465,e=>{var t=e.i(843476),s=e.i(271645),r=e.i(967489),a=e.i(856423),i=e.i(41931),n=e.i(201276),l=e.i(111110);e.s(["f",0,function({value:e,onChange:o,className:d}){let[c,u]=(0,s.useState)([]),{t:m}=(0,l.b)();return(0,s.useEffect)(()=>{(async()=>{try{let e=await i.k.get("/api/notebooks");u(e)}catch(e){n.V.error("[NotebookSelector]","Failed to fetch notebooks",{error:e})}})()},[]),(0,t.jsxs)(r.d,{value:e,onValueChange:o,children:[(0,t.jsx)(r.P,{className:d,children:(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)(a.f,{className:"h-4 w-4 text-muted-foreground"}),(0,t.jsx)(r.U,{placeholder:m.notebooks?.selector?.placeholder||"Select Notebook"})]})}),(0,t.jsx)(r.r,{children:0===c.length?(0,t.jsx)("div",{className:"p-2 text-sm text-muted-foreground text-center",children:m.notebooks?.selector?.empty||"No notebooks available"}):c.map(e=>(0,t.jsx)(r.T,{value:e.id,children:e.name},e.id))})]})}])},674166,e=>{var t=e.i(843476),s=e.i(967489),r=e.i(470279);e.s(["f",0,function({value:e,onChange:a,disabled:i}){let{groups:n,loading:l}=(0,r.f)(),o=n.filter(e=>e.isActive);return(0,t.jsxs)(s.d,{value:e,onValueChange:a,disabled:i||l,children:[(0,t.jsx)(s.P,{children:(0,t.jsx)(s.U,{placeholder:"选择卷别"})}),(0,t.jsx)(s.r,{children:o.map(e=>(0,t.jsx)(s.T,{value:e.id,children:e.name},e.id))})]})}])},149704,e=>{var t=e.i(843476),s=e.i(111110),r=e.i(398019),a=e.i(184110),i=e.i(975157);let n={left:"mr-auto",center:"mx-auto",right:"ml-auto"};e.s(["f",0,function({svg:e,scale:l,align:o,className:d}){let{t:c}=(0,s.b)();if(!e)return null;let u=(0,a.V)(l),m=(0,a.o)(o);return(0,t.jsx)("figure",{className:(0,i.f)("question-figure my-3",d),children:(0,t.jsx)("img",{src:(0,r.d)(e),alt:c.figure.alt,className:(0,i.f)(n[m],"block h-auto max-w-full rounded border bg-white p-2"),style:{..."left"===m?{marginLeft:0,marginRight:"auto"}:"right"===m?{marginLeft:"auto",marginRight:0}:{},maxHeight:360,zoom:u/100,maxWidth:`${Math.min(u,100)}%`}})})}])},184110,e=>{let t=["left","center","right"],s="center";function r(e){return"number"==typeof e&&Number.isInteger(e)&&e>=10&&e<=200}e.s(["E",0,s,"n",0,100,"j",0,t,"a",0,200,"_",0,10,"x",0,r,"o",0,function(e){return"string"==typeof e&&t.includes(e)?e:s},"V",0,function(e){return r(e)?e:100}])},398019,e=>{e.s(["K",0,1e5,"d",0,function(e){return`data:image/svg+xml;charset=utf-8,${encodeURIComponent(e)}`}])},767077,e=>{var t=e.i(303163);e.s(["f",0,function(e,s){let r=s.common?.messages?.analysisFailed||"Analysis failed, please try again",a=(0,t.d)(e);if(a){let e=s.errors??{};if(!(a in e))return a;let t=e[a];return"string"==typeof t?t:r}let i=(0,t.Z)(e);if(i.includes("fetch")||i.includes("network"))return s.errors?.AI_CONNECTION_FAILED||"网络连接失败";if("object"==typeof e&&null!==e&&"data"in e&&"string"==typeof e.data){let t="status"in e&&"number"==typeof e.status?e.status:"Error";return`${r} (${t})`}return r}])},991722,e=>{function t(e){return"not_attempted"===e||"wrong_attempt"===e||"unknown"===e?e:"unknown"}e.s(["i",0,function(e,s="zh"){return("en"===s?{not_attempted:"Not attempted",wrong_attempt:"Wrong attempt",unknown:"Unknown"}:{not_attempted:"不会做",wrong_attempt:"做错了",unknown:"未判断"})[t(e)]},"h",0,t,"x",0,function(e,s){return(s||"").trim()?"wrong_attempt":t(e)}])},401280,e=>{let t={single_choice:"single_choice",singlechoice:"single_choice","single choice":"single_choice","single-choice":"single_choice",multiple_choice:"multiple_choice",multiplechoice:"multiple_choice","multiple choice":"multiple_choice","multiple-choice":"multiple_choice",multichoice:"multiple_choice","multi choice":"multiple_choice",true_false:"true_false",truefalse:"true_false","true/false":"true_false","true false":"true_false","true-false":"true_false","true / false":"true_false",fill_blank:"fill_blank",fillblank:"fill_blank","fill in the blank":"fill_blank","fill-in-the-blank":"fill_blank",fillintheblank:"fill_blank",calculation:"calculation",solution:"solution",reading:"reading",cloze:"cloze",writing:"writing",other:"other",选择题:"single_choice",单项选择:"single_choice",单选:"single_choice",单选题:"single_choice",不定项:"multiple_choice",不定项选择:"multiple_choice",多项选择:"multiple_choice",多选:"multiple_choice",多选题:"multiple_choice",判断:"true_false",判断题:"true_false",是非:"true_false",是非题:"true_false",填空:"fill_blank",填空题:"fill_blank",口算:"calculation",计算:"calculation",计算题:"calculation",解答:"solution",解答题:"solution",应用:"solution",应用题:"solution",证明:"solution",证明题:"solution",简答:"solution",简答题:"solution",阅读:"reading",阅读理解:"reading",完形:"cloze",完形填空:"cloze",作文:"writing",写作:"writing",书面表达:"writing",其他:"other"};e.s(["O",0,"__none__","V",0,["single_choice","multiple_choice","true_false","fill_blank","calculation","solution","reading","cloze","writing","other"],"u",0,{single_choice:"Single Choice",multiple_choice:"Multiple Choice",true_false:"True / False",fill_blank:"Fill in the Blank",calculation:"Calculation",solution:"Solution",reading:"Reading Comprehension",cloze:"Cloze",writing:"Writing",other:"Other"},"H",0,{single_choice:"单选题",multiple_choice:"多选题",true_false:"判断题",fill_blank:"填空题",calculation:"计算题",solution:"解答题",reading:"阅读理解",cloze:"完形填空",writing:"写作",other:"其他"},"P",0,function(e){if("string"!=typeof e)return null;let s=e.trim().toLowerCase();return s?t[s]??null:null}])},597138,e=>{e.i(306831),e.s(["f",0,function(e){if(!e)return null;let t=e.toLowerCase();return t.includes("math")||t.includes("数学")?"math":t.includes("science")||t.includes("科学")?"science":t.includes("physics")||t.includes("物理")?"physics":t.includes("chemistry")||t.includes("化学")?"chemistry":t.includes("biology")||t.includes("生物")?"biology":t.includes("english")||t.includes("英语")?"english":t.includes("chinese")||t.includes("语文")?"chinese":t.includes("history")||t.includes("历史")?"history":t.includes("geography")||t.includes("地理")?"geography":t.includes("politics")||t.includes("政治")?"politics":null}])}])})();
|
|
@@ -6,4 +6,4 @@
|
|
|
6
6
|
Defaulting to \`null\`.`}d(p,"defaultGetValueLabel"),d(v,"getProgressState"),d(j,"isNumber"),d(y,"isValidMaxNumber"),d(w,"isValidValueNumber"),d(b,"getInvalidMaxError"),d(N,"getInvalidValueError");var k=e.i(975157);let S=i.forwardRef(({className:e,value:t,...s},r)=>(0,a.jsx)(h,{ref:r,value:t,className:(0,k.f)("relative h-4 w-full overflow-hidden rounded-full bg-secondary",e),...s,children:(0,a.jsx)(g,{className:"h-full w-full flex-1 bg-primary transition-all",style:{transform:`translateX(-${100-(t||0)}%)`}})}));S.displayName=h.displayName,e.s(["f",0,S],168148)},856522,e=>{var t=e.i(456420);let s={name:"save",size:24,node:[["path",{d:"M15.2 3a2 2 0 0 1 1.4.6l3.8 3.8a2 2 0 0 1 .6 1.4V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2z",key:"1c8476"}],["path",{d:"M17 21v-7a1 1 0 0 0-1-1H8a1 1 0 0 0-1 1v7",key:"1ydtos"}],["path",{d:"M7 3v4a1 1 0 0 0 1 1h7",key:"t51u73"}]]};s.node;let r=(0,t.f)(s);e.s(["f",0,r],856522)},786563,e=>{var t=e.i(456420);let s={name:"star",size:24,node:[["path",{d:"M11.525 2.295a.53.53 0 0 1 .95 0l2.31 4.679a2.123 2.123 0 0 0 1.595 1.16l5.166.756a.53.53 0 0 1 .294.904l-3.736 3.638a2.123 2.123 0 0 0-.611 1.878l.882 5.14a.53.53 0 0 1-.771.56l-4.618-2.428a2.122 2.122 0 0 0-1.973 0L6.396 21.01a.53.53 0 0 1-.77-.56l.881-5.139a2.122 2.122 0 0 0-.611-1.879L2.16 9.795a.53.53 0 0 1 .294-.906l5.165-.755a2.122 2.122 0 0 0 1.597-1.16z",key:"r04s7s"}]]};s.node;let r=(0,t.f)(s);e.s(["f",0,r],786563)},866531,497346,183444,e=>{var t=e.i(843476),s=e.i(271645),r=e.i(632781),a=e.i(741120),i=e.i(856522),n=e.i(314381),l=e.i(3198),o=e.i(519455),d=e.i(111110),c=e.i(41931),u=e.i(294114),m=e.i(201276);function f({data:e,onChange:a}){let{t:i}=(0,d.b)(),[x,h]=(0,s.useState)(!1),[g,p]=(0,s.useState)(null),v=async()=>{if(!e.questionText.trim())return void u.c.warning(i.editor.enterQuestionFirst||"Please enter question text first");if(!e.answerText.trim())return void u.c.warning(i.geogebra.answerRequired);h(!0),p(null);try{let t=await c.k.post("/api/geogebra-analyze",{questionText:e.questionText,answerText:e.answerText,analysis:e.analysis},{timeout:18e4,recoverable:!0});t.suitable&&t.commands&&t.commands.length>0?a({geogebraCommands:JSON.stringify(t.commands)}):p(t.description||i.geogebra.notSuitable)}catch(e){m.V.error("[CorrectionEditor]","GeoGebra analysis failed",{error:e}),p(i.geogebra.analyzeFailed)}finally{h(!1)}};return e.geogebraCommands?(0,t.jsx)(l.f,{commands:e.geogebraCommands,height:350,onRegenerate:v,onDelete:async()=>a({geogebraCommands:void 0})}):e.questionText.trim()&&e.answerText.trim()?(0,t.jsxs)("div",{className:"rounded-lg border border-dashed p-4",children:[(0,t.jsxs)("div",{className:"flex items-center justify-between",children:[(0,t.jsxs)("div",{className:"flex items-center gap-2 text-sm text-muted-foreground",children:[(0,t.jsx)(n.f,{className:"h-4 w-4"}),(0,t.jsx)("span",{children:i.geogebra.title})]}),(0,t.jsx)(o.f,{variant:"outline",size:"sm",onClick:v,disabled:x,children:x?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(r.f,{className:"mr-2 h-4 w-4 animate-spin"}),i.geogebra.analyzing]}):(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(n.f,{className:"mr-2 h-4 w-4"}),i.geogebra.generate]})})]}),g&&(0,t.jsx)("p",{className:"text-xs text-muted-foreground mt-2",children:g}),(0,t.jsx)("p",{className:"text-xs text-muted-foreground mt-2",children:i.geogebra.hint})]}):null}var x=e.i(469937),h=e.i(28342),g=e.i(793479),p=e.i(438465),v=e.i(674166),j=e.i(110204),y=e.i(967489),w=e.i(401280);function b({data:e,paperLevel:s,onChange:r}){let{t:a}=(0,d.b)();return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsx)(j.f,{children:a.editor.selectNotebook||"Select Notebook"}),(0,t.jsx)(p.f,{value:e.subjectId,onChange:e=>r({subjectId:e})})]}),(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsx)(j.f,{htmlFor:"correction-source",children:a.editor.source||"Source"}),(0,t.jsx)(g.f,{id:"correction-source",value:e.source??"",onChange:e=>r({source:e.target.value||null}),placeholder:a.editor.sourcePlaceholder||"e.g. Midterm exam"})]}),(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsx)(j.f,{children:a.questionType.label||"Question Type"}),(0,t.jsxs)(y.d,{value:e.questionType||"",onValueChange:e=>r({questionType:e===w.O?null:e}),children:[(0,t.jsx)(y.P,{children:(0,t.jsx)(y.U,{placeholder:a.questionType.notSet||"Not set"})}),(0,t.jsxs)(y.r,{children:[(0,t.jsx)(y.T,{value:w.O,children:a.questionType.clear||"Clear"}),w.V.map(e=>(0,t.jsx)(y.T,{value:e,children:a.questionType.names?.[e]||e},e))]})]})]}),(0,t.jsxs)("div",{className:"grid grid-cols-2 gap-4",children:[(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsx)(j.f,{htmlFor:"correction-grade-semester",children:a.editor.gradeSemester||"Grade/Semester"}),(0,t.jsx)(h.f,{id:"correction-grade-semester",value:e.gradeSemester||"",onChange:e=>r({gradeSemester:e})})]}),(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsx)(j.f,{children:a.editor.paperLevel||"Paper Level"}),(0,t.jsx)(v.f,{value:s,onChange:e=>r({paperLevel:e})})]})]}),(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsx)(j.f,{children:a.difficulty.label}),(0,t.jsx)("div",{children:(0,t.jsx)(x.f,{size:"md",value:e.difficultyStars,onChange:e=>r({difficultyStars:e})})})]})]})}var N=e.i(141176),k=e.i(515288);function S({data:e,onChange:s}){let{t:r}=(0,d.b)();return(0,t.jsxs)(k.N,{children:[(0,t.jsx)(k.Y,{children:(0,t.jsx)(k.v,{children:r.editor.mistakeAnalysisTitle||"Mistake Analysis"})}),(0,t.jsxs)(k.O,{className:"space-y-4",children:[(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsx)(j.f,{children:r.editor.mistakeStatus||"Attempt Status"}),(0,t.jsxs)(y.d,{value:e.mistakeStatus||"unknown",onValueChange:e=>s({mistakeStatus:e}),children:[(0,t.jsx)(y.P,{children:(0,t.jsx)(y.U,{})}),(0,t.jsxs)(y.r,{children:[(0,t.jsx)(y.T,{value:"not_attempted",children:r.editor.mistakeStatuses?.notAttempted||"Not attempted"}),(0,t.jsx)(y.T,{value:"wrong_attempt",children:r.editor.mistakeStatuses?.wrongAttempt||"Wrong attempt"}),(0,t.jsx)(y.T,{value:"unknown",children:r.editor.mistakeStatuses?.unknown||"Unknown"})]})]})]}),(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsx)(j.f,{children:r.editor.wrongAnswerText||"Wrong Answer / Work"}),(0,t.jsx)(N.f,{value:e.wrongAnswerText||"",onChange:t=>s({wrongAnswerText:t,mistakeStatus:t.trim()?"wrong_attempt":e.mistakeStatus}),className:"min-h-[100px] font-mono text-sm",placeholder:r.editor.wrongAnswerPlaceholder||"Leave blank if no wrong answer is visible"})]}),(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsx)(j.f,{children:r.editor.mistakeAnalysis||"Mistake Cause Analysis"}),(0,t.jsx)(N.f,{value:e.mistakeAnalysis||"",onChange:e=>s({mistakeAnalysis:e}),className:"min-h-[140px] font-mono text-sm",placeholder:r.editor.mistakeAnalysisPlaceholder||"Explain where and why the mistake happened"})]})]})]})}var T=e.i(511445),A=e.i(149704);function E({title:e,children:s,className:r}){return(0,t.jsxs)(k.N,{children:[(0,t.jsx)(k.Y,{children:(0,t.jsx)(k.v,{children:e})}),(0,t.jsx)(k.O,{className:r,children:s})]})}function I({data:e,children:s}){let{t:r}=(0,d.b)(),a={wrong_attempt:r.editor.mistakeStatuses?.wrongAttempt||"Wrong attempt",not_attempted:r.editor.mistakeStatuses?.notAttempted||"Not attempted",unknown:r.editor.mistakeStatuses?.unknown||"Unknown"};return(0,t.jsxs)("div",{className:"space-y-6",children:[(0,t.jsxs)(E,{title:r.editor.preview?.question||"Question Preview",children:[(0,t.jsx)(T.f,{content:e.questionText}),(0,t.jsx)(A.f,{svg:e.figureSvg})]}),s,(0,t.jsx)(E,{title:r.editor.preview?.answer||"Answer Preview",children:(0,t.jsx)(T.f,{content:e.answerText})}),(0,t.jsx)(E,{title:r.editor.preview?.analysis||"Analysis Preview",children:(0,t.jsx)(T.f,{content:e.analysis})}),(0,t.jsxs)(E,{title:r.editor.preview?.mistakeAnalysis||"Mistake Analysis Preview",className:"space-y-3 text-sm",children:[(0,t.jsxs)("div",{className:"text-muted-foreground",children:[r.editor.mistakeStatus||"Attempt Status",r.common.colon,a[e.mistakeStatus]??a.unknown]}),e.wrongAnswerText&&(0,t.jsxs)("div",{children:[(0,t.jsx)("div",{className:"font-medium mb-1",children:r.editor.wrongAnswerText||"Wrong Answer / Work"}),(0,t.jsx)(T.f,{content:e.wrongAnswerText})]}),e.mistakeAnalysis&&(0,t.jsxs)("div",{children:[(0,t.jsx)("div",{className:"font-medium mb-1",children:r.editor.mistakeAnalysis||"Mistake Cause Analysis"}),(0,t.jsx)(T.f,{content:e.mistakeAnalysis})]})]})]})}var C=e.i(574041),_=e.i(215519),R=e.i(306831);e.i(676167);var V=e.i(597138),O=e.i(991722),z=e.i(470279),M=e.i(303163);e.s(["f",0,function({initialData:e,onSave:n,onCancel:l,imagePreview:x,initialSubjectId:h,aiTimeout:g}){let{timeZone:p}=(0,_.M)(),{t:v,language:y}=(0,d.b)(),w=e=>e.trim()?e:"",[T,A]=(0,s.useState)({...e,answerText:w(e.answerText),analysis:w(e.analysis),wrongAnswerText:e.wrongAnswerText||"",mistakeAnalysis:e.mistakeAnalysis||"",mistakeStatus:e.mistakeStatus||"unknown",subjectId:h,gradeSemester:e.gradeSemester||""}),E=(0,s.useRef)(!1),$=e=>{"gradeSemester"in e&&(E.current=!0),A(t=>({...t,...e}))},{groups:L}=(0,z.f)(),G=(()=>{if(T.paperLevel)return T.paperLevel;let e="number"==typeof T.difficultyStars&&T.difficultyStars>=4?"b":"a";return L.find(t=>t.key===e&&t.isActive)?.id||""})(),P=T.paperLevel??G,[q,U]=(0,s.useState)(!1),[F,H]=(0,s.useState)(!1),[D,Q]=(0,s.useState)(!1),[B,W]=(0,s.useState)(void 0),[Z,J]=(0,s.useState)([]);(0,s.useEffect)(()=>{c.k.get("/api/notebooks").then(J).catch(e=>m.V.error("[CorrectionEditor]","Failed to fetch notebooks",{error:e})),c.k.get("/api/user").then(e=>{if(Q(!!e?.enableGeogebra),e){let t=function(e,t=R.J){return"ai"===e.gradeRecognitionMode?null:e.fixedGradeSemester?e.fixedGradeSemester:e.educationStage&&e.enrollmentYear?function(e,t,s=new Date,r="en",a=R.J){let i=(0,R.c)(s,a),n=i.getFullYear(),l=i.getMonth()+1,o=n-t,d="2nd";l>=9?(o+=1,d="1st"):d=l<2?"1st":"2nd";let c="zh"===r,u=c?"1st"===d?"上期":"下期":"1st"===d?"1st Semester":"2nd Semester",m=(c?{primary:["一年级","二年级","三年级","四年级","五年级","六年级"],junior_high:["初一","初二","初三"],senior_high:["高一","高二","高三"],university:["大一","大二","大三","大四"]}:{primary:["Grade 1","Grade 2","Grade 3","Grade 4","Grade 5","Grade 6"],junior_high:["Junior High Grade 1","Junior High Grade 2","Junior High Grade 3"],senior_high:["Senior High Grade 1","Senior High Grade 2","Senior High Grade 3"],university:["Freshman","Sophomore","Junior","Senior"]})[e]||[],f=`${o}`;if(f=o>0&&o<=m.length?m[o-1]:o>m.length?c?"已毕业":"Graduated":c?"学前":"Pre-school",!c)return`${f}, ${u}`;{let e="1st"===d?"上":"下";return`${f}${e}`}}(e.educationStage,e.enrollmentYear,new Date,"zh",t):null}(e,p);A(e=>e.gradeSemester||E.current?e:{...e,gradeSemester:t||""}),W(e.educationStage||void 0)}}).catch(e=>m.V.error("[CorrectionEditor]","Failed to fetch user info for grade calculation",{error:e}))},[y,p]);let Y=async()=>{if(!T.questionText.trim())return void u.c.warning(v.editor.enterQuestionFirst||"Please enter question text first");U(!0);try{let e=function({questionText:e,language:t,subject:s,imagePreview:r,gradeSemester:a,subjectId:i}){let n={questionText:e,language:t,subject:s};return r&&(n.imageBase64=r),a&&(n.gradeSemester=a),i&&(n.subjectId=i),n}({questionText:T.questionText,language:y,subject:T.subject,imagePreview:x,gradeSemester:T.gradeSemester??void 0,subjectId:T.subjectId});m.V.info("[Reanswer]",e.imageBase64?"Sending image + text (image available for mistake analysis)":"Sending text only (no image available)",{timeout:g});let t=await c.k.post("/api/reanswer",e,{timeout:g||18e4,recoverable:!0});A(e=>({...e,answerText:t.answerText,analysis:t.analysis,knowledgePoints:t.knowledgePoints,wrongAnswerText:t.wrongAnswerText||"",mistakeAnalysis:t.mistakeAnalysis||"",mistakeStatus:(0,O.x)(t.mistakeStatus,t.wrongAnswerText),difficultyStars:t.difficultyStars??e.difficultyStars,questionType:t.questionType??e.questionType})),u.c.success(v.editor.reanswerSuccess||"✅ Answer and analysis updated!")}catch(r){let e,t,s;m.V.error("[CorrectionEditor]","Reanswer failed",{error:r}),u.c.error((e=(0,M.d)(r)||"",s=(t=v.errors?.reanswer||{}).default||"Reanswer failed",e.includes("AI_AUTH_ERROR")?t.authError||v.errors?.AI_AUTH_ERROR||s:e.includes("AI_CONNECTION_FAILED")?t.connectionFailed||v.errors?.AI_CONNECTION_FAILED||s:e.includes("AI_RESPONSE_ERROR")&&(t.responseError||v.errors?.AI_RESPONSE_ERROR)||s))}finally{U(!1)}},K=async()=>{if(!T.subjectId)return void u.c.warning(v.editor.messages?.selectNotebook||"Please select a notebook");if(!F){H(!0);try{await n({...T,paperLevel:P,mistakeStatus:(0,O.x)(T.mistakeStatus,T.wrongAnswerText)})}finally{H(!1)}}},X=v.editor.placeholder||"Supports Markdown and LaTeX...",ee=(0,V.f)(Z.find(e=>e.id===T.subjectId)?.name||null)||(0,V.f)(T.subject||null)||void 0;return(0,t.jsxs)("div",{className:"space-y-6",children:[(0,t.jsxs)("div",{className:"flex items-center justify-between",children:[(0,t.jsx)("h2",{className:"text-2xl font-bold",children:v.editor.title}),(0,t.jsxs)("div",{className:"flex gap-2",children:[(0,t.jsx)(o.f,{variant:"outline",onClick:l,children:v.editor.cancel}),(0,t.jsxs)(o.f,{onClick:K,disabled:F,children:[F?(0,t.jsx)(r.f,{className:"mr-2 h-4 w-4 animate-spin"}):(0,t.jsx)(i.f,{className:"mr-2 h-4 w-4"}),F?v.common?.pleaseWait||"Please wait...":v.editor.save]})]})]}),(0,t.jsxs)("div",{className:"grid gap-6 lg:grid-cols-2",children:[(0,t.jsxs)("div",{className:"space-y-6",children:[x&&(0,t.jsx)(k.N,{children:(0,t.jsx)(k.O,{className:"p-4",children:(0,t.jsx)("img",{src:x,alt:"Original",className:"w-full rounded-md"})})}),(0,t.jsx)(b,{data:T,paperLevel:P,onChange:$}),(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsx)(j.f,{children:v.editor.question}),(0,t.jsx)(N.f,{value:T.questionText,onChange:e=>$({questionText:e}),className:"min-h-[150px] font-mono text-sm",placeholder:X}),(0,t.jsx)(o.f,{variant:"default",size:"sm",onClick:Y,disabled:q||!T.questionText.trim(),className:"w-full bg-gradient-to-r from-indigo-600 to-violet-500 hover:from-indigo-700 hover:to-violet-600 text-white font-medium",children:q?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(r.f,{className:"mr-2 h-4 w-4 animate-spin"}),v.editor.reanswering||"AI solving..."]}):(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(a.f,{className:"mr-2 h-4 w-4"}),v.editor.reanswer||"🔄 Reanswer (based on corrected question)"]})}),(0,t.jsx)("p",{className:"text-xs text-muted-foreground",children:v.editor.reanswerHint||"💡 If the question was misrecognized, correct it and click to regenerate answer"})]}),(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsx)(j.f,{children:v.editor.tags}),(0,t.jsx)(C.f,{value:T.knowledgePoints,onChange:e=>$({knowledgePoints:e}),placeholder:v.editor.tagsPlaceholder||"Enter knowledge tags...",enterHint:v.editor.createTagHint,subject:ee,gradeStage:B}),(0,t.jsx)("p",{className:"text-xs text-muted-foreground",children:v.editor.tagsHint||"💡 Tag suggestions will appear as you type"})]}),(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsx)(j.f,{children:v.editor.answer}),(0,t.jsx)(N.f,{value:T.answerText,onChange:e=>$({answerText:e}),className:"min-h-[100px] font-mono text-sm",placeholder:X})]}),(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsx)(j.f,{children:v.editor.analysis}),(0,t.jsx)(N.f,{value:T.analysis,onChange:e=>$({analysis:e}),className:"min-h-[200px] font-mono text-sm",placeholder:X})]}),(0,t.jsx)(S,{data:T,onChange:$})]}),(0,t.jsx)(I,{data:T,children:D&&(0,t.jsx)(f,{data:T,onChange:$})})]})]})}],866531);var $=e.i(853138),L=e.i(263676);e.s(["f",0,function({message:e,onDismiss:s}){let{t:r}=(0,d.b)();return e?(0,t.jsxs)("div",{role:"alert",className:"flex items-start gap-3 rounded-xl border border-destructive/30 bg-destructive/5 p-4 text-sm text-destructive",children:[(0,t.jsx)($.f,{"aria-hidden":"true",className:"mt-0.5 h-4 w-4 shrink-0"}),(0,t.jsx)("p",{className:"min-w-0 flex-1 whitespace-pre-line break-words leading-relaxed",children:e}),(0,t.jsx)("button",{type:"button",onClick:s,"aria-label":r.common.close,className:"shrink-0 rounded p-1 hover:bg-destructive/10",children:(0,t.jsx)(L.X,{"aria-hidden":"true",className:"h-4 w-4"})})]}):null}],497346);var G=e.i(618566),P=e.i(707212);function q(e){return"object"!=typeof e||null===e||Array.isArray(e)?void 0:e}function U(e,t){if("string"!=typeof e||!/^(QUESTION_SAVE_|AI_)[A-Z_]+$/.test(e))return;let s=t.errors[e];return"string"==typeof s?s:void 0}e.s(["f",0,function(e){let{t}=(0,d.b)(),r=(0,G.useRouter)(),[a,i]=(0,s.useState)(null),n=async(s,a,n=!0)=>{i(null);try{let e=await s();return u.c.success(e.duplicate?t.importFlow.duplicate:t.common.messages.saveSuccess),n&&(e.duplicate?r.push(`/error-items/${e.id}`):a&&r.push(`/notebooks/${a}`)),!0}catch(r){m.V.error(e,"Save failed",{errorMessage:(0,M.d)(r)??(0,M.Z)(r)});let s=function(e,t){let s=q(e),r=q(s?.data),a="number"==typeof s?.status?s.status:void 0,i=(0,M.d)(e),n=U(i,t)??U(r?.code,t),l={400:t.errors.QUESTION_SAVE_INVALID_INPUT,401:t.errors.QUESTION_SAVE_UNAUTHORIZED,403:t.errors.QUESTION_SAVE_FORBIDDEN,408:t.errors.QUESTION_SAVE_TIMEOUT,409:t.errors.QUESTION_SAVE_CONFLICT,413:t.errors.QUESTION_SAVE_TOO_LARGE,429:t.errors.QUESTION_SAVE_RATE_LIMITED,502:t.errors.QUESTION_SAVE_SERVER_UNAVAILABLE,503:t.errors.QUESTION_SAVE_SERVER_UNAVAILABLE,504:t.errors.QUESTION_SAVE_TIMEOUT},o=n??(a?l[a]:void 0)??t.errors.QUESTION_SAVE_FAILED;!a&&(e instanceof TypeError||/fetch|network|load failed/i.test((0,M.Z)(e)))&&(o=t.errors.QUESTION_SAVE_NETWORK_ERROR);let d=q(r?.details);if("QUESTION_SAVE_GRADE_FAILED"===i){let e=U(d?.reason,t);e&&(o+=`
|
|
7
7
|
${e}`)}return 400===a&&(o+=(function(e,t){if(!Array.isArray(e))return[];let s={questionText:t.editor.question,answerText:t.editor.answer,analysis:t.editor.analysis,wrongAnswerText:t.editor.wrongAnswerText,mistakeAnalysis:t.editor.mistakeAnalysis,knowledgePoints:t.editor.tags,subjectId:t.editor.selectNotebook,gradeSemester:t.editor.gradeSemester,paperLevel:t.editor.paperLevel};return e.slice(0,3).flatMap(e=>{let r=q(e),a=r?.path,i=Array.isArray(a)&&"string"==typeof a[0]?s[a[0]]:void 0;if(!i)return[];let n=r?.maximum,l=t.questionSave.invalidField;return r?.code==="too_big"&&"number"==typeof n&&Number.isSafeInteger(n)&&n>=0&&(l="array"===r.origin?t.questionSave.tooMany:t.questionSave.tooLong),[l.replace("{field}",i).replace("{maximum}",String(n))]})})(r?.details,t).map(e=>`
|
|
8
8
|
${e}`).join("")),"string"==typeof d?.databaseCode&&/^P\d{4}$/.test(d.databaseCode)&&(o+=`
|
|
9
|
-
${t.questionSave.databaseCode.replace("{code}",d.databaseCode)}`),a&&(o+=` (HTTP ${a})`),o}(r,t);return i(s),(0,P.t)((0,M.d)(r))||u.c.error(s),!1}};return{saveError:a,setSaveError:i,dismissSaveError:()=>i(null),run:n}}],183444)},469937,e=>{var t=e.i(843476),s=e.i(786563),r=e.i(111110),a=e.i(975157);let i=[1,2,3,4,5];e.s(["f",0,function({value:e,onChange:n,disabled:l,size:o="sm",showUnrated:d=!0,className:c}){let{t:u}=(0,r.b)(),m=e??0,f="sm"===o?"h-3.5 w-3.5":"h-5 w-5",x=m?u.difficulty.starsLabel.replace("{n}",String(m)):u.difficulty.unrated;return n?(0,t.jsxs)("span",{className:(0,a.f)("inline-flex items-center gap-0.5",c),role:"group","aria-label":`${u.difficulty.label}${u.common.colon}${x}`,title:u.difficulty.clearHint,children:[i.map(e=>(0,t.jsx)("button",{type:"button",disabled:l,onClick:()=>n(e===m?null:e),"aria-label":u.difficulty.setStars.replace("{n}",String(e)),"aria-pressed":e<=m,className:"rounded p-0.5 hover:bg-muted disabled:opacity-50 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring",children:(0,t.jsx)(s.f,{className:(0,a.f)(f,e<=m?"fill-amber-400 text-amber-400":"text-muted-foreground/40")})},e)),!m&&d&&(0,t.jsx)("span",{className:"ml-1 text-xs text-muted-foreground",children:u.difficulty.unrated})]}):m?(0,t.jsx)("span",{className:(0,a.f)("inline-flex items-center",c),role:"img","aria-label":`${u.difficulty.label}${u.common.colon}${x}`,title:x,children:i.map(e=>(0,t.jsx)(s.f,{className:(0,a.f)(f,e<=m?"fill-amber-400 text-amber-400":"text-muted-foreground/30"),"aria-hidden":!0},e))}):d?(0,t.jsx)("span",{className:(0,a.f)("text-xs text-muted-foreground",c),children:u.difficulty.unrated}):null}])},731335,532377,339501,e=>{var t=e.i(843476),s=e.i(399847),r=e.i(551757),a=e.i(456420);let i={name:"clock-3",size:24,node:[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 6v6h4",key:"135r8i"}]]};i.node;let n=(0,a.f)(i);var l=e.i(632781),o=e.i(615568),d=e.i(487486),c=e.i(519455),u=e.i(168148),m=e.i(111110),f=e.i(215519),x=e.i(306831);let h=["read","convert","crop","compress","upload"],g=["receive","analyze","save"];function p(e){if(!Number.isFinite(e)||e<0)return"-";if(e<1e3)return`${Math.round(e)}ms`;let t=e/1e3;if(t<60)return`${t.toFixed(+(t<10))}s`;let s=Math.round(t);return`${Math.floor(s/60)}:${String(s%60).padStart(2,"0")}`}var v=e.i(975157);let j={analyzing:50,saving:90},y={analyzing:l.f,saving:l.f,review:o.f,saved:r.f,failed:s.f};e.s(["f",0,function({task:e,now:s,onReview:r,onViewItem:a,onRetry:i,onDiscard:l}){let{t:o}=(0,m.b)(),{timeZone:w}=(0,f.M)(),b=y[e.status],N="analyzing"===e.status||"saving"===e.status,k=o.errors,S=e.error?"string"==typeof k[e.error]?k[e.error]:e.error:null,T=function(e){let t=[];for(let s of h){let r=e?.client?.[s];"number"==typeof r&&t.push({stage:s,ms:r})}for(let s of g){let r=e?.server?.[s];"number"==typeof r&&t.push({stage:s,ms:r})}return t}(e.timings),A=N&&s?s-Date.parse(e.createdAt):null;return(0,t.jsxs)("div",{className:(0,v.f)("space-y-2 rounded-lg border p-3 text-sm",e.unread&&"border-primary/50 bg-primary/5"),"data-testid":"import-task-card","data-status":e.status,children:[(0,t.jsxs)("div",{className:"flex items-start gap-2",children:[(0,t.jsx)(b,{className:(0,v.f)("mt-0.5 h-4 w-4 shrink-0",N&&"animate-spin text-primary","saved"===e.status&&"text-green-600","failed"===e.status&&"text-destructive","review"===e.status&&"text-primary")}),(0,t.jsxs)("div",{className:"min-w-0 flex-1 space-y-1",children:[(0,t.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[(0,t.jsx)("span",{className:"font-medium",children:o.importTasks.status[e.status]}),(0,t.jsx)("span",{className:"text-xs text-muted-foreground",children:o.importTasks.mode[e.mode]}),e.unread&&(0,t.jsx)(d.f,{children:o.importTasks.unread})]}),N&&(0,t.jsx)(u.f,{value:j[e.status],"aria-label":o.importTasks.stageEstimate,"aria-valuetext":o.common.progress.estimated.replace("{percent}",String(j[e.status])),className:"h-1.5"}),e.excerpt&&(0,t.jsx)("p",{className:"break-words text-muted-foreground",children:e.excerpt}),"saved"===e.status&&!e.errorItemId&&(0,t.jsx)("p",{className:"text-xs text-muted-foreground",children:o.importTasks.itemDeleted}),"saved"===e.status&&e.errorItemId&&(0,t.jsx)("p",{className:"text-xs text-green-700 dark:text-green-300",children:e.duplicate?o.importTasks.duplicateSaved:o.importTasks.savedTo.replace("{notebook}",e.notebookName||"-").replace("{id}",e.errorItemShortId||"-")}),S&&(0,t.jsx)("p",{className:"text-xs text-destructive",children:S}),(0,t.jsxs)("div",{className:"flex flex-wrap items-center gap-x-3 gap-y-1 text-xs text-muted-foreground",children:[(0,t.jsxs)("span",{className:"flex items-center gap-1",children:[(0,t.jsx)(n,{className:"h-3 w-3"}),o.importTasks.createdAt.replace("{time}",(0,x.r)(e.createdAt,"MM-dd HH:mm",w))]}),null!==A&&(0,t.jsx)("span",{children:o.importTasks.elapsed.replace("{time}",p(A))}),e.attempts>1&&(0,t.jsx)("span",{children:o.importTasks.attempts.replace("{count}",String(e.attempts))})]}),T.length>0&&(0,t.jsx)("ul",{className:"flex flex-wrap gap-x-3 gap-y-1 text-xs text-muted-foreground tabular-nums","aria-label":"timings",children:T.map(({stage:e,ms:s})=>(0,t.jsxs)("li",{children:[o.importTasks.timings[e]," ",p(s)]},e))})]})]}),(0,t.jsxs)("div",{className:"flex flex-wrap justify-end gap-2",children:["review"===e.status&&r&&(0,t.jsx)(c.f,{size:"sm",onClick:r,children:o.importTasks.continueReview}),"saved"===e.status&&e.errorItemId&&a&&(0,t.jsx)(c.f,{size:"sm",variant:"outline",onClick:a,children:o.importTasks.viewItem}),"failed"===e.status&&i&&(0,t.jsx)(c.f,{size:"sm",onClick:i,children:o.importTasks.retry}),"saving"!==e.status&&"saved"!==e.status&&l&&(0,t.jsx)(c.f,{size:"sm",variant:"ghost",onClick:l,children:o.importTasks.discard})]})]})}],731335);var w=e.i(618566),b=e.i(767077),N=e.i(294114),k=e.i(201276),S=e.i(127175);e.s(["f",0,function(e){let{t}=(0,m.b)(),s=(0,w.useRouter)(),r=e=>{e.unread&&(0,S.N)(e.id).catch(e=>k.V.warn("[ImportTasks]","Mark read failed",{error:e}))};return{openReview:e=>{r(e),s.push(`/import-tasks/${e.id}`)},viewItem:e=>{e.errorItemId&&(r(e),s.push(`/error-items/${e.errorItemId}`))},markRead:r,retry:async s=>{try{await (0,S.R)(s.id),N.c.info(t.importTasks.retried)}catch(e){N.c.error((0,b.f)(e,t))}e?.()},discard:async s=>{if(!await (0,N.u)(t.importTasks.discardConfirm))return!1;let r=!1;try{await (0,S.x)(s.id),N.c.success(t.importTasks.discarded),r=!0}catch(e){N.c.error((0,b.f)(e,t))}return e?.(),r}}}],532377);var T=e.i(271645);e.s(["f",0,function(e,t=1e3){let[s,r]=(0,T.useState)(()=>Date.now());return(0,T.useEffect)(()=>{if(!e)return;let s=setInterval(()=>r(Date.now()),t);return()=>clearInterval(s)},[e,t]),s}],339501)},141176,e=>{var t=e.i(843476),s=e.i(271645),r=e.i(456420);let a={name:"code-xml",size:24,node:[["path",{d:"m18 16 4-4-4-4",key:"1inbqp"}],["path",{d:"m6 8-4 4 4 4",key:"15zrgr"}],["path",{d:"m14.5 4-5 16",key:"e7oirm"}]],aliases:["code-2"]};a.node;let i=(0,r.f)(a);var n=e.i(772382),l=e.i(511445),o=e.i(624687),d=e.i(111110),c=e.i(975157);e.s(["f",0,function({value:e,onChange:r,className:a,...u}){let{t:m}=(0,d.b)(),[f,x]=(0,s.useState)("source"),h=(0,s.useId)(),g=[{mode:"source",label:m.markdownEditor.source,icon:i},{mode:"preview",label:m.markdownEditor.preview,icon:n.f}];return(0,t.jsxs)("div",{className:"space-y-1.5",children:[(0,t.jsx)("div",{role:"tablist","aria-label":m.markdownEditor.modeLabel,className:"flex justify-end",children:(0,t.jsx)("div",{className:"inline-flex rounded-md border bg-muted/40 p-0.5",children:g.map(({mode:e,label:s,icon:r})=>(0,t.jsxs)("button",{type:"button",role:"tab","aria-selected":f===e,"aria-controls":h,onClick:()=>x(e),className:(0,c.f)("flex items-center gap-1 rounded px-2.5 py-1 text-xs transition-colors",f===e?"bg-background font-medium shadow-sm":"text-muted-foreground hover:text-foreground"),children:[(0,t.jsx)(r,{className:"h-3.5 w-3.5"}),s]},e))})}),(0,t.jsx)("div",{id:h,role:"tabpanel",children:"source"===f?(0,t.jsx)(o.f,{value:e,onChange:e=>r(e.target.value),className:a,...u}):(0,t.jsx)("div",{className:"min-h-24 cursor-text rounded-md border bg-muted/20 px-3 py-2",onDoubleClick:()=>x("source"),title:m.markdownEditor.doubleClickToEdit,children:e.trim()?(0,t.jsx)(l.f,{content:e}):(0,t.jsx)("p",{className:"text-sm italic text-muted-foreground",children:m.markdownEditor.empty})})})]})}],141176)},438465,e=>{var t=e.i(843476),s=e.i(271645),r=e.i(967489),a=e.i(856423),i=e.i(41931),n=e.i(201276),l=e.i(111110);e.s(["f",0,function({value:e,onChange:o,className:d}){let[c,u]=(0,s.useState)([]),{t:m}=(0,l.b)();return(0,s.useEffect)(()=>{(async()=>{try{let e=await i.k.get("/api/notebooks");u(e)}catch(e){n.V.error("[NotebookSelector]","Failed to fetch notebooks",{error:e})}})()},[]),(0,t.jsxs)(r.d,{value:e,onValueChange:o,children:[(0,t.jsx)(r.P,{className:d,children:(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)(a.f,{className:"h-4 w-4 text-muted-foreground"}),(0,t.jsx)(r.U,{placeholder:m.notebooks?.selector?.placeholder||"Select Notebook"})]})}),(0,t.jsx)(r.r,{children:0===c.length?(0,t.jsx)("div",{className:"p-2 text-sm text-muted-foreground text-center",children:m.notebooks?.selector?.empty||"No notebooks available"}):c.map(e=>(0,t.jsx)(r.T,{value:e.id,children:e.name},e.id))})]})}])},674166,e=>{var t=e.i(843476),s=e.i(967489),r=e.i(470279);e.s(["f",0,function({value:e,onChange:a,disabled:i}){let{groups:n,loading:l}=(0,r.f)(),o=n.filter(e=>e.isActive);return(0,t.jsxs)(s.d,{value:e,onValueChange:a,disabled:i||l,children:[(0,t.jsx)(s.P,{children:(0,t.jsx)(s.U,{placeholder:"选择卷别"})}),(0,t.jsx)(s.r,{children:o.map(e=>(0,t.jsx)(s.T,{value:e.id,children:e.name},e.id))})]})}])},149704,e=>{var t=e.i(843476),s=e.i(111110),r=e.i(398019),a=e.i(184110),i=e.i(975157);let n={left:"mr-auto",center:"mx-auto",right:"ml-auto"};e.s(["f",0,function({svg:e,scale:l,align:o,className:d}){let{t:c}=(0,s.b)();if(!e)return null;let u=(0,a.V)(l),m=(0,a.o)(o);return(0,t.jsx)("figure",{className:(0,i.f)("question-figure my-3",d),children:(0,t.jsx)("img",{src:(0,r.d)(e),alt:c.figure.alt,className:(0,i.f)(n[m],"block h-auto max-w-full rounded border bg-white p-2"),style:{..."left"===m?{marginLeft:0,marginRight:"auto"}:"right"===m?{marginLeft:"auto",marginRight:0}:{},maxHeight:360,zoom:u/100,maxWidth:`${Math.min(u,100)}%`}})})}])},184110,e=>{let t=["left","center","right"],s="center";function r(e){return"number"==typeof e&&Number.isInteger(e)&&e>=10&&e<=200}e.s(["E",0,s,"n",0,100,"j",0,t,"a",0,200,"_",0,10,"x",0,r,"o",0,function(e){return"string"==typeof e&&t.includes(e)?e:s},"V",0,function(e){return r(e)?e:100}])},398019,e=>{e.s(["K",0,1e5,"d",0,function(e){return`data:image/svg+xml;charset=utf-8,${encodeURIComponent(e)}`}])},767077,e=>{var t=e.i(303163);e.s(["f",0,function(e,s){let r=s.common?.messages?.analysisFailed||"Analysis failed, please try again",a=(0,t.d)(e);if(a){let e=s.errors??{};if(!(a in e))return a;let t=e[a];return"string"==typeof t?t:r}let i=(0,t.Z)(e);if(i.includes("fetch")||i.includes("network"))return s.errors?.AI_CONNECTION_FAILED||"网络连接失败";if("object"==typeof e&&null!==e&&"data"in e&&"string"==typeof e.data){let t="status"in e&&"number"==typeof e.status?e.status:"Error";return`${r} (${t})`}return r}])},991722,e=>{function t(e){return"not_attempted"===e||"wrong_attempt"===e||"unknown"===e?e:"unknown"}e.s(["i",0,function(e,s="zh"){return("en"===s?{not_attempted:"Not attempted",wrong_attempt:"Wrong attempt",unknown:"Unknown"}:{not_attempted:"不会做",wrong_attempt:"做错了",unknown:"未判断"})[t(e)]},"h",0,t,"x",0,function(e,s){return(s||"").trim()?"wrong_attempt":t(e)}])},597138,e=>{e.i(306831),e.s(["f",0,function(e){if(!e)return null;let t=e.toLowerCase();return t.includes("math")||t.includes("数学")?"math":t.includes("physics")||t.includes("物理")?"physics":t.includes("chemistry")||t.includes("化学")?"chemistry":t.includes("biology")||t.includes("生物")?"biology":t.includes("english")||t.includes("英语")?"english":t.includes("chinese")||t.includes("语文")?"chinese":t.includes("history")||t.includes("历史")?"history":t.includes("geography")||t.includes("地理")?"geography":t.includes("politics")||t.includes("政治")?"politics":null}])}])})();
|
|
9
|
+
${t.questionSave.databaseCode.replace("{code}",d.databaseCode)}`),a&&(o+=` (HTTP ${a})`),o}(r,t);return i(s),(0,P.t)((0,M.d)(r))||u.c.error(s),!1}};return{saveError:a,setSaveError:i,dismissSaveError:()=>i(null),run:n}}],183444)},469937,e=>{var t=e.i(843476),s=e.i(786563),r=e.i(111110),a=e.i(975157);let i=[1,2,3,4,5];e.s(["f",0,function({value:e,onChange:n,disabled:l,size:o="sm",showUnrated:d=!0,className:c}){let{t:u}=(0,r.b)(),m=e??0,f="sm"===o?"h-3.5 w-3.5":"h-5 w-5",x=m?u.difficulty.starsLabel.replace("{n}",String(m)):u.difficulty.unrated;return n?(0,t.jsxs)("span",{className:(0,a.f)("inline-flex items-center gap-0.5",c),role:"group","aria-label":`${u.difficulty.label}${u.common.colon}${x}`,title:u.difficulty.clearHint,children:[i.map(e=>(0,t.jsx)("button",{type:"button",disabled:l,onClick:()=>n(e===m?null:e),"aria-label":u.difficulty.setStars.replace("{n}",String(e)),"aria-pressed":e<=m,className:"rounded p-0.5 hover:bg-muted disabled:opacity-50 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring",children:(0,t.jsx)(s.f,{className:(0,a.f)(f,e<=m?"fill-amber-400 text-amber-400":"text-muted-foreground/40")})},e)),!m&&d&&(0,t.jsx)("span",{className:"ml-1 text-xs text-muted-foreground",children:u.difficulty.unrated})]}):m?(0,t.jsx)("span",{className:(0,a.f)("inline-flex items-center",c),role:"img","aria-label":`${u.difficulty.label}${u.common.colon}${x}`,title:x,children:i.map(e=>(0,t.jsx)(s.f,{className:(0,a.f)(f,e<=m?"fill-amber-400 text-amber-400":"text-muted-foreground/30"),"aria-hidden":!0},e))}):d?(0,t.jsx)("span",{className:(0,a.f)("text-xs text-muted-foreground",c),children:u.difficulty.unrated}):null}])},731335,532377,339501,e=>{var t=e.i(843476),s=e.i(399847),r=e.i(551757),a=e.i(456420);let i={name:"clock-3",size:24,node:[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 6v6h4",key:"135r8i"}]]};i.node;let n=(0,a.f)(i);var l=e.i(632781),o=e.i(615568),d=e.i(487486),c=e.i(519455),u=e.i(168148),m=e.i(111110),f=e.i(215519),x=e.i(306831);let h=["read","convert","crop","compress","upload"],g=["receive","analyze","save"];function p(e){if(!Number.isFinite(e)||e<0)return"-";if(e<1e3)return`${Math.round(e)}ms`;let t=e/1e3;if(t<60)return`${t.toFixed(+(t<10))}s`;let s=Math.round(t);return`${Math.floor(s/60)}:${String(s%60).padStart(2,"0")}`}var v=e.i(975157);let j={analyzing:50,saving:90},y={analyzing:l.f,saving:l.f,review:o.f,saved:r.f,failed:s.f};e.s(["f",0,function({task:e,now:s,onReview:r,onViewItem:a,onRetry:i,onDiscard:l}){let{t:o}=(0,m.b)(),{timeZone:w}=(0,f.M)(),b=y[e.status],N="analyzing"===e.status||"saving"===e.status,k=o.errors,S=e.error?"string"==typeof k[e.error]?k[e.error]:e.error:null,T=function(e){let t=[];for(let s of h){let r=e?.client?.[s];"number"==typeof r&&t.push({stage:s,ms:r})}for(let s of g){let r=e?.server?.[s];"number"==typeof r&&t.push({stage:s,ms:r})}return t}(e.timings),A=N&&s?s-Date.parse(e.createdAt):null;return(0,t.jsxs)("div",{className:(0,v.f)("space-y-2 rounded-lg border p-3 text-sm",e.unread&&"border-primary/50 bg-primary/5"),"data-testid":"import-task-card","data-status":e.status,children:[(0,t.jsxs)("div",{className:"flex items-start gap-2",children:[(0,t.jsx)(b,{className:(0,v.f)("mt-0.5 h-4 w-4 shrink-0",N&&"animate-spin text-primary","saved"===e.status&&"text-green-600","failed"===e.status&&"text-destructive","review"===e.status&&"text-primary")}),(0,t.jsxs)("div",{className:"min-w-0 flex-1 space-y-1",children:[(0,t.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[(0,t.jsx)("span",{className:"font-medium",children:o.importTasks.status[e.status]}),(0,t.jsx)("span",{className:"text-xs text-muted-foreground",children:o.importTasks.mode[e.mode]}),e.unread&&(0,t.jsx)(d.f,{children:o.importTasks.unread})]}),N&&(0,t.jsx)(u.f,{value:j[e.status],"aria-label":o.importTasks.stageEstimate,"aria-valuetext":o.common.progress.estimated.replace("{percent}",String(j[e.status])),className:"h-1.5"}),e.excerpt&&(0,t.jsx)("p",{className:"break-words text-muted-foreground",children:e.excerpt}),"saved"===e.status&&!e.errorItemId&&(0,t.jsx)("p",{className:"text-xs text-muted-foreground",children:o.importTasks.itemDeleted}),"saved"===e.status&&e.errorItemId&&(0,t.jsx)("p",{className:"text-xs text-green-700 dark:text-green-300",children:e.duplicate?o.importTasks.duplicateSaved:o.importTasks.savedTo.replace("{notebook}",e.notebookName||"-").replace("{id}",e.errorItemShortId||"-")}),S&&(0,t.jsx)("p",{className:"text-xs text-destructive",children:S}),(0,t.jsxs)("div",{className:"flex flex-wrap items-center gap-x-3 gap-y-1 text-xs text-muted-foreground",children:[(0,t.jsxs)("span",{className:"flex items-center gap-1",children:[(0,t.jsx)(n,{className:"h-3 w-3"}),o.importTasks.createdAt.replace("{time}",(0,x.r)(e.createdAt,"MM-dd HH:mm",w))]}),null!==A&&(0,t.jsx)("span",{children:o.importTasks.elapsed.replace("{time}",p(A))}),e.attempts>1&&(0,t.jsx)("span",{children:o.importTasks.attempts.replace("{count}",String(e.attempts))})]}),T.length>0&&(0,t.jsx)("ul",{className:"flex flex-wrap gap-x-3 gap-y-1 text-xs text-muted-foreground tabular-nums","aria-label":"timings",children:T.map(({stage:e,ms:s})=>(0,t.jsxs)("li",{children:[o.importTasks.timings[e]," ",p(s)]},e))})]})]}),(0,t.jsxs)("div",{className:"flex flex-wrap justify-end gap-2",children:["review"===e.status&&r&&(0,t.jsx)(c.f,{size:"sm",onClick:r,children:o.importTasks.continueReview}),"saved"===e.status&&e.errorItemId&&a&&(0,t.jsx)(c.f,{size:"sm",variant:"outline",onClick:a,children:o.importTasks.viewItem}),"failed"===e.status&&i&&(0,t.jsx)(c.f,{size:"sm",onClick:i,children:o.importTasks.retry}),"saving"!==e.status&&"saved"!==e.status&&l&&(0,t.jsx)(c.f,{size:"sm",variant:"ghost",onClick:l,children:o.importTasks.discard})]})]})}],731335);var w=e.i(618566),b=e.i(767077),N=e.i(294114),k=e.i(201276),S=e.i(127175);e.s(["f",0,function(e){let{t}=(0,m.b)(),s=(0,w.useRouter)(),r=e=>{e.unread&&(0,S.N)(e.id).catch(e=>k.V.warn("[ImportTasks]","Mark read failed",{error:e}))};return{openReview:e=>{r(e),s.push(`/import-tasks/${e.id}`)},viewItem:e=>{e.errorItemId&&(r(e),s.push(`/error-items/${e.errorItemId}`))},markRead:r,retry:async s=>{try{await (0,S.R)(s.id),N.c.info(t.importTasks.retried)}catch(e){N.c.error((0,b.f)(e,t))}e?.()},discard:async s=>{if(!await (0,N.u)(t.importTasks.discardConfirm))return!1;let r=!1;try{await (0,S.x)(s.id),N.c.success(t.importTasks.discarded),r=!0}catch(e){N.c.error((0,b.f)(e,t))}return e?.(),r}}}],532377);var T=e.i(271645);e.s(["f",0,function(e,t=1e3){let[s,r]=(0,T.useState)(()=>Date.now());return(0,T.useEffect)(()=>{if(!e)return;let s=setInterval(()=>r(Date.now()),t);return()=>clearInterval(s)},[e,t]),s}],339501)},141176,e=>{var t=e.i(843476),s=e.i(271645),r=e.i(456420);let a={name:"code-xml",size:24,node:[["path",{d:"m18 16 4-4-4-4",key:"1inbqp"}],["path",{d:"m6 8-4 4 4 4",key:"15zrgr"}],["path",{d:"m14.5 4-5 16",key:"e7oirm"}]],aliases:["code-2"]};a.node;let i=(0,r.f)(a);var n=e.i(772382),l=e.i(511445),o=e.i(624687),d=e.i(111110),c=e.i(975157);e.s(["f",0,function({value:e,onChange:r,className:a,...u}){let{t:m}=(0,d.b)(),[f,x]=(0,s.useState)("source"),h=(0,s.useId)(),g=[{mode:"source",label:m.markdownEditor.source,icon:i},{mode:"preview",label:m.markdownEditor.preview,icon:n.f}];return(0,t.jsxs)("div",{className:"space-y-1.5",children:[(0,t.jsx)("div",{role:"tablist","aria-label":m.markdownEditor.modeLabel,className:"flex justify-end",children:(0,t.jsx)("div",{className:"inline-flex rounded-md border bg-muted/40 p-0.5",children:g.map(({mode:e,label:s,icon:r})=>(0,t.jsxs)("button",{type:"button",role:"tab","aria-selected":f===e,"aria-controls":h,onClick:()=>x(e),className:(0,c.f)("flex items-center gap-1 rounded px-2.5 py-1 text-xs transition-colors",f===e?"bg-background font-medium shadow-sm":"text-muted-foreground hover:text-foreground"),children:[(0,t.jsx)(r,{className:"h-3.5 w-3.5"}),s]},e))})}),(0,t.jsx)("div",{id:h,role:"tabpanel",children:"source"===f?(0,t.jsx)(o.f,{value:e,onChange:e=>r(e.target.value),className:a,...u}):(0,t.jsx)("div",{className:"min-h-24 cursor-text rounded-md border bg-muted/20 px-3 py-2",onDoubleClick:()=>x("source"),title:m.markdownEditor.doubleClickToEdit,children:e.trim()?(0,t.jsx)(l.f,{content:e}):(0,t.jsx)("p",{className:"text-sm italic text-muted-foreground",children:m.markdownEditor.empty})})})]})}],141176)},438465,e=>{var t=e.i(843476),s=e.i(271645),r=e.i(967489),a=e.i(856423),i=e.i(41931),n=e.i(201276),l=e.i(111110);e.s(["f",0,function({value:e,onChange:o,className:d}){let[c,u]=(0,s.useState)([]),{t:m}=(0,l.b)();return(0,s.useEffect)(()=>{(async()=>{try{let e=await i.k.get("/api/notebooks");u(e)}catch(e){n.V.error("[NotebookSelector]","Failed to fetch notebooks",{error:e})}})()},[]),(0,t.jsxs)(r.d,{value:e,onValueChange:o,children:[(0,t.jsx)(r.P,{className:d,children:(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)(a.f,{className:"h-4 w-4 text-muted-foreground"}),(0,t.jsx)(r.U,{placeholder:m.notebooks?.selector?.placeholder||"Select Notebook"})]})}),(0,t.jsx)(r.r,{children:0===c.length?(0,t.jsx)("div",{className:"p-2 text-sm text-muted-foreground text-center",children:m.notebooks?.selector?.empty||"No notebooks available"}):c.map(e=>(0,t.jsx)(r.T,{value:e.id,children:e.name},e.id))})]})}])},674166,e=>{var t=e.i(843476),s=e.i(967489),r=e.i(470279);e.s(["f",0,function({value:e,onChange:a,disabled:i}){let{groups:n,loading:l}=(0,r.f)(),o=n.filter(e=>e.isActive);return(0,t.jsxs)(s.d,{value:e,onValueChange:a,disabled:i||l,children:[(0,t.jsx)(s.P,{children:(0,t.jsx)(s.U,{placeholder:"选择卷别"})}),(0,t.jsx)(s.r,{children:o.map(e=>(0,t.jsx)(s.T,{value:e.id,children:e.name},e.id))})]})}])},149704,e=>{var t=e.i(843476),s=e.i(111110),r=e.i(398019),a=e.i(184110),i=e.i(975157);let n={left:"mr-auto",center:"mx-auto",right:"ml-auto"};e.s(["f",0,function({svg:e,scale:l,align:o,className:d}){let{t:c}=(0,s.b)();if(!e)return null;let u=(0,a.V)(l),m=(0,a.o)(o);return(0,t.jsx)("figure",{className:(0,i.f)("question-figure my-3",d),children:(0,t.jsx)("img",{src:(0,r.d)(e),alt:c.figure.alt,className:(0,i.f)(n[m],"block h-auto max-w-full rounded border bg-white p-2"),style:{..."left"===m?{marginLeft:0,marginRight:"auto"}:"right"===m?{marginLeft:"auto",marginRight:0}:{},maxHeight:360,zoom:u/100,maxWidth:`${Math.min(u,100)}%`}})})}])},184110,e=>{let t=["left","center","right"],s="center";function r(e){return"number"==typeof e&&Number.isInteger(e)&&e>=10&&e<=200}e.s(["E",0,s,"n",0,100,"j",0,t,"a",0,200,"_",0,10,"x",0,r,"o",0,function(e){return"string"==typeof e&&t.includes(e)?e:s},"V",0,function(e){return r(e)?e:100}])},398019,e=>{e.s(["K",0,1e5,"d",0,function(e){return`data:image/svg+xml;charset=utf-8,${encodeURIComponent(e)}`}])},767077,e=>{var t=e.i(303163);e.s(["f",0,function(e,s){let r=s.common?.messages?.analysisFailed||"Analysis failed, please try again",a=(0,t.d)(e);if(a){let e=s.errors??{};if(!(a in e))return a;let t=e[a];return"string"==typeof t?t:r}let i=(0,t.Z)(e);if(i.includes("fetch")||i.includes("network"))return s.errors?.AI_CONNECTION_FAILED||"网络连接失败";if("object"==typeof e&&null!==e&&"data"in e&&"string"==typeof e.data){let t="status"in e&&"number"==typeof e.status?e.status:"Error";return`${r} (${t})`}return r}])},991722,e=>{function t(e){return"not_attempted"===e||"wrong_attempt"===e||"unknown"===e?e:"unknown"}e.s(["i",0,function(e,s="zh"){return("en"===s?{not_attempted:"Not attempted",wrong_attempt:"Wrong attempt",unknown:"Unknown"}:{not_attempted:"不会做",wrong_attempt:"做错了",unknown:"未判断"})[t(e)]},"h",0,t,"x",0,function(e,s){return(s||"").trim()?"wrong_attempt":t(e)}])},597138,e=>{e.i(306831),e.s(["f",0,function(e){if(!e)return null;let t=e.toLowerCase();return t.includes("math")||t.includes("数学")?"math":t.includes("science")||t.includes("科学")?"science":t.includes("physics")||t.includes("物理")?"physics":t.includes("chemistry")||t.includes("化学")?"chemistry":t.includes("biology")||t.includes("生物")?"biology":t.includes("english")||t.includes("英语")?"english":t.includes("chinese")||t.includes("语文")?"chinese":t.includes("history")||t.includes("历史")?"history":t.includes("geography")||t.includes("地理")?"geography":t.includes("politics")||t.includes("政治")?"politics":null}])}])})();
|