wrong-notebook 2026.11.1 → 2026.11.2-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 +1 -0
- package/.next/build-manifest.json +3 -3
- package/.next/prerender-manifest.json +3 -3
- package/.next/routes-manifest.json +6 -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/app-paths-manifest.json +3 -0
- package/.next/server/app/api/admin/cnm-tags/route/build-manifest.json +12 -0
- package/.next/server/app/api/admin/cnm-tags/route/server-reference-manifest.json +4 -0
- package/.next/server/app/api/admin/cnm-tags/route.js +12 -0
- package/.next/server/app/api/admin/cnm-tags/route.js.map +5 -0
- package/.next/server/app/api/admin/cnm-tags/route.js.nft.json +1 -0
- package/.next/server/app/api/admin/cnm-tags/route_client-reference-manifest.js +3 -0
- package/.next/server/app/api/admin/dashboard/route.js +10 -10
- package/.next/server/app/api/admin/dashboard/route.js.nft.json +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.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 +10 -10
- 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.nft.json +1 -1
- package/.next/server/app/api/ai/models/route.js +4 -4
- package/.next/server/app/api/ai/models/route.js.nft.json +1 -1
- package/.next/server/app/api/ai/test/route.js +8 -8
- package/.next/server/app/api/ai/test/route.js.nft.json +1 -1
- package/.next/server/app/api/analytics/route.js +8 -8
- package/.next/server/app/api/analytics/route.js.nft.json +1 -1
- package/.next/server/app/api/analyze/route.js +4 -4
- 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 +10 -10
- 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 +7 -7
- 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 +13 -13
- 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.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 +10 -10
- 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 +9 -9
- 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.nft.json +1 -1
- package/.next/server/app/api/error-items/[id]/svg-animation/narration/route.js +10 -10
- 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 +10 -10
- package/.next/server/app/api/error-items/[id]/svg-animation/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.nft.json +1 -1
- package/.next/server/app/api/error-items/route.js +12 -12
- 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.nft.json +1 -1
- package/.next/server/app/api/exams/[id]/questions/[questionId]/regenerate/route.js +13 -13
- 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 +10 -10
- package/.next/server/app/api/exams/[id]/results/route.js.nft.json +1 -1
- package/.next/server/app/api/exams/[id]/retry/route.js +9 -9
- package/.next/server/app/api/exams/[id]/retry/route.js.nft.json +1 -1
- package/.next/server/app/api/exams/[id]/route.js +13 -13
- package/.next/server/app/api/exams/[id]/route.js.nft.json +1 -1
- package/.next/server/app/api/exams/route.js +12 -12
- package/.next/server/app/api/exams/route.js.nft.json +1 -1
- package/.next/server/app/api/export/route.js.nft.json +1 -1
- package/.next/server/app/api/geogebra-analyze/route.js +6 -6
- 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 +13 -13
- package/.next/server/app/api/import/route.js.nft.json +1 -1
- 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.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.nft.json +1 -1
- package/.next/server/app/api/notebooks/[id]/retag/route.js +12 -12
- 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.nft.json +1 -1
- package/.next/server/app/api/openclaw/batch-upload/route.js +8 -8
- package/.next/server/app/api/openclaw/batch-upload/route.js.nft.json +1 -1
- package/.next/server/app/api/paper-groups/[id]/route.js +1 -1
- package/.next/server/app/api/paper-groups/[id]/route.js.nft.json +1 -1
- package/.next/server/app/api/paper-groups/route.js.nft.json +1 -1
- package/.next/server/app/api/practice/generate/route.js +9 -9
- package/.next/server/app/api/practice/generate/route.js.nft.json +1 -1
- package/.next/server/app/api/practice/grade/route.js +6 -6
- package/.next/server/app/api/practice/grade/route.js.nft.json +1 -1
- package/.next/server/app/api/practice/record/[id]/route.js +10 -10
- package/.next/server/app/api/practice/record/[id]/route.js.nft.json +1 -1
- package/.next/server/app/api/practice/record/route.js +10 -10
- package/.next/server/app/api/practice/record/route.js.nft.json +1 -1
- package/.next/server/app/api/reanswer/route.js +4 -4
- package/.next/server/app/api/reanswer/route.js.nft.json +1 -1
- package/.next/server/app/api/register/route.js.nft.json +1 -1
- package/.next/server/app/api/register/status/route.js.nft.json +1 -1
- package/.next/server/app/api/requests/[id]/route.js.nft.json +1 -1
- package/.next/server/app/api/review/due/route.js +8 -8
- package/.next/server/app/api/review/due/route.js.nft.json +1 -1
- package/.next/server/app/api/settings/route.js.nft.json +1 -1
- package/.next/server/app/api/setup/route.js.nft.json +1 -1
- package/.next/server/app/api/stats/practice/clear/route.js.nft.json +1 -1
- package/.next/server/app/api/stats/practice/route.js.nft.json +1 -1
- 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.nft.json +1 -1
- package/.next/server/app/api/tts/batch/route.js +6 -6
- package/.next/server/app/api/tts/batch/route.js.nft.json +1 -1
- package/.next/server/app/api/tts/route.js +5 -5
- package/.next/server/app/api/tts/route.js.nft.json +1 -1
- package/.next/server/app/api/tts/status/route.js +4 -4
- package/.next/server/app/api/tts/status/route.js.nft.json +1 -1
- package/.next/server/app/api/user/route.js +9 -9
- package/.next/server/app/api/user/route.js.nft.json +1 -1
- package/.next/server/app/api/version/route.js.nft.json +1 -1
- package/.next/server/app/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/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 +1 -0
- package/.next/server/chunks/{[root-of-the-server]__1xyydo-zlm13-._.js → [root-of-the-server]__00jyo3io99_dn._.js} +2 -2
- package/.next/server/chunks/[root-of-the-server]__02dkbynj2vxld._.js +1 -1
- package/.next/server/chunks/{[root-of-the-server]__0z24ffpp1rsf3._.js → [root-of-the-server]__08t21dbk1cidn._.js} +1 -1
- package/.next/server/chunks/[root-of-the-server]__09jqnx_673l93._.js +1 -1
- package/.next/server/chunks/[root-of-the-server]__0_uvtfu0yr-na._.js +1 -1
- package/.next/server/chunks/[root-of-the-server]__0nujsu6qbn-8o._.js +1 -1
- package/.next/server/chunks/[root-of-the-server]__0tflqqgyujt1r._.js +3 -0
- package/.next/server/chunks/[root-of-the-server]__13_k7w8nrx7ie._.js +1 -1
- package/.next/server/chunks/{[root-of-the-server]__0ibwwrznwebhg._.js → [root-of-the-server]__142g4s902bza-._.js} +1 -1
- package/.next/server/chunks/[root-of-the-server]__18z_cczwqkonn._.js +1 -1
- package/.next/server/chunks/{[root-of-the-server]__0rpqerm37sl_v._.js → [root-of-the-server]__1f_lrxzw_n-6-._.js} +1 -1
- package/.next/server/chunks/[root-of-the-server]__1ptzu7aqoga2n._.js +1 -1
- package/.next/server/chunks/[root-of-the-server]__1r0s6pktkiqkf._.js +3 -0
- package/.next/server/chunks/[root-of-the-server]__1r_x7moz0opqt._.js +3 -0
- package/.next/server/chunks/{[root-of-the-server]__1mfrik5p09lu9._.js → [root-of-the-server]__1sggr1m3ukvts._.js} +1 -1
- package/.next/server/chunks/[root-of-the-server]__1v1p83o4ygnyt._.js +1 -1
- package/.next/server/chunks/[root-of-the-server]__1wh65tfd7apxx._.js +3 -0
- package/.next/server/chunks/_0dicq393_0h3i._.js +3 -0
- package/.next/server/chunks/{_0jgk7kwvf4_6i._.js → _0x3jdlmx-bey5._.js} +1 -1
- package/.next/server/chunks/_10tpt8iizl4v3._.js +3 -3
- package/.next/server/chunks/_1dvka-waihfum._.js +3 -3
- package/.next/server/chunks/_1upqhtax8p96-._.js +3 -0
- package/.next/server/chunks/_1yujnc0thk8ab._.js +3 -0
- package/.next/server/chunks/_next-internal_server_app_api_admin_cnm-tags_route_actions_1en5m631bmjfo.js +3 -0
- package/.next/server/chunks/src_lib_0r67kyyoh6ky6._.js +1 -1
- package/.next/server/chunks/src_lib_1_m3-y2t3e4xi._.js +46 -42
- package/.next/server/chunks/src_lib_1geq39r7va9gy._.js +1 -1
- package/.next/server/chunks/src_lib_logger_ts_1a0ve505bb0y2._.js +1 -1
- package/.next/server/chunks/ssr/[root-of-the-server]__0fy6mc47ccfce._.js +1 -1
- package/.next/server/chunks/ssr/_02zfjls23g-o4._.js +1 -1
- package/.next/server/chunks/ssr/_09y2uhjubswp4._.js +1 -1
- package/.next/server/chunks/ssr/_0cmd1ubdlo_by._.js +1 -1
- package/.next/server/chunks/ssr/_0ltqx22v65imo._.js +1 -1
- package/.next/server/chunks/ssr/_0lzeodofsq9pe._.js +1 -1
- package/.next/server/chunks/ssr/_0ozptnii2nxuw._.js +1 -1
- package/.next/server/chunks/ssr/_0rd-teluypcd2._.js +1 -1
- package/.next/server/chunks/ssr/_0tr-7klbcz1r7._.js +3 -0
- package/.next/server/chunks/ssr/_1-i5cy964i_s9._.js +3 -0
- package/.next/server/chunks/ssr/_10stgw6io7x93._.js +3 -0
- package/.next/server/chunks/ssr/_1cc3psc9rvrwn._.js +1 -1
- package/.next/server/chunks/ssr/_1hp7fzio98dms._.js +3 -0
- package/.next/server/chunks/ssr/_1qgg_ll5hkjaf._.js +5 -2
- package/.next/server/chunks/ssr/_1ux6eqqkupo6v._.js +5 -2
- package/.next/server/chunks/ssr/node_modules_lucide-react_dist_esm_icons_play_mjs_1al5hft92dlrg._.js +1 -1
- package/.next/server/chunks/ssr/src_1gayunqs8u2e2._.js +1 -1
- package/.next/server/chunks/ssr/src_app_admin_page_tsx_0ublbd0w90cx_._.js +1 -1
- package/.next/server/chunks/ssr/src_app_admin_user_[id]_page_tsx_0zidp-8hr5upa._.js +1 -1
- package/.next/server/chunks/ssr/src_app_error-items_[id]_page_tsx_04xwwdmyh7_9q._.js +1 -1
- package/.next/server/chunks/ssr/src_app_exams_[id]_page_tsx_0xcjflkgkwzgd._.js +1 -1
- package/.next/server/chunks/ssr/src_app_exams_[id]_print_page_tsx_1i-xvhk8ul1l1._.js +9 -9
- package/.next/server/chunks/ssr/src_app_exams_page_tsx_17_d4_gy2i1ds._.js +1 -1
- package/.next/server/chunks/ssr/src_app_notebooks_[id]_add_page_tsx_179tow1ql6vc_._.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_notebooks_page_tsx_1p9src5gnz_40._.js +1 -1
- package/.next/server/chunks/ssr/src_app_page_tsx_1chiuahujsxm1._.js +1 -1
- package/.next/server/chunks/ssr/src_app_practice_page_tsx_10gnx53v3kpzb._.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_app_register_page_tsx_0l87b3754fa2j._.js +1 -1
- package/.next/server/chunks/ssr/src_app_review_page_tsx_1rq4ygvo_szv0._.js +1 -1
- package/.next/server/chunks/ssr/src_app_setup_page_tsx_0szlnxow_9skp._.js +1 -1
- package/.next/server/chunks/ssr/src_components_1od0rowgu8w6v._.js +1 -1
- package/.next/server/chunks/ssr/src_components_create-notebook-dialog_tsx_0c5teagim70r7._.js +1 -1
- package/.next/server/chunks/ssr/src_components_mastery-panel_tsx_1--j5c7mhomdp._.js +1 -1
- package/.next/server/chunks/ssr/src_components_print-preview_answer-space-control_tsx_02kuswyxklzp_._.js +33 -0
- package/.next/server/chunks/ssr/src_components_providers_tsx_09kw-mv3nb6xs._.js +73 -17
- package/.next/server/chunks/ssr/src_components_tag-input_tsx_0b9sxffna5c9i._.js +1 -1
- package/.next/server/chunks/ssr/src_lib_api-client_ts_04r2_ex-gua5i._.js +1 -1
- package/.next/server/chunks/ssr/src_lib_short-id-client_ts_1v7n6pg50kguj._.js +1 -1
- package/.next/server/middleware-build-manifest.js +3 -3
- package/.next/server/pages/500.html +1 -1
- package/.next/server/preview-props.json +3 -3
- package/.next/server/server-reference-manifest.js +1 -1
- package/.next/server/server-reference-manifest.json +1 -1
- package/.next/static/chunks/{42p60iwe4ayfi.js → 06bfusm1eqhzt.js} +1 -1
- package/.next/static/chunks/{1oqx_8e83xfjr.js → 0fu1xttg42yzk.js} +1 -1
- package/.next/static/chunks/0mp9tvylhyxid.js +1 -0
- package/.next/static/chunks/{1wq7na8axxyfd.js → 0nq5_ne_bugdp.js} +1 -1
- package/.next/static/chunks/0xuzdy0dn7jkp.js +63 -0
- package/.next/static/chunks/{1dyf1qqv2ckxs.js → 1-00icoq9w3_i.js} +1 -1
- package/.next/static/chunks/{2r4x8vhlmc092.js → 1b5jj8zk0mtzk.js} +1 -1
- package/.next/static/chunks/{3fohh6i-hrda9.js → 1d-3q230sjpsa.js} +1 -1
- package/.next/static/chunks/{1gvev34tv39bd.js → 1fa2xv93zl8oj.js} +1 -1
- package/.next/static/chunks/{370c45nip4mld.js → 1g13qcek7-0du.js} +1 -1
- package/.next/static/chunks/{10xs8eu3rd2lt.js → 1ou17klnb8gu_.js} +1 -1
- package/.next/static/chunks/{1sjf69friyuwh.js → 1pdlii0oox0-7.js} +1 -1
- package/.next/static/chunks/{2hihgd7vu8tw5.js → 1z_0hbg6kxv58.js} +1 -1
- package/.next/static/chunks/21v7--q2m3c4_.js +1 -0
- package/.next/static/chunks/22gdddnfj38h6.js +1 -0
- package/.next/static/chunks/2btkflolmab19.css +3 -0
- package/.next/static/chunks/{41j6vve1unchm.js → 2cfz0fumc6ghe.js} +1 -1
- package/.next/static/chunks/2dml0yrklxocr.js +31 -0
- package/.next/static/chunks/2hjp9cnvepyzy.js +247 -0
- package/.next/static/chunks/{2h1-bjeib7r-u.js → 2mu8zu6zd59z2.js} +1 -1
- package/.next/static/chunks/{09z8ds-9g-ble.js → 2urhwgx3nt7lq.js} +1 -1
- package/.next/static/chunks/{1c36uw_9rc8oc.js → 2xibor-sxcc67.js} +1 -1
- package/.next/static/chunks/{31pvc0nv10j93.js → 3-w46lg1a_qse.js} +1 -1
- package/.next/static/chunks/{0zj83pnid72u3.js → 34lp-hkkywd8r.js} +1 -1
- package/.next/static/chunks/3_e_larybjcr5.js +1 -0
- package/.next/static/chunks/3au-yz7ullfnr.js +9 -0
- package/.next/static/chunks/{0lwd5-772ng4i.js → 3difxy8vzqlxn.js} +1 -1
- package/.next/static/chunks/3zs0fu6zcu0lb.js +1 -0
- package/dist-scripts/src/lib/debug-log.js +6 -6
- package/package.json +1 -1
- package/prisma/seed.db +0 -0
- package/.next/server/chunks/_008zx49yrqg5a._.js +0 -3
- package/.next/server/chunks/ssr/_037_l3ca0s_0m._.js +0 -3
- package/.next/server/chunks/ssr/_0_snnfou-vj50._.js +0 -3
- package/.next/server/chunks/ssr/_19-9r85m2zwkm._.js +0 -3
- package/.next/server/chunks/ssr/_1b5bo2mgv9_4a._.js +0 -3
- package/.next/static/chunks/0i1q2hqzk7ojc.css +0 -3
- package/.next/static/chunks/24mest-vas-bu.js +0 -33
- package/.next/static/chunks/25emavlvjqnb_.js +0 -6
- package/.next/static/chunks/26-0j9v7hswqr.js +0 -1
- package/.next/static/chunks/2ju2bi0z49pn1.js +0 -1
- package/.next/static/chunks/2p9s6dcxnj129.js +0 -1
- package/.next/static/chunks/2qvnb2d_gv2o5.js +0 -1
- package/.next/static/chunks/2rx6yjo9suvmj.js +0 -1
- package/.next/static/chunks/2zgqd5dt_6z_7.js +0 -1
- package/.next/static/chunks/3cyz6w014ooxj.js +0 -191
- /package/.next/static/{6sBeEDpD-TPpDMfiFpz9K → jqVIU6HRwaZt62YD8QH_p}/_buildManifest.js +0 -0
- /package/.next/static/{6sBeEDpD-TPpDMfiFpz9K → jqVIU6HRwaZt62YD8QH_p}/_clientMiddlewareManifest.js +0 -0
- /package/.next/static/{6sBeEDpD-TPpDMfiFpz9K → jqVIU6HRwaZt62YD8QH_p}/_ssgManifest.js +0 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
(()=>{"use strict";(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,367784,699375,e=>{var s=e.i(456420);let i={name:"log-out",size:24,node:[["path",{d:"m16 17 5-5-5-5",key:"1bji2h"}],["path",{d:"M21 12H9",key:"dn1m92"}],["path",{d:"M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4",key:"1uf3rs"}]]};i.node;let t=(0,s.f)(i);e.s(["f",0,t],367784);var n=e.i(843476),a=e.i(271645),r=e.i(981140),l=e.i(820783),o=e.i(30030),c=e.i(369340),d=e.i(635804),m=e.i(248425),p=Object.defineProperty,u=(e,s)=>p(e,"name",{value:s,configurable:!0}),h="Switch",[x,f]=(0,o.f)(h),[g,v]=x(h);function j(e){let{__scopeSwitch:s,checked:i,children:t,defaultChecked:r,disabled:l,form:o,name:d,onCheckedChange:m,required:p,value:u="on",internal_do_not_use_render:x}=e,[f,v]=(0,c.f)({prop:i,defaultProp:r??!1,onChange:m,caller:h}),[j,y]=a.useState(null),[b,N]=a.useState(null),[k,C]=a.useState(null),S=!j||!!o||!!j.closest("form"),U={checked:f,setChecked:v,disabled:l,control:j,setControl:y,name:d,form:o,value:u,userClick:k,onUserClick:C,required:p,defaultChecked:r,isFormControl:S,bubbleInput:b,setBubbleInput:N};return(0,n.jsx)(g,{scope:s,...U,children:w(x)?x(U):t})}u(j,"SwitchProvider");var y=a.forwardRef(u(function({__scopeSwitch:e,onClick:s,...i},t){let{control:o,form:c,value:d,disabled:p,checked:h,required:x,setControl:f,setChecked:g,onUserClick:j,isFormControl:y,bubbleInput:b}=v("SwitchTrigger",e),N=(0,l.f)(t,f),k=a.useRef(h);return a.useEffect(()=>{let e=c?o?.ownerDocument.getElementById(c):o?.form;if(e instanceof HTMLFormElement){let s=u(()=>g(k.current),"reset");return e.addEventListener("reset",s),()=>e.removeEventListener("reset",s)}},[o,c,g]),(0,n.jsx)(m.V.button,{type:"button",role:"switch","aria-checked":h,"aria-required":x,"data-state":C(h),"data-disabled":p?"":void 0,disabled:p,value:d,...i,ref:N,onClick:(0,r.f)(s,e=>{let s=e.isPropagationStopped();j({requestedChecked:!h,hasConsumerStoppedPropagation:s}),g(e=>!e),b&&y&&!s&&e.stopPropagation()})})},"SwitchTrigger")),b=a.forwardRef(u(function(e,s){let{__scopeSwitch:i,name:t,checked:a,defaultChecked:r,required:l,disabled:o,value:c,onCheckedChange:d,form:m,...p}=e;return(0,n.jsx)(j,{__scopeSwitch:i,checked:a,defaultChecked:r,disabled:o,required:l,onCheckedChange:d,name:t,form:m,value:c,internal_do_not_use_render:({isFormControl:e})=>(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(y,{...p,ref:s,__scopeSwitch:i}),e&&(0,n.jsx)(k,{__scopeSwitch:i})]})})},"Switch")),N=a.forwardRef(u(function(e,s){let{__scopeSwitch:i,...t}=e,a=v("SwitchThumb",i);return(0,n.jsx)(m.V.span,{"data-state":C(a.checked),"data-disabled":a.disabled?"":void 0,...t,ref:s})},"SwitchThumb")),k=a.forwardRef(u(function({__scopeSwitch:e,onClick:s,...i},t){let{control:o,userClick:c,checked:p,defaultChecked:u,required:h,disabled:x,name:f,value:g,form:j,bubbleInput:y,setBubbleInput:b}=v("SwitchBubbleInput",e),N=(0,l.f)(t,b),k=(0,d.f)(o),w=a.useRef(!1),C=a.useRef(p),S=a.useRef(c),U=a.useRef(null);a.useEffect(()=>{if(!y)return;let e=Object.getOwnPropertyDescriptor(window.HTMLInputElement.prototype,"checked").set;if(!e)return;let s=C.current!==p;C.current=p;let i=null!==c&&c!==S.current;if(S.current=c,i)U.current=s?null:c,s&&e.call(y,p),y.dispatchEvent(new Event("click",{bubbles:!c.hasConsumerStoppedPropagation}));else if(s){let s=U.current;U.current=null;let i=s?.requestedChecked===p;w.current=!0,e.call(y,p),y.dispatchEvent(new Event("click",{bubbles:!(i&&s.hasConsumerStoppedPropagation)})),w.current=!1}},[y,p,c]);let K=a.useRef(p);return(0,n.jsx)(m.V.input,{type:"checkbox","aria-hidden":!0,defaultChecked:u??K.current,required:h,disabled:x,name:f,value:g,form:j,...i,tabIndex:-1,ref:N,onClick:(0,r.f)(s,e=>{w.current&&e.stopPropagation()}),style:{...i.style,...k,position:"absolute",pointerEvents:"none",opacity:0,margin:0,transform:"translateX(-100%)"}})},"SwitchBubbleInput"));function w(e){return"function"==typeof e}function C(e){return e?"checked":"unchecked"}u(w,"isFunction"),u(C,"getState");var S=e.i(975157);let U=a.forwardRef(({className:e,...s},i)=>(0,n.jsx)(b,{className:(0,S.f)("peer inline-flex h-5 w-9 shrink-0 cursor-pointer items-center rounded-full border-2 border-transparent shadow-sm transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-primary data-[state=unchecked]:bg-input",e),...s,ref:i,children:(0,n.jsx)(N,{className:(0,S.f)("pointer-events-none block h-4 w-4 rounded-full bg-background shadow-lg ring-0 transition-transform data-[state=checked]:translate-x-4 data-[state=unchecked]:translate-x-0")})}));U.displayName=b.displayName,e.s(["f",0,U],699375)},713452,551757,753817,128093,e=>{var s=e.i(843476),i=e.i(271645),t=e.i(456420);let n={name:"circle-check",size:24,node:[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m16 9-5.5 5.5L8 12",key:"xofnsj"}]],aliases:["check-circle-2"]};n.node;let a=(0,t.f)(n);e.s(["f",0,a],551757);var r=e.i(632781),l=e.i(583967);let o={name:"zap",size:24,node:[["path",{d:"M15.914 4a1.5 1.5 0 00-2.474-1.561l-9 9A1.5 1.5 0 005.5 14h4.002a.5.5 0 01.471.666L8.086 20a1.5 1.5 0 002.475 1.56l9-9A1.5 1.5 0 0018.5 10h-3.997a.5.5 0 01-.472-.667z",key:"1v7up4"}]]};o.node;let c=(0,t.f)(o);var d=e.i(519455),m=e.i(111110);function p({detail:e}){let{t:i}=(0,m.b)();return e?(0,s.jsxs)("p",{className:"mt-1 rounded bg-background/60 px-2 py-1 font-mono text-[11px] leading-relaxed text-red-700 dark:text-red-300 break-all select-text",children:[(0,s.jsx)("span",{className:"font-sans text-muted-foreground",children:i.settings.ai.providerErrorDetail}),e]}):null}e.s(["f",0,p],753817);let u={minimax:{name:"MiniMax",nameEn:"MiniMax",baseUrl:"https://api.minimax.cn/v1",model:"MiniMax-M3.1-Flash",envPrefix:"MINIMAX",consoleUrl:"https://platform.minimax.cn",docs:{cn:"https://platform.minimax.cn/docs/api-reference/api-overview",intl:"https://platform.minimax.io/docs/api-reference/api-overview",apiKey:"https://platform.minimax.cn/docs/guides/quickstart-preparation",models:"https://platform.minimax.cn/docs/guides/models-intro"}},glm:{name:"智谱 GLM",nameEn:"Zhipu GLM",baseUrl:"https://open.bigmodel.cn/api/paas/v4",model:"glm-5.3-flash",envPrefix:"GLM",consoleUrl:"https://open.bigmodel.cn",docs:{cn:"https://docs.bigmodel.cn/cn/guide/start/quick-start",intl:"https://docs.z.ai/guides/overview/quick-start",apiKey:"https://docs.bigmodel.cn/cn/guide/start/quick-start",models:"https://docs.bigmodel.cn/cn/guide/start/model-overview"}},deepseek:{name:"DeepSeek",nameEn:"DeepSeek",baseUrl:"https://api.deepseek.com",model:"deepseek-v4-flash",envPrefix:"DEEPSEEK",consoleUrl:"https://platform.deepseek.com",docs:{cn:"https://api-docs.deepseek.com/zh-cn/",apiKey:"https://api-docs.deepseek.com/zh-cn/",models:"https://api-docs.deepseek.com/zh-cn/quick_start/pricing"}},kimi:{name:"Kimi",nameEn:"Kimi",baseUrl:"https://api.moonshot.cn/v1",model:"kimi-k3.1-pro",envPrefix:"KIMI",consoleUrl:"https://platform.kimi.com",docs:{cn:"https://platform.moonshot.cn/docs/introduction",intl:"https://platform.moonshot.ai/docs/introduction",apiKey:"https://platform.moonshot.cn/docs/introduction",models:"https://platform.moonshot.cn/docs/pricing/chat"}},qwen:{name:"千问 Qwen",nameEn:"Qwen",baseUrl:"https://token-plan.cn-beijing.maas.aliyuncs.com/compatible-mode/v1",model:"qwen3.8-max",envPrefix:"QWEN",consoleUrl:"https://bailian.console.aliyun.com",docs:{cn:"https://help.aliyun.com/zh/model-studio/token-plan-personal-quick-start",intl:"https://www.alibabacloud.com/help/en/model-studio/token-plan-personal-quick-start",apiKey:"https://help.aliyun.com/zh/model-studio/token-plan-personal-quick-start",models:"https://help.aliyun.com/zh/model-studio/models"}},stepfun:{name:"阶跃星辰 StepFun",nameEn:"StepFun",baseUrl:"https://api.stepfun.com/step_plan/v1",model:"step-5-preview",envPrefix:"STEPFUN",consoleUrl:"https://platform.stepfun.com",docs:{cn:"https://platform.stepfun.com/docs/zh/guides/developer/openai",intl:"https://platform.stepfun.ai/docs/en/guides/developer/openai",apiKey:"https://platform.stepfun.com/docs/zh/guides/developer/openai",models:"https://platform.stepfun.com/docs/zh/guides/models/list"}},volcengine:{name:"火山引擎 豆包",nameEn:"Volcengine Doubao",baseUrl:"https://ark.cn-beijing.volces.com/api/v3",model:"doubao-seed-evolving",envPrefix:"VOLCENGINE",consoleUrl:"https://console.volcengine.com/ark",docs:{cn:"https://www.volcengine.com/docs/82379/1330626",intl:"https://docs.byteplus.com/en/docs/ModelArk/1330626",apiKey:"https://www.volcengine.com/docs/82379/1541594",models:"https://www.volcengine.com/docs/82379/1330310"}},"volcengine-agent":{name:"火山引擎 Agent Plan",nameEn:"Volcengine Agent Plan",baseUrl:"https://ark.cn-beijing.volces.com/api/plan/v3",model:"doubao-seed-evolving",envPrefix:"VOLCENGINE_AGENT",consoleUrl:"https://console.volcengine.com/ark",docs:{cn:"https://ark.volcengine.com/region:cn-beijing/docs/82379/2160841?lang=zh",apiKey:"https://ark.volcengine.com/region:cn-beijing/docs/82379/2160841?lang=zh",models:"https://www.volcengine.com/docs/82379/2366394"}},"volcengine-coding":{name:"火山引擎 Coding Plan",nameEn:"Volcengine Coding Plan",baseUrl:"https://ark.cn-beijing.volces.com/api/coding/v3",model:"doubao-seed-evolving",envPrefix:"VOLCENGINE_CODING",consoleUrl:"https://console.volcengine.com/ark",docs:{cn:"https://www.volcengine.com/docs/82379/1928261",apiKey:"https://www.volcengine.com/docs/82379/1928261",models:"https://www.volcengine.com/docs/82379/1928261"}},"volcengine-free":{name:"火山引擎(免费试用)",nameEn:"Volcengine (free trial)",baseUrl:"https://ark.cn-beijing.volces.com/api/v3",model:"doubao-seed-evolving",envPrefix:"VOLCENGINE_FREE",consoleUrl:"https://console.volcengine.com/ark",docs:{cn:"https://www.volcengine.com/docs/82379/1399514",apiKey:"https://www.volcengine.com/docs/82379/1541594",models:"https://www.volcengine.com/docs/82379/1330310"}}},h=Object.keys(u);function x(e){return"string"==typeof e&&Object.prototype.hasOwnProperty.call(u,e)}e.s(["$",0,u,"U",0,h,"z",0,function(e,s){let i=u[e];return"zh"===s?i.name:i.nameEn},"j",0,x,"k",0,function(e,s){let i=u[e];return{apiKey:s?.apiKey||"",baseUrl:s?.baseUrl||i.baseUrl,model:s?.model||i.model}}],128093);var f=e.i(41931),g=e.i(303163),v=e.i(201276);e.s(["f",0,function({config:e,saving:t,saveButton:n}){let{t:o,language:u}=(0,m.b)(),[h,j]=(0,i.useState)(!1),[y,b]=(0,i.useState)(null),N=e=>o.settings?.ai?.errors?.[e]||e.replace("UNKNOWN:",""),k=async()=>{let s=function(e,s){let i=e.aiProvider;if("openai"===i){let t=e.openai?.instances?.find(s=>s.id===e.openai?.activeInstanceId);return t?.apiKey?{ok:!0,body:{provider:i,apiKey:t.apiKey,baseUrl:t.baseUrl,model:t.model,language:s}}:{ok:!1,error:"API_KEY_REQUIRED"}}if("azure"===i){let t=e.azure;return t?.apiKey&&t.endpoint&&t.deploymentName?{ok:!0,body:{provider:i,apiKey:t.apiKey,endpoint:t.endpoint,deploymentName:t.deploymentName,apiVersion:t.apiVersion,model:t.model,language:s}}:{ok:!1,error:"AZURE_CONFIG_INCOMPLETE"}}if("minimax-code"===i)return{ok:!0,body:{provider:i,model:e.minimaxCode?.model,language:s}};if("gemini"===i||"anthropic"===i||x(i)){let t=e[i];return t?.apiKey?{ok:!0,body:{provider:i,apiKey:t.apiKey,baseUrl:t.baseUrl,model:t.model,language:s}}:{ok:!1,error:"API_KEY_REQUIRED"}}return{ok:!1,error:"UNSUPPORTED_PROVIDER"}}(e,u);if(!s.ok){if("UNSUPPORTED_PROVIDER"===s.error)return;b({success:!1,textSupport:!1,visionSupport:!1,textError:"AZURE_CONFIG_INCOMPLETE"===s.error?o.settings?.ai?.validationAzureEndpointRequired||"Azure config is incomplete":o.settings?.ai?.validationApiKeyRequired||"API Key is required"});return}j(!0),b(null);try{b(await f.f.post("/api/ai/test",s.body))}catch(e){v.V.error("[AiConnectionTest]","AI connection test failed",{error:e}),b({success:!1,textSupport:!1,visionSupport:!1,textError:(0,g.Z)(e)})}finally{j(!1)}};return(0,s.jsxs)("div",{className:"space-y-3 pt-3 border-t",children:[(0,s.jsxs)("div",{className:"flex gap-2",children:[(0,s.jsxs)(d.f,{type:"button",variant:"outline",onClick:k,disabled:h||t,className:"flex-1",children:[h?(0,s.jsx)(r.f,{className:"mr-2 h-4 w-4 animate-spin"}):(0,s.jsx)(c,{className:"mr-2 h-4 w-4"}),h?o.settings?.ai?.testing||"Testing...":o.settings?.ai?.testConnection||"Test Connection"]}),n]}),y&&(0,s.jsxs)("div",{className:`p-3 rounded-md text-sm ${y.success?"bg-green-50 dark:bg-green-950/40 border border-green-200 dark:border-green-900":"bg-red-50 dark:bg-red-950/40 border border-red-200 dark:border-red-900"}`,children:[(0,s.jsx)("div",{className:"flex items-center gap-2 font-medium mb-2",children:y.success?(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(a,{className:"h-4 w-4 text-green-600"}),(0,s.jsx)("span",{className:"text-green-700 dark:text-green-300",children:o.settings?.ai?.testSuccess||"Connection Successful"}),y.modelInfo&&(0,s.jsxs)("span",{className:"text-green-600 text-xs",children:["(",y.modelInfo,")"]})]}):(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(l.f,{className:"h-4 w-4 text-red-600"}),(0,s.jsx)("span",{className:"text-red-700 dark:text-red-300",children:o.settings?.ai?.testFailed||"Connection Failed"})]})}),y.success&&(0,s.jsxs)("div",{className:"space-y-1 text-xs",children:[(0,s.jsxs)("div",{className:"flex items-center gap-2",children:[(0,s.jsxs)("span",{className:"text-muted-foreground",children:[o.settings?.ai?.textSupport||"Text Generation",":"]}),(0,s.jsxs)("span",{className:"text-green-600",children:["✓ ",o.settings?.ai?.supported||"Supported"]})]}),(0,s.jsxs)("div",{className:"flex items-center gap-2",children:[(0,s.jsxs)("span",{className:"text-muted-foreground",children:[o.settings?.ai?.visionSupport||"Vision/Multimodal",":"]}),y.visionSupport?(0,s.jsxs)("span",{className:"text-green-600",children:["✓ ",o.settings?.ai?.supported||"Supported"]}):(0,s.jsxs)("span",{className:"text-amber-600",children:["✗ ",y.visionError?N(y.visionError):o.settings?.ai?.notSupported||"Not Supported"]})]}),!y.visionSupport&&(0,s.jsx)(p,{detail:y.visionErrorDetail}),(0,s.jsx)("p",{className:"text-muted-foreground/60 text-[10px] pl-1",children:o.settings?.ai?.testNetworkNote})]}),!y.success&&y.textError&&(0,s.jsx)("p",{className:"text-red-600 text-xs mt-1",children:N(y.textError)}),!y.success&&(0,s.jsx)(p,{detail:y.textErrorDetail})]})]})}],713452)},10038,835467,e=>{var s=e.i(843476),i=e.i(632781),t=e.i(519455),n=e.i(110204),a=e.i(967489),r=e.i(713452),l=e.i(459649),o=e.i(118585),c=e.i(75977),d=e.i(482022),m=e.i(97923),p=e.i(367784),u=e.i(741120),h=e.i(487486),x=e.i(793479),f=e.i(975153),g=e.i(699375),v=e.i(111110),j=e.i(215519),y=e.i(306831);function b({checkin:e,autoCheckin:a,onAutoCheckinChange:r,busy:l,onCheckin:o}){let c,{t:d}=(0,v.b)(),{timeZone:m}=(0,j.M)(),p=d.settings?.ai?.minimaxCode,{today:u,last:x}=e,N=x&&"failed"!==x.status?x:null,k=!!(u?.checkedToday||N),w=String(N?.points??(u?u.points+u.bonusPoints:0)),C=String(N?.streakDays??u?.streakDays??0);return c=N?.trigger==="auto"&&"checked-in"===N.status?(p?.checkinAuto||"Checked in automatically today at {time} (+{points} credits, day {days} in a row)").replace("{time}",(0,y.r)(N.at,"HH:mm",m)).replace("{points}",w).replace("{days}",C):k?(p?.checkinDone||"Checked in today (+{points} credits, day {days} in a row)").replace("{points}",w).replace("{days}",C):x?.status==="failed"?(p?.checkinFailed||"Check-in failed: {error}").replace("{error}",x.error||""):e.autoCheckin?p?.checkinWillAuto||"Not checked in yet today. The app will check in automatically within the hour.":p?.checkinNotYet||"Not checked in yet today",(0,s.jsxs)("div",{className:"space-y-3 border-t pt-3",children:[(0,s.jsxs)("div",{className:"flex flex-wrap items-center justify-between gap-2 text-sm",children:[(0,s.jsxs)("div",{className:"flex min-w-0 items-center gap-2",children:[(0,s.jsx)("span",{className:"text-muted-foreground",children:p?.checkinToday||"Today's check-in"}),(0,s.jsxs)(h.f,{variant:k?"default":x?.status==="failed"?"destructive":"secondary",children:[(0,s.jsx)(f.f,{className:"mr-1 h-3 w-3"}),k?p?.checkinSuccess||"Checked in":p?.checkinNotYet||"Not yet"]})]}),!k&&(0,s.jsxs)(t.f,{size:"sm",variant:"outline",onClick:o,disabled:l,children:[l&&(0,s.jsx)(i.f,{className:"mr-2 h-4 w-4 animate-spin"}),p?.checkinNow||"Check in now"]})]}),(0,s.jsx)("p",{className:"text-xs text-muted-foreground break-words",children:c}),(0,s.jsxs)("div",{className:"flex items-start justify-between gap-3",children:[(0,s.jsxs)("div",{className:"space-y-1",children:[(0,s.jsx)(n.f,{htmlFor:"minimax-code-auto-checkin",children:p?.autoCheckin||"Daily auto check-in"}),(0,s.jsx)("p",{className:"text-xs text-muted-foreground",children:p?.autoCheckinHint})]}),(0,s.jsx)(g.f,{id:"minimax-code-auto-checkin",checked:a,onCheckedChange:r})]})]})}let N=["MiniMax-M3.1-Flash","MiniMax-M3","MiniMax-M2.7-highspeed","MiniMax-M2.7"];var k=e.i(271645),w=e.i(41931),C=e.i(303163),S=e.i(294114),U=e.i(201276);function K({value:e,onChange:a}){let{t:r}=(0,v.b)(),l=r.settings?.ai?.minimaxCode,{status:o,loading:c,pending:f,busy:g,refresh:j,login:y,logout:P,checkin:E}=function(){let{t:e}=(0,v.b)(),s=e.settings?.ai?.minimaxCode,[i,t]=(0,k.useState)(null),[n,a]=(0,k.useState)(!0),[r,l]=(0,k.useState)(null),[o,c]=(0,k.useState)(!1),d=(0,k.useRef)(null),m=(0,k.useCallback)(async()=>{a(!0);try{let e=await w.f.get("/api/minimax-code");t(e),e.pendingLogin&&l(e.pendingLogin)}catch(e){U.V.error("[MiniMaxCode]","Failed to load status",{error:e})}finally{a(!1)}},[]);(0,k.useEffect)(()=>{m()},[m]),(0,k.useEffect)(()=>{if(!r)return;let e=!1,i=async()=>{try{let t=await w.f.get("/api/minimax-code/login");if(e)return;if("pending"===t.status){d.current=setTimeout(i,r.intervalMs);return}l(null),"ok"===t.status?S.c.success(s?.loginSuccess||"Signed in"):"expired"===t.status?S.c.error(s?.loginExpired||"Authorization timed out"):"denied"===t.status&&S.c.error(s?.loginDenied||"Authorization declined"),m()}catch(i){if(e)return;l(null),S.c.error(`${s?.loginFailed||"Sign-in failed"}: ${(0,C.Z)(i)}`)}};return d.current=setTimeout(i,r.intervalMs),()=>{e=!0,d.current&&clearTimeout(d.current)}},[r,m,s]);let p=async()=>{c(!0);try{await w.f.delete("/api/minimax-code"),l(null),await m()}catch(e){S.c.error((0,C.Z)(e))}finally{c(!1)}},u=async()=>{c(!0);try{let e=await w.f.post("/api/minimax-code/checkin",{});"failed"===e.status?S.c.error((s?.checkinFailed||"Check-in failed: {error}").replace("{error}",e.error||"")):S.c.success(s?.checkinSuccess||"Checked in"),await m()}catch(e){S.c.error((0,C.Z)(e))}finally{c(!1)}};return{status:i,loading:n,pending:r,busy:o,refresh:m,login:async()=>{c(!0);try{let e=await w.f.post("/api/minimax-code/login",{});l(e),window.open(e.url,"_blank","noopener,noreferrer")}catch(e){S.c.error(`${s?.loginFailed||"Sign-in failed"}: ${(0,C.Z)(e)}`)}finally{c(!1)}},logout:p,checkin:u}}(),M=o?.login??"none",I=o?.account,z=o?.credits,A={none:l?.statusNone||"Not signed in",active:l?.statusActive||"Signed in",expired:l?.statusExpired||"Login expired"}[M];return(0,s.jsxs)("div",{className:"space-y-3 animate-in fade-in slide-in-from-top-2",children:[(0,s.jsx)("p",{className:"text-xs text-muted-foreground",children:l?.intro}),(0,s.jsxs)("section",{className:"space-y-3 rounded-md border bg-background p-3","aria-label":l?.title||"MiniMax Code account",children:[(0,s.jsxs)("div",{className:"flex items-center justify-between gap-2",children:[(0,s.jsx)("h4",{className:"text-sm font-medium",children:l?.title||"MiniMax Code account"}),(0,s.jsx)(t.f,{variant:"ghost",size:"sm",onClick:()=>void j(),disabled:c,"aria-label":l?.refresh||"Refresh",children:(0,s.jsx)(u.f,{className:`h-4 w-4 ${c?"animate-spin":""}`})})]}),(0,s.jsxs)("dl",{className:"grid grid-cols-[auto_1fr] gap-x-4 gap-y-2 text-sm",children:[(0,s.jsx)("dt",{className:"text-muted-foreground",children:l?.loginStatus||"Login status"}),(0,s.jsxs)("dd",{className:"flex min-w-0 flex-wrap items-center gap-2",children:[(0,s.jsx)(h.f,{variant:"active"===M?"default":"expired"===M?"destructive":"secondary",children:A}),I&&(0,s.jsx)("span",{className:"truncate text-muted-foreground",children:I.name||I.email||I.userId})]}),"active"===M&&(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)("dt",{className:"text-muted-foreground",children:l?.credits||"Remaining credits"}),(0,s.jsx)("dd",{children:z?(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)("span",{className:"font-medium tabular-nums",children:z.total}),(0,s.jsx)("span",{className:"ml-2 text-xs text-muted-foreground",children:(l?.creditsDetail||"Free {free} · Purchased {purchased}").replace("{free}",String(z.free)).replace("{purchased}",String(z.purchased))})]}):(0,s.jsx)("span",{className:"text-muted-foreground",children:l?.creditsUnavailable||"Unavailable"})})]})]}),"active"===M&&o&&(0,s.jsx)(b,{checkin:o.checkin,autoCheckin:e?.autoCheckin!==!1,onAutoCheckinChange:s=>a({...e,autoCheckin:s}),busy:g,onCheckin:()=>void E()}),f?(0,s.jsxs)("div",{className:"space-y-1 rounded-md bg-muted/50 p-3 text-sm",children:[(0,s.jsxs)("p",{className:"flex items-center gap-2",children:[(0,s.jsx)(i.f,{className:"h-4 w-4 animate-spin"}),l?.waiting]}),f.userCode&&(0,s.jsxs)("p",{children:[l?.userCode||"Verification code",": ",(0,s.jsx)("span",{className:"font-mono font-medium",children:f.userCode})]}),(0,s.jsxs)("a",{href:f.url,target:"_blank",rel:"noopener noreferrer",className:"inline-flex items-center gap-1 underline",children:[l?.openLink||"Open the authorization page"," ",(0,s.jsx)(d.f,{className:"h-3 w-3"})]})]}):(0,s.jsxs)("div",{className:"flex flex-wrap gap-2",children:[(0,s.jsxs)(t.f,{size:"sm",onClick:()=>void y(),disabled:g,children:[g?(0,s.jsx)(i.f,{className:"mr-2 h-4 w-4 animate-spin"}):(0,s.jsx)(m.f,{className:"mr-2 h-4 w-4"}),"none"===M?l?.login||"Sign in with browser":l?.relogin||"Sign in again"]}),"none"!==M&&(0,s.jsxs)(t.f,{size:"sm",variant:"outline",onClick:()=>void P(),disabled:g,children:[(0,s.jsx)(p.f,{className:"mr-2 h-4 w-4"}),l?.logout||"Sign out"]})]})]}),(0,s.jsxs)("div",{className:"space-y-2",children:[(0,s.jsx)(n.f,{htmlFor:"minimax-code-model",children:l?.model||"Model"}),(0,s.jsx)(x.f,{id:"minimax-code-model",list:"minimax-code-models",value:e?.model||"",onChange:s=>a({...e,model:s.target.value}),placeholder:"MiniMax-M3.1-Flash"}),(0,s.jsx)("datalist",{id:"minimax-code-models",children:N.map(e=>(0,s.jsx)("option",{value:e},e))}),(0,s.jsx)("p",{className:"text-xs text-muted-foreground",children:l?.modelHint})]}),(0,s.jsx)("p",{className:"text-xs text-muted-foreground",children:l?.risk})]})}var P=e.i(77071),E=e.i(759659),M=e.i(464034),I=e.i(434901),z=e.i(37038),A=e.i(62189);function R({value:e,onChange:i}){let{t:r}=(0,v.b)(),l=(0,A.f)("openai"),o=e?.instances||[],c=e?.activeInstanceId,d=o.find(e=>e.id===c),m=(s,t)=>{i({...e,instances:o.map(e=>e.id===c?{...e,[s]:t}:e)})},p=async()=>{if(!c||!await (0,S.u)(r.settings?.ai?.confirmDelete||"Delete this instance?",{destructive:!0}))return;let e=o.filter(e=>e.id!==c);i({instances:e,activeInstanceId:e[0]?.id})};return(0,s.jsxs)("div",{className:"space-y-3 animate-in fade-in slide-in-from-top-2",children:[(0,s.jsxs)("div",{className:"space-y-2",children:[(0,s.jsxs)("div",{className:"flex items-center justify-between",children:[(0,s.jsx)(n.f,{children:r.settings?.ai?.instances||"Instance"}),(0,s.jsxs)(t.f,{type:"button",variant:"outline",size:"sm",onClick:()=>{if(o.length>=10)return;let e={id:"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,e=>{let s=16*Math.random()|0;return("x"===e?s:3&s|8).toString(16)}),name:`Instance ${o.length+1}`,apiKey:"",baseUrl:"https://api.openai.com/v1",model:"gpt-6.1-sol"};i({instances:[...o,e],activeInstanceId:e.id})},disabled:o.length>=10,className:"h-7 px-2 text-xs",children:[(0,s.jsx)(P.f,{className:"h-3 w-3 mr-1"}),r.settings?.ai?.addInstance||"Add"]})]}),o.length>0?(0,s.jsxs)("div",{className:"flex gap-2",children:[(0,s.jsxs)(a.d,{value:c||"",onValueChange:s=>i({...e,activeInstanceId:s}),children:[(0,s.jsx)(a.P,{className:"flex-1",children:(0,s.jsx)(a.U,{placeholder:r.settings?.ai?.selectInstance||"Select Instance"})}),(0,s.jsx)(a.r,{children:o.map(e=>(0,s.jsx)(a.T,{value:e.id,children:e.name},e.id))})]}),o.length>1&&(0,s.jsx)(t.f,{type:"button",variant:"outline",size:"icon",onClick:p,className:"h-10 w-10 text-destructive hover:text-destructive",children:(0,s.jsx)(E.f,{className:"h-4 w-4"})})]}):(0,s.jsx)("p",{className:"text-sm text-muted-foreground",children:r.settings?.ai?.noInstances||"No instances configured. Click 'Add' to create one."}),o.length>=10&&(0,s.jsx)("p",{className:"text-xs text-amber-600",children:r.settings?.ai?.maxInstancesReached||"Maximum instances reached (10)"})]}),d&&(0,s.jsxs)("div",{className:"space-y-3 p-3 border rounded-md bg-background",children:[(0,s.jsxs)("div",{className:"space-y-2",children:[(0,s.jsxs)(n.f,{children:[r.settings?.ai?.instanceName||"Instance Name"," ",(0,s.jsx)("span",{className:"text-destructive",children:"*"})]}),(0,s.jsx)(x.f,{value:d.name||"",onChange:e=>m("name",e.target.value),placeholder:"e.g. GLM-4V",className:d.name?.trim()?"":"border-destructive"})]}),(0,s.jsxs)("div",{className:"space-y-2",children:[(0,s.jsx)(I.f,{label:(0,s.jsxs)(s.Fragment,{children:["API Key ",(0,s.jsx)("span",{className:"text-destructive",children:"*"})]}),href:l?.apiKey,linkText:r.settings.ai.docLinks.apiKey}),(0,s.jsx)(z.f,{value:d.apiKey||"",onChange:e=>m("apiKey",e.target.value),placeholder:"sk-...",className:d.apiKey?.trim()?"":"border-destructive"})]}),(0,s.jsxs)("div",{className:"space-y-2 pt-4 border-t",children:[(0,s.jsxs)(n.f,{children:["Base URL ",(0,s.jsx)("span",{className:"text-destructive",children:"*"})]}),(0,s.jsx)(x.f,{value:d.baseUrl||"",onChange:e=>m("baseUrl",e.target.value),placeholder:"https://api.openai.com/v1",className:d.baseUrl?.trim()?"":"border-destructive"})]}),(0,s.jsx)(M.f,{provider:"openai",apiKey:d.apiKey,baseUrl:d.baseUrl,currentModel:d.model,onModelChange:e=>m("model",e),docsHref:l?.models})]})]})}function T({provider:e}){let{t:i}=(0,v.b)(),t=i.settings.ai.providerDocs,n=(0,A.f)(e);if(!n)return null;let a=[n.cn&&{href:n.cn,label:n.intl?t.cn:t.official},n.intl&&{href:n.intl,label:n.cn?t.intl:t.official}].filter(e=>!!e);return(0,s.jsxs)("p",{className:"flex flex-wrap items-center gap-x-3 gap-y-1 text-xs text-muted-foreground",children:[(0,s.jsx)("span",{children:t.title}),a.map(e=>(0,s.jsxs)("a",{href:e.href,target:"_blank",rel:"noopener noreferrer",className:"inline-flex items-center gap-1 underline",children:[e.label,(0,s.jsx)(d.f,{className:"h-3 w-3"})]},e.href))]})}var F=e.i(128093);function L({provider:e,value:i,onChange:t}){let{t:a}=(0,v.b)(),r=F.$[e],l=(e,s)=>t({...i,[e]:s}),o={qwen:a.settings?.ai?.qwenBaseUrlHint,stepfun:a.settings?.ai?.stepfunBaseUrlHint,volcengine:a.settings?.ai?.volcengineBaseUrlHint,"volcengine-agent":a.settings?.ai?.volcengineAgentBaseUrlHint,"volcengine-coding":a.settings?.ai?.volcengineCodingBaseUrlHint};return(0,s.jsxs)("div",{className:"space-y-3 animate-in fade-in slide-in-from-top-2",children:["volcengine-free"===e&&(0,s.jsxs)("div",{className:"rounded-md border border-green-200 bg-green-50 p-3 text-xs text-green-800 dark:border-green-900 dark:bg-green-950/40 dark:text-green-300",children:[(0,s.jsx)("p",{className:"font-medium",children:a.settings.ai.volcengineFree.title}),(0,s.jsx)("p",{className:"mt-1",children:a.settings.ai.volcengineFree.body})]}),(0,s.jsxs)("div",{className:"space-y-2",children:[(0,s.jsx)(I.f,{label:"API Key",href:r.docs.apiKey,linkText:a.settings.ai.docLinks.apiKey}),(0,s.jsx)(z.f,{value:i?.apiKey||"",onChange:e=>l("apiKey",e.target.value),placeholder:"sk-..."}),(0,s.jsxs)("p",{className:"text-xs text-muted-foreground",children:[a.settings?.ai?.vendorApiKeyHint||"Get an API key from the console:"," ",(0,s.jsx)("a",{href:r.consoleUrl,target:"_blank",rel:"noopener noreferrer",className:"underline break-all",children:r.consoleUrl})]})]}),(0,s.jsxs)("div",{className:"space-y-2",children:[(0,s.jsx)(n.f,{children:"Base URL (Optional)"}),(0,s.jsx)(x.f,{value:i?.baseUrl||"",onChange:e=>l("baseUrl",e.target.value),placeholder:r.baseUrl}),(0,s.jsx)("p",{className:"text-xs text-muted-foreground",children:o[e]??a.settings?.ai?.vendorBaseUrlHint})]}),(0,s.jsx)(M.f,{provider:e,apiKey:i?.apiKey,baseUrl:i?.baseUrl,currentModel:i?.model||r.model,onModelChange:e=>l("model",e),docsHref:r.docs.models})]})}e.s(["f",0,function({config:e,setConfig:d,loading:m,saving:p,onSave:u}){let{t:h,language:x}=(0,v.b)();return m?(0,s.jsx)("div",{className:"flex justify-center py-4",children:(0,s.jsx)(i.f,{className:"h-6 w-6 animate-spin text-muted-foreground"})}):(0,s.jsxs)("div",{className:"space-y-4 border rounded-lg p-4 bg-muted/30",children:[(0,s.jsxs)("div",{className:"space-y-2",children:[(0,s.jsx)(n.f,{children:h.settings?.tabs?.ai||"AI Provider"}),(0,s.jsxs)(a.d,{value:e.aiProvider,onValueChange:e=>d(s=>({...s,aiProvider:e})),children:[(0,s.jsx)(a.P,{children:(0,s.jsx)(a.U,{})}),(0,s.jsxs)(a.r,{children:[(0,s.jsx)(a.T,{value:"minimax",children:(0,F.z)("minimax",x)}),(0,s.jsx)(a.T,{value:"minimax-code",children:"MiniMax Code OAuth"}),F.U.filter(e=>"minimax"!==e).map(e=>(0,s.jsx)(a.T,{value:e,children:(0,F.z)(e,x)},e)),(0,s.jsx)(a.T,{value:"anthropic",children:"Anthropic / Compatible"}),(0,s.jsx)(a.T,{value:"azure",children:"Azure OpenAI"}),(0,s.jsx)(a.T,{value:"openai",children:"OpenAI / Compatible"}),(0,s.jsx)(a.T,{value:"gemini",children:"Google Gemini"})]})]}),(0,s.jsx)(T,{provider:e.aiProvider})]}),"openai"===e.aiProvider&&(0,s.jsx)(R,{value:e.openai,onChange:e=>d(s=>({...s,openai:e}))}),"gemini"===e.aiProvider&&(0,s.jsx)(c.f,{value:e.gemini,onChange:e=>d(s=>({...s,gemini:e}))}),"minimax-code"===e.aiProvider&&(0,s.jsx)(K,{value:e.minimaxCode,onChange:e=>d(s=>({...s,minimaxCode:e}))}),"anthropic"===e.aiProvider&&(0,s.jsx)(l.f,{value:e.anthropic,onChange:e=>d(s=>({...s,anthropic:e}))}),(0,F.j)(e.aiProvider)&&(0,s.jsx)(L,{provider:e.aiProvider,value:e[e.aiProvider],onChange:e=>d(s=>({...s,[s.aiProvider]:e}))},e.aiProvider),"azure"===e.aiProvider&&(0,s.jsx)(o.f,{value:e.azure,onChange:e=>d(s=>({...s,azure:e}))}),(0,s.jsx)(r.f,{config:e,saving:p,saveButton:(0,s.jsxs)(t.f,{onClick:u,disabled:p,className:"flex-1",children:[p&&(0,s.jsx)(i.f,{className:"mr-2 h-4 w-4 animate-spin"}),h.settings?.ai?.save||"Save AI Settings"]})})]})}],10038),e.s(["f",0,function(e,s){if(!(0,y.L)(e.timeZone??y.J))return s.settings.general.invalidTimeZone;if("openai"===e.aiProvider)for(let i of e.openai?.instances||[]){if(!i.name?.trim())return s.settings?.ai?.validationNameRequired||"Instance name is required";if(!i.apiKey?.trim())return s.settings?.ai?.validationApiKeyRequired||"API Key is required";if(!i.baseUrl?.trim())return s.settings?.ai?.validationBaseUrlRequired||"Base URL is required";if(!i.model?.trim())return s.settings?.ai?.validationModelRequired||"Model name is required"}if("azure"===e.aiProvider){if(!e.azure?.endpoint?.trim())return s.settings?.ai?.validationAzureEndpointRequired||"Azure Endpoint is required";if(!e.azure?.deploymentName?.trim())return s.settings?.ai?.validationAzureDeploymentRequired||"Deployment Name is required";if(!e.azure?.apiKey?.trim())return s.settings?.ai?.validationApiKeyRequired||"API Key is required"}return null}],835467)},459649,464034,434901,62189,118585,75977,97923,e=>{var s=e.i(843476),i=e.i(793479),t=e.i(37038),n=e.i(110204),a=e.i(271645),r=e.i(519455),l=e.i(967489),o=e.i(482022),c=e.i(741120),d=e.i(632781),m=e.i(41931),p=e.i(111110),u=e.i(128093),h=e.i(201276);function x({provider:e,apiKey:t,baseUrl:f,currentModel:g,onModelChange:v,docsHref:j}){let{t:y}=(0,p.b)(),[b,N]=(0,a.useState)([]),[k,w]=(0,a.useState)(!1),[C,S]=(0,a.useState)(null),[U,K]=(0,a.useState)(g||""),[P,E]=(0,a.useState)(!1),[M,I]=(0,a.useState)(g);g!==M&&(I(g),K(g||""));let z=async()=>{if(!t)return void S(y.modelSelector?.enterApiKeyFirst||"Please enter API Key first");w(!0),S(null);try{let s=await m.f.post("/api/ai/models",{provider:e,apiKey:t,...f&&{baseUrl:f}});if("error"in s&&"string"==typeof s.error){S(s.error),E(!0),N([]);return}N(s.models),0===s.models.length&&(S(y.modelSelector?.noVisionModel||"No vision model found, please enter manually"),E(!0))}catch(s){h.V.error("[ModelSelector]","Failed to fetch models",{error:s});let e=s instanceof Error&&s.message||y.modelSelector?.fetchFailed||"Failed to fetch models";S(e+(y.modelSelector?.enterManually||", please enter manually")),E(!0)}finally{w(!1)}};return(0,s.jsxs)("div",{className:"space-y-2",children:[(0,s.jsxs)("div",{className:"flex items-center gap-2",children:[(0,s.jsx)(n.f,{className:"flex-1",children:y.modelSelector?.modelName||"Model Name"}),j&&(0,s.jsxs)("a",{href:j,target:"_blank",rel:"noopener noreferrer",className:"inline-flex shrink-0 items-center gap-1 text-xs text-muted-foreground underline",children:[y.settings.ai.docLinks.models,(0,s.jsx)(o.f,{className:"h-3 w-3"})]}),(0,s.jsx)(r.f,{type:"button",variant:"outline",size:"sm",onClick:z,disabled:k||!t,children:k?(0,s.jsx)(d.f,{className:"h-3 w-3 animate-spin"}):(0,s.jsx)(c.f,{className:"h-3 w-3"})})]}),C&&(0,s.jsx)("p",{className:"text-xs text-yellow-600",children:C}),P||0===b.length?(0,s.jsxs)("div",{className:"space-y-2",children:[(0,s.jsx)(i.f,{value:U,onChange:e=>{var s;K(s=e.target.value),v(s)},placeholder:(0,u.j)(e)?u.$[e].model:"openai"===e?"gpt-6.1-sol":"gemini-1.5-flash"}),b.length>0&&(0,s.jsx)(r.f,{type:"button",variant:"link",size:"sm",className:"h-auto p-0 text-xs",onClick:()=>E(!1),children:y.modelSelector?.selectFromList||"Select from List"})]}):(0,s.jsx)("div",{className:"space-y-2",children:(0,s.jsxs)(l.d,{value:g,onValueChange:e=>{"_custom"===e?E(!0):(E(!1),K(e),v(e))},children:[(0,s.jsx)(l.P,{children:(0,s.jsx)(l.U,{placeholder:y.modelSelector?.selectModel||"Select Model"})}),(0,s.jsxs)(l.r,{children:[b.map(e=>(0,s.jsxs)(l.T,{value:e.id,children:[e.name,e.owned_by&&` (${e.owned_by})`]},e.id)),(0,s.jsx)(l.T,{value:"_custom",children:y.modelSelector?.customInput||"Custom Input..."})]})]})})]})}function f({label:e,href:i,linkText:t}){return i?(0,s.jsxs)("div",{className:"flex items-center justify-between gap-2",children:[(0,s.jsx)(n.f,{children:e}),(0,s.jsxs)("a",{href:i,target:"_blank",rel:"noopener noreferrer",className:"inline-flex shrink-0 items-center gap-1 text-xs text-muted-foreground underline",children:[t,(0,s.jsx)(o.f,{className:"h-3 w-3"})]})]}):(0,s.jsx)(n.f,{children:e})}e.s(["f",0,x],464034),e.s(["f",0,f],434901);let g={openai:{intl:"https://platform.openai.com/docs/api-reference",apiKey:"https://platform.openai.com/docs/quickstart",models:"https://platform.openai.com/docs/models"},anthropic:{intl:"https://docs.anthropic.com/en/api/overview",apiKey:"https://docs.anthropic.com/en/api/getting-started",models:"https://docs.anthropic.com/en/docs/about-claude/models/overview"},azure:{intl:"https://learn.microsoft.com/azure/ai-foundry/openai/reference",apiKey:"https://learn.microsoft.com/azure/ai-foundry/openai/how-to/create-resource",models:"https://learn.microsoft.com/azure/ai-foundry/openai/concepts/models"},gemini:{intl:"https://ai.google.dev/gemini-api/docs",apiKey:"https://ai.google.dev/gemini-api/docs/api-key",models:"https://ai.google.dev/gemini-api/docs/models"}};function v(e){return(0,u.j)(e)?u.$[e].docs:g[e]??null}e.s(["f",0,v],62189),e.s(["f",0,function({value:e,onChange:a}){let{t:r}=(0,p.b)(),l=v("anthropic"),o=(s,i)=>a({...e,[s]:i});return(0,s.jsxs)("div",{className:"space-y-3 animate-in fade-in slide-in-from-top-2",children:[(0,s.jsxs)("div",{className:"space-y-2",children:[(0,s.jsx)(f,{label:"API Key",href:l?.apiKey,linkText:r.settings.ai.docLinks.apiKey}),(0,s.jsx)(t.f,{value:e?.apiKey||"",onChange:e=>o("apiKey",e.target.value),placeholder:"sk-ant-..."})]}),(0,s.jsxs)("div",{className:"space-y-2",children:[(0,s.jsx)(n.f,{children:"Base URL (Optional)"}),(0,s.jsx)(i.f,{value:e?.baseUrl||"",onChange:e=>o("baseUrl",e.target.value),placeholder:"https://api.anthropic.com"}),(0,s.jsx)("p",{className:"text-xs text-muted-foreground",children:r.settings?.ai?.anthropicBaseUrlHint})]}),(0,s.jsx)(x,{provider:"anthropic",apiKey:e?.apiKey,baseUrl:e?.baseUrl,currentModel:e?.model,onModelChange:e=>o("model",e),docsHref:l?.models})]})}],459649),e.s(["f",0,function({value:e,onChange:a}){let{t:r}=(0,p.b)(),l=v("azure"),o=(s,i)=>a({...e,[s]:i}),c=e=>e?.trim()?"":"border-destructive";return(0,s.jsxs)("div",{className:"space-y-3 animate-in fade-in slide-in-from-top-2",children:[(0,s.jsxs)("div",{className:"space-y-2",children:[(0,s.jsxs)(n.f,{children:[r.settings?.ai?.azureEndpoint||"Azure Endpoint"," ",(0,s.jsx)("span",{className:"text-destructive",children:"*"})]}),(0,s.jsx)(i.f,{value:e?.endpoint||"",onChange:e=>o("endpoint",e.target.value),placeholder:r.settings?.ai?.azureEndpointPlaceholder||"https://your-resource.openai.azure.com",className:c(e?.endpoint)})]}),(0,s.jsxs)("div",{className:"space-y-2",children:[(0,s.jsx)(f,{label:(0,s.jsxs)(s.Fragment,{children:[r.settings?.ai?.azureDeployment||"Deployment Name"," ",(0,s.jsx)("span",{className:"text-destructive",children:"*"})]}),href:l?.models,linkText:r.settings.ai.docLinks.models}),(0,s.jsx)(i.f,{value:e?.deploymentName||"",onChange:e=>o("deploymentName",e.target.value),placeholder:r.settings?.ai?.azureDeploymentPlaceholder||"gpt-4o-deployment",className:c(e?.deploymentName)})]}),(0,s.jsxs)("div",{className:"space-y-2",children:[(0,s.jsx)(f,{label:(0,s.jsxs)(s.Fragment,{children:["API Key ",(0,s.jsx)("span",{className:"text-destructive",children:"*"})]}),href:l?.apiKey,linkText:r.settings.ai.docLinks.apiKey}),(0,s.jsx)(t.f,{value:e?.apiKey||"",onChange:e=>o("apiKey",e.target.value),placeholder:"xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",className:c(e?.apiKey)})]}),(0,s.jsxs)("div",{className:"space-y-2",children:[(0,s.jsx)(n.f,{children:r.settings?.ai?.azureApiVersion||"API Version"}),(0,s.jsx)(i.f,{value:e?.apiVersion||"",onChange:e=>o("apiVersion",e.target.value),placeholder:r.settings?.ai?.azureApiVersionPlaceholder||"2024-02-15-preview"})]}),(0,s.jsxs)("div",{className:"space-y-2",children:[(0,s.jsx)(n.f,{children:r.settings?.ai?.azureModel||"Model Display Name"}),(0,s.jsx)(i.f,{value:e?.model||"",onChange:e=>o("model",e.target.value),placeholder:"gpt-4o"})]})]})}],118585),e.s(["f",0,function({value:e,onChange:a}){let{t:r}=(0,p.b)(),l=v("gemini"),o=(s,i)=>a({...e,[s]:i});return(0,s.jsxs)("div",{className:"space-y-3 animate-in fade-in slide-in-from-top-2",children:[(0,s.jsxs)("div",{className:"space-y-2",children:[(0,s.jsx)(f,{label:"API Key",href:l?.apiKey,linkText:r.settings.ai.docLinks.apiKey}),(0,s.jsx)(t.f,{value:e?.apiKey||"",onChange:e=>o("apiKey",e.target.value),placeholder:"AIza..."})]}),(0,s.jsxs)("div",{className:"space-y-2",children:[(0,s.jsx)(n.f,{children:"Base URL (Optional)"}),(0,s.jsx)(i.f,{value:e?.baseUrl||"",onChange:e=>o("baseUrl",e.target.value),placeholder:"https://generativelanguage.googleapis.com"})]}),(0,s.jsx)(x,{provider:"gemini",apiKey:e?.apiKey,baseUrl:e?.baseUrl,currentModel:e?.model,onModelChange:e=>o("model",e),docsHref:l?.models})]})}],75977);var j=e.i(456420);let y={name:"log-in",size:24,node:[["path",{d:"m10 17 5-5-5-5",key:"1bsop3"}],["path",{d:"M15 12H3",key:"6jk70r"}],["path",{d:"M15 3h4a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2h-4",key:"u53s6r"}]]};y.node;let b=(0,j.f)(y);e.s(["f",0,b],97923)},37038,e=>{var s=e.i(843476),i=e.i(271645),t=e.i(772382),n=e.i(580860),a=e.i(519455),r=e.i(793479),l=e.i(111110),o=e.i(975157);e.s(["f",0,function({className:e,...c}){let{t:d}=(0,l.b)(),[m,p]=(0,i.useState)(!1);return(0,s.jsxs)("div",{className:"relative",children:[(0,s.jsx)(r.f,{type:m?"text":"password",className:(0,o.f)("pr-10",e),...c}),(0,s.jsx)(a.f,{type:"button",variant:"ghost",size:"icon",className:"absolute right-0 top-0 h-full px-3 py-2 hover:bg-transparent",onClick:()=>p(!m),"aria-label":m?d.common.hidePassword:d.common.showPassword,tabIndex:-1,children:m?(0,s.jsx)(n.f,{className:"h-4 w-4 text-muted-foreground"}):(0,s.jsx)(t.f,{className:"h-4 w-4 text-muted-foreground"})})]})}])}])})();
|
|
1
|
+
(()=>{"use strict";(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,367784,699375,e=>{var s=e.i(456420);let i={name:"log-out",size:24,node:[["path",{d:"m16 17 5-5-5-5",key:"1bji2h"}],["path",{d:"M21 12H9",key:"dn1m92"}],["path",{d:"M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4",key:"1uf3rs"}]]};i.node;let t=(0,s.f)(i);e.s(["f",0,t],367784);var n=e.i(843476),a=e.i(271645),r=e.i(981140),l=e.i(820783),o=e.i(30030),c=e.i(369340),d=e.i(635804),m=e.i(248425),p=Object.defineProperty,u=(e,s)=>p(e,"name",{value:s,configurable:!0}),h="Switch",[x,f]=(0,o.f)(h),[g,v]=x(h);function j(e){let{__scopeSwitch:s,checked:i,children:t,defaultChecked:r,disabled:l,form:o,name:d,onCheckedChange:m,required:p,value:u="on",internal_do_not_use_render:x}=e,[f,v]=(0,c.f)({prop:i,defaultProp:r??!1,onChange:m,caller:h}),[j,y]=a.useState(null),[b,N]=a.useState(null),[k,C]=a.useState(null),S=!j||!!o||!!j.closest("form"),U={checked:f,setChecked:v,disabled:l,control:j,setControl:y,name:d,form:o,value:u,userClick:k,onUserClick:C,required:p,defaultChecked:r,isFormControl:S,bubbleInput:b,setBubbleInput:N};return(0,n.jsx)(g,{scope:s,...U,children:w(x)?x(U):t})}u(j,"SwitchProvider");var y=a.forwardRef(u(function({__scopeSwitch:e,onClick:s,...i},t){let{control:o,form:c,value:d,disabled:p,checked:h,required:x,setControl:f,setChecked:g,onUserClick:j,isFormControl:y,bubbleInput:b}=v("SwitchTrigger",e),N=(0,l.f)(t,f),k=a.useRef(h);return a.useEffect(()=>{let e=c?o?.ownerDocument.getElementById(c):o?.form;if(e instanceof HTMLFormElement){let s=u(()=>g(k.current),"reset");return e.addEventListener("reset",s),()=>e.removeEventListener("reset",s)}},[o,c,g]),(0,n.jsx)(m.V.button,{type:"button",role:"switch","aria-checked":h,"aria-required":x,"data-state":C(h),"data-disabled":p?"":void 0,disabled:p,value:d,...i,ref:N,onClick:(0,r.f)(s,e=>{let s=e.isPropagationStopped();j({requestedChecked:!h,hasConsumerStoppedPropagation:s}),g(e=>!e),b&&y&&!s&&e.stopPropagation()})})},"SwitchTrigger")),b=a.forwardRef(u(function(e,s){let{__scopeSwitch:i,name:t,checked:a,defaultChecked:r,required:l,disabled:o,value:c,onCheckedChange:d,form:m,...p}=e;return(0,n.jsx)(j,{__scopeSwitch:i,checked:a,defaultChecked:r,disabled:o,required:l,onCheckedChange:d,name:t,form:m,value:c,internal_do_not_use_render:({isFormControl:e})=>(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(y,{...p,ref:s,__scopeSwitch:i}),e&&(0,n.jsx)(k,{__scopeSwitch:i})]})})},"Switch")),N=a.forwardRef(u(function(e,s){let{__scopeSwitch:i,...t}=e,a=v("SwitchThumb",i);return(0,n.jsx)(m.V.span,{"data-state":C(a.checked),"data-disabled":a.disabled?"":void 0,...t,ref:s})},"SwitchThumb")),k=a.forwardRef(u(function({__scopeSwitch:e,onClick:s,...i},t){let{control:o,userClick:c,checked:p,defaultChecked:u,required:h,disabled:x,name:f,value:g,form:j,bubbleInput:y,setBubbleInput:b}=v("SwitchBubbleInput",e),N=(0,l.f)(t,b),k=(0,d.f)(o),w=a.useRef(!1),C=a.useRef(p),S=a.useRef(c),U=a.useRef(null);a.useEffect(()=>{if(!y)return;let e=Object.getOwnPropertyDescriptor(window.HTMLInputElement.prototype,"checked").set;if(!e)return;let s=C.current!==p;C.current=p;let i=null!==c&&c!==S.current;if(S.current=c,i)U.current=s?null:c,s&&e.call(y,p),y.dispatchEvent(new Event("click",{bubbles:!c.hasConsumerStoppedPropagation}));else if(s){let s=U.current;U.current=null;let i=s?.requestedChecked===p;w.current=!0,e.call(y,p),y.dispatchEvent(new Event("click",{bubbles:!(i&&s.hasConsumerStoppedPropagation)})),w.current=!1}},[y,p,c]);let K=a.useRef(p);return(0,n.jsx)(m.V.input,{type:"checkbox","aria-hidden":!0,defaultChecked:u??K.current,required:h,disabled:x,name:f,value:g,form:j,...i,tabIndex:-1,ref:N,onClick:(0,r.f)(s,e=>{w.current&&e.stopPropagation()}),style:{...i.style,...k,position:"absolute",pointerEvents:"none",opacity:0,margin:0,transform:"translateX(-100%)"}})},"SwitchBubbleInput"));function w(e){return"function"==typeof e}function C(e){return e?"checked":"unchecked"}u(w,"isFunction"),u(C,"getState");var S=e.i(975157);let U=a.forwardRef(({className:e,...s},i)=>(0,n.jsx)(b,{className:(0,S.f)("peer inline-flex h-5 w-9 shrink-0 cursor-pointer items-center rounded-full border-2 border-transparent shadow-sm transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-primary data-[state=unchecked]:bg-input",e),...s,ref:i,children:(0,n.jsx)(N,{className:(0,S.f)("pointer-events-none block h-4 w-4 rounded-full bg-background shadow-lg ring-0 transition-transform data-[state=checked]:translate-x-4 data-[state=unchecked]:translate-x-0")})}));U.displayName=b.displayName,e.s(["f",0,U],699375)},713452,551757,753817,128093,e=>{var s=e.i(843476),i=e.i(271645),t=e.i(456420);let n={name:"circle-check",size:24,node:[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m16 9-5.5 5.5L8 12",key:"xofnsj"}]],aliases:["check-circle-2"]};n.node;let a=(0,t.f)(n);e.s(["f",0,a],551757);var r=e.i(632781),l=e.i(583967);let o={name:"zap",size:24,node:[["path",{d:"M15.914 4a1.5 1.5 0 00-2.474-1.561l-9 9A1.5 1.5 0 005.5 14h4.002a.5.5 0 01.471.666L8.086 20a1.5 1.5 0 002.475 1.56l9-9A1.5 1.5 0 0018.5 10h-3.997a.5.5 0 01-.472-.667z",key:"1v7up4"}]]};o.node;let c=(0,t.f)(o);var d=e.i(519455),m=e.i(111110);function p({detail:e}){let{t:i}=(0,m.b)();return e?(0,s.jsxs)("p",{className:"mt-1 rounded bg-background/60 px-2 py-1 font-mono text-[11px] leading-relaxed text-red-700 dark:text-red-300 break-all select-text",children:[(0,s.jsx)("span",{className:"font-sans text-muted-foreground",children:i.settings.ai.providerErrorDetail}),e]}):null}e.s(["f",0,p],753817);let u={minimax:{name:"MiniMax",nameEn:"MiniMax",baseUrl:"https://api.minimax.cn/v1",model:"MiniMax-M3.1-Flash",envPrefix:"MINIMAX",consoleUrl:"https://platform.minimax.cn",docs:{cn:"https://platform.minimax.cn/docs/api-reference/api-overview",intl:"https://platform.minimax.io/docs/api-reference/api-overview",apiKey:"https://platform.minimax.cn/docs/guides/quickstart-preparation",models:"https://platform.minimax.cn/docs/guides/models-intro"}},glm:{name:"智谱 GLM",nameEn:"Zhipu GLM",baseUrl:"https://open.bigmodel.cn/api/paas/v4",model:"glm-5.3-flash",envPrefix:"GLM",consoleUrl:"https://open.bigmodel.cn",docs:{cn:"https://docs.bigmodel.cn/cn/guide/start/quick-start",intl:"https://docs.z.ai/guides/overview/quick-start",apiKey:"https://docs.bigmodel.cn/cn/guide/start/quick-start",models:"https://docs.bigmodel.cn/cn/guide/start/model-overview"}},deepseek:{name:"DeepSeek",nameEn:"DeepSeek",baseUrl:"https://api.deepseek.com",model:"deepseek-v4-flash",envPrefix:"DEEPSEEK",consoleUrl:"https://platform.deepseek.com",docs:{cn:"https://api-docs.deepseek.com/zh-cn/",apiKey:"https://api-docs.deepseek.com/zh-cn/",models:"https://api-docs.deepseek.com/zh-cn/quick_start/pricing"}},kimi:{name:"Kimi",nameEn:"Kimi",baseUrl:"https://api.moonshot.cn/v1",model:"kimi-k3.1-pro",envPrefix:"KIMI",consoleUrl:"https://platform.kimi.com",docs:{cn:"https://platform.moonshot.cn/docs/introduction",intl:"https://platform.moonshot.ai/docs/introduction",apiKey:"https://platform.moonshot.cn/docs/introduction",models:"https://platform.moonshot.cn/docs/pricing/chat"}},qwen:{name:"千问 Qwen",nameEn:"Qwen",baseUrl:"https://token-plan.cn-beijing.maas.aliyuncs.com/compatible-mode/v1",model:"qwen3.8-max",envPrefix:"QWEN",consoleUrl:"https://bailian.console.aliyun.com",docs:{cn:"https://help.aliyun.com/zh/model-studio/token-plan-personal-quick-start",intl:"https://www.alibabacloud.com/help/en/model-studio/token-plan-personal-quick-start",apiKey:"https://help.aliyun.com/zh/model-studio/token-plan-personal-quick-start",models:"https://help.aliyun.com/zh/model-studio/models"}},stepfun:{name:"阶跃星辰 StepFun",nameEn:"StepFun",baseUrl:"https://api.stepfun.com/step_plan/v1",model:"step-5-preview",envPrefix:"STEPFUN",consoleUrl:"https://platform.stepfun.com",docs:{cn:"https://platform.stepfun.com/docs/zh/guides/developer/openai",intl:"https://platform.stepfun.ai/docs/en/guides/developer/openai",apiKey:"https://platform.stepfun.com/docs/zh/guides/developer/openai",models:"https://platform.stepfun.com/docs/zh/guides/models/list"}},volcengine:{name:"火山引擎 豆包",nameEn:"Volcengine Doubao",baseUrl:"https://ark.cn-beijing.volces.com/api/v3",model:"doubao-seed-evolving",envPrefix:"VOLCENGINE",consoleUrl:"https://console.volcengine.com/ark",docs:{cn:"https://www.volcengine.com/docs/82379/1330626",intl:"https://docs.byteplus.com/en/docs/ModelArk/1330626",apiKey:"https://www.volcengine.com/docs/82379/1541594",models:"https://www.volcengine.com/docs/82379/1330310"}},"volcengine-agent":{name:"火山引擎 Agent Plan",nameEn:"Volcengine Agent Plan",baseUrl:"https://ark.cn-beijing.volces.com/api/plan/v3",model:"doubao-seed-evolving",envPrefix:"VOLCENGINE_AGENT",consoleUrl:"https://console.volcengine.com/ark",docs:{cn:"https://ark.volcengine.com/region:cn-beijing/docs/82379/2160841?lang=zh",apiKey:"https://ark.volcengine.com/region:cn-beijing/docs/82379/2160841?lang=zh",models:"https://www.volcengine.com/docs/82379/2366394"}},"volcengine-coding":{name:"火山引擎 Coding Plan",nameEn:"Volcengine Coding Plan",baseUrl:"https://ark.cn-beijing.volces.com/api/coding/v3",model:"doubao-seed-evolving",envPrefix:"VOLCENGINE_CODING",consoleUrl:"https://console.volcengine.com/ark",docs:{cn:"https://www.volcengine.com/docs/82379/1928261",apiKey:"https://www.volcengine.com/docs/82379/1928261",models:"https://www.volcengine.com/docs/82379/1928261"}},"volcengine-free":{name:"火山引擎(免费试用)",nameEn:"Volcengine (free trial)",baseUrl:"https://ark.cn-beijing.volces.com/api/v3",model:"doubao-seed-evolving",envPrefix:"VOLCENGINE_FREE",consoleUrl:"https://console.volcengine.com/ark",docs:{cn:"https://www.volcengine.com/docs/82379/1399514",apiKey:"https://www.volcengine.com/docs/82379/1541594",models:"https://www.volcengine.com/docs/82379/1330310"}}},h=Object.keys(u);function x(e){return"string"==typeof e&&Object.prototype.hasOwnProperty.call(u,e)}e.s(["$",0,u,"U",0,h,"z",0,function(e,s){let i=u[e];return"zh"===s?i.name:i.nameEn},"j",0,x,"k",0,function(e,s){let i=u[e];return{apiKey:s?.apiKey||"",baseUrl:s?.baseUrl||i.baseUrl,model:s?.model||i.model}}],128093);var f=e.i(41931),g=e.i(303163),v=e.i(201276);e.s(["f",0,function({config:e,saving:t,saveButton:n}){let{t:o,language:u}=(0,m.b)(),[h,j]=(0,i.useState)(!1),[y,b]=(0,i.useState)(null),N=e=>o.settings?.ai?.errors?.[e]||e.replace("UNKNOWN:",""),k=async()=>{let s=function(e,s){let i=e.aiProvider;if("openai"===i){let t=e.openai?.instances?.find(s=>s.id===e.openai?.activeInstanceId);return t?.apiKey?{ok:!0,body:{provider:i,apiKey:t.apiKey,baseUrl:t.baseUrl,model:t.model,language:s}}:{ok:!1,error:"API_KEY_REQUIRED"}}if("azure"===i){let t=e.azure;return t?.apiKey&&t.endpoint&&t.deploymentName?{ok:!0,body:{provider:i,apiKey:t.apiKey,endpoint:t.endpoint,deploymentName:t.deploymentName,apiVersion:t.apiVersion,model:t.model,language:s}}:{ok:!1,error:"AZURE_CONFIG_INCOMPLETE"}}if("minimax-code"===i)return{ok:!0,body:{provider:i,model:e.minimaxCode?.model,language:s}};if("gemini"===i||"anthropic"===i||x(i)){let t=e[i];return t?.apiKey?{ok:!0,body:{provider:i,apiKey:t.apiKey,baseUrl:t.baseUrl,model:t.model,language:s}}:{ok:!1,error:"API_KEY_REQUIRED"}}return{ok:!1,error:"UNSUPPORTED_PROVIDER"}}(e,u);if(!s.ok){if("UNSUPPORTED_PROVIDER"===s.error)return;b({success:!1,textSupport:!1,visionSupport:!1,textError:"AZURE_CONFIG_INCOMPLETE"===s.error?o.settings?.ai?.validationAzureEndpointRequired||"Azure config is incomplete":o.settings?.ai?.validationApiKeyRequired||"API Key is required"});return}j(!0),b(null);try{b(await f.k.post("/api/ai/test",s.body))}catch(e){v.V.error("[AiConnectionTest]","AI connection test failed",{error:e}),b({success:!1,textSupport:!1,visionSupport:!1,textError:(0,g.Z)(e)})}finally{j(!1)}};return(0,s.jsxs)("div",{className:"space-y-3 pt-3 border-t",children:[(0,s.jsxs)("div",{className:"flex gap-2",children:[(0,s.jsxs)(d.f,{type:"button",variant:"outline",onClick:k,disabled:h||t,className:"flex-1",children:[h?(0,s.jsx)(r.f,{className:"mr-2 h-4 w-4 animate-spin"}):(0,s.jsx)(c,{className:"mr-2 h-4 w-4"}),h?o.settings?.ai?.testing||"Testing...":o.settings?.ai?.testConnection||"Test Connection"]}),n]}),y&&(0,s.jsxs)("div",{className:`p-3 rounded-md text-sm ${y.success?"bg-green-50 dark:bg-green-950/40 border border-green-200 dark:border-green-900":"bg-red-50 dark:bg-red-950/40 border border-red-200 dark:border-red-900"}`,children:[(0,s.jsx)("div",{className:"flex items-center gap-2 font-medium mb-2",children:y.success?(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(a,{className:"h-4 w-4 text-green-600"}),(0,s.jsx)("span",{className:"text-green-700 dark:text-green-300",children:o.settings?.ai?.testSuccess||"Connection Successful"}),y.modelInfo&&(0,s.jsxs)("span",{className:"text-green-600 text-xs",children:["(",y.modelInfo,")"]})]}):(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(l.f,{className:"h-4 w-4 text-red-600"}),(0,s.jsx)("span",{className:"text-red-700 dark:text-red-300",children:o.settings?.ai?.testFailed||"Connection Failed"})]})}),y.success&&(0,s.jsxs)("div",{className:"space-y-1 text-xs",children:[(0,s.jsxs)("div",{className:"flex items-center gap-2",children:[(0,s.jsxs)("span",{className:"text-muted-foreground",children:[o.settings?.ai?.textSupport||"Text Generation",":"]}),(0,s.jsxs)("span",{className:"text-green-600",children:["✓ ",o.settings?.ai?.supported||"Supported"]})]}),(0,s.jsxs)("div",{className:"flex items-center gap-2",children:[(0,s.jsxs)("span",{className:"text-muted-foreground",children:[o.settings?.ai?.visionSupport||"Vision/Multimodal",":"]}),y.visionSupport?(0,s.jsxs)("span",{className:"text-green-600",children:["✓ ",o.settings?.ai?.supported||"Supported"]}):(0,s.jsxs)("span",{className:"text-amber-600",children:["✗ ",y.visionError?N(y.visionError):o.settings?.ai?.notSupported||"Not Supported"]})]}),!y.visionSupport&&(0,s.jsx)(p,{detail:y.visionErrorDetail}),(0,s.jsx)("p",{className:"text-muted-foreground/60 text-[10px] pl-1",children:o.settings?.ai?.testNetworkNote})]}),!y.success&&y.textError&&(0,s.jsx)("p",{className:"text-red-600 text-xs mt-1",children:N(y.textError)}),!y.success&&(0,s.jsx)(p,{detail:y.textErrorDetail})]})]})}],713452)},10038,835467,e=>{var s=e.i(843476),i=e.i(632781),t=e.i(519455),n=e.i(110204),a=e.i(967489),r=e.i(713452),l=e.i(459649),o=e.i(118585),c=e.i(75977),d=e.i(482022),m=e.i(97923),p=e.i(367784),u=e.i(741120),h=e.i(487486),x=e.i(793479),f=e.i(975153),g=e.i(699375),v=e.i(111110),j=e.i(215519),y=e.i(306831);function b({checkin:e,autoCheckin:a,onAutoCheckinChange:r,busy:l,onCheckin:o}){let c,{t:d}=(0,v.b)(),{timeZone:m}=(0,j.M)(),p=d.settings?.ai?.minimaxCode,{today:u,last:x}=e,N=x&&"failed"!==x.status?x:null,k=!!(u?.checkedToday||N),w=String(N?.points??(u?u.points+u.bonusPoints:0)),C=String(N?.streakDays??u?.streakDays??0);return c=N?.trigger==="auto"&&"checked-in"===N.status?(p?.checkinAuto||"Checked in automatically today at {time} (+{points} credits, day {days} in a row)").replace("{time}",(0,y.r)(N.at,"HH:mm",m)).replace("{points}",w).replace("{days}",C):k?(p?.checkinDone||"Checked in today (+{points} credits, day {days} in a row)").replace("{points}",w).replace("{days}",C):x?.status==="failed"?(p?.checkinFailed||"Check-in failed: {error}").replace("{error}",x.error||""):e.autoCheckin?p?.checkinWillAuto||"Not checked in yet today. The app will check in automatically within the hour.":p?.checkinNotYet||"Not checked in yet today",(0,s.jsxs)("div",{className:"space-y-3 border-t pt-3",children:[(0,s.jsxs)("div",{className:"flex flex-wrap items-center justify-between gap-2 text-sm",children:[(0,s.jsxs)("div",{className:"flex min-w-0 items-center gap-2",children:[(0,s.jsx)("span",{className:"text-muted-foreground",children:p?.checkinToday||"Today's check-in"}),(0,s.jsxs)(h.f,{variant:k?"default":x?.status==="failed"?"destructive":"secondary",children:[(0,s.jsx)(f.f,{className:"mr-1 h-3 w-3"}),k?p?.checkinSuccess||"Checked in":p?.checkinNotYet||"Not yet"]})]}),!k&&(0,s.jsxs)(t.f,{size:"sm",variant:"outline",onClick:o,disabled:l,children:[l&&(0,s.jsx)(i.f,{className:"mr-2 h-4 w-4 animate-spin"}),p?.checkinNow||"Check in now"]})]}),(0,s.jsx)("p",{className:"text-xs text-muted-foreground break-words",children:c}),(0,s.jsxs)("div",{className:"flex items-start justify-between gap-3",children:[(0,s.jsxs)("div",{className:"space-y-1",children:[(0,s.jsx)(n.f,{htmlFor:"minimax-code-auto-checkin",children:p?.autoCheckin||"Daily auto check-in"}),(0,s.jsx)("p",{className:"text-xs text-muted-foreground",children:p?.autoCheckinHint})]}),(0,s.jsx)(g.f,{id:"minimax-code-auto-checkin",checked:a,onCheckedChange:r})]})]})}let N=["MiniMax-M3.1-Flash","MiniMax-M3","MiniMax-M2.7-highspeed","MiniMax-M2.7"];var k=e.i(271645),w=e.i(41931),C=e.i(303163),S=e.i(294114),U=e.i(201276);function K({value:e,onChange:a}){let{t:r}=(0,v.b)(),l=r.settings?.ai?.minimaxCode,{status:o,loading:c,pending:f,busy:g,refresh:j,login:y,logout:P,checkin:E}=function(){let{t:e}=(0,v.b)(),s=e.settings?.ai?.minimaxCode,[i,t]=(0,k.useState)(null),[n,a]=(0,k.useState)(!0),[r,l]=(0,k.useState)(null),[o,c]=(0,k.useState)(!1),d=(0,k.useRef)(null),m=(0,k.useCallback)(async()=>{a(!0);try{let e=await w.k.get("/api/minimax-code");t(e),e.pendingLogin&&l(e.pendingLogin)}catch(e){U.V.error("[MiniMaxCode]","Failed to load status",{error:e})}finally{a(!1)}},[]);(0,k.useEffect)(()=>{m()},[m]),(0,k.useEffect)(()=>{if(!r)return;let e=!1,i=async()=>{try{let t=await w.k.get("/api/minimax-code/login");if(e)return;if("pending"===t.status){d.current=setTimeout(i,r.intervalMs);return}l(null),"ok"===t.status?S.c.success(s?.loginSuccess||"Signed in"):"expired"===t.status?S.c.error(s?.loginExpired||"Authorization timed out"):"denied"===t.status&&S.c.error(s?.loginDenied||"Authorization declined"),m()}catch(i){if(e)return;l(null),S.c.error(`${s?.loginFailed||"Sign-in failed"}: ${(0,C.Z)(i)}`)}};return d.current=setTimeout(i,r.intervalMs),()=>{e=!0,d.current&&clearTimeout(d.current)}},[r,m,s]);let p=async()=>{c(!0);try{await w.k.delete("/api/minimax-code"),l(null),await m()}catch(e){S.c.error((0,C.Z)(e))}finally{c(!1)}},u=async()=>{c(!0);try{let e=await w.k.post("/api/minimax-code/checkin",{});"failed"===e.status?S.c.error((s?.checkinFailed||"Check-in failed: {error}").replace("{error}",e.error||"")):S.c.success(s?.checkinSuccess||"Checked in"),await m()}catch(e){S.c.error((0,C.Z)(e))}finally{c(!1)}};return{status:i,loading:n,pending:r,busy:o,refresh:m,login:async()=>{c(!0);try{let e=await w.k.post("/api/minimax-code/login",{});l(e),window.open(e.url,"_blank","noopener,noreferrer")}catch(e){S.c.error(`${s?.loginFailed||"Sign-in failed"}: ${(0,C.Z)(e)}`)}finally{c(!1)}},logout:p,checkin:u}}(),M=o?.login??"none",I=o?.account,z=o?.credits,A={none:l?.statusNone||"Not signed in",active:l?.statusActive||"Signed in",expired:l?.statusExpired||"Login expired"}[M];return(0,s.jsxs)("div",{className:"space-y-3 animate-in fade-in slide-in-from-top-2",children:[(0,s.jsx)("p",{className:"text-xs text-muted-foreground",children:l?.intro}),(0,s.jsxs)("section",{className:"space-y-3 rounded-md border bg-background p-3","aria-label":l?.title||"MiniMax Code account",children:[(0,s.jsxs)("div",{className:"flex items-center justify-between gap-2",children:[(0,s.jsx)("h4",{className:"text-sm font-medium",children:l?.title||"MiniMax Code account"}),(0,s.jsx)(t.f,{variant:"ghost",size:"sm",onClick:()=>void j(),disabled:c,"aria-label":l?.refresh||"Refresh",children:(0,s.jsx)(u.f,{className:`h-4 w-4 ${c?"animate-spin":""}`})})]}),(0,s.jsxs)("dl",{className:"grid grid-cols-[auto_1fr] gap-x-4 gap-y-2 text-sm",children:[(0,s.jsx)("dt",{className:"text-muted-foreground",children:l?.loginStatus||"Login status"}),(0,s.jsxs)("dd",{className:"flex min-w-0 flex-wrap items-center gap-2",children:[(0,s.jsx)(h.f,{variant:"active"===M?"default":"expired"===M?"destructive":"secondary",children:A}),I&&(0,s.jsx)("span",{className:"truncate text-muted-foreground",children:I.name||I.email||I.userId})]}),"active"===M&&(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)("dt",{className:"text-muted-foreground",children:l?.credits||"Remaining credits"}),(0,s.jsx)("dd",{children:z?(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)("span",{className:"font-medium tabular-nums",children:z.total}),(0,s.jsx)("span",{className:"ml-2 text-xs text-muted-foreground",children:(l?.creditsDetail||"Free {free} · Purchased {purchased}").replace("{free}",String(z.free)).replace("{purchased}",String(z.purchased))})]}):(0,s.jsx)("span",{className:"text-muted-foreground",children:l?.creditsUnavailable||"Unavailable"})})]})]}),"active"===M&&o&&(0,s.jsx)(b,{checkin:o.checkin,autoCheckin:e?.autoCheckin!==!1,onAutoCheckinChange:s=>a({...e,autoCheckin:s}),busy:g,onCheckin:()=>void E()}),f?(0,s.jsxs)("div",{className:"space-y-1 rounded-md bg-muted/50 p-3 text-sm",children:[(0,s.jsxs)("p",{className:"flex items-center gap-2",children:[(0,s.jsx)(i.f,{className:"h-4 w-4 animate-spin"}),l?.waiting]}),f.userCode&&(0,s.jsxs)("p",{children:[l?.userCode||"Verification code",": ",(0,s.jsx)("span",{className:"font-mono font-medium",children:f.userCode})]}),(0,s.jsxs)("a",{href:f.url,target:"_blank",rel:"noopener noreferrer",className:"inline-flex items-center gap-1 underline",children:[l?.openLink||"Open the authorization page"," ",(0,s.jsx)(d.f,{className:"h-3 w-3"})]})]}):(0,s.jsxs)("div",{className:"flex flex-wrap gap-2",children:[(0,s.jsxs)(t.f,{size:"sm",onClick:()=>void y(),disabled:g,children:[g?(0,s.jsx)(i.f,{className:"mr-2 h-4 w-4 animate-spin"}):(0,s.jsx)(m.f,{className:"mr-2 h-4 w-4"}),"none"===M?l?.login||"Sign in with browser":l?.relogin||"Sign in again"]}),"none"!==M&&(0,s.jsxs)(t.f,{size:"sm",variant:"outline",onClick:()=>void P(),disabled:g,children:[(0,s.jsx)(p.f,{className:"mr-2 h-4 w-4"}),l?.logout||"Sign out"]})]})]}),(0,s.jsxs)("div",{className:"space-y-2",children:[(0,s.jsx)(n.f,{htmlFor:"minimax-code-model",children:l?.model||"Model"}),(0,s.jsx)(x.f,{id:"minimax-code-model",list:"minimax-code-models",value:e?.model||"",onChange:s=>a({...e,model:s.target.value}),placeholder:"MiniMax-M3.1-Flash"}),(0,s.jsx)("datalist",{id:"minimax-code-models",children:N.map(e=>(0,s.jsx)("option",{value:e},e))}),(0,s.jsx)("p",{className:"text-xs text-muted-foreground",children:l?.modelHint})]}),(0,s.jsx)("p",{className:"text-xs text-muted-foreground",children:l?.risk})]})}var P=e.i(77071),E=e.i(759659),M=e.i(464034),I=e.i(434901),z=e.i(37038),A=e.i(62189);function R({value:e,onChange:i}){let{t:r}=(0,v.b)(),l=(0,A.f)("openai"),o=e?.instances||[],c=e?.activeInstanceId,d=o.find(e=>e.id===c),m=(s,t)=>{i({...e,instances:o.map(e=>e.id===c?{...e,[s]:t}:e)})},p=async()=>{if(!c||!await (0,S.u)(r.settings?.ai?.confirmDelete||"Delete this instance?",{destructive:!0}))return;let e=o.filter(e=>e.id!==c);i({instances:e,activeInstanceId:e[0]?.id})};return(0,s.jsxs)("div",{className:"space-y-3 animate-in fade-in slide-in-from-top-2",children:[(0,s.jsxs)("div",{className:"space-y-2",children:[(0,s.jsxs)("div",{className:"flex items-center justify-between",children:[(0,s.jsx)(n.f,{children:r.settings?.ai?.instances||"Instance"}),(0,s.jsxs)(t.f,{type:"button",variant:"outline",size:"sm",onClick:()=>{if(o.length>=10)return;let e={id:"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,e=>{let s=16*Math.random()|0;return("x"===e?s:3&s|8).toString(16)}),name:`Instance ${o.length+1}`,apiKey:"",baseUrl:"https://api.openai.com/v1",model:"gpt-6.1-sol"};i({instances:[...o,e],activeInstanceId:e.id})},disabled:o.length>=10,className:"h-7 px-2 text-xs",children:[(0,s.jsx)(P.f,{className:"h-3 w-3 mr-1"}),r.settings?.ai?.addInstance||"Add"]})]}),o.length>0?(0,s.jsxs)("div",{className:"flex gap-2",children:[(0,s.jsxs)(a.d,{value:c||"",onValueChange:s=>i({...e,activeInstanceId:s}),children:[(0,s.jsx)(a.P,{className:"flex-1",children:(0,s.jsx)(a.U,{placeholder:r.settings?.ai?.selectInstance||"Select Instance"})}),(0,s.jsx)(a.r,{children:o.map(e=>(0,s.jsx)(a.T,{value:e.id,children:e.name},e.id))})]}),o.length>1&&(0,s.jsx)(t.f,{type:"button",variant:"outline",size:"icon",onClick:p,className:"h-10 w-10 text-destructive hover:text-destructive",children:(0,s.jsx)(E.f,{className:"h-4 w-4"})})]}):(0,s.jsx)("p",{className:"text-sm text-muted-foreground",children:r.settings?.ai?.noInstances||"No instances configured. Click 'Add' to create one."}),o.length>=10&&(0,s.jsx)("p",{className:"text-xs text-amber-600",children:r.settings?.ai?.maxInstancesReached||"Maximum instances reached (10)"})]}),d&&(0,s.jsxs)("div",{className:"space-y-3 p-3 border rounded-md bg-background",children:[(0,s.jsxs)("div",{className:"space-y-2",children:[(0,s.jsxs)(n.f,{children:[r.settings?.ai?.instanceName||"Instance Name"," ",(0,s.jsx)("span",{className:"text-destructive",children:"*"})]}),(0,s.jsx)(x.f,{value:d.name||"",onChange:e=>m("name",e.target.value),placeholder:"e.g. GLM-4V",className:d.name?.trim()?"":"border-destructive"})]}),(0,s.jsxs)("div",{className:"space-y-2",children:[(0,s.jsx)(I.f,{label:(0,s.jsxs)(s.Fragment,{children:["API Key ",(0,s.jsx)("span",{className:"text-destructive",children:"*"})]}),href:l?.apiKey,linkText:r.settings.ai.docLinks.apiKey}),(0,s.jsx)(z.f,{value:d.apiKey||"",onChange:e=>m("apiKey",e.target.value),placeholder:"sk-...",className:d.apiKey?.trim()?"":"border-destructive"})]}),(0,s.jsxs)("div",{className:"space-y-2 pt-4 border-t",children:[(0,s.jsxs)(n.f,{children:["Base URL ",(0,s.jsx)("span",{className:"text-destructive",children:"*"})]}),(0,s.jsx)(x.f,{value:d.baseUrl||"",onChange:e=>m("baseUrl",e.target.value),placeholder:"https://api.openai.com/v1",className:d.baseUrl?.trim()?"":"border-destructive"})]}),(0,s.jsx)(M.f,{provider:"openai",apiKey:d.apiKey,baseUrl:d.baseUrl,currentModel:d.model,onModelChange:e=>m("model",e),docsHref:l?.models})]})]})}function T({provider:e}){let{t:i}=(0,v.b)(),t=i.settings.ai.providerDocs,n=(0,A.f)(e);if(!n)return null;let a=[n.cn&&{href:n.cn,label:n.intl?t.cn:t.official},n.intl&&{href:n.intl,label:n.cn?t.intl:t.official}].filter(e=>!!e);return(0,s.jsxs)("p",{className:"flex flex-wrap items-center gap-x-3 gap-y-1 text-xs text-muted-foreground",children:[(0,s.jsx)("span",{children:t.title}),a.map(e=>(0,s.jsxs)("a",{href:e.href,target:"_blank",rel:"noopener noreferrer",className:"inline-flex items-center gap-1 underline",children:[e.label,(0,s.jsx)(d.f,{className:"h-3 w-3"})]},e.href))]})}var F=e.i(128093);function L({provider:e,value:i,onChange:t}){let{t:a}=(0,v.b)(),r=F.$[e],l=(e,s)=>t({...i,[e]:s}),o={qwen:a.settings?.ai?.qwenBaseUrlHint,stepfun:a.settings?.ai?.stepfunBaseUrlHint,volcengine:a.settings?.ai?.volcengineBaseUrlHint,"volcengine-agent":a.settings?.ai?.volcengineAgentBaseUrlHint,"volcengine-coding":a.settings?.ai?.volcengineCodingBaseUrlHint};return(0,s.jsxs)("div",{className:"space-y-3 animate-in fade-in slide-in-from-top-2",children:["volcengine-free"===e&&(0,s.jsxs)("div",{className:"rounded-md border border-green-200 bg-green-50 p-3 text-xs text-green-800 dark:border-green-900 dark:bg-green-950/40 dark:text-green-300",children:[(0,s.jsx)("p",{className:"font-medium",children:a.settings.ai.volcengineFree.title}),(0,s.jsx)("p",{className:"mt-1",children:a.settings.ai.volcengineFree.body})]}),(0,s.jsxs)("div",{className:"space-y-2",children:[(0,s.jsx)(I.f,{label:"API Key",href:r.docs.apiKey,linkText:a.settings.ai.docLinks.apiKey}),(0,s.jsx)(z.f,{value:i?.apiKey||"",onChange:e=>l("apiKey",e.target.value),placeholder:"sk-..."}),(0,s.jsxs)("p",{className:"text-xs text-muted-foreground",children:[a.settings?.ai?.vendorApiKeyHint||"Get an API key from the console:"," ",(0,s.jsx)("a",{href:r.consoleUrl,target:"_blank",rel:"noopener noreferrer",className:"underline break-all",children:r.consoleUrl})]})]}),(0,s.jsxs)("div",{className:"space-y-2",children:[(0,s.jsx)(n.f,{children:"Base URL (Optional)"}),(0,s.jsx)(x.f,{value:i?.baseUrl||"",onChange:e=>l("baseUrl",e.target.value),placeholder:r.baseUrl}),(0,s.jsx)("p",{className:"text-xs text-muted-foreground",children:o[e]??a.settings?.ai?.vendorBaseUrlHint})]}),(0,s.jsx)(M.f,{provider:e,apiKey:i?.apiKey,baseUrl:i?.baseUrl,currentModel:i?.model||r.model,onModelChange:e=>l("model",e),docsHref:r.docs.models})]})}e.s(["f",0,function({config:e,setConfig:d,loading:m,saving:p,onSave:u}){let{t:h,language:x}=(0,v.b)();return m?(0,s.jsx)("div",{className:"flex justify-center py-4",children:(0,s.jsx)(i.f,{className:"h-6 w-6 animate-spin text-muted-foreground"})}):(0,s.jsxs)("div",{className:"space-y-4 border rounded-lg p-4 bg-muted/30",children:[(0,s.jsxs)("div",{className:"space-y-2",children:[(0,s.jsx)(n.f,{children:h.settings?.tabs?.ai||"AI Provider"}),(0,s.jsxs)(a.d,{value:e.aiProvider,onValueChange:e=>d(s=>({...s,aiProvider:e})),children:[(0,s.jsx)(a.P,{children:(0,s.jsx)(a.U,{})}),(0,s.jsxs)(a.r,{children:[(0,s.jsx)(a.T,{value:"minimax",children:(0,F.z)("minimax",x)}),(0,s.jsx)(a.T,{value:"minimax-code",children:"MiniMax Code OAuth"}),F.U.filter(e=>"minimax"!==e).map(e=>(0,s.jsx)(a.T,{value:e,children:(0,F.z)(e,x)},e)),(0,s.jsx)(a.T,{value:"anthropic",children:"Anthropic / Compatible"}),(0,s.jsx)(a.T,{value:"azure",children:"Azure OpenAI"}),(0,s.jsx)(a.T,{value:"openai",children:"OpenAI / Compatible"}),(0,s.jsx)(a.T,{value:"gemini",children:"Google Gemini"})]})]}),(0,s.jsx)(T,{provider:e.aiProvider})]}),"openai"===e.aiProvider&&(0,s.jsx)(R,{value:e.openai,onChange:e=>d(s=>({...s,openai:e}))}),"gemini"===e.aiProvider&&(0,s.jsx)(c.f,{value:e.gemini,onChange:e=>d(s=>({...s,gemini:e}))}),"minimax-code"===e.aiProvider&&(0,s.jsx)(K,{value:e.minimaxCode,onChange:e=>d(s=>({...s,minimaxCode:e}))}),"anthropic"===e.aiProvider&&(0,s.jsx)(l.f,{value:e.anthropic,onChange:e=>d(s=>({...s,anthropic:e}))}),(0,F.j)(e.aiProvider)&&(0,s.jsx)(L,{provider:e.aiProvider,value:e[e.aiProvider],onChange:e=>d(s=>({...s,[s.aiProvider]:e}))},e.aiProvider),"azure"===e.aiProvider&&(0,s.jsx)(o.f,{value:e.azure,onChange:e=>d(s=>({...s,azure:e}))}),(0,s.jsx)(r.f,{config:e,saving:p,saveButton:(0,s.jsxs)(t.f,{onClick:u,disabled:p,className:"flex-1",children:[p&&(0,s.jsx)(i.f,{className:"mr-2 h-4 w-4 animate-spin"}),h.settings?.ai?.save||"Save AI Settings"]})})]})}],10038),e.s(["f",0,function(e,s){if(!(0,y.L)(e.timeZone??y.J))return s.settings.general.invalidTimeZone;if("openai"===e.aiProvider)for(let i of e.openai?.instances||[]){if(!i.name?.trim())return s.settings?.ai?.validationNameRequired||"Instance name is required";if(!i.apiKey?.trim())return s.settings?.ai?.validationApiKeyRequired||"API Key is required";if(!i.baseUrl?.trim())return s.settings?.ai?.validationBaseUrlRequired||"Base URL is required";if(!i.model?.trim())return s.settings?.ai?.validationModelRequired||"Model name is required"}if("azure"===e.aiProvider){if(!e.azure?.endpoint?.trim())return s.settings?.ai?.validationAzureEndpointRequired||"Azure Endpoint is required";if(!e.azure?.deploymentName?.trim())return s.settings?.ai?.validationAzureDeploymentRequired||"Deployment Name is required";if(!e.azure?.apiKey?.trim())return s.settings?.ai?.validationApiKeyRequired||"API Key is required"}return null}],835467)},459649,464034,434901,62189,118585,75977,97923,e=>{var s=e.i(843476),i=e.i(793479),t=e.i(37038),n=e.i(110204),a=e.i(271645),r=e.i(519455),l=e.i(967489),o=e.i(482022),c=e.i(741120),d=e.i(632781),m=e.i(41931),p=e.i(111110),u=e.i(128093),h=e.i(201276);function x({provider:e,apiKey:t,baseUrl:f,currentModel:g,onModelChange:v,docsHref:j}){let{t:y}=(0,p.b)(),[b,N]=(0,a.useState)([]),[k,w]=(0,a.useState)(!1),[C,S]=(0,a.useState)(null),[U,K]=(0,a.useState)(g||""),[P,E]=(0,a.useState)(!1),[M,I]=(0,a.useState)(g);g!==M&&(I(g),K(g||""));let z=async()=>{if(!t)return void S(y.modelSelector?.enterApiKeyFirst||"Please enter API Key first");w(!0),S(null);try{let s=await m.k.post("/api/ai/models",{provider:e,apiKey:t,...f&&{baseUrl:f}});if("error"in s&&"string"==typeof s.error){S(s.error),E(!0),N([]);return}N(s.models),0===s.models.length&&(S(y.modelSelector?.noVisionModel||"No vision model found, please enter manually"),E(!0))}catch(s){h.V.error("[ModelSelector]","Failed to fetch models",{error:s});let e=s instanceof Error&&s.message||y.modelSelector?.fetchFailed||"Failed to fetch models";S(e+(y.modelSelector?.enterManually||", please enter manually")),E(!0)}finally{w(!1)}};return(0,s.jsxs)("div",{className:"space-y-2",children:[(0,s.jsxs)("div",{className:"flex items-center gap-2",children:[(0,s.jsx)(n.f,{className:"flex-1",children:y.modelSelector?.modelName||"Model Name"}),j&&(0,s.jsxs)("a",{href:j,target:"_blank",rel:"noopener noreferrer",className:"inline-flex shrink-0 items-center gap-1 text-xs text-muted-foreground underline",children:[y.settings.ai.docLinks.models,(0,s.jsx)(o.f,{className:"h-3 w-3"})]}),(0,s.jsx)(r.f,{type:"button",variant:"outline",size:"sm",onClick:z,disabled:k||!t,children:k?(0,s.jsx)(d.f,{className:"h-3 w-3 animate-spin"}):(0,s.jsx)(c.f,{className:"h-3 w-3"})})]}),C&&(0,s.jsx)("p",{className:"text-xs text-yellow-600",children:C}),P||0===b.length?(0,s.jsxs)("div",{className:"space-y-2",children:[(0,s.jsx)(i.f,{value:U,onChange:e=>{var s;K(s=e.target.value),v(s)},placeholder:(0,u.j)(e)?u.$[e].model:"openai"===e?"gpt-6.1-sol":"gemini-1.5-flash"}),b.length>0&&(0,s.jsx)(r.f,{type:"button",variant:"link",size:"sm",className:"h-auto p-0 text-xs",onClick:()=>E(!1),children:y.modelSelector?.selectFromList||"Select from List"})]}):(0,s.jsx)("div",{className:"space-y-2",children:(0,s.jsxs)(l.d,{value:g,onValueChange:e=>{"_custom"===e?E(!0):(E(!1),K(e),v(e))},children:[(0,s.jsx)(l.P,{children:(0,s.jsx)(l.U,{placeholder:y.modelSelector?.selectModel||"Select Model"})}),(0,s.jsxs)(l.r,{children:[b.map(e=>(0,s.jsxs)(l.T,{value:e.id,children:[e.name,e.owned_by&&` (${e.owned_by})`]},e.id)),(0,s.jsx)(l.T,{value:"_custom",children:y.modelSelector?.customInput||"Custom Input..."})]})]})})]})}function f({label:e,href:i,linkText:t}){return i?(0,s.jsxs)("div",{className:"flex items-center justify-between gap-2",children:[(0,s.jsx)(n.f,{children:e}),(0,s.jsxs)("a",{href:i,target:"_blank",rel:"noopener noreferrer",className:"inline-flex shrink-0 items-center gap-1 text-xs text-muted-foreground underline",children:[t,(0,s.jsx)(o.f,{className:"h-3 w-3"})]})]}):(0,s.jsx)(n.f,{children:e})}e.s(["f",0,x],464034),e.s(["f",0,f],434901);let g={openai:{intl:"https://platform.openai.com/docs/api-reference",apiKey:"https://platform.openai.com/docs/quickstart",models:"https://platform.openai.com/docs/models"},anthropic:{intl:"https://docs.anthropic.com/en/api/overview",apiKey:"https://docs.anthropic.com/en/api/getting-started",models:"https://docs.anthropic.com/en/docs/about-claude/models/overview"},azure:{intl:"https://learn.microsoft.com/azure/ai-foundry/openai/reference",apiKey:"https://learn.microsoft.com/azure/ai-foundry/openai/how-to/create-resource",models:"https://learn.microsoft.com/azure/ai-foundry/openai/concepts/models"},gemini:{intl:"https://ai.google.dev/gemini-api/docs",apiKey:"https://ai.google.dev/gemini-api/docs/api-key",models:"https://ai.google.dev/gemini-api/docs/models"}};function v(e){return(0,u.j)(e)?u.$[e].docs:g[e]??null}e.s(["f",0,v],62189),e.s(["f",0,function({value:e,onChange:a}){let{t:r}=(0,p.b)(),l=v("anthropic"),o=(s,i)=>a({...e,[s]:i});return(0,s.jsxs)("div",{className:"space-y-3 animate-in fade-in slide-in-from-top-2",children:[(0,s.jsxs)("div",{className:"space-y-2",children:[(0,s.jsx)(f,{label:"API Key",href:l?.apiKey,linkText:r.settings.ai.docLinks.apiKey}),(0,s.jsx)(t.f,{value:e?.apiKey||"",onChange:e=>o("apiKey",e.target.value),placeholder:"sk-ant-..."})]}),(0,s.jsxs)("div",{className:"space-y-2",children:[(0,s.jsx)(n.f,{children:"Base URL (Optional)"}),(0,s.jsx)(i.f,{value:e?.baseUrl||"",onChange:e=>o("baseUrl",e.target.value),placeholder:"https://api.anthropic.com"}),(0,s.jsx)("p",{className:"text-xs text-muted-foreground",children:r.settings?.ai?.anthropicBaseUrlHint})]}),(0,s.jsx)(x,{provider:"anthropic",apiKey:e?.apiKey,baseUrl:e?.baseUrl,currentModel:e?.model,onModelChange:e=>o("model",e),docsHref:l?.models})]})}],459649),e.s(["f",0,function({value:e,onChange:a}){let{t:r}=(0,p.b)(),l=v("azure"),o=(s,i)=>a({...e,[s]:i}),c=e=>e?.trim()?"":"border-destructive";return(0,s.jsxs)("div",{className:"space-y-3 animate-in fade-in slide-in-from-top-2",children:[(0,s.jsxs)("div",{className:"space-y-2",children:[(0,s.jsxs)(n.f,{children:[r.settings?.ai?.azureEndpoint||"Azure Endpoint"," ",(0,s.jsx)("span",{className:"text-destructive",children:"*"})]}),(0,s.jsx)(i.f,{value:e?.endpoint||"",onChange:e=>o("endpoint",e.target.value),placeholder:r.settings?.ai?.azureEndpointPlaceholder||"https://your-resource.openai.azure.com",className:c(e?.endpoint)})]}),(0,s.jsxs)("div",{className:"space-y-2",children:[(0,s.jsx)(f,{label:(0,s.jsxs)(s.Fragment,{children:[r.settings?.ai?.azureDeployment||"Deployment Name"," ",(0,s.jsx)("span",{className:"text-destructive",children:"*"})]}),href:l?.models,linkText:r.settings.ai.docLinks.models}),(0,s.jsx)(i.f,{value:e?.deploymentName||"",onChange:e=>o("deploymentName",e.target.value),placeholder:r.settings?.ai?.azureDeploymentPlaceholder||"gpt-4o-deployment",className:c(e?.deploymentName)})]}),(0,s.jsxs)("div",{className:"space-y-2",children:[(0,s.jsx)(f,{label:(0,s.jsxs)(s.Fragment,{children:["API Key ",(0,s.jsx)("span",{className:"text-destructive",children:"*"})]}),href:l?.apiKey,linkText:r.settings.ai.docLinks.apiKey}),(0,s.jsx)(t.f,{value:e?.apiKey||"",onChange:e=>o("apiKey",e.target.value),placeholder:"xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",className:c(e?.apiKey)})]}),(0,s.jsxs)("div",{className:"space-y-2",children:[(0,s.jsx)(n.f,{children:r.settings?.ai?.azureApiVersion||"API Version"}),(0,s.jsx)(i.f,{value:e?.apiVersion||"",onChange:e=>o("apiVersion",e.target.value),placeholder:r.settings?.ai?.azureApiVersionPlaceholder||"2024-02-15-preview"})]}),(0,s.jsxs)("div",{className:"space-y-2",children:[(0,s.jsx)(n.f,{children:r.settings?.ai?.azureModel||"Model Display Name"}),(0,s.jsx)(i.f,{value:e?.model||"",onChange:e=>o("model",e.target.value),placeholder:"gpt-4o"})]})]})}],118585),e.s(["f",0,function({value:e,onChange:a}){let{t:r}=(0,p.b)(),l=v("gemini"),o=(s,i)=>a({...e,[s]:i});return(0,s.jsxs)("div",{className:"space-y-3 animate-in fade-in slide-in-from-top-2",children:[(0,s.jsxs)("div",{className:"space-y-2",children:[(0,s.jsx)(f,{label:"API Key",href:l?.apiKey,linkText:r.settings.ai.docLinks.apiKey}),(0,s.jsx)(t.f,{value:e?.apiKey||"",onChange:e=>o("apiKey",e.target.value),placeholder:"AIza..."})]}),(0,s.jsxs)("div",{className:"space-y-2",children:[(0,s.jsx)(n.f,{children:"Base URL (Optional)"}),(0,s.jsx)(i.f,{value:e?.baseUrl||"",onChange:e=>o("baseUrl",e.target.value),placeholder:"https://generativelanguage.googleapis.com"})]}),(0,s.jsx)(x,{provider:"gemini",apiKey:e?.apiKey,baseUrl:e?.baseUrl,currentModel:e?.model,onModelChange:e=>o("model",e),docsHref:l?.models})]})}],75977);var j=e.i(456420);let y={name:"log-in",size:24,node:[["path",{d:"m10 17 5-5-5-5",key:"1bsop3"}],["path",{d:"M15 12H3",key:"6jk70r"}],["path",{d:"M15 3h4a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2h-4",key:"u53s6r"}]]};y.node;let b=(0,j.f)(y);e.s(["f",0,b],97923)},37038,e=>{var s=e.i(843476),i=e.i(271645),t=e.i(772382),n=e.i(580860),a=e.i(519455),r=e.i(793479),l=e.i(111110),o=e.i(975157);e.s(["f",0,function({className:e,...c}){let{t:d}=(0,l.b)(),[m,p]=(0,i.useState)(!1);return(0,s.jsxs)("div",{className:"relative",children:[(0,s.jsx)(r.f,{type:m?"text":"password",className:(0,o.f)("pr-10",e),...c}),(0,s.jsx)(a.f,{type:"button",variant:"ghost",size:"icon",className:"absolute right-0 top-0 h-full px-3 py-2 hover:bg-transparent",onClick:()=>p(!m),"aria-label":m?d.common.hidePassword:d.common.showPassword,tabIndex:-1,children:m?(0,s.jsx)(n.f,{className:"h-4 w-4 text-muted-foreground"}):(0,s.jsx)(t.f,{className:"h-4 w-4 text-muted-foreground"})})]})}])}])})();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(()=>{"use strict";(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,711241,e=>{var t=e.i(456420);let s={name:"arrow-left",size:24,node:[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]]};s.node;let a=(0,t.f)(s);e.s(["f",0,a],711241)},666776,e=>{var t=e.i(843476),s=e.i(271645),a=e.i(618566),i=e.i(519455),n=e.i(912505),o=e.i(393842),r=e.i(86963),l=e.i(632781),c=e.i(456420);let d={name:"locate-fixed",size:24,node:[["line",{x1:"2",x2:"5",y1:"12",y2:"12",key:"bvdh0s"}],["line",{x1:"19",x2:"22",y1:"12",y2:"12",key:"1tbv5k"}],["line",{x1:"12",x2:"12",y1:"2",y2:"5",key:"11lu5j"}],["line",{x1:"12",x2:"12",y1:"19",y2:"22",key:"x3vr5v"}],["circle",{cx:"12",cy:"12",r:"7",key:"fim9np"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]]};d.node;let h=(0,c.f)(d);var m=e.i(793479),u=e.i(111110),x=e.i(833547),g=e.i(747279);function f(){let{t:e}=(0,u.b)(),n=(0,a.useRouter)(),[o,r]=(0,s.useState)(""),[c,d]=(0,s.useState)(null),[f,b]=(0,s.useState)(!1),y=async t=>{t.preventDefault();let s=o.trim();if(!(0,g.f)(s))return void d(e.shortId.invalid);b(!0),d(null);let a=await (0,x.f)(s);b(!1),a?n.push(`/error-items/${a}`):d(e.shortId.notFound)};return(0,t.jsxs)("form",{onSubmit:y,className:"space-y-1",children:[(0,t.jsxs)("div",{className:"flex gap-2",children:[(0,t.jsx)(m.f,{value:o,onChange:e=>{r(e.target.value),d(null)},placeholder:e.shortId.locatePlaceholder,maxLength:6,className:"font-mono sm:max-w-xs","aria-label":e.shortId.locateTitle}),(0,t.jsxs)(i.f,{type:"submit",variant:"outline",disabled:f||!o.trim(),children:[f?(0,t.jsx)(l.f,{className:"h-4 w-4 animate-spin"}):(0,t.jsx)(h,{className:"h-4 w-4"}),(0,t.jsx)("span",{className:"ml-2",children:e.shortId.locate})]})]}),c&&(0,t.jsx)("p",{className:"text-xs text-destructive",children:c})]})}var b=e.i(856423),y=e.i(77071);let p={name:"atom",size:24,node:[["circle",{cx:"12",cy:"12",r:"1",key:"41hilf"}],["path",{d:"M20.2 20.2c2.04-2.03.02-7.36-4.5-11.9-4.54-4.52-9.87-6.54-11.9-4.5-2.04 2.03-.02 7.36 4.5 11.9 4.54 4.52 9.87 6.54 11.9 4.5Z",key:"1l2ple"}],["path",{d:"M15.7 15.7c4.52-4.54 6.54-9.87 4.5-11.9-2.03-2.04-7.36-.02-11.9 4.5-4.52 4.54-6.54 9.87-4.5 11.9 2.03 2.04 7.36.02 11.9-4.5Z",key:"1wam0m"}]]};p.node;let k=(0,c.f)(p),j={name:"book-text",size:24,node:[["path",{d:"M4 19.5v-15A2.5 2.5 0 0 1 6.5 2H19a1 1 0 0 1 1 1v18a1 1 0 0 1-1 1H6.5a1 1 0 0 1 0-5H20",key:"k3hazp"}],["path",{d:"M8 11h8",key:"vwpz6n"}],["path",{d:"M8 7h6",key:"1f0q6e"}]]};j.node;let v=(0,c.f)(j);var N=e.i(867927);let w={name:"flask-conical",size:24,node:[["path",{d:"M14 2v6a2 2 0 0 0 .245.96l5.51 10.08A2 2 0 0 1 18 22H6a2 2 0 0 1-1.755-2.96l5.51-10.08A2 2 0 0 0 10 8V2",key:"18mbvz"}],["path",{d:"M6.453 15h11.094",key:"3shlmq"}],["path",{d:"M8.5 2h7",key:"csnxdl"}]]};w.node;let C=(0,c.f)(w),M={name:"globe",size:24,node:[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 2a14.5 14.5 0 0 0 0 20 14.5 14.5 0 0 0 0-20",key:"13o1zl"}],["path",{d:"M2 12h20",key:"9i4pu4"}]]};M.node;let z=(0,c.f)(M),S={name:"landmark",size:24,node:[["path",{d:"M10 18v-7",key:"wt116b"}],["path",{d:"M11.119 2.205a2 2 0 0 1 1.762 0l7.84 3.846A.5.5 0 0 1 20.5 7h-17a.5.5 0 0 1-.22-.949z",key:"yxxwt6"}],["path",{d:"M14 18v-7",key:"vav6t3"}],["path",{d:"M18 18v-7",key:"aexdmj"}],["path",{d:"M3 22h18",key:"8prr45"}],["path",{d:"M6 18v-7",key:"1ivflk"}]]};S.node;let F=(0,c.f)(S);var H=e.i(999092);let V={name:"leaf",size:24,node:[["path",{d:"M11 20a10 10 0 0010-10 25.9 25.9 0 00-1.04-7.281 1 1 0 00-1.755-.325C15.833 5.5 13 5.5 9.8 6.1A7 7 0 0011 20",key:"1wjnjv"}],["path",{d:"M2 21a5 5 0 012.911-4.544C7.613 15.212 8.351 15.24 11 13",key:"c1ejpn"}]]};V.node;let E=(0,c.f)(V),L={name:"scale",size:24,node:[["path",{d:"M12 3v18",key:"108xh3"}],["path",{d:"m19 8 3 8a5 5 0 0 1-6 0zV7",key:"zcdpyk"}],["path",{d:"M3 7h1a17 17 0 0 0 8-2 17 17 0 0 0 8 2h1",key:"1yorad"}],["path",{d:"m5 8 3 8a5 5 0 0 1-6 0zV7",key:"eua70x"}],["path",{d:"M7 21h10",key:"1b0cd5"}]]};L.node;let T=(0,c.f)(L),I={name:"sigma",size:24,node:[["path",{d:"M18 7V5a1 1 0 0 0-1-1H6.5a.5.5 0 0 0-.4.8l4.5 6a2 2 0 0 1 0 2.4l-4.5 6a.5.5 0 0 0 .4.8H17a1 1 0 0 0 1-1v-2",key:"wuwx1p"}]]};I.node;let K=(0,c.f)(I);var P=e.i(709830),A=e.i(76824);let R={math:{icon:K,className:"bg-blue-100 text-blue-600 dark:bg-blue-500/15 dark:text-blue-300"},english:{icon:H.f,className:"bg-emerald-100 text-emerald-600 dark:bg-emerald-500/15 dark:text-emerald-300"},chinese:{icon:v,className:"bg-rose-100 text-rose-600 dark:bg-rose-500/15 dark:text-rose-300"},physics:{icon:k,className:"bg-amber-100 text-amber-600 dark:bg-amber-500/15 dark:text-amber-300"},chemistry:{icon:C,className:"bg-teal-100 text-teal-600 dark:bg-teal-500/15 dark:text-teal-300"},biology:{icon:E,className:"bg-lime-100 text-lime-700 dark:bg-lime-500/15 dark:text-lime-300"},history:{icon:F,className:"bg-orange-100 text-orange-600 dark:bg-orange-500/15 dark:text-orange-300"},geography:{icon:z,className:"bg-cyan-100 text-cyan-600 dark:bg-cyan-500/15 dark:text-cyan-300"},politics:{icon:T,className:"bg-red-100 text-red-600 dark:bg-red-500/15 dark:text-red-300"}},U={icon:b.f,className:"bg-accent text-accent-foreground"};function O({name:e,stage:s,subjectKey:a,errorCount:i,onClick:n,itemLabel:o="items"}){let r=(0,A.v)({name:e,stage:s,subjectKey:a}),{icon:l,className:c}=r.subject?R[r.subject]:U;return(0,t.jsxs)("div",{role:"link",tabIndex:0,className:"group relative flex cursor-pointer items-center gap-4 rounded-2xl border bg-card p-4 shadow-sm transition-all hover:-translate-y-0.5 hover:border-primary/40 hover:shadow-md focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring",onClick:n,onKeyDown:e=>{"Enter"===e.key&&n()},children:[(0,t.jsx)("div",{className:`flex h-12 w-12 shrink-0 items-center justify-center rounded-xl ${c}`,children:(0,t.jsx)(l,{className:"h-6 w-6"})}),(0,t.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,t.jsx)("h3",{className:"truncate font-semibold",children:e}),(0,t.jsxs)("p",{className:"mt-0.5 flex items-center gap-1.5 text-sm text-muted-foreground",children:[(0,t.jsx)("span",{className:"font-medium tabular-nums text-foreground",children:i}),o,(0,t.jsx)("span",{className:"text-border",children:"|"}),(0,t.jsx)(P.E,{notebook:{name:e,stage:s,subjectKey:a},className:"truncate"})]})]}),(0,t.jsx)(N.f,{className:"h-4 w-4 shrink-0 text-muted-foreground"})]})}var _=e.i(527161),W=e.i(41931),$=e.i(35209),D=e.i(294114),B=e.i(201276),q=e.i(303163);e.s(["default",0,function(){let e=(0,a.useRouter)(),{t:l}=(0,u.b)();(0,$.f)(l.notebooks.title);let[c,d]=(0,s.useState)([]),[h,m]=(0,s.useState)(!0),[x,g]=(0,s.useState)(!1),p=(0,s.useCallback)(async()=>{try{let e=await W.f.get("/api/notebooks");d(e)}catch(e){B.V.error("[Notebooks]","Failed to fetch notebooks",{error:e})}finally{m(!1)}},[]);(0,s.useEffect)(()=>{p()},[p]);let k=async e=>{try{await W.f.post("/api/notebooks",e),await p()}catch(t){B.V.error("[Notebooks]","Failed to create notebook",{error:t});let e=(0,q.d)(t)||l.notebooks?.createError||"Failed to create";D.c.error(e)}};return h?(0,t.jsx)(r.f,{label:l.common.loading}):(0,t.jsx)("main",{className:"mx-auto min-h-screen max-w-6xl px-4 py-6 md:px-8 md:py-8",children:(0,t.jsxs)("div",{className:"space-y-6",children:[(0,t.jsx)(o.f,{title:l.notebooks?.title||"My Notebooks",description:l.notebooks?.subtitle||"Manage your mistakes by subject",actions:(0,t.jsxs)(i.f,{onClick:()=>g(!0),"aria-label":l.notebooks?.create||"New Notebook",children:[(0,t.jsx)(y.f,{className:"h-4 w-4"}),(0,t.jsx)("span",{className:"hidden sm:inline",children:l.notebooks?.create||"New Notebook"})]})}),(0,t.jsx)(f,{}),0===c.length?(0,t.jsx)(n.f,{icon:b.f,title:l.notebooks?.empty||"No notebooks yet.",action:(0,t.jsxs)(i.f,{onClick:()=>g(!0),children:[(0,t.jsx)(y.f,{className:"h-4 w-4"}),l.notebooks?.createFirst||"Create Notebook"]})}):(0,t.jsx)("div",{className:"grid grid-cols-1 gap-4 sm:grid-cols-2 lg:grid-cols-3",children:c.map(s=>(0,t.jsx)(O,{name:s.name,stage:s.stage,subjectKey:s.subjectKey,errorCount:s._count?.errorItems||0,onClick:()=>{var t;return t=s.id,void e.push(`/notebooks/${t}`)},itemLabel:l.notebooks.cardItems},s.id))}),(0,t.jsx)(_.f,{open:x,onOpenChange:g,onCreate:k},l.common.loading)]})})}],666776)},527161,e=>{var t=e.i(843476),s=e.i(271645),a=e.i(776639),i=e.i(519455),n=e.i(793479),o=e.i(110204),r=e.i(967489),l=e.i(709830),c=e.i(111110),d=e.i(76824),h=e.i(41931),m=e.i(294114),u=e.i(201276);async function x(){try{let e=await h.f.get("/api/tags?tagSetsOnly=true");return e.tagSets?.length?e.tagSets:["default"]}catch{return["default"]}}e.s(["f",0,function({open:e,onOpenChange:h,onCreate:g}){let[f,b]=(0,s.useState)(""),[y,p]=(0,s.useState)(d.j),[k,j]=(0,s.useState)(d.W[d.j][0]),[v,N]=(0,s.useState)("default"),[w,C]=(0,s.useState)(["default"]),[M,z]=(0,s.useState)(!1),{t:S}=(0,c.b)(),{stageLabel:F,subjectLabel:H}=(0,l.O)();(0,s.useEffect)(()=>{e&&x().then(C)},[e]);let V=async()=>{if(!f.trim())return void m.c.warning(S.notebooks?.dialog?.enterName||"Please enter notebook name");z(!0);try{await g({name:f.trim(),stage:y,subjectKey:k,tagSet:v}),b(""),h(!1)}catch(e){u.V.error("[CreateNotebook]","Failed to create notebook",{error:e})}finally{z(!1)}};return(0,t.jsx)(a.N,{open:e,onOpenChange:h,children:(0,t.jsxs)(a.d,{children:[(0,t.jsxs)(a.s,{children:[(0,t.jsx)(a.F,{children:S.notebooks?.dialog?.title||"Create New Notebook"}),(0,t.jsx)(a.C,{children:S.notebooks?.dialog?.desc||"Create separate notebooks for different subjects or chapters"})]}),(0,t.jsxs)("div",{className:"space-y-4 py-4",children:[(0,t.jsxs)("div",{className:"grid grid-cols-2 gap-3",children:[(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsx)(o.f,{htmlFor:"notebook-stage",children:S.notebooks.dialog.stageLabel}),(0,t.jsxs)(r.d,{value:y,onValueChange:e=>{p(e),d.W[e].includes(k)||j(d.W[e][0])},children:[(0,t.jsx)(r.P,{id:"notebook-stage",children:(0,t.jsx)(r.U,{})}),(0,t.jsx)(r.r,{children:d.c.map(e=>(0,t.jsx)(r.T,{value:e,children:F(e)},e))})]})]}),(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsx)(o.f,{htmlFor:"notebook-subject",children:S.notebooks.dialog.subjectLabel}),(0,t.jsxs)(r.d,{value:k,onValueChange:e=>j(e),children:[(0,t.jsx)(r.P,{id:"notebook-subject",children:(0,t.jsx)(r.U,{})}),(0,t.jsx)(r.r,{children:d.W[y].map(e=>(0,t.jsx)(r.T,{value:e,children:H(e)},e))})]})]})]}),w.length>1&&(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsx)(o.f,{htmlFor:"notebook-tagset",children:S.notebooks.dialog.tagSetLabel}),(0,t.jsxs)(r.d,{value:v,onValueChange:N,children:[(0,t.jsx)(r.P,{id:"notebook-tagset",children:(0,t.jsx)(r.U,{})}),(0,t.jsx)(r.r,{children:w.map(e=>(0,t.jsx)(r.T,{value:e,children:"default"===e?S.notebooks.dialog.tagSetDefault||"Built-in":S.notebooks.dialog.tagSetNames?.[e]||e},e))})]})]}),(0,t.jsx)("p",{className:"text-xs text-muted-foreground",children:S.notebooks.dialog.scopeHint}),(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsx)(o.f,{htmlFor:"name",children:S.notebooks?.dialog?.nameLabel||"Notebook Name"}),(0,t.jsx)(n.f,{id:"name",placeholder:S.notebooks?.dialog?.placeholder||"e.g. Math, Physics, Chemistry...",value:f,onChange:e=>b(e.target.value),onKeyDown:e=>"Enter"===e.key&&V()})]})]}),(0,t.jsxs)(a.c,{children:[(0,t.jsx)(i.f,{variant:"outline",onClick:()=>h(!1),children:S.common.cancel}),(0,t.jsx)(i.f,{onClick:V,disabled:M||!f.trim(),children:M?S.notebooks?.dialog?.creating||"Creating...":S.notebooks?.dialog?.create||"Create"})]})]})})}])},709830,76824,e=>{var t=e.i(843476),s=e.i(111110),a=e.i(952122);let i=["primary","junior_high","senior_high"],n="primary",o=["math","english","chinese","physics","chemistry","biology","history","geography","politics"];function r(e){return"string"==typeof e&&o.includes(e)}function l(e){var t;let s=r(e.subjectKey)?e.subjectKey:(0,a.f)(e.name);return{stage:"string"==typeof(t=e.stage)&&i.includes(t)?e.stage:n,subject:s&&r(s)?s:null}}function c(){let{t:e}=(0,s.b)();return{stageLabel:t=>({primary:e.auth.primary,junior_high:e.auth.juniorHigh,senior_high:e.auth.seniorHigh})[t],subjectLabel:t=>e.tags.subjects[t]}}e.s(["j",0,n,"c",0,i,"W",0,{primary:["math","english","chinese"],junior_high:o,senior_high:o},"v",0,l],76824),e.s(["E",0,function({notebook:e,className:s}){let{stageLabel:a,subjectLabel:i}=c(),n=l(e);return(0,t.jsxs)("span",{className:s,children:[a(n.stage),n.subject?` \xb7 ${i(n.subject)}`:""]})},"O",0,c],709830)},590546,e=>{var t=e.i(843476),s=e.i(618566),a=e.i(519455),i=e.i(711241);e.s(["f",0,function({fallbackUrl:e,className:n}){let o=(0,s.useRouter)();return(0,t.jsx)(a.f,{variant:"ghost",size:"icon",onClick:()=>{o.push(e)},className:n,children:(0,t.jsx)(i.f,{className:"h-5 w-5"})})}])},912505,e=>{var t=e.i(843476),s=e.i(975157);e.s(["f",0,function({icon:e,title:a,description:i,action:n,className:o}){return(0,t.jsxs)("div",{className:(0,s.f)("flex flex-col items-center justify-center rounded-2xl border border-dashed bg-card/50 px-6 py-14 text-center",o),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:a}),i&&(0,t.jsx)("p",{className:"mt-1 max-w-sm text-sm text-muted-foreground",children:i}),n&&(0,t.jsx)("div",{className:"mt-5",children:n})]})}])},393842,e=>{var t=e.i(843476),s=e.i(590546),a=e.i(975157);e.s(["f",0,function({title:e,description:i,backHref:n,actions:o,titleAddon:r,className:l}){return(0,t.jsxs)("div",{className:(0,a.f)("flex items-start gap-3",l),children:[n&&(0,t.jsx)(s.f,{fallbackUrl:n,className:"-ml-2 shrink-0"}),(0,t.jsxs)("div",{className:"min-w-0 flex-1 space-y-1",children:[(0,t.jsxs)("div",{className:"flex items-center gap-1",children:[(0,t.jsx)("h1",{className:"truncate text-2xl font-bold tracking-tight sm:text-3xl",children:e}),r]}),i&&(0,t.jsx)("p",{className:"text-sm text-muted-foreground sm:text-base",children:i})]}),o&&(0,t.jsx)("div",{className:"flex shrink-0 items-center gap-2",children:o})]})}])},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})]})}])},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}])},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])}])},833547,747279,e=>{var t=e.i(41931);async function s(e){try{return(await t.f.get(`/api/error-items/short/${encodeURIComponent(e)}`)).id}catch{return null}}e.s(["f",0,s],833547);let a=RegExp("^[123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz]{6}$");e.s(["f",0,function(e){return"string"==typeof e&&a.test(e)}],747279)}])})();
|
|
1
|
+
(()=>{"use strict";(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,711241,e=>{var t=e.i(456420);let s={name:"arrow-left",size:24,node:[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]]};s.node;let a=(0,t.f)(s);e.s(["f",0,a],711241)},666776,e=>{var t=e.i(843476),s=e.i(271645),a=e.i(618566),i=e.i(519455),n=e.i(912505),o=e.i(393842),r=e.i(86963),l=e.i(632781),c=e.i(456420);let d={name:"locate-fixed",size:24,node:[["line",{x1:"2",x2:"5",y1:"12",y2:"12",key:"bvdh0s"}],["line",{x1:"19",x2:"22",y1:"12",y2:"12",key:"1tbv5k"}],["line",{x1:"12",x2:"12",y1:"2",y2:"5",key:"11lu5j"}],["line",{x1:"12",x2:"12",y1:"19",y2:"22",key:"x3vr5v"}],["circle",{cx:"12",cy:"12",r:"7",key:"fim9np"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]]};d.node;let h=(0,c.f)(d);var m=e.i(793479),u=e.i(111110),x=e.i(833547),g=e.i(747279);function b(){let{t:e}=(0,u.b)(),n=(0,a.useRouter)(),[o,r]=(0,s.useState)(""),[c,d]=(0,s.useState)(null),[b,f]=(0,s.useState)(!1),y=async t=>{t.preventDefault();let s=o.trim();if(!(0,g.f)(s))return void d(e.shortId.invalid);f(!0),d(null);let a=await (0,x.f)(s);f(!1),a?n.push(`/error-items/${a}`):d(e.shortId.notFound)};return(0,t.jsxs)("form",{onSubmit:y,className:"space-y-1",children:[(0,t.jsxs)("div",{className:"flex gap-2",children:[(0,t.jsx)(m.f,{value:o,onChange:e=>{r(e.target.value),d(null)},placeholder:e.shortId.locatePlaceholder,maxLength:6,className:"font-mono sm:max-w-xs","aria-label":e.shortId.locateTitle}),(0,t.jsxs)(i.f,{type:"submit",variant:"outline",disabled:b||!o.trim(),children:[b?(0,t.jsx)(l.f,{className:"h-4 w-4 animate-spin"}):(0,t.jsx)(h,{className:"h-4 w-4"}),(0,t.jsx)("span",{className:"ml-2",children:e.shortId.locate})]})]}),c&&(0,t.jsx)("p",{className:"text-xs text-destructive",children:c})]})}var f=e.i(856423),y=e.i(77071);let p={name:"atom",size:24,node:[["circle",{cx:"12",cy:"12",r:"1",key:"41hilf"}],["path",{d:"M20.2 20.2c2.04-2.03.02-7.36-4.5-11.9-4.54-4.52-9.87-6.54-11.9-4.5-2.04 2.03-.02 7.36 4.5 11.9 4.54 4.52 9.87 6.54 11.9 4.5Z",key:"1l2ple"}],["path",{d:"M15.7 15.7c4.52-4.54 6.54-9.87 4.5-11.9-2.03-2.04-7.36-.02-11.9 4.5-4.52 4.54-6.54 9.87-4.5 11.9 2.03 2.04 7.36.02 11.9-4.5Z",key:"1wam0m"}]]};p.node;let k=(0,c.f)(p),j={name:"book-text",size:24,node:[["path",{d:"M4 19.5v-15A2.5 2.5 0 0 1 6.5 2H19a1 1 0 0 1 1 1v18a1 1 0 0 1-1 1H6.5a1 1 0 0 1 0-5H20",key:"k3hazp"}],["path",{d:"M8 11h8",key:"vwpz6n"}],["path",{d:"M8 7h6",key:"1f0q6e"}]]};j.node;let v=(0,c.f)(j);var N=e.i(867927);let w={name:"flask-conical",size:24,node:[["path",{d:"M14 2v6a2 2 0 0 0 .245.96l5.51 10.08A2 2 0 0 1 18 22H6a2 2 0 0 1-1.755-2.96l5.51-10.08A2 2 0 0 0 10 8V2",key:"18mbvz"}],["path",{d:"M6.453 15h11.094",key:"3shlmq"}],["path",{d:"M8.5 2h7",key:"csnxdl"}]]};w.node;let C=(0,c.f)(w),M={name:"globe",size:24,node:[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 2a14.5 14.5 0 0 0 0 20 14.5 14.5 0 0 0 0-20",key:"13o1zl"}],["path",{d:"M2 12h20",key:"9i4pu4"}]]};M.node;let z=(0,c.f)(M),S={name:"landmark",size:24,node:[["path",{d:"M10 18v-7",key:"wt116b"}],["path",{d:"M11.119 2.205a2 2 0 0 1 1.762 0l7.84 3.846A.5.5 0 0 1 20.5 7h-17a.5.5 0 0 1-.22-.949z",key:"yxxwt6"}],["path",{d:"M14 18v-7",key:"vav6t3"}],["path",{d:"M18 18v-7",key:"aexdmj"}],["path",{d:"M3 22h18",key:"8prr45"}],["path",{d:"M6 18v-7",key:"1ivflk"}]]};S.node;let F=(0,c.f)(S);var H=e.i(999092);let V={name:"leaf",size:24,node:[["path",{d:"M11 20a10 10 0 0010-10 25.9 25.9 0 00-1.04-7.281 1 1 0 00-1.755-.325C15.833 5.5 13 5.5 9.8 6.1A7 7 0 0011 20",key:"1wjnjv"}],["path",{d:"M2 21a5 5 0 012.911-4.544C7.613 15.212 8.351 15.24 11 13",key:"c1ejpn"}]]};V.node;let E=(0,c.f)(V),L={name:"scale",size:24,node:[["path",{d:"M12 3v18",key:"108xh3"}],["path",{d:"m19 8 3 8a5 5 0 0 1-6 0zV7",key:"zcdpyk"}],["path",{d:"M3 7h1a17 17 0 0 0 8-2 17 17 0 0 0 8 2h1",key:"1yorad"}],["path",{d:"m5 8 3 8a5 5 0 0 1-6 0zV7",key:"eua70x"}],["path",{d:"M7 21h10",key:"1b0cd5"}]]};L.node;let T=(0,c.f)(L),I={name:"sigma",size:24,node:[["path",{d:"M18 7V5a1 1 0 0 0-1-1H6.5a.5.5 0 0 0-.4.8l4.5 6a2 2 0 0 1 0 2.4l-4.5 6a.5.5 0 0 0 .4.8H17a1 1 0 0 0 1-1v-2",key:"wuwx1p"}]]};I.node;let K=(0,c.f)(I);var P=e.i(709830),A=e.i(76824);let R={math:{icon:K,className:"bg-blue-100 text-blue-600 dark:bg-blue-500/15 dark:text-blue-300"},english:{icon:H.f,className:"bg-emerald-100 text-emerald-600 dark:bg-emerald-500/15 dark:text-emerald-300"},chinese:{icon:v,className:"bg-rose-100 text-rose-600 dark:bg-rose-500/15 dark:text-rose-300"},physics:{icon:k,className:"bg-amber-100 text-amber-600 dark:bg-amber-500/15 dark:text-amber-300"},chemistry:{icon:C,className:"bg-teal-100 text-teal-600 dark:bg-teal-500/15 dark:text-teal-300"},biology:{icon:E,className:"bg-lime-100 text-lime-700 dark:bg-lime-500/15 dark:text-lime-300"},history:{icon:F,className:"bg-orange-100 text-orange-600 dark:bg-orange-500/15 dark:text-orange-300"},geography:{icon:z,className:"bg-cyan-100 text-cyan-600 dark:bg-cyan-500/15 dark:text-cyan-300"},politics:{icon:T,className:"bg-red-100 text-red-600 dark:bg-red-500/15 dark:text-red-300"}},U={icon:f.f,className:"bg-accent text-accent-foreground"};function O({name:e,stage:s,subjectKey:a,errorCount:i,onClick:n,itemLabel:o="items"}){let r=(0,A.v)({name:e,stage:s,subjectKey:a}),{icon:l,className:c}=r.subject?R[r.subject]:U;return(0,t.jsxs)("div",{role:"link",tabIndex:0,className:"group relative flex cursor-pointer items-center gap-4 rounded-2xl border bg-card p-4 shadow-sm transition-all hover:-translate-y-0.5 hover:border-primary/40 hover:shadow-md focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring",onClick:n,onKeyDown:e=>{"Enter"===e.key&&n()},children:[(0,t.jsx)("div",{className:`flex h-12 w-12 shrink-0 items-center justify-center rounded-xl ${c}`,children:(0,t.jsx)(l,{className:"h-6 w-6"})}),(0,t.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,t.jsx)("h3",{className:"truncate font-semibold",children:e}),(0,t.jsxs)("p",{className:"mt-0.5 flex items-center gap-1.5 text-sm text-muted-foreground",children:[(0,t.jsx)("span",{className:"font-medium tabular-nums text-foreground",children:i}),o,(0,t.jsx)("span",{className:"text-border",children:"|"}),(0,t.jsx)(P.E,{notebook:{name:e,stage:s,subjectKey:a},className:"truncate"})]})]}),(0,t.jsx)(N.f,{className:"h-4 w-4 shrink-0 text-muted-foreground"})]})}var _=e.i(527161),W=e.i(41931),$=e.i(35209),D=e.i(294114),B=e.i(201276),q=e.i(303163);e.s(["default",0,function(){let e=(0,a.useRouter)(),{t:l}=(0,u.b)();(0,$.f)(l.notebooks.title);let[c,d]=(0,s.useState)([]),[h,m]=(0,s.useState)(!0),[x,g]=(0,s.useState)(!1),p=(0,s.useCallback)(async()=>{try{let e=await W.k.get("/api/notebooks");d(e)}catch(e){B.V.error("[Notebooks]","Failed to fetch notebooks",{error:e})}finally{m(!1)}},[]);(0,s.useEffect)(()=>{p()},[p]);let k=async e=>{try{await W.k.post("/api/notebooks",e),await p()}catch(t){B.V.error("[Notebooks]","Failed to create notebook",{error:t});let e=(0,q.d)(t)||l.notebooks?.createError||"Failed to create";D.c.error(e)}};return h?(0,t.jsx)(r.f,{label:l.common.loading}):(0,t.jsx)("main",{className:"mx-auto min-h-screen max-w-6xl px-4 py-6 md:px-8 md:py-8",children:(0,t.jsxs)("div",{className:"space-y-6",children:[(0,t.jsx)(o.f,{title:l.notebooks?.title||"My Notebooks",description:l.notebooks?.subtitle||"Manage your mistakes by subject",actions:(0,t.jsxs)(i.f,{onClick:()=>g(!0),"aria-label":l.notebooks?.create||"New Notebook",children:[(0,t.jsx)(y.f,{className:"h-4 w-4"}),(0,t.jsx)("span",{className:"hidden sm:inline",children:l.notebooks?.create||"New Notebook"})]})}),(0,t.jsx)(b,{}),0===c.length?(0,t.jsx)(n.f,{icon:f.f,title:l.notebooks?.empty||"No notebooks yet.",action:(0,t.jsxs)(i.f,{onClick:()=>g(!0),children:[(0,t.jsx)(y.f,{className:"h-4 w-4"}),l.notebooks?.createFirst||"Create Notebook"]})}):(0,t.jsx)("div",{className:"grid grid-cols-1 gap-4 sm:grid-cols-2 lg:grid-cols-3",children:c.map(s=>(0,t.jsx)(O,{name:s.name,stage:s.stage,subjectKey:s.subjectKey,errorCount:s._count?.errorItems||0,onClick:()=>{var t;return t=s.id,void e.push(`/notebooks/${t}`)},itemLabel:l.notebooks.cardItems},s.id))}),(0,t.jsx)(_.f,{open:x,onOpenChange:g,onCreate:k},l.common.loading)]})})}],666776)},527161,e=>{var t=e.i(843476),s=e.i(271645),a=e.i(776639),i=e.i(519455),n=e.i(793479),o=e.i(110204),r=e.i(967489),l=e.i(709830),c=e.i(111110),d=e.i(76824),h=e.i(41931),m=e.i(294114),u=e.i(201276);async function x(){try{let e=await h.k.get("/api/tags?tagSetsOnly=true");return e.tagSets?.length?e.tagSets:["default"]}catch{return["default"]}}e.s(["f",0,function({open:e,onOpenChange:h,onCreate:g}){let[b,f]=(0,s.useState)(""),[y,p]=(0,s.useState)(d.j),[k,j]=(0,s.useState)(d.W[d.j][0]),[v,N]=(0,s.useState)("default"),[w,C]=(0,s.useState)(["default"]),[M,z]=(0,s.useState)(!1),{t:S}=(0,c.b)(),{stageLabel:F,subjectLabel:H}=(0,l.O)();(0,s.useEffect)(()=>{e&&x().then(C)},[e]);let V=async()=>{if(!b.trim())return void m.c.warning(S.notebooks?.dialog?.enterName||"Please enter notebook name");z(!0);try{await g({name:b.trim(),stage:y,subjectKey:k,tagSet:v}),f(""),h(!1)}catch(e){u.V.error("[CreateNotebook]","Failed to create notebook",{error:e})}finally{z(!1)}};return(0,t.jsx)(a.N,{open:e,onOpenChange:h,children:(0,t.jsxs)(a.d,{children:[(0,t.jsxs)(a.s,{children:[(0,t.jsx)(a.F,{children:S.notebooks?.dialog?.title||"Create New Notebook"}),(0,t.jsx)(a.C,{children:S.notebooks?.dialog?.desc||"Create separate notebooks for different subjects or chapters"})]}),(0,t.jsxs)("div",{className:"space-y-4 py-4",children:[(0,t.jsxs)("div",{className:"grid grid-cols-2 gap-3",children:[(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsx)(o.f,{htmlFor:"notebook-stage",children:S.notebooks.dialog.stageLabel}),(0,t.jsxs)(r.d,{value:y,onValueChange:e=>{p(e),d.W[e].includes(k)||j(d.W[e][0])},children:[(0,t.jsx)(r.P,{id:"notebook-stage",children:(0,t.jsx)(r.U,{})}),(0,t.jsx)(r.r,{children:d.c.map(e=>(0,t.jsx)(r.T,{value:e,children:F(e)},e))})]})]}),(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsx)(o.f,{htmlFor:"notebook-subject",children:S.notebooks.dialog.subjectLabel}),(0,t.jsxs)(r.d,{value:k,onValueChange:e=>j(e),children:[(0,t.jsx)(r.P,{id:"notebook-subject",children:(0,t.jsx)(r.U,{})}),(0,t.jsx)(r.r,{children:d.W[y].map(e=>(0,t.jsx)(r.T,{value:e,children:H(e)},e))})]})]})]}),w.length>1&&(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsx)(o.f,{htmlFor:"notebook-tagset",children:S.notebooks.dialog.tagSetLabel}),(0,t.jsxs)(r.d,{value:v,onValueChange:N,children:[(0,t.jsx)(r.P,{id:"notebook-tagset",children:(0,t.jsx)(r.U,{})}),(0,t.jsx)(r.r,{children:w.map(e=>(0,t.jsx)(r.T,{value:e,children:"default"===e?S.notebooks.dialog.tagSetDefault||"Built-in":S.notebooks.dialog.tagSetNames?.[e]||e},e))})]})]}),(0,t.jsx)("p",{className:"text-xs text-muted-foreground",children:S.notebooks.dialog.scopeHint}),(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsx)(o.f,{htmlFor:"name",children:S.notebooks?.dialog?.nameLabel||"Notebook Name"}),(0,t.jsx)(n.f,{id:"name",placeholder:S.notebooks?.dialog?.placeholder||"e.g. Math, Physics, Chemistry...",value:b,onChange:e=>f(e.target.value),onKeyDown:e=>"Enter"===e.key&&V()})]})]}),(0,t.jsxs)(a.c,{children:[(0,t.jsx)(i.f,{variant:"outline",onClick:()=>h(!1),children:S.common.cancel}),(0,t.jsx)(i.f,{onClick:V,disabled:M||!b.trim(),children:M?S.notebooks?.dialog?.creating||"Creating...":S.notebooks?.dialog?.create||"Create"})]})]})})}])},709830,76824,e=>{var t=e.i(843476),s=e.i(111110),a=e.i(952122);let i=["primary","junior_high","senior_high"],n="primary",o=["math","english","chinese","physics","chemistry","biology","history","geography","politics"];function r(e){return"string"==typeof e&&o.includes(e)}function l(e){var t;let s=r(e.subjectKey)?e.subjectKey:(0,a.f)(e.name);return{stage:"string"==typeof(t=e.stage)&&i.includes(t)?e.stage:n,subject:s&&r(s)?s:null}}function c(){let{t:e}=(0,s.b)();return{stageLabel:t=>({primary:e.auth.primary,junior_high:e.auth.juniorHigh,senior_high:e.auth.seniorHigh})[t],subjectLabel:t=>e.tags.subjects[t]}}e.s(["j",0,n,"c",0,i,"W",0,{primary:["math","english","chinese"],junior_high:o,senior_high:o},"v",0,l],76824),e.s(["E",0,function({notebook:e,className:s}){let{stageLabel:a,subjectLabel:i}=c(),n=l(e);return(0,t.jsxs)("span",{className:s,children:[a(n.stage),n.subject?` \xb7 ${i(n.subject)}`:""]})},"O",0,c],709830)},590546,e=>{var t=e.i(843476),s=e.i(618566),a=e.i(519455),i=e.i(711241);e.s(["f",0,function({fallbackUrl:e,className:n}){let o=(0,s.useRouter)();return(0,t.jsx)(a.f,{variant:"ghost",size:"icon",onClick:()=>{o.push(e)},className:n,children:(0,t.jsx)(i.f,{className:"h-5 w-5"})})}])},912505,e=>{var t=e.i(843476),s=e.i(975157);e.s(["f",0,function({icon:e,title:a,description:i,action:n,className:o}){return(0,t.jsxs)("div",{className:(0,s.f)("flex flex-col items-center justify-center rounded-2xl border border-dashed bg-card/50 px-6 py-14 text-center",o),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:a}),i&&(0,t.jsx)("p",{className:"mt-1 max-w-sm text-sm text-muted-foreground",children:i}),n&&(0,t.jsx)("div",{className:"mt-5",children:n})]})}])},393842,e=>{var t=e.i(843476),s=e.i(590546),a=e.i(975157);e.s(["f",0,function({title:e,description:i,backHref:n,actions:o,titleAddon:r,className:l}){return(0,t.jsxs)("div",{className:(0,a.f)("flex items-start gap-3",l),children:[n&&(0,t.jsx)(s.f,{fallbackUrl:n,className:"-ml-2 shrink-0"}),(0,t.jsxs)("div",{className:"min-w-0 flex-1 space-y-1",children:[(0,t.jsxs)("div",{className:"flex items-center gap-1",children:[(0,t.jsx)("h1",{className:"truncate text-2xl font-bold tracking-tight sm:text-3xl",children:e}),r]}),i&&(0,t.jsx)("p",{className:"text-sm text-muted-foreground sm:text-base",children:i})]}),o&&(0,t.jsx)("div",{className:"flex shrink-0 items-center gap-2",children:o})]})}])},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})]})}])},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}])},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])}])},833547,747279,e=>{var t=e.i(41931);async function s(e){try{return(await t.k.get(`/api/error-items/short/${encodeURIComponent(e)}`)).id}catch{return null}}e.s(["f",0,s],833547);let a=RegExp("^[123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz]{6}$");e.s(["f",0,function(e){return"string"==typeof e&&a.test(e)}],747279)}])})();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(()=>{"use strict";(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,399847,e=>{var t=e.i(456420);let s={name:"circle-alert",size:24,node:[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["line",{x1:"12",x2:"12",y1:"8",y2:"12",key:"1pkeuh"}],["line",{x1:"12",x2:"12.01",y1:"16",y2:"16",key:"4dfq90"}]],aliases:["alert-circle"]};s.node;let a=(0,t.f)(s);e.s(["f",0,a],399847)},586906,e=>{var t=e.i(843476),s=e.i(271645),a=e.i(618566),i=e.i(519455),r=e.i(793479),l=e.i(515288),n=e.i(522016),o=e.i(480342),c=e.i(111110),d=e.i(35209),u=e.i(215519),m=e.i(306831),h=e.i(772382),x=e.i(580860),g=e.i(632781),f=e.i(399847),p=e.i(41931),j=e.i(294114),v=e.i(201276),b=e.i(303163);e.s(["default",0,function(){let{timeZone:e}=(0,u.M)(),y=(0,a.useRouter)(),{t:N}=(0,c.b)();(0,d.f)(N.pageTitle.register);let[w,S]=(0,s.useState)(""),[k,C]=(0,s.useState)(""),[P,Y]=(0,s.useState)(""),[R,T]=(0,s.useState)(""),[q,F]=(0,s.useState)("junior_high"),[A,E]=(0,s.useState)("2025"),[z,H]=(0,s.useState)(""),[L,M]=(0,s.useState)(!1),[O,U]=(0,s.useState)(!1),[B,D]=(0,s.useState)(!1),[I,_]=(0,s.useState)(null),K=(0,s.useCallback)(async()=>{try{let e=await fetch("/api/register/status"),t=await e.json();_(t.allowRegistration)}catch(e){v.V.error("[Register]","Failed to check registration status",{error:e}),_(!1)}},[]);(0,s.useEffect)(()=>{K()},[K]);let J=async e=>{if(e.preventDefault(),M(!0),H(""),P!==R){H(N.auth?.register?.passwordMismatch||"Passwords do not match"),M(!1);return}try{await p.
|
|
1
|
+
(()=>{"use strict";(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,399847,e=>{var t=e.i(456420);let s={name:"circle-alert",size:24,node:[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["line",{x1:"12",x2:"12",y1:"8",y2:"12",key:"1pkeuh"}],["line",{x1:"12",x2:"12.01",y1:"16",y2:"16",key:"4dfq90"}]],aliases:["alert-circle"]};s.node;let a=(0,t.f)(s);e.s(["f",0,a],399847)},586906,e=>{var t=e.i(843476),s=e.i(271645),a=e.i(618566),i=e.i(519455),r=e.i(793479),l=e.i(515288),n=e.i(522016),o=e.i(480342),c=e.i(111110),d=e.i(35209),u=e.i(215519),m=e.i(306831),h=e.i(772382),x=e.i(580860),g=e.i(632781),f=e.i(399847),p=e.i(41931),j=e.i(294114),v=e.i(201276),b=e.i(303163);e.s(["default",0,function(){let{timeZone:e}=(0,u.M)(),y=(0,a.useRouter)(),{t:N}=(0,c.b)();(0,d.f)(N.pageTitle.register);let[w,S]=(0,s.useState)(""),[k,C]=(0,s.useState)(""),[P,Y]=(0,s.useState)(""),[R,T]=(0,s.useState)(""),[q,F]=(0,s.useState)("junior_high"),[A,E]=(0,s.useState)("2025"),[z,H]=(0,s.useState)(""),[L,M]=(0,s.useState)(!1),[O,U]=(0,s.useState)(!1),[B,D]=(0,s.useState)(!1),[I,_]=(0,s.useState)(null),K=(0,s.useCallback)(async()=>{try{let e=await fetch("/api/register/status"),t=await e.json();_(t.allowRegistration)}catch(e){v.V.error("[Register]","Failed to check registration status",{error:e}),_(!1)}},[]);(0,s.useEffect)(()=>{K()},[K]);let J=async e=>{if(e.preventDefault(),M(!0),H(""),P!==R){H(N.auth?.register?.passwordMismatch||"Passwords do not match"),M(!1);return}try{await p.k.post("/api/register",{name:w,email:k,password:P,educationStage:q,enrollmentYear:parseInt(A)}),j.c.success(N.auth?.register?.success||"Registration successful! Please login"),y.push("/login")}catch(t){let e=(0,b.d)(t);e="User with this email already exists"===e?N.auth?.register?.emailExists||e:"Too many requests"===e?N.auth?.register?.tooManyAttempts||e:e||N.auth?.register?.failed||"Registration failed",H(e)}finally{M(!1)}};return null===I?(0,t.jsx)(o.f,{children:(0,t.jsx)("div",{className:"flex justify-center",children:(0,t.jsx)(g.f,{className:"h-8 w-8 animate-spin text-primary"})})}):!1===I?(0,t.jsx)(o.f,{children:(0,t.jsxs)(l.N,{className:"w-full rounded-2xl border-0 shadow-xl shadow-indigo-500/5 ring-1 ring-border",children:[(0,t.jsx)(l.Y,{children:(0,t.jsx)(l.v,{className:"text-2xl text-center",children:N.auth?.register?.disabled||"Registration Disabled"})}),(0,t.jsxs)(l.O,{className:"space-y-4",children:[(0,t.jsxs)("div",{className:"flex flex-col items-center gap-4 py-6",children:[(0,t.jsx)(f.f,{className:"h-12 w-12 text-muted-foreground"}),(0,t.jsx)("p",{className:"text-center text-muted-foreground",children:N.auth?.register?.disabledMessage||"Registration is currently disabled by administrator. Please contact admin for access."})]}),(0,t.jsx)("div",{className:"text-center",children:(0,t.jsx)(n.default,{href:"/login",className:"text-primary hover:underline",children:N.auth?.register?.backToLogin||"Back to Login"})})]})]})}):(0,t.jsx)(o.f,{children:(0,t.jsxs)(l.N,{className:"w-full rounded-2xl border-0 shadow-xl shadow-indigo-500/5 ring-1 ring-border",children:[(0,t.jsx)(l.Y,{children:(0,t.jsx)(l.v,{className:"text-2xl text-center",children:N.auth?.register?.title||"Create an Account"})}),(0,t.jsx)(l.O,{children:(0,t.jsxs)("form",{onSubmit:J,className:"space-y-4",children:[(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsx)("label",{htmlFor:"name",className:"text-sm font-medium",children:N.auth?.name||"Name"}),(0,t.jsx)(r.f,{id:"name",name:"name",type:"text",value:w,onChange:e=>S(e.target.value),required:!0})]}),(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsx)("label",{htmlFor:"email",className:"text-sm font-medium",children:N.auth?.email||"Email"}),(0,t.jsx)(r.f,{id:"email",name:"email",type:"email",value:k,onChange:e=>C(e.target.value),required:!0})]}),(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsx)("label",{htmlFor:"password",className:"text-sm font-medium",children:N.auth?.password||"Password"}),(0,t.jsxs)("div",{className:"relative",children:[(0,t.jsx)(r.f,{id:"password",name:"password",type:O?"text":"password",value:P,onChange:e=>Y(e.target.value),required:!0,minLength:6,className:"pr-10"}),(0,t.jsx)(i.f,{type:"button",variant:"ghost",size:"icon",className:"absolute right-0 top-0 h-full px-3 py-2 hover:bg-transparent",onClick:()=>U(!O),tabIndex:-1,children:O?(0,t.jsx)(x.f,{className:"h-4 w-4 text-muted-foreground"}):(0,t.jsx)(h.f,{className:"h-4 w-4 text-muted-foreground"})})]})]}),(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsx)("label",{htmlFor:"confirmPassword",className:"text-sm font-medium",children:N.auth?.confirmPassword||"Confirm Password"}),(0,t.jsxs)("div",{className:"relative",children:[(0,t.jsx)(r.f,{id:"confirmPassword",name:"confirmPassword",type:B?"text":"password",value:R,onChange:e=>T(e.target.value),required:!0,minLength:6,className:"pr-10"}),(0,t.jsx)(i.f,{type:"button",variant:"ghost",size:"icon",className:"absolute right-0 top-0 h-full px-3 py-2 hover:bg-transparent",onClick:()=>D(!B),tabIndex:-1,children:B?(0,t.jsx)(x.f,{className:"h-4 w-4 text-muted-foreground"}):(0,t.jsx)(h.f,{className:"h-4 w-4 text-muted-foreground"})})]})]}),(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsx)("label",{htmlFor:"educationStage",className:"text-sm font-medium",children:N.auth?.educationStage||"Education Stage"}),(0,t.jsxs)("select",{id:"educationStage",name:"educationStage",className:"flex h-10 w-full rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background file:border-0 file:bg-transparent file:text-sm file:font-medium placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",value:q,onChange:e=>F(e.target.value),required:!0,children:[(0,t.jsx)("option",{value:"",disabled:!0,children:N.auth?.selectStage||"Select Stage"}),(0,t.jsx)("option",{value:"primary",children:N.auth?.primary||"Primary School"}),(0,t.jsx)("option",{value:"junior_high",children:N.auth?.juniorHigh||"Junior High"}),(0,t.jsx)("option",{value:"senior_high",children:N.auth?.seniorHigh||"Senior High"}),(0,t.jsx)("option",{value:"university",children:N.auth?.university||"University"})]})]}),(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsx)("label",{htmlFor:"enrollmentYear",className:"text-sm font-medium",children:N.auth?.enrollmentYear||"Enrollment Year"}),(0,t.jsx)(r.f,{id:"enrollmentYear",name:"enrollmentYear",type:"number",value:A,onChange:e=>E(e.target.value),placeholder:"YYYY",required:!0,min:1990,max:Number((0,m.r)(new Date,"yyyy",e))})]}),z&&(0,t.jsx)("div",{className:"rounded-lg bg-destructive/10 px-3 py-2 text-center text-sm text-destructive",children:z}),(0,t.jsx)(i.f,{type:"submit",size:"lg",className:"w-full",disabled:L,children:L?N.auth?.register?.registering||"Registering...":N.auth?.register?.action||"Register"}),(0,t.jsxs)("div",{className:"text-center text-sm text-muted-foreground",children:[N.auth?.register?.hasAccount||"Already have an account? ",(0,t.jsx)(n.default,{href:"/login",className:"text-primary hover:underline",children:N.auth?.register?.loginHere||"Login here"})]})]})})]})})}])},480342,e=>{var t=e.i(843476),s=e.i(325164),a=e.i(111110);e.s(["f",0,function({children:e,wide:i=!1}){let{t:r}=(0,a.b)();return(0,t.jsxs)("div",{className:"relative flex min-h-screen items-center justify-center overflow-hidden bg-background p-4",children:[(0,t.jsx)("div",{className:"pointer-events-none absolute -left-32 -top-32 h-96 w-96 rounded-full bg-indigo-400/25 blur-3xl"}),(0,t.jsx)("div",{className:"pointer-events-none absolute -bottom-40 -right-24 h-[28rem] w-[28rem] rounded-full bg-violet-400/20 blur-3xl"}),(0,t.jsxs)("div",{className:`relative w-full space-y-6 py-8 ${i?"max-w-xl":"max-w-md"}`,children:[(0,t.jsxs)("div",{className:"flex flex-col items-center gap-3 text-center",children:[(0,t.jsx)(s.default,{src:"/icons/icon.png",alt:"",width:64,height:64,className:"rounded-2xl shadow-lg shadow-indigo-500/30",priority:!0,unoptimized:!0}),(0,t.jsxs)("div",{className:"space-y-1",children:[(0,t.jsx)("p",{className:"text-xl font-bold tracking-tight",children:r.pageTitle.base}),(0,t.jsx)("p",{className:"text-sm text-muted-foreground",children:r.app.subtitle})]})]}),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])}])}])})();
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
(()=>{"use strict";(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,981140,e=>{var t=Object.defineProperty,r=(e,r)=>t(e,"name",{value:r,configurable:!0}),n=!!("u">typeof window&&window.document&&window.document.createElement);function o(e,t,{checkForDefaultPrevented:n=!0}={}){return r(function(r){if(e?.(r),!1===n||!r||!r.defaultPrevented)return t?.(r)},"handleEvent")}function i(e){if(!n)throw Error("Cannot access document outside of the DOM");return e?.ownerDocument??document}function a(e){return"IFRAME"===e.tagName}r(o,"composeEventHandlers"),r(function(e){if(!n)throw Error("Cannot access window outside of the DOM");return e?.ownerDocument?.defaultView??window},"getOwnerWindow"),r(i,"getOwnerDocument"),r(function e(t,r=!1){let{activeElement:n}=i(t);if(!n?.nodeName)return null;if(a(n)&&n.contentDocument)return e(n.contentDocument.body,r);if(r){let e=n.getAttribute("aria-activedescendant");if(e){let t=i(n).getElementById(e);if(t)return t}}return n},"getActiveElement"),r(a,"isFrame"),e.s(["f",0,o])},705844,e=>{e.s(["f",0,!1])},30030,e=>{var t=e.i(271645),r=e.i(843476),n=Object.defineProperty,o=(e,t)=>n(e,"name",{value:t,configurable:!0});function i(e,n=[]){let s=[];function l(n,i){let a=t.createContext(i);a.displayName=n+"Context";let l=s.length;s=[...s,i];let u=o(n=>{let{scope:o,children:i,...s}=n,u=o?.[e]?.[l]||a,c=t.useMemo(()=>s,Object.values(s));return(0,r.jsx)(u.Provider,{value:c,children:i})},"Provider");function c(r,o,s={}){let{optional:u=!1}=s,f=o?.[e]?.[l]||a,d=t.useContext(f);if(d)return d;if(void 0!==i)return i;if(!u)throw Error(`\`${r}\` must be used within \`${n}\``)}return u.displayName=n+"Provider",o(c,"useContext"),[u,c]}o(l,"createContext");let u=o(()=>{let r=s.map(e=>t.createContext(e));return o(function(n){let o=n?.[e]||r;return t.useMemo(()=>({[`__scope${e}`]:{...n,[e]:o}}),[n,o])},"useScope")},"createScope");return u.scopeName=e,[l,a(u,...n)]}function a(...e){let r=e[0];if(1===e.length)return r;let n=o(()=>{let n=e.map(e=>({useScope:e(),scopeName:e.scopeName}));return o(function(e){let o=n.reduce((t,{useScope:r,scopeName:n})=>{let o=r(e)[`__scope${n}`];return{...t,...o}},{});return t.useMemo(()=>({[`__scope${r.scopeName}`]:o}),[o])},"useComposedScopes")},"createScope");return n.scopeName=r.scopeName,n}o(function(e,n){let i=t.createContext(n);i.displayName=e+"Context";let a=o(e=>{let{children:n,...o}=e,a=t.useMemo(()=>o,Object.values(o));return(0,r.jsx)(i.Provider,{value:a,children:n})},"Provider");function s(r,o={}){let{optional:a=!1}=o,l=t.useContext(i);if(l)return l;if(void 0!==n)return n;if(!a)throw Error(`\`${r}\` must be used within \`${e}\``)}return a.displayName=e+"Provider",o(s,"useContext"),[a,s]},"createContext"),o(i,"createContextScope"),o(a,"composeContextScopes"),e.s(["f",0,i])},296626,e=>{var t=e.i(271645),r=e.i(934620),n=Object.defineProperty,o=(e,t)=>n(e,"name",{value:t,configurable:!0});function i(e,r){return t.useReducer((e,t)=>r[e][t]??e,e)}o(i,"useStateMachine");var a=o(e=>{let{present:r,children:n}=e,o=s(r),i="function"==typeof n?n({present:o.isPresent}):t.Children.only(n),a=u(o.ref,f(i));return"function"==typeof n||o.isPresent?t.cloneElement(i,{ref:a}):null},"Presence");function s(e){let[n,a]=t.useState(),s=t.useRef(null),l=t.useRef(e),u=t.useRef("none"),f=t.useRef(void 0),[d,p]=i(e?"mounted":"unmounted",{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return t.useEffect(()=>{"mounted"===d?(u.current=f.current??c(s.current),f.current=void 0):u.current="none"},[d]),(0,r.f)(()=>{let t=s.current,r=l.current;if(r!==e){let n=u.current,o=c(t);e?(f.current=o,p("MOUNT")):"none"===o||t?.display==="none"?p("UNMOUNT"):r&&n!==o?p("ANIMATION_OUT"):p("UNMOUNT"),l.current=e}},[e,p]),(0,r.f)(()=>{if(n){let e,t=n.ownerDocument.defaultView??window,r=o(r=>{let o=c(s.current).includes(CSS.escape(r.animationName));if(r.target===n&&o&&(p("ANIMATION_END"),!l.current)){let r=n.style.animationFillMode;n.style.animationFillMode="forwards",e=t.setTimeout(()=>{"forwards"===n.style.animationFillMode&&(n.style.animationFillMode=r)})}},"handleAnimationEnd"),i=o(e=>{e.target===n&&(u.current=c(s.current))},"handleAnimationStart");return n.addEventListener("animationstart",i),n.addEventListener("animationcancel",r),n.addEventListener("animationend",r),()=>{t.clearTimeout(e),n.removeEventListener("animationstart",i),n.removeEventListener("animationcancel",r),n.removeEventListener("animationend",r)}}p("ANIMATION_END")},[n,p]),{isPresent:["mounted","unmountSuspended"].includes(d),ref:t.useCallback(e=>{if(e){let t=getComputedStyle(e);s.current=t,f.current=c(t)}else s.current=null;a(e)},[])}}function l(e,t){if("function"==typeof e)return e(t);null!=e&&(e.current=t)}function u(...e){let r=t.useRef(e);return r.current=e,t.useCallback(e=>{let t=r.current,n=!1,o=t.map(t=>{let r=l(t,e);return n||"function"!=typeof r||(n=!0),r});if(n)return()=>{for(let e=0;e<o.length;e++){let r=o[e];"function"==typeof r?r():l(t[e],null)}}},[])}function c(e){return e?.animationName||"none"}function f(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,r=t&&"isReactWarning"in t&&t.isReactWarning;return r?e.ref:(r=(t=Object.getOwnPropertyDescriptor(e,"ref")?.get)&&"isReactWarning"in t&&t.isReactWarning)?e.props.ref:e.props.ref||e.ref}o(s,"usePresence"),o(l,"setRef"),o(u,"useStableComposedRefs"),o(c,"getAnimationName"),o(f,"getElementRef"),e.s(["f",0,a])},248425,e=>{var t=e.i(271645),r=e.i(174080),n=e.i(991918),o=e.i(843476),i=Object.defineProperty,a=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"].reduce((e,r)=>{let i=(0,n.B)(`Primitive.${r}`),a=t.forwardRef((e,t)=>{let{asChild:n,...a}=e;return"u">typeof window&&(window[Symbol.for("radix-ui")]=!0),(0,o.jsx)(n?i:r,{...a,ref:t})});return a.displayName=`Primitive.${r}`,{...e,[r]:a}},{});function s(e,t){e&&r.flushSync(()=>e.dispatchEvent(t))}i(s,"name",{value:"dispatchDiscreteCustomEvent",configurable:!0}),e.s(["V",0,a,"u",0,s])},369340,e=>{var t=e.i(271645),r=e.i(705844),n=e.i(934620),o=Object.defineProperty,i=t[" useEffectEvent ".trim().toString()],a=t[" useInsertionEffect ".trim().toString()];function s(e){if("function"==typeof i)return i(e);let r=t.useRef(()=>{throw Error("Cannot call an event handler while rendering.")});return"function"==typeof a?a(()=>{r.current=e}):(0,n.f)(()=>{r.current=e}),t.useMemo(()=>(...e)=>r.current?.(...e),[])}o(s,"name",{value:"useEffectEvent",configurable:!0});var l=Object.defineProperty,u=(e,t)=>l(e,"name",{value:t,configurable:!0}),c=t[" useInsertionEffect ".trim().toString()]||n.f;function f({prop:e,defaultProp:n,onChange:o=u(()=>{},"onChange"),caller:i}){let[a,s,l]=d({defaultProp:n,onChange:o}),c=void 0!==e,m=c?e:a;if(r.f){let r=t.useRef(void 0!==e);t.useEffect(()=>{let e=r.current;if(e!==c){let t=c?"controlled":"uncontrolled";console.warn(`${i} is changing from ${e?"controlled":"uncontrolled"} to ${t}. Components should not switch from controlled to uncontrolled (or vice versa). Decide between using a controlled or uncontrolled value for the lifetime of the component.`)}r.current=c},[c,i])}return[m,t.useCallback(t=>{if(c){let r=p(t)?t(e):t;r!==e&&l.current?.(r)}else s(t)},[c,e,s,l])]}function d({defaultProp:e,onChange:r}){let[n,o]=t.useState(e),i=t.useRef(n),a=t.useRef(r);return c(()=>{a.current=r},[r]),t.useEffect(()=>{i.current!==n&&(a.current?.(n),i.current=n)},[n,i]),[n,o,a]}function p(e){return"function"==typeof e}u(f,"useControllableState"),u(d,"useUncontrolledState"),u(p,"isFunction");var m=Symbol("RADIX:SYNC_STATE");u(function(e,n,o,i){let{prop:a,defaultProp:l,onChange:u,caller:c}=n,f=void 0!==a,d=s(u);if(r.f){let e=t.useRef(void 0!==a);t.useEffect(()=>{let t=e.current;if(t!==f){let e=f?"controlled":"uncontrolled";console.warn(`${c} is changing from ${t?"controlled":"uncontrolled"} to ${e}. Components should not switch from controlled to uncontrolled (or vice versa). Decide between using a controlled or uncontrolled value for the lifetime of the component.`)}e.current=f},[f,c])}let p=[{...o,state:l}];i&&p.push(i);let[g,h]=t.useReducer((t,r)=>{if(r.type===m)return{...t,state:r.state};let n=e(t,r);return f&&!Object.is(n.state,t.state)&&d(n.state),n},...p),v=g.state,y=t.useRef(v);t.useEffect(()=>{y.current!==v&&(y.current=v,f||d(v))},[v,y,f]);let b=t.useMemo(()=>void 0!==a?{...g,state:a}:g,[g,a]);return t.useEffect(()=>{f&&!Object.is(a,g.state)&&h({type:m,state:a})},[a,g.state,f]),[b,h]},"useControllableStateReducer"),e.s(["f",0,f],369340)},934620,e=>{var t=e.i(271645),r=globalThis?.document?t.useLayoutEffect:()=>{};e.s(["f",0,r])},635804,e=>{var t=e.i(271645),r=e.i(934620);function n(e){let[n,o]=t.useState(void 0);return(0,r.f)(()=>{if(e){o({width:e.offsetWidth,height:e.offsetHeight});let t=0,r=new ResizeObserver(r=>{if(!Array.isArray(r)||!r.length)return;let n=r[0];window.cancelAnimationFrame(t),t=window.requestAnimationFrame(()=>{let t,r;if("borderBoxSize"in n){let e=n.borderBoxSize,o=Array.isArray(e)?e[0]:e;t=o.inlineSize,r=o.blockSize}else t=e.offsetWidth,r=e.offsetHeight;o({width:t,height:r})})});return r.observe(e,{box:"border-box"}),()=>{window.cancelAnimationFrame(t),r.unobserve(e)}}o(void 0)},[e]),n}(0,Object.defineProperty)(n,"name",{value:"useSize",configurable:!0}),e.s(["f",0,n])},689664,e=>{var t=e.i(456420);let r={name:"check",size:24,node:[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]]};r.node;let n=(0,t.f)(r);e.s(["f",0,n],689664)},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 i=(0,t.f)(o);e.s(["f",0,i],456539)},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)},632781,e=>{var t=e.i(456420);let r={name:"loader-circle",size:24,node:[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]],aliases:["loader-2"]};r.node;let n=(0,t.f)(r);e.s(["f",0,n],632781)},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)},395925,e=>{var t=e.i(456420);let r={name:"rotate-ccw",size:24,node:[["path",{d:"M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8",key:"1357e3"}],["path",{d:"M3 3v5h5",key:"1xhq8a"}]]};r.node;let n=(0,t.f)(r);e.s(["f",0,n],395925)},759659,e=>{var t=e.i(456420);let r={name:"trash",size:24,node:[["path",{d:"M10 11v6",key:"nco0om"}],["path",{d:"M14 11v6",key:"outv1u"}],["path",{d:"M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6",key:"miytrc"}],["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2",key:"e791ji"}]],aliases:["trash-2"]};r.node;let n=(0,t.f)(r);e.s(["f",0,n],759659)},853138,446513,e=>{var t=e.i(456420);let r={name:"triangle-alert",size:24,node:[["path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3",key:"wmoenq"}],["path",{d:"M12 9v4",key:"juzpu7"}],["path",{d:"M12 17h.01",key:"p32p05"}]],aliases:["alert-triangle"]};r.node;let n=(0,t.f)(r);e.s(["f",0,n],853138);let o={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"}]]};o.node;let i=(0,t.f)(o);e.s(["f",0,i],446513)},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 v},useLinkStatus:function(){return b}};for(var o in n)Object.defineProperty(r,o,{enumerable:!0,get:n[o]});let i=e.r(190809),a=e.r(843476),s=i._(e.r(271645)),l=e.r(195057),u=e.r(8372),c=e.r(818581),f=e.r(718967),d=e.r(405550),p=e.r(388540),m=e.r(91949),g=e.r(573668),h=e.r(509396);function v(t){var r;let n,o,i,[v,b]=(0,s.useOptimistic)(m.IDLE_LINK_STATUS),w=(0,s.useRef)(null),{href:x,as:E,children:S,prefetch:j=null,passHref:C,replace:N,shallow:P,scroll:O,onClick:R,onMouseEnter:D,onTouchStart:T,legacyBehavior:M=!1,onNavigate:k,transitionTypes:A,ref:_,unstable_dynamicOnHover:I,...L}=t;n=S,M&&("string"==typeof n||"number"==typeof n)&&(n=(0,a.jsx)("a",{children:n}));let $=s.default.useContext(u.AppRouterContext),z=!1!==j,F=!1===j?"none":!0===j?"full":"auto",U="none"!==F?"auto"===F?h.FetchStrategy.PPR:h.FetchStrategy.Full:h.FetchStrategy.PPR,V="string"==typeof(r=E||x)?r:(0,l.formatUrl)(r);if(M){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 B=M?o&&"object"==typeof o&&o.ref:_,W,q=s.default.useCallback(e=>(null!==$&&(w.current=(0,m.mountLinkInstance)(e,V,$,U,z,b,W)),()=>{w.current&&((0,m.unmountLinkForCurrentNavigation)(w.current),w.current=null),(0,m.unmountPrefetchableInstance)(e)}),[z,V,$,U,b,W]),J={ref:(0,c.useMergedRef)(q,B),onClick(t){M||"function"!=typeof R||R(t),M&&o.props&&"function"==typeof o.props.onClick&&o.props.onClick(t),!$||t.defaultPrevented||function(t,r,n,o,i,a,s,l="none"){if("u">typeof window){let u,{nodeName:c}=t.currentTarget;if("A"===c.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(),a){let e=!1;if(a({preventDefault:()=>{e=!0}}),e)return}let{navigate:f}=e.r(132916);f(r,o?"replace":"push",!1===i?p.ScrollBehavior.NoScroll:p.ScrollBehavior.Default,n.current,s,l)}}(t,V,w,N,O,k,A,F)},onMouseEnter(e){M||"function"!=typeof D||D(e),M&&o.props&&"function"==typeof o.props.onMouseEnter&&o.props.onMouseEnter(e),$&&z&&(0,m.onNavigationIntent)(e.currentTarget,!0===I)},onTouchStart:function(e){M||"function"!=typeof T||T(e),M&&o.props&&"function"==typeof o.props.onTouchStart&&o.props.onTouchStart(e),$&&z&&(0,m.onNavigationIntent)(e.currentTarget,!0===I)}};return(0,f.isAbsoluteUrl)(V)?J.href=V:M&&!C&&("a"!==o.type||"href"in o.props)||(J.href=(0,d.addBasePath)(V)),i=M?s.default.cloneElement(o,J):(0,a.jsx)("a",{...L,...J,children:n}),(0,a.jsx)(y.Provider,{value:v,children:i})}let y=(0,s.createContext)(m.IDLE_LINK_STATUS),b=()=>(0,s.useContext)(y);("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=i(e,n)),t&&(o.current=i(t,n))},[e,t])}function i(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 i=e.r(190809)._(e.r(998183)),a=/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(i.urlQueryToSearchParams(l)));let c=e.search||l&&`?${l}`||"";return n&&!n.endsWith(":")&&(n+=":"),e.slashes||(!n||a.test(n))&&!1!==u?(u="//"+(u||""),o&&"/"!==o[0]&&(o="/"+o)):u||(u=""),s&&"#"!==s[0]&&(s="#"+s),c&&"?"!==c[0]&&(c="?"+c),o=o.replace(/[?#]/g,encodeURIComponent),c=c.replace("#","%23"),`${n}${u}${o}${c}${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 i}});let n=e.r(718967),o=e.r(652817);function i(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 v},MiddlewareNotFoundError:function(){return x},MissingStaticPage:function(){return w},NormalizeError:function(){return y},PageNotFoundError:function(){return b},SP:function(){return g},ST:function(){return h},WEB_VITALS:function(){return i},execOnce:function(){return a},getDisplayName:function(){return f},getLocationOrigin:function(){return u},getURL:function(){return c},isAbsoluteUrl:function(){return l},isResSent:function(){return d},loadGetInitialProps:function(){return m},normalizeRepeatedSlashes:function(){return p},stringifyError:function(){return E}};for(var o in n)Object.defineProperty(r,o,{enumerable:!0,get:n[o]});let i=["CLS","FCP","INP","LCP","TTFB"];function a(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 c(){let{href:e}=window.location,t=u();return e.substring(t.length)}function f(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 m(e,t){let r=t.res||t.ctx&&t.ctx.res;if(!e.getInitialProps)return t.ctx&&t.Component?{pageProps:await m(t.Component,t.ctx)}:{};let n=await e.getInitialProps(t);if(r&&d(r))return n;if(!n)throw Error(`"${f(e)}.getInitialProps()" should resolve to an object. But found "${n}" instead.`);return n}let g="u">typeof performance,h=g&&["mark","measure","getEntriesByName"].every(e=>"function"==typeof performance[e]);class v extends Error{}class y extends Error{}class b extends Error{constructor(e){super(),this.code="ENOENT",this.name="PageNotFoundError",this.message=`Cannot find module for page: ${e}`}}class w extends Error{constructor(e,t){super(),this.message=`Failed to load static file for page: ${e} ${t}`}}class x extends Error{constructor(){super(),this.code="ENOENT",this.message="Cannot find the middleware module"}}function E(e){return JSON.stringify({message:e.message,stack:e.stack})}},28342,676167,e=>{var t=e.i(843476),r=e.i(111110);let n=["一年级","二年级","三年级","四年级","五年级","六年级","初一","初二","初三","高一","高二","高三","大一","大二","大三","大四"],o=n.flatMap(e=>[`${e}上`,`${e}下`]),i={primary:{start:0,end:6},junior_high:{start:6,end:9},senior_high:{start:9,end:12},university:{start:12,end:16}};e.s(["T",0,n,"H",0,o,"c",0,function(e){let t=i[e];return t?n.slice(t.start,t.end):[]},"p",0,function(e){return e.endsWith("上")?{grade:e.slice(0,-1),semester:"上"}:e.endsWith("下")?{grade:e.slice(0,-1),semester:"下"}:null}],676167),e.s(["f",0,function({id:e,value:i,onChange:a,disabled:s}){let{t:l}=(0,r.b)();return(0,t.jsxs)("select",{id:e,value:i,onChange:e=>a(e.target.value),disabled:s,"aria-label":l.editor.gradeSemester,className:"h-10 w-full min-w-0 rounded-md border border-input bg-background px-3 text-sm disabled:opacity-50",children:[(0,t.jsx)("option",{value:"",children:l.common.notSet}),i&&!o.includes(i)&&(0,t.jsx)("option",{value:i,children:i}),n.flatMap((e,r)=>["上","下"].map((n,o)=>(0,t.jsxs)("option",{value:`${e}${n}`,children:[l.gradeSelection.names[r]," · ",0===o?l.gradeSelection.firstSemester:l.gradeSelection.secondSemester]},`${e}${n}`)))]})}],28342)},487486,e=>{var t=e.i(843476),r=e.i(991918),n=e.i(225913),o=e.i(975157);let i=(0,n.f)("inline-flex items-center justify-center rounded-full border px-2 py-0.5 text-xs font-medium w-fit whitespace-nowrap shrink-0 [&>svg]:size-3 gap-1 [&>svg]:pointer-events-none focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive transition-[color,box-shadow] overflow-hidden",{variants:{variant:{default:"border-transparent bg-primary text-primary-foreground [a&]:hover:bg-primary/90",secondary:"border-transparent bg-secondary text-secondary-foreground [a&]:hover:bg-secondary/90",destructive:"border-transparent bg-destructive text-white [a&]:hover:bg-destructive/90 focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40 dark:bg-destructive/60",outline:"text-foreground [a&]:hover:bg-accent [a&]:hover:text-accent-foreground"}},defaultVariants:{variant:"default"}});e.s(["f",0,function({className:e,variant:n,asChild:a=!1,...s}){let l=a?r.M:"span";return(0,t.jsx)(l,{"data-slot":"badge",className:(0,o.f)(i({variant:n}),e),...s})}])},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),i=e.i(30030),a=e.i(610772),s=e.i(369340),l=e.i(726330),u=e.i(765491),c=e.i(774606),f=e.i(296626),d=e.i(248425),p=e.i(303536),m=e.i(934620),g=e.i(985369),h=e.i(186312),v=e.i(991918),y=Object.defineProperty,b=(e,t)=>y(e,"name",{value:t,configurable:!0}),w="Dialog",[x,E]=(0,i.f)(w),[S,j]=x(w),C=b(e=>{let{__scopeDialog:n,children:o,open:i,defaultOpen:l,onOpenChange:c,modal:f=!0}=e,d=r.useRef(null),p=r.useRef(null),{nodes:m,registry:g}=(0,u.D)(),[h,v]=(0,s.f)({prop:i,defaultProp:l??!1,onChange:c,caller:w}),[y,b]=r.useState(0),[x,E]=r.useState(0);return(0,t.jsx)(S,{scope:n,triggerRef:d,contentRef:p,contentId:(0,a.f)(),titleId:(0,a.f)(),descriptionId:(0,a.f)(),titlePresent:y>0,descriptionPresent:x>0,setTitleCount:b,setDescriptionCount:E,open:h,onOpenChange:v,onOpenToggle:r.useCallback(()=>v(e=>!e),[v]),modal:f,branchNodes:m,branchRegistry:g,children:o})},"Dialog"),N=r.forwardRef(b(function(e,r){let{__scopeDialog:i,...a}=e,s=j("DialogTrigger",i),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":W(s.open),...a,ref:l,onClick:(0,n.f)(e.onClick,s.onOpenToggle)})},"DialogTrigger")),P="DialogPortal",[O,R]=x(P,{forceMount:void 0}),D=b(e=>{let{__scopeDialog:n,forceMount:o,children:i,container:a}=e,s=j(P,n);return(0,t.jsx)(O,{scope:n,forceMount:o,children:r.Children.map(i,e=>(0,t.jsx)(f.f,{present:o||s.open,children:(0,t.jsx)(c.f,{asChild:!0,container:a,children:e})}))})},"DialogPortal"),T="DialogOverlay",M=r.forwardRef(b(function(e,r){let n=R(T,e.__scopeDialog),{forceMount:o=n.forceMount,...i}=e,a=j(T,e.__scopeDialog);return a.modal?(0,t.jsx)(f.f,{present:o||a.open,children:(0,t.jsx)(A,{...i,ref:r})}):null},"DialogOverlay")),k=(0,v.B)("DialogOverlay.RemoveScroll"),A=r.forwardRef(b(function(e,n){let{__scopeDialog:i,...a}=e,s=j(T,i),u=(0,l.y)(),c=(0,o.f)(n,u);return(0,t.jsx)(g.f,{as:k,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":W(s.open),...a,ref:c,style:{pointerEvents:"auto",...a.style}})})},"DialogOverlayImpl")),_="DialogContent",I=r.forwardRef(b(function(e,r){let n=R(_,e.__scopeDialog),{forceMount:o=n.forceMount,...i}=e,a=j(_,e.__scopeDialog);return(0,t.jsx)(f.f,{present:o||a.open,children:a.modal?(0,t.jsx)(L,{...i,ref:r}):(0,t.jsx)($,{...i,ref:r})})},"DialogContent")),L=r.forwardRef(b(function(e,i){let a=j(_,e.__scopeDialog),s=r.useRef(null),l=(0,o.f)(i,a.contentRef,s);return r.useEffect(()=>{let e=s.current;if(e)return(0,h.f)(e)},[]),(0,t.jsx)(z,{...e,ref:l,trapFocus:a.open,disableOutsidePointerEvents:a.open,onCloseAutoFocus:(0,n.f)(e.onCloseAutoFocus,e=>{e.preventDefault(),a.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=j(_,e.__scopeDialog),i=r.useRef(!1),a=r.useRef(!1);return(0,t.jsx)(z,{...e,ref:n,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:t=>{e.onCloseAutoFocus?.(t),t.defaultPrevented||(i.current||o.triggerRef.current?.focus(),t.preventDefault()),i.current=!1,a.current=!1},onInteractOutside:t=>{e.onInteractOutside?.(t),t.defaultPrevented||(i.current=!0,"pointerdown"===t.detail.originalEvent.type&&(a.current=!0));let r=t.target;o.triggerRef.current?.contains(r)&&t.preventDefault(),"focusin"===t.detail.originalEvent.type&&a.current&&t.preventDefault()}})},"DialogContentNonModal")),z=r.forwardRef(b(function(e,r){let{__scopeDialog:n,trapFocus:o,onOpenAutoFocus:i,onCloseAutoFocus:a,"aria-describedby":s,children:c,...f}=e,d=j(_,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:i,onUnmountAutoFocus:a,children:(0,t.jsx)(l.V,{role:"dialog",id:d.contentId,"aria-labelledby":d.titlePresent?d.titleId:void 0,"aria-describedby":d.descriptionPresent?B(s,d.descriptionId):s,"data-state":W(d.open),...f,ref:r,deferPointerDownOutside:!0,onDismiss:()=>d.onOpenChange(!1),children:c})})})},"DialogContentImpl")),F=r.forwardRef(b(function(e,r){let{__scopeDialog:n,...o}=e,i=j("DialogTitle",n),{setTitleCount:a}=i;return(0,m.f)(()=>(a(e=>e+1),()=>a(e=>e-1)),[a]),(0,t.jsx)(d.V.h2,{id:i.titleId,...o,ref:r})},"DialogTitle")),U=r.forwardRef(b(function(e,r){let{__scopeDialog:n,...o}=e,i=j("DialogDescription",n),{setDescriptionCount:a}=i;return(0,m.f)(()=>(a(e=>e+1),()=>a(e=>e-1)),[a]),(0,t.jsx)(d.V.p,{id:i.descriptionId,...o,ref:r})},"DialogDescription")),V=r.forwardRef(b(function(e,r){let{__scopeDialog:o,...i}=e,a=j("DialogClose",o);return(0,t.jsx)(d.V.button,{type:"button",...i,ref:r,onClick:(0,n.f)(e.onClick,()=>a.onOpenChange(!1))})},"DialogClose"));function B(...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 W(e){return e?"open":"closed"}b(B,"concatAriaDescribedby"),b(W,"getState");var q=e.i(263676),J=e.i(975157);let K=r.forwardRef(({className:e,...r},n)=>(0,t.jsx)(M,{ref:n,className:(0,J.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}));K.displayName=M.displayName;let H=r.forwardRef(({className:e,children:r,...n},o)=>(0,t.jsxs)(D,{children:[(0,t.jsx)(K,{}),(0,t.jsxs)(I,{ref:o,onPointerDownOutside:e=>{e.preventDefault()},className:(0,J.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)(q.X,{className:"h-4 w-4"}),(0,t.jsx)("span",{className:"sr-only",children:"Close"})]})]})]}));H.displayName=I.displayName;let G=({className:e,...r})=>(0,t.jsx)("div",{className:(0,J.f)("flex flex-col space-y-1.5 text-center sm:text-left",e),...r});G.displayName="DialogHeader";let X=({className:e,...r})=>(0,t.jsx)("div",{className:(0,J.f)("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",e),...r});X.displayName="DialogFooter";let Z=r.forwardRef(({className:e,...r},n)=>(0,t.jsx)(F,{ref:n,className:(0,J.f)("text-lg font-semibold leading-none tracking-tight",e),...r}));Z.displayName=F.displayName;let Y=r.forwardRef(({className:e,...r},n)=>(0,t.jsx)(U,{ref:n,className:(0,J.f)("text-sm text-muted-foreground",e),...r}));Y.displayName=U.displayName,e.s(["N",0,C,"d",0,H,"C",0,Y,"c",0,X,"s",0,G,"F",0,Z,"a",0,N],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})}])},110204,e=>{var t=e.i(843476),r=e.i(271645),n=e.i(248425),o=Object.defineProperty,i=r.forwardRef(o(function(e,r){return(0,t.jsx)(n.V.label,{...e,ref:r,onMouseDown:t=>{t.target.closest("button, input, select, textarea")||(e.onMouseDown?.(t),!t.defaultPrevented&&t.detail>1&&t.preventDefault())}})},"name",{value:"Label",configurable:!0})),a=e.i(975157);e.s(["f",0,function({className:e,...r}){return(0,t.jsx)(i,{"data-slot":"label",className:(0,a.f)("flex items-center gap-2 text-sm leading-none font-medium select-none group-data-[disabled=true]:pointer-events-none group-data-[disabled=true]:opacity-50 peer-disabled:cursor-not-allowed peer-disabled:opacity-50",e),...r})}],110204)},624687,e=>{var t=e.i(843476),r=e.i(975157);e.s(["f",0,function({className:e,...n}){return(0,t.jsx)("textarea",{"data-slot":"textarea",className:(0,r.f)("border-input placeholder:text-muted-foreground focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive dark:bg-input/30 flex field-sizing-content min-h-16 w-full rounded-md border bg-transparent px-3 py-2 text-base shadow-xs transition-[color,box-shadow] outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50 md:text-sm",e),...n})}])},215519,e=>{var t=e.i(843476),r=e.i(271645),n=e.i(306831);let o=(0,r.createContext)({timeZone:n.J,setTimeZone:()=>void 0});e.s(["n",0,function({children:e,initialTimeZone:i=n.J}){let[a,s]=(0,r.useState)(i);return(0,t.jsx)(o.Provider,{value:{timeZone:a,setTimeZone:s},children:e})},"M",0,function(){return(0,r.useContext)(o)}])},41931,294114,e=>{let t={success:2500,info:3500,warning:4500,error:5e3},r={toasts:[],confirm:null},n=1,o=new Set;function i(e){r=e,o.forEach(e=>e(r))}function a(e){i({...r,toasts:r.toasts.filter(t=>t.id!==e)})}function s(e,o){let s="string"==typeof o?o:String(o??"");if(!s)return;let l=n++;i({...r,toasts:[...r.toasts.slice(-3),{id:l,type:e,message:s}]}),setTimeout(()=>a(l),t[e])}let l={success:e=>s("success",e),error:e=>s("error",e),info:e=>s("info",e),warning:e=>s("warning",e)};e.s(["u",0,function(e,t={}){return 0===o.size?Promise.resolve("function"==typeof window.confirm&&window.confirm(e)):(r.confirm?.resolve(!1),new Promise(o=>{let a=n++;i({...r,confirm:{...t,id:a,message:e,resolve:e=>{r.confirm?.id===a&&i({...r,confirm:null}),o(e)}}})}))},"p",0,a,"M",0,function(e){return o.add(e),e(r),()=>{o.delete(e)}},"c",0,l],294114);var u=e.i(869253);class c extends Error{status;statusText;data;constructor(e,t,r){super(`API Error: ${e} ${t}`),this.status=e,this.statusText=t,this.data=r,this.name="ApiError"}}function f(e){if("object"!=typeof e||null===e||!("code"in e)||"AI_DAILY_LIMIT_EXCEEDED"!==e.code)return;let t="zh";try{"en"===localStorage.getItem("app-language")&&(t="en")}catch{}l.warning(u.f[t].errors.AI_DAILY_LIMIT_EXCEEDED)}let d=e=>new Promise(t=>setTimeout(t,e));async function p(e,t,r){let n=Date.now();for(;Date.now()<t;){let t=null;try{t=await m(`/api/requests/${e}`,{method:"GET",timeout:15e3})}catch(e){if(e instanceof c&&404===e.status&&Date.now()-n>6e3)throw r}if(t?.state==="done"){if(t.status>=200&&t.status<300)return t.body??{};throw 429===t.status&&f(t.body),new c(t.status,"",t.body)}await d(3e3)}throw new c(408,"Request Timeout",{message:"AI_TIMEOUT_ERROR"})}async function m(e,t={}){let r,{params:n,headers:o,timeout:i=6e4,recoverable:a,...s}=t,l=a?(r=new Uint8Array(16),crypto.getRandomValues(r),Array.from(r,e=>e.toString(16).padStart(2,"0")).join("")):null,u=Date.now(),d=e;if(n){let e=new URLSearchParams(n);d+=`?${e.toString()}`}let g=new AbortController,h=setTimeout(()=>g.abort(),i);try{let e=await fetch(d,{headers:{"Content-Type":"application/json",...l?{"X-Request-Id":l}:{},...o},signal:g.signal,...s});if(clearTimeout(h),!e.ok){let t,r=await e.text();try{t=JSON.parse(r)}catch{t=r}throw 429===e.status&&f(t),new c(e.status,e.statusText,t)}if(204===e.status)return{};try{return await e.json()}catch{return{}}}catch(e){if(clearTimeout(h),e instanceof Error&&"AbortError"===e.name)throw new c(408,"Request Timeout",{message:"AI_TIMEOUT_ERROR"});if(l&&e instanceof TypeError)return p(l,u+i,e);throw e}}e.s(["a",0,c,"k",0,{get:(e,t)=>m(e,{...t,method:"GET"}),post:(e,t,r)=>m(e,{...r,method:"POST",body:JSON.stringify(t)}),put:(e,t,r)=>m(e,{...r,method:"PUT",body:JSON.stringify(t)}),patch:(e,t,r)=>m(e,{...r,method:"PATCH",body:JSON.stringify(t)}),delete:(e,t)=>m(e,{...t,method:"DELETE"})}],41931)},303163,e=>{e.s(["L",0,function(e){if("object"!=typeof e||null===e||!("data"in e))return;let{data:t}=e;if("object"==typeof t&&null!==t&&"details"in t)return"string"==typeof t.details&&t.details?t.details:void 0},"d",0,function(e){if("object"!=typeof e||null===e||!("data"in e))return;let{data:t}=e;if("object"==typeof t&&null!==t&&"message"in t)return"string"==typeof t.message?t.message:void 0},"Z",0,function(e){return e instanceof Error?e.message:String(e)}])},113381,e=>{var t=e.i(303163);let r=["Line","Segment","Ray","Point","Circle","Ellipse","Hyperbola","Parabola","Polygon","Intersect","Midpoint","PerpendicularLine","Angle","Text","Slider","Locus","Reflect","Translate","Rotate","Vector","UnitVector","OrthogonalVector","Distance","Length","Area","Tangent","Arc","CircularArc","Semicircle","Sequence","Element","If","Sum","Integral","Derivative","Root","Extremum","sin","cos","tan","asin","acos","atan","sqrt","abs","exp","ln","log","floor","ceil","round","min","max"],n=["setCoordSystem","setAxesVisible","setGridVisible","setColor","setLineThickness","setLineStyle","setPointSize","setPointStyle","setLabelVisible","setCaption","setVisible","setFilling","setValue","setFixed","setBackgroundColor"],o=new Map(n.map(e=>[e.toLowerCase(),e])),i=new Set(r.map(e=>e.toLowerCase())),a=/(?:java|vb)script\s*:|[\u0000-\u0008\u000b\u000c\u000e-\u001f]/i;function s(e){if(a.test(e)||/<\s*\/?\s*(?:script|iframe|img|svg|object|embed|html)\b/i.test(e))return!0;for(let t of e.matchAll(/"(?:\\.|[^"\\])*"|'(?:\\.|[^'\\])*'/g))try{let e=u(t[0]);if("string"==typeof e&&(/<\s*\/?\s*[a-z!][^>]*>/i.test(e)||a.test(e)))return!0;if(t[0].startsWith('"'))try{let e=JSON.parse(t[0]);if("string"==typeof e&&(/<\s*\/?\s*[a-z!][^>]*>/i.test(e)||/(?:java|vb)script\s*:/i.test(e)))return!0}catch{}}catch{return!0}return!1}function l(e){if(!e.trim())return[];let t=[],r="",n=!1,o=0,i=0;for(let a=0;a<e.length;a++){let s=e[a];if(r)n?n=!1:"\\"===s?n=!0:s===r&&(r="");else if('"'===s||"'"===s)r=s;else if("["===s)o++;else if("]"===s){if(--o<0)throw Error("参数括号不匹配")}else","===s&&0===o&&(t.push(e.slice(i,a).trim()),i=a+1)}if(r||o||n)throw Error("参数未闭合");return t.push(e.slice(i).trim()),t}function u(e){if(/^[+-]?(?:\d+\.?\d*|\.\d+)(?:e[+-]?\d+)?$/i.test(e)){let t=Number(e);if(Number.isFinite(t))return t}if("true"===e||"false"===e)return"true"===e;if(e.startsWith("[")&&e.endsWith("]"))return l(e.slice(1,-1)).map(u);let t=e[0];if(('"'===t||"'"===t)&&e.endsWith(t)){let r=e.slice(1,-1),n="";for(let e=0;e<r.length;e++){if(r[e]===t)throw Error("字符串包含未转义引号");if("\\"!==r[e])n+=r[e];else{let o=r[++e];if(void 0===o)throw Error("字符串转义未闭合");n+="\\"===o||o===t?o:"\\"+o}}return n}if(/^[\p{L}_][\p{L}\p{N}_]*$/u.test(e))return e;throw Error("API 参数必须是字面值")}e.s(["r",0,n,"I",0,r,"i",0,function(e){if(!e?.trim())return[];let t=e.trim();if(t.startsWith("["))try{let e=JSON.parse(t);if(Array.isArray(e))return e.filter(e=>"string"==typeof e&&!!e.trim())}catch{}return t.split("\n").map(e=>e.trim()).filter(e=>e&&!e.startsWith("//"))},"L",0,function(e,r){let n=[],a=new Set;for(let c of r)try{if(s(c))throw Error("命令包含不允许的脚本或标记");if(function(e){let t=e.trim().match(/^(\w+)\s*\(/)?.[1].toLowerCase();return!!t&&o.has(t)}(c)){let t=function(e){let t=e.trim().match(/^(\w+)\s*\(([\s\S]*)\)$/);if(!t)return null;let r=o.get(t[1].toLowerCase());if(!r)return null;try{let e=l(t[2]).map(u);return{m:r,a:e}}catch{return null}}(c),r=t?e[t.m]:void 0;if(!t||"function"!=typeof r)throw Error("API 方法或参数无效");r.apply(e,t.a)}else{if(!function(e,t=new Set){if(!e.trim()||s(e)||/[;`\r\n]/.test(e))return!1;let r=e.replace(/"(?:\\.|[^"\\])*"|'(?:\\.|[^'\\])*'/g,"");if(/["']/.test(r)||/(?:https?:|\b(?:ggbApplet|window|document)\b)/i.test(r)||/\b(?:Execute|RunClickScript|RunUpdateScript|JavaScript|eval|Function|Open|PlaySound|ReadText)\b/i.test(r))return!1;let n=r.match(/^\s*([\p{L}_][\p{L}\p{N}_]*)\s*\([^)]*\)\s*=/u)?.[1];for(let e of r.matchAll(/([\p{L}_][\p{L}\p{N}_]*)\s*[(\[]/gu)){let r=e[1];if(!i.has(r.toLowerCase())&&r!==n&&!t.has(r))return!1}return!0}(c,a))throw Error("指令不在允许范围内");if(!e.evalCommand(c.trim()))throw Error("GeoGebra 未能执行该命令");let t=c.match(/^\s*([\p{L}_][\p{L}\p{N}_]*)\s*\([^)]*\)\s*=/u)?.[1];t&&a.add(t)}}catch(e){n.push({command:c,message:(0,t.Z)(e)})}return n}])},664030,e=>{var t=e.i(271645),r=e.i(41931),n=e.i(201276);let o=null,i=0,a=new Set;e.s(["f",0,function(){let[e,s]=(0,t.useState)(o??[]),[l,u]=(0,t.useState)(!o),[c,f]=(0,t.useState)(null),d=(0,t.useCallback)(async(e=!1)=>{let t=Date.now();if(!e&&o&&t-i<3e4){s(o),u(!1);return}try{u(!0);let e=await r.k.get("/api/paper-groups");o=e,i=t,a.forEach(t=>t(e)),f(null)}catch(e){n.V.error("[usePaperGroups]","Failed to fetch paper groups",{error:e}),f("Failed to load paper groups")}finally{u(!1)}},[]);return(0,t.useEffect)(()=>(a.add(s),d(),()=>{a.delete(s)}),[d]),{groups:e,loading:l,error:c,refetch:(0,t.useCallback)(()=>(o=null,i=0,d(!0)),[d])}}])}])})();
|