wrong-notebook 2026.11.3 → 2026.11.4-2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.next/BUILD_ID +1 -1
- package/.next/app-path-routes-manifest.json +3 -0
- package/.next/build-manifest.json +3 -3
- package/.next/routes-manifest.json +18 -0
- 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 +5 -5
- package/.next/server/app/api/admin/cnm-tags/route.js.nft.json +1 -1
- package/.next/server/app/api/admin/dashboard/route.js +11 -11
- 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 +4 -4
- package/.next/server/app/api/admin/debug-logs/route.js.nft.json +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.nft.json +1 -1
- package/.next/server/app/api/admin/users/[id]/detail/route.js +11 -11
- 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.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 +11 -11
- package/.next/server/app/api/ai/models/route.js.nft.json +1 -1
- package/.next/server/app/api/ai/test/route.js +10 -10
- package/.next/server/app/api/ai/test/route.js.nft.json +1 -1
- package/.next/server/app/api/analytics/route.js +16 -15
- package/.next/server/app/api/analytics/route.js.nft.json +1 -1
- package/.next/server/app/api/analyze/route.js +12 -12
- package/.next/server/app/api/analyze/route.js.nft.json +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.nft.json +1 -1
- package/.next/server/app/api/error-items/[id]/figure/route.js +16 -16
- 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 +15 -15
- 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 +11 -11
- 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 +4 -4
- 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.nft.json +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 +16 -16
- 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 +13 -12
- 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 +16 -16
- 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 +16 -16
- 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 +4 -4
- 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.nft.json +1 -1
- package/.next/server/app/api/error-items/clear/route.js.nft.json +1 -1
- package/.next/server/app/api/error-items/list/route.js +1 -1
- package/.next/server/app/api/error-items/list/route.js.nft.json +1 -1
- package/.next/server/app/api/error-items/route.js +19 -18
- package/.next/server/app/api/error-items/route.js.nft.json +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 +4 -4
- package/.next/server/app/api/error-items/similarity/route.js.nft.json +1 -1
- package/.next/server/app/api/exams/[id]/questions/[questionId]/regenerate/route.js +16 -16
- 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 +15 -14
- package/.next/server/app/api/exams/[id]/results/route.js.nft.json +1 -1
- package/.next/server/app/api/exams/[id]/retry/route.js +15 -14
- package/.next/server/app/api/exams/[id]/retry/route.js.nft.json +1 -1
- package/.next/server/app/api/exams/[id]/route.js +15 -15
- package/.next/server/app/api/exams/[id]/route.js.nft.json +1 -1
- package/.next/server/app/api/exams/route.js +17 -16
- package/.next/server/app/api/exams/route.js.nft.json +1 -1
- package/.next/server/app/api/export/route.js +5 -5
- package/.next/server/app/api/export/route.js.nft.json +1 -1
- package/.next/server/app/api/geogebra-analyze/route.js +13 -13
- 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 +16 -16
- package/.next/server/app/api/import/route.js.nft.json +1 -1
- package/.next/server/app/api/import-batches/[id]/confirm-all/route.js +21 -21
- 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 +15 -14
- 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 +21 -21
- 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 +21 -21
- 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 +21 -21
- 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 +21 -21
- package/.next/server/app/api/import-batches/[id]/start/route.js.nft.json +1 -1
- package/.next/server/app/api/import-batches/route.js +21 -21
- package/.next/server/app/api/import-batches/route.js.nft.json +1 -1
- package/.next/server/app/api/import-tasks/[id]/confirm/route.js +17 -17
- 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 +17 -17
- 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 +17 -17
- 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 +17 -17
- package/.next/server/app/api/import-tasks/[id]/route.js.nft.json +1 -1
- package/.next/server/app/api/import-tasks/route.js +21 -21
- package/.next/server/app/api/import-tasks/route.js.nft.json +1 -1
- package/.next/server/app/api/initialize/route.js +3 -3
- package/.next/server/app/api/initialize/route.js.nft.json +1 -1
- package/.next/server/app/api/logs/frontend/route.js.nft.json +1 -1
- 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.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 +15 -14
- package/.next/server/app/api/notebooks/[id]/retag/route.js.nft.json +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 +14 -14
- package/.next/server/app/api/openclaw/batch-upload/route.js.nft.json +1 -1
- package/.next/server/app/api/paper-groups/[id]/route.js +4 -4
- package/.next/server/app/api/paper-groups/[id]/route.js.nft.json +1 -1
- package/.next/server/app/api/paper-groups/route.js +5 -5
- package/.next/server/app/api/paper-groups/route.js.nft.json +1 -1
- package/.next/server/app/api/practice/generate/route.js +13 -13
- package/.next/server/app/api/practice/generate/route.js.nft.json +1 -1
- package/.next/server/app/api/practice/grade/route.js +12 -12
- package/.next/server/app/api/practice/grade/route.js.nft.json +1 -1
- package/.next/server/app/api/practice/record/[id]/route.js +11 -11
- package/.next/server/app/api/practice/record/[id]/route.js.nft.json +1 -1
- package/.next/server/app/api/practice/record/route.js +14 -14
- package/.next/server/app/api/practice/record/route.js.nft.json +1 -1
- package/.next/server/app/api/reanswer/route.js +15 -15
- package/.next/server/app/api/reanswer/route.js.nft.json +1 -1
- package/.next/server/app/api/register/route.js +5 -5
- package/.next/server/app/api/register/route.js.nft.json +1 -1
- package/.next/server/app/api/register/status/route.js +5 -5
- package/.next/server/app/api/register/status/route.js.nft.json +1 -1
- package/.next/server/app/api/requests/[id]/route.js.nft.json +1 -1
- package/.next/server/app/api/review/due/route.js +11 -11
- package/.next/server/app/api/review/due/route.js.nft.json +1 -1
- package/.next/server/app/api/settings/route.js +5 -5
- 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/app-paths-manifest.json +3 -0
- package/.next/server/app/api/stats/activity/route/build-manifest.json +12 -0
- package/.next/server/app/api/stats/activity/route/server-reference-manifest.json +4 -0
- package/.next/server/app/api/stats/activity/route.js +14 -0
- package/.next/server/app/api/stats/activity/route.js.map +5 -0
- package/.next/server/app/api/stats/activity/route.js.nft.json +1 -0
- package/.next/server/app/api/stats/activity/route_client-reference-manifest.js +3 -0
- package/.next/server/app/api/stats/practice/clear/route.js.nft.json +1 -1
- package/.next/server/app/api/stats/practice/route.js +6 -5
- package/.next/server/app/api/stats/practice/route.js.nft.json +1 -1
- package/.next/server/app/api/stats/repeated-mistakes/route/app-paths-manifest.json +3 -0
- package/.next/server/app/api/stats/repeated-mistakes/route/build-manifest.json +12 -0
- package/.next/server/app/api/stats/repeated-mistakes/route/server-reference-manifest.json +4 -0
- package/.next/server/app/api/stats/repeated-mistakes/route.js +26 -0
- package/.next/server/app/api/stats/repeated-mistakes/route.js.map +5 -0
- package/.next/server/app/api/stats/repeated-mistakes/route.js.nft.json +1 -0
- package/.next/server/app/api/stats/repeated-mistakes/route_client-reference-manifest.js +3 -0
- package/.next/server/app/api/stats/weak-tags/route/app-paths-manifest.json +3 -0
- package/.next/server/app/api/stats/weak-tags/route/build-manifest.json +12 -0
- package/.next/server/app/api/stats/weak-tags/route/server-reference-manifest.json +4 -0
- package/.next/server/app/api/stats/weak-tags/route.js +26 -0
- package/.next/server/app/api/stats/weak-tags/route.js.map +5 -0
- package/.next/server/app/api/stats/weak-tags/route.js.nft.json +1 -0
- package/.next/server/app/api/stats/weak-tags/route_client-reference-manifest.js +3 -0
- package/.next/server/app/api/tags/route.js.nft.json +1 -1
- package/.next/server/app/api/tags/stats/route.js.nft.json +1 -1
- package/.next/server/app/api/tags/suggestions/route.js.nft.json +1 -1
- package/.next/server/app/api/tasks/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 +9 -9
- package/.next/server/app/api/tts/batch/route.js.nft.json +1 -1
- package/.next/server/app/api/tts/route.js +7 -7
- package/.next/server/app/api/tts/route.js.nft.json +1 -1
- package/.next/server/app/api/tts/status/route.js +8 -8
- package/.next/server/app/api/tts/status/route.js.nft.json +1 -1
- package/.next/server/app/api/user/route.js +14 -13
- package/.next/server/app/api/user/route.js.nft.json +1 -1
- 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/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 +3 -0
- package/.next/server/chunks/1oeh_server_app_api_stats_repeated-mistakes_route_actions_06q2817k49p9f.js +3 -0
- package/.next/server/chunks/{[root-of-the-server]__0ddvoqy3a719u._.js → [root-of-the-server]__006u92h_madgn._.js} +1 -1
- package/.next/server/chunks/[root-of-the-server]__012pau7crikop._.js +3 -0
- package/.next/server/chunks/[root-of-the-server]__01jc87mm42cex._.js +3 -0
- package/.next/server/chunks/[root-of-the-server]__01newhoirvvb2._.js +3 -0
- package/.next/server/chunks/[root-of-the-server]__057qz9ucs7lib._.js +3 -0
- package/.next/server/chunks/[root-of-the-server]__06_pvs6rg70ri._.js +3 -0
- package/.next/server/chunks/{[root-of-the-server]__0opuw_bsktcnc._.js → [root-of-the-server]__09pkxauucdf_0._.js} +2 -2
- package/.next/server/chunks/[root-of-the-server]__0_vinl1oembls._.js +3 -0
- package/.next/server/chunks/{[root-of-the-server]__1679e_8h0w86j._.js → [root-of-the-server]__0ahni9caaouya._.js} +2 -2
- package/.next/server/chunks/[root-of-the-server]__0aq01totjzgkp._.js +3 -0
- package/.next/server/chunks/[root-of-the-server]__0b_zf20owrv7l._.js +3 -0
- package/.next/server/chunks/[root-of-the-server]__0cel4yig3zcho._.js +3 -0
- package/.next/server/chunks/[root-of-the-server]__0fg20m1i6x4y9._.js +3 -0
- package/.next/server/chunks/[root-of-the-server]__0fhy87hr0_glw._.js +3 -0
- package/.next/server/chunks/{[root-of-the-server]__0ijmyxflggama._.js → [root-of-the-server]__0geynfn2xmdle._.js} +2 -2
- package/.next/server/chunks/[root-of-the-server]__0glupa52ge074._.js +3 -0
- package/.next/server/chunks/{[root-of-the-server]__0xnu_7ck-z9do._.js → [root-of-the-server]__0imuc7gi1ii-e._.js} +2 -2
- package/.next/server/chunks/[root-of-the-server]__0jk-9m6ra-_um._.js +3 -0
- package/.next/server/chunks/[root-of-the-server]__0jvusk64khb-a._.js +3 -0
- package/.next/server/chunks/{[root-of-the-server]__0a5qx2roo_50n._.js → [root-of-the-server]__0k4cyyyh6z6_p._.js} +2 -2
- package/.next/server/chunks/[root-of-the-server]__0lqv0n5j2fg24._.js +3 -0
- package/.next/server/chunks/[root-of-the-server]__0n5l60oyv1n-1._.js +3 -0
- package/.next/server/chunks/[root-of-the-server]__0nkrql6or-tf_._.js +3 -0
- package/.next/server/chunks/[root-of-the-server]__0ovdiut1h8kkt._.js +3 -0
- package/.next/server/chunks/[root-of-the-server]__0p5_lv_pjxr5f._.js +3 -0
- package/.next/server/chunks/[root-of-the-server]__0p8wlug4uvmvi._.js +3 -0
- package/.next/server/chunks/[root-of-the-server]__0r7f34_38kmvk._.js +3 -0
- package/.next/server/chunks/[root-of-the-server]__0ualui9b50ufh._.js +3 -0
- package/.next/server/chunks/[root-of-the-server]__0ujfft7untkmq._.js +3 -0
- package/.next/server/chunks/[root-of-the-server]__0vw7u-y__gk7p._.js +3 -0
- package/.next/server/chunks/[root-of-the-server]__0xj_313186tqc._.js +3 -0
- package/.next/server/chunks/{[root-of-the-server]__12u4jc5x2ss9k._.js → [root-of-the-server]__0z0knsep33lsx._.js} +2 -2
- package/.next/server/chunks/{[root-of-the-server]__1sggr1m3ukvts._.js → [root-of-the-server]__1-djdd7tnb-n7._.js} +2 -2
- package/.next/server/chunks/{[root-of-the-server]__1r0s6pktkiqkf._.js → [root-of-the-server]__10gp75p89v9a2._.js} +2 -2
- package/.next/server/chunks/[root-of-the-server]__112w8xm57okk5._.js +3 -0
- package/.next/server/chunks/[root-of-the-server]__12h4ckd6f76pb._.js +3 -0
- package/.next/server/chunks/[root-of-the-server]__12ig6-5hpb7s-._.js +3 -0
- package/.next/server/chunks/[root-of-the-server]__14c50fhuh_abo._.js +3 -0
- package/.next/server/chunks/{[root-of-the-server]__1l-2u-q625i2a._.js → [root-of-the-server]__166997w1su5wq._.js} +2 -2
- package/.next/server/chunks/[root-of-the-server]__16xl11-irmhu3._.js +3 -0
- package/.next/server/chunks/[root-of-the-server]__19i64i9v32y8o._.js +3 -0
- package/.next/server/chunks/[root-of-the-server]__19jqc7tzna13p._.js +3 -0
- package/.next/server/chunks/[root-of-the-server]__1azaa45m60iqm._.js +3 -0
- package/.next/server/chunks/[root-of-the-server]__1d159cxbdta68._.js +3 -0
- package/.next/server/chunks/{[root-of-the-server]__1yct9oj28kq_h._.js → [root-of-the-server]__1dmp3ynxbcyjz._.js} +2 -2
- package/.next/server/chunks/[root-of-the-server]__1e5tjfwab0exu._.js +3 -0
- package/.next/server/chunks/{[root-of-the-server]__0ahnj8vp1pywj._.js → [root-of-the-server]__1eu_g0k_nr3i-._.js} +2 -2
- package/.next/server/chunks/[root-of-the-server]__1f-7-l2abs15s._.js +3 -0
- package/.next/server/chunks/[root-of-the-server]__1fepss7g57apj._.js +3 -0
- package/.next/server/chunks/[root-of-the-server]__1g11271g0z55n._.js +3 -0
- package/.next/server/chunks/[root-of-the-server]__1he8kk4382-0h._.js +3 -0
- package/.next/server/chunks/[root-of-the-server]__1j44_t992y-1-._.js +3 -0
- package/.next/server/chunks/[root-of-the-server]__1k4f33-z95_7c._.js +3 -0
- package/.next/server/chunks/[root-of-the-server]__1kiolpvl5u4e-._.js +3 -0
- package/.next/server/chunks/{[root-of-the-server]__0_fisu5brhyk_._.js → [root-of-the-server]__1kx3a0dm7l2wl._.js} +2 -2
- package/.next/server/chunks/[root-of-the-server]__1m_y4afrn94oy._.js +3 -0
- package/.next/server/chunks/[root-of-the-server]__1o9pbkx7ejxu0._.js +3 -0
- package/.next/server/chunks/[root-of-the-server]__1tffqae521gxo._.js +3 -0
- package/.next/server/chunks/[root-of-the-server]__1u5c7agj_phnb._.js +3 -0
- package/.next/server/chunks/[root-of-the-server]__1vg8sj020j9pp._.js +3 -0
- package/.next/server/chunks/[root-of-the-server]__1wfhdwfdvc6j3._.js +3 -0
- package/.next/server/chunks/{[root-of-the-server]__0wj82qshtrskw._.js → [root-of-the-server]__1y0n2tg-0l636._.js} +1 -1
- package/.next/server/chunks/[root-of-the-server]__1zqfz2rc4i280._.js +3 -0
- package/.next/server/chunks/[root-of-the-server]__212aaltyh6kc2._.js +3 -0
- package/.next/server/chunks/_0-ne-bwuvd_6w._.js +1 -1
- package/.next/server/chunks/_01y7-j4vx6cu5._.js +3 -0
- package/.next/server/chunks/_03ovgh1-4xf3f._.js +1 -1
- package/.next/server/chunks/_07amw8ha9rney._.js +1 -1
- package/.next/server/chunks/_0_rhee7wb6tcg._.js +1 -1
- package/.next/server/chunks/_0d66myj_8567o._.js +1 -1
- package/.next/server/chunks/_0edfmbz_jbxsu._.js +3 -0
- package/.next/server/chunks/_0ge95_bkwrkmc._.js +1 -1
- package/.next/server/chunks/{_0x3jdlmx-bey5._.js → _0lj59y-ytysr5._.js} +2 -2
- package/.next/server/chunks/_0lo1_vwfiel-b._.js +3 -0
- package/.next/server/chunks/_0r0hnbjdq-k9-._.js +3 -0
- package/.next/server/chunks/_0v762_h-sp94d._.js +3 -0
- package/.next/server/chunks/_0vshwghrjetxu._.js +3 -0
- package/.next/server/chunks/_0wegi_sv1s4wx._.js +1 -1
- package/.next/server/chunks/_11w6ynlxuzl55._.js +1 -1
- package/.next/server/chunks/_12w5k19rc45j_._.js +1 -1
- package/.next/server/chunks/_1a1oatugfke1p._.js +3 -0
- package/.next/server/chunks/_1ex6ovo_j2jzv._.js +1 -1
- package/.next/server/chunks/_1fgb9ve_nfat4._.js +1 -1
- package/.next/server/chunks/_1fki7pamd4s-7._.js +3 -0
- package/.next/server/chunks/{_1ox156inx113o._.js → _1fsfy4c3rj36b._.js} +2 -2
- package/.next/server/chunks/_1hc_es1a3cl6a._.js +3 -0
- package/.next/server/chunks/_1ns6y6y2tq8sh._.js +3 -0
- package/.next/server/chunks/_next-internal_server_app_api_stats_activity_route_actions_1yux8iszfudpr.js +3 -0
- package/.next/server/chunks/_next-internal_server_app_api_stats_weak-tags_route_actions_037n-g-nwrsh6.js +3 -0
- package/.next/server/chunks/{node_modules_zod_v4_classic_external_0cradpuc4fjmm.js → node_modules_zod_v4_classic_external_0qoqh-q5drsgn.js} +3 -3
- package/.next/server/chunks/src_lib_0fedb0fkc3km1._.js +3 -0
- package/.next/server/chunks/src_lib_0okewfjk6p2ci._.js +3 -0
- package/.next/server/chunks/src_lib_0rb6u4i7kn30r._.js +3 -0
- package/.next/server/chunks/src_lib_1chbt4n9_vpoj._.js +3 -0
- package/.next/server/chunks/src_lib_exam_ts_0d3a4q4r41hcf._.js +1 -1
- package/.next/server/chunks/ssr/[root-of-the-server]__01z2m5q6l60fn._.js +3 -0
- package/.next/server/chunks/ssr/[root-of-the-server]__03208_liub81h._.js +3 -0
- package/.next/server/chunks/ssr/[root-of-the-server]__08j-3_6cl3898._.js +3 -0
- package/.next/server/chunks/ssr/[root-of-the-server]__0ht0nkzazbnl9._.js +3 -0
- package/.next/server/chunks/ssr/[root-of-the-server]__0mqo18mv_ooyq._.js +3 -0
- package/.next/server/chunks/ssr/[root-of-the-server]__0r18qmblwuijm._.js +3 -0
- package/.next/server/chunks/ssr/[root-of-the-server]__0sb3jhytba2xr._.js +3 -0
- package/.next/server/chunks/ssr/_002crzzz_cqha._.js +3 -0
- package/.next/server/chunks/ssr/_01qu892bisrf0._.js +3 -0
- package/.next/server/chunks/ssr/_01rfvhncgnpvl._.js +3 -0
- package/.next/server/chunks/ssr/_0k8_zrcalckn6._.js +3 -0
- package/.next/server/chunks/ssr/_0qgs--x99c558._.js +3 -0
- package/.next/server/chunks/ssr/_0rd-teluypcd2._.js +1 -1
- package/.next/server/chunks/ssr/_0w83jztp72o20._.js +3 -0
- package/.next/server/chunks/ssr/{_0f2k-q7kimi4o._.js → _0xkk9yj75j2gl._.js} +1 -1
- package/.next/server/chunks/ssr/_0zacgi5-qgqwr._.js +3 -0
- package/.next/server/chunks/ssr/_11820i-k62560._.js +3 -0
- package/.next/server/chunks/ssr/_1a4u3f5sc05kb._.js +3 -0
- package/.next/server/chunks/ssr/_1sztendo5e5tf._.js +3 -0
- package/.next/server/chunks/ssr/_1ujx-n3muyaxs._.js +1 -1
- package/.next/server/chunks/ssr/_1xv0q8o3g3r5d._.js +3 -0
- package/.next/server/chunks/ssr/{node_modules_1-mokx4fe30es._.js → node_modules_02k42jp0_uoqr._.js} +2 -2
- package/.next/server/chunks/ssr/{node_modules_heic-to_dist_csp_heic-to_1myi81wrj4gw4.js → node_modules_heic-to_dist_csp_heic-to_0byqh-lbfcigr.js} +1 -1
- package/.next/server/chunks/ssr/node_modules_heic-to_dist_csp_heic-to_19_dv9gdzg_e7.js +3 -0
- package/.next/server/chunks/ssr/{node_modules_zod_v4_classic_external_0n-w9zu3b6q41.js → node_modules_zod_v4_classic_external_0veaboc415l0m.js} +3 -3
- package/.next/server/chunks/ssr/src_0z149pjrheeb7._.js +3 -0
- package/.next/server/chunks/ssr/src_app_exams_[id]_page_tsx_0xcjflkgkwzgd._.js +1 -1
- package/.next/server/chunks/ssr/src_app_exams_page_tsx_17_d4_gy2i1ds._.js +1 -1
- package/.next/server/chunks/ssr/src_app_import-batches_[id]_page_tsx_0mhg_vriwmkkw._.js +1 -1
- package/.next/server/chunks/ssr/src_app_notebooks_[id]_page_tsx_08njm-5-txm8_._.js +1 -1
- package/.next/server/chunks/ssr/src_app_print-preview_page_tsx_001yt-fzrj7tf._.js +1 -1
- package/.next/server/chunks/ssr/src_components_providers_tsx_09kw-mv3nb6xs._.js +10 -10
- package/.next/server/middleware-build-manifest.js +3 -3
- package/.next/server/pages/500.html +1 -1
- package/.next/static/chunks/0_xcjg47jv3ur.js +1 -0
- package/.next/static/chunks/0e6ximjg-pqgt.js +1 -0
- package/.next/static/chunks/0wcwopwk4us6h.js +9 -0
- package/.next/static/chunks/17-num1x7o1m2.js +1 -0
- package/.next/static/chunks/{1ywx2_e5apnra.js → 17dk_oppf9-hv.js} +4 -4
- package/.next/static/chunks/1egd1e1483_lj.js +1 -0
- package/.next/static/chunks/1o_q928xcfjs3.js +1 -0
- package/.next/static/chunks/21qaa-gzvurvc.js +1 -0
- package/.next/static/chunks/25flylmb_qz91.js +1 -0
- package/.next/static/chunks/2924d0kl-68z7.js +193 -0
- package/.next/static/chunks/2cpsg6e2vg7fx.css +3 -0
- package/.next/static/chunks/2ebh36q8lvor_.js +1 -0
- package/.next/static/chunks/{210o9wkszynk8.js → 2j0linvpqza7u.js} +4 -4
- package/.next/static/chunks/2r5aeenvfl93p.js +1 -0
- package/.next/static/chunks/3fh32b9da9l_5.js +1 -0
- package/.next/static/chunks/{3u2qw-orhi1q3.js → 3oz37kz8n7y3b.js} +1 -1
- package/.next/static/chunks/3s_fq__cff-ps.js +2 -0
- package/.next/static/chunks/3tv07cyoo_hat.js +1 -0
- package/.next/static/chunks/3wch6vphcivq5.js +1 -0
- package/.next/static/chunks/42rupczfyygo1.js +1 -0
- package/package.json +1 -1
- package/prisma/migrations/20261103231825_exam_paper_mode/migration.sql +25 -0
- package/prisma/schema.prisma +1 -0
- package/prisma/seed.db +0 -0
- package/.next/server/chunks/[root-of-the-server]__0-f1ktua0hz_g._.js +0 -3
- package/.next/server/chunks/[root-of-the-server]__01mz72wf0po36._.js +0 -3
- package/.next/server/chunks/[root-of-the-server]__02ez4rqh6y7uu._.js +0 -3
- package/.next/server/chunks/[root-of-the-server]__02jcq4nj_tb6l._.js +0 -3
- package/.next/server/chunks/[root-of-the-server]__08aldp-j0e_op._.js +0 -3
- package/.next/server/chunks/[root-of-the-server]__08crf3zxl7fnv._.js +0 -3
- package/.next/server/chunks/[root-of-the-server]__094fb72-14c6v._.js +0 -3
- package/.next/server/chunks/[root-of-the-server]__0d31vt-7stly0._.js +0 -3
- package/.next/server/chunks/[root-of-the-server]__0h3er81lqy7-3._.js +0 -3
- package/.next/server/chunks/[root-of-the-server]__0hy5-7_ikat1_._.js +0 -3
- package/.next/server/chunks/[root-of-the-server]__0ik-49062qe6v._.js +0 -3
- package/.next/server/chunks/[root-of-the-server]__0j-1ri4yahq6t._.js +0 -3
- package/.next/server/chunks/[root-of-the-server]__0l30p58xnmw13._.js +0 -3
- package/.next/server/chunks/[root-of-the-server]__0ob0n0xzc2--7._.js +0 -3
- package/.next/server/chunks/[root-of-the-server]__0rwxa2doabk45._.js +0 -3
- package/.next/server/chunks/[root-of-the-server]__0s-etfexh0i4a._.js +0 -3
- package/.next/server/chunks/[root-of-the-server]__0v5o3aoha3nct._.js +0 -3
- package/.next/server/chunks/[root-of-the-server]__0xasoo-1cispc._.js +0 -3
- package/.next/server/chunks/[root-of-the-server]__121tnm6bol8ow._.js +0 -3
- package/.next/server/chunks/[root-of-the-server]__13ofz2qkhwdmd._.js +0 -3
- package/.next/server/chunks/[root-of-the-server]__13ogen7pkq8aa._.js +0 -3
- package/.next/server/chunks/[root-of-the-server]__18tzik6wyd5b2._.js +0 -3
- package/.next/server/chunks/[root-of-the-server]__196oikyiyhn_9._.js +0 -3
- package/.next/server/chunks/[root-of-the-server]__19qwvtmhzhh9_._.js +0 -3
- package/.next/server/chunks/[root-of-the-server]__19wv3dxe-dx43._.js +0 -3
- package/.next/server/chunks/[root-of-the-server]__1azlmjwymm3nj._.js +0 -3
- package/.next/server/chunks/[root-of-the-server]__1c5_00hz3u1z7._.js +0 -3
- package/.next/server/chunks/[root-of-the-server]__1dtpezu7cisnu._.js +0 -3
- package/.next/server/chunks/[root-of-the-server]__1eli1ues3akzx._.js +0 -3
- package/.next/server/chunks/[root-of-the-server]__1h545soby66hi._.js +0 -3
- package/.next/server/chunks/[root-of-the-server]__1ixotu0p11op8._.js +0 -3
- package/.next/server/chunks/[root-of-the-server]__1j0l1jz1c3mpt._.js +0 -3
- package/.next/server/chunks/[root-of-the-server]__1ll7fod21jjr6._.js +0 -3
- package/.next/server/chunks/[root-of-the-server]__1nv28fsr0vd5p._.js +0 -3
- package/.next/server/chunks/[root-of-the-server]__1o_zqaie6w0vc._.js +0 -3
- package/.next/server/chunks/[root-of-the-server]__1q-7krekgvk1w._.js +0 -3
- package/.next/server/chunks/[root-of-the-server]__1qzd0dm9ny797._.js +0 -3
- package/.next/server/chunks/[root-of-the-server]__1rqu8zxkn8yj1._.js +0 -3
- package/.next/server/chunks/[root-of-the-server]__1seev7pmug-hj._.js +0 -3
- package/.next/server/chunks/[root-of-the-server]__1xkmo8s1c258u._.js +0 -3
- package/.next/server/chunks/[root-of-the-server]__1z56ua9u9hadc._.js +0 -3
- package/.next/server/chunks/_0ymqtnritje40._.js +0 -3
- package/.next/server/chunks/_1duugm0s3-6nw._.js +0 -3
- package/.next/server/chunks/_1gjtds8ik0l6x._.js +0 -3
- package/.next/server/chunks/_1hvmjv_7xksea._.js +0 -3
- package/.next/server/chunks/_1rreh3rgx8xan._.js +0 -3
- package/.next/server/chunks/_1wnggnglg9_n1._.js +0 -3
- package/.next/server/chunks/src_lib_0dxltm34zaclb._.js +0 -3
- package/.next/server/chunks/src_lib_1xdguwkq8k_gz._.js +0 -3
- package/.next/server/chunks/src_lib_date-time_ts_14chb270f3epb._.js +0 -3
- package/.next/server/chunks/src_lib_tag-hierarchy_ts_1illun--8v3_9._.js +0 -3
- package/.next/server/chunks/ssr/[root-of-the-server]__0_bi5ljcm1i1c._.js +0 -3
- package/.next/server/chunks/ssr/[root-of-the-server]__0fy6mc47ccfce._.js +0 -3
- package/.next/server/chunks/ssr/[root-of-the-server]__0q_1ml4ix5ftb._.js +0 -3
- package/.next/server/chunks/ssr/[root-of-the-server]__0r_5r-242wwqy._.js +0 -3
- package/.next/server/chunks/ssr/[root-of-the-server]__0vgnixmnie9dg._.js +0 -3
- package/.next/server/chunks/ssr/[root-of-the-server]__1eutot_8-s4s4._.js +0 -3
- package/.next/server/chunks/ssr/[root-of-the-server]__2019hdxvtb4e0._.js +0 -3
- package/.next/server/chunks/ssr/_05szyj465au6e._.js +0 -3
- package/.next/server/chunks/ssr/_0nt5dm7rmsp4f._.js +0 -3
- package/.next/server/chunks/ssr/_0ueequ0gysrs-._.js +0 -3
- package/.next/server/chunks/ssr/_15fdum1ye-k0z._.js +0 -3
- package/.next/server/chunks/ssr/_1b8cip9y91_br._.js +0 -3
- package/.next/server/chunks/ssr/_1d91l8e5qt82w._.js +0 -3
- package/.next/server/chunks/ssr/_1hbrn0tcfh7hd._.js +0 -3
- package/.next/server/chunks/ssr/_1j21wzv797ipf._.js +0 -3
- package/.next/server/chunks/ssr/_1w1qijzykerpu._.js +0 -3
- package/.next/server/chunks/ssr/node_modules_lucide-react_dist_esm_icons_1bq471wvtkwrl._.js +0 -3
- package/.next/server/chunks/ssr/src_components_difficulty-stars_tsx_1af9qqfurq7_t._.js +0 -3
- package/.next/static/chunks/0455_qx26n4sc.js +0 -1
- package/.next/static/chunks/0_0cdw71x2r9p.js +0 -1
- package/.next/static/chunks/0ajfstfi1ibjf.js +0 -1
- package/.next/static/chunks/0nq5_ne_bugdp.js +0 -1
- package/.next/static/chunks/1b5jj8zk0mtzk.js +0 -1
- package/.next/static/chunks/1ppadg8s8wyf0.js +0 -1
- package/.next/static/chunks/1upvap68fad8i.js +0 -1
- package/.next/static/chunks/1v3rj6mh3f3-l.js +0 -1
- package/.next/static/chunks/25_80i03m2bsy.css +0 -3
- package/.next/static/chunks/2e4yhd7hvrn4n.js +0 -1
- package/.next/static/chunks/2ic9ath-r3jvf.js +0 -193
- package/.next/static/chunks/2urhwgx3nt7lq.js +0 -1
- package/.next/static/chunks/3-se55-6uc0mx.js +0 -2
- package/.next/static/chunks/3-w46lg1a_qse.js +0 -1
- package/.next/static/chunks/34lp-hkkywd8r.js +0 -1
- package/.next/static/chunks/38fux_rbsoiif.js +0 -1
- package/.next/static/chunks/3jvftad10pwwg.js +0 -9
- /package/.next/static/{rhXQeIgvoLtutrDHSq6bR → E10D9dv115hLNvX7vE6qA}/_buildManifest.js +0 -0
- /package/.next/static/{rhXQeIgvoLtutrDHSq6bR → E10D9dv115hLNvX7vE6qA}/_clientMiddlewareManifest.js +0 -0
- /package/.next/static/{rhXQeIgvoLtutrDHSq6bR → E10D9dv115hLNvX7vE6qA}/_ssgManifest.js +0 -0
|
@@ -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 r={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"}]]};r.node;let s=(0,t.f)(r);e.s(["f",0,s],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),x=e.i(519455),g=e.i(111110),h=e.i(294114),p=e.i(201276),v=e.i(113381);let y=null;function j(e,t,r){let s=e?.firstElementChild;s&&(s.style.width="100%",s.style.height=`${r}px`,t?.setSize(e?.offsetWidth||s.offsetWidth||800,r))}function w(e,t){let r=(0,v.L)(e,t);for(let e of r)p.V.warn("[GGB]","命令执行失败",{...e});return r.map(e=>e.command+":"+e.message).join("\n")||void 0}e.s(["f",0,function({commands:e,height:t=700,showToolBar:r=!1,showAlgebraInput:s=!1,showMenuBar:l=!1,className:d="",onRegenerate:b,onDelete:k}){let{t:N}=(0,g.b)(),S=(0,i.useRef)(null),A=(0,i.useRef)(null),T=(0,i.useRef)(void 0),E=(0,i.useId)(),I=(0,i.useRef)(`ggb-${E.replace(/[^a-zA-Z0-9_-]/g,"")}`),[C,_]=(0,i.useState)(!0),[R,V]=(0,i.useState)(null),[$,M]=(0,i.useState)(!0),[O,z]=(0,i.useState)(!1),[L,G]=(0,i.useState)(!1),P=(0,i.useMemo)(()=>(0,v.i)(e),[e]);(0,i.useEffect)(()=>{if(0===P.length)return;let e=!1,a=I.current,i=S.current;return(y||(y=new Promise((e,t)=>{if(window.GGBApplet)return void e();let r=document.createElement("script");r.src="https://www.geogebra.org/apps/deployggb.js",r.async=!0,r.onload=()=>e(),r.onerror=()=>{y=null,t(Error("Failed to load GeoGebra"))},document.head.appendChild(r)}))).then(()=>{if(e)return;let n=window.GGBApplet;if(!n){V(N.geogebra.notLoaded),_(!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:r,showAlgebraInput:s,showMenuBar:l,showResetIcon:!0,enableRightClick:!0,enableShiftDragZoom:!0,language:"zh",appletOnLoad:r=>{e||(A.current=r,j(i,r,t),T.current=w(r,P),_(!1))}},!0).inject(a)}catch(t){p.V.error("[GGB]","Init failed",{error:t}),e||(V(N.geogebra.initFailed),_(!1))}}}).catch(t=>{p.V.error("[GGB]","Script load failed",{error:t}),e||(V(N.geogebra.scriptFailed),_(!1))}),()=>{e=!0;try{let e=A.current;e?.remove&&e.remove()}catch(e){p.V.warn("[GGB]","Cleanup failed",{error:e})}A.current=null,i&&(i.innerHTML="")}},[P,r,s,l]),(0,i.useEffect)(()=>{j(S.current,A.current,$?700:t)},[$,t]);let U=(0,i.useCallback)(()=>{let e=A.current;if(e)try{e.resetConstruction(),setTimeout(()=>{A.current&&(T.current=w(A.current,P))},300)}catch(e){p.V.warn("[GGB]","Reset failed",{error:e})}},[P]),F=(0,i.useCallback)(async()=>{if(b&&!O){z(!0);try{await b(T.current)}finally{z(!1)}}},[b,O]),D=(0,i.useCallback)(async()=>{if(k&&!L&&await (0,h.u)(N.geogebra.confirmDelete,{destructive:!0})){G(!0);try{await k()}catch{h.c.error(N.geogebra.deleteFailed)}finally{G(!1)}}},[k,L,N]);return 0===P.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}),C&&(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:[b&&(0,a.jsxs)(x.f,{variant:"ghost",size:"sm",className:"h-7 px-2 text-xs gap-1",onClick:F,title:N.geogebra.regenerate,disabled:O||C,children:[O?(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)(x.f,{variant:"ghost",size:"sm",className:"h-7 px-2 text-xs gap-1 text-destructive hover:text-destructive",onClick:D,title:N.geogebra.delete,disabled:L||O,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)(x.f,{variant:"ghost",size:"sm",className:"h-7 w-7 p-0",onClick:U,title:N.geogebra.reset,disabled:C,children:(0,a.jsx)(u.f,{className:"h-3.5 w-3.5"})}),(0,a.jsx)(x.f,{variant:"ghost",size:"sm",className:"h-7 w-7 p-0",onClick:()=>M(e=>!e),title:$?N.geogebra.shrink:N.geogebra.enlarge,children:$?(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%"}}),C&&(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)},399847,e=>{var t=e.i(456420);let r={name:"circle-alert",size:24,node:[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["line",{x1:"12",x2:"12",y1:"8",y2:"12",key:"1pkeuh"}],["line",{x1:"12",x2:"12.01",y1:"16",y2:"16",key:"4dfq90"}]],aliases:["alert-circle"]};r.node;let s=(0,t.f)(r);e.s(["f",0,s],399847)},615568,168148,e=>{var t=e.i(456420);let r={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"}]]};r.node;let s=(0,t.f)(r);e.s(["f",0,s],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,x]=u(c),g=i.forwardRef(d(function(e,t){let{__scopeProgress:r,value:s=null,max:i,getValueLabel:n=p,...o}=e;(i||0===i)&&!j(i)&&console.error(b(`${i}`,"Progress"));let d=j(i)?i:100;null===s||w(s,d)||console.error(k(`${s}`,"Progress"));let c=w(s,d)?s:null,u=y(c)?n(c,d):void 0;return(0,a.jsx)(f,{scope:r,value:c,max:d,children:(0,a.jsx)(l.V.div,{"aria-valuemax":d,"aria-valuemin":0,"aria-valuenow":y(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")),h=i.forwardRef(d(function(e,t){let{__scopeProgress:r,...s}=e,i=x("ProgressIndicator",r);return(0,a.jsx)(l.V.div,{"data-state":v(i.value,i.max),"data-value":i.value??void 0,"data-max":i.max,...s,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 y(e){return"number"==typeof e}function j(e){return y(e)&&!isNaN(e)&&e>0}function w(e,t){return y(e)&&!isNaN(e)&&e<=t&&e>=0}function b(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(y,"isNumber"),d(j,"isValidMaxNumber"),d(w,"isValidValueNumber"),d(b,"getInvalidMaxError"),d(k,"getInvalidValueError");var N=e.i(975157);let S=i.forwardRef(({className:e,value:t,...r},s)=>(0,a.jsx)(g,{ref:s,value:t,className:(0,N.f)("relative h-4 w-full overflow-hidden rounded-full bg-secondary",e),...r,children:(0,a.jsx)(h,{className:"h-full w-full flex-1 bg-primary transition-all",style:{transform:`translateX(-${100-(t||0)}%)`}})}));S.displayName=g.displayName,e.s(["f",0,S],168148)},856522,e=>{var t=e.i(456420);let r={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"}]]};r.node;let s=(0,t.f)(r);e.s(["f",0,s],856522)},786563,e=>{var t=e.i(456420);let r={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"}]]};r.node;let s=(0,t.f)(r);e.s(["f",0,s],786563)},866531,497346,752012,e=>{var t=e.i(843476),r=e.i(271645),s=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,g]=(0,r.useState)(!1),[h,p]=(0,r.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);g(!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{g(!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)(s.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]})})]}),h&&(0,t.jsx)("p",{className:"text-xs text-muted-foreground mt-2",children:h}),(0,t.jsx)("p",{className:"text-xs text-muted-foreground mt-2",children:i.geogebra.hint})]}):null}var x=e.i(469937),g=e.i(28342),h=e.i(438465),p=e.i(674166),v=e.i(110204);function y({data:e,paperLevel:r,onChange:s}){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)(v.f,{children:a.editor.selectNotebook||"Select Notebook"}),(0,t.jsx)(h.f,{value:e.subjectId,onChange:e=>s({subjectId: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)(v.f,{htmlFor:"correction-grade-semester",children:a.editor.gradeSemester||"Grade/Semester"}),(0,t.jsx)(g.f,{id:"correction-grade-semester",value:e.gradeSemester||"",onChange:e=>s({gradeSemester:e})})]}),(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsx)(v.f,{children:a.editor.paperLevel||"Paper Level"}),(0,t.jsx)(p.f,{value:r,onChange:e=>s({paperLevel:e})})]})]}),(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsx)(v.f,{children:a.difficulty.label}),(0,t.jsx)("div",{children:(0,t.jsx)(x.f,{size:"md",value:e.difficultyStars,onChange:e=>s({difficultyStars:e})})})]})]})}var j=e.i(141176),w=e.i(515288),b=e.i(967489);function k({data:e,onChange:r}){let{t:s}=(0,d.b)();return(0,t.jsxs)(w.N,{children:[(0,t.jsx)(w.Y,{children:(0,t.jsx)(w.v,{children:s.editor.mistakeAnalysisTitle||"Mistake Analysis"})}),(0,t.jsxs)(w.O,{className:"space-y-4",children:[(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsx)(v.f,{children:s.editor.mistakeStatus||"Attempt Status"}),(0,t.jsxs)(b.d,{value:e.mistakeStatus||"unknown",onValueChange:e=>r({mistakeStatus:e}),children:[(0,t.jsx)(b.P,{children:(0,t.jsx)(b.U,{})}),(0,t.jsxs)(b.r,{children:[(0,t.jsx)(b.T,{value:"not_attempted",children:s.editor.mistakeStatuses?.notAttempted||"Not attempted"}),(0,t.jsx)(b.T,{value:"wrong_attempt",children:s.editor.mistakeStatuses?.wrongAttempt||"Wrong attempt"}),(0,t.jsx)(b.T,{value:"unknown",children:s.editor.mistakeStatuses?.unknown||"Unknown"})]})]})]}),(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsx)(v.f,{children:s.editor.wrongAnswerText||"Wrong Answer / Work"}),(0,t.jsx)(j.f,{value:e.wrongAnswerText||"",onChange:t=>r({wrongAnswerText:t,mistakeStatus:t.trim()?"wrong_attempt":e.mistakeStatus}),className:"min-h-[100px] font-mono text-sm",placeholder:s.editor.wrongAnswerPlaceholder||"Leave blank if no wrong answer is visible"})]}),(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsx)(v.f,{children:s.editor.mistakeAnalysis||"Mistake Cause Analysis"}),(0,t.jsx)(j.f,{value:e.mistakeAnalysis||"",onChange:e=>r({mistakeAnalysis:e}),className:"min-h-[140px] font-mono text-sm",placeholder:s.editor.mistakeAnalysisPlaceholder||"Explain where and why the mistake happened"})]})]})]})}var N=e.i(511445),S=e.i(149704);function A({title:e,children:r,className:s}){return(0,t.jsxs)(w.N,{children:[(0,t.jsx)(w.Y,{children:(0,t.jsx)(w.v,{children:e})}),(0,t.jsx)(w.O,{className:s,children:r})]})}function T({data:e,children:r}){let{t:s}=(0,d.b)(),a={wrong_attempt:s.editor.mistakeStatuses?.wrongAttempt||"Wrong attempt",not_attempted:s.editor.mistakeStatuses?.notAttempted||"Not attempted",unknown:s.editor.mistakeStatuses?.unknown||"Unknown"};return(0,t.jsxs)("div",{className:"space-y-6",children:[(0,t.jsxs)(A,{title:s.editor.preview?.question||"Question Preview",children:[(0,t.jsx)(N.f,{content:e.questionText}),(0,t.jsx)(S.f,{svg:e.figureSvg})]}),r,(0,t.jsx)(A,{title:s.editor.preview?.answer||"Answer Preview",children:(0,t.jsx)(N.f,{content:e.answerText})}),(0,t.jsx)(A,{title:s.editor.preview?.analysis||"Analysis Preview",children:(0,t.jsx)(N.f,{content:e.analysis})}),(0,t.jsxs)(A,{title:s.editor.preview?.mistakeAnalysis||"Mistake Analysis Preview",className:"space-y-3 text-sm",children:[(0,t.jsxs)("div",{className:"text-muted-foreground",children:[s.editor.mistakeStatus||"Attempt Status",s.common.colon,a[e.mistakeStatus]??a.unknown]}),e.wrongAnswerText&&(0,t.jsxs)("div",{children:[(0,t.jsx)("div",{className:"font-medium mb-1",children:s.editor.wrongAnswerText||"Wrong Answer / Work"}),(0,t.jsx)(N.f,{content:e.wrongAnswerText})]}),e.mistakeAnalysis&&(0,t.jsxs)("div",{children:[(0,t.jsx)("div",{className:"font-medium mb-1",children:s.editor.mistakeAnalysis||"Mistake Cause Analysis"}),(0,t.jsx)(N.f,{content:e.mistakeAnalysis})]})]})]})}var E=e.i(574041),I=e.i(215519),C=e.i(306831);e.i(676167);var _=e.i(952122),R=e.i(62825),V=e.i(664030),$=e.i(303163);e.s(["f",0,function({initialData:e,onSave:n,onCancel:l,imagePreview:x,initialSubjectId:g,aiTimeout:h}){let{timeZone:p}=(0,I.M)(),{t:b,language:N}=(0,d.b)(),[S,A]=(0,r.useState)({...e,wrongAnswerText:e.wrongAnswerText||"",mistakeAnalysis:e.mistakeAnalysis||"",mistakeStatus:e.mistakeStatus||"unknown",subjectId:g,gradeSemester:e.gradeSemester||""}),M=(0,r.useRef)(!1),O=e=>{"gradeSemester"in e&&(M.current=!0),A(t=>({...t,...e}))},{groups:z}=(0,V.f)(),L=(()=>{if(S.paperLevel)return S.paperLevel;let e="number"==typeof S.difficultyStars&&S.difficultyStars>=4?"b":"a";return z.find(t=>t.key===e&&t.isActive)?.id||""})(),G=S.paperLevel??L,[P,U]=(0,r.useState)(!1),[F,D]=(0,r.useState)(!1),[q,H]=(0,r.useState)(!1),[Q,B]=(0,r.useState)(void 0),[W,Z]=(0,r.useState)([]);(0,r.useEffect)(()=>{c.k.get("/api/notebooks").then(Z).catch(e=>m.V.error("[CorrectionEditor]","Failed to fetch notebooks",{error:e})),c.k.get("/api/user").then(e=>{if(H(!!e?.enableGeogebra),e){let t=function(e,t=C.J){return"ai"===e.gradeRecognitionMode?null:e.fixedGradeSemester?e.fixedGradeSemester:e.educationStage&&e.enrollmentYear?function(e,t,r=new Date,s="en",a=C.J){let i=(0,C.c)(r,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"===s,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||M.current?e:{...e,gradeSemester:t||""}),B(e.educationStage||void 0)}}).catch(e=>m.V.error("[CorrectionEditor]","Failed to fetch user info for grade calculation",{error:e}))},[N,p]);let J=async()=>{if(!S.questionText.trim())return void u.c.warning(b.editor.enterQuestionFirst||"Please enter question text first");U(!0);try{let e=function({questionText:e,language:t,subject:r,imagePreview:s,gradeSemester:a,subjectId:i}){let n={questionText:e,language:t,subject:r};return s&&(n.imageBase64=s),a&&(n.gradeSemester=a),i&&(n.subjectId=i),n}({questionText:S.questionText,language:N,subject:S.subject,imagePreview:x,gradeSemester:S.gradeSemester??void 0,subjectId:S.subjectId});m.V.info("[Reanswer]",e.imageBase64?"Sending image + text (image available for mistake analysis)":"Sending text only (no image available)",{timeout:h});let t=await c.k.post("/api/reanswer",e,{timeout:h||18e4,recoverable:!0});A(e=>({...e,answerText:t.answerText,analysis:t.analysis,knowledgePoints:t.knowledgePoints,wrongAnswerText:t.wrongAnswerText||"",mistakeAnalysis:t.mistakeAnalysis||"",mistakeStatus:(0,R.x)(t.mistakeStatus,t.wrongAnswerText),difficultyStars:t.difficultyStars??e.difficultyStars})),u.c.success(b.editor.reanswerSuccess||"✅ Answer and analysis updated!")}catch(s){let e,t,r;m.V.error("[CorrectionEditor]","Reanswer failed",{error:s}),u.c.error((e=(0,$.d)(s)||"",r=(t=b.errors?.reanswer||{}).default||"Reanswer failed",e.includes("AI_AUTH_ERROR")?t.authError||b.errors?.AI_AUTH_ERROR||r:e.includes("AI_CONNECTION_FAILED")?t.connectionFailed||b.errors?.AI_CONNECTION_FAILED||r:e.includes("AI_RESPONSE_ERROR")&&(t.responseError||b.errors?.AI_RESPONSE_ERROR)||r))}finally{U(!1)}},Y=async()=>{if(!S.subjectId)return void u.c.warning(b.editor.messages?.selectNotebook||"Please select a notebook");if(!F){D(!0);try{await n({...S,paperLevel:G,mistakeStatus:(0,R.x)(S.mistakeStatus,S.wrongAnswerText)})}finally{D(!1)}}},X=b.editor.placeholder||"Supports Markdown and LaTeX...",K=(0,_.f)(W.find(e=>e.id===S.subjectId)?.name||null)||(0,_.f)(S.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:b.editor.title}),(0,t.jsxs)("div",{className:"flex gap-2",children:[(0,t.jsx)(o.f,{variant:"outline",onClick:l,children:b.editor.cancel}),(0,t.jsxs)(o.f,{onClick:Y,disabled:F,children:[F?(0,t.jsx)(s.f,{className:"mr-2 h-4 w-4 animate-spin"}):(0,t.jsx)(i.f,{className:"mr-2 h-4 w-4"}),F?b.common?.pleaseWait||"Please wait...":b.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)(w.N,{children:(0,t.jsx)(w.O,{className:"p-4",children:(0,t.jsx)("img",{src:x,alt:"Original",className:"w-full rounded-md"})})}),(0,t.jsx)(y,{data:S,paperLevel:G,onChange:O}),(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsx)(v.f,{children:b.editor.question}),(0,t.jsx)(j.f,{value:S.questionText,onChange:e=>O({questionText:e}),className:"min-h-[150px] font-mono text-sm",placeholder:X}),(0,t.jsx)(o.f,{variant:"default",size:"sm",onClick:J,disabled:P||!S.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:P?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(s.f,{className:"mr-2 h-4 w-4 animate-spin"}),b.editor.reanswering||"AI solving..."]}):(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(a.f,{className:"mr-2 h-4 w-4"}),b.editor.reanswer||"🔄 Reanswer (based on corrected question)"]})}),(0,t.jsx)("p",{className:"text-xs text-muted-foreground",children:b.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)(v.f,{children:b.editor.tags}),(0,t.jsx)(E.f,{value:S.knowledgePoints,onChange:e=>O({knowledgePoints:e}),placeholder:b.editor.tagsPlaceholder||"Enter knowledge tags...",enterHint:b.editor.createTagHint,subject:K,gradeStage:Q}),(0,t.jsx)("p",{className:"text-xs text-muted-foreground",children:b.editor.tagsHint||"💡 Tag suggestions will appear as you type"})]}),(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsx)(v.f,{children:b.editor.answer}),(0,t.jsx)(j.f,{value:S.answerText,onChange:e=>O({answerText:e}),className:"min-h-[100px] font-mono text-sm",placeholder:X})]}),(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsx)(v.f,{children:b.editor.analysis}),(0,t.jsx)(j.f,{value:S.analysis,onChange:e=>O({analysis:e}),className:"min-h-[200px] font-mono text-sm",placeholder:X})]}),(0,t.jsx)(k,{data:S,onChange:O})]}),(0,t.jsx)(T,{data:S,children:q&&(0,t.jsx)(f,{data:S,onChange:O})})]})]})}],866531);var M=e.i(853138),O=e.i(263676);e.s(["f",0,function({message:e,onDismiss:r}){let{t:s}=(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)(M.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:r,"aria-label":s.common.close,className:"shrink-0 rounded p-1 hover:bg-destructive/10",children:(0,t.jsx)(O.X,{"aria-hidden":"true",className:"h-4 w-4"})})]}):null}],497346);var z=e.i(618566);function L(e){return"object"!=typeof e||null===e||Array.isArray(e)?void 0:e}function G(e,t){if("string"!=typeof e||!/^(QUESTION_SAVE_|AI_)[A-Z_]+$/.test(e))return;let r=t.errors[e];return"string"==typeof r?r:void 0}e.s(["f",0,function(e){let{t}=(0,d.b)(),s=(0,z.useRouter)(),[a,i]=(0,r.useState)(null),n=async(r,a,n=!0)=>{i(null);try{let e=await r();return u.c.success(e.duplicate?t.importFlow.duplicate:t.common.messages.saveSuccess),n&&(e.duplicate?s.push(`/error-items/${e.id}`):a&&s.push(`/notebooks/${a}`)),!0}catch(s){m.V.error(e,"Save failed",{errorMessage:(0,$.d)(s)??(0,$.Z)(s)});let r=function(e,t){let r=L(e),s=L(r?.data),a="number"==typeof r?.status?r.status:void 0,i=(0,$.d)(e),n=G(i,t)??G(s?.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,$.Z)(e)))&&(o=t.errors.QUESTION_SAVE_NETWORK_ERROR);let d=L(s?.details);if("QUESTION_SAVE_GRADE_FAILED"===i){let e=G(d?.reason,t);e&&(o+=`
|
|
7
|
+
${e}`)}return 400===a&&(o+=(function(e,t){if(!Array.isArray(e))return[];let r={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 s=L(e),a=s?.path,i=Array.isArray(a)&&"string"==typeof a[0]?r[a[0]]:void 0;if(!i)return[];let n=s?.maximum,l=t.questionSave.invalidField;return s?.code==="too_big"&&"number"==typeof n&&Number.isSafeInteger(n)&&n>=0&&(l="array"===s.origin?t.questionSave.tooMany:t.questionSave.tooLong),[l.replace("{field}",i).replace("{maximum}",String(n))]})})(s?.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}(s,t);return i(r),"AI_DAILY_LIMIT_EXCEEDED"!==(0,$.d)(s)&&u.c.error(r),!1}};return{saveError:a,setSaveError:i,dismissSaveError:()=>i(null),run:n}}],752012)},469937,e=>{var t=e.i(843476),r=e.i(786563),s=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,s.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)(r.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)(r.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,579321,927904,e=>{var t=e.i(843476),r=e.i(399847),s=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 g=["read","convert","crop","compress","upload"],h=["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 r=Math.round(t);return`${Math.floor(r/60)}:${String(r%60).padStart(2,"0")}`}var v=e.i(975157);let y={analyzing:50,saving:90},j={analyzing:l.f,saving:l.f,review:o.f,saved:s.f,failed:r.f};e.s(["f",0,function({task:e,now:r,onReview:s,onViewItem:a,onRetry:i,onDiscard:l}){let{t:o}=(0,m.b)(),{timeZone:w}=(0,f.M)(),b=j[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,A=function(e){let t=[];for(let r of g){let s=e?.client?.[r];"number"==typeof s&&t.push({stage:r,ms:s})}for(let r of h){let s=e?.server?.[r];"number"==typeof s&&t.push({stage:r,ms:s})}return t}(e.timings),T=k&&r?r-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",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:y[e.status],"aria-label":o.importTasks.stageEstimate,"aria-valuetext":o.common.progress.estimated.replace("{percent}",String(y[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!==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))})]}),A.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:A.map(({stage:e,ms:r})=>(0,t.jsxs)("li",{children:[o.importTasks.timings[e]," ",p(r)]},e))})]})]}),(0,t.jsxs)("div",{className:"flex flex-wrap justify-end gap-2",children:["review"===e.status&&s&&(0,t.jsx)(c.f,{size:"sm",onClick:s,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(61425),k=e.i(294114),N=e.i(201276),S=e.i(116331);e.s(["f",0,function(e){let{t}=(0,m.b)(),r=(0,w.useRouter)(),s=e=>{e.unread&&(0,S.N)(e.id).catch(e=>N.V.warn("[ImportTasks]","Mark read failed",{error:e}))};return{openReview:e=>{s(e),r.push(`/import-tasks/${e.id}`)},viewItem:e=>{e.errorItemId&&(s(e),r.push(`/error-items/${e.errorItemId}`))},markRead:s,retry:async r=>{try{await (0,S.R)(r.id),k.c.info(t.importTasks.retried)}catch(e){k.c.error((0,b.f)(e,t))}e?.()},discard:async r=>{if(!await (0,k.u)(t.importTasks.discardConfirm))return!1;let s=!1;try{await (0,S.x)(r.id),k.c.success(t.importTasks.discarded),s=!0}catch(e){k.c.error((0,b.f)(e,t))}return e?.(),s}}}],579321);var A=e.i(271645);e.s(["f",0,function(e,t=1e3){let[r,s]=(0,A.useState)(()=>Date.now());return(0,A.useEffect)(()=>{if(!e)return;let r=setInterval(()=>s(Date.now()),t);return()=>clearInterval(r)},[e,t]),r}],927904)},141176,e=>{var t=e.i(843476),r=e.i(271645),s=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,s.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:s,className:a,...u}){let{t:m}=(0,d.b)(),[f,x]=(0,r.useState)("source"),g=(0,r.useId)(),h=[{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:h.map(({mode:e,label:r,icon:s})=>(0,t.jsxs)("button",{type:"button",role:"tab","aria-selected":f===e,"aria-controls":g,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)(s,{className:"h-3.5 w-3.5"}),r]},e))})}),(0,t.jsx)("div",{id:g,role:"tabpanel",children:"source"===f?(0,t.jsx)(o.f,{value:e,onChange:e=>s(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,674166,e=>{var t=e.i(843476),r=e.i(271645),s=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,r.useState)([]),{t:m}=(0,l.b)();return(0,r.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)(s.d,{value:e,onValueChange:o,children:[(0,t.jsx)(s.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)(s.U,{placeholder:m.notebooks?.selector?.placeholder||"Select Notebook"})]})}),(0,t.jsx)(s.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)(s.T,{value:e.id,children:e.name},e.id))})]})}],438465);var o=e.i(664030);e.s(["f",0,function({value:e,onChange:r,disabled:a}){let{groups:i,loading:n}=(0,o.f)(),l=i.filter(e=>e.isActive);return(0,t.jsxs)(s.d,{value:e,onValueChange:r,disabled:a||n,children:[(0,t.jsx)(s.P,{children:(0,t.jsx)(s.U,{placeholder:"选择卷别"})}),(0,t.jsx)(s.r,{children:l.map(e=>(0,t.jsx)(s.T,{value:e.id,children:e.name},e.id))})]})}],674166)},149704,e=>{var t=e.i(843476),r=e.i(111110),s=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,r.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,s.f)(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)}%`}})})}])},574041,e=>{var t=e.i(843476),r=e.i(271645),s=e.i(263676),a=e.i(487486),i=e.i(793479),n=e.i(41931),l=e.i(201276);e.s(["f",0,function({value:e=[],onChange:o,placeholder:d="Enter tags...",className:c="",enterHint:u,subject:m,gradeStage:f}){let[x,g]=(0,r.useState)(""),[h,p]=(0,r.useState)([]),[v,y]=(0,r.useState)(!1),[j,w]=(0,r.useState)(0),b=(0,r.useRef)(null),k=(0,r.useRef)(null),N=(0,r.useCallback)(async t=>{try{let r=new URLSearchParams({q:t});m&&r.append("subject",m),f&&r.append("stage",f);let s=((await n.k.get(`/api/tags/suggestions?${r.toString()}`)).suggestions||[]).filter(t=>!e.includes(t));p(s.slice(0,20)),y(s.length>0),w(0)}catch(e){l.V.error("[TagInput]","Failed to fetch suggestions",{error:e})}},[m,f,e]);(0,r.useEffect)(()=>{x.trim()&&N(x)},[x,N]);let S=t=>{t.trim()&&!e.includes(t.trim())&&(o([...e,t.trim()]),g(""),p([]),y(!1),w(0))},A=t=>{o(e.filter(e=>e!==t))};return(0,r.useEffect)(()=>{let e=e=>{!k.current||k.current.contains(e.target)||b.current?.contains(e.target)||y(!1)};return document.addEventListener("mousedown",e),()=>document.removeEventListener("mousedown",e)},[]),(0,t.jsxs)("div",{className:`relative ${c}`,children:[(0,t.jsxs)("div",{className:"flex flex-wrap gap-2 p-2 border rounded-lg bg-background min-h-[42px]",children:[e.map(e=>(0,t.jsxs)(a.f,{variant:"secondary",className:"flex items-center gap-1 px-2 py-1",children:[e,(0,t.jsx)("button",{type:"button",onClick:()=>A(e),className:"hover:text-destructive ml-1",children:(0,t.jsx)(s.X,{className:"h-3 w-3"})})]},e)),(0,t.jsx)(i.f,{ref:b,type:"text",value:x,onChange:e=>{g(e.target.value),e.target.value.trim()||(p([]),y(!1))},onKeyDown:t=>{"Enter"===t.key?(t.preventDefault(),j>=0&&h[j]?S(h[j]):x.trim()&&S(x)):"ArrowDown"===t.key?(t.preventDefault(),w(e=>Math.min(e+1,h.length-1))):"ArrowUp"===t.key?(t.preventDefault(),w(e=>Math.max(e-1,0))):"Escape"===t.key?(y(!1),w(0)):"Backspace"===t.key&&!x&&e.length>0&&A(e[e.length-1])},onFocus:()=>{h.length>0&&y(!0)},placeholder:0===e.length?d:"",className:"flex-1 min-w-[120px] border-none focus-visible:ring-0 focus-visible:ring-offset-0 h-8 px-0"})]}),v&&h.length>0&&(0,t.jsx)("div",{ref:k,className:"absolute z-50 w-full mt-1 bg-popover border rounded-md shadow-md max-h-48 overflow-y-auto",children:h.map((e,r)=>(0,t.jsx)("div",{className:`px-3 py-2 cursor-pointer hover:bg-accent ${r===j?"bg-accent":""}`,onClick:()=>S(e),onMouseEnter:()=>w(r),children:e},e))}),x&&!v&&(0,t.jsx)("div",{className:"text-xs text-muted-foreground mt-1",children:u?`${u} "${x}"`:`Press Enter to create "${x}"`})]})}])},61425,e=>{var t=e.i(303163);e.s(["f",0,function(e,r){let s=r.common?.messages?.analysisFailed||"Analysis failed, please try again",a=(0,t.d)(e);if(a){let e=r.errors??{};if(!(a in e))return a;let t=e[a];return"string"==typeof t?t:s}let i=(0,t.Z)(e);if(i.includes("fetch")||i.includes("network"))return r.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`${s} (${t})`}return s}])},184110,e=>{let t=["left","center","right"],r="center";function s(e){return"number"==typeof e&&Number.isInteger(e)&&e>=10&&e<=200}e.s(["E",0,r,"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:r},"V",0,function(e){return s(e)?e:100}])},398019,e=>{e.s(["f",0,function(e){return`data:image/svg+xml;charset=utf-8,${encodeURIComponent(e)}`}])},952122,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}])},62825,e=>{function t(e){return"not_attempted"===e||"wrong_attempt"===e||"unknown"===e?e:"unknown"}e.s(["i",0,function(e,r="zh"){return("en"===r?{not_attempted:"Not attempted",wrong_attempt:"Wrong attempt",unknown:"Unknown"}:{not_attempted:"不会做",wrong_attempt:"做错了",unknown:"未判断"})[t(e)]},"h",0,t,"x",0,function(e,r){return(r||"").trim()?"wrong_attempt":t(e)}])}])})();
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
(()=>{"use strict";(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,711241,e=>{var t=e.i(456420);let r={name:"arrow-left",size:24,node:[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]]};r.node;let s=(0,t.f)(r);e.s(["f",0,s],711241)},952801,e=>{var t=e.i(843476),r=e.i(271645),s=e.i(522016),a=e.i(215519),n=e.i(306831),i=e.i(226091),l=e.i(77071),d=e.i(519455),c=e.i(515288),o=e.i(912505),m=e.i(393842),u=e.i(86963),x=e.i(618566),f=e.i(632781),h=e.i(994533),p=e.i(257428),g=e.i(793479),b=e.i(110204),j=e.i(574041),v=e.i(111110);let y=["generate","original"];function k({value:e,onChange:r}){let{t:s}=(0,v.b)();return(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsx)(b.f,{children:s.exam.modeLabel}),(0,t.jsx)("div",{className:"grid grid-cols-2 gap-1 rounded-md bg-muted p-1 sm:max-w-sm",role:"group","aria-label":s.exam.modeLabel,children:y.map(a=>(0,t.jsx)("button",{type:"button","aria-pressed":e===a,onClick:()=>r(a),className:`rounded px-2 py-1.5 text-sm transition-colors ${e===a?"bg-background shadow-sm font-medium":"text-muted-foreground"}`,children:s.exam.modes[a]},a))}),"original"===e&&(0,t.jsx)("p",{className:"text-xs text-muted-foreground",children:s.exam.originalHint})]})}var N=e.i(41931),w=e.i(664030);let C=["unmastered","mastered","all"],S=["least_practiced","random"],E=["easy","medium","hard","harder"];function R(){let{t:e,language:s}=(0,v.b)(),a=(0,x.useRouter)(),[n,i]=(0,r.useState)([]),[l,o]=(0,r.useState)([]),[m,u]=(0,r.useState)([]),[y,R]=(0,r.useState)([]),[P,$]=(0,r.useState)("unmastered"),[I,L]=(0,r.useState)("least_practiced"),[M,T]=(0,r.useState)(10),[O,D]=(0,r.useState)("medium"),[F,_]=(0,r.useState)("generate"),[A,U]=(0,r.useState)(""),[q,H]=(0,r.useState)(!1),[B,z]=(0,r.useState)(null),{groups:K,loading:V}=(0,w.f)();(0,r.useEffect)(()=>{N.k.get("/api/notebooks").then(e=>{i(e),1===e.length&&o([e[0].id])}).catch(()=>i([]))},[]);let X=async t=>{if(t.preventDefault(),0===l.length)return void z(e.exam.noNotebook);H(!0),z(null);try{let e=await N.k.post("/api/exams",{subjectIds:l,tagNames:m,paperLevelIds:y.length>0?y:void 0,scope:P,pickRule:I,count:M,difficulty:"original"===F?void 0:O,mode:F,title:A.trim()||void 0,language:s});a.push(`/exams/${e.id}`)}catch(t){z("NO_SOURCE_ITEMS"===t?.data?.message?e.exam.noSource:e.common.messages?.saveFailed||"Failed"),H(!1)}},Y=e.practice.difficulty;return(0,t.jsxs)(c.N,{children:[(0,t.jsx)(c.Y,{children:(0,t.jsx)(c.v,{className:"text-lg",children:e.exam.createTitle})}),(0,t.jsx)(c.O,{children:(0,t.jsxs)("form",{onSubmit:X,className:"space-y-5",children:[(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsxs)("div",{className:"flex items-center justify-between",children:[(0,t.jsx)(b.f,{children:e.exam.notebooks}),n.length>1&&(0,t.jsx)("button",{type:"button",className:"text-xs text-primary hover:underline",onClick:()=>o(l.length===n.length?[]:n.map(e=>e.id)),children:e.exam.selectAll})]}),(0,t.jsx)("div",{className:"grid grid-cols-2 sm:grid-cols-3 gap-2",children:n.map(e=>(0,t.jsxs)("label",{className:"flex items-center gap-2 rounded-md border p-2 text-sm cursor-pointer hover:bg-muted/50",children:[(0,t.jsx)(p.f,{checked:l.includes(e.id),onCheckedChange:()=>{var t;return t=e.id,void o(e=>e.includes(t)?e.filter(e=>e!==t):[...e,t])}}),(0,t.jsx)("span",{className:"truncate",children:e.name}),(0,t.jsx)("span",{className:"ml-auto text-xs text-muted-foreground",children:e._count?.errorItems??""})]},e.id))})]}),(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsx)(b.f,{children:e.exam.tags}),(0,t.jsx)(j.f,{value:m,onChange:u,placeholder:e.exam.tagsPlaceholder})]}),!V&&K.filter(e=>e.isActive).length>0&&(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsx)(b.f,{children:e.filter.paperLevel}),(0,t.jsx)("div",{className:"flex flex-wrap gap-2",children:K.filter(e=>e.isActive).map(e=>(0,t.jsx)("button",{type:"button",onClick:()=>{var t;return t=e.id,void R(e=>e.includes(t)?e.filter(e=>e!==t):[...e,t])},className:`rounded-full border px-3 py-1.5 text-sm transition-colors ${y.includes(e.id)?"border-primary bg-primary text-primary-foreground":"border-input bg-background hover:bg-muted"}`,children:e.name},e.id))})]}),(0,t.jsx)(k,{value:F,onChange:_}),(0,t.jsxs)("div",{className:`grid gap-4 ${"generate"===F?"sm:grid-cols-3":"sm:grid-cols-2"}`,children:[(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsx)(b.f,{children:e.exam.scope}),(0,t.jsx)("div",{className:"grid grid-cols-3 gap-1 rounded-md bg-muted p-1",children:C.map(r=>(0,t.jsx)("button",{type:"button",onClick:()=>$(r),className:`rounded px-2 py-1.5 text-sm transition-colors ${P===r?"bg-background shadow-sm font-medium":"text-muted-foreground"}`,children:e.exam.scopes[r]},r))})]}),(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsx)(b.f,{htmlFor:"exam-count",children:e.exam.count}),(0,t.jsx)(g.f,{id:"exam-count",type:"number",min:1,max:50,value:M,onChange:e=>T(Math.min(50,Math.max(1,parseInt(e.target.value,10)||1)))})]}),"generate"===F&&(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsx)(b.f,{htmlFor:"exam-difficulty",children:e.exam.difficulty}),(0,t.jsx)("select",{id:"exam-difficulty",value:O,onChange:e=>D(e.target.value),className:"h-9 w-full rounded-md border bg-background px-3 text-sm",children:E.map(e=>(0,t.jsx)("option",{value:e,children:Y[e]},e))})]})]}),(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsx)(b.f,{children:e.exam.pickRule}),(0,t.jsx)("div",{className:"grid grid-cols-2 gap-1 rounded-md bg-muted p-1 sm:max-w-sm",children:S.map(r=>(0,t.jsx)("button",{type:"button",onClick:()=>L(r),className:`rounded px-2 py-1.5 text-sm transition-colors ${I===r?"bg-background shadow-sm font-medium":"text-muted-foreground"}`,children:e.exam.pickRules[r]},r))}),(0,t.jsx)("p",{className:"text-xs text-muted-foreground",children:e.exam.pickRuleHints[I]})]}),(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsx)(b.f,{htmlFor:"exam-title",children:e.exam.titleLabel}),(0,t.jsx)(g.f,{id:"exam-title",value:A,maxLength:100,onChange:e=>U(e.target.value)})]}),B&&(0,t.jsx)("p",{className:"text-sm text-destructive",children:B}),(0,t.jsxs)(d.f,{type:"submit",disabled:q,className:"w-full sm:w-auto",children:[q?(0,t.jsx)(f.f,{className:"mr-2 h-4 w-4 animate-spin"}):(0,t.jsx)(h.f,{className:"mr-2 h-4 w-4"}),q?e.exam.creating:"original"===F?e.exam.createOriginal:e.exam.generate]})]})})]})}var P=e.i(663661),$=e.i(487486),I=e.i(35209);e.s(["default",0,function(){let{timeZone:e}=(0,a.M)(),{t:x}=(0,v.b)();(0,I.f)(x.exam.title);let[f,h]=(0,r.useState)(null),[p,g]=(0,r.useState)(!1);(0,r.useEffect)(()=>{N.k.get("/api/exams").then(e=>{h(e),0===e.length&&g(!0)}).catch(()=>h([]))},[]);let b=x.practice.difficulty;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",children:[(0,t.jsx)(m.f,{title:x.exam.title,description:x.exam.subtitle,actions:!p&&(0,t.jsxs)(d.f,{onClick:()=>g(!0),"aria-label":x.exam.create,children:[(0,t.jsx)(l.f,{className:"h-4 w-4"}),(0,t.jsx)("span",{className:"hidden sm:inline",children:x.exam.create})]})}),p&&(0,t.jsx)(R,{}),(0,t.jsxs)("section",{className:"space-y-3",children:[(0,t.jsx)("h2",{className:"text-lg font-semibold",children:x.exam.list}),null===f?(0,t.jsx)(u.f,{}):0===f.length?(0,t.jsx)(o.f,{icon:i.f,title:x.exam.empty,className:"py-10"}):(0,t.jsx)("div",{className:"grid gap-3 md:grid-cols-2",children:f.map(r=>(0,t.jsx)(s.default,{href:`/exams/${r.id}`,children:(0,t.jsx)(c.N,{className:"h-full rounded-2xl transition-all hover:-translate-y-0.5 hover:border-primary/40 hover:shadow-md",children:(0,t.jsxs)(c.O,{className:"space-y-2 pt-4",children:[(0,t.jsxs)("div",{className:"flex items-start justify-between gap-2",children:[(0,t.jsxs)("span",{className:"flex items-center gap-2 font-medium",children:[(0,t.jsx)(i.f,{className:"h-4 w-4 shrink-0 text-primary"}),r.title]}),(0,t.jsx)(P.f,{status:r.status,recorded:r.recordedCount>0})]}),(0,t.jsxs)("div",{className:"flex flex-wrap gap-x-3 gap-y-1 text-xs text-muted-foreground",children:[(0,t.jsx)("span",{children:(0,n.r)(r.createdAt,"yyyy-MM-dd HH:mm",e)}),(0,t.jsx)("span",{children:x.exam.questionCount.replace("{count}",String(r.questionCount))}),(0,t.jsx)("span",{children:x.exam.scopes[r.scope]}),"original"===r.mode?(0,t.jsx)($.f,{variant:"secondary",children:x.exam.modes.original}):(0,t.jsx)("span",{children:b[r.difficulty]||r.difficulty}),(0,t.jsx)("span",{children:r.recordedCount>0?x.exam.recorded:x.exam.notRecorded})]})]})})},r.id))})]})]})})}],952801)},663661,e=>{var t=e.i(843476),r=e.i(487486),s=e.i(111110);let a={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:n}){let{t:i}=(0,s.b)(),l=n&&("ready"===e||"partial"===e)?"completed":e;return(0,t.jsx)(r.f,{variant:"outline",className:a[l],children:i.exam.status[l]})}])},574041,e=>{var t=e.i(843476),r=e.i(271645),s=e.i(263676),a=e.i(487486),n=e.i(793479),i=e.i(41931),l=e.i(201276);e.s(["f",0,function({value:e=[],onChange:d,placeholder:c="Enter tags...",className:o="",enterHint:m,subject:u,gradeStage:x}){let[f,h]=(0,r.useState)(""),[p,g]=(0,r.useState)([]),[b,j]=(0,r.useState)(!1),[v,y]=(0,r.useState)(0),k=(0,r.useRef)(null),N=(0,r.useRef)(null),w=(0,r.useCallback)(async t=>{try{let r=new URLSearchParams({q:t});u&&r.append("subject",u),x&&r.append("stage",x);let s=((await i.k.get(`/api/tags/suggestions?${r.toString()}`)).suggestions||[]).filter(t=>!e.includes(t));g(s.slice(0,20)),j(s.length>0),y(0)}catch(e){l.V.error("[TagInput]","Failed to fetch suggestions",{error:e})}},[u,x,e]);(0,r.useEffect)(()=>{f.trim()&&w(f)},[f,w]);let C=t=>{t.trim()&&!e.includes(t.trim())&&(d([...e,t.trim()]),h(""),g([]),j(!1),y(0))},S=t=>{d(e.filter(e=>e!==t))};return(0,r.useEffect)(()=>{let e=e=>{!N.current||N.current.contains(e.target)||k.current?.contains(e.target)||j(!1)};return document.addEventListener("mousedown",e),()=>document.removeEventListener("mousedown",e)},[]),(0,t.jsxs)("div",{className:`relative ${o}`,children:[(0,t.jsxs)("div",{className:"flex flex-wrap gap-2 p-2 border rounded-lg bg-background min-h-[42px]",children:[e.map(e=>(0,t.jsxs)(a.f,{variant:"secondary",className:"flex items-center gap-1 px-2 py-1",children:[e,(0,t.jsx)("button",{type:"button",onClick:()=>S(e),className:"hover:text-destructive ml-1",children:(0,t.jsx)(s.X,{className:"h-3 w-3"})})]},e)),(0,t.jsx)(n.f,{ref:k,type:"text",value:f,onChange:e=>{h(e.target.value),e.target.value.trim()||(g([]),j(!1))},onKeyDown:t=>{"Enter"===t.key?(t.preventDefault(),v>=0&&p[v]?C(p[v]):f.trim()&&C(f)):"ArrowDown"===t.key?(t.preventDefault(),y(e=>Math.min(e+1,p.length-1))):"ArrowUp"===t.key?(t.preventDefault(),y(e=>Math.max(e-1,0))):"Escape"===t.key?(j(!1),y(0)):"Backspace"===t.key&&!f&&e.length>0&&S(e[e.length-1])},onFocus:()=>{p.length>0&&j(!0)},placeholder:0===e.length?c:"",className:"flex-1 min-w-[120px] border-none focus-visible:ring-0 focus-visible:ring-offset-0 h-8 px-0"})]}),b&&p.length>0&&(0,t.jsx)("div",{ref:N,className:"absolute z-50 w-full mt-1 bg-popover border rounded-md shadow-md max-h-48 overflow-y-auto",children:p.map((e,r)=>(0,t.jsx)("div",{className:`px-3 py-2 cursor-pointer hover:bg-accent ${r===v?"bg-accent":""}`,onClick:()=>C(e),onMouseEnter:()=>y(r),children:e},e))}),f&&!b&&(0,t.jsx)("div",{className:"text-xs text-muted-foreground mt-1",children:m?`${m} "${f}"`:`Press Enter to create "${f}"`})]})}])},590546,e=>{var t=e.i(843476),r=e.i(618566),s=e.i(519455),a=e.i(711241);e.s(["f",0,function({fallbackUrl:e,className:n}){let i=(0,r.useRouter)();return(0,t.jsx)(s.f,{variant:"ghost",size:"icon",onClick:()=>{i.push(e)},className:n,children:(0,t.jsx)(a.f,{className:"h-5 w-5"})})}])},257428,e=>{var t=e.i(843476),r=e.i(271645),s=e.i(820783),a=e.i(30030),n=e.i(981140),i=e.i(369340),l=e.i(635804),d=e.i(296626),c=e.i(248425),o=Object.defineProperty,m=(e,t)=>o(e,"name",{value:t,configurable:!0}),u="Checkbox",[x,f]=(0,a.f)(u),[h,p]=x(u);function g(e){let{__scopeCheckbox:s,checked:a,children:n,defaultChecked:l,disabled:d,form:c,name:o,onCheckedChange:m,required:x,value:f="on",internal_do_not_use_render:p}=e,[g,b]=(0,i.f)({prop:a,defaultProp:l??!1,onChange:m,caller:u}),[j,v]=r.useState(null),[y,w]=r.useState(null),[C,S]=r.useState(null),E=!j||!!c||!!j.closest("form"),R={checked:g,disabled:d,setChecked:b,control:j,setControl:v,name:o,form:c,value:f,userClick:C,onUserClick:S,required:x,defaultChecked:!N(l)&&l,isFormControl:E,bubbleInput:y,setBubbleInput:w};return(0,t.jsx)(h,{scope:s,...R,children:k(p)?p(R):n})}m(g,"CheckboxProvider");var b=r.forwardRef(m(function({__scopeCheckbox:e,onKeyDown:a,onClick:i,...l},d){let{control:o,value:u,disabled:x,checked:f,required:h,setControl:g,setChecked:b,onUserClick:j,isFormControl:v,bubbleInput:y}=p("CheckboxTrigger",e),k=(0,s.f)(d,g),C=r.useRef(f);return r.useEffect(()=>{let e=o?.form;if(e){let t=m(()=>b(C.current),"reset");return e.addEventListener("reset",t),()=>e.removeEventListener("reset",t)}},[o,b]),(0,t.jsx)(c.V.button,{type:"button",role:"checkbox","aria-checked":N(f)?"mixed":f,"aria-required":h,"data-state":w(f),"data-disabled":x?"":void 0,disabled:x,value:u,...l,ref:k,onKeyDown:(0,n.f)(a,e=>{"Enter"===e.key&&e.preventDefault()}),onClick:(0,n.f)(i,e=>{let t=e.isPropagationStopped();j({requestedChecked:!!N(f)||!f,hasConsumerStoppedPropagation:t}),b(e=>!!N(e)||!e),y&&v&&!t&&e.stopPropagation()})})},"CheckboxTrigger")),j=r.forwardRef(m(function(e,r){let{__scopeCheckbox:s,name:a,checked:n,defaultChecked:i,required:l,disabled:d,value:c,onCheckedChange:o,form:m,...u}=e;return(0,t.jsx)(g,{__scopeCheckbox:s,checked:n,defaultChecked:i,disabled:d,required:l,onCheckedChange:o,name:a,form:m,value:c,internal_do_not_use_render:({isFormControl:e})=>(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(b,{...u,ref:r,__scopeCheckbox:s}),e&&(0,t.jsx)(y,{__scopeCheckbox:s})]})})},"Checkbox")),v=r.forwardRef(m(function(e,r){let{__scopeCheckbox:s,forceMount:a,...n}=e,i=p("CheckboxIndicator",s);return(0,t.jsx)(d.f,{present:a||N(i.checked)||!0===i.checked,children:(0,t.jsx)(c.V.span,{"data-state":w(i.checked),"data-disabled":i.disabled?"":void 0,...n,ref:r,style:{pointerEvents:"none",...e.style}})})},"CheckboxIndicator")),y=r.forwardRef(m(function({__scopeCheckbox:e,onClick:a,...i},d){let{control:o,userClick:m,checked:u,defaultChecked:x,required:f,disabled:h,name:g,value:b,form:j,bubbleInput:v,setBubbleInput:y}=p("CheckboxBubbleInput",e),k=(0,s.f)(d,y),w=(0,l.f)(o),C=r.useRef(!1),S=r.useRef(u),E=r.useRef(m),R=r.useRef(null);r.useEffect(()=>{if(!v)return;let e=Object.getOwnPropertyDescriptor(window.HTMLInputElement.prototype,"checked").set;if(!e)return;let t=S.current!==u;S.current=u;let r=null!==m&&m!==E.current;if(E.current=m,r)R.current=t?null:m,t&&(v.indeterminate=N(u),e.call(v,!N(u)&&u)),v.dispatchEvent(new Event("click",{bubbles:!m.hasConsumerStoppedPropagation}));else if(t){let t=R.current;R.current=null;let r=t?.requestedChecked===u;C.current=!0,v.indeterminate=N(u),e.call(v,!N(u)&&u),v.dispatchEvent(new Event("click",{bubbles:!(r&&t.hasConsumerStoppedPropagation)})),C.current=!1}},[v,u,m]);let P=r.useRef(!N(u)&&u);return(0,t.jsx)(c.V.input,{type:"checkbox","aria-hidden":!0,defaultChecked:x??P.current,required:f,disabled:h,name:g,value:b,form:j,...i,tabIndex:-1,ref:k,onClick:(0,n.f)(a,e=>{C.current&&e.stopPropagation()}),style:{...i.style,...w,position:"absolute",pointerEvents:"none",opacity:0,margin:0,transform:"translateX(-100%)"}})},"CheckboxBubbleInput"));function k(e){return"function"==typeof e}function N(e){return"indeterminate"===e}function w(e){return N(e)?"indeterminate":e?"checked":"unchecked"}m(k,"isFunction"),m(N,"isIndeterminate"),m(w,"getState");var C=e.i(689664),S=e.i(975157);let E=r.forwardRef(({className:e,...r},s)=>(0,t.jsx)(j,{ref:s,className:(0,S.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),...r,children:(0,t.jsx)(v,{className:(0,S.f)("flex items-center justify-center text-current"),children:(0,t.jsx)(C.f,{className:"h-4 w-4"})})}));E.displayName=j.displayName,e.s(["f",0,E],257428)},912505,e=>{var t=e.i(843476),r=e.i(975157);e.s(["f",0,function({icon:e,title:s,description:a,action:n,className:i}){return(0,t.jsxs)("div",{className:(0,r.f)("flex flex-col items-center justify-center rounded-2xl border border-dashed bg-card/50 px-6 py-14 text-center",i),children:[(0,t.jsx)("div",{className:"mb-4 flex h-14 w-14 items-center justify-center rounded-2xl bg-accent text-accent-foreground",children:(0,t.jsx)(e,{className:"h-7 w-7"})}),(0,t.jsx)("p",{className:"font-medium",children:s}),a&&(0,t.jsx)("p",{className:"mt-1 max-w-sm text-sm text-muted-foreground",children:a}),n&&(0,t.jsx)("div",{className:"mt-5",children:n})]})}])},393842,e=>{var t=e.i(843476),r=e.i(590546),s=e.i(975157);e.s(["f",0,function({title:e,description:a,backHref:n,actions:i,titleAddon:l,className:d}){return(0,t.jsxs)("div",{className:(0,s.f)("flex items-start gap-3",d),children:[n&&(0,t.jsx)(r.f,{fallbackUrl:n,className:"-ml-2 shrink-0"}),(0,t.jsxs)("div",{className:"min-w-0 flex-1 space-y-1",children:[(0,t.jsxs)("div",{className:"flex items-center gap-1",children:[(0,t.jsx)("h1",{className:"truncate text-2xl font-bold tracking-tight sm:text-3xl",children:e}),l]}),a&&(0,t.jsx)("p",{className:"text-sm text-muted-foreground sm:text-base",children:a})]}),i&&(0,t.jsx)("div",{className:"flex shrink-0 items-center gap-2",children:i})]})}])},86963,e=>{var t=e.i(843476),r=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)(r.f,{className:"h-7 w-7 animate-spin text-primary"}),e&&(0,t.jsx)("p",{className:"text-sm",children:e})]})}])},35209,e=>{var t=e.i(271645),r=e.i(111110);e.s(["f",0,function(...e){let{t:s}=(0,r.b)(),a=[s.pageTitle.base,...e.map(e=>"string"==typeof e?e.trim():"").filter(e=>e.length>0)].join("-");(0,t.useEffect)(()=>{document.title=a},[a])}])}])})();
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
(()=>{"use strict";(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,399847,e=>{var t=e.i(456420);let r={name:"circle-alert",size:24,node:[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["line",{x1:"12",x2:"12",y1:"8",y2:"12",key:"1pkeuh"}],["line",{x1:"12",x2:"12.01",y1:"16",y2:"16",key:"4dfq90"}]],aliases:["alert-circle"]};r.node;let s=(0,t.f)(r);e.s(["f",0,s],399847)},13285,e=>{var t=e.i(456420);let r={name:"layers",size:24,node:[["path",{d:"M12.83 2.18a2 2 0 0 0-1.66 0L2.6 6.08a1 1 0 0 0 0 1.83l8.58 3.91a2 2 0 0 0 1.66 0l8.58-3.9a1 1 0 0 0 0-1.83z",key:"zw3jo"}],["path",{d:"M2 12a1 1 0 0 0 .58.91l8.6 3.91a2 2 0 0 0 1.65 0l8.58-3.9A1 1 0 0 0 22 12",key:"1wduqc"}],["path",{d:"M2 17a1 1 0 0 0 .58.91l8.6 3.91a2 2 0 0 0 1.65 0l8.58-3.9A1 1 0 0 0 22 17",key:"kqbvx6"}]],aliases:["layers-3"]};r.node;let s=(0,t.f)(r);e.s(["f",0,s],13285)},615568,168148,e=>{var t=e.i(456420);let r={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"}]]};r.node;let s=(0,t.f)(r);e.s(["f",0,s],615568);var a=e.i(843476),n=e.i(271645),i=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,i.f)(c),[h
|
|
1
|
+
(()=>{"use strict";(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,399847,e=>{var t=e.i(456420);let r={name:"circle-alert",size:24,node:[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["line",{x1:"12",x2:"12",y1:"8",y2:"12",key:"1pkeuh"}],["line",{x1:"12",x2:"12.01",y1:"16",y2:"16",key:"4dfq90"}]],aliases:["alert-circle"]};r.node;let s=(0,t.f)(r);e.s(["f",0,s],399847)},13285,e=>{var t=e.i(456420);let r={name:"layers",size:24,node:[["path",{d:"M12.83 2.18a2 2 0 0 0-1.66 0L2.6 6.08a1 1 0 0 0 0 1.83l8.58 3.91a2 2 0 0 0 1.66 0l8.58-3.9a1 1 0 0 0 0-1.83z",key:"zw3jo"}],["path",{d:"M2 12a1 1 0 0 0 .58.91l8.6 3.91a2 2 0 0 0 1.65 0l8.58-3.9A1 1 0 0 0 22 12",key:"1wduqc"}],["path",{d:"M2 17a1 1 0 0 0 .58.91l8.6 3.91a2 2 0 0 0 1.65 0l8.58-3.9A1 1 0 0 0 22 17",key:"kqbvx6"}]],aliases:["layers-3"]};r.node;let s=(0,t.f)(r);e.s(["f",0,s],13285)},615568,168148,e=>{var t=e.i(456420);let r={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"}]]};r.node;let s=(0,t.f)(r);e.s(["f",0,s],615568);var a=e.i(843476),n=e.i(271645),i=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,i.f)(c),[f,h]=u(c),p=n.forwardRef(d(function(e,t){let{__scopeProgress:r,value:s=null,max:n,getValueLabel:i=x,...o}=e;(n||0===n)&&!y(n)&&console.error(b(`${n}`,"Progress"));let d=y(n)?n:100;null===s||j(s,d)||console.error(k(`${s}`,"Progress"));let c=j(s,d)?s:null,u=w(c)?i(c,d):void 0;return(0,a.jsx)(f,{scope:r,value:c,max:d,children:(0,a.jsx)(l.V.div,{"aria-valuemax":d,"aria-valuemin":0,"aria-valuenow":w(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=n.forwardRef(d(function(e,t){let{__scopeProgress:r,...s}=e,n=h("ProgressIndicator",r);return(0,a.jsx)(l.V.div,{"data-state":v(n.value,n.max),"data-value":n.value??void 0,"data-max":n.max,...s,ref:t})},"ProgressIndicator"));function x(e,t){return`${Math.round(e/t*100)}%`}function v(e,t){return null==e?"indeterminate":e===t?"complete":"loading"}function w(e){return"number"==typeof e}function y(e){return w(e)&&!isNaN(e)&&e>0}function j(e,t){return w(e)&&!isNaN(e)&&e<=t&&e>=0}function b(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
2
|
- a positive number
|
|
3
3
|
- less than the value passed to \`max\` (or 100 if no \`max\` prop is set)
|
|
4
4
|
- \`null\` or \`undefined\` if the progress is indeterminate.
|
|
5
5
|
|
|
6
|
-
Defaulting to \`null\`.`}d(x,"defaultGetValueLabel"),d(v,"getProgressState"),d(w,"isNumber"),d(y,"isValidMaxNumber"),d(j,"isValidValueNumber"),d(b,"getInvalidMaxError"),d(k,"getInvalidValueError");var S=e.i(975157);let N=n.forwardRef(({className:e,value:t,...r},s)=>(0,a.jsx)(p,{ref:s,value:t,className:(0,S.f)("relative h-4 w-full overflow-hidden rounded-full bg-secondary",e),...r,children:(0,a.jsx)(g,{className:"h-full w-full flex-1 bg-primary transition-all",style:{transform:`translateX(-${100-(t||0)}%)`}})}));N.displayName=p.displayName,e.s(["f",0,N],168148)},866531,497346,752012,e=>{var t=e.i(843476),r=e.i(271645),s=e.i(632781),a=e.i(741120),n=e.i(856522),i=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 h({data:e,onChange:a}){let{t:n}=(0,d.b)(),[f,p]=(0,r.useState)(!1),[g,x]=(0,r.useState)(null),v=async()=>{if(!e.questionText.trim())return void u.c.warning(n.editor.enterQuestionFirst||"Please enter question text first");if(!e.answerText.trim())return void u.c.warning(n.geogebra.answerRequired);p(!0),x(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)}):x(t.description||n.geogebra.notSuitable)}catch(e){m.V.error("[CorrectionEditor]","GeoGebra analysis failed",{error:e}),x(n.geogebra.analyzeFailed)}finally{p(!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)(i.f,{className:"h-4 w-4"}),(0,t.jsx)("span",{children:n.geogebra.title})]}),(0,t.jsx)(o.f,{variant:"outline",size:"sm",onClick:v,disabled:f,children:f?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(s.f,{className:"mr-2 h-4 w-4 animate-spin"}),n.geogebra.analyzing]}):(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(i.f,{className:"mr-2 h-4 w-4"}),n.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:n.geogebra.hint})]}):null}var f=e.i(469937),p=e.i(28342),g=e.i(438465),x=e.i(674166),v=e.i(110204);function w({data:e,paperLevel:r,onChange:s}){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)(v.f,{children:a.editor.selectNotebook||"Select Notebook"}),(0,t.jsx)(g.f,{value:e.subjectId,onChange:e=>s({subjectId: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)(v.f,{htmlFor:"correction-grade-semester",children:a.editor.gradeSemester||"Grade/Semester"}),(0,t.jsx)(p.f,{id:"correction-grade-semester",value:e.gradeSemester||"",onChange:e=>s({gradeSemester:e})})]}),(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsx)(v.f,{children:a.editor.paperLevel||"Paper Level"}),(0,t.jsx)(x.f,{value:r,onChange:e=>s({paperLevel:e})})]})]}),(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsx)(v.f,{children:a.difficulty.label}),(0,t.jsx)("div",{children:(0,t.jsx)(f.f,{size:"md",value:e.difficultyStars,onChange:e=>s({difficultyStars:e})})})]})]})}var y=e.i(141176),j=e.i(515288),b=e.i(967489);function k({data:e,onChange:r}){let{t:s}=(0,d.b)();return(0,t.jsxs)(j.N,{children:[(0,t.jsx)(j.Y,{children:(0,t.jsx)(j.v,{children:s.editor.mistakeAnalysisTitle||"Mistake Analysis"})}),(0,t.jsxs)(j.O,{className:"space-y-4",children:[(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsx)(v.f,{children:s.editor.mistakeStatus||"Attempt Status"}),(0,t.jsxs)(b.d,{value:e.mistakeStatus||"unknown",onValueChange:e=>r({mistakeStatus:e}),children:[(0,t.jsx)(b.P,{children:(0,t.jsx)(b.U,{})}),(0,t.jsxs)(b.r,{children:[(0,t.jsx)(b.T,{value:"not_attempted",children:s.editor.mistakeStatuses?.notAttempted||"Not attempted"}),(0,t.jsx)(b.T,{value:"wrong_attempt",children:s.editor.mistakeStatuses?.wrongAttempt||"Wrong attempt"}),(0,t.jsx)(b.T,{value:"unknown",children:s.editor.mistakeStatuses?.unknown||"Unknown"})]})]})]}),(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsx)(v.f,{children:s.editor.wrongAnswerText||"Wrong Answer / Work"}),(0,t.jsx)(y.f,{value:e.wrongAnswerText||"",onChange:t=>r({wrongAnswerText:t,mistakeStatus:t.trim()?"wrong_attempt":e.mistakeStatus}),className:"min-h-[100px] font-mono text-sm",placeholder:s.editor.wrongAnswerPlaceholder||"Leave blank if no wrong answer is visible"})]}),(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsx)(v.f,{children:s.editor.mistakeAnalysis||"Mistake Cause Analysis"}),(0,t.jsx)(y.f,{value:e.mistakeAnalysis||"",onChange:e=>r({mistakeAnalysis:e}),className:"min-h-[140px] font-mono text-sm",placeholder:s.editor.mistakeAnalysisPlaceholder||"Explain where and why the mistake happened"})]})]})]})}var S=e.i(511445),N=e.i(149704);function A({title:e,children:r,className:s}){return(0,t.jsxs)(j.N,{children:[(0,t.jsx)(j.Y,{children:(0,t.jsx)(j.v,{children:e})}),(0,t.jsx)(j.O,{className:s,children:r})]})}function T({data:e,children:r}){let{t:s}=(0,d.b)(),a={wrong_attempt:s.editor.mistakeStatuses?.wrongAttempt||"Wrong attempt",not_attempted:s.editor.mistakeStatuses?.notAttempted||"Not attempted",unknown:s.editor.mistakeStatuses?.unknown||"Unknown"};return(0,t.jsxs)("div",{className:"space-y-6",children:[(0,t.jsxs)(A,{title:s.editor.preview?.question||"Question Preview",children:[(0,t.jsx)(S.f,{content:e.questionText}),(0,t.jsx)(N.f,{svg:e.figureSvg})]}),r,(0,t.jsx)(A,{title:s.editor.preview?.answer||"Answer Preview",children:(0,t.jsx)(S.f,{content:e.answerText})}),(0,t.jsx)(A,{title:s.editor.preview?.analysis||"Analysis Preview",children:(0,t.jsx)(S.f,{content:e.analysis})}),(0,t.jsxs)(A,{title:s.editor.preview?.mistakeAnalysis||"Mistake Analysis Preview",className:"space-y-3 text-sm",children:[(0,t.jsxs)("div",{className:"text-muted-foreground",children:[s.editor.mistakeStatus||"Attempt Status",s.common.colon,a[e.mistakeStatus]??a.unknown]}),e.wrongAnswerText&&(0,t.jsxs)("div",{children:[(0,t.jsx)("div",{className:"font-medium mb-1",children:s.editor.wrongAnswerText||"Wrong Answer / Work"}),(0,t.jsx)(S.f,{content:e.wrongAnswerText})]}),e.mistakeAnalysis&&(0,t.jsxs)("div",{children:[(0,t.jsx)("div",{className:"font-medium mb-1",children:s.editor.mistakeAnalysis||"Mistake Cause Analysis"}),(0,t.jsx)(S.f,{content:e.mistakeAnalysis})]})]})]})}var I=e.i(574041),E=e.i(215519),_=e.i(306831);e.i(676167);var C=e.i(952122),R=e.i(62825),M=e.i(664030),O=e.i(303163);e.s(["f",0,function({initialData:e,onSave:i,onCancel:l,imagePreview:f,initialSubjectId:p,aiTimeout:g}){let{timeZone:x}=(0,E.M)(),{t:b,language:S}=(0,d.b)(),[N,A]=(0,r.useState)({...e,wrongAnswerText:e.wrongAnswerText||"",mistakeAnalysis:e.mistakeAnalysis||"",mistakeStatus:e.mistakeStatus||"unknown",subjectId:p,gradeSemester:e.gradeSemester||""}),P=(0,r.useRef)(!1),$=e=>{"gradeSemester"in e&&(P.current=!0),A(t=>({...t,...e}))},{groups:U}=(0,M.f)(),L=(()=>{if(N.paperLevel)return N.paperLevel;let e="number"==typeof N.difficultyStars&&N.difficultyStars>=4?"b":"a";return U.find(t=>t.key===e&&t.isActive)?.id||""})(),V=N.paperLevel??L,[q,F]=(0,r.useState)(!1),[z,D]=(0,r.useState)(!1),[G,H]=(0,r.useState)(!1),[Q,W]=(0,r.useState)(void 0),[B,J]=(0,r.useState)([]);(0,r.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(H(!!e?.enableGeogebra),e){let t=function(e,t=_.J){return"ai"===e.gradeRecognitionMode?null:e.fixedGradeSemester?e.fixedGradeSemester:e.educationStage&&e.enrollmentYear?function(e,t,r=new Date,s="en",a=_.J){let n=(0,_.c)(r,a),i=n.getFullYear(),l=n.getMonth()+1,o=i-t,d="2nd";l>=9?(o+=1,d="1st"):d=l<2?"1st":"2nd";let c="zh"===s,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]||[],h=`${o}`;if(h=o>0&&o<=m.length?m[o-1]:o>m.length?c?"已毕业":"Graduated":c?"学前":"Pre-school",!c)return`${h}, ${u}`;{let e="1st"===d?"上":"下";return`${h}${e}`}}(e.educationStage,e.enrollmentYear,new Date,"zh",t):null}(e,x);A(e=>e.gradeSemester||P.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}))},[S,x]);let X=async()=>{if(!N.questionText.trim())return void u.c.warning(b.editor.enterQuestionFirst||"Please enter question text first");F(!0);try{let e=function({questionText:e,language:t,subject:r,imagePreview:s,gradeSemester:a,subjectId:n}){let i={questionText:e,language:t,subject:r};return s&&(i.imageBase64=s),a&&(i.gradeSemester=a),n&&(i.subjectId=n),i}({questionText:N.questionText,language:S,subject:N.subject,imagePreview:f,gradeSemester:N.gradeSemester??void 0,subjectId:N.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,R.x)(t.mistakeStatus,t.wrongAnswerText),difficultyStars:t.difficultyStars??e.difficultyStars})),u.c.success(b.editor.reanswerSuccess||"✅ Answer and analysis updated!")}catch(s){let e,t,r;m.V.error("[CorrectionEditor]","Reanswer failed",{error:s}),u.c.error((e=(0,O.d)(s)||"",r=(t=b.errors?.reanswer||{}).default||"Reanswer failed",e.includes("AI_AUTH_ERROR")?t.authError||b.errors?.AI_AUTH_ERROR||r:e.includes("AI_CONNECTION_FAILED")?t.connectionFailed||b.errors?.AI_CONNECTION_FAILED||r:e.includes("AI_RESPONSE_ERROR")&&(t.responseError||b.errors?.AI_RESPONSE_ERROR)||r))}finally{F(!1)}},Y=async()=>{if(!N.subjectId)return void u.c.warning(b.editor.messages?.selectNotebook||"Please select a notebook");if(!z){D(!0);try{await i({...N,paperLevel:V,mistakeStatus:(0,R.x)(N.mistakeStatus,N.wrongAnswerText)})}finally{D(!1)}}},Z=b.editor.placeholder||"Supports Markdown and LaTeX...",K=(0,C.f)(B.find(e=>e.id===N.subjectId)?.name||null)||(0,C.f)(N.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:b.editor.title}),(0,t.jsxs)("div",{className:"flex gap-2",children:[(0,t.jsx)(o.f,{variant:"outline",onClick:l,children:b.editor.cancel}),(0,t.jsxs)(o.f,{onClick:Y,disabled:z,children:[z?(0,t.jsx)(s.f,{className:"mr-2 h-4 w-4 animate-spin"}):(0,t.jsx)(n.f,{className:"mr-2 h-4 w-4"}),z?b.common?.pleaseWait||"Please wait...":b.editor.save]})]})]}),(0,t.jsxs)("div",{className:"grid gap-6 lg:grid-cols-2",children:[(0,t.jsxs)("div",{className:"space-y-6",children:[f&&(0,t.jsx)(j.N,{children:(0,t.jsx)(j.O,{className:"p-4",children:(0,t.jsx)("img",{src:f,alt:"Original",className:"w-full rounded-md"})})}),(0,t.jsx)(w,{data:N,paperLevel:V,onChange:$}),(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsx)(v.f,{children:b.editor.question}),(0,t.jsx)(y.f,{value:N.questionText,onChange:e=>$({questionText:e}),className:"min-h-[150px] font-mono text-sm",placeholder:Z}),(0,t.jsx)(o.f,{variant:"default",size:"sm",onClick:X,disabled:q||!N.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)(s.f,{className:"mr-2 h-4 w-4 animate-spin"}),b.editor.reanswering||"AI solving..."]}):(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(a.f,{className:"mr-2 h-4 w-4"}),b.editor.reanswer||"🔄 Reanswer (based on corrected question)"]})}),(0,t.jsx)("p",{className:"text-xs text-muted-foreground",children:b.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)(v.f,{children:b.editor.tags}),(0,t.jsx)(I.f,{value:N.knowledgePoints,onChange:e=>$({knowledgePoints:e}),placeholder:b.editor.tagsPlaceholder||"Enter knowledge tags...",enterHint:b.editor.createTagHint,subject:K,gradeStage:Q}),(0,t.jsx)("p",{className:"text-xs text-muted-foreground",children:b.editor.tagsHint||"💡 Tag suggestions will appear as you type"})]}),(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsx)(v.f,{children:b.editor.answer}),(0,t.jsx)(y.f,{value:N.answerText,onChange:e=>$({answerText:e}),className:"min-h-[100px] font-mono text-sm",placeholder:Z})]}),(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsx)(v.f,{children:b.editor.analysis}),(0,t.jsx)(y.f,{value:N.analysis,onChange:e=>$({analysis:e}),className:"min-h-[200px] font-mono text-sm",placeholder:Z})]}),(0,t.jsx)(k,{data:N,onChange:$})]}),(0,t.jsx)(T,{data:N,children:G&&(0,t.jsx)(h,{data:N,onChange:$})})]})]})}],866531);var P=e.i(853138),$=e.i(263676);e.s(["f",0,function({message:e,onDismiss:r}){let{t:s}=(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)(P.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:r,"aria-label":s.common.close,className:"shrink-0 rounded p-1 hover:bg-destructive/10",children:(0,t.jsx)($.X,{"aria-hidden":"true",className:"h-4 w-4"})})]}):null}],497346);var U=e.i(618566);function L(e){return"object"!=typeof e||null===e||Array.isArray(e)?void 0:e}function V(e,t){if("string"!=typeof e||!/^(QUESTION_SAVE_|AI_)[A-Z_]+$/.test(e))return;let r=t.errors[e];return"string"==typeof r?r:void 0}e.s(["f",0,function(e){let{t}=(0,d.b)(),s=(0,U.useRouter)(),[a,n]=(0,r.useState)(null),i=async(r,a,i=!0)=>{n(null);try{let e=await r();return u.c.success(e.duplicate?t.importFlow.duplicate:t.common.messages.saveSuccess),i&&(e.duplicate?s.push(`/error-items/${e.id}`):a&&s.push(`/notebooks/${a}`)),!0}catch(s){m.V.error(e,"Save failed",{errorMessage:(0,O.d)(s)??(0,O.Z)(s)});let r=function(e,t){let r=L(e),s=L(r?.data),a="number"==typeof r?.status?r.status:void 0,n=(0,O.d)(e),i=V(n,t)??V(s?.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=i??(a?l[a]:void 0)??t.errors.QUESTION_SAVE_FAILED;!a&&(e instanceof TypeError||/fetch|network|load failed/i.test((0,O.Z)(e)))&&(o=t.errors.QUESTION_SAVE_NETWORK_ERROR);let d=L(s?.details);if("QUESTION_SAVE_GRADE_FAILED"===n){let e=V(d?.reason,t);e&&(o+=`
|
|
6
|
+
Defaulting to \`null\`.`}d(x,"defaultGetValueLabel"),d(v,"getProgressState"),d(w,"isNumber"),d(y,"isValidMaxNumber"),d(j,"isValidValueNumber"),d(b,"getInvalidMaxError"),d(k,"getInvalidValueError");var S=e.i(975157);let N=n.forwardRef(({className:e,value:t,...r},s)=>(0,a.jsx)(p,{ref:s,value:t,className:(0,S.f)("relative h-4 w-full overflow-hidden rounded-full bg-secondary",e),...r,children:(0,a.jsx)(g,{className:"h-full w-full flex-1 bg-primary transition-all",style:{transform:`translateX(-${100-(t||0)}%)`}})}));N.displayName=p.displayName,e.s(["f",0,N],168148)},866531,497346,752012,e=>{var t=e.i(843476),r=e.i(271645),s=e.i(632781),a=e.i(741120),n=e.i(856522),i=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:n}=(0,d.b)(),[h,p]=(0,r.useState)(!1),[g,x]=(0,r.useState)(null),v=async()=>{if(!e.questionText.trim())return void u.c.warning(n.editor.enterQuestionFirst||"Please enter question text first");if(!e.answerText.trim())return void u.c.warning(n.geogebra.answerRequired);p(!0),x(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)}):x(t.description||n.geogebra.notSuitable)}catch(e){m.V.error("[CorrectionEditor]","GeoGebra analysis failed",{error:e}),x(n.geogebra.analyzeFailed)}finally{p(!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)(i.f,{className:"h-4 w-4"}),(0,t.jsx)("span",{children:n.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)(s.f,{className:"mr-2 h-4 w-4 animate-spin"}),n.geogebra.analyzing]}):(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(i.f,{className:"mr-2 h-4 w-4"}),n.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:n.geogebra.hint})]}):null}var h=e.i(469937),p=e.i(28342),g=e.i(438465),x=e.i(674166),v=e.i(110204);function w({data:e,paperLevel:r,onChange:s}){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)(v.f,{children:a.editor.selectNotebook||"Select Notebook"}),(0,t.jsx)(g.f,{value:e.subjectId,onChange:e=>s({subjectId: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)(v.f,{htmlFor:"correction-grade-semester",children:a.editor.gradeSemester||"Grade/Semester"}),(0,t.jsx)(p.f,{id:"correction-grade-semester",value:e.gradeSemester||"",onChange:e=>s({gradeSemester:e})})]}),(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsx)(v.f,{children:a.editor.paperLevel||"Paper Level"}),(0,t.jsx)(x.f,{value:r,onChange:e=>s({paperLevel:e})})]})]}),(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsx)(v.f,{children:a.difficulty.label}),(0,t.jsx)("div",{children:(0,t.jsx)(h.f,{size:"md",value:e.difficultyStars,onChange:e=>s({difficultyStars:e})})})]})]})}var y=e.i(141176),j=e.i(515288),b=e.i(967489);function k({data:e,onChange:r}){let{t:s}=(0,d.b)();return(0,t.jsxs)(j.N,{children:[(0,t.jsx)(j.Y,{children:(0,t.jsx)(j.v,{children:s.editor.mistakeAnalysisTitle||"Mistake Analysis"})}),(0,t.jsxs)(j.O,{className:"space-y-4",children:[(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsx)(v.f,{children:s.editor.mistakeStatus||"Attempt Status"}),(0,t.jsxs)(b.d,{value:e.mistakeStatus||"unknown",onValueChange:e=>r({mistakeStatus:e}),children:[(0,t.jsx)(b.P,{children:(0,t.jsx)(b.U,{})}),(0,t.jsxs)(b.r,{children:[(0,t.jsx)(b.T,{value:"not_attempted",children:s.editor.mistakeStatuses?.notAttempted||"Not attempted"}),(0,t.jsx)(b.T,{value:"wrong_attempt",children:s.editor.mistakeStatuses?.wrongAttempt||"Wrong attempt"}),(0,t.jsx)(b.T,{value:"unknown",children:s.editor.mistakeStatuses?.unknown||"Unknown"})]})]})]}),(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsx)(v.f,{children:s.editor.wrongAnswerText||"Wrong Answer / Work"}),(0,t.jsx)(y.f,{value:e.wrongAnswerText||"",onChange:t=>r({wrongAnswerText:t,mistakeStatus:t.trim()?"wrong_attempt":e.mistakeStatus}),className:"min-h-[100px] font-mono text-sm",placeholder:s.editor.wrongAnswerPlaceholder||"Leave blank if no wrong answer is visible"})]}),(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsx)(v.f,{children:s.editor.mistakeAnalysis||"Mistake Cause Analysis"}),(0,t.jsx)(y.f,{value:e.mistakeAnalysis||"",onChange:e=>r({mistakeAnalysis:e}),className:"min-h-[140px] font-mono text-sm",placeholder:s.editor.mistakeAnalysisPlaceholder||"Explain where and why the mistake happened"})]})]})]})}var S=e.i(511445),N=e.i(149704);function A({title:e,children:r,className:s}){return(0,t.jsxs)(j.N,{children:[(0,t.jsx)(j.Y,{children:(0,t.jsx)(j.v,{children:e})}),(0,t.jsx)(j.O,{className:s,children:r})]})}function T({data:e,children:r}){let{t:s}=(0,d.b)(),a={wrong_attempt:s.editor.mistakeStatuses?.wrongAttempt||"Wrong attempt",not_attempted:s.editor.mistakeStatuses?.notAttempted||"Not attempted",unknown:s.editor.mistakeStatuses?.unknown||"Unknown"};return(0,t.jsxs)("div",{className:"space-y-6",children:[(0,t.jsxs)(A,{title:s.editor.preview?.question||"Question Preview",children:[(0,t.jsx)(S.f,{content:e.questionText}),(0,t.jsx)(N.f,{svg:e.figureSvg})]}),r,(0,t.jsx)(A,{title:s.editor.preview?.answer||"Answer Preview",children:(0,t.jsx)(S.f,{content:e.answerText})}),(0,t.jsx)(A,{title:s.editor.preview?.analysis||"Analysis Preview",children:(0,t.jsx)(S.f,{content:e.analysis})}),(0,t.jsxs)(A,{title:s.editor.preview?.mistakeAnalysis||"Mistake Analysis Preview",className:"space-y-3 text-sm",children:[(0,t.jsxs)("div",{className:"text-muted-foreground",children:[s.editor.mistakeStatus||"Attempt Status",s.common.colon,a[e.mistakeStatus]??a.unknown]}),e.wrongAnswerText&&(0,t.jsxs)("div",{children:[(0,t.jsx)("div",{className:"font-medium mb-1",children:s.editor.wrongAnswerText||"Wrong Answer / Work"}),(0,t.jsx)(S.f,{content:e.wrongAnswerText})]}),e.mistakeAnalysis&&(0,t.jsxs)("div",{children:[(0,t.jsx)("div",{className:"font-medium mb-1",children:s.editor.mistakeAnalysis||"Mistake Cause Analysis"}),(0,t.jsx)(S.f,{content:e.mistakeAnalysis})]})]})]})}var I=e.i(574041),E=e.i(215519),_=e.i(306831);e.i(676167);var C=e.i(952122),R=e.i(62825),M=e.i(664030),O=e.i(303163);e.s(["f",0,function({initialData:e,onSave:i,onCancel:l,imagePreview:h,initialSubjectId:p,aiTimeout:g}){let{timeZone:x}=(0,E.M)(),{t:b,language:S}=(0,d.b)(),[N,A]=(0,r.useState)({...e,wrongAnswerText:e.wrongAnswerText||"",mistakeAnalysis:e.mistakeAnalysis||"",mistakeStatus:e.mistakeStatus||"unknown",subjectId:p,gradeSemester:e.gradeSemester||""}),P=(0,r.useRef)(!1),$=e=>{"gradeSemester"in e&&(P.current=!0),A(t=>({...t,...e}))},{groups:U}=(0,M.f)(),L=(()=>{if(N.paperLevel)return N.paperLevel;let e="number"==typeof N.difficultyStars&&N.difficultyStars>=4?"b":"a";return U.find(t=>t.key===e&&t.isActive)?.id||""})(),V=N.paperLevel??L,[q,F]=(0,r.useState)(!1),[z,D]=(0,r.useState)(!1),[G,H]=(0,r.useState)(!1),[Q,W]=(0,r.useState)(void 0),[B,J]=(0,r.useState)([]);(0,r.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(H(!!e?.enableGeogebra),e){let t=function(e,t=_.J){return"ai"===e.gradeRecognitionMode?null:e.fixedGradeSemester?e.fixedGradeSemester:e.educationStage&&e.enrollmentYear?function(e,t,r=new Date,s="en",a=_.J){let n=(0,_.c)(r,a),i=n.getFullYear(),l=n.getMonth()+1,o=i-t,d="2nd";l>=9?(o+=1,d="1st"):d=l<2?"1st":"2nd";let c="zh"===s,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,x);A(e=>e.gradeSemester||P.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}))},[S,x]);let X=async()=>{if(!N.questionText.trim())return void u.c.warning(b.editor.enterQuestionFirst||"Please enter question text first");F(!0);try{let e=function({questionText:e,language:t,subject:r,imagePreview:s,gradeSemester:a,subjectId:n}){let i={questionText:e,language:t,subject:r};return s&&(i.imageBase64=s),a&&(i.gradeSemester=a),n&&(i.subjectId=n),i}({questionText:N.questionText,language:S,subject:N.subject,imagePreview:h,gradeSemester:N.gradeSemester??void 0,subjectId:N.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,R.x)(t.mistakeStatus,t.wrongAnswerText),difficultyStars:t.difficultyStars??e.difficultyStars})),u.c.success(b.editor.reanswerSuccess||"✅ Answer and analysis updated!")}catch(s){let e,t,r;m.V.error("[CorrectionEditor]","Reanswer failed",{error:s}),u.c.error((e=(0,O.d)(s)||"",r=(t=b.errors?.reanswer||{}).default||"Reanswer failed",e.includes("AI_AUTH_ERROR")?t.authError||b.errors?.AI_AUTH_ERROR||r:e.includes("AI_CONNECTION_FAILED")?t.connectionFailed||b.errors?.AI_CONNECTION_FAILED||r:e.includes("AI_RESPONSE_ERROR")&&(t.responseError||b.errors?.AI_RESPONSE_ERROR)||r))}finally{F(!1)}},Y=async()=>{if(!N.subjectId)return void u.c.warning(b.editor.messages?.selectNotebook||"Please select a notebook");if(!z){D(!0);try{await i({...N,paperLevel:V,mistakeStatus:(0,R.x)(N.mistakeStatus,N.wrongAnswerText)})}finally{D(!1)}}},Z=b.editor.placeholder||"Supports Markdown and LaTeX...",K=(0,C.f)(B.find(e=>e.id===N.subjectId)?.name||null)||(0,C.f)(N.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:b.editor.title}),(0,t.jsxs)("div",{className:"flex gap-2",children:[(0,t.jsx)(o.f,{variant:"outline",onClick:l,children:b.editor.cancel}),(0,t.jsxs)(o.f,{onClick:Y,disabled:z,children:[z?(0,t.jsx)(s.f,{className:"mr-2 h-4 w-4 animate-spin"}):(0,t.jsx)(n.f,{className:"mr-2 h-4 w-4"}),z?b.common?.pleaseWait||"Please wait...":b.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)(j.N,{children:(0,t.jsx)(j.O,{className:"p-4",children:(0,t.jsx)("img",{src:h,alt:"Original",className:"w-full rounded-md"})})}),(0,t.jsx)(w,{data:N,paperLevel:V,onChange:$}),(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsx)(v.f,{children:b.editor.question}),(0,t.jsx)(y.f,{value:N.questionText,onChange:e=>$({questionText:e}),className:"min-h-[150px] font-mono text-sm",placeholder:Z}),(0,t.jsx)(o.f,{variant:"default",size:"sm",onClick:X,disabled:q||!N.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)(s.f,{className:"mr-2 h-4 w-4 animate-spin"}),b.editor.reanswering||"AI solving..."]}):(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(a.f,{className:"mr-2 h-4 w-4"}),b.editor.reanswer||"🔄 Reanswer (based on corrected question)"]})}),(0,t.jsx)("p",{className:"text-xs text-muted-foreground",children:b.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)(v.f,{children:b.editor.tags}),(0,t.jsx)(I.f,{value:N.knowledgePoints,onChange:e=>$({knowledgePoints:e}),placeholder:b.editor.tagsPlaceholder||"Enter knowledge tags...",enterHint:b.editor.createTagHint,subject:K,gradeStage:Q}),(0,t.jsx)("p",{className:"text-xs text-muted-foreground",children:b.editor.tagsHint||"💡 Tag suggestions will appear as you type"})]}),(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsx)(v.f,{children:b.editor.answer}),(0,t.jsx)(y.f,{value:N.answerText,onChange:e=>$({answerText:e}),className:"min-h-[100px] font-mono text-sm",placeholder:Z})]}),(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsx)(v.f,{children:b.editor.analysis}),(0,t.jsx)(y.f,{value:N.analysis,onChange:e=>$({analysis:e}),className:"min-h-[200px] font-mono text-sm",placeholder:Z})]}),(0,t.jsx)(k,{data:N,onChange:$})]}),(0,t.jsx)(T,{data:N,children:G&&(0,t.jsx)(f,{data:N,onChange:$})})]})]})}],866531);var P=e.i(853138),$=e.i(263676);e.s(["f",0,function({message:e,onDismiss:r}){let{t:s}=(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)(P.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:r,"aria-label":s.common.close,className:"shrink-0 rounded p-1 hover:bg-destructive/10",children:(0,t.jsx)($.X,{"aria-hidden":"true",className:"h-4 w-4"})})]}):null}],497346);var U=e.i(618566);function L(e){return"object"!=typeof e||null===e||Array.isArray(e)?void 0:e}function V(e,t){if("string"!=typeof e||!/^(QUESTION_SAVE_|AI_)[A-Z_]+$/.test(e))return;let r=t.errors[e];return"string"==typeof r?r:void 0}e.s(["f",0,function(e){let{t}=(0,d.b)(),s=(0,U.useRouter)(),[a,n]=(0,r.useState)(null),i=async(r,a,i=!0)=>{n(null);try{let e=await r();return u.c.success(e.duplicate?t.importFlow.duplicate:t.common.messages.saveSuccess),i&&(e.duplicate?s.push(`/error-items/${e.id}`):a&&s.push(`/notebooks/${a}`)),!0}catch(s){m.V.error(e,"Save failed",{errorMessage:(0,O.d)(s)??(0,O.Z)(s)});let r=function(e,t){let r=L(e),s=L(r?.data),a="number"==typeof r?.status?r.status:void 0,n=(0,O.d)(e),i=V(n,t)??V(s?.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=i??(a?l[a]:void 0)??t.errors.QUESTION_SAVE_FAILED;!a&&(e instanceof TypeError||/fetch|network|load failed/i.test((0,O.Z)(e)))&&(o=t.errors.QUESTION_SAVE_NETWORK_ERROR);let d=L(s?.details);if("QUESTION_SAVE_GRADE_FAILED"===n){let e=V(d?.reason,t);e&&(o+=`
|
|
7
7
|
${e}`)}return 400===a&&(o+=(function(e,t){if(!Array.isArray(e))return[];let r={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 s=L(e),a=s?.path,n=Array.isArray(a)&&"string"==typeof a[0]?r[a[0]]:void 0;if(!n)return[];let i=s?.maximum,l=t.questionSave.invalidField;return s?.code==="too_big"&&"number"==typeof i&&Number.isSafeInteger(i)&&i>=0&&(l="array"===s.origin?t.questionSave.tooMany:t.questionSave.tooLong),[l.replace("{field}",n).replace("{maximum}",String(i))]})})(s?.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}(s,t);return n(r),"AI_DAILY_LIMIT_EXCEEDED"!==(0,O.d)(s)&&u.c.error(r),!1}};return{saveError:a,setSaveError:n,dismissSaveError:()=>n(null),run:i}}],752012)},731335,579321,927904,e=>{var t=e.i(843476),r=e.i(399847),s=e.i(551757),a=e.i(456420);let n={name:"clock-3",size:24,node:[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 6v6h4",key:"135r8i"}]]};n.node;let i=(0,a.f)(n);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),h=e.i(215519),f=e.i(306831);let p=["read","convert","crop","compress","upload"],g=["receive","analyze","save"];function x(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 r=Math.round(t);return`${Math.floor(r/60)}:${String(r%60).padStart(2,"0")}`}var v=e.i(975157);let w={analyzing:50,saving:90},y={analyzing:l.f,saving:l.f,review:o.f,saved:s.f,failed:r.f};e.s(["f",0,function({task:e,now:r,onReview:s,onViewItem:a,onRetry:n,onDiscard:l}){let{t:o}=(0,m.b)(),{timeZone:j}=(0,h.M)(),b=y[e.status],k="analyzing"===e.status||"saving"===e.status,S=o.errors,N=e.error?"string"==typeof S[e.error]?S[e.error]:e.error:null,A=function(e){let t=[];for(let r of p){let s=e?.client?.[r];"number"==typeof s&&t.push({stage:r,ms:s})}for(let r of g){let s=e?.server?.[r];"number"==typeof s&&t.push({stage:r,ms:s})}return t}(e.timings),T=k&&r?r-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",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:w[e.status],"aria-label":o.importTasks.stageEstimate,"aria-valuetext":o.common.progress.estimated.replace("{percent}",String(w[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||"-")}),N&&(0,t.jsx)("p",{className:"text-xs text-destructive",children:N}),(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)(i,{className:"h-3 w-3"}),o.importTasks.createdAt.replace("{time}",(0,f.r)(e.createdAt,"MM-dd HH:mm",j))]}),null!==T&&(0,t.jsx)("span",{children:o.importTasks.elapsed.replace("{time}",x(T))}),e.attempts>1&&(0,t.jsx)("span",{children:o.importTasks.attempts.replace("{count}",String(e.attempts))})]}),A.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:A.map(({stage:e,ms:r})=>(0,t.jsxs)("li",{children:[o.importTasks.timings[e]," ",x(r)]},e))})]})]}),(0,t.jsxs)("div",{className:"flex flex-wrap justify-end gap-2",children:["review"===e.status&&s&&(0,t.jsx)(c.f,{size:"sm",onClick:s,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&&n&&(0,t.jsx)(c.f,{size:"sm",onClick:n,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 j=e.i(618566),b=e.i(61425),k=e.i(294114),S=e.i(201276),N=e.i(116331);e.s(["f",0,function(e){let{t}=(0,m.b)(),r=(0,j.useRouter)(),s=e=>{e.unread&&(0,N.N)(e.id).catch(e=>S.V.warn("[ImportTasks]","Mark read failed",{error:e}))};return{openReview:e=>{s(e),r.push(`/import-tasks/${e.id}`)},viewItem:e=>{e.errorItemId&&(s(e),r.push(`/error-items/${e.errorItemId}`))},markRead:s,retry:async r=>{try{await (0,N.R)(r.id),k.c.info(t.importTasks.retried)}catch(e){k.c.error((0,b.f)(e,t))}e?.()},discard:async r=>{if(!await (0,k.u)(t.importTasks.discardConfirm))return!1;let s=!1;try{await (0,N.x)(r.id),k.c.success(t.importTasks.discarded),s=!0}catch(e){k.c.error((0,b.f)(e,t))}return e?.(),s}}}],579321);var A=e.i(271645);e.s(["f",0,function(e,t=1e3){let[r,s]=(0,A.useState)(()=>Date.now());return(0,A.useEffect)(()=>{if(!e)return;let r=setInterval(()=>s(Date.now()),t);return()=>clearInterval(r)},[e,t]),r}],927904)},61425,e=>{var t=e.i(303163);e.s(["f",0,function(e,r){let s=r.common?.messages?.analysisFailed||"Analysis failed, please try again",a=(0,t.d)(e);if(a){let e=r.errors??{};if(!(a in e))return a;let t=e[a];return"string"==typeof t?t:s}let n=(0,t.Z)(e);if(n.includes("fetch")||n.includes("network"))return r.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`${s} (${t})`}return s}])},810104,e=>{var t=e.i(213761);function r(e,t=.008){let s=Math.max(0,e.x-t),a=Math.max(0,e.y-t);return{x:s,y:a,width:Math.min(1,e.x+e.width+t)-s,height:Math.min(1,e.y+e.height+t)-a}}async function s(e){let t=new Image;if(t.decoding="async",t.src=e,await t.decode(),!t.naturalWidth||!t.naturalHeight)throw Error("IMAGE_EMPTY");return t}async function a(e,r){let s=function(e,t=16,r=!1){let s=Math.max(...e.map(e=>e.width)),a=0,n=e.map(e=>{let n=r?s/e.width:e.scale??1,i={x:0,y:a,width:Math.round(e.width*n),height:Math.round(e.height*n)};return a+=i.height+t,i});return{width:Math.max(...n.map(e=>e.width)),height:a-t,rects:n}}(e.map(e=>({width:e.sw,height:e.sh,scale:e.scale})),16,r),a=document.createElement("canvas");a.width=s.width,a.height=s.height;let n=a.getContext("2d");if(!n)throw Error("CANVAS_UNSUPPORTED");n.fillStyle="#ffffff",n.fillRect(0,0,a.width,a.height),e.forEach((e,t)=>{let r=s.rects[t];n.drawImage(e.source,e.sx,e.sy,e.sw,e.sh,r.x,r.y,r.width,r.height)});let i=await createImageBitmap(a);try{return await (0,t.X)({source:i,width:a.width,height:a.height})}finally{i.close()}}async function n(e,s){let n=e.naturalWidth,i=e.naturalHeight,l=s.map(e=>r(e));return 1===l.length?(0,t.X)({source:e,width:n,height:i},l[0]):a(l.map(t=>({source:e,sx:Math.round(t.x*n),sy:Math.round(t.y*i),sw:Math.max(1,Math.round(t.width*n)),sh:Math.max(1,Math.round(t.height*i))})),!1)}async function i(e){return a((await Promise.all(e.map(s))).map(e=>({source:e,sx:0,sy:0,sw:e.naturalWidth,sh:e.naturalHeight})),!0)}async function l(e,t,s){let n=e.naturalWidth,i=e.naturalHeight,l=s.width/n,o=t.map(e=>r(e)).map(t=>({source:e,sx:Math.round(t.x*n),sy:Math.round(t.y*i),sw:Math.max(1,Math.round(t.width*n)),sh:Math.max(1,Math.round(t.height*i)),scale:l}));return o.push({source:s.source,sx:0,sy:0,sw:s.width,sh:s.height}),a(o,!1)}e.s(["y",0,s,"k",0,l,"M",0,n,"v",0,i])},575557,e=>{var t=e.i(41931),r=e.i(116331);async function s(e){let t;for(let r=0;r<3;r++)try{return await e()}catch(e){if(t=e,!function(e){let t=e?.status;return void 0===t||408===t||502===t||503===t||504===t}(e)||2===r)break;await new Promise(e=>setTimeout(e,1e3*(r+1)))}throw t}async function a(e,n=(0,r.c)()){let{batch:i}=await s(()=>t.k.post("/api/import-batches",{...e,clientRequestId:n,subjectId:e.subjectId||void 0,targetSubjectId:e.targetSubjectId||void 0,paperLevel:e.paperLevel||void 0},{timeout:12e4}));return(0,r.P)(),i}async function n(e,r={}){let s=r.image?"?include=image":"",{batch:a}=await t.k.get(`/api/import-batches/${encodeURIComponent(e)}${s}`);return a}async function i(e,r,s){let{batch:a}=await t.k.patch(`/api/import-batches/${encodeURIComponent(e)}`,{version:r,draft:s});return a}async function l(e,a,n){let{batch:i}=await s(()=>t.k.post(`/api/import-batches/${encodeURIComponent(e)}/start`,{version:a,images:n},{timeout:12e4}));return(0,r.P)(),i}async function o(e){let{batch:s}=await t.k.post(`/api/import-batches/${encodeURIComponent(e)}/retry`,{});return(0,r.P)(),s}async function d(e){let s=await t.k.post(`/api/import-batches/${encodeURIComponent(e)}/confirm-all`,{});return(0,r.P)(),s}async function c(e){await t.k.delete(`/api/import-batches/${encodeURIComponent(e)}`),(0,r.P)()}async function u(e){await t.k.post(`/api/import-batches/${encodeURIComponent(e)}/read`,{}),(0,r.P)()}async function m(e,r){return t.k.post(`/api/import-batches/${encodeURIComponent(e)}/fix-text`,{items:r},{timeout:6e5,recoverable:!0})}e.s(["J",0,d,"n",0,function(e){return e?.status===409?e.data?.details?.batch??null:null},"v",0,a,"o",0,c,"w",0,n,"$",0,m,"f",0,u,"s",0,o,"S",0,i,"g",0,l])},364002,e=>{var t=e.i(41931);async function r(){try{return!!(await t.k.get("/api/user")).confirmBeforeImport}catch{return!1}}async function s(e,r){let s=await t.k.post("/api/error-items",{questionText:e.questionText,answerText:e.answerText,analysis:e.analysis,wrongAnswerText:e.wrongAnswerText||null,mistakeAnalysis:e.mistakeAnalysis||null,mistakeStatus:e.mistakeStatus||"unknown",knowledgePoints:e.knowledgePoints||[],difficultyStars:e.difficultyStars??null,recognizedGradeSemester:e.gradeSemester??null,hasFigure:e.hasFigure??!1,figureSvg:e.figureSvg??null,subjectId:r.subjectId||void 0,subjectName:r.subjectId?void 0:e.subject,originalImageUrl:r.imageUrl||"",paperLevel:r.paperLevel||void 0});return{id:s.id,shortId:s.shortId??null,subjectId:s.subjectId??null,notebookName:s.subject?.name??null,duplicate:s.duplicate}}e.i(201276),e.s(["x",0,r,"a",0,s],364002)},825624,e=>{let t=/^[\s ]+/,r="一二三四五六七八九十",s=[{family:"dot",pattern:/^(\d{1,3})\s*[..](?!\d)\s*/},{family:"comma",pattern:/^(\d{1,3})\s*[、,,](?!\d)\s*/},{family:"paren",pattern:/^(\d{1,3})\s*[))]\s*/},{family:"colon",pattern:/^(\d{1,3})\s*[::](?!\d)\s*/},{family:"ti",pattern:/^第\s*(\d{1,3}|[一二三四五六七八九十]{1,3})\s*题\s*[..、::]?\s*/},{family:"example",pattern:/^(?:例题?|练习|习题)\s*(\d{1,3})\s*[..、::]?\s*/},{family:"q",pattern:/^(?:Q|Question|Problem|Exercise)\s*(\d{1,3})\s*[..::)]?\s+/i},{family:"cn",pattern:/^([一二三四五六七八九十]{1,3})\s*[、..]\s*/}];function a(e){let a=e.replace(t,"");for(let{family:e,pattern:t}of s){let s=a.match(t);if(!s||a.length<=s[0].length)continue;let n=function(e){if(/^\d+$/.test(e))return Number(e);if("十"===e)return 10;let t=e.indexOf("十");return -1===t?r.indexOf(e)+1:10*(0===t?1:r.indexOf(e[0])+1)+(t===e.length-1?0:r.indexOf(e[t+1])+1)}(s[1]);if(Number.isFinite(n)&&!(n<=0))return{value:n,family:e,prefixLength:s[0].length,label:s[1]}}return null}function n(e){let t=[];for(let r of e)(r||0!==t.length&&""!==t[t.length-1])&&t.push(r);for(;t.length>0&&""===t[t.length-1];)t.pop();return t.join("\n")}let i=/(姓名|班级|学号|日期|得分|分数|评分|考号|座位号|家长签字|用时|Name\s*[::_]|Class\s*[::_]|Date\s*[::_]|Score\s*[::_])|_{3,}|共\s*\d+\s*(道|题|小题)|做完|答案(见|在)|最后一页|满分\s*\d+\s*分/i,l=/(阅读|材料|短文|文章|选文|诗歌|古诗|文言文|下[面列]的?(表格|图表|统计|信息)|根据.{0,20}(回答|完成)|passage|read the|according to the)/i,o=/^(参考答案|答案与解析|答案|Answers?|Answer Key)\s*[::]?$/i,d=/^(第[一二三四五六七八九十]+(部分|大题|节)|(Part|Section)\s+[A-Z0-9IVX]+\b)/i,c=/(选择|填空|判断|计算|解答|应用|解决问题|操作|作图|阅读|写作|作文|综合|口算|听力|单项|完形|题)/,u=/(\d{1,3})\s*[~~\-—–至到]\s*(\d{1,3})\s*(?:小?题|questions?)/i,m=/(小问|小题|下列问题|以下问题|下列各题|下面各题|完成下列|回答下列|回答以下|following questions|answer the following)/i;function h(e){let t=[],r=[];for(let s of e)s?r.push(s):r.length&&(t.push(r.join("\n")),r=[]);return r.length&&t.push(r.join("\n")),t}function f(e,t){let r=[];for(let s=0;s<e.length;s++){let a=e[s],n=[a];for(let r=s+1;r<e.length;r++){let s=e[r],i=n[n.length-1];if(s.family!==a.family)continue;let l=1===s.value&&[...t].some(e=>e>i.line&&e<s.line);(s.value===i.value+1||l)&&n.push(s)}n.length>r.length&&(r=n)}return r}function p(e,t,r){return!!d.test(e)||!!t&&"cn"===t.family&&"cn"!==r&&null!==r&&(e.length<=40||c.test(e.slice(0,20)))}function g(e){let t=e.match(u);if(!t)return null;let r=Number(t[1]),s=Number(t[2]);return r<=s?{from:r,to:s}:null}e.s(["S",0,60,"i",0,2e4,"J",0,function(e,r={}){let s=e.length>2e4,c=e.slice(0,2e4).replace(/\r\n?/g,"\n").split("\n").map(e=>e.replace(t,"").replace(/[\s ]+$/,"")),x=c.map(e=>e?a(e):null),v=c.length;for(let e=0;e<c.length;e++)if(o.test(c[e])){v=e;break}let w=[],y=[];for(let e=0;e<v;e++){let t=x[e];t&&("cn"===t.family?y:w).push({...t,line:e})}let j=new Set;for(let e=0;e<v;e++)(d.test(c[e])||x[e]?.family==="cn")&&j.add(e);let b=f(w,j);if(b.length<2){let e=f(y,new Set);e.length>=2&&(b=e)}let k=n(c.slice(0,v)),S=v<c.length?h(c.slice(v)):[],N=e=>({questions:k?[{label:null,text:k,material:null,section:null}]:[],ignored:S,detected:!1,ambiguous:e,candidateCount:e?b.length:+!!k,overflow:0,tooLong:s});if(b.length<2)return N(!1);let A=b[0].family;if(!r.forceNumbered&&function(e,t,r,s){let a=null;for(let n=t-1;n>=0;n--)if(e[n]){a=p(e[n],s[n],r)?null:e[n];break}return!(!a||i.test(a)||u.test(a))&&("paren"===r?a.length>=15||/[。?!?!::,,;;]$/.test(a):/[::]$/.test(a)&&m.test(a))}(c,b[0].line,A,x))return N(!0);let T=new Set(b.map(e=>e.line)),I=[],E=[],_=null,C=[],R=[],M=(e,t)=>{for(let r of h(e))(!i.test(r)||!(r.length<80))&&(l.test(r)||r.length>=80&&/[。!?.!?;;]/.test(r))?C.push({text:r,range:g(r)}):t?I.push(r):_&&!E.some(e=>e.section===_)?_=`${_}
|
|
10
|
-
${r}`:I.push(r)},O=b[0].line,P=[];for(let e=0;e<O;e++)c[e]&&p(c[e],x[e],A)?(M(P.splice(0),!0),_=c[e],R=[]):P.push(c[e]);M(P,!0);for(let e=0;e<b.length;e++){let r=b[e].line,s=e+1<b.length?b[e+1].line:v;C.length&&(R=[...R.filter(e=>e.range),...C],C=[]);let i=s,o=null;for(let e=r+1;e<s;e++)if(c[e]&&!T.has(e)&&p(c[e],x[e],A)){i=e,o=c[e];break}let d=c.slice(r,i),u=
|
|
9
|
+
${t.questionSave.databaseCode.replace("{code}",d.databaseCode)}`),a&&(o+=` (HTTP ${a})`),o}(s,t);return n(r),"AI_DAILY_LIMIT_EXCEEDED"!==(0,O.d)(s)&&u.c.error(r),!1}};return{saveError:a,setSaveError:n,dismissSaveError:()=>n(null),run:i}}],752012)},731335,579321,927904,e=>{var t=e.i(843476),r=e.i(399847),s=e.i(551757),a=e.i(456420);let n={name:"clock-3",size:24,node:[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 6v6h4",key:"135r8i"}]]};n.node;let i=(0,a.f)(n);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 p=["read","convert","crop","compress","upload"],g=["receive","analyze","save"];function x(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 r=Math.round(t);return`${Math.floor(r/60)}:${String(r%60).padStart(2,"0")}`}var v=e.i(975157);let w={analyzing:50,saving:90},y={analyzing:l.f,saving:l.f,review:o.f,saved:s.f,failed:r.f};e.s(["f",0,function({task:e,now:r,onReview:s,onViewItem:a,onRetry:n,onDiscard:l}){let{t:o}=(0,m.b)(),{timeZone:j}=(0,f.M)(),b=y[e.status],k="analyzing"===e.status||"saving"===e.status,S=o.errors,N=e.error?"string"==typeof S[e.error]?S[e.error]:e.error:null,A=function(e){let t=[];for(let r of p){let s=e?.client?.[r];"number"==typeof s&&t.push({stage:r,ms:s})}for(let r of g){let s=e?.server?.[r];"number"==typeof s&&t.push({stage:r,ms:s})}return t}(e.timings),T=k&&r?r-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",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:w[e.status],"aria-label":o.importTasks.stageEstimate,"aria-valuetext":o.common.progress.estimated.replace("{percent}",String(w[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||"-")}),N&&(0,t.jsx)("p",{className:"text-xs text-destructive",children:N}),(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)(i,{className:"h-3 w-3"}),o.importTasks.createdAt.replace("{time}",(0,h.r)(e.createdAt,"MM-dd HH:mm",j))]}),null!==T&&(0,t.jsx)("span",{children:o.importTasks.elapsed.replace("{time}",x(T))}),e.attempts>1&&(0,t.jsx)("span",{children:o.importTasks.attempts.replace("{count}",String(e.attempts))})]}),A.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:A.map(({stage:e,ms:r})=>(0,t.jsxs)("li",{children:[o.importTasks.timings[e]," ",x(r)]},e))})]})]}),(0,t.jsxs)("div",{className:"flex flex-wrap justify-end gap-2",children:["review"===e.status&&s&&(0,t.jsx)(c.f,{size:"sm",onClick:s,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&&n&&(0,t.jsx)(c.f,{size:"sm",onClick:n,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 j=e.i(618566),b=e.i(61425),k=e.i(294114),S=e.i(201276),N=e.i(116331);e.s(["f",0,function(e){let{t}=(0,m.b)(),r=(0,j.useRouter)(),s=e=>{e.unread&&(0,N.N)(e.id).catch(e=>S.V.warn("[ImportTasks]","Mark read failed",{error:e}))};return{openReview:e=>{s(e),r.push(`/import-tasks/${e.id}`)},viewItem:e=>{e.errorItemId&&(s(e),r.push(`/error-items/${e.errorItemId}`))},markRead:s,retry:async r=>{try{await (0,N.R)(r.id),k.c.info(t.importTasks.retried)}catch(e){k.c.error((0,b.f)(e,t))}e?.()},discard:async r=>{if(!await (0,k.u)(t.importTasks.discardConfirm))return!1;let s=!1;try{await (0,N.x)(r.id),k.c.success(t.importTasks.discarded),s=!0}catch(e){k.c.error((0,b.f)(e,t))}return e?.(),s}}}],579321);var A=e.i(271645);e.s(["f",0,function(e,t=1e3){let[r,s]=(0,A.useState)(()=>Date.now());return(0,A.useEffect)(()=>{if(!e)return;let r=setInterval(()=>s(Date.now()),t);return()=>clearInterval(r)},[e,t]),r}],927904)},61425,e=>{var t=e.i(303163);e.s(["f",0,function(e,r){let s=r.common?.messages?.analysisFailed||"Analysis failed, please try again",a=(0,t.d)(e);if(a){let e=r.errors??{};if(!(a in e))return a;let t=e[a];return"string"==typeof t?t:s}let n=(0,t.Z)(e);if(n.includes("fetch")||n.includes("network"))return r.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`${s} (${t})`}return s}])},810104,e=>{var t=e.i(213761);function r(e,t=.008){let s=Math.max(0,e.x-t),a=Math.max(0,e.y-t);return{x:s,y:a,width:Math.min(1,e.x+e.width+t)-s,height:Math.min(1,e.y+e.height+t)-a}}async function s(e){let t=new Image;if(t.decoding="async",t.src=e,await t.decode(),!t.naturalWidth||!t.naturalHeight)throw Error("IMAGE_EMPTY");return t}async function a(e,r){let s=function(e,t=16,r=!1){let s=Math.max(...e.map(e=>e.width)),a=0,n=e.map(e=>{let n=r?s/e.width:e.scale??1,i={x:0,y:a,width:Math.round(e.width*n),height:Math.round(e.height*n)};return a+=i.height+t,i});return{width:Math.max(...n.map(e=>e.width)),height:a-t,rects:n}}(e.map(e=>({width:e.sw,height:e.sh,scale:e.scale})),16,r),a=document.createElement("canvas");a.width=s.width,a.height=s.height;let n=a.getContext("2d");if(!n)throw Error("CANVAS_UNSUPPORTED");n.fillStyle="#ffffff",n.fillRect(0,0,a.width,a.height),e.forEach((e,t)=>{let r=s.rects[t];n.drawImage(e.source,e.sx,e.sy,e.sw,e.sh,r.x,r.y,r.width,r.height)});let i=await createImageBitmap(a);try{return await (0,t.X)({source:i,width:a.width,height:a.height})}finally{i.close()}}async function n(e,s){let n=e.naturalWidth,i=e.naturalHeight,l=s.map(e=>r(e));return 1===l.length?(0,t.X)({source:e,width:n,height:i},l[0]):a(l.map(t=>({source:e,sx:Math.round(t.x*n),sy:Math.round(t.y*i),sw:Math.max(1,Math.round(t.width*n)),sh:Math.max(1,Math.round(t.height*i))})),!1)}async function i(e){return a((await Promise.all(e.map(s))).map(e=>({source:e,sx:0,sy:0,sw:e.naturalWidth,sh:e.naturalHeight})),!0)}async function l(e,t,s){let n=e.naturalWidth,i=e.naturalHeight,l=s.width/n,o=t.map(e=>r(e)).map(t=>({source:e,sx:Math.round(t.x*n),sy:Math.round(t.y*i),sw:Math.max(1,Math.round(t.width*n)),sh:Math.max(1,Math.round(t.height*i)),scale:l}));return o.push({source:s.source,sx:0,sy:0,sw:s.width,sh:s.height}),a(o,!1)}e.s(["y",0,s,"k",0,l,"M",0,n,"v",0,i])},575557,e=>{var t=e.i(41931),r=e.i(116331);async function s(e){let t;for(let r=0;r<3;r++)try{return await e()}catch(e){if(t=e,!function(e){let t=e?.status;return void 0===t||408===t||502===t||503===t||504===t}(e)||2===r)break;await new Promise(e=>setTimeout(e,1e3*(r+1)))}throw t}async function a(e,n=(0,r.c)()){let{batch:i}=await s(()=>t.k.post("/api/import-batches",{...e,clientRequestId:n,subjectId:e.subjectId||void 0,targetSubjectId:e.targetSubjectId||void 0,paperLevel:e.paperLevel||void 0},{timeout:12e4}));return(0,r.P)(),i}async function n(e,r={}){let s=r.image?"?include=image":"",{batch:a}=await t.k.get(`/api/import-batches/${encodeURIComponent(e)}${s}`);return a}async function i(e,r,s){let{batch:a}=await t.k.patch(`/api/import-batches/${encodeURIComponent(e)}`,{version:r,draft:s});return a}async function l(e,a,n){let{batch:i}=await s(()=>t.k.post(`/api/import-batches/${encodeURIComponent(e)}/start`,{version:a,images:n},{timeout:12e4}));return(0,r.P)(),i}async function o(e){let{batch:s}=await t.k.post(`/api/import-batches/${encodeURIComponent(e)}/retry`,{});return(0,r.P)(),s}async function d(e){let s=await t.k.post(`/api/import-batches/${encodeURIComponent(e)}/confirm-all`,{});return(0,r.P)(),s}async function c(e){await t.k.delete(`/api/import-batches/${encodeURIComponent(e)}`),(0,r.P)()}async function u(e){await t.k.post(`/api/import-batches/${encodeURIComponent(e)}/read`,{}),(0,r.P)()}async function m(e,r){return t.k.post(`/api/import-batches/${encodeURIComponent(e)}/fix-text`,{items:r},{timeout:6e5,recoverable:!0})}e.s(["J",0,d,"n",0,function(e){return e?.status===409?e.data?.details?.batch??null:null},"v",0,a,"o",0,c,"w",0,n,"$",0,m,"f",0,u,"s",0,o,"S",0,i,"g",0,l])},35209,e=>{var t=e.i(271645),r=e.i(111110);e.s(["f",0,function(...e){let{t:s}=(0,r.b)(),a=[s.pageTitle.base,...e.map(e=>"string"==typeof e?e.trim():"").filter(e=>e.length>0)].join("-");(0,t.useEffect)(()=>{document.title=a},[a])}])},364002,e=>{var t=e.i(41931);async function r(){try{return!!(await t.k.get("/api/user")).confirmBeforeImport}catch{return!1}}async function s(e,r){let s=await t.k.post("/api/error-items",{questionText:e.questionText,answerText:e.answerText,analysis:e.analysis,wrongAnswerText:e.wrongAnswerText||null,mistakeAnalysis:e.mistakeAnalysis||null,mistakeStatus:e.mistakeStatus||"unknown",knowledgePoints:e.knowledgePoints||[],difficultyStars:e.difficultyStars??null,recognizedGradeSemester:e.gradeSemester??null,hasFigure:e.hasFigure??!1,figureSvg:e.figureSvg??null,subjectId:r.subjectId||void 0,subjectName:r.subjectId?void 0:e.subject,originalImageUrl:r.imageUrl||"",paperLevel:r.paperLevel||void 0});return{id:s.id,shortId:s.shortId??null,subjectId:s.subjectId??null,notebookName:s.subject?.name??null,duplicate:s.duplicate}}e.i(201276),e.s(["x",0,r,"a",0,s],364002)},825624,e=>{let t=/^[\s ]+/,r="一二三四五六七八九十",s=[{family:"dot",pattern:/^(\d{1,3})\s*[..](?!\d)\s*/},{family:"comma",pattern:/^(\d{1,3})\s*[、,,](?!\d)\s*/},{family:"paren",pattern:/^(\d{1,3})\s*[))]\s*/},{family:"colon",pattern:/^(\d{1,3})\s*[::](?!\d)\s*/},{family:"ti",pattern:/^第\s*(\d{1,3}|[一二三四五六七八九十]{1,3})\s*题\s*[..、::]?\s*/},{family:"example",pattern:/^(?:例题?|练习|习题)\s*(\d{1,3})\s*[..、::]?\s*/},{family:"q",pattern:/^(?:Q|Question|Problem|Exercise)\s*(\d{1,3})\s*[..::)]?\s+/i},{family:"cn",pattern:/^([一二三四五六七八九十]{1,3})\s*[、..]\s*/}];function a(e){let a=e.replace(t,"");for(let{family:e,pattern:t}of s){let s=a.match(t);if(!s||a.length<=s[0].length)continue;let n=function(e){if(/^\d+$/.test(e))return Number(e);if("十"===e)return 10;let t=e.indexOf("十");return -1===t?r.indexOf(e)+1:10*(0===t?1:r.indexOf(e[0])+1)+(t===e.length-1?0:r.indexOf(e[t+1])+1)}(s[1]);if(Number.isFinite(n)&&!(n<=0))return{value:n,family:e,prefixLength:s[0].length,label:s[1]}}return null}function n(e){let t=[];for(let r of e)(r||0!==t.length&&""!==t[t.length-1])&&t.push(r);for(;t.length>0&&""===t[t.length-1];)t.pop();return t.join("\n")}let i=/(姓名|班级|学号|日期|得分|分数|评分|考号|座位号|家长签字|用时|Name\s*[::_]|Class\s*[::_]|Date\s*[::_]|Score\s*[::_])|_{3,}|共\s*\d+\s*(道|题|小题)|做完|答案(见|在)|最后一页|满分\s*\d+\s*分/i,l=/(阅读|材料|短文|文章|选文|诗歌|古诗|文言文|下[面列]的?(表格|图表|统计|信息)|根据.{0,20}(回答|完成)|passage|read the|according to the)/i,o=/^(参考答案|答案与解析|答案|Answers?|Answer Key)\s*[::]?$/i,d=/^(第[一二三四五六七八九十]+(部分|大题|节)|(Part|Section)\s+[A-Z0-9IVX]+\b)/i,c=/(选择|填空|判断|计算|解答|应用|解决问题|操作|作图|阅读|写作|作文|综合|口算|听力|单项|完形|题)/,u=/(\d{1,3})\s*[~~\-—–至到]\s*(\d{1,3})\s*(?:小?题|questions?)/i,m=/(小问|小题|下列问题|以下问题|下列各题|下面各题|完成下列|回答下列|回答以下|following questions|answer the following)/i;function f(e){let t=[],r=[];for(let s of e)s?r.push(s):r.length&&(t.push(r.join("\n")),r=[]);return r.length&&t.push(r.join("\n")),t}function h(e,t){let r=[];for(let s=0;s<e.length;s++){let a=e[s],n=[a];for(let r=s+1;r<e.length;r++){let s=e[r],i=n[n.length-1];if(s.family!==a.family)continue;let l=1===s.value&&[...t].some(e=>e>i.line&&e<s.line);(s.value===i.value+1||l)&&n.push(s)}n.length>r.length&&(r=n)}return r}function p(e,t,r){return!!d.test(e)||!!t&&"cn"===t.family&&"cn"!==r&&null!==r&&(e.length<=40||c.test(e.slice(0,20)))}function g(e){let t=e.match(u);if(!t)return null;let r=Number(t[1]),s=Number(t[2]);return r<=s?{from:r,to:s}:null}e.s(["S",0,60,"i",0,2e4,"J",0,function(e,r={}){let s=e.length>2e4,c=e.slice(0,2e4).replace(/\r\n?/g,"\n").split("\n").map(e=>e.replace(t,"").replace(/[\s ]+$/,"")),x=c.map(e=>e?a(e):null),v=c.length;for(let e=0;e<c.length;e++)if(o.test(c[e])){v=e;break}let w=[],y=[];for(let e=0;e<v;e++){let t=x[e];t&&("cn"===t.family?y:w).push({...t,line:e})}let j=new Set;for(let e=0;e<v;e++)(d.test(c[e])||x[e]?.family==="cn")&&j.add(e);let b=h(w,j);if(b.length<2){let e=h(y,new Set);e.length>=2&&(b=e)}let k=n(c.slice(0,v)),S=v<c.length?f(c.slice(v)):[],N=e=>({questions:k?[{label:null,text:k,material:null,section:null}]:[],ignored:S,detected:!1,ambiguous:e,candidateCount:e?b.length:+!!k,overflow:0,tooLong:s});if(b.length<2)return N(!1);let A=b[0].family;if(!r.forceNumbered&&function(e,t,r,s){let a=null;for(let n=t-1;n>=0;n--)if(e[n]){a=p(e[n],s[n],r)?null:e[n];break}return!(!a||i.test(a)||u.test(a))&&("paren"===r?a.length>=15||/[。?!?!::,,;;]$/.test(a):/[::]$/.test(a)&&m.test(a))}(c,b[0].line,A,x))return N(!0);let T=new Set(b.map(e=>e.line)),I=[],E=[],_=null,C=[],R=[],M=(e,t)=>{for(let r of f(e))(!i.test(r)||!(r.length<80))&&(l.test(r)||r.length>=80&&/[。!?.!?;;]/.test(r))?C.push({text:r,range:g(r)}):t?I.push(r):_&&!E.some(e=>e.section===_)?_=`${_}
|
|
10
|
+
${r}`:I.push(r)},O=b[0].line,P=[];for(let e=0;e<O;e++)c[e]&&p(c[e],x[e],A)?(M(P.splice(0),!0),_=c[e],R=[]):P.push(c[e]);M(P,!0);for(let e=0;e<b.length;e++){let r=b[e].line,s=e+1<b.length?b[e+1].line:v;C.length&&(R=[...R.filter(e=>e.range),...C],C=[]);let i=s,o=null;for(let e=r+1;e<s;e++)if(c[e]&&!T.has(e)&&p(c[e],x[e],A)){i=e,o=c[e];break}let d=c.slice(r,i),u=f(d),m=[];for(;u.length>1&&l.test(u[u.length-1].slice(0,30));)m.unshift(u.pop());let h=m.length?u.join("\n"):n(d),w=b[e].value,y=R.filter(e=>!e.range||w>=e.range.from&&w<=e.range.to);for(let r of(E.push({label:b[e].label,text:function(e){let r=e.split("\n"),s=r[0]?.replace(t,"")??"",n=a(s);return n&&"cn"!==n.family&&(r[0]=s.slice(n.prefixLength)),r.join("\n")}(h),material:y.length?y.map(e=>e.text).join("\n\n"):null,section:_}),m))C.push({text:r,range:g(r)});null!==o&&(_=o,R=[],M(c.slice(i+1,s),!1))}let $=E.slice(60);return{questions:E.slice(0,60),ignored:[...I,...S,...$.map(e=>{var t;let r,s;return r=(t=e).text.trim(),(s=t.material?.trim())?`${s}
|
|
11
11
|
|
|
12
12
|
${r}`:r})],detected:!0,ambiguous:!1,candidateCount:E.length,overflow:$.length,tooLong:s}}])}])})();
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
(()=>{"use strict";(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,981140,e=>{var t=Object.defineProperty,r=(e,r)=>t(e,"name",{value:r,configurable:!0}),n=!!("u">typeof window&&window.document&&window.document.createElement);function i(e,t,{checkForDefaultPrevented:n=!0}={}){return r(function(r){if(e?.(r),!1===n||!r||!r.defaultPrevented)return t?.(r)},"handleEvent")}function o(e){if(!n)throw Error("Cannot access document outside of the DOM");return e?.ownerDocument??document}function a(e){return"IFRAME"===e.tagName}r(i,"composeEventHandlers"),r(function(e){if(!n)throw Error("Cannot access window outside of the DOM");return e?.ownerDocument?.defaultView??window},"getOwnerWindow"),r(o,"getOwnerDocument"),r(function e(t,r=!1){let{activeElement:n}=o(t);if(!n?.nodeName)return null;if(a(n)&&n.contentDocument)return e(n.contentDocument.body,r);if(r){let e=n.getAttribute("aria-activedescendant");if(e){let t=o(n).getElementById(e);if(t)return t}}return n},"getActiveElement"),r(a,"isFrame"),e.s(["f",0,i])},705844,e=>{e.s(["f",0,!1])},30030,e=>{var t=e.i(271645),r=e.i(843476),n=Object.defineProperty,i=(e,t)=>n(e,"name",{value:t,configurable:!0});function o(e,n=[]){let s=[];function u(n,o){let a=t.createContext(o);a.displayName=n+"Context";let u=s.length;s=[...s,o];let l=i(n=>{let{scope:i,children:o,...s}=n,l=i?.[e]?.[u]||a,c=t.useMemo(()=>s,Object.values(s));return(0,r.jsx)(l.Provider,{value:c,children:o})},"Provider");function c(r,i,s={}){let{optional:l=!1}=s,f=i?.[e]?.[u]||a,d=t.useContext(f);if(d)return d;if(void 0!==o)return o;if(!l)throw Error(`\`${r}\` must be used within \`${n}\``)}return l.displayName=n+"Provider",i(c,"useContext"),[l,c]}i(u,"createContext");let l=i(()=>{let r=s.map(e=>t.createContext(e));return i(function(n){let i=n?.[e]||r;return t.useMemo(()=>({[`__scope${e}`]:{...n,[e]:i}}),[n,i])},"useScope")},"createScope");return l.scopeName=e,[u,a(l,...n)]}function a(...e){let r=e[0];if(1===e.length)return r;let n=i(()=>{let n=e.map(e=>({useScope:e(),scopeName:e.scopeName}));return i(function(e){let i=n.reduce((t,{useScope:r,scopeName:n})=>{let i=r(e)[`__scope${n}`];return{...t,...i}},{});return t.useMemo(()=>({[`__scope${r.scopeName}`]:i}),[i])},"useComposedScopes")},"createScope");return n.scopeName=r.scopeName,n}i(function(e,n){let o=t.createContext(n);o.displayName=e+"Context";let a=i(e=>{let{children:n,...i}=e,a=t.useMemo(()=>i,Object.values(i));return(0,r.jsx)(o.Provider,{value:a,children:n})},"Provider");function s(r,i={}){let{optional:a=!1}=i,u=t.useContext(o);if(u)return u;if(void 0!==n)return n;if(!a)throw Error(`\`${r}\` must be used within \`${e}\``)}return a.displayName=e+"Provider",i(s,"useContext"),[a,s]},"createContext"),i(o,"createContextScope"),i(a,"composeContextScopes"),e.s(["f",0,o])},296626,e=>{var t=e.i(271645),r=e.i(934620),n=Object.defineProperty,i=(e,t)=>n(e,"name",{value:t,configurable:!0});function o(e,r){return t.useReducer((e,t)=>r[e][t]??e,e)}i(o,"useStateMachine");var a=i(e=>{let{present:r,children:n}=e,i=s(r),o="function"==typeof n?n({present:i.isPresent}):t.Children.only(n),a=l(i.ref,f(o));return"function"==typeof n||i.isPresent?t.cloneElement(o,{ref:a}):null},"Presence");function s(e){let[n,a]=t.useState(),s=t.useRef(null),u=t.useRef(e),l=t.useRef("none"),f=t.useRef(void 0),[d,m]=o(e?"mounted":"unmounted",{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return t.useEffect(()=>{"mounted"===d?(l.current=f.current??c(s.current),f.current=void 0):l.current="none"},[d]),(0,r.f)(()=>{let t=s.current,r=u.current;if(r!==e){let n=l.current,i=c(t);e?(f.current=i,m("MOUNT")):"none"===i||t?.display==="none"?m("UNMOUNT"):r&&n!==i?m("ANIMATION_OUT"):m("UNMOUNT"),u.current=e}},[e,m]),(0,r.f)(()=>{if(n){let e,t=n.ownerDocument.defaultView??window,r=i(r=>{let i=c(s.current).includes(CSS.escape(r.animationName));if(r.target===n&&i&&(m("ANIMATION_END"),!u.current)){let r=n.style.animationFillMode;n.style.animationFillMode="forwards",e=t.setTimeout(()=>{"forwards"===n.style.animationFillMode&&(n.style.animationFillMode=r)})}},"handleAnimationEnd"),o=i(e=>{e.target===n&&(l.current=c(s.current))},"handleAnimationStart");return n.addEventListener("animationstart",o),n.addEventListener("animationcancel",r),n.addEventListener("animationend",r),()=>{t.clearTimeout(e),n.removeEventListener("animationstart",o),n.removeEventListener("animationcancel",r),n.removeEventListener("animationend",r)}}m("ANIMATION_END")},[n,m]),{isPresent:["mounted","unmountSuspended"].includes(d),ref:t.useCallback(e=>{if(e){let t=getComputedStyle(e);s.current=t,f.current=c(t)}else s.current=null;a(e)},[])}}function u(e,t){if("function"==typeof e)return e(t);null!=e&&(e.current=t)}function l(...e){let r=t.useRef(e);return r.current=e,t.useCallback(e=>{let t=r.current,n=!1,i=t.map(t=>{let r=u(t,e);return n||"function"!=typeof r||(n=!0),r});if(n)return()=>{for(let e=0;e<i.length;e++){let r=i[e];"function"==typeof r?r():u(t[e],null)}}},[])}function c(e){return e?.animationName||"none"}function f(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,r=t&&"isReactWarning"in t&&t.isReactWarning;return r?e.ref:(r=(t=Object.getOwnPropertyDescriptor(e,"ref")?.get)&&"isReactWarning"in t&&t.isReactWarning)?e.props.ref:e.props.ref||e.ref}i(s,"usePresence"),i(u,"setRef"),i(l,"useStableComposedRefs"),i(c,"getAnimationName"),i(f,"getElementRef"),e.s(["f",0,a])},248425,e=>{var t=e.i(271645),r=e.i(174080),n=e.i(991918),i=e.i(843476),o=Object.defineProperty,a=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"].reduce((e,r)=>{let o=(0,n.B)(`Primitive.${r}`),a=t.forwardRef((e,t)=>{let{asChild:n,...a}=e;return"u">typeof window&&(window[Symbol.for("radix-ui")]=!0),(0,i.jsx)(n?o:r,{...a,ref:t})});return a.displayName=`Primitive.${r}`,{...e,[r]:a}},{});function s(e,t){e&&r.flushSync(()=>e.dispatchEvent(t))}o(s,"name",{value:"dispatchDiscreteCustomEvent",configurable:!0}),e.s(["V",0,a,"u",0,s])},369340,e=>{var t=e.i(271645),r=e.i(705844),n=e.i(934620),i=Object.defineProperty,o=t[" useEffectEvent ".trim().toString()],a=t[" useInsertionEffect ".trim().toString()];function s(e){if("function"==typeof o)return o(e);let r=t.useRef(()=>{throw Error("Cannot call an event handler while rendering.")});return"function"==typeof a?a(()=>{r.current=e}):(0,n.f)(()=>{r.current=e}),t.useMemo(()=>(...e)=>r.current?.(...e),[])}i(s,"name",{value:"useEffectEvent",configurable:!0});var u=Object.defineProperty,l=(e,t)=>u(e,"name",{value:t,configurable:!0}),c=t[" useInsertionEffect ".trim().toString()]||n.f;function f({prop:e,defaultProp:n,onChange:i=l(()=>{},"onChange"),caller:o}){let[a,s,u]=d({defaultProp:n,onChange:i}),c=void 0!==e,p=c?e:a;if(r.f){let r=t.useRef(void 0!==e);t.useEffect(()=>{let e=r.current;if(e!==c){let t=c?"controlled":"uncontrolled";console.warn(`${o} is changing from ${e?"controlled":"uncontrolled"} to ${t}. Components should not switch from controlled to uncontrolled (or vice versa). Decide between using a controlled or uncontrolled value for the lifetime of the component.`)}r.current=c},[c,o])}return[p,t.useCallback(t=>{if(c){let r=m(t)?t(e):t;r!==e&&u.current?.(r)}else s(t)},[c,e,s,u])]}function d({defaultProp:e,onChange:r}){let[n,i]=t.useState(e),o=t.useRef(n),a=t.useRef(r);return c(()=>{a.current=r},[r]),t.useEffect(()=>{o.current!==n&&(a.current?.(n),o.current=n)},[n,o]),[n,i,a]}function m(e){return"function"==typeof e}l(f,"useControllableState"),l(d,"useUncontrolledState"),l(m,"isFunction");var p=Symbol("RADIX:SYNC_STATE");l(function(e,n,i,o){let{prop:a,defaultProp:u,onChange:l,caller:c}=n,f=void 0!==a,d=s(l);if(r.f){let e=t.useRef(void 0!==a);t.useEffect(()=>{let t=e.current;if(t!==f){let e=f?"controlled":"uncontrolled";console.warn(`${c} is changing from ${t?"controlled":"uncontrolled"} to ${e}. Components should not switch from controlled to uncontrolled (or vice versa). Decide between using a controlled or uncontrolled value for the lifetime of the component.`)}e.current=f},[f,c])}let m=[{...i,state:u}];o&&m.push(o);let[v,h]=t.useReducer((t,r)=>{if(r.type===p)return{...t,state:r.state};let n=e(t,r);return f&&!Object.is(n.state,t.state)&&d(n.state),n},...m),g=v.state,y=t.useRef(g);t.useEffect(()=>{y.current!==g&&(y.current=g,f||d(g))},[g,y,f]);let w=t.useMemo(()=>void 0!==a?{...v,state:a}:v,[v,a]);return t.useEffect(()=>{f&&!Object.is(a,v.state)&&h({type:p,state:a})},[a,v.state,f]),[w,h]},"useControllableStateReducer"),e.s(["f",0,f],369340)},934620,e=>{var t=e.i(271645),r=globalThis?.document?t.useLayoutEffect:()=>{};e.s(["f",0,r])},635804,e=>{var t=e.i(271645),r=e.i(934620);function n(e){let[n,i]=t.useState(void 0);return(0,r.f)(()=>{if(e){i({width:e.offsetWidth,height:e.offsetHeight});let t=0,r=new ResizeObserver(r=>{if(!Array.isArray(r)||!r.length)return;let n=r[0];window.cancelAnimationFrame(t),t=window.requestAnimationFrame(()=>{let t,r;if("borderBoxSize"in n){let e=n.borderBoxSize,i=Array.isArray(e)?e[0]:e;t=i.inlineSize,r=i.blockSize}else t=e.offsetWidth,r=e.offsetHeight;i({width:t,height:r})})});return r.observe(e,{box:"border-box"}),()=>{window.cancelAnimationFrame(t),r.unobserve(e)}}i(void 0)},[e]),n}(0,Object.defineProperty)(n,"name",{value:"useSize",configurable:!0}),e.s(["f",0,n])},856423,e=>{var t=e.i(456420);let r={name:"book-open",size:24,node:[["path",{d:"M12 5v16",key:"1f6ucr"}],["path",{d:"M20.001 19A2 2 0 0022 17V5a2 2 0 00-1.999-2L16 3.002A5 5 0 0012 5a5 5 0 00-4-2H4a2 2 0 00-2 2v12a2 2 0 001.999 2H8a5 5 0 014 2 5 5 0 014-2z",key:"1fyvmf"}]]};r.node;let n=(0,t.f)(r);e.s(["f",0,n],856423)},689664,e=>{var t=e.i(456420);let r={name:"check",size:24,node:[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]]};r.node;let n=(0,t.f)(r);e.s(["f",0,n],689664)},551757,e=>{var t=e.i(456420);let r={name:"circle-check",size:24,node:[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m16 9-5.5 5.5L8 12",key:"xofnsj"}]],aliases:["check-circle-2"]};r.node;let n=(0,t.f)(r);e.s(["f",0,n],551757)},772382,e=>{var t=e.i(456420);let r={name:"eye",size:24,node:[["path",{d:"M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0",key:"1nclc0"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]]};r.node;let n=(0,t.f)(r);e.s(["f",0,n],772382)},632781,e=>{var t=e.i(456420);let r={name:"loader-circle",size:24,node:[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]],aliases:["loader-2"]};r.node;let n=(0,t.f)(r);e.s(["f",0,n],632781)},395925,e=>{var t=e.i(456420);let r={name:"rotate-ccw",size:24,node:[["path",{d:"M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8",key:"1357e3"}],["path",{d:"M3 3v5h5",key:"1xhq8a"}]]};r.node;let n=(0,t.f)(r);e.s(["f",0,n],395925)},759659,e=>{var t=e.i(456420);let r={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"]};r.node;let n=(0,t.f)(r);e.s(["f",0,n],759659)},853138,e=>{var t=e.i(456420);let r={name:"triangle-alert",size:24,node:[["path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3",key:"wmoenq"}],["path",{d:"M12 9v4",key:"juzpu7"}],["path",{d:"M12 17h.01",key:"p32p05"}]],aliases:["alert-triangle"]};r.node;let n=(0,t.f)(r);e.s(["f",0,n],853138)},28342,676167,e=>{var t=e.i(843476),r=e.i(111110);let n=["一年级","二年级","三年级","四年级","五年级","六年级","初一","初二","初三","高一","高二","高三","大一","大二","大三","大四"],i=n.flatMap(e=>[`${e}上`,`${e}下`]),o={primary:{start:0,end:6},junior_high:{start:6,end:9},senior_high:{start:9,end:12},university:{start:12,end:16}};e.s(["T",0,n,"H",0,i,"c",0,function(e){let t=o[e];return t?n.slice(t.start,t.end):[]},"p",0,function(e){return e.endsWith("上")?{grade:e.slice(0,-1),semester:"上"}:e.endsWith("下")?{grade:e.slice(0,-1),semester:"下"}:null}],676167),e.s(["f",0,function({id:e,value:o,onChange:a,disabled:s}){let{t:u}=(0,r.b)();return(0,t.jsxs)("select",{id:e,value:o,onChange:e=>a(e.target.value),disabled:s,"aria-label":u.editor.gradeSemester,className:"h-10 w-full min-w-0 rounded-md border border-input bg-background px-3 text-sm disabled:opacity-50",children:[(0,t.jsx)("option",{value:"",children:u.common.notSet}),o&&!i.includes(o)&&(0,t.jsx)("option",{value:o,children:o}),n.flatMap((e,r)=>["上","下"].map((n,i)=>(0,t.jsxs)("option",{value:`${e}${n}`,children:[u.gradeSelection.names[r]," · ",0===i?u.gradeSelection.firstSemester:u.gradeSelection.secondSemester]},`${e}${n}`)))]})}],28342)},487486,e=>{var t=e.i(843476),r=e.i(991918),n=e.i(225913),i=e.i(975157);let o=(0,n.f)("inline-flex items-center justify-center rounded-full border px-2 py-0.5 text-xs font-medium w-fit whitespace-nowrap shrink-0 [&>svg]:size-3 gap-1 [&>svg]:pointer-events-none focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive transition-[color,box-shadow] overflow-hidden",{variants:{variant:{default:"border-transparent bg-primary text-primary-foreground [a&]:hover:bg-primary/90",secondary:"border-transparent bg-secondary text-secondary-foreground [a&]:hover:bg-secondary/90",destructive:"border-transparent bg-destructive text-white [a&]:hover:bg-destructive/90 focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40 dark:bg-destructive/60",outline:"text-foreground [a&]:hover:bg-accent [a&]:hover:text-accent-foreground"}},defaultVariants:{variant:"default"}});e.s(["f",0,function({className:e,variant:n,asChild:a=!1,...s}){let u=a?r.M:"span";return(0,t.jsx)(u,{"data-slot":"badge",className:(0,i.f)(o({variant:n}),e),...s})}])},110204,e=>{var t=e.i(843476),r=e.i(271645),n=e.i(248425),i=Object.defineProperty,o=r.forwardRef(i(function(e,r){return(0,t.jsx)(n.V.label,{...e,ref:r,onMouseDown:t=>{t.target.closest("button, input, select, textarea")||(e.onMouseDown?.(t),!t.defaultPrevented&&t.detail>1&&t.preventDefault())}})},"name",{value:"Label",configurable:!0})),a=e.i(975157);e.s(["f",0,function({className:e,...r}){return(0,t.jsx)(o,{"data-slot":"label",className:(0,a.f)("flex items-center gap-2 text-sm leading-none font-medium select-none group-data-[disabled=true]:pointer-events-none group-data-[disabled=true]:opacity-50 peer-disabled:cursor-not-allowed peer-disabled:opacity-50",e),...r})}],110204)},624687,e=>{var t=e.i(843476),r=e.i(975157);e.s(["f",0,function({className:e,...n}){return(0,t.jsx)("textarea",{"data-slot":"textarea",className:(0,r.f)("border-input placeholder:text-muted-foreground focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive dark:bg-input/30 flex field-sizing-content min-h-16 w-full rounded-md border bg-transparent px-3 py-2 text-base shadow-xs transition-[color,box-shadow] outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50 md:text-sm",e),...n})}])},215519,e=>{var t=e.i(843476),r=e.i(271645),n=e.i(306831);let i=(0,r.createContext)({timeZone:n.J,setTimeZone:()=>void 0});e.s(["n",0,function({children:e,initialTimeZone:o=n.J}){let[a,s]=(0,r.useState)(o);return(0,t.jsx)(i.Provider,{value:{timeZone:a,setTimeZone:s},children:e})},"M",0,function(){return(0,r.useContext)(i)}])},41931,294114,e=>{let t={success:2500,info:3500,warning:4500,error:5e3},r={toasts:[],confirm:null},n=1,i=new Set;function o(e){r=e,i.forEach(e=>e(r))}function a(e){o({...r,toasts:r.toasts.filter(t=>t.id!==e)})}function s(e,i){let s="string"==typeof i?i:String(i??"");if(!s)return;let u=n++;o({...r,toasts:[...r.toasts.slice(-3),{id:u,type:e,message:s}]}),setTimeout(()=>a(u),t[e])}let u={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===i.size?Promise.resolve("function"==typeof window.confirm&&window.confirm(e)):(r.confirm?.resolve(!1),new Promise(i=>{let a=n++;o({...r,confirm:{...t,id:a,message:e,resolve:e=>{r.confirm?.id===a&&o({...r,confirm:null}),i(e)}}})}))},"p",0,a,"M",0,function(e){return i.add(e),e(r),()=>{i.delete(e)}},"c",0,u],294114);var l=e.i(869253);class c extends Error{status;statusText;data;constructor(e,t,r){super(`API Error: ${e} ${t}`),this.status=e,this.statusText=t,this.data=r,this.name="ApiError"}}function f(e){if("object"!=typeof e||null===e||!("code"in e)||"AI_DAILY_LIMIT_EXCEEDED"!==e.code)return;let t="zh";try{"en"===localStorage.getItem("app-language")&&(t="en")}catch{}u.warning(l.f[t].errors.AI_DAILY_LIMIT_EXCEEDED)}let d=e=>new Promise(t=>setTimeout(t,e));async function m(e,t,r){let n=Date.now();for(;Date.now()<t;){let t=null;try{t=await p(`/api/requests/${e}`,{method:"GET",timeout:15e3})}catch(e){if(e instanceof c&&404===e.status&&Date.now()-n>6e3)throw r}if(t?.state==="done"){if(t.status>=200&&t.status<300)return t.body??{};throw 429===t.status&&f(t.body),new c(t.status,"",t.body)}await d(3e3)}throw new c(408,"Request Timeout",{message:"AI_TIMEOUT_ERROR"})}async function p(e,t={}){let r,{params:n,headers:i,timeout:o=6e4,recoverable:a,...s}=t,u=a?(r=new Uint8Array(16),crypto.getRandomValues(r),Array.from(r,e=>e.toString(16).padStart(2,"0")).join("")):null,l=Date.now(),d=e;if(n){let e=new URLSearchParams(n);d+=`?${e.toString()}`}let v=new AbortController,h=setTimeout(()=>v.abort(),o);try{let e=await fetch(d,{headers:{"Content-Type":"application/json",...u?{"X-Request-Id":u}:{},...i},signal:v.signal,...s});if(clearTimeout(h),!e.ok){let t,r=await e.text();try{t=JSON.parse(r)}catch{t=r}throw 429===e.status&&f(t),new c(e.status,e.statusText,t)}if(204===e.status)return{};try{return await e.json()}catch{return{}}}catch(e){if(clearTimeout(h),e instanceof Error&&"AbortError"===e.name)throw new c(408,"Request Timeout",{message:"AI_TIMEOUT_ERROR"});if(u&&e instanceof TypeError)return m(u,l+o,e);throw e}}e.s(["a",0,c,"k",0,{get:(e,t)=>p(e,{...t,method:"GET"}),post:(e,t,r)=>p(e,{...r,method:"POST",body:JSON.stringify(t)}),put:(e,t,r)=>p(e,{...r,method:"PUT",body:JSON.stringify(t)}),patch:(e,t,r)=>p(e,{...r,method:"PATCH",body:JSON.stringify(t)}),delete:(e,t)=>p(e,{...t,method:"DELETE"})}],41931)},303163,e=>{e.s(["L",0,function(e){if("object"!=typeof e||null===e||!("data"in e))return;let{data:t}=e;if("object"==typeof t&&null!==t&&"details"in t)return"string"==typeof t.details&&t.details?t.details:void 0},"d",0,function(e){if("object"!=typeof e||null===e||!("data"in e))return;let{data:t}=e;if("object"==typeof t&&null!==t&&"message"in t)return"string"==typeof t.message?t.message:void 0},"Z",0,function(e){return e instanceof Error?e.message:String(e)}])},113381,e=>{var t=e.i(303163);let r=["Line","Segment","Ray","Point","Circle","Ellipse","Hyperbola","Parabola","Polygon","Intersect","Midpoint","PerpendicularLine","Angle","Text","Slider","Locus","Reflect","Translate","Rotate","Vector","UnitVector","OrthogonalVector","Distance","Length","Area","Tangent","Arc","CircularArc","Semicircle","Sequence","Element","If","Sum","Integral","Derivative","Root","Extremum","sin","cos","tan","asin","acos","atan","sqrt","abs","exp","ln","log","floor","ceil","round","min","max"],n=["setCoordSystem","setAxesVisible","setGridVisible","setColor","setLineThickness","setLineStyle","setPointSize","setPointStyle","setLabelVisible","setCaption","setVisible","setFilling","setValue","setFixed","setBackgroundColor"],i=new Map(n.map(e=>[e.toLowerCase(),e])),o=new Set(r.map(e=>e.toLowerCase())),a=/(?:java|vb)script\s*:|[\u0000-\u0008\u000b\u000c\u000e-\u001f]/i;function s(e){if(a.test(e)||/<\s*\/?\s*(?:script|iframe|img|svg|object|embed|html)\b/i.test(e))return!0;for(let t of e.matchAll(/"(?:\\.|[^"\\])*"|'(?:\\.|[^'\\])*'/g))try{let e=l(t[0]);if("string"==typeof e&&(/<\s*\/?\s*[a-z!][^>]*>/i.test(e)||a.test(e)))return!0;if(t[0].startsWith('"'))try{let e=JSON.parse(t[0]);if("string"==typeof e&&(/<\s*\/?\s*[a-z!][^>]*>/i.test(e)||/(?:java|vb)script\s*:/i.test(e)))return!0}catch{}}catch{return!0}return!1}function u(e){if(!e.trim())return[];let t=[],r="",n=!1,i=0,o=0;for(let a=0;a<e.length;a++){let s=e[a];if(r)n?n=!1:"\\"===s?n=!0:s===r&&(r="");else if('"'===s||"'"===s)r=s;else if("["===s)i++;else if("]"===s){if(--i<0)throw Error("参数括号不匹配")}else","===s&&0===i&&(t.push(e.slice(o,a).trim()),o=a+1)}if(r||i||n)throw Error("参数未闭合");return t.push(e.slice(o).trim()),t}function l(e){if(/^[+-]?(?:\d+\.?\d*|\.\d+)(?:e[+-]?\d+)?$/i.test(e)){let t=Number(e);if(Number.isFinite(t))return t}if("true"===e||"false"===e)return"true"===e;if(e.startsWith("[")&&e.endsWith("]"))return u(e.slice(1,-1)).map(l);let t=e[0];if(('"'===t||"'"===t)&&e.endsWith(t)){let r=e.slice(1,-1),n="";for(let e=0;e<r.length;e++){if(r[e]===t)throw Error("字符串包含未转义引号");if("\\"!==r[e])n+=r[e];else{let i=r[++e];if(void 0===i)throw Error("字符串转义未闭合");n+="\\"===i||i===t?i:"\\"+i}}return n}if(/^[\p{L}_][\p{L}\p{N}_]*$/u.test(e))return e;throw Error("API 参数必须是字面值")}e.s(["r",0,n,"I",0,r,"i",0,function(e){if(!e?.trim())return[];let t=e.trim();if(t.startsWith("["))try{let e=JSON.parse(t);if(Array.isArray(e))return e.filter(e=>"string"==typeof e&&!!e.trim())}catch{}return t.split("\n").map(e=>e.trim()).filter(e=>e&&!e.startsWith("//"))},"L",0,function(e,r){let n=[],a=new Set;for(let c of r)try{if(s(c))throw Error("命令包含不允许的脚本或标记");if(function(e){let t=e.trim().match(/^(\w+)\s*\(/)?.[1].toLowerCase();return!!t&&i.has(t)}(c)){let t=function(e){let t=e.trim().match(/^(\w+)\s*\(([\s\S]*)\)$/);if(!t)return null;let r=i.get(t[1].toLowerCase());if(!r)return null;try{let e=u(t[2]).map(l);return{m:r,a:e}}catch{return null}}(c),r=t?e[t.m]:void 0;if(!t||"function"!=typeof r)throw Error("API 方法或参数无效");r.apply(e,t.a)}else{if(!function(e,t=new Set){if(!e.trim()||s(e)||/[;`\r\n]/.test(e))return!1;let r=e.replace(/"(?:\\.|[^"\\])*"|'(?:\\.|[^'\\])*'/g,"");if(/["']/.test(r)||/(?:https?:|\b(?:ggbApplet|window|document)\b)/i.test(r)||/\b(?:Execute|RunClickScript|RunUpdateScript|JavaScript|eval|Function|Open|PlaySound|ReadText)\b/i.test(r))return!1;let n=r.match(/^\s*([\p{L}_][\p{L}\p{N}_]*)\s*\([^)]*\)\s*=/u)?.[1];for(let e of r.matchAll(/([\p{L}_][\p{L}\p{N}_]*)\s*[(\[]/gu)){let r=e[1];if(!o.has(r.toLowerCase())&&r!==n&&!t.has(r))return!1}return!0}(c,a))throw Error("指令不在允许范围内");if(!e.evalCommand(c.trim()))throw Error("GeoGebra 未能执行该命令");let t=c.match(/^\s*([\p{L}_][\p{L}\p{N}_]*)\s*\([^)]*\)\s*=/u)?.[1];t&&a.add(t)}}catch(e){n.push({command:c,message:(0,t.Z)(e)})}return n}])},116331,e=>{var t=e.i(41931);let r="wrong-notebook:import-tasks-changed";function n(){window.dispatchEvent(new Event(r))}function i(){let e=new Uint8Array(16);return crypto.getRandomValues(e),Array.from(e,e=>e.toString(16).padStart(2,"0")).join("")}async function o(e,r=i()){let a;for(let i=0;i<3;i++)try{let{task:i}=await t.k.post("/api/import-tasks",{...e,clientRequestId:r,subjectId:e.subjectId||void 0,targetSubjectId:e.targetSubjectId||void 0,paperLevel:e.paperLevel||void 0},{timeout:12e4});return n(),i}catch(e){if(a=e,!function(e){let t=e?.status;return void 0===t||408===t||502===t||503===t||504===t}(e)||2===i)break;await new Promise(e=>setTimeout(e,1e3*(i+1)))}throw a}async function a(e,r={}){let n=r.image?"?include=image":"",{task:i}=await t.k.get(`/api/import-tasks/${encodeURIComponent(e)}${n}`);return i}async function s(e,r){let i=await t.k.post(`/api/import-tasks/${encodeURIComponent(e)}/confirm`,r);return n(),i}async function u(e){let{task:r}=await t.k.post(`/api/import-tasks/${encodeURIComponent(e)}/retry`,{});return n(),r}async function l(e){await t.k.post(`/api/import-tasks/${encodeURIComponent(e)}/read`,{}),n()}async function c(e){await t.k.delete(`/api/import-tasks/${encodeURIComponent(e)}`),n()}e.s(["y",0,r,"I",0,s,"S",0,o,"x",0,c,"h",0,a,"B",0,function(){return t.k.get("/api/import-tasks")},"N",0,l,"c",0,i,"P",0,n,"E",0,function(e){let t=()=>{"visible"===document.visibilityState&&e()},r=t=>{t.persisted&&e()};return document.addEventListener("visibilitychange",t),window.addEventListener("focus",e),window.addEventListener("pageshow",r),window.addEventListener("online",e),()=>{document.removeEventListener("visibilitychange",t),window.removeEventListener("focus",e),window.removeEventListener("pageshow",r),window.removeEventListener("online",e)}},"R",0,u])},768339,e=>{var t=e.i(271645),r=e.i(116331);e.s(["a",0,function(e,n){var i;let[o,a]=(0,t.useState)(null),[s,u]=(0,t.useState)(!1),l=(0,t.useRef)(e),c=(0,t.useRef)(n);(0,t.useEffect)(()=>{l.current=e,c.current=n},[e,n]);let f=(0,t.useCallback)(async()=>{let e=l.current;if(e&&("u"<typeof document||"hidden"!==document.visibilityState))try{let t=await (0,r.h)(e);l.current===e&&(a(t),u(!1),c.current?.(t))}catch(t){t?.status===404&&l.current===e&&u(!0)}},[]);(0,t.useEffect)(()=>{if(!e)return;let t=setTimeout(f,0),n=(0,r.E)(f);return()=>{clearTimeout(t),n()}},[e,f]);let d="analyzing"===(i=o?.status)||"saving"===i;return(0,t.useEffect)(()=>{if(!e||!d)return;let t=setInterval(f,2500);return()=>clearInterval(t)},[e,d,f]),{task:o&&o.id===e?o:null,notFound:s,refresh:f,setTask:a}},"b",0,function(e=!0){let[n,i]=(0,t.useState)(null),[o,a]=(0,t.useState)(!1),s=(0,t.useCallback)(async()=>{if("u"<typeof document||"hidden"!==document.visibilityState)try{i(await (0,r.B)()),a(!1)}catch{a(!0)}},[]);(0,t.useEffect)(()=>{if(!e)return;let t=setTimeout(s,0),n=(0,r.E)(s);return window.addEventListener(r.y,s),()=>{clearTimeout(t),n(),window.removeEventListener(r.y,s)}},[e,s]);let u=(n?.activeCount??0)>0;return(0,t.useEffect)(()=>{if(!e)return;let t=setInterval(s,u?2500:3e4);return()=>clearInterval(t)},[e,u,s]),{data:n,error:o,refresh:s}}])},664030,e=>{var t=e.i(271645),r=e.i(41931),n=e.i(201276);let i=null,o=0,a=new Set;e.s(["f",0,function(){let[e,s]=(0,t.useState)(i??[]),[u,l]=(0,t.useState)(!i),[c,f]=(0,t.useState)(null),d=(0,t.useCallback)(async(e=!1)=>{let t=Date.now();if(!e&&i&&t-o<3e4){s(i),l(!1);return}try{l(!0);let e=await r.k.get("/api/paper-groups");i=e,o=t,a.forEach(t=>t(e)),f(null)}catch(e){n.V.error("[usePaperGroups]","Failed to fetch paper groups",{error:e}),f("Failed to load paper groups")}finally{l(!1)}},[]);return(0,t.useEffect)(()=>(a.add(s),d(),()=>{a.delete(s)}),[d]),{groups:e,loading:u,error:c,refetch:(0,t.useCallback)(()=>(i=null,o=0,d(!0)),[d])}}])}])})();
|
|
@@ -0,0 +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)},474544,e=>{var t=e.i(456420);let a={name:"clock",size:24,node:[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 6v6l4 2",key:"mmk7yg"}]]};a.node;let s=(0,t.f)(a);e.s(["f",0,s],474544)},444594,e=>{var t=e.i(456420);let a={name:"inbox",size:24,node:[["polyline",{points:"22 12 16 12 14 15 10 15 8 12 2 12",key:"o97t9d"}],["path",{d:"M5.45 5.11 2 12v6a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2v-6l-3.45-6.89A2 2 0 0 0 16.76 4H7.24a2 2 0 0 0-1.79 1.11z",key:"oot6mr"}]]};a.node;let s=(0,t.f)(a);e.s(["f",0,s],444594)},218964,e=>{var t=e.i(456420);let a={name:"list-checks",size:24,node:[["path",{d:"M13 5h8",key:"a7qcls"}],["path",{d:"M13 12h8",key:"h98zly"}],["path",{d:"M13 19h8",key:"c3s6r1"}],["path",{d:"m3 17 2 2 4-4",key:"1jhpwq"}],["path",{d:"m3 7 2 2 4-4",key:"1obspn"}]]};a.node;let s=(0,t.f)(a);e.s(["f",0,s],218964)},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)},566595,e=>{var t=e.i(456420);let a={name:"search",size:24,node:[["path",{d:"m21 21-4.34-4.34",key:"14j7rj"}],["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}]]};a.node;let s=(0,t.f)(a);e.s(["f",0,s],566595)},328623,e=>{var t=e.i(456420);let a={name:"sparkles",size:24,node:[["path",{d:"M11.017 2.814a1 1 0 0 1 1.966 0l1.051 5.558a2 2 0 0 0 1.594 1.594l5.558 1.051a1 1 0 0 1 0 1.966l-5.558 1.051a2 2 0 0 0-1.594 1.594l-1.051 5.558a1 1 0 0 1-1.966 0l-1.051-5.558a2 2 0 0 0-1.594-1.594l-5.558-1.051a1 1 0 0 1 0-1.966l5.558-1.051a2 2 0 0 0 1.594-1.594z",key:"1s2grr"}],["path",{d:"M20 2v4",key:"1rf3ol"}],["path",{d:"M22 4h-4",key:"gwowj6"}],["circle",{cx:"4",cy:"20",r:"2",key:"6kqj1y"}]],aliases:["stars"]};a.node;let s=(0,t.f)(a);e.s(["f",0,s],328623)},786563,e=>{var t=e.i(456420);let a={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"}]]};a.node;let s=(0,t.f)(a);e.s(["f",0,s],786563)},198591,e=>{var t=e.i(843476),a=e.i(271645),s=e.i(618566),r=e.i(519455),i=e.i(393842),n=e.i(86963),l=e.i(77071),o=e.i(456420);let c={name:"pencil",size:24,node:[["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"}],["path",{d:"m15 5 4 4",key:"1mk7zo"}]]};c.node;let d=(0,o.f)(c);var u=e.i(759659),m=e.i(522016);let h={name:"git-compare-arrows",size:24,node:[["circle",{cx:"5",cy:"6",r:"3",key:"1qnov2"}],["path",{d:"M12 6h5a2 2 0 0 1 2 2v7",key:"1yj91y"}],["path",{d:"m15 9-3-3 3-3",key:"1lwv8l"}],["circle",{cx:"19",cy:"18",r:"3",key:"1qljk2"}],["path",{d:"M12 18H7a2 2 0 0 1-2-2V9",key:"16sdep"}],["path",{d:"m9 15 3 3-3 3",key:"1m3kbl"}]]};h.node;let f=(0,o.f)(h);var x=e.i(444594),p=e.i(218964),g=e.i(77043),b=e.i(566595),j=e.i(666696),y=e.i(716327);let v={name:"funnel",size:24,node:[["path",{d:"M10 20a1 1 0 0 0 .553.895l2 1A1 1 0 0 0 14 21v-7a2 2 0 0 1 .517-1.341L21.74 4.67A1 1 0 0 0 21 3H3a1 1 0 0 0-.742 1.67l7.225 7.989A2 2 0 0 1 10 14z",key:"sc7q7i"}]],aliases:["filter"]};v.node;let k=(0,o.f)(v);var w=e.i(755146),N=e.i(111110);function S({mastery:e,timeRange:a,onMasteryChange:s,onTimeRangeChange:i}){let{t:n}=(0,N.b)(),l=[{value:"all",label:n.filter.all||"All"},{value:"new",label:n.filter.review||"To Review"},{value:"reviewing",label:n.filter.reviewing||"Reviewing"},{value:"mastered",label:n.filter.mastered||"Mastered"}],o=[{value:"all",label:n.filter.allTime||"All Time"},{value:"week",label:n.filter.lastWeek||"Last Week"},{value:"month",label:n.filter.lastMonth||"Last Month"}];return(0,t.jsxs)(w.G,{children:[(0,t.jsx)(w.X,{asChild:!0,children:(0,t.jsxs)(r.f,{variant:"outline",size:"sm",className:"h-10",children:[(0,t.jsx)(k,{className:"mr-2 h-4 w-4"}),n.notebook.filter,(0,t.jsx)(y.f,{className:"ml-2 h-4 w-4"})]})}),(0,t.jsxs)(w.L,{align:"end",className:"w-48",children:[(0,t.jsx)(w.B,{children:n.filter.masteryStatus||"Mastery Status"}),l.map(({value:a,label:r})=>(0,t.jsxs)(w.r,{onClick:()=>s(a),children:[e===a&&"✓ ",r]},a)),(0,t.jsx)(w.U,{}),(0,t.jsx)(w.B,{children:n.filter.timeRange||"Time Range"}),o.map(({value:e,label:s})=>(0,t.jsxs)(w.r,{onClick:()=>i(e),children:[a===e&&"✓ ",s]},e))]})]})}var C=e.i(664030);function R({value:e,onChange:a}){let{t:s}=(0,N.b)(),{groups:i,loading:n}=(0,C.f)(),l=i.filter(e=>e.isActive);return n?null:(0,t.jsxs)("div",{className:"flex flex-wrap gap-2",children:[(0,t.jsx)(r.f,{variant:"all"===e?"default":"outline",size:"sm",className:"rounded-full",onClick:()=>a("all"),children:s.filter.all||"All"}),l.map(s=>(0,t.jsx)(r.f,{variant:e===s.id?"default":"outline",size:"sm",className:"rounded-full",onClick:()=>a(s.id),children:s.name},s.id))]})}var E=e.i(263676),z=e.i(632781),T=e.i(776639),M=e.i(307364),q=e.i(511445),P=e.i(41931),$=e.i(201276);function F({ids:e}){let{t:s}=(0,N.b)(),[i,n]=(0,a.useState)(!1),[l,o]=(0,a.useState)(null),[c,d]=(0,a.useState)(!1),[u,h]=(0,a.useState)(null),[x,p]=(0,a.useState)(0),[g,b]=e,j=()=>{d(!0),o(null),h(null),p(e=>e+1)};return(0,a.useEffect)(()=>{if(!i||!g||!b)return;let e=!0;return P.k.post("/api/error-items/similarity",{ids:[g,b]}).then(t=>{e&&o(t)}).catch(t=>{e&&(h("Question text is required for similarity comparison"===t?.data?.message?s.questionSimilarity.missingText:s.questionSimilarity.failed),$.V.error("[Similarity]","相似度比较失败",{error:t instanceof Error?t.message:String(t)}))}).finally(()=>{e&&d(!1)}),()=>{e=!1}},[i,g,b,x,s.questionSimilarity.failed,s.questionSimilarity.missingText]),(0,t.jsxs)(T.N,{open:i,onOpenChange:e=>{n(e),e&&j()},children:[(0,t.jsx)(T.a,{asChild:!0,children:(0,t.jsxs)(r.f,{variant:"outline",disabled:2!==e.length,title:s.questionSimilarity.selectTwo,children:[(0,t.jsx)(f,{className:"mr-2 h-4 w-4"}),s.questionSimilarity.title]})}),(0,t.jsxs)(T.d,{className:"w-[calc(100vw-2rem)] sm:max-w-3xl max-h-[85vh] overflow-y-auto",children:[(0,t.jsxs)(T.s,{children:[(0,t.jsx)(T.F,{children:s.questionSimilarity.title}),(0,t.jsx)(T.C,{children:s.questionSimilarity.description})]}),c&&(0,t.jsxs)("div",{className:"flex items-center gap-2 text-sm",role:"status",children:[(0,t.jsx)(z.f,{className:"h-4 w-4 animate-spin"}),s.common.loading]}),u&&(0,t.jsx)("p",{className:"text-sm text-destructive",role:"alert",children:u}),u&&(0,t.jsx)(r.f,{variant:"outline",onClick:j,children:s.questionSimilarity.retry}),l&&(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)("div",{className:"space-y-2 rounded-lg bg-muted p-4",role:"status",children:[(0,t.jsx)("p",{className:"text-sm",children:s.questionSimilarity.score}),(0,t.jsxs)("p",{className:"text-3xl font-bold tabular-nums",children:[Number((100*l.similarity).toFixed(4)),"%"]}),(0,t.jsx)("p",{className:"text-sm",children:s.questionSimilarity.threshold.replace("{threshold}",String(l.threshold))}),(0,t.jsx)("p",{className:"text-sm font-medium",children:l.duplicate?s.questionSimilarity.duplicate:s.questionSimilarity.different})]}),(0,t.jsx)("div",{className:"grid gap-3 sm:grid-cols-2",children:l.items.map((e,a)=>(0,t.jsxs)("div",{className:"min-w-0 space-y-2 rounded-lg border p-3",children:[(0,t.jsxs)(m.default,{href:`/error-items/${e.id}`,className:"text-sm font-medium text-primary hover:underline",children:[s.questionSimilarity.question.replace("{index}",String(a+1))," · ",e.shortId||"-"]}),e.notebookName&&(0,t.jsx)("p",{className:"text-xs text-muted-foreground",children:e.notebookName}),(0,t.jsx)("div",{className:"max-h-56 overflow-auto text-sm",children:(0,t.jsx)(q.f,{content:e.questionText})})]},e.id))})]}),(0,t.jsx)(M.f,{onSaved:j})]})]})}function A({selectedIds:e,deleting:a,onCancel:s,onDelete:i}){let{t:n}=(0,N.b)();return(0,t.jsx)("div",{className:"pb-safe fixed bottom-0 left-0 right-0 z-50 border-t bg-card/95 p-4 shadow-lg backdrop-blur",children:(0,t.jsxs)("div",{className:"mx-auto flex max-w-6xl flex-col gap-3 sm:flex-row sm:items-center sm:justify-between",children:[(0,t.jsxs)("div",{className:"space-y-1 text-sm text-muted-foreground",children:[(0,t.jsx)("p",{children:n.notebook.selectedCount.replace("{count}",String(e.length))}),(0,t.jsx)("p",{className:"text-xs",children:n.questionSimilarity.selectTwo})]}),(0,t.jsxs)("div",{className:"flex flex-wrap gap-2",children:[(0,t.jsx)(F,{ids:e}),(0,t.jsxs)(r.f,{variant:"outline",onClick:s,children:[(0,t.jsx)(E.X,{className:"mr-2 h-4 w-4"}),n.notebook.cancelSelect]}),(0,t.jsxs)(r.f,{variant:"destructive",onClick:i,disabled:0===e.length||a,children:[(0,t.jsx)(u.f,{className:"mr-2 h-4 w-4"}),n.notebook.deleteSelected]})]})]})})}var L=e.i(215519),_=e.i(306831),D=e.i(967489),I=e.i(952122);let V={1:["一年级"],2:["二年级"],3:["三年级"],4:["四年级"],5:["五年级"],6:["六年级"],7:["七年级上","七年级下","七年级"],8:["八年级上","八年级下","八年级"],9:["九年级上","九年级下","九年级"],10:["高一上","高一下","高一"],11:["高二上","高二下","高二"],12:["高三上","高三下","高三"]};function H({gradeSemester:e,tag:s,subjectName:r,tagSet:i="default",onFilterChange:n,className:l}){let{t:o}=(0,N.b)(),{timeZone:c}=(0,L.M)(),[d,u]=(0,a.useState)(e||""),[m,h]=(0,a.useState)(""),[f,x]=(0,a.useState)(s||""),[p,g]=(0,a.useState)([]),[b,j]=(0,a.useState)(!0),[y,v]=(0,a.useState)([]),[k,w]=(0,a.useState)(e);e!==k&&(w(e),void 0!==e&&u(e));let[S,C]=(0,a.useState)(s);s!==S&&(C(s),void 0!==s&&x(s||""));let R=(0,a.useCallback)((e,t)=>{let a=(0,_.c)(new Date,c),s=a.getFullYear(),r=(a.getMonth()+1>=9?s:s-1)-t+1;return"primary"===e?r:"junior_high"===e?r+6:"senior_high"===e?r+9:0},[c]),E=(0,a.useCallback)((e,t)=>{let a=[];return e?"primary"===e?a=[1,2,3,4,5,6]:"junior_high"===e?(a=[7,8,9],t&&R(e,t)>=10&&a.push(10,11,12)):a="senior_high"===e?[10,11,12]:[1,2,3,4,5,6,7,8,9,10,11,12]:a=[1,2,3,4,5,6,7,8,9,10,11,12],a.flatMap(e=>V[e]||[])},[R]);(0,a.useEffect)(()=>{(async()=>{j(!0);try{let e=await P.k.get("/api/user"),t=E(e.educationStage,e.enrollmentYear);v(t);let a=r?(0,I.f)(r):"math";try{let e=await P.k.get(`/api/tags?subject=${a}&tagSet=${encodeURIComponent(i)}`);g(e.tags)}catch(e){$.V.warn("[KnowledgeFilter]","Failed to fetch tags for subject",{subject:a,tagSet:i,error:e}),g([])}}catch(e){$.V.error("[KnowledgeFilter]","Failed to load filter data",{error:e})}finally{j(!1)}})()},[r,i,E]);let z=p.find(e=>e.name===d),T=z?.children||[],M=T.find(e=>e.name===m),q=e=>0===e.children.length?[e.name]:e.children.flatMap(e=>q(e)),F=M?[...new Set(q(M))]:[],A=y.filter(e=>p.some(t=>t.name===e));return(0,t.jsxs)("div",{className:`flex gap-2 ${l}`,children:[(0,t.jsxs)(D.d,{value:d,onValueChange:e=>{u(e),h(""),x(""),n({gradeSemester:"all"===e?void 0:e,chapter:void 0,tag:void 0})},disabled:b,children:[(0,t.jsx)(D.P,{className:"w-[140px]",children:(0,t.jsx)(D.U,{placeholder:o.filter?.gradeShort||"Grade"})}),(0,t.jsxs)(D.r,{children:[(0,t.jsx)(D.T,{value:"all",children:o.filter?.allGrades||"All grades"}),A.map(e=>(0,t.jsx)(D.T,{value:e,children:e},e))]})]}),(0,t.jsxs)(D.d,{value:m,onValueChange:e=>{h(e),x(""),n({gradeSemester:"all"===d?void 0:d,chapter:"all"===e?void 0:e,tag:void 0})},disabled:!d||"all"===d,children:[(0,t.jsx)(D.P,{className:"w-[180px]",children:(0,t.jsx)(D.U,{placeholder:o.filter?.chapter||"Chapter"})}),(0,t.jsxs)(D.r,{children:[(0,t.jsx)(D.T,{value:"all",children:o.filter?.allChapters||"All chapters"}),T.map(e=>(0,t.jsx)(D.T,{value:e.name,children:e.name.replace(/^第\d+章\s*/,"")},e.id))]})]}),(0,t.jsxs)(D.d,{value:f,onValueChange:e=>{x(e),n({gradeSemester:"all"===d?void 0:d,chapter:"all"===m?void 0:m,tag:"all"===e?void 0:e})},disabled:!m||"all"===m,children:[(0,t.jsx)(D.P,{className:"w-[140px]",children:(0,t.jsx)(D.U,{placeholder:o.filter?.knowledgePoint||"Tag"})}),(0,t.jsxs)(D.r,{children:[(0,t.jsx)(D.T,{value:"all",children:o.filter?.allKnowledgePoints||"All tags"}),F.map(e=>(0,t.jsx)(D.T,{value:e,children:e},e))]})]})]})}var U=e.i(487486),B=e.i(912505),K=e.i(793479),O=e.i(658512),W=e.i(469817),G=e.i(905110);function X(e){let t=new URLSearchParams;return e.subjectId&&t.append("subjectId",e.subjectId),e.search&&t.append("query",e.search),"all"!==e.mastery&&t.append("mastery",e.mastery),"all"!==e.timeRange&&t.append("timeRange",e.timeRange),e.tag&&t.append("tag",e.tag),e.gradeSemester&&t.append("gradeSemester",e.gradeSemester),e.chapter&&t.append("chapter",e.chapter),"all"!==e.paperLevel&&t.append("paperLevel",e.paperLevel),t}var Y=e.i(294114),J=e.i(833547),Q=e.i(747279);function Z({subjectId:e,subjectName:i,tagSet:n="default",initialMastery:l,initialTag:o}){let{t:c}=(0,N.b)(),d=(0,s.useRouter)(),[u,m]=(0,a.useState)([]),[h,y]=(0,a.useState)(!0),[v,k]=(0,a.useState)(""),[w,C]=(0,a.useState)(l??"all"),[E,z]=(0,a.useState)("all"),[T,M]=(0,a.useState)(""),[q,F]=(0,a.useState)(""),[L,_]=(0,a.useState)("all"),[D,I]=(0,a.useState)(o??null),[V,G]=(0,a.useState)(1),ee=W.$,[et,ea]=(0,a.useState)(0),[es,er]=(0,a.useState)(0),[ei,en]=(0,a.useState)(!1),[el,eo]=(0,a.useState)(new Set),[ec,ed]=(0,a.useState)(!1),eu=(0,a.useMemo)(()=>({subjectId:e,search:v,mastery:w,timeRange:E,tag:D,gradeSemester:T,chapter:q,paperLevel:L}),[e,v,w,E,D,T,q,L]),em=()=>{en(!ei),eo(new Set)},eh=(0,a.useCallback)(async()=>{y(!0);try{let e=X(eu);e.append("page",V.toString()),e.append("pageSize",ee.toString());let t=await P.k.get(`/api/error-items/list?${e.toString()}`);m(t.items),ea(t.total),er(t.totalPages)}catch(e){$.V.error("[ErrorList]","Failed to fetch error items",{error:e})}finally{y(!1)}},[eu,V,ee]),ef=async()=>{if(0===el.size)return;let e=(c.notebook?.confirmBatchDelete||"Delete {count} items?").replace("{count}",el.size.toString());if(await (0,Y.u)(e,{destructive:!0})){ed(!0);try{await P.k.post("/api/error-items/batch-delete",{ids:Array.from(el)}),Y.c.success(c.notebook?.batchDeleteSuccess||"Deleted successfully"),en(!1),eo(new Set),eh()}catch(e){$.V.error("[ErrorList]","Batch delete failed",{error:e}),Y.c.error(c.common?.messages?.deleteFailed||"Delete failed")}finally{ed(!1)}}},ex=(0,a.useRef)(eu);return(0,a.useEffect)(()=>{let e=ex.current!==eu;(ex.current=eu,e&&1!==V)?G(1):eh()},[V,eu,eh]),(0,t.jsxs)("div",{className:`space-y-6 ${ei?"pb-40 sm:pb-24":""}`,children:[(0,t.jsxs)("div",{className:"flex flex-col gap-3 lg:flex-row",children:[(0,t.jsxs)("div",{className:"relative w-full lg:flex-1",children:[(0,t.jsx)(b.f,{className:"absolute left-3 top-1/2 h-4 w-4 -translate-y-1/2 text-muted-foreground"}),(0,t.jsx)(K.f,{placeholder:c.notebook.search,title:c.shortId.searchHint,className:"h-10 rounded-xl bg-card pl-9",value:v,onChange:e=>k(e.target.value),onKeyDown:async e=>{let t=v.trim();if("Enter"!==e.key||!(0,Q.f)(t))return;let a=await (0,J.f)(t);a&&d.push(`/error-items/${a}`)}})]}),(0,t.jsxs)("div",{className:"flex flex-wrap gap-2",children:[(0,t.jsx)(S,{mastery:w,timeRange:E,onMasteryChange:C,onTimeRangeChange:z}),(0,t.jsxs)(r.f,{variant:"outline",size:"sm",className:"h-10",onClick:()=>d.push(`/print-preview?${X(eu).toString()}`),children:[(0,t.jsx)(g.f,{className:"mr-2 h-4 w-4"}),c.notebook?.exportPrint||"Export for Print"]}),!ei&&(0,t.jsxs)(r.f,{variant:"outline",size:"sm",className:"h-10",onClick:em,children:[(0,t.jsx)(f,{className:"mr-2 h-4 w-4"}),c.questionSimilarity.title]}),(0,t.jsxs)(r.f,{variant:ei?"secondary":"outline",size:"sm",className:"h-10",onClick:em,children:[(0,t.jsx)(p.f,{className:"mr-2 h-4 w-4"}),ei?c.notebook?.cancelSelect||"Cancel":c.notebook?.selectMode||"Select"]})]})]}),(0,t.jsxs)("div",{className:"flex flex-col sm:flex-row gap-4 items-stretch sm:items-center",children:[(0,t.jsx)("div",{className:"w-full sm:w-auto",children:(0,t.jsx)(H,{gradeSemester:T,tag:D,onFilterChange:({gradeSemester:e,chapter:t,tag:a})=>{void 0!==e&&M(e),void 0!==t&&F(t),I(void 0===a?null:a),e?t||F(""):(M(""),F(""),I(null)),G(1)},subjectName:i,tagSet:n})}),(0,t.jsx)(R,{value:L,onChange:_})]}),D&&(0,t.jsxs)("div",{className:"flex items-center gap-2 p-3 bg-muted rounded-lg",children:[(0,t.jsxs)("span",{className:"text-sm text-muted-foreground",children:[c.filter.filteringByTag||"Filtering by tag",":"]}),(0,t.jsxs)(U.f,{variant:"secondary",className:"cursor-pointer",onClick:()=>I(null),children:[D,(0,t.jsx)("span",{className:"ml-1 text-xs",children:"×"})]})]}),!h&&0===u.length&&(0,t.jsx)(B.f,{icon:x.f,title:c.notebook.emptyList,description:c.notebook.emptyListHint}),h&&0===u.length&&(0,t.jsx)("div",{className:"grid gap-4 md:grid-cols-2 lg:grid-cols-3",children:Array.from({length:6},(e,a)=>(0,t.jsx)("div",{className:"h-44 animate-pulse rounded-2xl bg-muted"},a))}),(0,t.jsx)("div",{className:`grid gap-4 md:grid-cols-2 lg:grid-cols-3 transition-opacity ${h?"opacity-60":""}`,children:u.map(e=>(0,t.jsx)(j.f,{item:e,selectMode:ei,selected:el.has(e.id),onToggleSelect:()=>{var t;return t=e.id,void eo(e=>{let a=new Set(e);return a.has(t)?a.delete(t):a.add(t),a})},selectedTag:D,onTagClick:e=>I(D===e?null:e)},e.id))}),(0,t.jsx)(O.f,{page:V,totalPages:es,total:et,pageSize:ee,onPageChange:G}),ei&&(0,t.jsx)(A,{selectedIds:[...el],deleting:ec,onCancel:em,onDelete:ef})]})}function ee(e){let r=(0,s.useSearchParams)(),i=(0,a.useMemo)(()=>{let e,t,a;return e={},t=r.get("mastery"),(0,G.A)(t)&&(e.mastery=t),(a=r.get("tag"))&&(e.tag=a),e},[r]);return(0,t.jsx)(Z,{...e,initialMastery:i.mastery,initialTag:i.tag})}function et(e){return(0,t.jsx)(a.Suspense,{fallback:null,children:(0,t.jsx)(ee,{...e})})}var ea=e.i(110204);function es({open:e,onOpenChange:s,currentName:i,onRename:n}){let[l,o]=(0,a.useState)(i),[c,d]=(0,a.useState)(!1),{t:u}=(0,N.b)(),[m,h]=(0,a.useState)(i);i!==m&&(h(i),o(i));let f=async()=>{if(!l.trim())return void Y.c.warning(u.notebooks?.renameDialog?.enterName||"Please enter notebook name");d(!0);try{await n(l.trim()),s(!1)}catch(e){$.V.error("[RenameNotebook]","Failed to rename notebook",{error:e})}finally{d(!1)}};return(0,t.jsx)(T.N,{open:e,onOpenChange:s,children:(0,t.jsxs)(T.d,{children:[(0,t.jsx)(T.s,{children:(0,t.jsx)(T.F,{children:u.notebooks?.renameDialog?.title||"Rename Notebook"})}),(0,t.jsx)("div",{className:"space-y-4 py-4",children:(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsx)(ea.f,{htmlFor:"rename-name",children:u.notebooks?.renameDialog?.nameLabel||"New Name"}),(0,t.jsx)(K.f,{id:"rename-name",placeholder:u.notebooks?.renameDialog?.placeholder||"Enter new notebook name",value:l,onChange:e=>o(e.target.value),onKeyDown:e=>"Enter"===e.key&&f()})]})}),(0,t.jsxs)(T.c,{children:[(0,t.jsx)(r.f,{variant:"outline",onClick:()=>s(!1),children:u.common.cancel}),(0,t.jsx)(r.f,{onClick:f,disabled:c||!l.trim(),children:c?u.notebooks?.renameDialog?.renaming||"Renaming...":u.notebooks?.renameDialog?.rename||"Rename"})]})]})})}var er=e.i(328623);function ei({notebookId:e,onFinished:s}){let{t:i}=(0,N.b)(),[n,l]=(0,a.useState)(null),[o,c]=(0,a.useState)(null),d=(0,a.useRef)(!1),u=(0,a.useCallback)(()=>{P.k.get(`/api/notebooks/${e}/retag`).then(e=>{d.current&&e&&!e.running&&s?.(),d.current=!!e?.running,l(e)}).catch(()=>void 0)},[e,s]);(0,a.useEffect)(u,[u]),(0,a.useEffect)(()=>{if(!n?.running)return;let e=setTimeout(u,2e3);return()=>clearTimeout(e)},[n,u]);let m=async()=>{if(await (0,Y.u)(i.retag.notebookConfirm)){c(null);try{let t=await P.k.post(`/api/notebooks/${e}/retag`,{});if(0===t.total)return void c(i.retag.empty);d.current=t.running,l(t)}catch{c(i.retag.itemFailed)}}},h=o??(n?.running?i.retag.progress.replace("{done}",String(n.done)).replace("{total}",String(n.total)):n?.finishedAt&&n.total>0?i.retag.finished.replace("{success}",String(n.total-n.failed)).replace("{failed}",String(n.failed)):null);return(0,t.jsxs)("div",{className:"flex flex-col items-start sm:items-end gap-1",children:[(0,t.jsxs)(r.f,{variant:"outline",size:"sm",onClick:m,disabled:n?.running,"aria-label":i.retag.notebookButton,children:[n?.running?(0,t.jsx)(z.f,{className:"h-4 w-4 animate-spin sm:mr-2"}):(0,t.jsx)(er.f,{className:"h-4 w-4 sm:mr-2"}),(0,t.jsx)("span",{className:"hidden sm:inline",children:i.retag.notebookButton})]}),h&&(0,t.jsx)("p",{className:"text-xs text-muted-foreground",children:h})]})}var en=e.i(709830),el=e.i(35209),eo=e.i(303163);e.s(["default",0,function(){let e=(0,s.useParams)(),o=(0,s.useRouter)(),{t:c}=(0,N.b)(),[h,f]=(0,a.useState)(null);(0,el.f)(c.notebooks.title,h?.name);let[x,p]=(0,a.useState)(!0),[g,b]=(0,a.useState)(!1),[j,y]=(0,a.useState)(0),v=(0,a.useCallback)(async e=>{try{let t=await P.k.get(`/api/notebooks/${e}`);f(t)}catch(e){$.V.error("[NotebookDetail]","Failed to fetch notebook",{error:e}),Y.c.error(c.notebooks?.notFound||"Notebook not found"),o.push("/notebooks")}finally{p(!1)}},[o,c]);(0,a.useEffect)(()=>{e.id&&v(e.id)},[e.id,v]);let k=async e=>{h&&f(await P.k.put(`/api/notebooks/${h.id}`,{name:e}))},w=async()=>{if(h)try{let e=await P.k.get(`/api/notebooks/${h.id}`);if((e._count?.errorItems||0)>0)return void Y.c.warning(c.notebooks?.deleteNotEmpty||"Please clear all items in this notebook first.");if(!await (0,Y.u)((c.notebooks?.deleteConfirm||"Are you sure?").replace("{name}",h.name),{destructive:!0}))return;await P.k.delete(`/api/notebooks/${h.id}`),o.replace("/notebooks")}catch(e){$.V.error("[NotebookDetail]","Failed to delete notebook",{error:e}),Y.c.error((0,eo.d)(e)||c.notebooks?.deleteError||"Failed to delete")}};return x?(0,t.jsx)(n.f,{label:c.common.loading}):h?(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",children:[(0,t.jsx)(i.f,{backHref:"/notebooks",title:h.name,titleAddon:(0,t.jsx)(r.f,{variant:"ghost",size:"icon-sm",className:"shrink-0 text-muted-foreground",onClick:()=>b(!0),title:c.notebooks?.rename||"Rename",children:(0,t.jsx)(d,{className:"h-4 w-4"})}),description:(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(en.E,{notebook:h})," · ",(c.notebooks?.totalErrors||"Total {count} errors").replace("{count}",(h._count?.errorItems||0).toString())]}),actions:(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)(r.f,{variant:"outline",size:"sm",className:"text-destructive hover:text-destructive",onClick:w,"aria-label":c.common.delete,children:[(0,t.jsx)(u.f,{className:"h-4 w-4"}),(0,t.jsx)("span",{className:"hidden sm:inline",children:c.common.delete})]}),(0,t.jsx)(ei,{notebookId:h.id,onFinished:()=>y(e=>e+1)}),(0,t.jsx)(m.default,{href:`/notebooks/${h.id}/add`,children:(0,t.jsxs)(r.f,{"aria-label":c.notebooks?.addError||"Add Error",children:[(0,t.jsx)(l.f,{className:"h-4 w-4"}),(0,t.jsx)("span",{className:"hidden sm:inline",children:c.notebooks?.addError||"Add Error"})]})})]})}),(0,t.jsx)(et,{subjectId:h.id,subjectName:h.name,tagSet:h.tagSet||"default"},j),(0,t.jsx)(es,{open:g,onOpenChange:b,currentName:h.name,onRename:k})]})}):null}],198591)},469937,e=>{var t=e.i(843476),a=e.i(786563),s=e.i(111110),r=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:c=!0,className:d}){let{t:u}=(0,s.b)(),m=e??0,h="sm"===o?"h-3.5 w-3.5":"h-5 w-5",f=m?u.difficulty.starsLabel.replace("{n}",String(m)):u.difficulty.unrated;return n?(0,t.jsxs)("span",{className:(0,r.f)("inline-flex items-center gap-0.5",d),role:"group","aria-label":`${u.difficulty.label}${u.common.colon}${f}`,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)(a.f,{className:(0,r.f)(h,e<=m?"fill-amber-400 text-amber-400":"text-muted-foreground/40")})},e)),!m&&c&&(0,t.jsx)("span",{className:"ml-1 text-xs text-muted-foreground",children:u.difficulty.unrated})]}):m?(0,t.jsx)("span",{className:(0,r.f)("inline-flex items-center",d),role:"img","aria-label":`${u.difficulty.label}${u.common.colon}${f}`,title:f,children:i.map(e=>(0,t.jsx)(a.f,{className:(0,r.f)(h,e<=m?"fill-amber-400 text-amber-400":"text-muted-foreground/30"),"aria-hidden":!0},e))}):c?(0,t.jsx)("span",{className:(0,r.f)("text-xs text-muted-foreground",d),children:u.difficulty.unrated}):null}])},846968,e=>{var t=e.i(843476),a=e.i(548161),s=e.i(474544),r=e.i(741120),i=e.i(487486),n=e.i(111110);let l={new:{className:"bg-warning/15 text-amber-700 dark:text-warning",icon:s.f},reviewing:{className:"bg-primary/10 text-primary",icon:r.f},mastered:{className:"bg-success/15 text-success",icon:a.f}};e.s(["o",0,{new:"border-l-warning/70",reviewing:"border-l-primary/60",mastered:"border-l-success/70"},"x",0,function({status:e,className:a=""}){let{t:s}=(0,n.b)(),{className:r,icon:o}=l[e],c="mastered"===e?s.notebook.mastered:"reviewing"===e?s.notebook.reviewing:s.notebook.review;return(0,t.jsx)(i.f,{variant:"secondary",className:`${r} ${a}`,children:(0,t.jsxs)("span",{className:"flex items-center gap-1",children:[(0,t.jsx)(o,{className:"h-3 w-3"})," ",c]})})}])},709830,76824,e=>{var t=e.i(843476),a=e.i(111110),s=e.i(952122);let r=["primary","junior_high","senior_high"],i="primary",n=["math","english","chinese","physics","chemistry","biology","history","geography","politics"];function l(e){return"string"==typeof e&&n.includes(e)}function o(e){var t;let a=l(e.subjectKey)?e.subjectKey:(0,s.f)(e.name);return{stage:"string"==typeof(t=e.stage)&&r.includes(t)?e.stage:i,subject:a&&l(a)?a:null}}function c(){let{t:e}=(0,a.b)();return{stageLabel:t=>({primary:e.auth.primary,junior_high:e.auth.juniorHigh,senior_high:e.auth.seniorHigh})[t],subjectLabel:t=>e.tags.subjects[t]}}e.s(["j",0,i,"c",0,r,"W",0,{primary:["math","english","chinese"],junior_high:n,senior_high:n},"v",0,o],76824),e.s(["E",0,function({notebook:e,className:a}){let{stageLabel:s,subjectLabel:r}=c(),i=o(e);return(0,t.jsxs)("span",{className:a,children:[s(i.stage),i.subject?` \xb7 ${r(i.subject)}`:""]})},"O",0,c],709830)},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:i}){let n=(0,a.useRouter)();return(0,t.jsx)(s.f,{variant:"ghost",size:"icon",onClick:()=>{n.push(e)},className:i,children:(0,t.jsx)(r.f,{className:"h-5 w-5"})})}])},257428,e=>{var t=e.i(843476),a=e.i(271645),s=e.i(820783),r=e.i(30030),i=e.i(981140),n=e.i(369340),l=e.i(635804),o=e.i(296626),c=e.i(248425),d=Object.defineProperty,u=(e,t)=>d(e,"name",{value:t,configurable:!0}),m="Checkbox",[h,f]=(0,r.f)(m),[x,p]=h(m);function g(e){let{__scopeCheckbox:s,checked:r,children:i,defaultChecked:l,disabled:o,form:c,name:d,onCheckedChange:u,required:h,value:f="on",internal_do_not_use_render:p}=e,[g,b]=(0,n.f)({prop:r,defaultProp:l??!1,onChange:u,caller:m}),[j,y]=a.useState(null),[v,N]=a.useState(null),[S,C]=a.useState(null),R=!j||!!c||!!j.closest("form"),E={checked:g,disabled:o,setChecked:b,control:j,setControl:y,name:d,form:c,value:f,userClick:S,onUserClick:C,required:h,defaultChecked:!w(l)&&l,isFormControl:R,bubbleInput:v,setBubbleInput:N};return(0,t.jsx)(x,{scope:s,...E,children:k(p)?p(E):i})}u(g,"CheckboxProvider");var b=a.forwardRef(u(function({__scopeCheckbox:e,onKeyDown:r,onClick:n,...l},o){let{control:d,value:m,disabled:h,checked:f,required:x,setControl:g,setChecked:b,onUserClick:j,isFormControl:y,bubbleInput:v}=p("CheckboxTrigger",e),k=(0,s.f)(o,g),S=a.useRef(f);return a.useEffect(()=>{let e=d?.form;if(e){let t=u(()=>b(S.current),"reset");return e.addEventListener("reset",t),()=>e.removeEventListener("reset",t)}},[d,b]),(0,t.jsx)(c.V.button,{type:"button",role:"checkbox","aria-checked":w(f)?"mixed":f,"aria-required":x,"data-state":N(f),"data-disabled":h?"":void 0,disabled:h,value:m,...l,ref:k,onKeyDown:(0,i.f)(r,e=>{"Enter"===e.key&&e.preventDefault()}),onClick:(0,i.f)(n,e=>{let t=e.isPropagationStopped();j({requestedChecked:!!w(f)||!f,hasConsumerStoppedPropagation:t}),b(e=>!!w(e)||!e),v&&y&&!t&&e.stopPropagation()})})},"CheckboxTrigger")),j=a.forwardRef(u(function(e,a){let{__scopeCheckbox:s,name:r,checked:i,defaultChecked:n,required:l,disabled:o,value:c,onCheckedChange:d,form:u,...m}=e;return(0,t.jsx)(g,{__scopeCheckbox:s,checked:i,defaultChecked:n,disabled:o,required:l,onCheckedChange:d,name:r,form:u,value:c,internal_do_not_use_render:({isFormControl:e})=>(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(b,{...m,ref:a,__scopeCheckbox:s}),e&&(0,t.jsx)(v,{__scopeCheckbox:s})]})})},"Checkbox")),y=a.forwardRef(u(function(e,a){let{__scopeCheckbox:s,forceMount:r,...i}=e,n=p("CheckboxIndicator",s);return(0,t.jsx)(o.f,{present:r||w(n.checked)||!0===n.checked,children:(0,t.jsx)(c.V.span,{"data-state":N(n.checked),"data-disabled":n.disabled?"":void 0,...i,ref:a,style:{pointerEvents:"none",...e.style}})})},"CheckboxIndicator")),v=a.forwardRef(u(function({__scopeCheckbox:e,onClick:r,...n},o){let{control:d,userClick:u,checked:m,defaultChecked:h,required:f,disabled:x,name:g,value:b,form:j,bubbleInput:y,setBubbleInput:v}=p("CheckboxBubbleInput",e),k=(0,s.f)(o,v),N=(0,l.f)(d),S=a.useRef(!1),C=a.useRef(m),R=a.useRef(u),E=a.useRef(null);a.useEffect(()=>{if(!y)return;let e=Object.getOwnPropertyDescriptor(window.HTMLInputElement.prototype,"checked").set;if(!e)return;let t=C.current!==m;C.current=m;let a=null!==u&&u!==R.current;if(R.current=u,a)E.current=t?null:u,t&&(y.indeterminate=w(m),e.call(y,!w(m)&&m)),y.dispatchEvent(new Event("click",{bubbles:!u.hasConsumerStoppedPropagation}));else if(t){let t=E.current;E.current=null;let a=t?.requestedChecked===m;S.current=!0,y.indeterminate=w(m),e.call(y,!w(m)&&m),y.dispatchEvent(new Event("click",{bubbles:!(a&&t.hasConsumerStoppedPropagation)})),S.current=!1}},[y,m,u]);let z=a.useRef(!w(m)&&m);return(0,t.jsx)(c.V.input,{type:"checkbox","aria-hidden":!0,defaultChecked:h??z.current,required:f,disabled:x,name:g,value:b,form:j,...n,tabIndex:-1,ref:k,onClick:(0,i.f)(r,e=>{S.current&&e.stopPropagation()}),style:{...n.style,...N,position:"absolute",pointerEvents:"none",opacity:0,margin:0,transform:"translateX(-100%)"}})},"CheckboxBubbleInput"));function k(e){return"function"==typeof e}function w(e){return"indeterminate"===e}function N(e){return w(e)?"indeterminate":e?"checked":"unchecked"}u(k,"isFunction"),u(w,"isIndeterminate"),u(N,"getState");var S=e.i(689664),C=e.i(975157);let R=a.forwardRef(({className:e,...a},s)=>(0,t.jsx)(j,{ref:s,className:(0,C.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),...a,children:(0,t.jsx)(y,{className:(0,C.f)("flex items-center justify-center text-current"),children:(0,t.jsx)(S.f,{className:"h-4 w-4"})})}));R.displayName=j.displayName,e.s(["f",0,R],257428)},912505,e=>{var t=e.i(843476),a=e.i(975157);e.s(["f",0,function({icon:e,title:s,description:r,action:i,className:n}){return(0,t.jsxs)("div",{className:(0,a.f)("flex flex-col items-center justify-center rounded-2xl border border-dashed bg-card/50 px-6 py-14 text-center",n),children:[(0,t.jsx)("div",{className:"mb-4 flex h-14 w-14 items-center justify-center rounded-2xl bg-accent text-accent-foreground",children:(0,t.jsx)(e,{className:"h-7 w-7"})}),(0,t.jsx)("p",{className:"font-medium",children:s}),r&&(0,t.jsx)("p",{className:"mt-1 max-w-sm text-sm text-muted-foreground",children:r}),i&&(0,t.jsx)("div",{className:"mt-5",children:i})]})}])},393842,e=>{var t=e.i(843476),a=e.i(590546),s=e.i(975157);e.s(["f",0,function({title:e,description:r,backHref:i,actions:n,titleAddon:l,className:o}){return(0,t.jsxs)("div",{className:(0,s.f)("flex items-start gap-3",o),children:[i&&(0,t.jsx)(a.f,{fallbackUrl:i,className:"-ml-2 shrink-0"}),(0,t.jsxs)("div",{className:"min-w-0 flex-1 space-y-1",children:[(0,t.jsxs)("div",{className:"flex items-center gap-1",children:[(0,t.jsx)("h1",{className:"truncate text-2xl font-bold tracking-tight sm:text-3xl",children:e}),l]}),r&&(0,t.jsx)("p",{className:"text-sm text-muted-foreground sm:text-base",children:r})]}),n&&(0,t.jsx)("div",{className:"flex shrink-0 items-center gap-2",children:n})]})}])},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})]})}])},469817,e=>{e.s(["$",0,18,"u",0,5,"A",0,200])},990745,e=>{e.s(["f",0,function(e){if(e.tags&&e.tags.length>0)return e.tags.map(e=>e.name);if(!e.knowledgePoints)return[];try{let t=JSON.parse(e.knowledgePoints);return Array.isArray(t)?t.filter(e=>"string"==typeof e):[]}catch{return[]}}])},952122,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}])},62825,e=>{function t(e){return"not_attempted"===e||"wrong_attempt"===e||"unknown"===e?e:"unknown"}e.s(["i",0,function(e,a="zh"){return("en"===a?{not_attempted:"Not attempted",wrong_attempt:"Wrong attempt",unknown:"Unknown"}:{not_attempted:"不会做",wrong_attempt:"做错了",unknown:"未判断"})[t(e)]},"h",0,t,"x",0,function(e,a){return(a||"").trim()?"wrong_attempt":t(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])}])},833547,747279,e=>{var t=e.i(41931);async function a(e){try{return(await t.k.get(`/api/error-items/short/${encodeURIComponent(e)}`)).id}catch{return null}}e.s(["f",0,a],833547);let s=RegExp("^[123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz]{6}$");e.s(["f",0,function(e){return"string"==typeof e&&s.test(e)}],747279)}])})();
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,[711241,e=>{var t=e.i(456420);let r={name:"arrow-left",size:24,node:[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]]};r.node;let n=(0,t.f)(r);e.s(["f",0,n],711241)},508734,e=>{var t=e.i(456420);let r={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"}]]};r.node;let n=(0,t.f)(r);e.s(["f",0,n],508734)},282492,e=>{var t=e.i(722219);e.s(["z",0,t])},590546,e=>{var t=e.i(843476),r=e.i(618566),n=e.i(519455),s=e.i(711241);e.s(["f",0,function({fallbackUrl:e,className:i}){let a=(0,r.useRouter)();return(0,t.jsx)(n.f,{variant:"ghost",size:"icon",onClick:()=>{a.push(e)},className:i,children:(0,t.jsx)(s.f,{className:"h-5 w-5"})})}])},257428,e=>{var t=e.i(843476),r=e.i(271645),n=e.i(820783),s=e.i(30030),i=e.i(981140),a=e.i(369340),c=e.i(635804),l=e.i(296626),o=e.i(248425),d=Object.defineProperty,f=(e,t)=>d(e,"name",{value:t,configurable:!0}),u="Checkbox",[h,m]=(0,s.f)(u),[x,p]=h(u);function b(e){let{__scopeCheckbox:n,checked:s,children:i,defaultChecked:c,disabled:l,form:o,name:d,onCheckedChange:f,required:h,value:m="on",internal_do_not_use_render:p}=e,[b,k]=(0,a.f)({prop:s,defaultProp:c??!1,onChange:f,caller:u}),[g,j]=r.useState(null),[v,w]=r.useState(null),[C,R]=r.useState(null),E=!g||!!o||!!g.closest("form"),P={checked:b,disabled:l,setChecked:k,control:g,setControl:j,name:d,form:o,value:m,userClick:C,onUserClick:R,required:h,defaultChecked:!N(c)&&c,isFormControl:E,bubbleInput:v,setBubbleInput:w};return(0,t.jsx)(x,{scope:n,...P,children:y(p)?p(P):i})}f(b,"CheckboxProvider");var k=r.forwardRef(f(function({__scopeCheckbox:e,onKeyDown:s,onClick:a,...c},l){let{control:d,value:u,disabled:h,checked:m,required:x,setControl:b,setChecked:k,onUserClick:g,isFormControl:j,bubbleInput:v}=p("CheckboxTrigger",e),y=(0,n.f)(l,b),C=r.useRef(m);return r.useEffect(()=>{let e=d?.form;if(e){let t=f(()=>k(C.current),"reset");return e.addEventListener("reset",t),()=>e.removeEventListener("reset",t)}},[d,k]),(0,t.jsx)(o.V.button,{type:"button",role:"checkbox","aria-checked":N(m)?"mixed":m,"aria-required":x,"data-state":w(m),"data-disabled":h?"":void 0,disabled:h,value:u,...c,ref:y,onKeyDown:(0,i.f)(s,e=>{"Enter"===e.key&&e.preventDefault()}),onClick:(0,i.f)(a,e=>{let t=e.isPropagationStopped();g({requestedChecked:!!N(m)||!m,hasConsumerStoppedPropagation:t}),k(e=>!!N(e)||!e),v&&j&&!t&&e.stopPropagation()})})},"CheckboxTrigger")),g=r.forwardRef(f(function(e,r){let{__scopeCheckbox:n,name:s,checked:i,defaultChecked:a,required:c,disabled:l,value:o,onCheckedChange:d,form:f,...u}=e;return(0,t.jsx)(b,{__scopeCheckbox:n,checked:i,defaultChecked:a,disabled:l,required:c,onCheckedChange:d,name:s,form:f,value:o,internal_do_not_use_render:({isFormControl:e})=>(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(k,{...u,ref:r,__scopeCheckbox:n}),e&&(0,t.jsx)(v,{__scopeCheckbox:n})]})})},"Checkbox")),j=r.forwardRef(f(function(e,r){let{__scopeCheckbox:n,forceMount:s,...i}=e,a=p("CheckboxIndicator",n);return(0,t.jsx)(l.f,{present:s||N(a.checked)||!0===a.checked,children:(0,t.jsx)(o.V.span,{"data-state":w(a.checked),"data-disabled":a.disabled?"":void 0,...i,ref:r,style:{pointerEvents:"none",...e.style}})})},"CheckboxIndicator")),v=r.forwardRef(f(function({__scopeCheckbox:e,onClick:s,...a},l){let{control:d,userClick:f,checked:u,defaultChecked:h,required:m,disabled:x,name:b,value:k,form:g,bubbleInput:j,setBubbleInput:v}=p("CheckboxBubbleInput",e),y=(0,n.f)(l,v),w=(0,c.f)(d),C=r.useRef(!1),R=r.useRef(u),E=r.useRef(f),P=r.useRef(null);r.useEffect(()=>{if(!j)return;let e=Object.getOwnPropertyDescriptor(window.HTMLInputElement.prototype,"checked").set;if(!e)return;let t=R.current!==u;R.current=u;let r=null!==f&&f!==E.current;if(E.current=f,r)P.current=t?null:f,t&&(j.indeterminate=N(u),e.call(j,!N(u)&&u)),j.dispatchEvent(new Event("click",{bubbles:!f.hasConsumerStoppedPropagation}));else if(t){let t=P.current;P.current=null;let r=t?.requestedChecked===u;C.current=!0,j.indeterminate=N(u),e.call(j,!N(u)&&u),j.dispatchEvent(new Event("click",{bubbles:!(r&&t.hasConsumerStoppedPropagation)})),C.current=!1}},[j,u,f]);let S=r.useRef(!N(u)&&u);return(0,t.jsx)(o.V.input,{type:"checkbox","aria-hidden":!0,defaultChecked:h??S.current,required:m,disabled:x,name:b,value:k,form:g,...a,tabIndex:-1,ref:y,onClick:(0,i.f)(s,e=>{C.current&&e.stopPropagation()}),style:{...a.style,...w,position:"absolute",pointerEvents:"none",opacity:0,margin:0,transform:"translateX(-100%)"}})},"CheckboxBubbleInput"));function y(e){return"function"==typeof e}function N(e){return"indeterminate"===e}function w(e){return N(e)?"indeterminate":e?"checked":"unchecked"}f(y,"isFunction"),f(N,"isIndeterminate"),f(w,"getState");var C=e.i(689664),R=e.i(975157);let E=r.forwardRef(({className:e,...r},n)=>(0,t.jsx)(g,{ref:n,className:(0,R.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),...r,children:(0,t.jsx)(j,{className:(0,R.f)("flex items-center justify-center text-current"),children:(0,t.jsx)(C.f,{className:"h-4 w-4"})})}));E.displayName=g.displayName,e.s(["f",0,E],257428)},912505,e=>{var t=e.i(843476),r=e.i(975157);e.s(["f",0,function({icon:e,title:n,description:s,action:i,className:a}){return(0,t.jsxs)("div",{className:(0,r.f)("flex flex-col items-center justify-center rounded-2xl border border-dashed bg-card/50 px-6 py-14 text-center",a),children:[(0,t.jsx)("div",{className:"mb-4 flex h-14 w-14 items-center justify-center rounded-2xl bg-accent text-accent-foreground",children:(0,t.jsx)(e,{className:"h-7 w-7"})}),(0,t.jsx)("p",{className:"font-medium",children:n}),s&&(0,t.jsx)("p",{className:"mt-1 max-w-sm text-sm text-muted-foreground",children:s}),i&&(0,t.jsx)("div",{className:"mt-5",children:i})]})}])},393842,e=>{var t=e.i(843476),r=e.i(590546),n=e.i(975157);e.s(["f",0,function({title:e,description:s,backHref:i,actions:a,titleAddon:c,className:l}){return(0,t.jsxs)("div",{className:(0,n.f)("flex items-start gap-3",l),children:[i&&(0,t.jsx)(r.f,{fallbackUrl:i,className:"-ml-2 shrink-0"}),(0,t.jsxs)("div",{className:"min-w-0 flex-1 space-y-1",children:[(0,t.jsxs)("div",{className:"flex items-center gap-1",children:[(0,t.jsx)("h1",{className:"truncate text-2xl font-bold tracking-tight sm:text-3xl",children:e}),c]}),s&&(0,t.jsx)("p",{className:"text-sm text-muted-foreground sm:text-base",children:s})]}),a&&(0,t.jsx)("div",{className:"flex shrink-0 items-center gap-2",children:a})]})}])},86963,e=>{var t=e.i(843476),r=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)(r.f,{className:"h-7 w-7 animate-spin text-primary"}),e&&(0,t.jsx)("p",{className:"text-sm",children:e})]})}])},35209,e=>{var t=e.i(271645),r=e.i(111110);e.s(["f",0,function(...e){let{t:n}=(0,r.b)(),s=[n.pageTitle.base,...e.map(e=>"string"==typeof e?e.trim():"").filter(e=>e.length>0)].join("-");(0,t.useEffect)(()=>{document.title=s},[s])}])}],462684,e=>{e.v(t=>Promise.all(["static/chunks/2hh64gi4pmlk2.js"].map(t=>e.l(t))).then(()=>t(506175)))}]);
|