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 @@
|
|
|
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 n=(0,t.f)(r);e.s(["f",0,n],314381);var i=e.i(843476),a=e.i(271645),o=e.i(632781);let s={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"}]]};s.node;let l=(0,t.f)(s),h={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"}]]};h.node;let c=(0,t.f)(h);var d=e.i(395925),u=e.i(741120),m=e.i(759659),g=e.i(519455),p=e.i(111110),f=e.i(294114),w=e.i(201276),x=e.i(113381);let y=null;function b(e,t,r){let n=e?.firstElementChild;n&&(n.style.width="100%",n.style.height=`${r}px`,t?.setSize(e?.offsetWidth||n.offsetWidth||800,r))}function v(e,t){let r=(0,x.L)(e,t);for(let e of r)w.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:n=!1,showMenuBar:s=!1,className:h="",onRegenerate:C,onDelete:j}){let{t:k}=(0,p.b)(),D=(0,a.useRef)(null),M=(0,a.useRef)(null),E=(0,a.useRef)(void 0),N=(0,a.useId)(),R=(0,a.useRef)(`ggb-${N.replace(/[^a-zA-Z0-9_-]/g,"")}`),[S,L]=(0,a.useState)(!0),[I,_]=(0,a.useState)(null),[P,$]=(0,a.useState)(!0),[H,A]=(0,a.useState)(!1),[z,B]=(0,a.useState)(!1),Y=(0,a.useMemo)(()=>(0,x.i)(e),[e]);(0,a.useEffect)(()=>{if(0===Y.length)return;let e=!1,i=R.current,a=D.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 o=window.GGBApplet;if(!o){_(k.geogebra.notLoaded),L(!1);return}if(a){a.innerHTML=`<div id="${i}" style="width:100%;height:${t}px"></div>`;try{new o({appName:"classic",width:"100%",height:t,showToolBar:r,showAlgebraInput:n,showMenuBar:s,showResetIcon:!0,enableRightClick:!0,enableShiftDragZoom:!0,language:"zh",appletOnLoad:r=>{e||(M.current=r,b(a,r,t),E.current=v(r,Y),L(!1))}},!0).inject(i)}catch(t){w.V.error("[GGB]","Init failed",{error:t}),e||(_(k.geogebra.initFailed),L(!1))}}}).catch(t=>{w.V.error("[GGB]","Script load failed",{error:t}),e||(_(k.geogebra.scriptFailed),L(!1))}),()=>{e=!0;try{let e=M.current;e?.remove&&e.remove()}catch(e){w.V.warn("[GGB]","Cleanup failed",{error:e})}M.current=null,a&&(a.innerHTML="")}},[Y,r,n,s]),(0,a.useEffect)(()=>{b(D.current,M.current,P?700:t)},[P,t]);let X=(0,a.useCallback)(()=>{let e=M.current;if(e)try{e.resetConstruction(),setTimeout(()=>{M.current&&(E.current=v(M.current,Y))},300)}catch(e){w.V.warn("[GGB]","Reset failed",{error:e})}},[Y]),O=(0,a.useCallback)(async()=>{if(C&&!H){A(!0);try{await C(E.current)}finally{A(!1)}}},[C,H]),U=(0,a.useCallback)(async()=>{if(j&&!z&&await (0,f.u)(k.geogebra.confirmDelete,{destructive:!0})){B(!0);try{await j()}catch{f.c.error(k.geogebra.deleteFailed)}finally{B(!1)}}},[j,z,k]);return 0===Y.length?null:(0,i.jsxs)("div",{className:`relative rounded-lg border bg-card ${h}`,children:[(0,i.jsxs)("div",{className:"flex items-center justify-between px-3 py-2 border-b bg-muted/30",children:[(0,i.jsxs)("div",{className:"flex items-center gap-2",children:[(0,i.jsx)("span",{className:"text-xs font-medium text-muted-foreground",children:k.geogebra.title}),S&&(0,i.jsx)(o.f,{className:"h-3 w-3 animate-spin text-muted-foreground"})]}),(0,i.jsxs)("div",{className:"flex items-center gap-1",children:[C&&(0,i.jsxs)(g.f,{variant:"ghost",size:"sm",className:"h-7 px-2 text-xs gap-1",onClick:O,title:k.geogebra.regenerate,disabled:H||S,children:[H?(0,i.jsx)(o.f,{className:"h-3.5 w-3.5 animate-spin"}):(0,i.jsx)(u.f,{className:"h-3.5 w-3.5"}),(0,i.jsx)("span",{children:k.geogebra.regenerate})]}),j&&(0,i.jsxs)(g.f,{variant:"ghost",size:"sm",className:"h-7 px-2 text-xs gap-1 text-destructive hover:text-destructive",onClick:U,title:k.geogebra.delete,disabled:z||H,children:[z?(0,i.jsx)(o.f,{className:"h-3.5 w-3.5 animate-spin"}):(0,i.jsx)(m.f,{className:"h-3.5 w-3.5"}),(0,i.jsx)("span",{children:k.geogebra.delete})]}),(0,i.jsx)(g.f,{variant:"ghost",size:"sm",className:"h-7 w-7 p-0",onClick:X,title:k.geogebra.reset,disabled:S,children:(0,i.jsx)(d.f,{className:"h-3.5 w-3.5"})}),(0,i.jsx)(g.f,{variant:"ghost",size:"sm",className:"h-7 w-7 p-0",onClick:()=>$(e=>!e),title:P?k.geogebra.shrink:k.geogebra.enlarge,children:P?(0,i.jsx)(c,{className:"h-3.5 w-3.5"}):(0,i.jsx)(l,{className:"h-3.5 w-3.5"})})]})]}),(0,i.jsx)("div",{ref:D,style:{width:"100%"}}),S&&(0,i.jsx)("div",{className:"absolute inset-0 z-10 flex items-center justify-center bg-background/80 rounded-b-lg",style:{top:37},children:(0,i.jsxs)("div",{className:"flex flex-col items-center gap-2",children:[(0,i.jsx)(o.f,{className:"h-6 w-6 animate-spin text-primary"}),(0,i.jsx)("span",{className:"text-sm text-muted-foreground",children:k.geogebra.loading})]})}),I&&(0,i.jsx)("div",{className:"flex items-center justify-center text-sm text-destructive",style:{minHeight:t},children:I})]})}],3198)},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 n=(0,t.f)(r);e.s(["f",0,n],856522)},328623,e=>{var t=e.i(456420);let r={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"]};r.node;let n=(0,t.f)(r);e.s(["f",0,n],328623)},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 n=(0,t.f)(r);e.s(["f",0,n],786563)},232660,213761,e=>{var t=e.i(271645),r={x:0,y:0,width:0,height:0,unit:"px"},n=(e,t,r)=>Math.min(Math.max(e,t),r),i=(e,t)=>e===t||e.width===t.width&&e.height===t.height&&e.x===t.x&&e.y===t.y&&e.unit===t.unit;function a(e,t,n){return"%"===e.unit?{...r,...e,unit:"%"}:{unit:"%",x:e.x?e.x/t*100:0,y:e.y?e.y/n*100:0,width:e.width?e.width/t*100:0,height:e.height?e.height/n*100:0}}function o(e,t,n){return e.unit&&"px"!==e.unit?{unit:"px",x:e.x?e.x*t/100:0,y:e.y?e.y*n/100:0,width:e.width?e.width*t/100:0,height:e.height?e.height*n/100:0}:{...r,...e,unit:"px"}}function s(e,t,r,n,i,a=0,o=0,l=n,h=i){let c={...e},d=Math.min(a,n),u=Math.min(o,i),m=Math.min(l,n),g=Math.min(h,i);t&&(t>1?(u=(d=o?o*t:d)/t,m=l*t):(d=(u=a?a/t:u)*t,g=h/t)),c.y<0&&(c.height=Math.max(c.height+c.y,u),c.y=0),c.x<0&&(c.width=Math.max(c.width+c.x,d),c.x=0);let p=n-(c.x+c.width);p<0&&(c.x=Math.min(c.x,n-d),c.width+=p);let f=i-(c.y+c.height);if(f<0&&(c.y=Math.min(c.y,i-u),c.height+=f),c.width<d&&(("sw"===r||"nw"==r)&&(c.x-=d-c.width),c.width=d),c.height<u&&(("nw"===r||"ne"==r)&&(c.y-=u-c.height),c.height=u),c.width>m&&(("sw"===r||"nw"==r)&&(c.x-=m-c.width),c.width=m),c.height>g&&(("nw"===r||"ne"==r)&&(c.y-=g-c.height),c.height=g),t){let e=c.width/c.height;if(e<t){let e=Math.max(c.width/t,u);("nw"===r||"ne"==r)&&(c.y-=e-c.height),c.height=e}else if(e>t){let e=Math.max(c.height*t,d);("sw"===r||"nw"==r)&&(c.x-=e-c.width),c.width=e}}return c}var l={capture:!0,passive:!1},h=0,c=class e extends t.PureComponent{static xOrds=["e","w"];static yOrds=["n","s"];static xyOrds=["nw","ne","se","sw"];static nudgeStep=1;static nudgeStepMedium=10;static nudgeStepLarge=100;static defaultProps={ariaLabels:{cropArea:"Use the arrow keys to move the crop selection area",nwDragHandle:"Use the arrow keys to move the north west drag handle to change the crop selection area",nDragHandle:"Use the up and down arrow keys to move the north drag handle to change the crop selection area",neDragHandle:"Use the arrow keys to move the north east drag handle to change the crop selection area",eDragHandle:"Use the up and down arrow keys to move the east drag handle to change the crop selection area",seDragHandle:"Use the arrow keys to move the south east drag handle to change the crop selection area",sDragHandle:"Use the up and down arrow keys to move the south drag handle to change the crop selection area",swDragHandle:"Use the arrow keys to move the south west drag handle to change the crop selection area",wDragHandle:"Use the up and down arrow keys to move the west drag handle to change the crop selection area"}};get document(){return document}docMoveBound=!1;mouseDownOnCrop=!1;dragStarted=!1;evData={startClientX:0,startClientY:0,startCropX:0,startCropY:0,clientX:0,clientY:0,isResize:!0};componentRef=(0,t.createRef)();mediaRef=(0,t.createRef)();resizeObserver;initChangeCalled=!1;instanceId=`rc-${h++}`;state={cropIsActive:!1,newCropIsBeingDrawn:!1};getBox(){let e=this.mediaRef.current;if(!e)return{x:0,y:0,width:0,height:0};let{x:t,y:r,width:n,height:i}=e.getBoundingClientRect();return{x:t,y:r,width:n,height:i}}componentDidUpdate(e){let{crop:t,onComplete:r}=this.props;if(r&&!e.crop&&t){let{width:e,height:n}=this.getBox();e&&n&&r(o(t,e,n),a(t,e,n))}}componentWillUnmount(){this.resizeObserver&&this.resizeObserver.disconnect(),this.unbindDocMove()}bindDocMove(){this.docMoveBound||=(this.document.addEventListener("pointermove",this.onDocPointerMove,l),this.document.addEventListener("pointerup",this.onDocPointerDone,l),this.document.addEventListener("pointercancel",this.onDocPointerDone,l),!0)}unbindDocMove(){this.docMoveBound&&=(this.document.removeEventListener("pointermove",this.onDocPointerMove,l),this.document.removeEventListener("pointerup",this.onDocPointerDone,l),this.document.removeEventListener("pointercancel",this.onDocPointerDone,l),!1)}onCropPointerDown=e=>{let{crop:t,disabled:r}=this.props,n=this.getBox();if(!t)return;let i=o(t,n.width,n.height);if(r)return;e.cancelable&&e.preventDefault(),this.bindDocMove(),this.componentRef.current.focus({preventScroll:!0});let a=e.target.dataset.ord,s=e.clientX,l=e.clientY,h=i.x,c=i.y;if(a){let t=e.clientX-n.x,r=e.clientY-n.y,o=0,d=0;"ne"===a||"e"==a?(o=t-(i.x+i.width),d=r-i.y,h=i.x,c=i.y+i.height):"se"===a||"s"===a?(o=t-(i.x+i.width),d=r-(i.y+i.height),h=i.x,c=i.y):"sw"===a||"w"==a?(o=t-i.x,d=r-(i.y+i.height),h=i.x+i.width,c=i.y):("nw"===a||"n"==a)&&(o=t-i.x,d=r-i.y,h=i.x+i.width,c=i.y+i.height),s=h+n.x+o,l=c+n.y+d}this.evData={startClientX:s,startClientY:l,startCropX:h,startCropY:c,clientX:e.clientX,clientY:e.clientY,isResize:!!a,ord:a},this.mouseDownOnCrop=!0,this.setState({cropIsActive:!0})};onComponentPointerDown=e=>{let{crop:t,disabled:r,locked:n,keepSelection:i,onChange:s}=this.props,l=this.getBox();if(r||n||i&&t)return;e.cancelable&&e.preventDefault(),this.bindDocMove(),this.componentRef.current.focus({preventScroll:!0});let h=e.clientX-l.x,c=e.clientY-l.y,d={unit:"px",x:h,y:c,width:0,height:0};this.evData={startClientX:e.clientX,startClientY:e.clientY,startCropX:h,startCropY:c,clientX:e.clientX,clientY:e.clientY,isResize:!0},this.mouseDownOnCrop=!0,s(o(d,l.width,l.height),a(d,l.width,l.height)),this.setState({cropIsActive:!0,newCropIsBeingDrawn:!0})};onDocPointerMove=e=>{let t,{crop:r,disabled:n,onChange:s,onDragStart:l}=this.props,h=this.getBox();if(n||!r||!this.mouseDownOnCrop)return;e.cancelable&&e.preventDefault(),this.dragStarted||(this.dragStarted=!0,l&&l(e));let{evData:c}=this;c.clientX=e.clientX,c.clientY=e.clientY,i(r,t=c.isResize?this.resizeCrop():this.dragCrop())||s(o(t,h.width,h.height),a(t,h.width,h.height))};onComponentKeyDown=t=>{let{crop:r,disabled:i,onChange:s,onComplete:l}=this.props;if(i)return;let h=t.key,c=!1;if(!r)return;let d=this.getBox(),u=this.makePixelCrop(d),m=(navigator.platform.match("Mac")?t.metaKey:t.ctrlKey)?e.nudgeStepLarge:t.shiftKey?e.nudgeStepMedium:e.nudgeStep;if("ArrowLeft"===h?(u.x-=m,c=!0):"ArrowRight"===h?(u.x+=m,c=!0):"ArrowUp"===h?(u.y-=m,c=!0):"ArrowDown"===h&&(u.y+=m,c=!0),c){t.cancelable&&t.preventDefault(),u.x=n(u.x,0,d.width-u.width),u.y=n(u.y,0,d.height-u.height);let e=o(u,d.width,d.height),r=a(u,d.width,d.height);s(e,r),l&&l(e,r)}};onHandlerKeyDown=(t,r)=>{var n,l;let h,{aspect:c=0,crop:d,disabled:u,minWidth:m=0,minHeight:g=0,maxWidth:p,maxHeight:f,onChange:w,onComplete:x}=this.props,y=this.getBox();if(u||!d||"ArrowUp"!==t.key&&"ArrowDown"!==t.key&&"ArrowLeft"!==t.key&&"ArrowRight"!==t.key)return;t.stopPropagation(),t.preventDefault();let b=(navigator.platform.match("Mac")?t.metaKey:t.ctrlKey)?e.nudgeStepLarge:t.shiftKey?e.nudgeStepMedium:e.nudgeStep,v=s((n=o(d,y.width,y.height),l=t.key,h={...n},"ArrowLeft"===l?"nw"===r?(h.x-=b,h.y-=b,h.width+=b,h.height+=b):"w"===r?(h.x-=b,h.width+=b):"sw"===r?(h.x-=b,h.width+=b,h.height+=b):"ne"===r?(h.y+=b,h.width-=b,h.height-=b):"e"===r?h.width-=b:"se"===r&&(h.width-=b,h.height-=b):"ArrowRight"===l&&("nw"===r?(h.x+=b,h.y+=b,h.width-=b,h.height-=b):"w"===r?(h.x+=b,h.width-=b):"sw"===r?(h.x+=b,h.width-=b,h.height-=b):"ne"===r?(h.y-=b,h.width+=b,h.height+=b):"e"===r?h.width+=b:"se"===r&&(h.width+=b,h.height+=b)),"ArrowUp"===l?"nw"===r?(h.x-=b,h.y-=b,h.width+=b,h.height+=b):"n"===r?(h.y-=b,h.height+=b):"ne"===r?(h.y-=b,h.width+=b,h.height+=b):"sw"===r?(h.x+=b,h.width-=b,h.height-=b):"s"===r?h.height-=b:"se"===r&&(h.width-=b,h.height-=b):"ArrowDown"===l&&("nw"===r?(h.x+=b,h.y+=b,h.width-=b,h.height-=b):"n"===r?(h.y+=b,h.height-=b):"ne"===r?(h.y+=b,h.width-=b,h.height-=b):"sw"===r?(h.x-=b,h.width+=b,h.height+=b):"s"===r?h.height+=b:"se"===r&&(h.width+=b,h.height+=b)),h),c,r,y.width,y.height,m,g,p,f);if(!i(d,v)){let e=a(v,y.width,y.height);w(v,e),x&&x(v,e)}};onDocPointerDone=e=>{let{crop:t,disabled:r,onComplete:n,onDragEnd:i}=this.props,s=this.getBox();this.unbindDocMove(),!(r||!t)&&this.mouseDownOnCrop&&(this.mouseDownOnCrop=!1,this.dragStarted=!1,i&&i(e),n&&n(o(t,s.width,s.height),a(t,s.width,s.height)),this.setState({cropIsActive:!1,newCropIsBeingDrawn:!1}))};onDragFocus=()=>{this.componentRef.current?.scrollTo(0,0)};getCropStyle(){let{crop:e}=this.props;if(e)return{top:`${e.y}${e.unit}`,left:`${e.x}${e.unit}`,width:`${e.width}${e.unit}`,height:`${e.height}${e.unit}`}}dragCrop(){let{evData:e}=this,t=this.getBox(),r=this.makePixelCrop(t),i=e.clientX-e.startClientX,a=e.clientY-e.startClientY;return r.x=n(e.startCropX+i,0,t.width-r.width),r.y=n(e.startCropY+a,0,t.height-r.height),r}getPointRegion(e,t,r,n){let{evData:i}=this,a=i.clientX-e.x,o=i.clientY-e.y,s;return s=n&&t?"nw"===t||"n"===t||"ne"===t:o<i.startCropY,(r&&t?"nw"===t||"w"===t||"sw"===t:a<i.startCropX)?s?"nw":"sw":s?"ne":"se"}resolveMinDimensions(e,t,r=0,n=0){let i=Math.min(r,e.width),a=Math.min(n,e.height);return t&&(i||a)?t>1?i?[i,i/t]:[a*t,a]:a?[a*t,a]:[i,i/t]:[i,a]}resizeCrop(){let{evData:t}=this,{aspect:r=0,maxWidth:i,maxHeight:a}=this.props,o=this.getBox(),[l,h]=this.resolveMinDimensions(o,r,this.props.minWidth,this.props.minHeight),c=this.makePixelCrop(o),d=this.getPointRegion(o,t.ord,l,h),u=t.ord||d,m=t.clientX-t.startClientX,g=t.clientY-t.startClientY;(l&&"nw"===u||"w"===u||"sw"===u)&&(m=Math.min(m,-l)),(h&&"nw"===u||"n"===u||"ne"===u)&&(g=Math.min(g,-h));let p={unit:"px",x:0,y:0,width:0,height:0};"ne"===d?(p.x=t.startCropX,p.width=m,r?p.height=p.width/r:p.height=Math.abs(g),p.y=t.startCropY-p.height):"se"===d?(p.x=t.startCropX,p.y=t.startCropY,p.width=m,r?p.height=p.width/r:p.height=g):"sw"===d?(p.x=t.startCropX+m,p.y=t.startCropY,p.width=Math.abs(m),r?p.height=p.width/r:p.height=g):"nw"===d&&(p.x=t.startCropX+m,p.width=Math.abs(m),r?(p.height=p.width/r,p.y=t.startCropY-p.height):(p.height=Math.abs(g),p.y=t.startCropY+g));let f=s(p,r,d,o.width,o.height,l,h,i,a);return r||e.xyOrds.indexOf(u)>-1?c=f:e.xOrds.indexOf(u)>-1?(c.x=f.x,c.width=f.width):e.yOrds.indexOf(u)>-1&&(c.y=f.y,c.height=f.height),c.x=n(c.x,0,o.width-c.width),c.y=n(c.y,0,o.height-c.height),c}renderCropSelection(){let{ariaLabels:r=e.defaultProps.ariaLabels,disabled:n,locked:i,renderSelectionAddon:a,ruleOfThirds:o,crop:s}=this.props,l=this.getCropStyle();if(s)return t.default.createElement("div",{style:l,className:"ReactCrop__crop-selection",onPointerDown:this.onCropPointerDown,"aria-label":r.cropArea,tabIndex:0,onKeyDown:this.onComponentKeyDown,role:"group"},!n&&!i&&t.default.createElement("div",{className:"ReactCrop__drag-elements",onFocus:this.onDragFocus},t.default.createElement("div",{className:"ReactCrop__drag-bar ord-n","data-ord":"n"}),t.default.createElement("div",{className:"ReactCrop__drag-bar ord-e","data-ord":"e"}),t.default.createElement("div",{className:"ReactCrop__drag-bar ord-s","data-ord":"s"}),t.default.createElement("div",{className:"ReactCrop__drag-bar ord-w","data-ord":"w"}),t.default.createElement("div",{className:"ReactCrop__drag-handle ord-nw","data-ord":"nw",tabIndex:0,"aria-label":r.nwDragHandle,onKeyDown:e=>this.onHandlerKeyDown(e,"nw"),role:"button"}),t.default.createElement("div",{className:"ReactCrop__drag-handle ord-n","data-ord":"n",tabIndex:0,"aria-label":r.nDragHandle,onKeyDown:e=>this.onHandlerKeyDown(e,"n"),role:"button"}),t.default.createElement("div",{className:"ReactCrop__drag-handle ord-ne","data-ord":"ne",tabIndex:0,"aria-label":r.neDragHandle,onKeyDown:e=>this.onHandlerKeyDown(e,"ne"),role:"button"}),t.default.createElement("div",{className:"ReactCrop__drag-handle ord-e","data-ord":"e",tabIndex:0,"aria-label":r.eDragHandle,onKeyDown:e=>this.onHandlerKeyDown(e,"e"),role:"button"}),t.default.createElement("div",{className:"ReactCrop__drag-handle ord-se","data-ord":"se",tabIndex:0,"aria-label":r.seDragHandle,onKeyDown:e=>this.onHandlerKeyDown(e,"se"),role:"button"}),t.default.createElement("div",{className:"ReactCrop__drag-handle ord-s","data-ord":"s",tabIndex:0,"aria-label":r.sDragHandle,onKeyDown:e=>this.onHandlerKeyDown(e,"s"),role:"button"}),t.default.createElement("div",{className:"ReactCrop__drag-handle ord-sw","data-ord":"sw",tabIndex:0,"aria-label":r.swDragHandle,onKeyDown:e=>this.onHandlerKeyDown(e,"sw"),role:"button"}),t.default.createElement("div",{className:"ReactCrop__drag-handle ord-w","data-ord":"w",tabIndex:0,"aria-label":r.wDragHandle,onKeyDown:e=>this.onHandlerKeyDown(e,"w"),role:"button"})),a&&t.default.createElement("div",{className:"ReactCrop__selection-addon",onPointerDown:e=>e.stopPropagation()},a(this.state)),o&&t.default.createElement(t.default.Fragment,null,t.default.createElement("div",{className:"ReactCrop__rule-of-thirds-hz"}),t.default.createElement("div",{className:"ReactCrop__rule-of-thirds-vt"})))}makePixelCrop(e){return o({...r,...this.props.crop||{}},e.width,e.height)}render(){let{aspect:e,children:r,circularCrop:n,className:i,crop:a,disabled:o,locked:s,style:l,ruleOfThirds:h}=this.props,{cropIsActive:c,newCropIsBeingDrawn:d}=this.state,u=a?this.renderCropSelection():null,m=((...e)=>e.filter(e=>e&&"string"==typeof e).join(" "))("ReactCrop",i,c&&"ReactCrop--active",o&&"ReactCrop--disabled",s&&"ReactCrop--locked",d&&"ReactCrop--new-crop",a&&e&&"ReactCrop--fixed-aspect",a&&n&&"ReactCrop--circular-crop",a&&h&&"ReactCrop--rule-of-thirds",!this.dragStarted&&a&&!a.width&&!a.height&&"ReactCrop--invisible-crop",n&&"ReactCrop--no-animate");return t.default.createElement("div",{ref:this.componentRef,className:m,style:l},t.default.createElement("div",{ref:this.mediaRef,className:"ReactCrop__child-wrapper",onPointerDown:this.onComponentPointerDown},r),a?t.default.createElement("svg",{className:"ReactCrop__crop-mask",width:"100%",height:"100%"},t.default.createElement("defs",null,t.default.createElement("mask",{id:`hole-${this.instanceId}`},t.default.createElement("rect",{width:"100%",height:"100%",fill:"white"}),n?t.default.createElement("ellipse",{cx:`${a.x+a.width/2}${a.unit}`,cy:`${a.y+a.height/2}${a.unit}`,rx:`${a.width/2}${a.unit}`,ry:`${a.height/2}${a.unit}`,fill:"black"}):t.default.createElement("rect",{x:`${a.x}${a.unit}`,y:`${a.y}${a.unit}`,width:`${a.width}${a.unit}`,height:`${a.height}${a.unit}`,fill:"black"}))),t.default.createElement("rect",{fill:"black",fillOpacity:.5,width:"100%",height:"100%",mask:`url(#hole-${this.instanceId})`})):void 0,u)}};e.s(["f",0,c],232660);let d={maxLongEdge:4096,maxPixels:4915200,maxBytes:1572864,startQuality:.9,minQuality:.8};class u extends Error{code;format;constructor(e,t,r){super(e,void 0===r?void 0:{cause:r}),this.code=e,this.format=t,this.name="ImageDecodeError"}}let m=new Set(["heic","heix","heim","heis","hevc","hevx","hevm","hevs"]),g=new Set(["mif1","msf1","mif2"]),p=new Set(["avif","avis"]);function f(e,t,r=d){let n=Math.min(1,r.maxLongEdge/Math.max(e,t),Math.sqrt(r.maxPixels/Math.max(1,e*t)));return{width:Math.max(1,Math.floor(e*n)),height:Math.max(1,Math.floor(t*n)),scale:n}}async function w(e){let t,r;if("function"==typeof createImageBitmap)try{return await createImageBitmap(e,{imageOrientation:"from-image"})}catch{}let n=await (t=URL.createObjectURL(e),(r=new Image).decoding="async",new Promise((e,n)=>{r.onload=()=>e(r),r.onerror=()=>n(Error("IMAGE_ELEMENT_DECODE_FAILED")),r.src=t}).finally(()=>URL.revokeObjectURL(t)));if(!n.naturalWidth||!n.naturalHeight)throw Error("IMAGE_EMPTY");return n}async function x(t){let{heicTo:r}=await e.A(462684);return r({blob:t,type:"image/jpeg",quality:.95})}function y(e,t){return new Promise((r,n)=>{e.toBlob(e=>e?r(e):n(Error("CANVAS_EMPTY")),"image/jpeg",t)})}function b(e,t,r,n,i,a,o){let s,l=((s=document.createElement("canvas")).width=a,s.height=o,s),h=l.getContext("2d");if(!h)throw Error("CANVAS_UNSUPPORTED");return h.fillStyle="#ffffff",h.fillRect(0,0,a,o),h.imageSmoothingEnabled=!0,h.imageSmoothingQuality="high",h.drawImage(e,t,r,n,i,0,0,a,o),l}async function v(e,t){var r;let n,i=performance.now(),a=await e.arrayBuffer(),o=performance.now()-i,s=function(e){let t=(t,r)=>String.fromCharCode(...e.subarray(t,r));if(e.length>=3&&255===e[0]&&216===e[1]&&255===e[2])return"jpeg";if(e.length>=8&&137===e[0]&&"PNG"===t(1,4))return"png";if(e.length>=12&&"RIFF"===t(0,4)&&"WEBP"===t(8,12))return"webp";if(e.length>=6&&("GIF87a"===t(0,6)||"GIF89a"===t(0,6)))return"gif";if(e.length>=2&&"BM"===t(0,2))return"bmp";if(e.length>=12&&"ftyp"===t(4,8)){let r=Math.min(e.length,(e[0]<<24|e[1]<<16|e[2]<<8|e[3])>>>0||e.length),n=[t(8,12)];for(let e=16;e+4<=r;e+=4)n.push(t(e,e+4));if(n.some(e=>m.has(e)))return"heic";if(n.some(e=>p.has(e)))return"avif";if(n.some(e=>g.has(e)))return"heic"}return"unknown"}(new Uint8Array(a,0,Math.min(a.byteLength,64))),l=e.type||"",h=performance.now(),c="native",d=new Blob([a],{type:l||"application/octet-stream"});try{n=await w(d)}catch(e){if("heic"!==s)throw new u("unknown"===s?"UNSUPPORTED_IMAGE":"IMAGE_DECODE_FAILED",s,e);t?.();try{n=await w(await x(d)),c="heic"}catch(e){throw new u("HEIC_DECODE_FAILED",s,e)}}let{width:v,height:C}=(r=n)instanceof HTMLImageElement?{width:r.naturalWidth,height:r.naturalHeight}:{width:r.width,height:r.height};if(!v||!C)throw new u("IMAGE_DECODE_FAILED",s);let j=f(v,C,{maxLongEdge:1600,maxPixels:1/0}),k=await y(b(n,0,0,v,C,j.width,j.height),.85),D=URL.createObjectURL(k),M=performance.now()-h;return{source:n,width:v,height:C,format:s,decoder:c,previewUrl:D,sourceType:l,sourceBytes:e.size,timings:{read:Math.round(o),convert:Math.round(M)},dispose:()=>{URL.revokeObjectURL(D),n instanceof HTMLImageElement||n.close()}}}let C={x:0,y:0,width:1,height:1};async function j(e,t=C,r=d){var n;let i=performance.now(),a=e=>Math.min(1,Math.max(0,e)),o=Math.round(a(t.x)*e.width),s=Math.round(a(t.y)*e.height),l=Math.max(1,Math.min(e.width-o,Math.round(a(t.width)*e.width))),h=Math.max(1,Math.min(e.height-s,Math.round(a(t.height)*e.height))),c=f(l,h,r),u=b(e.source,o,s,l,h,c.width,c.height),m=performance.now()-i,g=performance.now(),p=r.startQuality,w=await y(u,p);for(let t=0;w.size>r.maxBytes&&t<12;t++)p-.05>=r.minQuality-1e-9?p=Math.round((p-.05)*100)/100:(c={width:Math.max(1,Math.floor(.85*c.width)),height:Math.max(1,Math.floor(.85*c.height)),scale:.85*c.scale},u=b(e.source,o,s,l,h,c.width,c.height)),w=await y(u,p);return{dataUrl:await (n=w,new Promise((e,t)=>{let r=new FileReader;r.onload=()=>e(r.result),r.onerror=()=>t(r.error??Error("READ_FAILED")),r.readAsDataURL(n)})),width:c.width,height:c.height,bytes:w.size,quality:p,timings:{crop:Math.round(m),compress:Math.round(performance.now()-g)}}}e.s(["o",0,u,"N",0,function(e,t){return{sourceType:e.sourceType||e.format,sourceBytes:e.sourceBytes,sourceWidth:e.width,sourceHeight:e.height,outputWidth:t.width,outputHeight:t.height,outputBytes:t.bytes,decoder:e.decoder,quality:t.quality}},"p",0,v,"X",0,j],213761)},469937,e=>{var t=e.i(843476),r=e.i(786563),n=e.i(111110),i=e.i(975157);let a=[1,2,3,4,5];e.s(["f",0,function({value:e,onChange:o,disabled:s,size:l="sm",showUnrated:h=!0,className:c}){let{t:d}=(0,n.b)(),u=e??0,m="sm"===l?"h-3.5 w-3.5":"h-5 w-5",g=u?d.difficulty.starsLabel.replace("{n}",String(u)):d.difficulty.unrated;return o?(0,t.jsxs)("span",{className:(0,i.f)("inline-flex items-center gap-0.5",c),role:"group","aria-label":`${d.difficulty.label}${d.common.colon}${g}`,title:d.difficulty.clearHint,children:[a.map(e=>(0,t.jsx)("button",{type:"button",disabled:s,onClick:()=>o(e===u?null:e),"aria-label":d.difficulty.setStars.replace("{n}",String(e)),"aria-pressed":e<=u,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,i.f)(m,e<=u?"fill-amber-400 text-amber-400":"text-muted-foreground/40")})},e)),!u&&h&&(0,t.jsx)("span",{className:"ml-1 text-xs text-muted-foreground",children:d.difficulty.unrated})]}):u?(0,t.jsx)("span",{className:(0,i.f)("inline-flex items-center",c),role:"img","aria-label":`${d.difficulty.label}${d.common.colon}${g}`,title:g,children:a.map(e=>(0,t.jsx)(r.f,{className:(0,i.f)(m,e<=u?"fill-amber-400 text-amber-400":"text-muted-foreground/30"),"aria-hidden":!0},e))}):h?(0,t.jsx)("span",{className:(0,i.f)("text-xs text-muted-foreground",c),children:d.difficulty.unrated}):null}])},12130,e=>{var t=e.i(843476),r=e.i(271645),n=e.i(232660),i=e.i(519455),a=e.i(776639),o=e.i(263676),s=e.i(111110);async function l(e,t){let{naturalWidth:r,naturalHeight:n}=e;return Promise.all(t.map(t=>new Promise((i,a)=>{let o=document.createElement("canvas"),s=Math.round(t.x*r),l=Math.round(t.y*n);o.width=Math.max(1,Math.round(t.width*r)),o.height=Math.max(1,Math.round(t.height*n));let h=o.getContext("2d");h?(h.drawImage(e,s,l,o.width,o.height,0,0,o.width,o.height),o.toBlob(e=>e?i(e):a(Error("Canvas is empty")),"image/jpeg",.95)):a(Error("Canvas is not supported"))})))}let h={maxHeight:"65vh",maxWidth:"100%",objectFit:"contain"},c=(0,r.forwardRef)(function({imageSrc:e,regions:n,onChange:i,imageStyle:a=h,onImageLoad:l},c){let{t:d}=(0,s.b)(),u=(0,r.useRef)(null),m=(0,r.useRef)(null),[g,p]=(0,r.useState)(null),f=e=>{let t=u.current.getBoundingClientRect();return{x:(e.clientX-t.left)/t.width,y:(e.clientY-t.top)/t.height}},w=()=>{g&&g.width>=.02&&g.height>=.02&&i([...n,g]),m.current=null,p(null)},x=e=>({left:`${100*e.x}%`,top:`${100*e.y}%`,width:`${100*e.width}%`,height:`${100*e.height}%`});return(0,t.jsxs)("div",{className:"relative inline-block select-none",children:[(0,t.jsx)("img",{ref:c,src:e,alt:"",draggable:!1,style:a,onLoad:l,className:"block"}),(0,t.jsxs)("div",{ref:u,className:"absolute inset-0 cursor-crosshair",style:{touchAction:"none"},onPointerDown:e=>{0===e.button&&(u.current?.setPointerCapture(e.pointerId),m.current=f(e),p(null))},onPointerMove:e=>{var t,r,n,i;let a,o,s;if(!m.current)return;let l=f(e);p((t=m.current.x,r=m.current.y,n=l.x,i=l.y,o=(a=e=>Math.min(1,Math.max(0,e)))(Math.min(t,n)),s=a(Math.min(r,i)),{x:o,y:s,width:a(Math.max(t,n))-o,height:a(Math.max(r,i))-s}))},onPointerUp:w,onPointerCancel:w,children:[n.map((e,r)=>(0,t.jsxs)("div",{className:"absolute border-2 border-sky-400 bg-sky-400/15",style:x(e),children:[(0,t.jsx)("span",{className:"absolute left-0 top-0 bg-sky-500 px-1.5 text-xs font-bold text-white",children:r+1}),(0,t.jsx)("button",{type:"button",className:"absolute -right-3 -top-3 flex h-6 w-6 items-center justify-center rounded-full bg-red-500 text-white shadow","aria-label":d.batchImport.removeRegion.replace("{index}",String(r+1)),onPointerDown:e=>e.stopPropagation(),onClick:()=>i(n.filter((e,t)=>t!==r)),children:(0,t.jsx)(o.X,{className:"h-3 w-3"})})]},r)),g&&(0,t.jsx)("div",{className:"absolute border-2 border-dashed border-yellow-300 bg-yellow-300/10",style:x(g)})]})]})});var d=e.i(456420);let u={name:"zoom-in",size:24,node:[["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}],["line",{x1:"21",x2:"16.65",y1:"21",y2:"16.65",key:"13gj7c"}],["line",{x1:"11",x2:"11",y1:"8",y2:"14",key:"1vmskp"}],["line",{x1:"8",x2:"14",y1:"11",y2:"11",key:"durymu"}]]};u.node;let m=(0,d.f)(u),g={name:"zoom-out",size:24,node:[["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}],["line",{x1:"21",x2:"16.65",y1:"21",y2:"16.65",key:"13gj7c"}],["line",{x1:"8",x2:"14",y1:"11",y2:"11",key:"durymu"}]]};g.node;let p=(0,d.f)(g);function f({zoom:e,onZoomIn:r,onZoomOut:n,onReset:i}){let{t:a}=(0,s.b)(),o="outline-none focus-visible:ring-2 focus-visible:ring-white/70",l=`flex h-9 w-9 items-center justify-center rounded-full text-white transition-colors hover:bg-white/20 disabled:opacity-40 disabled:hover:bg-transparent ${o}`;return(0,t.jsxs)("div",{className:"flex items-center gap-0.5 rounded-full bg-black/60 p-1 shadow-lg backdrop-blur-sm",children:[(0,t.jsx)("button",{type:"button",className:l,onClick:n,disabled:e<=1,"aria-label":a.common.cropper.zoomOut,title:a.common.cropper.zoomOut,children:(0,t.jsx)(p,{className:"h-4 w-4"})}),(0,t.jsxs)("button",{type:"button",className:`h-9 min-w-14 rounded-full px-2 text-center text-xs font-medium tabular-nums text-white hover:bg-white/20 ${o}`,onClick:i,"aria-label":a.common.cropper.resetZoom,title:a.common.cropper.resetZoom,children:[Math.round(100*e),"%"]}),(0,t.jsx)("button",{type:"button",className:l,onClick:r,disabled:e>=5,"aria-label":a.common.cropper.zoomIn,title:a.common.cropper.zoomIn,children:(0,t.jsx)(m,{className:"h-4 w-4"})})]})}var w=e.i(201276);let x={single:{maxHeight:"70vh",maxWidth:"100%",objectFit:"contain"},auto:{maxHeight:"65vh",maxWidth:"100%",objectFit:"contain"},multi:{maxHeight:"65vh",maxWidth:"100%",objectFit:"contain"}};e.s(["f",0,function({imageSrc:e,open:o,onClose:h,onCropComplete:d,onMultiCropComplete:u,onRegionsSelected:m,allowMulti:g=!0,onAutoSplit:p,onAddPart:y,partCount:b=0}){let{t:v}=(0,s.b)(),C=/^(blob:|data:image\/)/i.test(e)?e:void 0,[j,k]=(0,r.useState)(),D=(0,r.useRef)(null),[M,E]=(0,r.useState)("single"),{containerRef:N,zoom:R,imageStyle:S,measureImage:L,zoomIn:I,zoomOut:_,reset:P}=function(e){let[t,n]=(0,r.useState)(null),i=(0,r.useRef)(null),a=(0,r.useCallback)(e=>{i.current=e,n(e)},[]),[o,s]=(0,r.useState)(1),l=(0,r.useRef)(1),[h,c]=(0,r.useState)(null),d=(0,r.useRef)(null),u=(0,r.useRef)(!1),m=(0,r.useCallback)((e,t,r)=>{let n=i.current,a=l.current,o=Math.min(5,Math.max(1,e));if(!n||o===a)return;if(1===a){let e=n.querySelector("img");e&&c(e.clientWidth)}let h=n.getBoundingClientRect(),u=(t??h.left+h.width/2)-h.left,m=(r??h.top+h.height/2)-h.top;d.current={viewX:u,viewY:m,contentX:n.scrollLeft+u,contentY:n.scrollTop+m,ratio:o/a},l.current=o,s(o)},[]);(0,r.useLayoutEffect)(()=>{let e=i.current,t=d.current;e&&t&&(e.scrollLeft=t.contentX*t.ratio-t.viewX,e.scrollTop=t.contentY*t.ratio-t.viewY,d.current=null)},[o]),(0,r.useEffect)(()=>{if(!t)return;let e=e=>{e.preventDefault(),m(l.current*Math.exp(-(.0015*e.deltaY)),e.clientX,e.clientY)},r=null,n=e=>{let[t,r]=[e[0],e[1]];return{distance:Math.hypot(t.clientX-r.clientX,t.clientY-r.clientY),centerX:(t.clientX+r.clientX)/2,centerY:(t.clientY+r.clientY)/2}},i=e=>{2===e.touches.length&&(r={distance:n(e.touches).distance,zoom:l.current},u.current=!0)},a=e=>{if(!r||2!==e.touches.length)return;e.preventDefault();let{distance:t,centerX:i,centerY:a}=n(e.touches);r.distance>0&&m(r.zoom*(t/r.distance),i,a)},o=e=>{e.touches.length<2&&(r=null,u.current=!1)},s=e=>{u.current&&e.stopPropagation()};return t.addEventListener("wheel",e,{passive:!1}),t.addEventListener("touchstart",i,{passive:!0}),t.addEventListener("touchmove",a,{passive:!1}),t.addEventListener("touchend",o),t.addEventListener("touchcancel",o),t.addEventListener("pointermove",s,{capture:!0}),()=>{t.removeEventListener("wheel",e),t.removeEventListener("touchstart",i),t.removeEventListener("touchmove",a),t.removeEventListener("touchend",o),t.removeEventListener("touchcancel",o),t.removeEventListener("pointermove",s,{capture:!0})}},[t,m]);let g=(0,r.useCallback)(e=>{e&&1===l.current&&c(e.clientWidth)},[]),p=(0,r.useCallback)(()=>m(1.25*l.current),[m]),f=(0,r.useCallback)(()=>m(l.current/1.25),[m]),w=(0,r.useCallback)(()=>{l.current=1,d.current=null,s(1)},[]),x=1!==o&&h?{...e,width:h*o,height:"auto",maxWidth:"none",maxHeight:"none"}:e;return{containerRef:a,zoom:o,imageStyle:x,measureImage:g,zoomIn:p,zoomOut:f,reset:w}}(x[M]);(0,r.useEffect)(()=>{P()},[e,P]);let[$,H]=(0,r.useState)({src:e,regions:[]}),A=$.src===e?$.regions:[],z=t=>H({src:e,regions:t}),B=(0,r.useRef)(null),Y=["single",...p?["auto"]:[],...u||m&&g?["multi"]:[]],X={single:v.batchImport.singleMode,auto:v.batchImport.autoMode,multi:v.batchImport.multiMode},O=async()=>{if(0!==A.length){if(m){m(A,!0),z([]);return}if(B.current&&u)try{u(await l(B.current,A)),z([])}catch(e){w.V.error("[ImageCropper]","Multi-image crop failed",{error:e})}}},U=()=>j&&j.width>0&&j.height>0?{x:j.x/100,y:j.y/100,width:j.width/100,height:j.height/100}:{x:0,y:0,width:1,height:1},K=async()=>{let e=U();if("auto"===M&&p)return void p(e);if(m)return void m([e],!1);if(D.current&&d)try{let[t]=await l(D.current,[e]);d(t)}catch(e){w.V.error("[ImageCropper]","Crop failed",{error:e})}};return(0,t.jsx)(a.N,{open:o,onOpenChange:e=>!e&&h(),children:(0,t.jsxs)(a.d,{className:"max-w-3xl h-[90vh] flex flex-col p-0 gap-0",children:[(0,t.jsx)(a.s,{className:"p-4 border-b shrink-0",children:(0,t.jsx)(a.F,{children:v.common.cropper?.title||"Crop Image"})}),(0,t.jsxs)("div",{className:"relative min-h-0 flex-1 bg-black",children:[(0,t.jsx)("div",{ref:N,className:"flex h-full w-full overflow-auto p-4",children:(0,t.jsx)("div",{className:"m-auto",children:"multi"===M?(0,t.jsx)(c,{ref:B,imageSrc:C,regions:A,onChange:z,imageStyle:S,onImageLoad:e=>L(e.currentTarget)}):(0,t.jsx)(n.f,{crop:j,onChange:(e,t)=>k(t),children:(0,t.jsx)("img",{ref:D,alt:"Crop me",src:C,onLoad:function(e){k({unit:"%",x:0,y:0,width:100,height:100}),L(e.currentTarget)},style:S})})})}),(0,t.jsx)("div",{className:"absolute right-3 top-3",children:(0,t.jsx)(f,{zoom:R,onZoomIn:I,onZoomOut:_,onReset:P})})]}),(0,t.jsxs)("div",{className:"p-4 border-t bg-background shrink-0 space-y-3",children:[Y.length>1&&(0,t.jsx)("div",{className:`grid gap-1 rounded-md bg-muted p-1 ${3===Y.length?"grid-cols-3 sm:w-[28rem]":"grid-cols-2 sm:w-80"}`,children:Y.map(e=>(0,t.jsx)("button",{type:"button","aria-pressed":M===e,onClick:()=>{P(),E(e)},className:`rounded px-2 py-1.5 text-sm font-medium transition-colors ${M===e?"bg-background shadow-sm":"text-muted-foreground"}`,children:X[e]},e))}),(0,t.jsxs)("div",{className:"flex flex-col sm:flex-row sm:justify-between sm:items-center gap-3",children:[(0,t.jsx)("p",{className:"text-sm text-muted-foreground",children:"multi"===M?`${v.batchImport.hint} ${v.batchImport.regionCount.replace("{count}",String(A.length))}`:"auto"===M?v.batchImport.autoHint:b>0?v.upload.parts.cropHint.replace("{n}",String(b+1)):v.common.cropper?.hint||"💡 Drag to adjust crop area"}),(0,t.jsxs)("div",{className:"flex flex-wrap gap-2 justify-end",children:["multi"===M&&A.length>0&&(0,t.jsx)(i.f,{variant:"ghost",onClick:()=>z([]),children:v.batchImport.clear}),(0,t.jsx)(i.f,{variant:"outline",onClick:h,children:v.common.cancel||"Cancel"}),"multi"===M?(0,t.jsx)(i.f,{onClick:O,disabled:0===A.length,children:v.batchImport.start.replace("{count}",String(A.length))}):(0,t.jsxs)(t.Fragment,{children:["single"===M&&y&&(0,t.jsx)(i.f,{variant:"secondary",onClick:()=>y(U()),"data-testid":"crop-add-part",children:v.upload.parts.addNext}),(0,t.jsx)(i.f,{onClick:K,children:"auto"===M?v.batchImport.autoStart:b>0?v.upload.parts.confirm.replace("{count}",String(b+1)):v.common.confirm||"Confirm"})]})]})]})]})]})})}],12130)},141176,e=>{var t=e.i(843476),r=e.i(271645),n=e.i(456420);let i={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"]};i.node;let a=(0,n.f)(i);var o=e.i(772382),s=e.i(511445),l=e.i(624687),h=e.i(111110),c=e.i(975157);e.s(["f",0,function({value:e,onChange:n,className:i,...d}){let{t:u}=(0,h.b)(),[m,g]=(0,r.useState)("source"),p=(0,r.useId)(),f=[{mode:"source",label:u.markdownEditor.source,icon:a},{mode:"preview",label:u.markdownEditor.preview,icon:o.f}];return(0,t.jsxs)("div",{className:"space-y-1.5",children:[(0,t.jsx)("div",{role:"tablist","aria-label":u.markdownEditor.modeLabel,className:"flex justify-end",children:(0,t.jsx)("div",{className:"inline-flex rounded-md border bg-muted/40 p-0.5",children:f.map(({mode:e,label:r,icon:n})=>(0,t.jsxs)("button",{type:"button",role:"tab","aria-selected":m===e,"aria-controls":p,onClick:()=>g(e),className:(0,c.f)("flex items-center gap-1 rounded px-2.5 py-1 text-xs transition-colors",m===e?"bg-background font-medium shadow-sm":"text-muted-foreground hover:text-foreground"),children:[(0,t.jsx)(n,{className:"h-3.5 w-3.5"}),r]},e))})}),(0,t.jsx)("div",{id:p,role:"tabpanel",children:"source"===m?(0,t.jsx)(l.f,{value:e,onChange:e=>n(e.target.value),className:i,...d}):(0,t.jsx)("div",{className:"min-h-24 cursor-text rounded-md border bg-muted/20 px-3 py-2",onDoubleClick:()=>g("source"),title:u.markdownEditor.doubleClickToEdit,children:e.trim()?(0,t.jsx)(s.f,{content:e}):(0,t.jsx)("p",{className:"text-sm italic text-muted-foreground",children:u.markdownEditor.empty})})})]})}],141176)},438465,674166,e=>{var t=e.i(843476),r=e.i(271645),n=e.i(967489),i=e.i(856423),a=e.i(41931),o=e.i(201276),s=e.i(111110);e.s(["f",0,function({value:e,onChange:l,className:h}){let[c,d]=(0,r.useState)([]),{t:u}=(0,s.b)();return(0,r.useEffect)(()=>{(async()=>{try{let e=await a.k.get("/api/notebooks");d(e)}catch(e){o.V.error("[NotebookSelector]","Failed to fetch notebooks",{error:e})}})()},[]),(0,t.jsxs)(n.d,{value:e,onValueChange:l,children:[(0,t.jsx)(n.P,{className:h,children:(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)(i.f,{className:"h-4 w-4 text-muted-foreground"}),(0,t.jsx)(n.U,{placeholder:u.notebooks?.selector?.placeholder||"Select Notebook"})]})}),(0,t.jsx)(n.r,{children:0===c.length?(0,t.jsx)("div",{className:"p-2 text-sm text-muted-foreground text-center",children:u.notebooks?.selector?.empty||"No notebooks available"}):c.map(e=>(0,t.jsx)(n.T,{value:e.id,children:e.name},e.id))})]})}],438465);var l=e.i(664030);e.s(["f",0,function({value:e,onChange:r,disabled:i}){let{groups:a,loading:o}=(0,l.f)(),s=a.filter(e=>e.isActive);return(0,t.jsxs)(n.d,{value:e,onValueChange:r,disabled:i||o,children:[(0,t.jsx)(n.P,{children:(0,t.jsx)(n.U,{placeholder:"选择卷别"})}),(0,t.jsx)(n.r,{children:s.map(e=>(0,t.jsx)(n.T,{value:e.id,children:e.name},e.id))})]})}],674166)},149704,e=>{var t=e.i(843476),r=e.i(111110),n=e.i(398019),i=e.i(184110),a=e.i(975157);let o={left:"mr-auto",center:"mx-auto",right:"ml-auto"};e.s(["f",0,function({svg:e,scale:s,align:l,className:h}){let{t:c}=(0,r.b)();if(!e)return null;let d=(0,i.V)(s),u=(0,i.o)(l);return(0,t.jsx)("figure",{className:(0,a.f)("question-figure my-3",h),children:(0,t.jsx)("img",{src:(0,n.f)(e),alt:c.figure.alt,className:(0,a.f)(o[u],"block h-auto max-w-full rounded border bg-white p-2"),style:{..."left"===u?{marginLeft:0,marginRight:"auto"}:"right"===u?{marginLeft:"auto",marginRight:0}:{},maxHeight:360,zoom:d/100,maxWidth:`${Math.min(d,100)}%`}})})}])},574041,e=>{var t=e.i(843476),r=e.i(271645),n=e.i(263676),i=e.i(487486),a=e.i(793479),o=e.i(41931),s=e.i(201276);e.s(["f",0,function({value:e=[],onChange:l,placeholder:h="Enter tags...",className:c="",enterHint:d,subject:u,gradeStage:m}){let[g,p]=(0,r.useState)(""),[f,w]=(0,r.useState)([]),[x,y]=(0,r.useState)(!1),[b,v]=(0,r.useState)(0),C=(0,r.useRef)(null),j=(0,r.useRef)(null),k=(0,r.useCallback)(async t=>{try{let r=new URLSearchParams({q:t});u&&r.append("subject",u),m&&r.append("stage",m);let n=((await o.k.get(`/api/tags/suggestions?${r.toString()}`)).suggestions||[]).filter(t=>!e.includes(t));w(n.slice(0,20)),y(n.length>0),v(0)}catch(e){s.V.error("[TagInput]","Failed to fetch suggestions",{error:e})}},[u,m,e]);(0,r.useEffect)(()=>{g.trim()&&k(g)},[g,k]);let D=t=>{t.trim()&&!e.includes(t.trim())&&(l([...e,t.trim()]),p(""),w([]),y(!1),v(0))},M=t=>{l(e.filter(e=>e!==t))};return(0,r.useEffect)(()=>{let e=e=>{!j.current||j.current.contains(e.target)||C.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)(i.f,{variant:"secondary",className:"flex items-center gap-1 px-2 py-1",children:[e,(0,t.jsx)("button",{type:"button",onClick:()=>M(e),className:"hover:text-destructive ml-1",children:(0,t.jsx)(n.X,{className:"h-3 w-3"})})]},e)),(0,t.jsx)(a.f,{ref:C,type:"text",value:g,onChange:e=>{p(e.target.value),e.target.value.trim()||(w([]),y(!1))},onKeyDown:t=>{"Enter"===t.key?(t.preventDefault(),b>=0&&f[b]?D(f[b]):g.trim()&&D(g)):"ArrowDown"===t.key?(t.preventDefault(),v(e=>Math.min(e+1,f.length-1))):"ArrowUp"===t.key?(t.preventDefault(),v(e=>Math.max(e-1,0))):"Escape"===t.key?(y(!1),v(0)):"Backspace"===t.key&&!g&&e.length>0&&M(e[e.length-1])},onFocus:()=>{f.length>0&&y(!0)},placeholder:0===e.length?h:"",className:"flex-1 min-w-[120px] border-none focus-visible:ring-0 focus-visible:ring-offset-0 h-8 px-0"})]}),x&&f.length>0&&(0,t.jsx)("div",{ref:j,className:"absolute z-50 w-full mt-1 bg-popover border rounded-md shadow-md max-h-48 overflow-y-auto",children:f.map((e,r)=>(0,t.jsx)("div",{className:`px-3 py-2 cursor-pointer hover:bg-accent ${r===b?"bg-accent":""}`,onClick:()=>D(e),onMouseEnter:()=>v(r),children:e},e))}),g&&!x&&(0,t.jsx)("div",{className:"text-xs text-muted-foreground mt-1",children:d?`${d} "${g}"`:`Press Enter to create "${g}"`})]})}])},184110,e=>{let t=["left","center","right"],r="center";function n(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,n,"o",0,function(e){return"string"==typeof e&&t.includes(e)?e:r},"V",0,function(e){return n(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 n=(0,t.f)(r);e.s(["f",0,n],711241)},474544,e=>{var t=e.i(456420);let r={name:"clock",size:24,node:[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 6v6l4 2",key:"mmk7yg"}]]};r.node;let n=(0,t.f)(r);e.s(["f",0,n],474544)},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 n=(0,t.f)(r);e.s(["f",0,n],786563)},118924,e=>{var t=e.i(843476),r=e.i(271645),n=e.i(522016),i=e.i(975153),a=e.i(741120),s=e.i(666696),l=e.i(519455),c=e.i(912505),o=e.i(393842),d=e.i(658512),u=e.i(111110),f=e.i(215519),m=e.i(41931),x=e.i(469817),p=e.i(306831),g=e.i(201276),h=e.i(35209);let b=[1,2,4,7,15,30];e.s(["default",0,function(){let{t:e}=(0,u.b)(),{timeZone:v}=(0,f.M)();(0,h.f)(e.review.title);let[w,y]=(0,r.useState)(null),[j,k]=(0,r.useState)(1),N=(0,r.useCallback)(async e=>{try{y(await m.k.get(`/api/review/due?page=${e}&pageSize=${x.$}`))}catch(e){g.V.error("[Review]","Failed to fetch due reviews",{error:e})}},[]);(0,r.useEffect)(()=>{N(j)},[j,N]);let C=(0,p.d)(new Date,v).start;return(0,t.jsxs)("main",{className:"mx-auto max-w-6xl space-y-6 px-4 py-6 md:px-8 md:py-8",children:[(0,t.jsx)(o.f,{title:e.review.title,description:e.review.desc,actions:w&&w.total>0&&(0,t.jsx)("span",{className:"rounded-full bg-primary/10 px-3 py-1 text-sm font-medium text-primary",children:e.review.dueCount.replace("{count}",String(w.total))})}),!w&&(0,t.jsx)("div",{className:"grid gap-4 md:grid-cols-2 lg:grid-cols-3",children:Array.from({length:6},(e,r)=>(0,t.jsx)("div",{className:"h-52 animate-pulse rounded-2xl bg-muted"},r))}),w&&0===w.total&&(0,t.jsx)(c.f,{icon:i.f,title:e.review.empty,description:e.review.emptyHint}),w&&w.items.length>0&&(0,t.jsx)("div",{className:"grid gap-4 md:grid-cols-2 lg:grid-cols-3",children:w.items.map(r=>{let i;return(0,t.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,t.jsx)("div",{className:"flex-1",children:(0,t.jsx)(s.f,{item:r,selectMode:!1,selected:!1,onToggleSelect:()=>{},selectedTag:null,onTagClick:()=>{}})}),(0,t.jsxs)("div",{className:"flex items-center justify-between gap-2 px-1 text-xs text-muted-foreground",children:[(0,t.jsxs)("span",{children:[(i=(0,p.r)(r.nextReviewAt,"MM/dd",v),new Date(r.nextReviewAt)<C?e.review.overdue.replace("{date}",i):e.review.dueOn.replace("{date}",i))," · ",e.review.round.replace("{round}",String(r.reviewStage+1)).replace("{total}",String(b.length))]}),(0,t.jsx)(n.default,{href:`/practice?id=${r.id}`,children:(0,t.jsxs)(l.f,{variant:"outline",size:"sm",className:"h-8",children:[(0,t.jsx)(a.f,{className:"mr-1.5 h-3.5 w-3.5"}),e.review.practice]})})]})]},r.id)})}),w&&(0,t.jsx)(d.f,{page:j,totalPages:w.totalPages,total:w.total,pageSize:w.pageSize,onPageChange:k})]})}],118924)},469937,e=>{var t=e.i(843476),r=e.i(786563),n=e.i(111110),i=e.i(975157);let a=[1,2,3,4,5];e.s(["f",0,function({value:e,onChange:s,disabled:l,size:c="sm",showUnrated:o=!0,className:d}){let{t:u}=(0,n.b)(),f=e??0,m="sm"===c?"h-3.5 w-3.5":"h-5 w-5",x=f?u.difficulty.starsLabel.replace("{n}",String(f)):u.difficulty.unrated;return s?(0,t.jsxs)("span",{className:(0,i.f)("inline-flex items-center gap-0.5",d),role:"group","aria-label":`${u.difficulty.label}${u.common.colon}${x}`,title:u.difficulty.clearHint,children:[a.map(e=>(0,t.jsx)("button",{type:"button",disabled:l,onClick:()=>s(e===f?null:e),"aria-label":u.difficulty.setStars.replace("{n}",String(e)),"aria-pressed":e<=f,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,i.f)(m,e<=f?"fill-amber-400 text-amber-400":"text-muted-foreground/40")})},e)),!f&&o&&(0,t.jsx)("span",{className:"ml-1 text-xs text-muted-foreground",children:u.difficulty.unrated})]}):f?(0,t.jsx)("span",{className:(0,i.f)("inline-flex items-center",d),role:"img","aria-label":`${u.difficulty.label}${u.common.colon}${x}`,title:x,children:a.map(e=>(0,t.jsx)(r.f,{className:(0,i.f)(m,e<=f?"fill-amber-400 text-amber-400":"text-muted-foreground/30"),"aria-hidden":!0},e))}):o?(0,t.jsx)("span",{className:(0,i.f)("text-xs text-muted-foreground",d),children:u.difficulty.unrated}):null}])},846968,e=>{var t=e.i(843476),r=e.i(548161),n=e.i(474544),i=e.i(741120),a=e.i(487486),s=e.i(111110);let l={new:{className:"bg-warning/15 text-amber-700 dark:text-warning",icon:n.f},reviewing:{className:"bg-primary/10 text-primary",icon:i.f},mastered:{className:"bg-success/15 text-success",icon:r.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:r=""}){let{t:n}=(0,s.b)(),{className:i,icon:c}=l[e],o="mastered"===e?n.notebook.mastered:"reviewing"===e?n.notebook.reviewing:n.notebook.review;return(0,t.jsx)(a.f,{variant:"secondary",className:`${i} ${r}`,children:(0,t.jsxs)("span",{className:"flex items-center gap-1",children:[(0,t.jsx)(c,{className:"h-3 w-3"})," ",o]})})}])},590546,e=>{var t=e.i(843476),r=e.i(618566),n=e.i(519455),i=e.i(711241);e.s(["f",0,function({fallbackUrl:e,className:a}){let s=(0,r.useRouter)();return(0,t.jsx)(n.f,{variant:"ghost",size:"icon",onClick:()=>{s.push(e)},className:a,children:(0,t.jsx)(i.f,{className:"h-5 w-5"})})}])},257428,e=>{var t=e.i(843476),r=e.i(271645),n=e.i(820783),i=e.i(30030),a=e.i(981140),s=e.i(369340),l=e.i(635804),c=e.i(296626),o=e.i(248425),d=Object.defineProperty,u=(e,t)=>d(e,"name",{value:t,configurable:!0}),f="Checkbox",[m,x]=(0,i.f)(f),[p,g]=m(f);function h(e){let{__scopeCheckbox:n,checked:i,children:a,defaultChecked:l,disabled:c,form:o,name:d,onCheckedChange:u,required:m,value:x="on",internal_do_not_use_render:g}=e,[h,b]=(0,s.f)({prop:i,defaultProp:l??!1,onChange:u,caller:f}),[v,w]=r.useState(null),[y,N]=r.useState(null),[C,S]=r.useState(null),R=!v||!!o||!!v.closest("form"),P={checked:h,disabled:c,setChecked:b,control:v,setControl:w,name:d,form:o,value:x,userClick:C,onUserClick:S,required:m,defaultChecked:!k(l)&&l,isFormControl:R,bubbleInput:y,setBubbleInput:N};return(0,t.jsx)(p,{scope:n,...P,children:j(g)?g(P):a})}u(h,"CheckboxProvider");var b=r.forwardRef(u(function({__scopeCheckbox:e,onKeyDown:i,onClick:s,...l},c){let{control:d,value:f,disabled:m,checked:x,required:p,setControl:h,setChecked:b,onUserClick:v,isFormControl:w,bubbleInput:y}=g("CheckboxTrigger",e),j=(0,n.f)(c,h),C=r.useRef(x);return r.useEffect(()=>{let e=d?.form;if(e){let t=u(()=>b(C.current),"reset");return e.addEventListener("reset",t),()=>e.removeEventListener("reset",t)}},[d,b]),(0,t.jsx)(o.V.button,{type:"button",role:"checkbox","aria-checked":k(x)?"mixed":x,"aria-required":p,"data-state":N(x),"data-disabled":m?"":void 0,disabled:m,value:f,...l,ref:j,onKeyDown:(0,a.f)(i,e=>{"Enter"===e.key&&e.preventDefault()}),onClick:(0,a.f)(s,e=>{let t=e.isPropagationStopped();v({requestedChecked:!!k(x)||!x,hasConsumerStoppedPropagation:t}),b(e=>!!k(e)||!e),y&&w&&!t&&e.stopPropagation()})})},"CheckboxTrigger")),v=r.forwardRef(u(function(e,r){let{__scopeCheckbox:n,name:i,checked:a,defaultChecked:s,required:l,disabled:c,value:o,onCheckedChange:d,form:u,...f}=e;return(0,t.jsx)(h,{__scopeCheckbox:n,checked:a,defaultChecked:s,disabled:c,required:l,onCheckedChange:d,name:i,form:u,value:o,internal_do_not_use_render:({isFormControl:e})=>(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(b,{...f,ref:r,__scopeCheckbox:n}),e&&(0,t.jsx)(y,{__scopeCheckbox:n})]})})},"Checkbox")),w=r.forwardRef(u(function(e,r){let{__scopeCheckbox:n,forceMount:i,...a}=e,s=g("CheckboxIndicator",n);return(0,t.jsx)(c.f,{present:i||k(s.checked)||!0===s.checked,children:(0,t.jsx)(o.V.span,{"data-state":N(s.checked),"data-disabled":s.disabled?"":void 0,...a,ref:r,style:{pointerEvents:"none",...e.style}})})},"CheckboxIndicator")),y=r.forwardRef(u(function({__scopeCheckbox:e,onClick:i,...s},c){let{control:d,userClick:u,checked:f,defaultChecked:m,required:x,disabled:p,name:h,value:b,form:v,bubbleInput:w,setBubbleInput:y}=g("CheckboxBubbleInput",e),j=(0,n.f)(c,y),N=(0,l.f)(d),C=r.useRef(!1),S=r.useRef(f),R=r.useRef(u),P=r.useRef(null);r.useEffect(()=>{if(!w)return;let e=Object.getOwnPropertyDescriptor(window.HTMLInputElement.prototype,"checked").set;if(!e)return;let t=S.current!==f;S.current=f;let r=null!==u&&u!==R.current;if(R.current=u,r)P.current=t?null:u,t&&(w.indeterminate=k(f),e.call(w,!k(f)&&f)),w.dispatchEvent(new Event("click",{bubbles:!u.hasConsumerStoppedPropagation}));else if(t){let t=P.current;P.current=null;let r=t?.requestedChecked===f;C.current=!0,w.indeterminate=k(f),e.call(w,!k(f)&&f),w.dispatchEvent(new Event("click",{bubbles:!(r&&t.hasConsumerStoppedPropagation)})),C.current=!1}},[w,f,u]);let E=r.useRef(!k(f)&&f);return(0,t.jsx)(o.V.input,{type:"checkbox","aria-hidden":!0,defaultChecked:m??E.current,required:x,disabled:p,name:h,value:b,form:v,...s,tabIndex:-1,ref:j,onClick:(0,a.f)(i,e=>{C.current&&e.stopPropagation()}),style:{...s.style,...N,position:"absolute",pointerEvents:"none",opacity:0,margin:0,transform:"translateX(-100%)"}})},"CheckboxBubbleInput"));function j(e){return"function"==typeof e}function k(e){return"indeterminate"===e}function N(e){return k(e)?"indeterminate":e?"checked":"unchecked"}u(j,"isFunction"),u(k,"isIndeterminate"),u(N,"getState");var C=e.i(689664),S=e.i(975157);let R=r.forwardRef(({className:e,...r},n)=>(0,t.jsx)(v,{ref:n,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)(w,{className:(0,S.f)("flex items-center justify-center text-current"),children:(0,t.jsx)(C.f,{className:"h-4 w-4"})})}));R.displayName=v.displayName,e.s(["f",0,R],257428)},912505,e=>{var t=e.i(843476),r=e.i(975157);e.s(["f",0,function({icon:e,title:n,description:i,action:a,className:s}){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",s),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}),i&&(0,t.jsx)("p",{className:"mt-1 max-w-sm text-sm text-muted-foreground",children:i}),a&&(0,t.jsx)("div",{className:"mt-5",children:a})]})}])},393842,e=>{var t=e.i(843476),r=e.i(590546),n=e.i(975157);e.s(["f",0,function({title:e,description:i,backHref:a,actions:s,titleAddon:l,className:c}){return(0,t.jsxs)("div",{className:(0,n.f)("flex items-start gap-3",c),children:[a&&(0,t.jsx)(r.f,{fallbackUrl:a,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]}),i&&(0,t.jsx)("p",{className:"text-sm text-muted-foreground sm:text-base",children:i})]}),s&&(0,t.jsx)("div",{className:"flex shrink-0 items-center gap-2",children:s})]})}])},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[]}}])},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)}])},35209,e=>{var t=e.i(271645),r=e.i(111110);e.s(["f",0,function(...e){let{t:n}=(0,r.b)(),i=[n.pageTitle.base,...e.map(e=>"string"==typeof e?e.trim():"").filter(e=>e.length>0)].join("-");(0,t.useEffect)(()=>{document.title=i},[i])}])}])})();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,[218964,e=>{var t=e.i(456420);let s={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"}]]};s.node;let a=(0,t.f)(s);e.s(["f",0,a],218964)},328623,e=>{var t=e.i(456420);let s={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"]};s.node;let a=(0,t.f)(s);e.s(["f",0,a],328623)},697886,e=>{var t=e.i(456420);let s={name:"target",size:24,node:[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["circle",{cx:"12",cy:"12",r:"6",key:"1vlfrh"}],["circle",{cx:"12",cy:"12",r:"2",key:"1c9p78"}]]};s.node;let a=(0,t.f)(s);e.s(["f",0,a],697886)},952683,e=>{var t=e.i(843476),s=e.i(271645),a=e.i(618566),i=e.i(518515),n=e.i(325597),r=e.i(328623),l=e.i(747819),o=e.i(866531),d=e.i(515288),c=e.i(519455),m=e.i(624687),u=e.i(110204),h=e.i(856522),x=e.i(632781),p=e.i(772382),g=e.i(7891),g=g,f=e.i(395925),v=e.i(111110),j=e.i(511445),y=e.i(574041),b=e.i(438465),k=e.i(674166),w=e.i(967489),N=e.i(952122),S=e.i(294114);function A({onSubmit:e,defaultNotebookId:a,defaultNotebookName:i,isSaving:r}){let{t:l}=(0,v.b)(),[o,C]=(0,s.useState)(null),[T,P]=(0,s.useState)(""),[E,I]=(0,s.useState)(""),[z,H]=(0,s.useState)(""),[M,q]=(0,s.useState)(""),[B,D]=(0,s.useState)(""),[F,R]=(0,s.useState)("unknown"),[K,U]=(0,s.useState)([]),[$,O]=(0,s.useState)(a||""),[L,V]=(0,s.useState)(""),[W,_]=(0,s.useState)(""),Q=async()=>{if(T.trim()){if(!$)return void S.c.warning(l.editor.messages?.selectNotebook||"Please select a notebook");await e({questionText:T.trim(),answerText:E.trim(),analysis:z.trim(),wrongAnswerText:M.trim(),mistakeAnalysis:B.trim(),mistakeStatus:F,knowledgePoints:K,subjectId:$,gradeSemester:L||void 0,paperLevel:W||void 0})}},G=e=>{(e.ctrlKey||e.metaKey)&&"Enter"===e.key&&(e.preventDefault(),T.trim()&&$&&!r&&Q())},J=[{key:"question",label:l.editor?.question||"Question Text",value:T,setter:P,placeholder:l.directEntry.questionPlaceholder,minHeight:"min-h-[180px]",required:!0},{key:"answer",label:l.editor?.answer||"Answer",value:E,setter:I,placeholder:l.directEntry.answerPlaceholder,minHeight:"min-h-[120px]"},{key:"analysis",label:l.editor?.analysis||"Analysis / Explanation",value:z,setter:H,placeholder:l.directEntry.analysisPlaceholder,minHeight:"min-h-[150px]"},{key:"wrongAnswer",label:l.editor?.wrongAnswerText||"Wrong Answer / Work",value:M,setter:q,placeholder:l.directEntry.wrongAnswerPlaceholder,minHeight:"min-h-[100px]"},{key:"mistakeAnalysis",label:l.editor?.mistakeAnalysis||"Mistake Cause Analysis",value:B,setter:D,placeholder:l.directEntry.mistakeAnalysisPlaceholder,minHeight:"min-h-[100px]"}];return(0,t.jsx)(d.N,{className:"rounded-2xl",children:(0,t.jsxs)(d.O,{className:"p-6 space-y-5",children:[(0,t.jsxs)("div",{className:"flex items-center justify-between",children:[(0,t.jsxs)("div",{className:"flex items-center gap-2 text-muted-foreground",children:[(0,t.jsx)(n.f,{className:"h-5 w-5"}),(0,t.jsx)("span",{className:"text-sm font-medium",children:l.directEntry.title})]}),(0,t.jsxs)(c.f,{variant:"ghost",size:"sm",onClick:()=>{P(""),I(""),H(""),q(""),D(""),R("unknown"),U([]),V(""),_("")},disabled:r,className:"text-muted-foreground hover:text-destructive",children:[(0,t.jsx)(f.f,{className:"h-4 w-4 mr-1"}),l.directEntry.reset]})]}),(0,t.jsxs)("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-4",children:[(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsxs)(u.f,{children:[l.editor?.selectNotebook||"Select Notebook"," *"]}),(0,t.jsx)(b.f,{value:$,onChange:O})]}),(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsx)(u.f,{children:l.editor?.gradeSemester||"Grade/Semester"}),(0,t.jsx)("input",{type:"text",value:L,onChange:e=>V(e.target.value),placeholder:l.directEntry.gradeSemesterPlaceholder,className:"flex h-10 w-full rounded-md border border-input bg-background px-3 py-2 text-sm"})]}),(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsx)(u.f,{children:l.editor?.paperLevel||"Paper Level"}),(0,t.jsx)(k.f,{value:W,onChange:_})]})]}),J.map(e=>(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsxs)("div",{className:"flex items-center justify-between",children:[(0,t.jsxs)(u.f,{className:e.required?"text-primary font-semibold":"",children:[e.label," ",e.required&&"*"]}),(0,t.jsx)(c.f,{variant:"ghost",size:"sm",className:"h-7 px-2 text-xs",onClick:()=>C(o===e.key?null:e.key),disabled:!e.value,children:o===e.key?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(g.f,{className:"h-3 w-3 mr-1"}),l.directEntry.edit]}):(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(p.f,{className:"h-3 w-3 mr-1"}),l.directEntry.preview]})})]}),o===e.key?(0,t.jsx)("div",{className:`rounded-md border bg-muted/30 p-4 ${e.minHeight} overflow-auto cursor-pointer`,onClick:()=>C(null),children:(0,t.jsx)(j.f,{content:e.value})}):(0,t.jsx)(m.f,{value:e.value,onChange:t=>e.setter(t.target.value),onKeyDown:G,placeholder:e.placeholder,className:`${e.minHeight} font-mono text-sm resize-y`,disabled:r})]},e.key)),(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsx)(u.f,{children:l.editor?.mistakeStatus||"Attempt Status"}),(0,t.jsxs)(w.d,{value:F,onValueChange:e=>R(e),children:[(0,t.jsx)(w.P,{className:"w-[200px]",children:(0,t.jsx)(w.U,{})}),(0,t.jsxs)(w.r,{children:[(0,t.jsx)(w.T,{value:"not_attempted",children:l.editor?.mistakeStatuses?.notAttempted||"Not attempted"}),(0,t.jsx)(w.T,{value:"wrong_attempt",children:l.editor?.mistakeStatuses?.wrongAttempt||"Wrong attempt"}),(0,t.jsx)(w.T,{value:"unknown",children:l.editor?.mistakeStatuses?.unknown||"Unknown"})]})]})]}),(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsx)(u.f,{children:l.editor?.tags||"Knowledge Points (Press Enter to add)"}),(0,t.jsx)(y.f,{value:K,onChange:U,placeholder:l.editor?.tagsPlaceholder||"Enter knowledge tags, select from suggestions...",enterHint:l.editor?.createTagHint,subject:(0,N.f)(i||null)||void 0}),(0,t.jsx)("p",{className:"text-xs text-muted-foreground",children:l.editor?.tagsHint||"💡 Tag suggestions will appear as you type"})]}),(0,t.jsxs)("div",{className:"flex flex-col items-center gap-2 pt-2",children:[(0,t.jsx)(c.f,{onClick:Q,disabled:!T.trim()||!$||r,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",size:"lg",children:r?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(x.f,{className:"mr-2 h-4 w-4 animate-spin"}),l.directEntry.saving]}):(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(h.f,{className:"mr-2 h-4 w-4"}),l.directEntry.save]})}),(0,t.jsx)("p",{className:"text-xs text-muted-foreground text-center",children:l.directEntry.hint})]})]})})}var C=e.i(522016),T=e.i(217255),P=e.i(856423),E=e.i(975153),I=e.i(218964),z=e.i(697886);let H=()=>()=>{};function M({href:e,icon:s,label:a,value:i}){return(0,t.jsxs)(C.default,{href:e,className:"rounded-xl bg-white/15 px-4 py-3 backdrop-blur-sm transition-colors hover:bg-white/20",children:[(0,t.jsxs)("div",{className:"flex items-center gap-1.5 text-xs text-white/75",children:[(0,t.jsx)(s,{className:"h-3.5 w-3.5 shrink-0"}),(0,t.jsx)("span",{className:"truncate",children:a})]}),(0,t.jsx)("div",{className:"mt-1 text-2xl font-bold tabular-nums",children:i??"–"})]})}function q({notebookCount:e,itemCount:a,dueCount:i,targetNotebook:n}){let{t:r,language:l}=(0,v.b)(),{data:o}=(0,T.useSession)(),d=(0,s.useSyncExternalStore)(H,()=>new Date().getHours(),()=>null),c=null===d?r.common.welcome.replace(/[,,\s]+$/,""):d<12?r.home.greetingMorning:d<18?r.home.greetingAfternoon:r.home.greetingEvening,m=o?.user?.name||o?.user?.email||"";return(0,t.jsxs)("section",{className:"relative overflow-hidden rounded-2xl bg-gradient-to-br from-indigo-600 via-indigo-500 to-violet-500 p-5 text-white shadow-lg shadow-indigo-500/20 md:p-7",children:[(0,t.jsx)("div",{className:"pointer-events-none absolute -right-10 -top-12 h-44 w-44 rounded-full bg-white/10 blur-2xl"}),(0,t.jsx)("div",{className:"pointer-events-none absolute -bottom-16 right-24 h-40 w-40 rounded-full bg-fuchsia-300/20 blur-2xl"}),(0,t.jsxs)("div",{className:"relative flex flex-col gap-5 md:flex-row md:items-end md:justify-between",children:[(0,t.jsxs)("div",{className:"space-y-1.5",children:[(0,t.jsxs)("h1",{className:"text-xl font-bold tracking-tight md:text-2xl",children:[c,m&&`${"zh"===l?",":", "}${m}`]}),(0,t.jsx)("p",{className:"max-w-md text-sm text-white/80",children:r.home.heroSubtitle}),n&&(0,t.jsxs)("p",{className:"inline-flex items-center gap-1.5 rounded-full bg-white/15 px-3 py-1 text-xs font-medium",children:[(0,t.jsx)(z.f,{className:"h-3.5 w-3.5"}),r.home.targetNotebook.replace("{name}",n)]})]}),(0,t.jsxs)("div",{className:"grid grid-cols-3 gap-3 md:w-96",children:[(0,t.jsx)(M,{href:"/notebooks",icon:P.f,label:r.home.notebookCount,value:e}),(0,t.jsx)(M,{href:"/notebooks",icon:I.f,label:r.home.itemCount,value:a}),(0,t.jsx)(M,{href:"/review",icon:E.f,label:r.home.dueCount,value:i})]})]})]})}var B=e.i(12130),D=e.i(430634),F=e.i(576019),R=e.i(847483),K=e.i(497346),U=e.i(717448),$=e.i(798469),O=e.i(86963),L=e.i(956738),V=e.i(185592),W=e.i(41931),_=e.i(201276),Q=e.i(35209),G=e.i(267275);function J(){let{t:e}=(0,v.b)();(0,Q.f)(e.pageTitle.home);let d=(0,a.useSearchParams)().get("notebook"),[c,m]=(0,s.useState)([]),[u,h]=(0,s.useState)(null),[x,p]=(0,s.useState)("image"),g=d?c.find(e=>e.id===d):void 0,f=(0,G.w)({logPrefix:"[Home]",analyzeSubjectId:d,importSubjectId:d,textNotebook:g&&{id:g.id,name:g.name}});(0,s.useEffect)(()=>{W.k.get("/api/notebooks").then(e=>m(e)).catch(e=>_.V.error("[Home]","Failed to fetch notebooks",{error:e})),W.k.get("/api/review/due?pageSize=1").then(e=>h(e.total)).catch(e=>_.V.error("[Home]","Failed to fetch due reviews",{error:e}))},[]);let j=async e=>{f.setAnalysisStep("saving"),await f.saveQuestion({...e,wrongAnswerText:e.wrongAnswerText||null,mistakeAnalysis:e.mistakeAnalysis||null,mistakeStatus:e.mistakeStatus||"unknown",originalImageUrl:""}),f.setAnalysisStep("idle")},y=c.reduce((e,t)=>e+(t._count?.errorItems||0),0),b=[{value:"image",icon:i.f,label:e.app?.uploadImage||"Take Photo"},{value:"text",icon:r.f,label:e.app?.manualInput||"Manual Input"},{value:"direct",icon:n.f,label:e.app?.directInput||"Manual Entry"}];return(0,t.jsxs)("main",{className:"min-h-screen",children:[(0,t.jsx)(L.f,{status:f.analysisStep,completed:f.completedStages}),(0,t.jsxs)("div",{className:`mx-auto space-y-6 px-4 py-6 md:px-8 md:py-8 ${"review"===f.step?"max-w-6xl":"max-w-4xl"}`,children:[(0,t.jsx)(K.f,{message:f.saveError,onDismiss:f.dismissSaveError}),"upload"===f.step&&(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(q,{notebookCount:c.length,itemCount:y,dueCount:u,targetNotebook:d?g?.name:void 0}),(0,t.jsxs)("div",{className:"space-y-4",children:[(0,t.jsx)(V.f,{options:b,value:x,onChange:p}),f.pendingTask&&(0,t.jsx)(F.f,{task:f.pendingTask,onRefresh:f.refreshPendingTask,onDismiss:f.dismissPendingTask}),f.lastImported&&(0,t.jsx)(D.f,{imported:f.lastImported,onDismiss:f.dismissImported}),f.batchImages?(0,t.jsx)(l.f,{images:f.batchImages,subjectId:d,onClose:f.closeBatch}):"image"===x?(0,t.jsxs)(t.Fragment,{children:[f.parts.length>0&&(0,t.jsx)(R.f,{parts:f.parts.map(e=>e.dataUrl),busy:f.isBusy,onFinish:()=>void f.finishParts(),onDiscard:f.discardParts}),(0,t.jsx)($.f,{onImageSelect:f.selectImage,isAnalyzing:f.isBusy})]}):"text"===x?(0,t.jsx)(U.f,{onSubmit:f.submitText,isAnalyzing:f.isBusy,defaultNotebookName:g?.name,onCreateBatch:f.createTextBatch,creatingBatch:f.creatingBatch}):(0,t.jsx)(A,{onSubmit:j,defaultNotebookId:d||void 0,defaultNotebookName:g?.name,isSaving:"saving"===f.analysisStep})]})]}),f.croppingImage&&(0,t.jsx)(B.f,{imageSrc:f.croppingImage,open:f.isCropperOpen,onClose:f.closeCropper,onRegionsSelected:f.cropRegions,allowMulti:0===f.parts.length,onAutoSplit:0===f.parts.length?f.autoSplitImage:void 0,onAddPart:f.parts.length<G.u-1?f.addPart:void 0,partCount:f.parts.length}),"review"===f.step&&f.parsedData&&(0,t.jsx)(o.f,{initialData:f.parsedData,onSave:f.saveReviewed,onCancel:f.cancelReview,imagePreview:f.currentImage,initialSubjectId:d||void 0,aiTimeout:f.aiTimeout})]})]})}e.s(["default",0,function(){return(0,t.jsx)(s.Suspense,{fallback:(0,t.jsx)(O.f,{}),children:(0,t.jsx)(J,{})})}],952683)},86963,e=>{var t=e.i(843476),s=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)(s.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),s=e.i(111110);e.s(["f",0,function(...e){let{t:a}=(0,s.b)(),i=[a.pageTitle.base,...e.map(e=>"string"==typeof e?e.trim():"").filter(e=>e.length>0)].join("-");(0,t.useEffect)(()=>{document.title=i},[i])}])}],462684,e=>{e.v(t=>Promise.all(["static/chunks/2hh64gi4pmlk2.js"].map(t=>e.l(t))).then(()=>t(506175)))}]);
|
|
1
|
+
(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,[218964,e=>{var t=e.i(456420);let s={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"}]]};s.node;let a=(0,t.f)(s);e.s(["f",0,a],218964)},328623,e=>{var t=e.i(456420);let s={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"]};s.node;let a=(0,t.f)(s);e.s(["f",0,a],328623)},697886,e=>{var t=e.i(456420);let s={name:"target",size:24,node:[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["circle",{cx:"12",cy:"12",r:"6",key:"1vlfrh"}],["circle",{cx:"12",cy:"12",r:"2",key:"1c9p78"}]]};s.node;let a=(0,t.f)(s);e.s(["f",0,a],697886)},952683,e=>{var t=e.i(843476),s=e.i(271645),a=e.i(618566),i=e.i(518515),n=e.i(325597),r=e.i(328623),l=e.i(747819),o=e.i(866531),d=e.i(515288),c=e.i(519455),m=e.i(624687),u=e.i(110204),h=e.i(856522),x=e.i(632781),p=e.i(772382),g=e.i(7891),g=g,f=e.i(395925),v=e.i(111110),j=e.i(511445),y=e.i(574041),k=e.i(438465),w=e.i(674166),b=e.i(967489),N=e.i(952122),S=e.i(294114);function A({onSubmit:e,defaultNotebookId:a,defaultNotebookName:i,isSaving:r}){let{t:l}=(0,v.b)(),[o,C]=(0,s.useState)(null),[T,P]=(0,s.useState)(""),[E,I]=(0,s.useState)(""),[z,H]=(0,s.useState)(""),[M,q]=(0,s.useState)(""),[B,D]=(0,s.useState)(""),[F,R]=(0,s.useState)("unknown"),[K,U]=(0,s.useState)([]),[$,O]=(0,s.useState)(a||""),[L,V]=(0,s.useState)(""),[W,_]=(0,s.useState)(""),Q=async()=>{if(T.trim()){if(!$)return void S.c.warning(l.editor.messages?.selectNotebook||"Please select a notebook");await e({questionText:T.trim(),answerText:E.trim(),analysis:z.trim(),wrongAnswerText:M.trim(),mistakeAnalysis:B.trim(),mistakeStatus:F,knowledgePoints:K,subjectId:$,gradeSemester:L||void 0,paperLevel:W||void 0})}},G=e=>{(e.ctrlKey||e.metaKey)&&"Enter"===e.key&&(e.preventDefault(),T.trim()&&$&&!r&&Q())},J=[{key:"question",label:l.editor?.question||"Question Text",value:T,setter:P,placeholder:l.directEntry.questionPlaceholder,minHeight:"min-h-[180px]",required:!0},{key:"answer",label:l.editor?.answer||"Answer",value:E,setter:I,placeholder:l.directEntry.answerPlaceholder,minHeight:"min-h-[120px]"},{key:"analysis",label:l.editor?.analysis||"Analysis / Explanation",value:z,setter:H,placeholder:l.directEntry.analysisPlaceholder,minHeight:"min-h-[150px]"},{key:"wrongAnswer",label:l.editor?.wrongAnswerText||"Wrong Answer / Work",value:M,setter:q,placeholder:l.directEntry.wrongAnswerPlaceholder,minHeight:"min-h-[100px]"},{key:"mistakeAnalysis",label:l.editor?.mistakeAnalysis||"Mistake Cause Analysis",value:B,setter:D,placeholder:l.directEntry.mistakeAnalysisPlaceholder,minHeight:"min-h-[100px]"}];return(0,t.jsx)(d.N,{className:"rounded-2xl",children:(0,t.jsxs)(d.O,{className:"p-6 space-y-5",children:[(0,t.jsxs)("div",{className:"flex items-center justify-between",children:[(0,t.jsxs)("div",{className:"flex items-center gap-2 text-muted-foreground",children:[(0,t.jsx)(n.f,{className:"h-5 w-5"}),(0,t.jsx)("span",{className:"text-sm font-medium",children:l.directEntry.title})]}),(0,t.jsxs)(c.f,{variant:"ghost",size:"sm",onClick:()=>{P(""),I(""),H(""),q(""),D(""),R("unknown"),U([]),V(""),_("")},disabled:r,className:"text-muted-foreground hover:text-destructive",children:[(0,t.jsx)(f.f,{className:"h-4 w-4 mr-1"}),l.directEntry.reset]})]}),(0,t.jsxs)("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-4",children:[(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsxs)(u.f,{children:[l.editor?.selectNotebook||"Select Notebook"," *"]}),(0,t.jsx)(k.f,{value:$,onChange:O})]}),(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsx)(u.f,{children:l.editor?.gradeSemester||"Grade/Semester"}),(0,t.jsx)("input",{type:"text",value:L,onChange:e=>V(e.target.value),placeholder:l.directEntry.gradeSemesterPlaceholder,className:"flex h-10 w-full rounded-md border border-input bg-background px-3 py-2 text-sm"})]}),(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsx)(u.f,{children:l.editor?.paperLevel||"Paper Level"}),(0,t.jsx)(w.f,{value:W,onChange:_})]})]}),J.map(e=>(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsxs)("div",{className:"flex items-center justify-between",children:[(0,t.jsxs)(u.f,{className:e.required?"text-primary font-semibold":"",children:[e.label," ",e.required&&"*"]}),(0,t.jsx)(c.f,{variant:"ghost",size:"sm",className:"h-7 px-2 text-xs",onClick:()=>C(o===e.key?null:e.key),disabled:!e.value,children:o===e.key?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(g.f,{className:"h-3 w-3 mr-1"}),l.directEntry.edit]}):(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(p.f,{className:"h-3 w-3 mr-1"}),l.directEntry.preview]})})]}),o===e.key?(0,t.jsx)("div",{className:`rounded-md border bg-muted/30 p-4 ${e.minHeight} overflow-auto cursor-pointer`,onClick:()=>C(null),children:(0,t.jsx)(j.f,{content:e.value})}):(0,t.jsx)(m.f,{value:e.value,onChange:t=>e.setter(t.target.value),onKeyDown:G,placeholder:e.placeholder,className:`${e.minHeight} font-mono text-sm resize-y`,disabled:r})]},e.key)),(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsx)(u.f,{children:l.editor?.mistakeStatus||"Attempt Status"}),(0,t.jsxs)(b.d,{value:F,onValueChange:e=>R(e),children:[(0,t.jsx)(b.P,{className:"w-[200px]",children:(0,t.jsx)(b.U,{})}),(0,t.jsxs)(b.r,{children:[(0,t.jsx)(b.T,{value:"not_attempted",children:l.editor?.mistakeStatuses?.notAttempted||"Not attempted"}),(0,t.jsx)(b.T,{value:"wrong_attempt",children:l.editor?.mistakeStatuses?.wrongAttempt||"Wrong attempt"}),(0,t.jsx)(b.T,{value:"unknown",children:l.editor?.mistakeStatuses?.unknown||"Unknown"})]})]})]}),(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsx)(u.f,{children:l.editor?.tags||"Knowledge Points (Press Enter to add)"}),(0,t.jsx)(y.f,{value:K,onChange:U,placeholder:l.editor?.tagsPlaceholder||"Enter knowledge tags, select from suggestions...",enterHint:l.editor?.createTagHint,subject:(0,N.f)(i||null)||void 0}),(0,t.jsx)("p",{className:"text-xs text-muted-foreground",children:l.editor?.tagsHint||"💡 Tag suggestions will appear as you type"})]}),(0,t.jsxs)("div",{className:"flex flex-col items-center gap-2 pt-2",children:[(0,t.jsx)(c.f,{onClick:Q,disabled:!T.trim()||!$||r,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",size:"lg",children:r?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(x.f,{className:"mr-2 h-4 w-4 animate-spin"}),l.directEntry.saving]}):(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(h.f,{className:"mr-2 h-4 w-4"}),l.directEntry.save]})}),(0,t.jsx)("p",{className:"text-xs text-muted-foreground text-center",children:l.directEntry.hint})]})]})})}var C=e.i(522016),T=e.i(217255),P=e.i(856423),E=e.i(975153),I=e.i(218964),z=e.i(697886);let H=()=>()=>{};function M({href:e,icon:s,label:a,value:i}){return(0,t.jsxs)(C.default,{href:e,className:"rounded-xl bg-white/15 px-4 py-3 backdrop-blur-sm transition-colors hover:bg-white/20",children:[(0,t.jsxs)("div",{className:"flex items-center gap-1.5 text-xs text-white/75",children:[(0,t.jsx)(s,{className:"h-3.5 w-3.5 shrink-0"}),(0,t.jsx)("span",{className:"truncate",children:a})]}),(0,t.jsx)("div",{className:"mt-1 text-2xl font-bold tabular-nums",children:i??"–"})]})}function q({notebookCount:e,itemCount:a,dueCount:i,targetNotebook:n}){let{t:r,language:l}=(0,v.b)(),{data:o}=(0,T.useSession)(),d=(0,s.useSyncExternalStore)(H,()=>new Date().getHours(),()=>null),c=null===d?r.common.welcome.replace(/[,,\s]+$/,""):d<12?r.home.greetingMorning:d<18?r.home.greetingAfternoon:r.home.greetingEvening,m=o?.user?.name||o?.user?.email||"";return(0,t.jsxs)("section",{className:"relative overflow-hidden rounded-2xl bg-gradient-to-br from-indigo-600 via-indigo-500 to-violet-500 p-5 text-white shadow-lg shadow-indigo-500/20 md:p-7",children:[(0,t.jsx)("div",{className:"pointer-events-none absolute -right-10 -top-12 h-44 w-44 rounded-full bg-white/10 blur-2xl"}),(0,t.jsx)("div",{className:"pointer-events-none absolute -bottom-16 right-24 h-40 w-40 rounded-full bg-fuchsia-300/20 blur-2xl"}),(0,t.jsxs)("div",{className:"relative flex flex-col gap-5 md:flex-row md:items-end md:justify-between",children:[(0,t.jsxs)("div",{className:"space-y-1.5",children:[(0,t.jsxs)("h1",{className:"text-xl font-bold tracking-tight md:text-2xl",children:[c,m&&`${"zh"===l?",":", "}${m}`]}),(0,t.jsx)("p",{className:"max-w-md text-sm text-white/80",children:r.home.heroSubtitle}),n&&(0,t.jsxs)("p",{className:"inline-flex items-center gap-1.5 rounded-full bg-white/15 px-3 py-1 text-xs font-medium",children:[(0,t.jsx)(z.f,{className:"h-3.5 w-3.5"}),r.home.targetNotebook.replace("{name}",n)]})]}),(0,t.jsxs)("div",{className:"grid grid-cols-3 gap-3 md:w-96",children:[(0,t.jsx)(M,{href:"/notebooks",icon:P.f,label:r.home.notebookCount,value:e}),(0,t.jsx)(M,{href:"/notebooks",icon:I.f,label:r.home.itemCount,value:a}),(0,t.jsx)(M,{href:"/review",icon:E.f,label:r.home.dueCount,value:i})]})]})]})}var B=e.i(12130),D=e.i(430634),F=e.i(576019),R=e.i(847483),K=e.i(497346),U=e.i(717448),$=e.i(798469),O=e.i(86963),L=e.i(956738),V=e.i(185592),W=e.i(41931),_=e.i(201276),Q=e.i(35209),G=e.i(267275);function J(){let{t:e}=(0,v.b)();(0,Q.f)(e.pageTitle.home);let d=(0,a.useSearchParams)().get("notebook"),[c,m]=(0,s.useState)([]),[u,h]=(0,s.useState)(null),[x,p]=(0,s.useState)("image"),g=d?c.find(e=>e.id===d):void 0,f=(0,G.w)({logPrefix:"[Home]",analyzeSubjectId:d,importSubjectId:d,textNotebook:g&&{id:g.id,name:g.name}});(0,s.useEffect)(()=>{W.k.get("/api/notebooks").then(e=>m(e)).catch(e=>_.V.error("[Home]","Failed to fetch notebooks",{error:e})),W.k.get("/api/review/due?pageSize=1").then(e=>h(e.total)).catch(e=>_.V.error("[Home]","Failed to fetch due reviews",{error:e}))},[]);let j=async e=>{f.setAnalysisStep("saving"),await f.saveQuestion({...e,wrongAnswerText:e.wrongAnswerText||null,mistakeAnalysis:e.mistakeAnalysis||null,mistakeStatus:e.mistakeStatus||"unknown",originalImageUrl:""}),f.setAnalysisStep("idle")},y=c.reduce((e,t)=>e+(t._count?.errorItems||0),0),k=[{value:"image",icon:i.f,label:e.app?.uploadImage||"Take Photo"},{value:"text",icon:r.f,label:e.app?.manualInput||"Manual Input"},{value:"direct",icon:n.f,label:e.app?.directInput||"Manual Entry"}];return(0,t.jsxs)("main",{className:"min-h-screen",children:[(0,t.jsx)(L.f,{status:f.analysisStep,completed:f.completedStages}),(0,t.jsxs)("div",{className:`mx-auto space-y-6 px-4 py-6 md:px-8 md:py-8 ${"review"===f.step?"max-w-6xl":"max-w-4xl"}`,children:[(0,t.jsx)(K.f,{message:f.saveError,onDismiss:f.dismissSaveError}),"upload"===f.step&&(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(q,{notebookCount:c.length,itemCount:y,dueCount:u,targetNotebook:d?g?.name:void 0}),(0,t.jsxs)("div",{className:"space-y-4",children:[(0,t.jsx)(V.f,{options:k,value:x,onChange:p}),f.pendingTask&&(0,t.jsx)(F.f,{task:f.pendingTask,onRefresh:f.refreshPendingTask,onDismiss:f.dismissPendingTask}),f.lastImported&&(0,t.jsx)(D.f,{imported:f.lastImported,onDismiss:f.dismissImported}),f.batchImages?(0,t.jsx)(l.f,{images:f.batchImages,subjectId:d,onClose:f.closeBatch}):"image"===x?(0,t.jsxs)(t.Fragment,{children:[f.parts.length>0&&(0,t.jsx)(R.f,{parts:f.parts.map(e=>e.dataUrl),busy:f.isBusy,onFinish:()=>void f.finishParts(),onDiscard:f.discardParts}),(0,t.jsx)($.f,{onImageSelect:f.selectImage,isAnalyzing:f.isBusy})]}):"text"===x?(0,t.jsx)(U.f,{onSubmit:f.submitText,isAnalyzing:f.isBusy,defaultNotebookName:g?.name,onCreateBatch:f.createTextBatch,creatingBatch:f.creatingBatch}):(0,t.jsx)(A,{onSubmit:j,defaultNotebookId:d||void 0,defaultNotebookName:g?.name,isSaving:"saving"===f.analysisStep})]})]}),f.croppingImage&&(0,t.jsx)(B.f,{imageSrc:f.croppingImage,open:f.isCropperOpen,onClose:f.closeCropper,onRegionsSelected:f.cropRegions,allowMulti:0===f.parts.length,onAutoSplit:0===f.parts.length?f.autoSplitImage:void 0,onAddPart:f.parts.length<G.u-1?f.addPart:void 0,partCount:f.parts.length}),"review"===f.step&&f.parsedData&&(0,t.jsx)(o.f,{initialData:f.parsedData,onSave:f.saveReviewed,onCancel:f.cancelReview,imagePreview:f.currentImage,initialSubjectId:d||void 0,aiTimeout:f.aiTimeout})]})]})}e.s(["default",0,function(){return(0,t.jsx)(s.Suspense,{fallback:(0,t.jsx)(O.f,{}),children:(0,t.jsx)(J,{})})}],952683)},86963,e=>{var t=e.i(843476),s=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)(s.f,{className:"h-7 w-7 animate-spin text-primary"}),e&&(0,t.jsx)("p",{className:"text-sm",children:e})]})}])}],462684,e=>{e.v(t=>Promise.all(["static/chunks/2hh64gi4pmlk2.js"].map(t=>e.l(t))).then(()=>t(506175)))}]);
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
(()=>{"use strict";(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,842727,e=>{var t=e.i(271645),r=e.i(981140),n=e.i(75830),o=e.i(820783),a=e.i(30030),i=e.i(610772),s=e.i(248425),l=e.i(30207),u=e.i(369340),f=e.i(586318),c=e.i(934620),d=Object.defineProperty,p=(e,t)=>d(e,"name",{value:t,configurable:!0}),h=!1;function g(){let[e,r]=t.useState(h);return t.useEffect(()=>{h||(h=!0,r(!0))},[]),e}p(g,"useIsHydrated");var m=t[" useSyncExternalStore ".trim().toString()];function y(){return()=>{}}function v(){return m(y,()=>!0,()=>!1)}p(y,"subscribe"),p(v,"useIsHydratedModern");var b="function"==typeof m?v:g,x=e.i(843476),w=Object.defineProperty,k=(e,t)=>w(e,"name",{value:t,configurable:!0}),j="rovingFocusGroup.onEntryFocus",M={bubbles:!1,cancelable:!0},R="RovingFocusGroup",[D,C,P]=(0,n.f)(R),[N,I]=(0,a.f)(R,[P]),[E,T]=N(R),A=t.forwardRef(k(function(e,t){return(0,x.jsx)(D.Provider,{scope:e.__scopeRovingFocusGroup,children:(0,x.jsx)(D.Slot,{scope:e.__scopeRovingFocusGroup,children:(0,x.jsx)(S,{...e,ref:t})})})},"RovingFocusGroup")),S=t.forwardRef(k(function(e,n){let{__scopeRovingFocusGroup:a,orientation:i,loop:c=!1,dir:d,currentTabStopId:p,defaultCurrentTabStopId:h,onCurrentTabStopIdChange:g,onEntryFocus:m,preventScrollOnEntryFocus:y=!1,...v}=e,b=t.useRef(null),w=(0,o.f)(n,b),k=(0,f.f)(d),[D,P]=(0,u.f)({prop:p,defaultProp:h??null,onChange:g,caller:R}),[N,I]=t.useState(!1),T=(0,l.f)(m),A=C(a),S=t.useRef(!1),[F,z]=t.useState(0);return t.useEffect(()=>{let e=b.current;if(e)return e.addEventListener(j,T),()=>e.removeEventListener(j,T)},[T]),(0,x.jsx)(E,{scope:a,orientation:i,dir:k,loop:c,currentTabStopId:D,onItemFocus:t.useCallback(e=>P(e),[P]),onItemShiftTab:t.useCallback(()=>I(!0),[]),onFocusableItemAdd:t.useCallback(()=>z(e=>e+1),[]),onFocusableItemRemove:t.useCallback(()=>z(e=>e-1),[]),children:(0,x.jsx)(s.V.div,{tabIndex:N||0===F?-1:0,"data-orientation":i,...v,ref:w,style:{outline:"none",...e.style},onMouseDown:(0,r.f)(e.onMouseDown,()=>{S.current=!0}),onFocus:(0,r.f)(e.onFocus,e=>{let t=!S.current;if(e.target===e.currentTarget&&t&&!N){let t=new CustomEvent(j,M);if(e.currentTarget.dispatchEvent(t),!t.defaultPrevented){let e=A().filter(e=>e.focusable);U([e.find(e=>e.active),e.find(e=>e.id===D),...e].filter(Boolean).map(e=>e.ref.current),y)}}S.current=!1}),onBlur:(0,r.f)(e.onBlur,()=>I(!1))})})},"RovingFocusGroupImpl")),F=t.forwardRef(k(function(e,n){let{__scopeRovingFocusGroup:o,focusable:a=!0,active:l=!1,tabStopId:u,children:f,...d}=e,p=(0,i.f)(),h=u||p,g=T("RovingFocusGroupItem",o),m=g.currentTabStopId===h,y=C(o),{onFocusableItemAdd:v,onFocusableItemRemove:w,currentTabStopId:k}=g,j=b();return(0,c.f)(()=>{if(j&&a)return v(),()=>w()},[j,a,v,w]),t.useEffect(()=>{if(!j&&a)return v(),()=>w()},[j,a,v,w]),(0,x.jsx)(D.ItemSlot,{scope:o,id:h,focusable:a,active:l,children:(0,x.jsx)(s.V.span,{tabIndex:m?0:-1,"data-orientation":g.orientation,...d,ref:n,onMouseDown:(0,r.f)(e.onMouseDown,e=>{a?g.onItemFocus(h):e.preventDefault()}),onFocus:(0,r.f)(e.onFocus,()=>g.onItemFocus(h)),onKeyDown:(0,r.f)(e.onKeyDown,e=>{if("Tab"===e.key&&e.shiftKey)return void g.onItemShiftTab();if(e.target!==e.currentTarget)return;let t=_(e,g.orientation,g.dir);if(void 0!==t){if(e.metaKey||e.ctrlKey||e.altKey||e.shiftKey)return;e.preventDefault();let r=y().filter(e=>e.focusable).map(e=>e.ref.current);if("last"===t)r.reverse();else if("prev"===t||"next"===t){"prev"===t&&r.reverse();let n=r.indexOf(e.currentTarget);r=g.loop?L(r,n+1):r.slice(n+1)}setTimeout(()=>U(r))}}),children:"function"==typeof f?f({isCurrentTabStop:m,hasTabStop:null!=k}):f})})},"RovingFocusGroupItem")),z={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function O(e,t){return"rtl"!==t?e:"ArrowLeft"===e?"ArrowRight":"ArrowRight"===e?"ArrowLeft":e}function _(e,t,r){let n=O(e.key,r);if(!("vertical"===t&&["ArrowLeft","ArrowRight"].includes(n))&&!("horizontal"===t&&["ArrowUp","ArrowDown"].includes(n)))return z[n]}function U(e,t=!1){let r=document.activeElement;for(let n of e)if(n===r||(n.focus({preventScroll:t}),document.activeElement!==r))return}function L(e,t){return e.map((r,n)=>e[(t+n)%e.length])}k(O,"getDirectionAwareKey"),k(_,"getFocusIntent"),k(U,"focusFirst"),k(L,"wrapArray"),e.s(["M",0,F,"F",0,A,"B",0,I],842727)},975153,e=>{var t=e.i(456420);let r={name:"calendar-check",size:24,node:[["path",{d:"M8 2v3",key:"1ioesn"}],["path",{d:"M16 2v3",key:"otl347"}],["rect",{x:"3",y:"3",width:"18",height:"18",rx:"2",key:"h1oib"}],["path",{d:"M3 9h18",key:"1pudct"}],["path",{d:"m9 15 2 2 4-4",key:"1grp1n"}]]};r.node;let n=(0,t.f)(r);e.s(["f",0,n],975153)},749803,e=>{var t=e.i(456420);let r={name:"chart-column",size:24,node:[["path",{d:"M3 3v16a2 2 0 0 0 2 2h16",key:"c24i48"}],["path",{d:"M18 17V9",key:"2bz60n"}],["path",{d:"M13 17V5",key:"1frdt8"}],["path",{d:"M8 17v-3",key:"17ska0"}]],aliases:["bar-chart-3"]};r.node;let n=(0,t.f)(r);e.s(["f",0,n],749803)},716327,456539,e=>{var t=e.i(456420);let r={name:"chevron-down",size:24,node:[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]]};r.node;let n=(0,t.f)(r);e.s(["f",0,n],716327);let o={name:"chevron-up",size:24,node:[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]]};o.node;let a=(0,t.f)(o);e.s(["f",0,a],456539)},867927,e=>{var t=e.i(456420);let r={name:"chevron-right",size:24,node:[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]]};r.node;let n=(0,t.f)(r);e.s(["f",0,n],867927)},548161,e=>{var t=e.i(456420);let r={name:"circle-check-big",size:24,node:[["path",{d:"M21.801 10A10 10 0 1 1 17 3.335",key:"yps3ct"}],["path",{d:"m9 11 3 3L22 4",key:"1pflzl"}]],aliases:["check-circle"]};r.node;let n=(0,t.f)(r);e.s(["f",0,n],548161)},583967,e=>{var t=e.i(456420);let r={name:"circle-x",size:24,node:[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m15 9-6 6",key:"1uzhvr"}],["path",{d:"m9 9 6 6",key:"z0biqf"}]],aliases:["x-circle"]};r.node;let n=(0,t.f)(r);e.s(["f",0,n],583967)},762368,e=>{var t=e.i(456420);let r={name:"download",size:24,node:[["path",{d:"M12 15V3",key:"m9g1x1"}],["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}],["path",{d:"m7 10 5 5 5-5",key:"brsn70"}]]};r.node;let n=(0,t.f)(r);e.s(["f",0,n],762368)},580860,e=>{var t=e.i(456420);let r={name:"eye-off",size:24,node:[["path",{d:"M10.733 5.076a10.744 10.744 0 0 1 11.205 6.575 1 1 0 0 1 0 .696 10.747 10.747 0 0 1-1.444 2.49",key:"ct8e1f"}],["path",{d:"M14.084 14.158a3 3 0 0 1-4.242-4.242",key:"151rxh"}],["path",{d:"M17.479 17.499a10.75 10.75 0 0 1-15.417-5.151 1 1 0 0 1 0-.696 10.75 10.75 0 0 1 4.446-5.143",key:"13bj9a"}],["path",{d:"m2 2 20 20",key:"1ooewy"}]]};r.node;let n=(0,t.f)(r);e.s(["f",0,n],580860)},226091,e=>{var t=e.i(456420);let r={name:"file-text",size:24,node:[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["path",{d:"M10 9H8",key:"b1mrlr"}],["path",{d:"M16 13H8",key:"t4e002"}],["path",{d:"M16 17H8",key:"z1uh3a"}]]};r.node;let n=(0,t.f)(r);e.s(["f",0,n],226091)},999092,e=>{var t=e.i(456420);let r={name:"languages",size:24,node:[["path",{d:"m5 8 6 6",key:"1wu5hv"}],["path",{d:"m4 14 6-6 2-3",key:"1k1g8d"}],["path",{d:"M2 5h12",key:"or177f"}],["path",{d:"M7 2h1",key:"1t2jsx"}],["path",{d:"m22 22-5-10-5 10",key:"don7ne"}],["path",{d:"M14 18h6",key:"1m8k6r"}]]};r.node;let n=(0,t.f)(r);e.s(["f",0,n],999092)},446513,e=>{var t=e.i(456420);let r={name:"monitor",size:24,node:[["rect",{width:"20",height:"14",x:"2",y:"3",rx:"2",key:"48i651"}],["line",{x1:"8",x2:"16",y1:"21",y2:"21",key:"1svkeh"}],["line",{x1:"12",x2:"12",y1:"17",y2:"21",key:"vw1qmm"}]]};r.node;let n=(0,t.f)(r);e.s(["f",0,n],446513)},21357,79058,e=>{var t=e.i(456420);let r={name:"play",size:24,node:[["path",{d:"M5 5a2 2 0 0 1 3.008-1.728l11.997 6.998a2 2 0 0 1 .003 3.458l-12 7A2 2 0 0 1 5 19z",key:"10ikf1"}]]};r.node;let n=(0,t.f)(r);e.s(["f",0,n],21357);var o=e.i(41931);let a=null,i=null,s=!1;function l(){return"u"<typeof Audio?null:i??=new Audio}let u=new Map,f=(e,t)=>`${t}
|
|
2
|
+
${e}`;function c(e,t,r,n){return o.k.post("/api/tts/batch",{texts:e,language:t,...r?{regenerate:r}:{},...n?{errorItemId:n}:{}},{timeout:6e5,recoverable:!0}).then(({items:e})=>e.map(({id:e,version:t})=>`/api/tts/${e}?v=${t}`))}async function d(e,t,r){let n=await c(e,t,!0,r);e.forEach((e,r)=>u.set(f(e,t),Promise.resolve(n[r])))}e.s(["l",0,l,"v",0,function(){return a??=o.k.get("/api/tts").then(e=>"cloud"===e.mode?"cloud":"browser").catch(()=>"browser")},"h",0,function(){return s},"z",0,function(e,t){return o.k.post("/api/tts/status",{texts:e,language:t}).then(e=>!0===e.ready).catch(()=>!1)},"w",0,function(e,t,r){let n=[...new Set(e)].filter(e=>!u.has(f(e,t)));if(!n.length)return Promise.resolve();let o=c(n,t,!1,r);return n.forEach((e,r)=>{let n=f(e,t),a=o.then(e=>e[r]);a.catch(()=>u.delete(n)),u.set(n,a)}),o.then(()=>void 0)},"H",0,d,"U",0,function(e,t){let r=f(e,t),n=u.get(r);!n&&((n=o.k.post("/api/tts",{text:e,language:t},{timeout:12e4,recoverable:!0}).then(({id:e,version:t})=>`/api/tts/${e}?v=${t}`)).catch(()=>u.delete(r)),u.set(r,n));return n},"p",0,function(){let e=l();if(e&&!s){let t,r,n;s=!0,t=new DataView(new ArrayBuffer(1644)),(r=(e,r)=>[...r].forEach((r,n)=>t.setUint8(e+n,r.charCodeAt(0))))(0,"RIFF"),t.setUint32(4,1636,!0),r(8,"WAVE"),r(12,"fmt "),t.setUint32(16,16,!0),t.setUint16(20,1,!0),t.setUint16(22,1,!0),t.setUint32(24,8e3,!0),t.setUint32(28,16e3,!0),t.setUint16(32,2,!0),t.setUint16(34,16,!0),r(36,"data"),t.setUint32(40,1600,!0),n="",new Uint8Array(t.buffer).forEach(e=>{n+=String.fromCharCode(e)}),e.src=`data:audio/wav;base64,${btoa(n)}`,e.play().catch(()=>{s=!1})}}],79058)},77071,e=>{var t=e.i(456420);let r={name:"plus",size:24,node:[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]]};r.node;let n=(0,t.f)(r);e.s(["f",0,n],77071)},741120,e=>{var t=e.i(456420);let r={name:"refresh-cw",size:24,node:[["path",{d:"M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8",key:"v9h5vc"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}],["path",{d:"M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16",key:"3uifl3"}],["path",{d:"M8 16H3v5",key:"1cv678"}]]};r.node;let n=(0,t.f)(r);e.s(["f",0,n],741120)},980105,e=>{var t=e.i(456420);let r={name:"scan-text",size:24,node:[["path",{d:"M3 7V5a2 2 0 0 1 2-2h2",key:"aa7l1z"}],["path",{d:"M17 3h2a2 2 0 0 1 2 2v2",key:"4qcy5o"}],["path",{d:"M21 17v2a2 2 0 0 1-2 2h-2",key:"6vwrx8"}],["path",{d:"M7 21H5a2 2 0 0 1-2-2v-2",key:"ioqczr"}],["path",{d:"M7 8h8",key:"1jbsf9"}],["path",{d:"M7 12h10",key:"b7w52i"}],["path",{d:"M7 16h6",key:"1vyc9m"}]]};r.node;let n=(0,t.f)(r);e.s(["f",0,n],980105)},901279,e=>{var t=e.i(456420);let r={name:"user",size:24,node:[["path",{d:"M19 21v-2a4 4 0 0 0-4-4H9a4 4 0 0 0-4 4v2",key:"975kel"}],["circle",{cx:"12",cy:"7",r:"4",key:"17ys0d"}]]};r.node;let n=(0,t.f)(r);e.s(["f",0,n],901279)},534693,e=>{var t=e.i(456420);let r={name:"wand-sparkles",size:24,node:[["path",{d:"m21.64 3.64-1.28-1.28a1.21 1.21 0 0 0-1.72 0L2.36 18.64a1.21 1.21 0 0 0 0 1.72l1.28 1.28a1.2 1.2 0 0 0 1.72 0L21.64 5.36a1.2 1.2 0 0 0 0-1.72",key:"ul74o6"}],["path",{d:"m14 7 3 3",key:"1r5n42"}],["path",{d:"M5 6v4",key:"ilb8ba"}],["path",{d:"M19 14v4",key:"blhpug"}],["path",{d:"M10 2v2",key:"7u0qdc"}],["path",{d:"M7 8H3",key:"zfb6yr"}],["path",{d:"M21 16h-4",key:"1cnmox"}],["path",{d:"M11 3H9",key:"1obp7u"}]],aliases:["wand-2"]};r.node;let n=(0,t.f)(r);e.s(["f",0,n])},994533,e=>{var t=e.i(534693);e.s(["f",()=>t.f])},263676,e=>{var t=e.i(456420);let r={name:"x",size:24,node:[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]};r.node;let n=(0,t.f)(r);e.s(["X",0,n],263676)},522016,(e,t,r)=>{e.i(247167),Object.defineProperty(r,"__esModule",{value:!0});var n={default:function(){return y},useLinkStatus:function(){return b}};for(var o in n)Object.defineProperty(r,o,{enumerable:!0,get:n[o]});let a=e.r(190809),i=e.r(843476),s=a._(e.r(271645)),l=e.r(195057),u=e.r(8372),f=e.r(818581),c=e.r(718967),d=e.r(405550),p=e.r(388540),h=e.r(91949),g=e.r(573668),m=e.r(509396);function y(t){var r;let n,o,a,[y,b]=(0,s.useOptimistic)(h.IDLE_LINK_STATUS),x=(0,s.useRef)(null),{href:w,as:k,children:j,prefetch:M=null,passHref:R,replace:D,shallow:C,scroll:P,onClick:N,onMouseEnter:I,onTouchStart:E,legacyBehavior:T=!1,onNavigate:A,transitionTypes:S,ref:F,unstable_dynamicOnHover:z,...O}=t;n=j,T&&("string"==typeof n||"number"==typeof n)&&(n=(0,i.jsx)("a",{children:n}));let _=s.default.useContext(u.AppRouterContext),U=!1!==M,L=!1===M?"none":!0===M?"full":"auto",$="none"!==L?"auto"===L?m.FetchStrategy.PPR:m.FetchStrategy.Full:m.FetchStrategy.PPR,V="string"==typeof(r=k||w)?r:(0,l.formatUrl)(r);if(T){if(n?.$$typeof===Symbol.for("react.lazy"))throw Error("`<Link legacyBehavior>` received a direct child that is either a Server Component, or JSX that was loaded with React.lazy(). This is not supported. Either remove legacyBehavior, or make the direct child a Client Component that renders the Link's `<a>` tag.");o=s.default.Children.only(n)}let K=T?o&&"object"==typeof o&&o.ref:F,B,H=s.default.useCallback(e=>(null!==_&&(x.current=(0,h.mountLinkInstance)(e,V,_,$,U,b,B)),()=>{x.current&&((0,h.unmountLinkForCurrentNavigation)(x.current),x.current=null),(0,h.unmountPrefetchableInstance)(e)}),[U,V,_,$,b,B]),q={ref:(0,f.useMergedRef)(H,K),onClick(t){T||"function"!=typeof N||N(t),T&&o.props&&"function"==typeof o.props.onClick&&o.props.onClick(t),!_||t.defaultPrevented||function(t,r,n,o,a,i,s,l="none"){if("u">typeof window){let u,{nodeName:f}=t.currentTarget;if("A"===f.toUpperCase()&&((u=t.currentTarget.getAttribute("target"))&&"_self"!==u||t.metaKey||t.ctrlKey||t.shiftKey||t.altKey||t.nativeEvent&&2===t.nativeEvent.which)||t.currentTarget.hasAttribute("download"))return;if(!(0,g.isLocalURL)(r)){o&&(t.preventDefault(),location.replace(r));return}if(t.preventDefault(),i){let e=!1;if(i({preventDefault:()=>{e=!0}}),e)return}let{navigate:c}=e.r(132916);c(r,o?"replace":"push",!1===a?p.ScrollBehavior.NoScroll:p.ScrollBehavior.Default,n.current,s,l)}}(t,V,x,D,P,A,S,L)},onMouseEnter(e){T||"function"!=typeof I||I(e),T&&o.props&&"function"==typeof o.props.onMouseEnter&&o.props.onMouseEnter(e),_&&U&&(0,h.onNavigationIntent)(e.currentTarget,!0===z)},onTouchStart:function(e){T||"function"!=typeof E||E(e),T&&o.props&&"function"==typeof o.props.onTouchStart&&o.props.onTouchStart(e),_&&U&&(0,h.onNavigationIntent)(e.currentTarget,!0===z)}};return(0,c.isAbsoluteUrl)(V)?q.href=V:T&&!R&&("a"!==o.type||"href"in o.props)||(q.href=(0,d.addBasePath)(V)),a=T?s.default.cloneElement(o,q):(0,i.jsx)("a",{...O,...q,children:n}),(0,i.jsx)(v.Provider,{value:y,children:a})}let v=(0,s.createContext)(h.IDLE_LINK_STATUS),b=()=>(0,s.useContext)(v);("function"==typeof r.default||"object"==typeof r.default&&null!==r.default)&&void 0===r.default.__esModule&&(Object.defineProperty(r.default,"__esModule",{value:!0}),Object.assign(r.default,r),t.exports=r.default)},818581,(e,t,r)=>{Object.defineProperty(r,"__esModule",{value:!0}),Object.defineProperty(r,"useMergedRef",{enumerable:!0,get:function(){return o}});let n=e.r(271645);function o(e,t){let r=(0,n.useRef)(null),o=(0,n.useRef)(null);return(0,n.useCallback)(n=>{if(null===n){let e=r.current;e&&(r.current=null,e());let t=o.current;t&&(o.current=null,t())}else e&&(r.current=a(e,n)),t&&(o.current=a(t,n))},[e,t])}function a(e,t){if("function"!=typeof e)return e.current=t,()=>{e.current=null};{let r=e(t);return"function"==typeof r?r:()=>e(null)}}("function"==typeof r.default||"object"==typeof r.default&&null!==r.default)&&void 0===r.default.__esModule&&(Object.defineProperty(r.default,"__esModule",{value:!0}),Object.assign(r.default,r),t.exports=r.default)},195057,(e,t,r)=>{e.i(247167),Object.defineProperty(r,"__esModule",{value:!0});var n={formatUrl:function(){return s},formatWithValidation:function(){return u},urlObjectKeys:function(){return l}};for(var o in n)Object.defineProperty(r,o,{enumerable:!0,get:n[o]});let a=e.r(190809)._(e.r(998183)),i=/https?|ftp|gopher|file/;function s(e){let{auth:t,hostname:r}=e,n=e.protocol||"",o=e.pathname||"",s=e.hash||"",l=e.query||"",u=!1;t=t?encodeURIComponent(t).replace(/%3A/i,":")+"@":"",e.host?u=t+e.host:r&&(u=t+(~r.indexOf(":")?`[${r}]`:r),e.port&&(u+=":"+e.port)),l&&"object"==typeof l&&(l=String(a.urlQueryToSearchParams(l)));let f=e.search||l&&`?${l}`||"";return n&&!n.endsWith(":")&&(n+=":"),e.slashes||(!n||i.test(n))&&!1!==u?(u="//"+(u||""),o&&"/"!==o[0]&&(o="/"+o)):u||(u=""),s&&"#"!==s[0]&&(s="#"+s),f&&"?"!==f[0]&&(f="?"+f),o=o.replace(/[?#]/g,encodeURIComponent),f=f.replace("#","%23"),`${n}${u}${o}${f}${s}`}let l=["auth","hash","host","hostname","href","path","pathname","port","protocol","query","search","slashes"];function u(e){return s(e)}},573668,(e,t,r)=>{Object.defineProperty(r,"__esModule",{value:!0}),Object.defineProperty(r,"isLocalURL",{enumerable:!0,get:function(){return a}});let n=e.r(718967),o=e.r(652817);function a(e){if(!(0,n.isAbsoluteUrl)(e))return!0;try{let t=(0,n.getLocationOrigin)(),r=new URL(e,t);return r.origin===t&&(0,o.hasBasePath)(r.pathname)}catch(e){return!1}}},718967,(e,t,r)=>{e.i(247167),Object.defineProperty(r,"__esModule",{value:!0});var n={DecodeError:function(){return y},MiddlewareNotFoundError:function(){return w},MissingStaticPage:function(){return x},NormalizeError:function(){return v},PageNotFoundError:function(){return b},SP:function(){return g},ST:function(){return m},WEB_VITALS:function(){return a},execOnce:function(){return i},getDisplayName:function(){return c},getLocationOrigin:function(){return u},getURL:function(){return f},isAbsoluteUrl:function(){return l},isResSent:function(){return d},loadGetInitialProps:function(){return h},normalizeRepeatedSlashes:function(){return p},stringifyError:function(){return k}};for(var o in n)Object.defineProperty(r,o,{enumerable:!0,get:n[o]});let a=["CLS","FCP","INP","LCP","TTFB"];function i(e){let t,r=!1;return(...n)=>(r||(r=!0,t=e(...n)),t)}let s=/^[a-zA-Z][a-zA-Z\d+\-.]*?:/,l=e=>{let t=e.charCodeAt(0);return!!(t>=65&&t<=90||t>=97&&t<=122)&&s.test(e)};function u(){let{protocol:e,hostname:t,port:r}=window.location;return`${e}//${t}${r?":"+r:""}`}function f(){let{href:e}=window.location,t=u();return e.substring(t.length)}function c(e){return"string"==typeof e?e:e.displayName||e.name||"Unknown"}function d(e){return e.finished||e.headersSent}function p(e){let t=e.split("?");return t[0].replace(/\\/g,"/").replace(/\/\/+/g,"/")+(t[1]?`?${t.slice(1).join("?")}`:"")}async function h(e,t){let r=t.res||t.ctx&&t.ctx.res;if(!e.getInitialProps)return t.ctx&&t.Component?{pageProps:await h(t.Component,t.ctx)}:{};let n=await e.getInitialProps(t);if(r&&d(r))return n;if(!n)throw Error(`"${c(e)}.getInitialProps()" should resolve to an object. But found "${n}" instead.`);return n}let g="u">typeof performance,m=g&&["mark","measure","getEntriesByName"].every(e=>"function"==typeof performance[e]);class y extends Error{}class v extends Error{}class b extends Error{constructor(e){super(),this.code="ENOENT",this.name="PageNotFoundError",this.message=`Cannot find module for page: ${e}`}}class x extends Error{constructor(e,t){super(),this.message=`Failed to load static file for page: ${e} ${t}`}}class w extends Error{constructor(){super(),this.code="ENOENT",this.message="Cannot find the middleware module"}}function k(e){return JSON.stringify({message:e.message,stack:e.stack})}},772325,e=>{var t=e.i(722219);e.s(["z",0,t])},978056,e=>{var t=e.i(722219);e.s(["z",0,t])},411382,e=>{var t=e.i(722219);e.s(["z",0,t])},54105,e=>{var t=e.i(722219);e.s(["z",0,t])},515288,e=>{var t=e.i(843476),r=e.i(975157);e.s(["N",0,function({className:e,...n}){return(0,t.jsx)("div",{"data-slot":"card",className:(0,r.f)("bg-card text-card-foreground flex flex-col gap-6 rounded-xl border py-6 shadow-sm",e),...n})},"O",0,function({className:e,...n}){return(0,t.jsx)("div",{"data-slot":"card-content",className:(0,r.f)("px-6",e),...n})},"u",0,function({className:e,...n}){return(0,t.jsx)("div",{"data-slot":"card-description",className:(0,r.f)("text-muted-foreground text-sm",e),...n})},"Y",0,function({className:e,...n}){return(0,t.jsx)("div",{"data-slot":"card-header",className:(0,r.f)("@container/card-header grid auto-rows-min grid-rows-[auto_auto] items-start gap-2 px-6 has-data-[slot=card-action]:grid-cols-[1fr_auto] [.border-b]:pb-6",e),...n})},"v",0,function({className:e,...n}){return(0,t.jsx)("div",{"data-slot":"card-title",className:(0,r.f)("leading-none font-semibold",e),...n})}])},776639,e=>{var t=e.i(843476),r=e.i(271645),n=e.i(981140),o=e.i(820783),a=e.i(30030),i=e.i(610772),s=e.i(369340),l=e.i(726330),u=e.i(765491),f=e.i(774606),c=e.i(296626),d=e.i(248425),p=e.i(303536),h=e.i(934620),g=e.i(985369),m=e.i(186312),y=e.i(991918),v=Object.defineProperty,b=(e,t)=>v(e,"name",{value:t,configurable:!0}),x="Dialog",[w,k]=(0,a.f)(x),[j,M]=w(x),R=b(e=>{let{__scopeDialog:n,children:o,open:a,defaultOpen:l,onOpenChange:f,modal:c=!0}=e,d=r.useRef(null),p=r.useRef(null),{nodes:h,registry:g}=(0,u.D)(),[m,y]=(0,s.f)({prop:a,defaultProp:l??!1,onChange:f,caller:x}),[v,b]=r.useState(0),[w,k]=r.useState(0);return(0,t.jsx)(j,{scope:n,triggerRef:d,contentRef:p,contentId:(0,i.f)(),titleId:(0,i.f)(),descriptionId:(0,i.f)(),titlePresent:v>0,descriptionPresent:w>0,setTitleCount:b,setDescriptionCount:k,open:m,onOpenChange:y,onOpenToggle:r.useCallback(()=>y(e=>!e),[y]),modal:c,branchNodes:h,branchRegistry:g,children:o})},"Dialog"),D=r.forwardRef(b(function(e,r){let{__scopeDialog:a,...i}=e,s=M("DialogTrigger",a),l=(0,o.f)(r,s.triggerRef);return(0,t.jsx)(d.V.button,{type:"button","aria-haspopup":"dialog","aria-expanded":s.open,"aria-controls":s.open?s.contentId:void 0,"data-state":B(s.open),...i,ref:l,onClick:(0,n.f)(e.onClick,s.onOpenToggle)})},"DialogTrigger")),C="DialogPortal",[P,N]=w(C,{forceMount:void 0}),I=b(e=>{let{__scopeDialog:n,forceMount:o,children:a,container:i}=e,s=M(C,n);return(0,t.jsx)(P,{scope:n,forceMount:o,children:r.Children.map(a,e=>(0,t.jsx)(c.f,{present:o||s.open,children:(0,t.jsx)(f.f,{asChild:!0,container:i,children:e})}))})},"DialogPortal"),E="DialogOverlay",T=r.forwardRef(b(function(e,r){let n=N(E,e.__scopeDialog),{forceMount:o=n.forceMount,...a}=e,i=M(E,e.__scopeDialog);return i.modal?(0,t.jsx)(c.f,{present:o||i.open,children:(0,t.jsx)(S,{...a,ref:r})}):null},"DialogOverlay")),A=(0,y.B)("DialogOverlay.RemoveScroll"),S=r.forwardRef(b(function(e,n){let{__scopeDialog:a,...i}=e,s=M(E,a),u=(0,l.y)(),f=(0,o.f)(n,u);return(0,t.jsx)(g.f,{as:A,allowPinchZoom:!0,shards:r.useMemo(()=>[s.contentRef,...s.branchNodes.map(e=>({current:e}))],[s.contentRef,s.branchNodes]),children:(0,t.jsx)(d.V.div,{"data-state":B(s.open),...i,ref:f,style:{pointerEvents:"auto",...i.style}})})},"DialogOverlayImpl")),F="DialogContent",z=r.forwardRef(b(function(e,r){let n=N(F,e.__scopeDialog),{forceMount:o=n.forceMount,...a}=e,i=M(F,e.__scopeDialog);return(0,t.jsx)(c.f,{present:o||i.open,children:i.modal?(0,t.jsx)(O,{...a,ref:r}):(0,t.jsx)(_,{...a,ref:r})})},"DialogContent")),O=r.forwardRef(b(function(e,a){let i=M(F,e.__scopeDialog),s=r.useRef(null),l=(0,o.f)(a,i.contentRef,s);return r.useEffect(()=>{let e=s.current;if(e)return(0,m.f)(e)},[]),(0,t.jsx)(U,{...e,ref:l,trapFocus:i.open,disableOutsidePointerEvents:i.open,onCloseAutoFocus:(0,n.f)(e.onCloseAutoFocus,e=>{e.preventDefault(),i.triggerRef.current?.focus()}),onPointerDownOutside:(0,n.f)(e.onPointerDownOutside,e=>{let t=e.detail.originalEvent,r=0===t.button&&!0===t.ctrlKey;(2===t.button||r)&&e.preventDefault()}),onFocusOutside:(0,n.f)(e.onFocusOutside,e=>e.preventDefault())})},"DialogContentModal")),_=r.forwardRef(b(function(e,n){let o=M(F,e.__scopeDialog),a=r.useRef(!1),i=r.useRef(!1);return(0,t.jsx)(U,{...e,ref:n,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:t=>{e.onCloseAutoFocus?.(t),t.defaultPrevented||(a.current||o.triggerRef.current?.focus(),t.preventDefault()),a.current=!1,i.current=!1},onInteractOutside:t=>{e.onInteractOutside?.(t),t.defaultPrevented||(a.current=!0,"pointerdown"===t.detail.originalEvent.type&&(i.current=!0));let r=t.target;o.triggerRef.current?.contains(r)&&t.preventDefault(),"focusin"===t.detail.originalEvent.type&&i.current&&t.preventDefault()}})},"DialogContentNonModal")),U=r.forwardRef(b(function(e,r){let{__scopeDialog:n,trapFocus:o,onOpenAutoFocus:a,onCloseAutoFocus:i,"aria-describedby":s,children:f,...c}=e,d=M(F,n);return(0,p.f)(),(0,t.jsx)(u.l,{registry:d.branchRegistry,children:(0,t.jsx)(u.v,{asChild:!0,loop:!0,trapped:o,branches:d.branchNodes,onMountAutoFocus:a,onUnmountAutoFocus:i,children:(0,t.jsx)(l.V,{role:"dialog",id:d.contentId,"aria-labelledby":d.titlePresent?d.titleId:void 0,"aria-describedby":d.descriptionPresent?K(s,d.descriptionId):s,"data-state":B(d.open),...c,ref:r,deferPointerDownOutside:!0,onDismiss:()=>d.onOpenChange(!1),children:f})})})},"DialogContentImpl")),L=r.forwardRef(b(function(e,r){let{__scopeDialog:n,...o}=e,a=M("DialogTitle",n),{setTitleCount:i}=a;return(0,h.f)(()=>(i(e=>e+1),()=>i(e=>e-1)),[i]),(0,t.jsx)(d.V.h2,{id:a.titleId,...o,ref:r})},"DialogTitle")),$=r.forwardRef(b(function(e,r){let{__scopeDialog:n,...o}=e,a=M("DialogDescription",n),{setDescriptionCount:i}=a;return(0,h.f)(()=>(i(e=>e+1),()=>i(e=>e-1)),[i]),(0,t.jsx)(d.V.p,{id:a.descriptionId,...o,ref:r})},"DialogDescription")),V=r.forwardRef(b(function(e,r){let{__scopeDialog:o,...a}=e,i=M("DialogClose",o);return(0,t.jsx)(d.V.button,{type:"button",...a,ref:r,onClick:(0,n.f)(e.onClick,()=>i.onOpenChange(!1))})},"DialogClose"));function K(...e){let t=new Set;for(let r of e)if("string"==typeof r)for(let e of String(r).trim().split(/\s+/))e&&t.add(e);return t.size>0?Array.from(t).join(" "):void 0}function B(e){return e?"open":"closed"}b(K,"concatAriaDescribedby"),b(B,"getState");var H=e.i(263676),q=e.i(975157);let G=r.forwardRef(({className:e,...r},n)=>(0,t.jsx)(T,{ref:n,className:(0,q.f)("fixed inset-0 z-50 bg-black/50 backdrop-blur-[2px] data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",e),...r}));G.displayName=T.displayName;let W=r.forwardRef(({className:e,children:r,...n},o)=>(0,t.jsxs)(I,{children:[(0,t.jsx)(G,{}),(0,t.jsxs)(z,{ref:o,onPointerDownOutside:e=>{e.preventDefault()},className:(0,q.f)("fixed left-[50%] top-[50%] z-50 grid w-[calc(100%-2rem)] max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 rounded-2xl border bg-card p-6 shadow-xl duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95",e),...n,children:[r,(0,t.jsxs)(V,{className:"absolute right-4 top-4 rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-accent data-[state=open]:text-muted-foreground",children:[(0,t.jsx)(H.X,{className:"h-4 w-4"}),(0,t.jsx)("span",{className:"sr-only",children:"Close"})]})]})]}));W.displayName=z.displayName;let X=({className:e,...r})=>(0,t.jsx)("div",{className:(0,q.f)("flex flex-col space-y-1.5 text-center sm:text-left",e),...r});X.displayName="DialogHeader";let Z=({className:e,...r})=>(0,t.jsx)("div",{className:(0,q.f)("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",e),...r});Z.displayName="DialogFooter";let J=r.forwardRef(({className:e,...r},n)=>(0,t.jsx)(L,{ref:n,className:(0,q.f)("text-lg font-semibold leading-none tracking-tight",e),...r}));J.displayName=L.displayName;let Q=r.forwardRef(({className:e,...r},n)=>(0,t.jsx)($,{ref:n,className:(0,q.f)("text-sm text-muted-foreground",e),...r}));Q.displayName=$.displayName,e.s(["N",0,R,"d",0,W,"C",0,Q,"c",0,Z,"s",0,X,"F",0,J,"a",0,D],776639)},793479,e=>{var t=e.i(843476),r=e.i(975157);e.s(["f",0,function({className:e,type:n,...o}){return(0,t.jsx)("input",{type:n,"data-slot":"input",className:(0,r.f)("file:text-foreground placeholder:text-muted-foreground selection:bg-primary selection:text-primary-foreground dark:bg-input/30 border-input h-9 w-full min-w-0 rounded-md border bg-transparent px-3 py-1 text-base shadow-xs transition-[color,box-shadow] outline-none file:inline-flex file:h-7 file:border-0 file:bg-transparent file:text-sm file:font-medium disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50 md:text-sm","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",e),...o})}])},677572,e=>{var t=e.i(843476),r=e.i(271645),n=e.i(981140),o=e.i(30030),a=e.i(842727),i=e.i(296626),s=e.i(248425),l=e.i(586318),u=e.i(369340),f=e.i(610772),c=Object.defineProperty,d=(e,t)=>c(e,"name",{value:t,configurable:!0}),p="Tabs",[h,g]=(0,o.f)(p,[a.B]),m=(0,a.B)(),[y,v]=h(p),b=r.forwardRef(d(function(e,r){let{__scopeTabs:n,value:o,onValueChange:a,defaultValue:i,orientation:c="horizontal",dir:d,activationMode:h="automatic",...g}=e,m=(0,l.f)(d),[v,b]=(0,u.f)({prop:o,onChange:a,defaultProp:i??"",caller:p});return(0,t.jsx)(y,{scope:n,baseId:(0,f.f)(),value:v,onValueChange:b,orientation:c,dir:m,activationMode:h,children:(0,t.jsx)(s.V.div,{dir:m,"data-orientation":c,...g,ref:r})})},"Tabs")),x=r.forwardRef(d(function(e,r){let{__scopeTabs:n,loop:o=!0,...i}=e,l=v("TabsList",n),u=m(n);return(0,t.jsx)(a.F,{asChild:!0,...u,orientation:l.orientation,dir:l.dir,loop:o,children:(0,t.jsx)(s.V.div,{role:"tablist","aria-orientation":l.orientation,...i,ref:r})})},"TabsList")),w=r.forwardRef(d(function(e,r){let{__scopeTabs:o,value:i,disabled:l=!1,...u}=e,f=v("TabsTrigger",o),c=m(o),d=j(f.baseId,i),p=M(f.baseId,i),h=i===f.value;return(0,t.jsx)(a.M,{asChild:!0,...c,focusable:!l,active:h,children:(0,t.jsx)(s.V.button,{type:"button",role:"tab","aria-selected":h,"aria-controls":p,"data-state":h?"active":"inactive","data-disabled":l?"":void 0,disabled:l,id:d,...u,ref:r,onMouseDown:(0,n.f)(e.onMouseDown,e=>{l||0!==e.button||!1!==e.ctrlKey?e.preventDefault():(e.currentTarget.focus(),f.onValueChange(i))}),onKeyDown:(0,n.f)(e.onKeyDown,e=>{!l&&e.target===e.currentTarget&&[" ","Enter"].includes(e.key)&&f.onValueChange(i)}),onFocus:(0,n.f)(e.onFocus,()=>{let e="manual"!==f.activationMode;h||l||!e||f.onValueChange(i)})})})},"TabsTrigger")),k=r.forwardRef(d(function(e,n){let{__scopeTabs:o,value:a,forceMount:l,children:u,...f}=e,c=v("TabsContent",o),d=j(c.baseId,a),p=M(c.baseId,a),h=a===c.value,g=r.useRef(h);return r.useEffect(()=>{let e=requestAnimationFrame(()=>g.current=!1);return()=>cancelAnimationFrame(e)},[]),(0,t.jsx)(i.f,{present:l||h,children:({present:r})=>(0,t.jsx)(s.V.div,{"data-state":h?"active":"inactive","data-orientation":c.orientation,role:"tabpanel","aria-labelledby":d,hidden:!r,id:p,tabIndex:0,...f,ref:n,style:{...e.style,animationDuration:g.current?"0s":void 0},children:r&&u})})},"TabsContent"));function j(e,t){return`${e}-trigger-${t}`}function M(e,t){return`${e}-content-${t}`}d(j,"makeTriggerId"),d(M,"makeContentId");var R=e.i(975157);let D=r.forwardRef(({className:e,...r},n)=>(0,t.jsx)(x,{ref:n,className:(0,R.f)("inline-flex h-10 items-center justify-center rounded-md bg-muted p-1 text-muted-foreground",e),...r}));D.displayName=x.displayName;let C=r.forwardRef(({className:e,...r},n)=>(0,t.jsx)(w,{ref:n,className:(0,R.f)("inline-flex items-center justify-center whitespace-nowrap rounded-sm px-3 py-1.5 text-sm font-medium ring-offset-background transition-all focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 data-[state=active]:bg-background data-[state=active]:text-foreground data-[state=active]:shadow-sm",e),...r}));C.displayName=w.displayName;let P=r.forwardRef(({className:e,...r},n)=>(0,t.jsx)(k,{ref:n,className:(0,R.f)("mt-2 ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2",e),...r}));P.displayName=k.displayName,e.s(["i",0,b,"S",0,P,"U",0,D,"k",0,C],677572)},81968,e=>{e.s(["f",0,function(){return window.WrongNotebookAndroid??null}])},637691,e=>{e.s(["f",0,"https://github.com/margrop/wrong-notebook"])},905110,e=>{let t=["new","reviewing","mastered"];e.s(["z",0,50,"o",0,100,"P",0,1,"m",0,function(e,t=50){return"number"==typeof e&&e>=t/100},"A",0,function(e){return"string"==typeof e&&t.includes(e)}])}])})();
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,864272,e=>{"use strict";var t=e.i(843476),a=e.i(271645),i=e.i(522016),r=e.i(618566),s=e.i(13285),n=e.i(853138),l=e.i(632781),c=e.i(77071),o=e.i(456420);let d={name:"undo-2",size:24,node:[["path",{d:"M9 14 4 9l5-5",key:"102s5s"}],["path",{d:"M4 9h10.5a5.5 5.5 0 0 1 5.5 5.5a5.5 5.5 0 0 1-5.5 5.5H11",key:"f3b9sd"}]]};d.node;let m=(0,o.f)(d),u={name:"arrow-right",size:24,node:[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"m12 5 7 7-7 7",key:"xquz4c"}]]};u.node;let x=(0,o.f)(u);var h=e.i(111110);function p({inputProps:e,created:a}){let{t:r}=(0,h.b)();return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("input",{type:"file",accept:"image/*",className:"hidden","data-testid":"continuation-input",...e}),a.length>0&&(0,t.jsx)("ul",{className:"space-y-1 rounded-lg border border-primary/40 bg-primary/5 p-3 text-sm","data-testid":"continuation-notice",children:a.map((e,a)=>(0,t.jsxs)("li",{className:"flex flex-wrap items-center justify-between gap-2",children:[(0,t.jsxs)("span",{className:"flex items-center gap-1",children:[(0,t.jsx)(s.f,{className:"h-4 w-4 text-primary"}),r.importBatch.continuation.notice.replace("{n}",String(a+2))]}),(0,t.jsxs)(i.default,{href:`/import-batches/${e}`,className:"flex items-center gap-1 text-primary underline-offset-2 hover:underline",children:[r.importBatch.continuation.open,(0,t.jsx)(x,{className:"h-3 w-3"})]})]},e))})]})}let f={name:"arrow-down",size:24,node:[["path",{d:"M12 5v14",key:"s699le"}],["path",{d:"m19 12-7 7-7-7",key:"1idqje"}]]};f.node;let g=(0,o.f)(f),y={name:"arrow-up",size:24,node:[["path",{d:"m5 12 7-7 7 7",key:"hav0vg"}],["path",{d:"M12 19V5",key:"x0mq9r"}]]};y.node;let b=(0,o.f)(y);var j=e.i(716327),v=e.i(456539),k=e.i(508734);let w={name:"crop",size:24,node:[["path",{d:"M6 2v14a2 2 0 0 0 2 2h14",key:"ron5a4"}],["path",{d:"M18 22V8a2 2 0 0 0-2-2H2",key:"7s9ehn"}]]};w.node;let N=(0,o.f)(w),B={name:"file-plus-corner",size:24,node:[["path",{d:"M11.35 22H6a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.706.706l3.588 3.588A2.4 2.4 0 0 1 20 8v5.35",key:"17jvcc"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["path",{d:"M14 19h6",key:"bvotb8"}],["path",{d:"M17 16v6",key:"18yu1i"}]],aliases:["file-plus-2"]};B.node;let C=(0,o.f)(B),S={name:"merge",size:24,node:[["path",{d:"m8 6 4-4 4 4",key:"ybng9g"}],["path",{d:"M12 2v10.3a4 4 0 0 1-1.172 2.872L4 22",key:"1hyw0i"}],["path",{d:"m20 22-5-5",key:"1m27yz"}]]};S.node;let z=(0,o.f)(S),T={name:"scissors",size:24,node:[["circle",{cx:"6",cy:"6",r:"3",key:"1lh9wr"}],["path",{d:"M8.12 8.12 12 12",key:"1alkpv"}],["path",{d:"M20 4 8.12 15.88",key:"xgtan2"}],["circle",{cx:"6",cy:"18",r:"3",key:"fqmcym"}],["path",{d:"M14.8 14.8 20 20",key:"ptml3r"}]]};T.node;let I=(0,o.f)(T);var M=e.i(328623),R=e.i(759659),$=e.i(411382),E=e.i(978056),A=e.i(54105),F=e.i(772325),D=e.i(722219),D=D,H=e.i(282492),U=e.i(825624);let q=$.z.object({x:E.z.number().min(0).max(1),y:E.z.number().min(0).max(1),width:E.z.number().min(.01).max(1),height:E.z.number().min(.01).max(1)}).refine(e=>e.x+e.width<=1.0001&&e.y+e.height<=1.0001,{message:"REGION_OUT_OF_BOUNDS"}),_=["unclear","partial","unlocated"],L=$.z.object({original:A.z.string().max(2e4),text:A.z.string().max(2e4),uncertain:F.z.array(A.z.string().max(200)).max(20)}),O=$.z.object({key:A.z.string().regex(/^[A-Za-z0-9_-]{1,40}$/),label:A.z.string().max(20).nullable(),text:A.z.string().max(2e4),material:A.z.string().max(2e4).nullable(),section:A.z.string().max(500).nullable(),selected:D.boolean(),regions:F.z.array(q).max(4),hasFigure:D.boolean(),flags:F.z.array(H.z.enum(_)).max(_.length),fix:L.nullish()}),P=["blurry","partial","truncated","tooMany"];function V(e=[]){let t=new Set(e);for(;;){let e=`q${Math.random().toString(36).slice(2,10)}`;if(!t.has(e))return e}}function K(e,t){return"image"===t?e.regions.length>0:e.text.trim().length>0}$.z.object({items:F.z.array(O).max(U.S),ignored:F.z.array(A.z.string().max(2e4)).max(200),warnings:F.z.array(H.z.enum(P)).max(P.length)}).superRefine((e,t)=>{let a=new Set;for(let i of e.items)a.has(i.key)&&t.addIssue({code:"custom",message:"DUPLICATE_ITEM_KEY"}),a.add(i.key)});var G=e.i(975157);function Q({imageUrl:e,imageSize:a,regions:i,className:r}){let s=function(e){if(0===e.length)return null;let t=Math.min(...e.map(e=>e.x)),a=Math.min(...e.map(e=>e.y));return{x:t,y:a,width:Math.max(...e.map(e=>e.x+e.width))-t,height:Math.max(...e.map(e=>e.y+e.height))-a}}(i);if(!s)return null;let n=s.width*a.width/Math.max(1,s.height*a.height);return(0,t.jsx)("div",{className:(0,G.f)("relative w-full overflow-hidden rounded-md border bg-white",r),style:{aspectRatio:String(Math.max(.25,Math.min(8,n)))},"aria-hidden":!0,children:(0,t.jsx)("img",{src:e,alt:"",className:"absolute max-w-none select-none",draggable:!1,style:{width:`${100/s.width}%`,height:`${100/s.height}%`,left:`${-s.x/s.width*100}%`,top:`${-s.y/s.height*100}%`}})})}var W=e.i(689664),Y=e.i(263676),J=e.i(519455);function X(e,t,a){if(!a)return;let i=e[e.length-1];i&&i.type===t?i.text+=a:e.push({type:t,text:a})}function Z({fix:e,onAccept:i,onReject:r}){let{t:s}=(0,h.b)(),n=(0,a.useMemo)(()=>(function(e,t){let a=Array.from(e),i=Array.from(t),r=0;for(;r<a.length&&r<i.length&&a[r]===i[r];)r++;let s=a.length,n=i.length;for(;s>r&&n>r&&a[s-1]===i[n-1];)s--,n--;let l=[];X(l,"same",a.slice(0,r).join(""));let c=a.slice(r,s),o=i.slice(r,n),d=c.length,m=o.length;if(d*m>2e6)X(l,"removed",c.join("")),X(l,"added",o.join(""));else{let e=m+1,t=new Uint32Array((d+1)*e);for(let a=d-1;a>=0;a--)for(let i=m-1;i>=0;i--)t[a*e+i]=c[a]===o[i]?t[(a+1)*e+i+1]+1:Math.max(t[(a+1)*e+i],t[a*e+i+1]);let a=0,i=0;for(;a<d&&i<m;)c[a]===o[i]?(X(l,"same",c[a]),a++,i++):t[(a+1)*e+i]>=t[a*e+i+1]?X(l,"removed",c[a++]):X(l,"added",o[i++]);X(l,"removed",c.slice(a).join("")),X(l,"added",o.slice(i).join(""))}return X(l,"same",a.slice(s).join("")),l})(e.original,e.text),[e.original,e.text]);return(0,t.jsxs)("div",{className:"space-y-2 rounded-lg border border-violet-300 bg-violet-50/60 p-2 text-sm dark:border-violet-800 dark:bg-violet-950/30","data-testid":"text-fix-panel",children:[(0,t.jsxs)("div",{className:"flex flex-wrap items-center justify-between gap-1",children:[(0,t.jsxs)("span",{className:"flex items-center gap-1 text-xs font-medium text-violet-700 dark:text-violet-300",children:[(0,t.jsx)(M.f,{className:"h-3 w-3"}),s.importBatch.fixText.title]}),(0,t.jsx)("span",{className:"text-xs text-muted-foreground",children:s.importBatch.fixText.legend})]}),(0,t.jsx)("p",{className:"whitespace-pre-wrap break-words font-mono text-sm","data-testid":"text-fix-diff",children:n.map((e,a)=>"same"===e.type?(0,t.jsx)("span",{children:e.text},a):"removed"===e.type?(0,t.jsx)("del",{className:"bg-red-100 text-red-700 decoration-red-500 dark:bg-red-950/50 dark:text-red-300",children:e.text},a):(0,t.jsx)("ins",{className:"bg-emerald-100 text-emerald-800 no-underline dark:bg-emerald-950/50 dark:text-emerald-300",children:e.text},a))}),e.uncertain.length>0&&(0,t.jsxs)("div",{className:"text-xs text-amber-800 dark:text-amber-300",children:[(0,t.jsx)("span",{children:s.importBatch.fixText.uncertain}),(0,t.jsx)("ul",{className:"mt-0.5 list-inside list-disc",children:e.uncertain.map((e,a)=>(0,t.jsx)("li",{className:"break-words",children:e},a))})]}),(0,t.jsxs)("div",{className:"flex flex-wrap gap-2",children:[(0,t.jsxs)(J.f,{type:"button",size:"sm",onClick:i,children:[(0,t.jsx)(W.f,{className:"mr-1 h-4 w-4"}),s.importBatch.fixText.accept]}),(0,t.jsxs)(J.f,{type:"button",size:"sm",variant:"ghost",onClick:r,children:[(0,t.jsx)(Y.X,{className:"mr-1 h-4 w-4"}),s.importBatch.fixText.reject]})]})]})}var ee=e.i(487486),et=e.i(257428),ea=e.i(624687);function ei(e,t){return{...e,items:t}}function er(e,t){return e.items.findIndex(e=>e.key===t)}function es(e,t,a){return ei(e,e.items.map(e=>{if(e.key!==t)return e;let i={...e,...a};return void 0!==a.text&&(i.text=a.text.slice(0,2e4),i.text!==e.text&&(i.fix=null)),void 0!==a.regions&&(i.regions=a.regions.slice(0,4),i.flags=i.regions.length>0?e.flags.filter(e=>"unlocated"!==e):[...new Set([...e.flags,"unlocated"])]),i}))}function en(e,t){return ei(e,e.items.filter(e=>e.key!==t))}function el(e,t,a){let i=er(e,t),r=i+a;if(i<0||r<0||r>=e.items.length)return e;let s=[...e.items];return[s[i],s[r]]=[s[r],s[i]],ei(e,s)}function ec(e,t){let a=t?new Set(t):null,i=!1,r=e.items.map(e=>e.fix&&(!a||a.has(e.key))?(i=!0,e.fix.original===e.text?{...e,text:e.fix.text,fix:null}:{...e,fix:null}):e);return i?ei(e,r):e}function eo({item:e,index:i,total:r,source:s,expanded:c,onToggleExpand:o,onEdit:d,image:m,onAdjustRegion:u,highlighted:x,onFixText:p,fixing:f,fixBusy:y,onContinue:w,continuing:B}){let{t:S}=(0,h.b)(),T=(0,a.useRef)(null),$=K(e,s),E=`draft-item-${e.key}`,A=e.fix&&e.fix.original===e.text?e.fix:null;return(0,t.jsxs)("li",{id:E,className:(0,G.f)("rounded-xl border bg-card p-3 transition-colors",!e.selected&&"opacity-70",x&&"border-primary ring-2 ring-primary/30"),"data-testid":"draft-item","data-selected":e.selected,"data-fix-pending":A?"true":void 0,children:[(0,t.jsxs)("div",{className:"flex items-start gap-3",children:[(0,t.jsx)(et.f,{className:"mt-1 h-5 w-5",checked:e.selected,disabled:!$,onCheckedChange:t=>d(a=>{var i,r;return i=e.key,r=!0===t,ei(a,a.items.map(e=>e.key===i?{...e,selected:r}:e))}),"aria-label":S.importBatch.question.replace("{index}",String(i+1))}),(0,t.jsxs)("button",{type:"button",className:"min-w-0 flex-1 text-left",onClick:o,"aria-expanded":c,"aria-controls":`${E}-body`,children:[(0,t.jsxs)("div",{className:"flex flex-wrap items-center gap-2 text-sm",children:[(0,t.jsx)("span",{className:"font-semibold",children:S.importBatch.question.replace("{index}",String(i+1))}),e.label&&(0,t.jsx)("span",{className:"text-xs text-muted-foreground",children:S.importBatch.originalLabel.replace("{label}",e.label)}),e.material&&(0,t.jsx)(ee.f,{variant:"secondary",children:S.importBatch.material}),e.hasFigure&&(0,t.jsx)(ee.f,{variant:"outline",children:S.importBatch.hasFigure}),A&&(0,t.jsx)(ee.f,{className:"bg-violet-600 text-white hover:bg-violet-600",children:S.importBatch.fixText.pending}),e.section&&(0,t.jsx)("span",{className:"truncate text-xs text-muted-foreground",children:e.section.split("\n")[0]})]}),!c&&!A&&e.text&&(0,t.jsx)("p",{className:"mt-1 line-clamp-3 whitespace-pre-line break-words text-sm text-muted-foreground",children:e.text}),e.flags.length>0&&(0,t.jsx)("ul",{className:"mt-1 space-y-0.5",children:e.flags.map(e=>(0,t.jsxs)("li",{className:"flex items-center gap-1 text-xs text-amber-700 dark:text-amber-300",children:[(0,t.jsx)(n.f,{className:"h-3 w-3 shrink-0"}),S.importBatch.flags[e]]},e))})]}),(0,t.jsx)(J.f,{type:"button",size:"icon",variant:"ghost",className:"h-8 w-8 shrink-0",onClick:o,"aria-label":c?S.importBatch.collapse:S.importBatch.edit,children:c?(0,t.jsx)(v.f,{className:"h-4 w-4"}):(0,t.jsx)(j.f,{className:"h-4 w-4"})})]}),m&&e.regions.length>0&&(0,t.jsx)("button",{type:"button",className:"mt-2 block w-full max-w-md pl-8",onClick:u,"aria-label":S.importBatch.adjustRegion,children:(0,t.jsx)(Q,{imageUrl:m.url,imageSize:m,regions:e.regions,className:"max-h-48"})}),w&&(0,t.jsx)("div",{className:"mt-2 pl-8",children:(0,t.jsxs)(J.f,{type:"button",size:"sm",variant:"outline",onClick:w,disabled:B,"data-testid":"draft-continue",children:[B?(0,t.jsx)(l.f,{className:"mr-1 h-4 w-4 animate-spin"}):(0,t.jsx)(C,{className:"mr-1 h-4 w-4"}),B?S.importBatch.continuation.working:S.importBatch.continuation.button]})}),A&&(0,t.jsx)("div",{className:"mt-2 pl-8",children:(0,t.jsx)(Z,{fix:A,onAccept:()=>d(t=>ec(t,[e.key])),onReject:()=>d(t=>{var a;return a=e.key,ei(t,t.items.map(e=>e.key===a&&e.fix?{...e,fix:null}:e))})})}),c&&(0,t.jsxs)("div",{id:`${E}-body`,className:"mt-3 space-y-3 pl-8",children:[e.material&&(0,t.jsxs)("div",{className:"rounded-lg bg-muted/60 p-2 text-sm",children:[(0,t.jsxs)("div",{className:"mb-1 flex items-center justify-between gap-2",children:[(0,t.jsxs)("span",{className:"text-xs font-medium",children:[S.importBatch.material," · ",S.importBatch.materialHint]}),(0,t.jsx)(J.f,{type:"button",size:"sm",variant:"ghost",className:"h-7 px-2 text-xs",onClick:()=>d(t=>es(t,e.key,{material:null})),children:S.importBatch.removeMaterial})]}),(0,t.jsx)("p",{className:"line-clamp-6 whitespace-pre-line break-words text-muted-foreground",children:e.material})]}),"text"===s?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(ea.f,{ref:T,"aria-label":S.importBatch.questionText,value:e.text,onChange:t=>d(a=>es(a,e.key,{text:t.target.value}),`text-${e.key}`),className:"min-h-28 font-mono text-sm"}),(0,t.jsx)("p",{className:"text-xs text-muted-foreground",children:S.importBatch.splitHint})]}):(0,t.jsxs)(t.Fragment,{children:[e.text&&(0,t.jsx)("p",{className:"whitespace-pre-line break-words text-sm text-muted-foreground",children:e.text}),(0,t.jsx)("p",{className:"text-xs text-muted-foreground",children:S.importBatch.imageTextHint})]}),(0,t.jsxs)("div",{className:"flex flex-wrap gap-2",children:["text"===s?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)(J.f,{type:"button",size:"sm",variant:"outline",onClick:()=>{let t=T.current?.selectionStart??0;d(a=>(function(e,t,a){let i=er(e,t);if(i<0||e.items.length>=U.S)return e;let r=e.items[i],s=r.text.slice(0,a).replace(/\s+$/,""),n=r.text.slice(a).replace(/^\s+/,"");if(!s||!n)return e;let l={...r,key:V(e.items.map(e=>e.key)),label:null,text:n,regions:[],flags:r.regions.length>0?["unlocated"]:[],selected:!(r.regions.length>0)&&r.selected,fix:null},c=[...e.items];return c.splice(i,1,{...r,text:s,fix:null},l),ei(e,c)})(a,e.key,t))},children:[(0,t.jsx)(I,{className:"mr-1 h-4 w-4"}),S.importBatch.splitHere]}),p&&(0,t.jsxs)(J.f,{type:"button",size:"sm",variant:"outline",onClick:p,disabled:y||!e.text.trim(),children:[f?(0,t.jsx)(l.f,{className:"mr-1 h-4 w-4 animate-spin"}):(0,t.jsx)(M.f,{className:"mr-1 h-4 w-4"}),f?S.importBatch.fixText.running:S.importBatch.fixText.one]})]}):(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)(J.f,{type:"button",size:"sm",variant:"outline",onClick:u,children:[(0,t.jsx)(N,{className:"mr-1 h-4 w-4"}),e.regions.length?S.importBatch.adjustRegion:S.importBatch.locate]}),(0,t.jsxs)(J.f,{type:"button",size:"sm",variant:"outline",onClick:()=>d(t=>(function(e,t){let a=er(e,t);if(a<0||e.items.length>=U.S)return e;let i=e.items[a],r={...i,key:V(e.items.map(e=>e.key)),label:null,regions:i.regions.map(e=>({...e}))},s=[...e.items];return s.splice(a+1,0,r),ei(e,s)})(t,e.key)),children:[(0,t.jsx)(k.f,{className:"mr-1 h-4 w-4"}),S.importBatch.duplicate]})]}),(0,t.jsxs)(J.f,{type:"button",size:"sm",variant:"outline",disabled:0===i,onClick:()=>d(t=>(function(e,t){let a=er(e,t);if(a<=0)return e;let i=e.items[a-1],r=e.items[a],s={...i,text:[i.text,r.text].filter(e=>e.trim()).join("\n").slice(0,2e4),material:i.material??r.material,selected:i.selected||r.selected,regions:[...i.regions,...r.regions].slice(0,4),hasFigure:i.hasFigure||r.hasFigure,flags:[...new Set([...i.flags,...r.flags])].filter(e=>"unlocated"!==e||i.regions.length+r.regions.length===0),fix:null},n=[...e.items];return n.splice(a-1,2,s),ei(e,n)})(t,e.key)),children:[(0,t.jsx)(z,{className:"mr-1 h-4 w-4"}),S.importBatch.mergeUp]}),(0,t.jsx)(J.f,{type:"button",size:"sm",variant:"ghost",disabled:0===i,onClick:()=>d(t=>el(t,e.key,-1)),"aria-label":S.importBatch.moveUp,children:(0,t.jsx)(b,{className:"h-4 w-4"})}),(0,t.jsx)(J.f,{type:"button",size:"sm",variant:"ghost",disabled:i===r-1,onClick:()=>d(t=>el(t,e.key,1)),"aria-label":S.importBatch.moveDown,children:(0,t.jsx)(g,{className:"h-4 w-4"})}),(0,t.jsxs)(J.f,{type:"button",size:"sm",variant:"ghost",className:"text-destructive",onClick:()=>d(t=>en(t,e.key)),children:[(0,t.jsx)(R.f,{className:"mr-1 h-4 w-4"}),S.importBatch.delete]})]})]})]})}function ed({count:e,missingRegions:a,pendingFixes:i=0,confirmBeforeImport:r,starting:s,onStart:n,onDiscard:c}){let{t:o}=(0,h.b)(),d=(r?o.importBatch.startReview:o.importBatch.startAuto).replace("{count}",String(e)),m=0===e?o.importBatch.nothingSelected:a>0?o.importBatch.needsRegion.replace("{count}",String(a)):i>0?o.importBatch.fixText.pendingHint.replace("{count}",String(i)):r?o.importBatch.startHintReview:o.importBatch.startHintAuto;return(0,t.jsx)("div",{className:"fixed inset-x-0 bottom-[calc(4rem+env(safe-area-inset-bottom))] z-30 border-t bg-background/95 py-3 pl-4 pr-16 shadow-[0_-4px_12px_rgba(0,0,0,0.06)] backdrop-blur md:sticky md:bottom-4 md:rounded-xl md:border md:px-4","data-testid":"draft-start-bar",children:(0,t.jsxs)("div",{className:"mx-auto flex max-w-4xl flex-col gap-2 md:flex-row md:items-center md:justify-between",children:[(0,t.jsx)("p",{className:"text-xs text-muted-foreground md:max-w-md","data-testid":"draft-start-hint",children:s??m}),(0,t.jsxs)("div",{className:"flex gap-2",children:[(0,t.jsx)(J.f,{type:"button",variant:"ghost",onClick:c,disabled:!!s,className:"shrink-0",children:o.importBatch.discard}),(0,t.jsxs)(J.f,{type:"button",onClick:n,disabled:0===e||!!s,className:"min-w-0 flex-1 md:flex-none","data-testid":"draft-start",children:[s?(0,t.jsx)(l.f,{className:"mr-2 h-4 w-4 animate-spin"}):(0,t.jsx)(M.f,{className:"mr-2 h-4 w-4"}),(0,t.jsx)("span",{className:"truncate",children:d})]})]})]})})}function em({ignored:e,onRestore:i}){let{t:r}=(0,h.b)(),[s,n]=(0,a.useState)(!1);return 0===e.length?null:(0,t.jsxs)("section",{className:"rounded-xl border p-3",children:[(0,t.jsxs)("button",{type:"button",className:"flex w-full items-center justify-between text-left text-sm font-medium",onClick:()=>n(e=>!e),"aria-expanded":s,children:[r.importBatch.ignoredTitle.replace("{count}",String(e.length)),s?(0,t.jsx)(v.f,{className:"h-4 w-4"}):(0,t.jsx)(j.f,{className:"h-4 w-4"})]}),s&&(0,t.jsxs)("div",{className:"mt-2 space-y-2",children:[(0,t.jsx)("p",{className:"text-xs text-muted-foreground",children:r.importBatch.ignoredHint}),(0,t.jsx)("ul",{className:"space-y-2",children:e.map((e,a)=>(0,t.jsxs)("li",{className:"flex items-start gap-2 rounded-lg bg-muted/50 p-2 text-sm",children:[(0,t.jsx)("p",{className:"min-w-0 flex-1 whitespace-pre-line break-words text-muted-foreground",children:e}),(0,t.jsx)(J.f,{type:"button",size:"sm",variant:"outline",className:"h-7 shrink-0",onClick:()=>i(a),children:r.importBatch.addAsQuestion})]},`${a}-${e.slice(0,20)}`))})]})]})}function eu({imageUrl:e,items:i,onSelectItem:r,highlightedKey:s}){let{t:n}=(0,h.b)(),[l,c]=(0,a.useState)(!0);return(0,t.jsxs)("section",{className:"rounded-xl border bg-card p-3","data-testid":"page-image-overview",children:[(0,t.jsxs)(J.f,{type:"button",variant:"ghost",size:"sm",className:"mb-2 h-8 px-2 md:hidden",onClick:()=>c(e=>!e),"aria-expanded":l,children:[l?(0,t.jsx)(v.f,{className:"mr-1 h-4 w-4"}):(0,t.jsx)(j.f,{className:"mr-1 h-4 w-4"}),l?n.importBatch.hideImage:n.importBatch.showImage]}),(0,t.jsxs)("div",{className:(0,G.f)("relative mx-auto w-fit max-w-full",!l&&"hidden md:block"),children:[(0,t.jsx)("img",{src:e,alt:"",className:"block max-h-[70vh] max-w-full select-none rounded-md",draggable:!1}),i.map((e,a)=>e.regions.map((i,l)=>(0,t.jsx)("button",{type:"button",onClick:()=>r(e.key),className:(0,G.f)("absolute rounded-sm border-2 transition-colors",e.selected?"border-primary bg-primary/10":"border-dashed border-muted-foreground/70 bg-transparent",s===e.key&&"border-amber-500 bg-amber-400/20"),style:{left:`${100*i.x}%`,top:`${100*i.y}%`,width:`${100*i.width}%`,height:`${100*i.height}%`},"aria-label":n.importBatch.question.replace("{index}",String(a+1)),children:0===l&&(0,t.jsx)("span",{className:(0,G.f)("absolute -left-0.5 -top-0.5 rounded-br-md px-1.5 text-xs font-semibold text-white",e.selected?"bg-primary":"bg-muted-foreground"),children:a+1})},`${e.key}-${l}`)))]})]})}var ex=e.i(232660),eh=e.i(776639);let ep={x:.1,y:.1,width:.8,height:.3};function ef(e){return{unit:"%",x:100*e.x,y:100*e.y,width:100*e.width,height:100*e.height}}function eg(e){let t={x:e.x/100,y:e.y/100,width:e.width/100,height:e.height/100};return t.width>=.01&&t.height>=.01?t:null}function ey({open:e,imageUrl:i,regions:r,onClose:s,onSave:n}){let{t:l}=(0,h.b)(),[o,d]=(0,a.useState)(()=>(r.length?r:[ep]).map(ef)),[m,u]=(0,a.useState)(0),x=o[Math.min(m,o.length-1)];return(0,t.jsx)(eh.N,{open:e,onOpenChange:e=>!e&&s(),children:(0,t.jsxs)(eh.d,{className:"flex h-[90vh] max-w-3xl flex-col gap-0 p-0",children:[(0,t.jsxs)(eh.s,{className:"shrink-0 border-b p-4",children:[(0,t.jsx)(eh.F,{children:l.importBatch.regionDialogTitle}),(0,t.jsx)(eh.C,{children:l.importBatch.regionDialogHint})]}),(0,t.jsx)("div",{className:"min-h-0 flex-1 overflow-auto bg-black p-3",children:(0,t.jsx)("div",{className:"mx-auto w-fit",children:(0,t.jsx)(ex.f,{crop:x,onChange:(e,t)=>d(e=>e.map((e,a)=>a===m?t:e)),children:(0,t.jsx)("img",{src:i,alt:"",className:"block max-h-[65vh] max-w-full",draggable:!1})})})}),(0,t.jsxs)("div",{className:"shrink-0 space-y-3 border-t p-4",children:[(0,t.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[o.map((e,a)=>(0,t.jsx)("button",{type:"button",onClick:()=>u(a),className:(0,G.f)("rounded-md border px-3 py-1 text-sm",a===m?"border-primary bg-primary/10 font-medium":"text-muted-foreground"),children:l.importBatch.regionTab.replace("{index}",String(a+1))},a)),o.length<4&&(0,t.jsxs)(J.f,{type:"button",size:"sm",variant:"ghost",onClick:()=>{d(e=>[...e,ef(ep)]),u(o.length)},children:[(0,t.jsx)(c.f,{className:"mr-1 h-4 w-4"}),l.importBatch.addRegion]}),o.length>1&&(0,t.jsxs)(J.f,{type:"button",size:"sm",variant:"ghost",className:"text-destructive",onClick:()=>{d(e=>e.filter((e,t)=>t!==m)),u(0)},children:[(0,t.jsx)(R.f,{className:"mr-1 h-4 w-4"}),l.importBatch.removeRegion]})]}),(0,t.jsxs)("div",{className:"flex justify-end gap-2",children:[(0,t.jsx)(J.f,{type:"button",variant:"outline",onClick:s,children:l.common.cancel}),(0,t.jsx)(J.f,{type:"button",onClick:()=>{let e=o.map(eg).filter(e=>null!==e);e.length&&n(e)},children:l.importBatch.saveRegion})]})]})]})})}let eb={name:"check-check",size:24,node:[["path",{d:"M18 6 7 17l-5-5",key:"116fxf"}],["path",{d:"m22 10-7.5 7.5L13 16",key:"ke71qq"}]]};eb.node;let ej=(0,o.f)(eb);function ev({targetCount:e,pendingCount:a,fixing:i,onFix:r,onAcceptAll:s}){let{t:n}=(0,h.b)();return(0,t.jsxs)("div",{className:"space-y-1 rounded-lg border border-dashed p-3","data-testid":"text-fix-toolbar",children:[(0,t.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[(0,t.jsxs)(J.f,{type:"button",size:"sm",variant:"outline",onClick:r,disabled:i||0===e,children:[i?(0,t.jsx)(l.f,{className:"mr-1 h-4 w-4 animate-spin"}):(0,t.jsx)(M.f,{className:"mr-1 h-4 w-4"}),i?n.importBatch.fixText.running:n.importBatch.fixText.selected.replace("{count}",String(e))]}),a>0&&(0,t.jsxs)(J.f,{type:"button",size:"sm",onClick:s,children:[(0,t.jsx)(ej,{className:"mr-1 h-4 w-4"}),n.importBatch.fixText.acceptAll.replace("{count}",String(a))]})]}),(0,t.jsx)("p",{className:"text-xs text-muted-foreground",children:n.importBatch.fixText.hint})]})}var ek=e.i(61425),ew=e.i(810104),eN=e.i(294114),eB=e.i(201276),eC=e.i(575557),eS=e.i(213761);function ez({batch:e,draft:i,onEdit:r,onUndo:s,canUndo:o,saveState:d,image:u,confirmBeforeImport:x,starting:f,onStart:g,onDiscard:y,hasConflictCopy:b,onRestoreConflict:j,onDismissConflict:v}){let{t:k}=(0,h.b)(),w=e.source,[N,B]=(0,a.useState)(null),[C,S]=(0,a.useState)(null),[z,T]=(0,a.useState)(null),I=i.items.filter(e=>e.selected&&K(e,w)),M=i.items.length>0&&i.items.every(e=>e.selected||!K(e,w)),R=i.items.filter(e=>e.selected&&!K(e,w)).length,$=function(e,t,i){let{t:r}=(0,h.b)(),[s,n]=(0,a.useState)([]);return{fix:(0,a.useCallback)(async a=>{let s=t.items.filter(e=>a.includes(e.key)&&e.text.trim()).map(e=>({key:e.key,text:e.text}));if(0!==s.length){n(s.map(e=>e.key));try{let t=await (0,eC.$)(e,s);t.fixes.length>0&&i(e=>{let a,i,r;return a=new Map(t.fixes.map(e=>[e.key,e])),i=!1,r=e.items.map(e=>{let t=a.get(e.key);return t&&e.text===t.original&&t.text!==t.original?(i=!0,{...e,fix:{original:t.original,text:t.text,uncertain:t.uncertain}}):e}),i?ei(e,r):e});let a=[t.fixes.length>0?r.importBatch.fixText.done.replace("{count}",String(t.fixes.length)):null,t.unchanged.length>0?r.importBatch.fixText.unchanged.replace("{count}",String(t.unchanged.length)):null,t.failed.length>0?r.importBatch.fixText.failed.replace("{count}",String(t.failed.length)):null].filter(Boolean).join(" ");t.failed.length>0?eN.c.warning(a):eN.c.success(a)}catch(e){eB.V.error("[ImportBatch]","Text fix failed",{error:e}),eN.c.error((0,ek.f)(e,r))}finally{n([])}}},[e,t,i,r]),fixingKeys:s,fixing:s.length>0}}(e.id,i,r),E=function(e,t,i,r){let{t:s,language:n}=(0,h.b)(),l=(0,a.useRef)(null),c=(0,a.useRef)(null),[o,d]=(0,a.useState)(null),[m,u]=(0,a.useState)([]),x=async a=>{let l=a.target.files?.[0];a.target.value="";let o=i.items.find(e=>e.key===c.current);if(l&&o&&t){d(o.key);try{let a=await (0,eS.p)(l);try{let i=await (0,ew.y)(t),l=await (0,ew.k)(i,o.regions,a),c={...(0,eS.N)(a,l),sourceType:"continuation"},d=await (0,eC.v)({source:"image",imageBase64:l.dataUrl,imageInfo:c,language:n,subjectId:e.subjectId,targetSubjectId:e.targetSubjectId,paperLevel:e.paperLevel});r(e=>en(e,o.key)),u(e=>[...e,d.id]),eB.V.info("[ImportBatch]","Continuation batch created",{batchId:d.id,...c}),eN.c.success(s.importBatch.continuation.created)}finally{a.dispose()}}catch(e){eB.V.error("[ImportBatch]","Continuation failed",{error:e}),eN.c.error(e instanceof eS.o?s.upload.decodeErrors[e.code].replace("{format}",e.format.toUpperCase()):(0,ek.f)(e,s))}finally{d(null)}}};return{pick:e=>{c.current=e,l.current?.click()},busyKey:o,created:m,inputProps:{ref:l,onChange:e=>void x(e)}}}(e,u?.url??null,i,r),A="text"===w?i.items.filter(e=>e.fix&&e.fix.original===e.text).length:0,F="text"===w?I.filter(e=>!(e.fix&&e.fix.original===e.text)).map(e=>e.key):[];return(0,t.jsxs)("div",{className:"space-y-4 pb-36 md:pb-24",children:[(0,t.jsxs)("div",{className:"flex flex-wrap items-center justify-between gap-2",children:[(0,t.jsxs)("p",{className:"text-base font-semibold","data-testid":"draft-summary",children:[k.importBatch.detected.replace("{count}",String(i.items.length)),(0,t.jsx)("span",{className:"mx-2 text-muted-foreground",children:"·"}),k.importBatch.selected.replace("{count}",String(I.length))]}),(0,t.jsxs)("div",{className:"flex items-center gap-1",children:[(0,t.jsxs)("span",{className:"mr-2 flex items-center gap-1 text-xs text-muted-foreground","aria-live":"polite","data-testid":"draft-save-state","data-state":d,children:["saving"===d&&(0,t.jsx)(l.f,{className:"h-3 w-3 animate-spin"}),k.importBatch.save[d]]}),(0,t.jsxs)(J.f,{type:"button",size:"sm",variant:"ghost",disabled:!o,onClick:s,children:[(0,t.jsx)(m,{className:"mr-1 h-4 w-4"}),k.importBatch.undo]}),(0,t.jsx)(J.f,{type:"button",size:"sm",variant:"ghost",onClick:()=>r(e=>(function(e,t,a=()=>!0){return ei(e,e.items.map(e=>({...e,selected:t&&a(e)})))})(e,!M,e=>K(e,w))),children:M?k.importBatch.selectNone:k.importBatch.selectAll})]})]}),b&&(0,t.jsxs)("div",{className:"space-y-2 rounded-lg border border-primary/40 bg-primary/5 p-3 text-sm",role:"status","data-testid":"draft-conflict",children:[(0,t.jsx)("p",{children:k.importBatch.conflictKept}),(0,t.jsxs)("div",{className:"flex flex-wrap gap-2",children:[(0,t.jsx)(J.f,{type:"button",size:"sm",onClick:j,children:k.importBatch.restoreMine}),(0,t.jsx)(J.f,{type:"button",size:"sm",variant:"ghost",onClick:v,children:k.importBatch.discardMine})]})]}),"text"===w&&i.items.length>0&&(0,t.jsx)(ev,{targetCount:F.length,pendingCount:A,fixing:$.fixing,onFix:()=>void $.fix(F),onAcceptAll:()=>r(e=>ec(e))}),i.warnings.length>0&&(0,t.jsx)("ul",{className:"space-y-1 rounded-lg border border-amber-300 bg-amber-50 p-3 text-sm text-amber-900 dark:border-amber-700 dark:bg-amber-950/40 dark:text-amber-200",children:i.warnings.map(e=>(0,t.jsxs)("li",{className:"flex items-start gap-2",children:[(0,t.jsx)(n.f,{className:"mt-0.5 h-4 w-4 shrink-0"}),k.importBatch.warnings[e]]},e))}),(0,t.jsx)(p,{inputProps:E.inputProps,created:E.created}),u&&(0,t.jsx)(eu,{imageUrl:u.url,items:i.items,onSelectItem:e=>{S(e),B(e),document.getElementById(`draft-item-${e}`)?.scrollIntoView({behavior:"smooth",block:"center"})},highlightedKey:C}),0===i.items.length?(0,t.jsx)("p",{className:"rounded-xl border border-dashed p-6 text-center text-sm text-muted-foreground",children:k.importBatch.emptyDraft}):(0,t.jsx)("ol",{className:"space-y-3",children:i.items.map((e,a)=>{var s;return(0,t.jsx)(eo,{item:e,index:a,total:i.items.length,source:w,expanded:N===e.key,onToggleExpand:()=>B(t=>t===e.key?null:e.key),onEdit:r,image:u,onAdjustRegion:()=>T({key:e.key,regions:e.regions}),highlighted:C===e.key,onFixText:"text"===w?()=>void $.fix([e.key]):void 0,fixing:$.fixingKeys.includes(e.key),fixBusy:$.fixing,onContinue:u&&(s=i.items.length,e.regions.length>0&&(e.flags.includes("partial")||a===s-1))?()=>E.pick(e.key):void 0,continuing:E.busyKey===e.key},e.key)})}),u&&(0,t.jsxs)(J.f,{type:"button",variant:"outline",size:"sm",onClick:()=>T({key:null,regions:[]}),children:[(0,t.jsx)(c.f,{className:"mr-1 h-4 w-4"}),k.importBatch.addQuestion]}),(0,t.jsx)(em,{ignored:i.ignored,onRestore:e=>r(t=>(function(e,t){let a=e.ignored[t];if(void 0===a||e.items.length>=U.S)return e;let i={key:V(e.items.map(e=>e.key)),label:null,text:a,material:null,section:null,selected:!0,regions:[],hasFigure:!1,flags:[]};return{...e,items:[...e.items,i],ignored:e.ignored.filter((e,a)=>a!==t)}})(t,e))}),(0,t.jsx)(ed,{count:I.length,missingRegions:R,pendingFixes:A,confirmBeforeImport:x,starting:f,onStart:g,onDiscard:y}),u&&z&&(0,t.jsx)(ey,{open:!0,imageUrl:u.url,regions:z.regions,onClose:()=>T(null),onSave:e=>{let t=z.key;r(a=>t?es(a,t,{regions:e,selected:!0}):function(e,t){if(e.items.length>=U.S)return e;let a={key:V(e.items.map(e=>e.key)),label:null,text:"",material:null,section:null,selected:!0,regions:[t],hasFigure:!1,flags:[]};return{...e,items:[...e.items,a]}}(a,e[0])),T(null)}})]})}var eT=e.i(399847),eI=e.i(395925);function eM({batch:e,busy:a,onRetry:i,onDiscard:r}){let{t:s}=(0,h.b)(),n=s.errors,c=e.error?"string"==typeof n[e.error]?n[e.error]:e.error:null;return"splitting"===e.phase?(0,t.jsxs)("section",{className:"flex items-start gap-3 rounded-xl border bg-card p-4",role:"status","data-testid":"batch-splitting",children:[(0,t.jsx)(l.f,{className:"mt-0.5 h-5 w-5 shrink-0 animate-spin text-primary"}),(0,t.jsxs)("div",{className:"min-w-0 flex-1 space-y-2",children:[(0,t.jsx)("p",{className:"font-medium",children:s.importBatch.phase.splitting}),(0,t.jsx)("p",{className:"text-sm text-muted-foreground",children:s.importBatch.splittingHint}),(0,t.jsx)(J.f,{type:"button",size:"sm",variant:"ghost",onClick:r,children:s.importBatch.discard})]})]}):(0,t.jsxs)("section",{className:"flex items-start gap-3 rounded-xl border border-destructive/40 bg-card p-4","data-testid":"batch-failed",children:[(0,t.jsx)(eT.f,{className:"mt-0.5 h-5 w-5 shrink-0 text-destructive"}),(0,t.jsxs)("div",{className:"min-w-0 flex-1 space-y-2",children:[(0,t.jsx)("p",{className:"font-medium",children:s.importBatch.phase.failed}),c&&(0,t.jsx)("p",{className:"text-sm text-destructive",children:c}),"image"===e.source&&(0,t.jsx)("p",{className:"text-sm text-muted-foreground",children:s.importBatch.manualFallback}),(0,t.jsxs)("div",{className:"flex flex-wrap gap-2",children:[(0,t.jsxs)(J.f,{type:"button",size:"sm",onClick:i,disabled:a,children:[(0,t.jsx)(eI.f,{className:"mr-1 h-4 w-4"}),s.importBatch.retrySplit]}),(0,t.jsx)(J.f,{type:"button",size:"sm",variant:"ghost",onClick:r,children:s.importBatch.discard})]})]})]})}var eR=e.i(551757),e$=e.i(615568),eE=e.i(168148);let eA={analyzing:.5,saving:.9,review:1,saved:1,failed:1};function eF({task:e}){let{t:a}=(0,h.b)(),i=a.importBatch.itemStatus;if("saved"===e.status){let a=e.errorItemId?e.duplicate?i.duplicate:i.saved:i.deleted;return(0,t.jsxs)("span",{className:"flex items-center gap-1 text-green-700 dark:text-green-300",children:[(0,t.jsx)(eR.f,{className:"h-4 w-4"}),a]})}return"failed"===e.status?(0,t.jsxs)("span",{className:"flex items-center gap-1 text-destructive",children:[(0,t.jsx)(eT.f,{className:"h-4 w-4"}),i.failed]}):"review"===e.status?(0,t.jsxs)("span",{className:"flex items-center gap-1 text-primary",children:[(0,t.jsx)(e$.f,{className:"h-4 w-4"}),i.review]}):(0,t.jsxs)("span",{className:"flex items-center gap-1 text-muted-foreground",children:[(0,t.jsx)(l.f,{className:"h-4 w-4 animate-spin"}),i[e.status]]})}function eD({batch:e,image:a,busy:r,onRetryFailed:s,onRetryOne:n,onConfirmAll:l}){let{t:c}=(0,h.b)(),{counts:o}=e,d=o.total-o.active,m=o.total?Math.round(e.tasks.reduce((e,t)=>e+eA[t.status],0)/o.total*100):0,u=new Map((e.draft?.items??[]).map((e,t)=>[e.key,{item:e,index:t}])),x=c.errors;return(0,t.jsxs)("div",{className:"space-y-4",children:[(0,t.jsxs)("section",{className:"space-y-3 rounded-xl border bg-card p-4","data-testid":"batch-progress","data-phase":e.phase,children:[(0,t.jsxs)("div",{className:"flex flex-wrap items-baseline justify-between gap-2",children:[(0,t.jsx)("p",{className:"text-base font-semibold",children:c.importBatch.progress.replace("{done}",String(d)).replace("{total}",String(o.total))}),(0,t.jsx)("p",{className:"text-xs text-muted-foreground",children:c.importTasks.stageEstimate})]}),(0,t.jsx)(eE.f,{value:m,"aria-label":c.importTasks.stageEstimate,"aria-valuetext":c.common.progress.estimated.replace("{percent}",String(m)),className:"h-2"}),(0,t.jsxs)("ul",{className:"flex flex-wrap gap-x-4 gap-y-1 text-sm","data-testid":"batch-counts",children:[(0,t.jsx)("li",{className:"text-green-700 dark:text-green-300",children:c.importBatch.counts.saved.replace("{count}",String(o.saved-o.duplicate))}),o.duplicate>0&&(0,t.jsx)("li",{className:"text-muted-foreground",children:c.importBatch.counts.duplicate.replace("{count}",String(o.duplicate))}),o.review>0&&(0,t.jsx)("li",{className:"text-primary",children:c.importBatch.counts.review.replace("{count}",String(o.review))}),o.failed>0&&(0,t.jsx)("li",{className:"text-destructive",children:c.importBatch.counts.failed.replace("{count}",String(o.failed))}),o.active>0&&(0,t.jsx)("li",{className:"text-muted-foreground",children:c.importBatch.counts.active.replace("{count}",String(o.active))})]}),o.active>0&&(0,t.jsx)("p",{className:"text-xs text-muted-foreground",children:c.importBatch.leaveHint}),(0,t.jsxs)("div",{className:"flex flex-wrap gap-2",children:[o.failed>0&&(0,t.jsxs)(J.f,{type:"button",size:"sm",onClick:s,disabled:r,children:[(0,t.jsx)(eI.f,{className:"mr-1 h-4 w-4"}),c.importBatch.retryFailed.replace("{count}",String(o.failed))]}),o.review>0&&(0,t.jsx)(J.f,{type:"button",size:"sm",variant:"outline",onClick:l,disabled:r,children:c.importBatch.confirmAll.replace("{count}",String(o.review))})]})]}),(0,t.jsx)("ol",{className:"space-y-3",children:e.tasks.map(e=>{let s=u.get(e.batchItemKey??""),l=e.error?"string"==typeof x[e.error]?x[e.error]:e.error:null;return(0,t.jsxs)("li",{className:(0,G.f)("flex gap-3 rounded-xl border bg-card p-3 text-sm",e.unread&&"review"===e.status&&"border-primary/50"),"data-testid":"batch-task","data-status":e.status,children:[a&&s&&s.item.regions.length>0&&(0,t.jsx)(Q,{imageUrl:a.url,imageSize:a,regions:s.item.regions,className:"w-20 shrink-0 self-start sm:w-28"}),(0,t.jsxs)("div",{className:"min-w-0 flex-1 space-y-1",children:[(0,t.jsxs)("div",{className:"flex flex-wrap items-center justify-between gap-2",children:[(0,t.jsx)("span",{className:"font-medium",children:c.importBatch.question.replace("{index}",String((s?.index??0)+1))}),(0,t.jsx)(eF,{task:e})]}),(0,t.jsx)("p",{className:"line-clamp-2 break-words text-muted-foreground",children:e.excerpt||s?.item.text}),"saved"===e.status&&e.errorItemId&&!e.duplicate&&e.notebookName&&(0,t.jsx)("p",{className:"text-xs text-muted-foreground",children:c.importTasks.savedTo.replace("{notebook}",e.notebookName).replace("{id}",e.errorItemShortId||"-")}),l&&"failed"===e.status&&(0,t.jsx)("p",{className:"text-xs text-destructive",children:l}),(0,t.jsxs)("div",{className:"flex flex-wrap gap-2 pt-1",children:["review"===e.status&&(0,t.jsx)(J.f,{asChild:!0,size:"sm",children:(0,t.jsx)(i.default,{href:`/import-tasks/${e.id}`,children:c.importBatch.review})}),"saved"===e.status&&e.errorItemId&&(0,t.jsx)(J.f,{asChild:!0,size:"sm",variant:"outline",children:(0,t.jsx)(i.default,{href:`/error-items/${e.errorItemId}`,children:c.importBatch.viewItem})}),"failed"===e.status&&(0,t.jsxs)(J.f,{type:"button",size:"sm",variant:"outline",onClick:()=>n(e),disabled:r,children:[(0,t.jsx)(eI.f,{className:"mr-1 h-3 w-3"}),c.importTasks.retry]})]})]})]},e.id)})})]})}var eH=e.i(912505),eU=e.i(393842),eq=e.i(86963),e_=e.i(116331),eL=e.i(35209),eO=e.i(364002);e.s(["default",0,function(){let e=(0,r.useParams)(),n=(0,r.useRouter)(),l=e.id,{t:c}=(0,h.b)();(0,eL.f)(c.importBatch.title);let o=function(e,t={}){let[i,r]=(0,a.useState)(null),[s,n]=(0,a.useState)(!1),[l,c]=(0,a.useState)(null),[o,d]=(0,a.useState)("saved"),m=(0,a.useRef)([]),[u,x]=(0,a.useState)(!1),h=(0,a.useRef)(0),p=(0,a.useRef)(0),f=(0,a.useRef)(0),g=(0,a.useRef)(null),y=(0,a.useRef)(null),b=(0,a.useRef)(null),j=(0,a.useRef)(async()=>!0),[v,k]=(0,a.useState)(null),w=(0,a.useRef)(t.onConflict);(0,a.useEffect)(()=>{w.current=t.onConflict},[t.onConflict]);let N=(0,a.useCallback)((e,t=!1)=>{r(t=>t&&!e.imageData&&t.imageData&&t.id===e.id?{...e,imageData:t.imageData}:e);let a=p.current!==f.current;(t||!a||"draft"!==e.status)&&(null!==g.current&&e.version!==h.current&&(m.current=[],x(!1)),h.current=e.version,g.current=e.draft,c(e.draft),f.current=p.current,d("saved"))},[]),B=(0,a.useCallback)(async()=>{if("u"<typeof document||"hidden"!==document.visibilityState)try{N(await (0,eC.w)(e)),n(!1)}catch(e){e?.status===404&&n(!0)}},[e,N]);(0,a.useEffect)(()=>{let t=!1;(0,eC.w)(e,{image:!0}).then(e=>{t||N(e,!0)}).catch(e=>{t||e?.status!==404||n(!0)});let a=(0,e_.E)(()=>void B());return()=>{t=!0,a()}},[e,N,B]);let C=i?.phase==="splitting"||i?.phase==="processing";(0,a.useEffect)(()=>{if(!C)return;let e=setInterval(()=>void B(),2500);return()=>clearInterval(e)},[C,B]);let S=(0,a.useCallback)(async()=>{let t=p.current;d("saving");try{let a=await (0,eC.S)(e,h.current,g.current);return h.current=a.version,f.current=t,r(e=>e?{...a,imageData:e.imageData}:a),d(p.current===t?"saved":"dirty"),"ok"}catch(t){let e=(0,eC.n)(t);if(e){let t=g.current;return"draft"===e.status&&t&&k(t),N(e,!0),w.current?.(),"conflict"}return d("error"),b.current&&clearTimeout(b.current),b.current=setTimeout(()=>void j.current(),5e3),"error"}},[e,N]),z=(0,a.useCallback)(async()=>{for(b.current&&(clearTimeout(b.current),b.current=null);;){let e=y.current??(y.current=(async()=>{try{for(;p.current!==f.current&&g.current;)if(await S()!=="ok")return!1;return!0}finally{y.current=null}})());if(!await e)return!1;if(p.current===f.current)return!0}},[S]);(0,a.useEffect)(()=>{j.current=z},[z]),(0,a.useEffect)(()=>{let e=()=>{"hidden"===document.visibilityState&&p.current!==f.current&&z()};return document.addEventListener("visibilitychange",e),window.addEventListener("pagehide",e),()=>{document.removeEventListener("visibilitychange",e),window.removeEventListener("pagehide",e)}},[z]),(0,a.useEffect)(()=>()=>{b.current&&clearTimeout(b.current)},[]);let T=(0,a.useCallback)(e=>{g.current=e,c(e),p.current+=1,d("dirty"),b.current&&clearTimeout(b.current),b.current=setTimeout(()=>void z(),800)},[z]),I=(0,a.useRef)(null),M=(0,a.useCallback)((e,t)=>{let a=g.current;if(!a)return;let i=e(a);if(i===a)return;let r=Date.now(),s=t&&I.current?.group===t&&r-I.current.at<1500;I.current=t?{group:t,at:r}:null,s||(m.current=[...m.current.slice(-29),a],x(!0)),T(i)},[T]),R=(0,a.useCallback)(()=>{let e=m.current.pop();I.current=null,x(m.current.length>0),e&&T(e)},[T]),$=(0,a.useCallback)(()=>{k(null),v&&M(()=>v)},[v,M]);return{batch:i,draft:l,notFound:s,saveState:o,refresh:B,save:z,edit:M,undo:R,canUndo:u,conflictCopy:v,restoreConflictCopy:$,dismissConflictCopy:()=>k(null),version:()=>h.current,replace:e=>N(e,!0)}}(l,{onConflict:()=>eN.c.info(c.importBatch.conflict)}),{batch:d,draft:m,notFound:u}=o,x=function(e){let[t,i]=(0,a.useState)(null);return(0,a.useEffect)(()=>{if(!e)return;let t=!1,a=new Image;return a.onload=()=>{t||i({url:e,width:a.naturalWidth,height:a.naturalHeight})},a.src=e,()=>{t=!0}},[e]),t&&t.url===e?t:null}(d?.source==="image"?d.imageData:null),[p,f]=(0,a.useState)(null),[g,y]=(0,a.useState)(null),[b,j]=(0,a.useState)(!1),v=(0,a.useRef)(null);if((0,a.useEffect)(()=>{(0,eO.x)().then(f)},[]),(0,a.useEffect)(()=>{d?.unread&&v.current!==`${d.id}:${d.phase}:${d.counts.active}`&&(v.current=`${d.id}:${d.phase}:${d.counts.active}`,(0,eC.f)(d.id).catch(e=>eB.V.warn("[ImportBatch]","Mark read failed",{error:e})))},[d]),u)return(0,t.jsx)("main",{className:"mx-auto max-w-3xl px-4 py-6 md:px-8 md:py-8",children:(0,t.jsx)(eH.f,{icon:s.f,title:c.importBatch.notFound,action:(0,t.jsx)(i.default,{href:"/import-tasks",children:(0,t.jsx)(J.f,{children:c.importTasks.viewTasks})})})});if(!d||null===p||"image"===d.source&&"draft"===d.status&&!x)return(0,t.jsx)(eq.f,{});let k=async e=>{j(!0);try{await e()}catch(t){let e=(0,eC.n)(t);e?(o.replace(e),eN.c.info(c.importBatch.conflict)):eN.c.error((0,ek.f)(t,c))}finally{j(!1)}},w=async()=>{if(m){y(c.importBatch.submitting);try{let e;if(!await o.save())return;if("image"===d.source){if(!d.imageData)throw Error("IMAGE_EMPTY");let t=await (0,ew.y)(d.imageData),a=m.items.filter(e=>e.selected&&K(e,"image"));e=[];let i=0;for(let r of a){y(c.importBatch.cropping.replace("{done}",String(e.length+1)).replace("{total}",String(a.length)));let s=await (0,ew.M)(t,r.regions);i+=s.bytes,e.push({key:r.key,imageBase64:s.dataUrl,imageInfo:{outputWidth:s.width,outputHeight:s.height,outputBytes:s.bytes,quality:s.quality}})}if(e.reduce((e,t)=>e+t.imageBase64.length,0)>0x3c00000)return void eN.c.error(c.errors.IMPORT_BATCH_TOO_LARGE);y(c.importBatch.uploadingImages.replace("{count}",String(e.length)).replace("{size}",`${(i/1024/1024).toFixed(1)}MB`))}o.replace(await (0,eC.g)(d.id,o.version(),e)),window.scrollTo({top:0})}catch(t){eB.V.error("[ImportBatch]","Start failed",{error:t});let e=(0,eC.n)(t);e?(o.replace(e),eN.c.info(c.importBatch.conflict)):eN.c.error((0,ek.f)(t,c))}finally{y(null)}}},N=async()=>{await (0,eN.u)(c.importBatch.discardConfirm)&&await k(async()=>{await (0,eC.o)(d.id),eN.c.success(c.importBatch.discarded),n.push("/import-tasks")})},B=()=>k(async()=>{o.replace(await (0,eC.s)(d.id)),eN.c.info(c.importTasks.retried)}),C=`${c.importBatch.source[d.source]} \xb7 ${c.importBatch.phase[d.phase]}`;return(0,t.jsxs)("main",{className:"mx-auto max-w-4xl space-y-4 px-4 py-6 md:px-8 md:py-8",children:[(0,t.jsx)(eU.f,{backHref:"/import-tasks",title:c.importBatch.title,description:C}),"splitting"===d.phase||"failed"===d.phase?(0,t.jsx)(eM,{batch:d,busy:b,onRetry:B,onDiscard:N}):"draft"===d.status&&m?(0,t.jsx)(ez,{batch:d,draft:m,onEdit:o.edit,onUndo:o.undo,canUndo:o.canUndo,saveState:o.saveState,image:x,confirmBeforeImport:p,starting:g,onStart:w,onDiscard:N,hasConflictCopy:!!o.conflictCopy,onRestoreConflict:o.restoreConflictCopy,onDismissConflict:o.dismissConflictCopy}):(0,t.jsx)(eD,{batch:d,image:x,busy:b,onRetryFailed:B,onRetryOne:e=>k(async()=>{await (0,e_.R)(e.id),eN.c.info(c.importTasks.retried),await o.refresh()}),onConfirmAll:()=>k(async()=>{let e=await (0,eC.J)(d.id);o.replace(e.batch),eN.c.success(c.importBatch.confirmAllDone.replace("{count}",String(e.saved)))})})]})}],864272)}]);
|