wrong-notebook 2026.10.31-2 → 2026.10.31-4
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 +2 -0
- package/.next/build-manifest.json +3 -3
- package/.next/prerender-manifest.json +3 -3
- package/.next/routes-manifest.json +12 -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/dashboard/route.js +14 -13
- package/.next/server/app/api/admin/dashboard/route.js.nft.json +1 -1
- package/.next/server/app/api/admin/debug-logs/export/route/app-paths-manifest.json +3 -0
- package/.next/server/app/api/admin/debug-logs/export/route/build-manifest.json +12 -0
- package/.next/server/app/api/admin/debug-logs/export/route/server-reference-manifest.json +4 -0
- package/.next/server/app/api/admin/debug-logs/export/route.js +13 -0
- package/.next/server/app/api/admin/debug-logs/export/route.js.map +5 -0
- package/.next/server/app/api/admin/debug-logs/export/route.js.nft.json +1 -0
- package/.next/server/app/api/admin/debug-logs/export/route_client-reference-manifest.js +3 -0
- package/.next/server/app/api/admin/debug-logs/route/app-paths-manifest.json +3 -0
- package/.next/server/app/api/admin/debug-logs/route/build-manifest.json +12 -0
- package/.next/server/app/api/admin/debug-logs/route/server-reference-manifest.json +4 -0
- package/.next/server/app/api/admin/debug-logs/route.js +12 -0
- package/.next/server/app/api/admin/debug-logs/route.js.map +5 -0
- package/.next/server/app/api/admin/debug-logs/route.js.nft.json +1 -0
- package/.next/server/app/api/admin/debug-logs/route_client-reference-manifest.js +3 -0
- package/.next/server/app/api/admin/migrate-tags/route.js +3 -3
- package/.next/server/app/api/admin/migrate-tags/route.js.nft.json +1 -1
- package/.next/server/app/api/admin/system-reset/route.js +2 -2
- 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 +14 -13
- 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 +2 -2
- package/.next/server/app/api/admin/users/[id]/route.js.nft.json +1 -1
- package/.next/server/app/api/admin/users/route.js +3 -3
- package/.next/server/app/api/admin/users/route.js.nft.json +1 -1
- package/.next/server/app/api/ai/models/route.js +11 -10
- package/.next/server/app/api/ai/models/route.js.nft.json +1 -1
- package/.next/server/app/api/ai/test/route.js +12 -12
- package/.next/server/app/api/ai/test/route.js.nft.json +1 -1
- package/.next/server/app/api/analytics/route.js +14 -13
- package/.next/server/app/api/analytics/route.js.nft.json +1 -1
- package/.next/server/app/api/analyze/route.js +16 -15
- package/.next/server/app/api/analyze/route.js.nft.json +1 -1
- package/.next/server/app/api/auth/[...nextauth]/route.js +1 -1
- package/.next/server/app/api/auth/[...nextauth]/route.js.nft.json +1 -1
- package/.next/server/app/api/error-items/[id]/delete/route.js +2 -2
- 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 +15 -14
- 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 +16 -15
- package/.next/server/app/api/error-items/[id]/fix-latex/route.js.nft.json +1 -1
- package/.next/server/app/api/error-items/[id]/geogebra/route.js +15 -14
- 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 +5 -5
- 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 +2 -2
- 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 +3 -3
- 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 +15 -14
- 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 +17 -16
- 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 +3 -3
- 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 +15 -14
- 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 +15 -14
- 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 +2 -2
- 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 +2 -2
- package/.next/server/app/api/error-items/clear/route.js.nft.json +1 -1
- package/.next/server/app/api/error-items/list/route.js +3 -3
- package/.next/server/app/api/error-items/list/route.js.nft.json +1 -1
- package/.next/server/app/api/error-items/route.js +18 -16
- package/.next/server/app/api/error-items/route.js.nft.json +1 -1
- package/.next/server/app/api/error-items/short/[shortId]/route.js +3 -3
- 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 +5 -5
- 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 +17 -16
- package/.next/server/app/api/exams/[id]/questions/[questionId]/regenerate/route.js.nft.json +1 -1
- package/.next/server/app/api/exams/[id]/results/route.js +16 -15
- package/.next/server/app/api/exams/[id]/results/route.js.nft.json +1 -1
- package/.next/server/app/api/exams/[id]/retry/route.js +17 -16
- package/.next/server/app/api/exams/[id]/retry/route.js.nft.json +1 -1
- package/.next/server/app/api/exams/[id]/route.js +13 -12
- package/.next/server/app/api/exams/[id]/route.js.nft.json +1 -1
- package/.next/server/app/api/exams/route.js +16 -15
- package/.next/server/app/api/exams/route.js.nft.json +1 -1
- package/.next/server/app/api/export/route.js +3 -3
- package/.next/server/app/api/export/route.js.nft.json +1 -1
- package/.next/server/app/api/geogebra-analyze/route.js +15 -14
- package/.next/server/app/api/geogebra-analyze/route.js.nft.json +1 -1
- package/.next/server/app/api/health/route.js.nft.json +1 -1
- package/.next/server/app/api/import/route.js +17 -16
- package/.next/server/app/api/import/route.js.nft.json +1 -1
- package/.next/server/app/api/initialize/route.js +6 -6
- package/.next/server/app/api/initialize/route.js.nft.json +1 -1
- package/.next/server/app/api/logs/frontend/route.js +2 -2
- package/.next/server/app/api/logs/frontend/route.js.nft.json +1 -1
- package/.next/server/app/api/minimax-code/checkin/route.js +3 -3
- package/.next/server/app/api/minimax-code/checkin/route.js.nft.json +1 -1
- package/.next/server/app/api/minimax-code/login/route.js +1 -1
- package/.next/server/app/api/minimax-code/login/route.js.nft.json +1 -1
- package/.next/server/app/api/minimax-code/route.js +3 -3
- package/.next/server/app/api/minimax-code/route.js.nft.json +1 -1
- package/.next/server/app/api/notebooks/[id]/retag/route.js +15 -15
- package/.next/server/app/api/notebooks/[id]/retag/route.js.nft.json +1 -1
- package/.next/server/app/api/notebooks/[id]/route.js +2 -2
- package/.next/server/app/api/notebooks/[id]/route.js.nft.json +1 -1
- package/.next/server/app/api/notebooks/route.js +4 -4
- package/.next/server/app/api/notebooks/route.js.nft.json +1 -1
- package/.next/server/app/api/openclaw/batch-upload/route.js +17 -16
- package/.next/server/app/api/openclaw/batch-upload/route.js.nft.json +1 -1
- package/.next/server/app/api/practice/generate/route.js +15 -14
- package/.next/server/app/api/practice/generate/route.js.nft.json +1 -1
- package/.next/server/app/api/practice/grade/route.js +14 -13
- package/.next/server/app/api/practice/grade/route.js.nft.json +1 -1
- package/.next/server/app/api/practice/record/[id]/route.js +13 -12
- package/.next/server/app/api/practice/record/[id]/route.js.nft.json +1 -1
- package/.next/server/app/api/practice/record/route.js +13 -12
- package/.next/server/app/api/practice/record/route.js.nft.json +1 -1
- package/.next/server/app/api/reanswer/route.js +14 -13
- package/.next/server/app/api/reanswer/route.js.nft.json +1 -1
- package/.next/server/app/api/register/route.js +7 -7
- package/.next/server/app/api/register/route.js.nft.json +1 -1
- package/.next/server/app/api/register/status/route.js +6 -6
- package/.next/server/app/api/register/status/route.js.nft.json +1 -1
- package/.next/server/app/api/requests/[id]/route.js +3 -3
- package/.next/server/app/api/requests/[id]/route.js.nft.json +1 -1
- package/.next/server/app/api/review/due/route.js +15 -14
- package/.next/server/app/api/review/due/route.js.nft.json +1 -1
- package/.next/server/app/api/settings/route.js +8 -8
- package/.next/server/app/api/settings/route.js.nft.json +1 -1
- package/.next/server/app/api/setup/route.js +3 -3
- package/.next/server/app/api/setup/route.js.nft.json +1 -1
- package/.next/server/app/api/stats/practice/clear/route.js +2 -2
- package/.next/server/app/api/stats/practice/clear/route.js.nft.json +1 -1
- package/.next/server/app/api/stats/practice/route.js +2 -2
- package/.next/server/app/api/stats/practice/route.js.nft.json +1 -1
- package/.next/server/app/api/tags/route.js +2 -2
- package/.next/server/app/api/tags/route.js.nft.json +1 -1
- package/.next/server/app/api/tags/stats/route.js +2 -2
- package/.next/server/app/api/tags/stats/route.js.nft.json +1 -1
- package/.next/server/app/api/tags/suggestions/route.js +2 -2
- package/.next/server/app/api/tags/suggestions/route.js.nft.json +1 -1
- package/.next/server/app/api/tasks/route.js +1 -1
- package/.next/server/app/api/tasks/route.js.nft.json +1 -1
- package/.next/server/app/api/tts/[id]/route.js +6 -6
- package/.next/server/app/api/tts/[id]/route.js.nft.json +1 -1
- package/.next/server/app/api/tts/batch/route.js +10 -10
- package/.next/server/app/api/tts/batch/route.js.nft.json +1 -1
- package/.next/server/app/api/tts/route.js +6 -6
- package/.next/server/app/api/tts/route.js.nft.json +1 -1
- package/.next/server/app/api/tts/status/route.js +9 -8
- package/.next/server/app/api/tts/status/route.js.nft.json +1 -1
- package/.next/server/app/api/user/route.js +14 -13
- package/.next/server/app/api/user/route.js.nft.json +1 -1
- package/.next/server/app/error-items/[id]/page.js.nft.json +1 -1
- package/.next/server/app/error-items/[id]/page_client-reference-manifest.js +1 -1
- package/.next/server/app/exams/[id]/page.js.nft.json +1 -1
- package/.next/server/app/exams/[id]/page_client-reference-manifest.js +1 -1
- package/.next/server/app/exams/[id]/print/page.js.nft.json +1 -1
- package/.next/server/app/exams/[id]/print/page_client-reference-manifest.js +1 -1
- package/.next/server/app/exams/page.js.nft.json +1 -1
- package/.next/server/app/exams/page_client-reference-manifest.js +1 -1
- package/.next/server/app/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 +2 -0
- package/.next/server/chunks/1oeh_server_app_api_admin_debug-logs_export_route_actions_0fuk-ong1cgma.js +3 -0
- package/.next/server/chunks/{[root-of-the-server]__0ulqz3-khwsss._.js → [root-of-the-server]__00kq2qcxfg-kq._.js} +2 -2
- package/.next/server/chunks/{[root-of-the-server]__05q3msyjhb-j7._.js → [root-of-the-server]__0455yyxule6q_._.js} +1 -1
- package/.next/server/chunks/{[root-of-the-server]__13kqbfb17y3bb._.js → [root-of-the-server]__05n74a-t4yfhk._.js} +2 -2
- package/.next/server/chunks/[root-of-the-server]__065p5m2qghilm._.js +3 -0
- package/.next/server/chunks/{[root-of-the-server]__05vih96sbx1om._.js → [root-of-the-server]__06lmwv-4d1slg._.js} +1 -1
- package/.next/server/chunks/[root-of-the-server]__0742cu03ar47c._.js +3 -0
- package/.next/server/chunks/{[root-of-the-server]__09z4bfwu-9yvs._.js → [root-of-the-server]__07uf7ctm4sjo4._.js} +1 -1
- package/.next/server/chunks/[root-of-the-server]__09jqnx_673l93._.js +4 -4
- package/.next/server/chunks/{[root-of-the-server]__00bm6ctglztc6._.js → [root-of-the-server]__09u2ogsxwacj4._.js} +2 -2
- package/.next/server/chunks/{[root-of-the-server]__08djb4rf84-rn._.js → [root-of-the-server]__0_ahztuh3lr_n._.js} +1 -1
- package/.next/server/chunks/[root-of-the-server]__0_uvtfu0yr-na._.js +1 -7
- package/.next/server/chunks/[root-of-the-server]__0alblz4_uxesb._.js +3 -0
- package/.next/server/chunks/{[root-of-the-server]__0i3-ol6ehhndm._.js → [root-of-the-server]__0c8fgr3zelpik._.js} +2 -2
- package/.next/server/chunks/[root-of-the-server]__0gaai286hkspk._.js +3 -0
- package/.next/server/chunks/[root-of-the-server]__0jy-eooky8kei._.js +3 -0
- package/.next/server/chunks/[root-of-the-server]__0kljn4jodzvqk._.js +3 -0
- package/.next/server/chunks/{[root-of-the-server]__01r1erfsa_no0._.js → [root-of-the-server]__0kmy5264opoz7._.js} +2 -2
- package/.next/server/chunks/{[root-of-the-server]__0mq39j3mkge8x._.js → [root-of-the-server]__0n0c-mpolar22._.js} +2 -2
- package/.next/server/chunks/[root-of-the-server]__0nujsu6qbn-8o._.js +1 -7
- package/.next/server/chunks/{[root-of-the-server]__0e__jjjf812j0._.js → [root-of-the-server]__0nw6t7u627b2m._.js} +2 -2
- package/.next/server/chunks/{[root-of-the-server]__0d-k9ke0ab1db._.js → [root-of-the-server]__0os8s3dtzx4gi._.js} +2 -2
- package/.next/server/chunks/[root-of-the-server]__0ovzmxzbr6t31._.js +3 -0
- package/.next/server/chunks/[root-of-the-server]__0pn5idap1logb._.js +3 -0
- package/.next/server/chunks/{[root-of-the-server]__07dm5fr9tvnrn._.js → [root-of-the-server]__0rnr17a382rjx._.js} +2 -2
- package/.next/server/chunks/{[root-of-the-server]__1r33ci5xcutn_._.js → [root-of-the-server]__0rpqerm37sl_v._.js} +2 -2
- package/.next/server/chunks/{[root-of-the-server]__0jjprmuxd9qs1._.js → [root-of-the-server]__0u36j_9ml4et6._.js} +1 -1
- package/.next/server/chunks/{[root-of-the-server]__0lt6jfx01vune._.js → [root-of-the-server]__0xqsrh251_yms._.js} +1 -1
- package/.next/server/chunks/{[root-of-the-server]__0g5lbqntkfu-4._.js → [root-of-the-server]__0ym21tuxqrmc4._.js} +2 -2
- package/.next/server/chunks/{[root-of-the-server]__0js5-zgrcuwh3._.js → [root-of-the-server]__0z24ffpp1rsf3._.js} +2 -2
- package/.next/server/chunks/[root-of-the-server]__0z99q93n88cro._.js +3 -0
- package/.next/server/chunks/[root-of-the-server]__1-36vz3p1o-t1._.js +3 -0
- package/.next/server/chunks/{[root-of-the-server]__0r438lr8n1t9g._.js → [root-of-the-server]__10l89psqaisak._.js} +2 -2
- package/.next/server/chunks/{[root-of-the-server]__02bkgmsvvpgbn._.js → [root-of-the-server]__11ztapi1pi7j-._.js} +1 -1
- package/.next/server/chunks/[root-of-the-server]__1236d6g1_51pt._.js +3 -0
- package/.next/server/chunks/[root-of-the-server]__12_laap0hyw4p._.js +3 -0
- package/.next/server/chunks/[root-of-the-server]__12cpc3g7-oi86._.js +3 -0
- package/.next/server/chunks/{[root-of-the-server]__1mjujo3osgtnm._.js → [root-of-the-server]__12fkzjxvspcin._.js} +2 -2
- package/.next/server/chunks/[root-of-the-server]__13_k7w8nrx7ie._.js +3 -0
- package/.next/server/chunks/[root-of-the-server]__13ogen7pkq8aa._.js +3 -0
- package/.next/server/chunks/{[root-of-the-server]__02h9d-jzqj4jc._.js → [root-of-the-server]__13zeb46abilr5._.js} +1 -1
- package/.next/server/chunks/[root-of-the-server]__145w7mwgp8ujm._.js +3 -0
- package/.next/server/chunks/{[root-of-the-server]__1gweth6y-8kb7._.js → [root-of-the-server]__14wezz97rhtz9._.js} +2 -2
- package/.next/server/chunks/[root-of-the-server]__15mf1z85mft8d._.js +3 -0
- package/.next/server/chunks/[root-of-the-server]__15ypu4q7xi8ig._.js +3 -0
- package/.next/server/chunks/[root-of-the-server]__1610s5zvyss1k._.js +3 -0
- package/.next/server/chunks/[root-of-the-server]__16864lw9bhmwl._.js +3 -0
- package/.next/server/chunks/{[root-of-the-server]__11-6zqeermj9a._.js → [root-of-the-server]__18nv1yn5xh03v._.js} +2 -2
- package/.next/server/chunks/[root-of-the-server]__18uhupcdidftm._.js +3 -0
- package/.next/server/chunks/[root-of-the-server]__19a62id_4lwka._.js +3 -0
- package/.next/server/chunks/[root-of-the-server]__1b42xh9458czy._.js +3 -0
- package/.next/server/chunks/{[root-of-the-server]__1gyiwzftbxnxk._.js → [root-of-the-server]__1d1gxff_c2o28._.js} +2 -2
- package/.next/server/chunks/[root-of-the-server]__1d221u0rrj5vn._.js +3 -0
- package/.next/server/chunks/[root-of-the-server]__1d5uqlu5q008p._.js +3 -0
- package/.next/server/chunks/{[root-of-the-server]__144bps7ptlcyi._.js → [root-of-the-server]__1dreyiratyfvo._.js} +2 -2
- package/.next/server/chunks/[root-of-the-server]__1elqmd_7a9bto._.js +3 -0
- package/.next/server/chunks/[root-of-the-server]__1fj6upsvfxy4r._.js +3 -0
- package/.next/server/chunks/[root-of-the-server]__1gvnk0s0_zrpo._.js +3 -0
- package/.next/server/chunks/[root-of-the-server]__1hwftfenrsu3p._.js +3 -0
- package/.next/server/chunks/[root-of-the-server]__1lafe11jnkmlv._.js +3 -0
- package/.next/server/chunks/[root-of-the-server]__1m1wi2f60x1fk._.js +3 -0
- package/.next/server/chunks/{[root-of-the-server]__19h_colcppf_d._.js → [root-of-the-server]__1m8b6why7f1uj._.js} +2 -2
- package/.next/server/chunks/[root-of-the-server]__1mfrik5p09lu9._.js +3 -0
- package/.next/server/chunks/[root-of-the-server]__1mm69hpl71v9e._.js +3 -0
- package/.next/server/chunks/[root-of-the-server]__1mupbedevo0sa._.js +3 -0
- package/.next/server/chunks/{[root-of-the-server]__0mz6f-h1xkunr._.js → [root-of-the-server]__1n21o3aq7pxla._.js} +2 -2
- package/.next/server/chunks/{[root-of-the-server]__0bu50xf4g3rn9._.js → [root-of-the-server]__1o-0-f8rlbavp._.js} +2 -2
- package/.next/server/chunks/{[root-of-the-server]__1s-y00c3-nc_-._.js → [root-of-the-server]__1o9pbkx7ejxu0._.js} +1 -1
- package/.next/server/chunks/{[root-of-the-server]__17tl0fx9bcvnz._.js → [root-of-the-server]__1oedx4ko_1hl9._.js} +2 -2
- package/.next/server/chunks/{[root-of-the-server]__1cdvl8l8bm9y2._.js → [root-of-the-server]__1qzd0dm9ny797._.js} +1 -1
- package/.next/server/chunks/[root-of-the-server]__1r7wz_id6mvlj._.js +3 -0
- package/.next/server/chunks/{[root-of-the-server]__0byjfpj2jd58b._.js → [root-of-the-server]__1rx3b8m_g_p57._.js} +2 -2
- package/.next/server/chunks/{[root-of-the-server]__1difhrtsofqaf._.js → [root-of-the-server]__1wsyku681k2uq._.js} +2 -2
- package/.next/server/chunks/[root-of-the-server]__1ximu6k5bljjj._.js +3 -0
- package/.next/server/chunks/[root-of-the-server]__1yct9oj28kq_h._.js +3 -0
- package/.next/server/chunks/[root-of-the-server]__1yrozlry-psmk._.js +3 -0
- package/.next/server/chunks/[root-of-the-server]__1zwat9xocdoqz._.js +3 -0
- package/.next/server/chunks/[root-of-the-server]__209bfnnc4kkd3._.js +3 -0
- package/.next/server/chunks/_0kjatc7pcrkvz._.js +3 -0
- package/.next/server/chunks/_0r9ejvgz0l0-0._.js +3 -0
- package/.next/server/chunks/{_0a7_sds_l6vgw._.js → _10tpt8iizl4v3._.js} +4 -7
- package/.next/server/chunks/_11_p1ahjjply_._.js +1 -1
- package/.next/server/chunks/_12i51zlq-xxrl._.js +1 -1
- package/.next/server/chunks/_12w5k19rc45j_._.js +1 -1
- package/.next/server/chunks/_17xgce88yoq84._.js +3 -0
- package/.next/server/chunks/_1_ns7o3cqznv6._.js +1 -1
- package/.next/server/chunks/_1a1udq0c4_6ad._.js +1 -1
- package/.next/server/chunks/{_0b7ljlcl6h_ro._.js → _1dvka-waihfum._.js} +4 -7
- package/.next/server/chunks/_1gjtds8ik0l6x._.js +3 -0
- package/.next/server/chunks/_1hj7iit2u6xez._.js +1 -1
- package/.next/server/chunks/_1m-yyz-pl9-03._.js +1 -1
- package/.next/server/chunks/_1rr_juv5pj1at._.js +3 -0
- package/.next/server/chunks/_1vtmdpk7p4al9._.js +1 -1
- package/.next/server/chunks/_1wnggnglg9_n1._.js +3 -0
- package/.next/server/chunks/_next-internal_server_app_api_admin_debug-logs_route_actions_0w_ihjwlb5df7.js +3 -0
- package/.next/server/chunks/{node_modules_zod_v4_classic_external_1h9u5hd8e7zk0.js → node_modules_zod_v4_classic_external_0cradpuc4fjmm.js} +5 -5
- package/.next/server/chunks/src_lib_0ptvn4_15zxu0._.js +3 -0
- package/.next/server/chunks/src_lib_0r67kyyoh6ky6._.js +3 -0
- package/.next/server/chunks/src_lib_0svj7bkzyw9oc._.js +3 -0
- package/.next/server/chunks/{src_lib_ai_prompts_ts_0z36zms4djibp._.js → src_lib_1_m3-y2t3e4xi._.js} +151 -129
- package/.next/server/chunks/src_lib_1smlosz37xitx._.js +3 -0
- package/.next/server/chunks/src_lib_1vt5vsj108u_q._.js +3 -0
- package/.next/server/chunks/src_lib_1wm8ay-jqxakc._.js +3 -0
- package/.next/server/chunks/src_lib_ai_index_ts_0m0hlq4d9zy9i._.js +3 -0
- package/.next/server/chunks/src_lib_logger_ts_1a0ve505bb0y2._.js +1 -1
- package/.next/server/chunks/src_lib_mastery_ts_0ybi94uxn8ut6._.js +1 -1
- package/.next/server/chunks/src_lib_minimax-code_checkin_ts_1j1mpuxc1vgoz._.js +1 -1
- package/.next/server/chunks/ssr/[root-of-the-server]__0jg0uiu38i5wt._.js +1 -1
- package/.next/server/chunks/ssr/{[root-of-the-server]__20o0en_6ej3fx._.js → [root-of-the-server]__1z9766wv6dj8z._.js} +2 -2
- package/.next/server/chunks/ssr/_0-ach07vhfvmq._.js +1 -1
- package/.next/server/chunks/ssr/_02d_2cjn8qw3w._.js +1 -1
- package/.next/server/chunks/ssr/_09y2uhjubswp4._.js +1 -1
- package/.next/server/chunks/ssr/_0ajvgy4u-t-py._.js +3 -0
- package/.next/server/chunks/ssr/_0am6ugw1ulqzu._.js +1 -1
- package/.next/server/chunks/ssr/_0cmd1ubdlo_by._.js +1 -1
- package/.next/server/chunks/ssr/_0ecx95vqjqdc3._.js +3 -0
- package/.next/server/chunks/ssr/_0gs_f7ri8ab-t._.js +3 -0
- package/.next/server/chunks/ssr/_0ha8gl7l6aod0._.js +3 -0
- package/.next/server/chunks/ssr/_0lzeodofsq9pe._.js +3 -0
- package/.next/server/chunks/ssr/_0ott13fp7-ogy._.js +3 -0
- package/.next/server/chunks/ssr/_0ozptnii2nxuw._.js +3 -0
- package/.next/server/chunks/ssr/_0rd-teluypcd2._.js +1 -1
- package/.next/server/chunks/ssr/_0rwiy2u3_4def._.js +3 -0
- package/.next/server/chunks/ssr/_0smjb872ux0bv._.js +3 -0
- package/.next/server/chunks/ssr/_0tqz2g6uwot_g._.js +1 -1
- package/.next/server/chunks/ssr/_16dhqh84g_-pd._.js +1 -1
- package/.next/server/chunks/ssr/_1dioymlnwdhgc._.js +3 -0
- package/.next/server/chunks/ssr/_1m9s9225s4ark._.js +1 -1
- package/.next/server/chunks/ssr/_1qgg_ll5hkjaf._.js +2 -2
- package/.next/server/chunks/ssr/_1ux6eqqkupo6v._.js +2 -2
- package/.next/server/chunks/ssr/node_modules_lucide-react_dist_esm_icons_1_edg73v2-k_y._.js +3 -0
- package/.next/server/chunks/ssr/src_1gayunqs8u2e2._.js +1 -1
- package/.next/server/chunks/ssr/src_1m8frpkuirkx8._.js +3 -0
- 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_initialize_page_tsx_0v79s64spkms8._.js +1 -1
- package/.next/server/chunks/ssr/src_app_login_page_tsx_0yrgg2z_juzv9._.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_1lbiuzxejiwvf._.js +1 -1
- package/.next/server/chunks/ssr/src_components_1od0rowgu8w6v._.js +3 -0
- package/.next/server/chunks/ssr/src_components_create-notebook-dialog_tsx_0c5teagim70r7._.js +1 -1
- package/.next/server/chunks/ssr/src_components_error-list_error-item-card_tsx_1zsiqsrj-jjd7._.js +1 -1
- package/.next/server/chunks/ssr/src_components_mastery-panel_tsx_1--j5c7mhomdp._.js +1 -1
- package/.next/server/chunks/ssr/src_components_providers_tsx_09kw-mv3nb6xs._.js +16 -16
- package/.next/server/chunks/ssr/src_components_tag-input_tsx_0b9sxffna5c9i._.js +1 -1
- package/.next/server/chunks/ssr/src_lib_short-id-client_ts_1v7n6pg50kguj._.js +3 -0
- 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/0hcvfgiy9-3ss.js +6 -0
- package/.next/static/chunks/{2vgyg-z4vzd60.js → 0hxzktxn-ob8a.js} +1 -1
- package/.next/static/chunks/{2agtko4ygutd5.js → 0kbwvt6gwikw-.js} +1 -1
- package/.next/static/chunks/0m120lsbhh8yv.js +1 -0
- package/.next/static/chunks/{1jg7_r1zx3afu.js → 0niljyr6lth9t.js} +1 -1
- package/.next/static/chunks/0ok4hus-aa3mo.js +1 -0
- package/.next/static/chunks/10xs8eu3rd2lt.js +1 -0
- package/.next/static/chunks/19xbzv_pt8doo.js +4 -0
- package/.next/static/chunks/{10hj0kjrsv_ea.js → 1asg7-kor1mp8.js} +1 -1
- package/.next/static/chunks/1dyf1qqv2ckxs.js +1 -0
- package/.next/static/chunks/1k250olgigdg-.js +1 -0
- package/.next/static/chunks/{2olkrktzfd5ih.js → 1nelcopq5fipp.js} +1 -1
- package/.next/static/chunks/1srbpgydt7ksr.js +1 -0
- package/.next/static/chunks/1t48_lbryoxu_.js +191 -0
- package/.next/static/chunks/1uaqnxl-xshw6.js +1 -0
- package/.next/static/chunks/1w5n49a92m6od.js +1 -0
- package/.next/static/chunks/1zm8q8qoykg0h.js +1 -0
- package/.next/static/chunks/2aab9ef-dj9_m.js +1 -0
- package/.next/static/chunks/{17fy-zs1a1djj.js → 2dcd2mlj33lw_.js} +1 -1
- package/.next/static/chunks/2f2eqqck1ucy5.js +1 -0
- package/.next/static/chunks/2mu1ha8i_vrsp.js +1 -0
- package/.next/static/chunks/2u3b6_dh_so3z.css +3 -0
- package/.next/static/chunks/{005nxzvjw9q29.js → 2x835xwpv6xv9.js} +1 -1
- package/.next/static/chunks/{0eoaf9_eucdfm.js → 31pvc0nv10j93.js} +1 -1
- package/.next/static/chunks/370c45nip4mld.js +1 -0
- package/.next/static/chunks/39z_ykj6io3w_.js +1 -0
- package/.next/static/chunks/{1ptb9vuc0d3rg.js → 3_yxkdzuf9365.js} +1 -1
- package/.next/static/chunks/3cwg2_rjdz-8j.js +1 -0
- package/.next/static/chunks/3fohh6i-hrda9.js +1 -0
- package/.next/static/chunks/3m602ro466gws.js +1 -0
- package/.next/static/chunks/3rv338thn950a.js +1 -0
- package/.next/static/chunks/{2mw4064uh0j9h.js → 3snkn29ynibmr.js} +1 -1
- package/README.en.md +16 -5
- package/package.json +1 -1
- package/prisma/migrations/20261031120000_add_theme_preference/migration.sql +2 -0
- package/prisma/migrations/20261031124834_add_question_grade_rule/migration.sql +3 -0
- package/prisma/schema.prisma +3 -0
- package/prisma/seed.db +0 -0
- package/.next/server/chunks/[root-of-the-server]__0_9ctojy3l6c5._.js +0 -3
- package/.next/server/chunks/[root-of-the-server]__0d-7snynttgf8._.js +0 -3
- package/.next/server/chunks/[root-of-the-server]__0e0qdqkz3jles._.js +0 -3
- package/.next/server/chunks/[root-of-the-server]__0f6h3h6s6tevl._.js +0 -3
- package/.next/server/chunks/[root-of-the-server]__0gbs3uc-1wo62._.js +0 -3
- package/.next/server/chunks/[root-of-the-server]__0gx_zjzm5qgpy._.js +0 -3
- package/.next/server/chunks/[root-of-the-server]__0iarbrdd95e-l._.js +0 -3
- package/.next/server/chunks/[root-of-the-server]__0jn95s6x8yat-._.js +0 -3
- package/.next/server/chunks/[root-of-the-server]__0m749pvxq5lfv._.js +0 -3
- package/.next/server/chunks/[root-of-the-server]__0n8gneckcpd95._.js +0 -3
- package/.next/server/chunks/[root-of-the-server]__0nbmu4su_1fb6._.js +0 -3
- package/.next/server/chunks/[root-of-the-server]__0p1v7id5tq9qu._.js +0 -3
- package/.next/server/chunks/[root-of-the-server]__0q083sqdrq0iw._.js +0 -3
- package/.next/server/chunks/[root-of-the-server]__0qv5f-aznfbwz._.js +0 -3
- package/.next/server/chunks/[root-of-the-server]__0rdqfinadfyh1._.js +0 -3
- package/.next/server/chunks/[root-of-the-server]__0u5ihs_obekst._.js +0 -3
- package/.next/server/chunks/[root-of-the-server]__0uqvlglad9q0i._.js +0 -3
- package/.next/server/chunks/[root-of-the-server]__0w9jdzsq8ac3f._.js +0 -3
- package/.next/server/chunks/[root-of-the-server]__0xcolv22y96_c._.js +0 -3
- package/.next/server/chunks/[root-of-the-server]__10-orm2n71xqa._.js +0 -3
- package/.next/server/chunks/[root-of-the-server]__10zt_0h-5wrjx._.js +0 -3
- package/.next/server/chunks/[root-of-the-server]__123dnz_qrx_4x._.js +0 -3
- package/.next/server/chunks/[root-of-the-server]__1499m7hr136cz._.js +0 -3
- package/.next/server/chunks/[root-of-the-server]__16eyl8sayqafi._.js +0 -3
- package/.next/server/chunks/[root-of-the-server]__1bl85bz9gz7rm._.js +0 -3
- package/.next/server/chunks/[root-of-the-server]__1enjcnw44fa68._.js +0 -3
- package/.next/server/chunks/[root-of-the-server]__1f9x9qtsx92o-._.js +0 -3
- package/.next/server/chunks/[root-of-the-server]__1gchlcjngobdc._.js +0 -3
- package/.next/server/chunks/[root-of-the-server]__1i2xhya11pb1c._.js +0 -3
- package/.next/server/chunks/[root-of-the-server]__1jim3r90l2x5u._.js +0 -3
- package/.next/server/chunks/[root-of-the-server]__1ldgzla7sdl4g._.js +0 -3
- package/.next/server/chunks/[root-of-the-server]__1nxfr-1oji1ma._.js +0 -3
- package/.next/server/chunks/[root-of-the-server]__1oa6zmgy0bz87._.js +0 -3
- package/.next/server/chunks/[root-of-the-server]__1p3r_x5ii95sv._.js +0 -3
- package/.next/server/chunks/[root-of-the-server]__1qwiiilhyoxmw._.js +0 -3
- package/.next/server/chunks/[root-of-the-server]__1si5zy-sdtem-._.js +0 -3
- package/.next/server/chunks/[root-of-the-server]__1xs41k4v-on1y._.js +0 -3
- package/.next/server/chunks/[root-of-the-server]__1y2h9r822ft62._.js +0 -3
- package/.next/server/chunks/[root-of-the-server]__1yii00-p0pyb7._.js +0 -3
- package/.next/server/chunks/[root-of-the-server]__1yr38xpsck7j-._.js +0 -3
- package/.next/server/chunks/src_lib_031_wmb3hj645._.js +0 -3
- package/.next/server/chunks/src_lib_0nylv32ppnzk1._.js +0 -3
- package/.next/server/chunks/src_lib_15kwif87cuv22._.js +0 -3
- package/.next/server/chunks/src_lib_1csf8_0vpeenu._.js +0 -3
- package/.next/server/chunks/src_lib_1qy5aajgog9r2._.js +0 -3
- package/.next/server/chunks/src_lib_1wgxqrl1loni_._.js +0 -3
- package/.next/server/chunks/src_lib_logger_ts_067l8txrna0gg._.js +0 -3
- package/.next/server/chunks/ssr/_0ixj0qb0-qgg2._.js +0 -3
- package/.next/server/chunks/ssr/_0k_0zrnuw5zgx._.js +0 -3
- package/.next/server/chunks/ssr/_0rwqz_j892v12._.js +0 -3
- package/.next/server/chunks/ssr/_0tr-7klbcz1r7._.js +0 -3
- package/.next/server/chunks/ssr/_10da9s0zjn9du._.js +0 -3
- package/.next/server/chunks/ssr/_12t46t1u_n1k-._.js +0 -3
- package/.next/server/chunks/ssr/_1hp7fzio98dms._.js +0 -3
- package/.next/server/chunks/ssr/node_modules_0fm0peui_p0ra._.js +0 -3
- package/.next/server/chunks/ssr/node_modules_1yow452htx6uk._.js +0 -3
- package/.next/server/chunks/ssr/node_modules_lucide-react_dist_esm_icons_0meo4vt9kfbts._.js +0 -3
- package/.next/server/chunks/ssr/node_modules_lucide-react_dist_esm_icons_1da2oxrj0qf5v._.js +0 -3
- package/.next/server/chunks/ssr/src_0_rgx1hl-1b6i._.js +0 -3
- package/.next/server/chunks/ssr/src_components_settings_duplicate-threshold-setting_tsx_06bbmwo1pkaim._.js +0 -3
- package/.next/static/chunks/00rs-o61dxfug.js +0 -1
- package/.next/static/chunks/0dlm3crujtk0q.js +0 -1
- package/.next/static/chunks/0em3sfxbygjk8.js +0 -1
- package/.next/static/chunks/0s11n1c35xok3.js +0 -1
- package/.next/static/chunks/0u8qed0gsmuyb.js +0 -1
- package/.next/static/chunks/17fdu98fkgo_3.js +0 -1
- package/.next/static/chunks/18wxnbx_vshlv.js +0 -1
- package/.next/static/chunks/1d-up0qu0abfy.js +0 -1
- package/.next/static/chunks/1eiokd8-xan7t.js +0 -6
- package/.next/static/chunks/2_vszrn30uhv4.css +0 -3
- package/.next/static/chunks/2igkwpp45e7is.js +0 -1
- package/.next/static/chunks/2m69r4jnazewv.js +0 -191
- package/.next/static/chunks/2qy-miqy2qmzd.js +0 -4
- package/.next/static/chunks/37v5zj-q3hku_.js +0 -1
- package/.next/static/chunks/393urxlf6frd1.js +0 -1
- package/.next/static/chunks/39r5304q8nhrr.js +0 -1
- package/.next/static/chunks/3aiz227rfearv.js +0 -1
- package/.next/static/chunks/3bvflzs_j0a7o.js +0 -1
- package/.next/static/chunks/3eommddspd-ux.js +0 -1
- package/.next/static/chunks/3j49r9o2bivkf.js +0 -1
- package/.next/static/chunks/3j8kn9zjrlp3t.js +0 -1
- /package/.next/static/{NAW_XaqZEUvPxbVIgnnoN → JmrJZEztiNCQYonhTuZh_}/_buildManifest.js +0 -0
- /package/.next/static/{NAW_XaqZEUvPxbVIgnnoN → JmrJZEztiNCQYonhTuZh_}/_clientMiddlewareManifest.js +0 -0
- /package/.next/static/{NAW_XaqZEUvPxbVIgnnoN → JmrJZEztiNCQYonhTuZh_}/_ssgManifest.js +0 -0
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
(()=>{"use strict";module.exports=[219107,a=>{var b=a.i(164831);let c={name:"arrow-left",size:24,node:[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]]};c.node;let d=(0,b.f)(c);a.s(["f",0,d],219107)},695001,a=>{var b=a.i(187924),c=a.i(50944),d=a.i(699570),e=a.i(219107);a.s(["f",0,function({fallbackUrl:a,className:f}){let g=(0,c.useRouter)();return(0,b.jsx)(d.f,{variant:"ghost",size:"icon",onClick:()=>{g.push(a)},className:f,children:(0,b.jsx)(e.f,{className:"h-5 w-5"})})}])},579834,a=>{var b=a.i(187924),c=a.i(368114);a.s(["f",0,function({icon:a,title:d,description:e,action:f,className:g}){return(0,b.jsxs)("div",{className:(0,c.f)("flex flex-col items-center justify-center rounded-2xl border border-dashed bg-card/50 px-6 py-14 text-center",g),children:[(0,b.jsx)("div",{className:"mb-4 flex h-14 w-14 items-center justify-center rounded-2xl bg-accent text-accent-foreground",children:(0,b.jsx)(a,{className:"h-7 w-7"})}),(0,b.jsx)("p",{className:"font-medium",children:d}),e&&(0,b.jsx)("p",{className:"mt-1 max-w-sm text-sm text-muted-foreground",children:e}),f&&(0,b.jsx)("div",{className:"mt-5",children:f})]})}])},251538,a=>{var b=a.i(187924),c=a.i(695001),d=a.i(368114);a.s(["f",0,function({title:a,description:e,backHref:f,actions:g,titleAddon:h,className:i}){return(0,b.jsxs)("div",{className:(0,d.f)("flex items-start gap-3",i),children:[f&&(0,b.jsx)(c.f,{fallbackUrl:f,className:"-ml-2 shrink-0"}),(0,b.jsxs)("div",{className:"min-w-0 flex-1 space-y-1",children:[(0,b.jsxs)("div",{className:"flex items-center gap-1",children:[(0,b.jsx)("h1",{className:"truncate text-2xl font-bold tracking-tight sm:text-3xl",children:a}),h]}),e&&(0,b.jsx)("p",{className:"text-sm text-muted-foreground sm:text-base",children:e})]}),g&&(0,b.jsx)("div",{className:"flex shrink-0 items-center gap-2",children:g})]})}])},506376,a=>{var b=a.i(187924),c=a.i(875160);a.s(["f",0,function({label:a}){return(0,b.jsxs)("div",{className:"flex min-h-[50vh] flex-col items-center justify-center gap-3 text-muted-foreground",children:[(0,b.jsx)(c.f,{className:"h-7 w-7 animate-spin text-primary"}),a&&(0,b.jsx)("p",{className:"text-sm",children:a})]})}])},557999,a=>{var b=a.i(572131),c=a.i(550194);a.s(["f",0,function(...a){let{t:d}=(0,c.b)(),e=[d.pageTitle.base,...a.map(a=>"string"==typeof a?a.trim():"").filter(a=>a.length>0)].join("-");(0,b.useEffect)(()=>{document.title=e},[e])}])}]})();
|
|
2
|
+
|
|
3
|
+
//# sourceMappingURL=_0ajvgy4u-t-py._.js.map
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
(()=>{"use strict";module.exports=[63331,310395,a=>{var b=a.i(164831);let c={name:"box",size:24,node:[["path",{d:"M21 8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73l7 4a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16Z",key:"hh9hay"}],["path",{d:"m3.3 7 8.7 5 8.7-5",key:"g66t2b"}],["path",{d:"M12 22V12",key:"d0xqtd"}]]};c.node;let d=(0,b.f)(c);a.s(["f",0,d],63331);var e=a.i(187924),f=a.i(572131),g=a.i(875160);let h={name:"maximize-2",size:24,node:[["path",{d:"M15 3h6v6",key:"1q9fwt"}],["path",{d:"m21 3-7 7",key:"1l2asr"}],["path",{d:"m3 21 7-7",key:"tjx5ai"}],["path",{d:"M9 21H3v-6",key:"wtvkvv"}]]};h.node;let i=(0,b.f)(h),j={name:"minimize-2",size:24,node:[["path",{d:"m14 10 7-7",key:"oa77jy"}],["path",{d:"M20 10h-6V4",key:"mjg0md"}],["path",{d:"m3 21 7-7",key:"tjx5ai"}],["path",{d:"M4 14h6v6",key:"rmj7iw"}]]};j.node;let k=(0,b.f)(j);var l=a.i(533838),m=a.i(519783),n=a.i(951675),o=a.i(699570),p=a.i(550194),q=a.i(710302),r=a.i(630534);let s=["setcoordsystem","setaxesvisible","setgridvisible","setcolor","setlinethickness","setlinestyle","setpointsize","setpointstyle","setlabelvisible","setcaption","setvisible","setfilling","setvalue","setfixed","setbackgroundcolor"];a.s(["f",0,function({commands:a,height:b=700,showToolBar:c=!1,showAlgebraInput:d=!1,showMenuBar:h=!1,className:j="",onRegenerate:t,onDelete:u}){let{t:v}=(0,p.b)(),w=(0,f.useRef)(null),x=(0,f.useRef)(null),y=(0,f.useId)();(0,f.useRef)(`ggb-${y.replace(/[^a-zA-Z0-9_-]/g,"")}`);let[z,A]=(0,f.useState)(!0),[B,C]=(0,f.useState)(null),[D,E]=(0,f.useState)(!0),[F,G]=(0,f.useState)(!1),[H,I]=(0,f.useState)(!1),J=(0,f.useMemo)(()=>(function(a){if(!a?.trim())return[];let b=a.trim();if(b.startsWith("["))try{let a=JSON.parse(b);if(Array.isArray(a))return a.filter(a=>"string"==typeof a&&""!==a.trim())}catch{}return b.split("\n").map(a=>a.trim()).filter(a=>a&&!a.startsWith("//"))})(a),[a]);(0,f.useEffect)(()=>{},[J,c,d,h]),(0,f.useEffect)(()=>{var a,c,d;let e;a=w.current,c=x.current,d=D?700:b,(e=a?.firstElementChild)&&(e.style.width="100%",e.style.height=`${d}px`,c?.setSize(a?.offsetWidth||e.offsetWidth||800,d))},[D,b]);let K=(0,f.useCallback)(()=>{let a=x.current;if(a)try{a.resetConstruction(),setTimeout(()=>{x.current&&function(a,b){for(let c of b)try{if(function(a){let b=a.toLowerCase().trim();return s.some(a=>b.startsWith(a+"("))}(c)){let b=function(a){let b=a.match(/^(\w+)\(([\s\S]+)\)$/);if(!b)return null;try{let a=b[2].trim();if(a.startsWith("[")&&a.endsWith("]"))return{m:b[1],a:JSON.parse(a)};if(/^-?\d+(\.\d+)?$/.test(a))return{m:b[1],a:[Number(a)]};if("true"===a||"false"===a)return{m:b[1],a:["true"===a]};if(a.startsWith('"')&&a.endsWith('"')||a.startsWith("'")&&a.endsWith("'"))return{m:b[1],a:[a.slice(1,-1)]};let c=a.split(",").map(a=>a.trim()).map(a=>/^-?\d+(\.\d+)?$/.test(a)?Number(a):"true"===a||"false"===a?"true"===a:a.startsWith('"')&&a.endsWith('"')||a.startsWith("'")&&a.endsWith("'")?a.slice(1,-1):a);return{m:b[1],a:c}}catch{return null}}(c),d=b?a[b.m]:void 0;b&&"function"==typeof d&&d.apply(a,b.a)}else{let b=c.trim();b&&!/[<>'"]/.test(b)?a.evalCommand(b):r.f.warn("[GGB]","Blocked potentially unsafe command",{command:c.substring(0,50)})}}catch(a){r.f.warn("[GGB]","Command failed",{command:c,error:a})}}(x.current,J)},300)}catch(a){r.f.warn("[GGB]","Reset failed",{error:a})}},[J]),L=(0,f.useCallback)(async()=>{if(t&&!F){G(!0);try{await t()}finally{G(!1)}}},[t,F]),M=(0,f.useCallback)(async()=>{if(u&&!H&&await (0,q.u)(v.geogebra.confirmDelete,{destructive:!0})){I(!0);try{await u()}catch{q.c.error(v.geogebra.deleteFailed)}finally{I(!1)}}},[u,H,v]);return 0===J.length?null:(0,e.jsxs)("div",{className:`relative rounded-lg border bg-card ${j}`,children:[(0,e.jsxs)("div",{className:"flex items-center justify-between px-3 py-2 border-b bg-muted/30",children:[(0,e.jsxs)("div",{className:"flex items-center gap-2",children:[(0,e.jsx)("span",{className:"text-xs font-medium text-muted-foreground",children:v.geogebra.title}),z&&(0,e.jsx)(g.f,{className:"h-3 w-3 animate-spin text-muted-foreground"})]}),(0,e.jsxs)("div",{className:"flex items-center gap-1",children:[t&&(0,e.jsxs)(o.f,{variant:"ghost",size:"sm",className:"h-7 px-2 text-xs gap-1",onClick:L,title:v.geogebra.regenerate,disabled:F||z,children:[F?(0,e.jsx)(g.f,{className:"h-3.5 w-3.5 animate-spin"}):(0,e.jsx)(m.f,{className:"h-3.5 w-3.5"}),(0,e.jsx)("span",{children:v.geogebra.regenerate})]}),u&&(0,e.jsxs)(o.f,{variant:"ghost",size:"sm",className:"h-7 px-2 text-xs gap-1 text-destructive hover:text-destructive",onClick:M,title:v.geogebra.delete,disabled:H||F,children:[H?(0,e.jsx)(g.f,{className:"h-3.5 w-3.5 animate-spin"}):(0,e.jsx)(n.f,{className:"h-3.5 w-3.5"}),(0,e.jsx)("span",{children:v.geogebra.delete})]}),(0,e.jsx)(o.f,{variant:"ghost",size:"sm",className:"h-7 w-7 p-0",onClick:K,title:v.geogebra.reset,disabled:z,children:(0,e.jsx)(l.f,{className:"h-3.5 w-3.5"})}),(0,e.jsx)(o.f,{variant:"ghost",size:"sm",className:"h-7 w-7 p-0",onClick:()=>E(a=>!a),title:D?v.geogebra.shrink:v.geogebra.enlarge,children:D?(0,e.jsx)(k,{className:"h-3.5 w-3.5"}):(0,e.jsx)(i,{className:"h-3.5 w-3.5"})})]})]}),(0,e.jsx)("div",{ref:w,style:{width:"100%"}}),z&&(0,e.jsx)("div",{className:"absolute inset-0 z-10 flex items-center justify-center bg-background/80 rounded-b-lg",style:{top:37},children:(0,e.jsxs)("div",{className:"flex flex-col items-center gap-2",children:[(0,e.jsx)(g.f,{className:"h-6 w-6 animate-spin text-primary"}),(0,e.jsx)("span",{className:"text-sm text-muted-foreground",children:v.geogebra.loading})]})}),B&&(0,e.jsx)("div",{className:"flex items-center justify-center text-sm text-destructive",style:{minHeight:b},children:B})]})}],310395)},797521,a=>{var b=a.i(187924),c=a.i(572131),d=c,e={x:0,y:0,width:0,height:0,unit:"px"},f=(a,b,c)=>Math.min(Math.max(a,b),c),g=(a,b)=>a===b||a.width===b.width&&a.height===b.height&&a.x===b.x&&a.y===b.y&&a.unit===b.unit;function h(a,b,c){return"%"===a.unit?{...e,...a,unit:"%"}:{unit:"%",x:a.x?a.x/b*100:0,y:a.y?a.y/c*100:0,width:a.width?a.width/b*100:0,height:a.height?a.height/c*100:0}}function i(a,b,c){return a.unit&&"px"!==a.unit?{unit:"px",x:a.x?a.x*b/100:0,y:a.y?a.y*c/100:0,width:a.width?a.width*b/100:0,height:a.height?a.height*c/100:0}:{...e,...a,unit:"px"}}function j(a,b,c,d,e,f=0,g=0,h=d,i=e){let k={...a},l=Math.min(f,d),m=Math.min(g,e),n=Math.min(h,d),o=Math.min(i,e);b&&(b>1?(m=(l=g?g*b:l)/b,n=h*b):(l=(m=f?f/b:m)*b,o=i/b)),k.y<0&&(k.height=Math.max(k.height+k.y,m),k.y=0),k.x<0&&(k.width=Math.max(k.width+k.x,l),k.x=0);let p=d-(k.x+k.width);p<0&&(k.x=Math.min(k.x,d-l),k.width+=p);let q=e-(k.y+k.height);if(q<0&&(k.y=Math.min(k.y,e-m),k.height+=q),k.width<l&&(("sw"===c||"nw"==c)&&(k.x-=l-k.width),k.width=l),k.height<m&&(("nw"===c||"ne"==c)&&(k.y-=m-k.height),k.height=m),k.width>n&&(("sw"===c||"nw"==c)&&(k.x-=n-k.width),k.width=n),k.height>o&&(("nw"===c||"ne"==c)&&(k.y-=o-k.height),k.height=o),b){let a=k.width/k.height;if(a<b){let a=Math.max(k.width/b,m);("nw"===c||"ne"==c)&&(k.y-=a-k.height),k.height=a}else if(a>b){let a=Math.max(k.height*b,l);("sw"===c||"nw"==c)&&(k.x-=a-k.width),k.width=a}}return k}var k={capture:!0,passive:!1},l=0,m=class a extends d.PureComponent{static xOrds=["e","w"];static yOrds=["n","s"];static xyOrds=["nw","ne","se","sw"];static nudgeStep=1;static nudgeStepMedium=10;static nudgeStepLarge=100;static defaultProps={ariaLabels:{cropArea:"Use the arrow keys to move the crop selection area",nwDragHandle:"Use the arrow keys to move the north west drag handle to change the crop selection area",nDragHandle:"Use the up and down arrow keys to move the north drag handle to change the crop selection area",neDragHandle:"Use the arrow keys to move the north east drag handle to change the crop selection area",eDragHandle:"Use the up and down arrow keys to move the east drag handle to change the crop selection area",seDragHandle:"Use the arrow keys to move the south east drag handle to change the crop selection area",sDragHandle:"Use the up and down arrow keys to move the south drag handle to change the crop selection area",swDragHandle:"Use the arrow keys to move the south west drag handle to change the crop selection area",wDragHandle:"Use the up and down arrow keys to move the west drag handle to change the crop selection area"}};get document(){return document}docMoveBound=!1;mouseDownOnCrop=!1;dragStarted=!1;evData={startClientX:0,startClientY:0,startCropX:0,startCropY:0,clientX:0,clientY:0,isResize:!0};componentRef=(0,d.createRef)();mediaRef=(0,d.createRef)();resizeObserver;initChangeCalled=!1;instanceId=`rc-${l++}`;state={cropIsActive:!1,newCropIsBeingDrawn:!1};getBox(){let a=this.mediaRef.current;if(!a)return{x:0,y:0,width:0,height:0};let{x:b,y:c,width:d,height:e}=a.getBoundingClientRect();return{x:b,y:c,width:d,height:e}}componentDidUpdate(a){let{crop:b,onComplete:c}=this.props;if(c&&!a.crop&&b){let{width:a,height:d}=this.getBox();a&&d&&c(i(b,a,d),h(b,a,d))}}componentWillUnmount(){this.resizeObserver&&this.resizeObserver.disconnect(),this.unbindDocMove()}bindDocMove(){this.docMoveBound||=(this.document.addEventListener("pointermove",this.onDocPointerMove,k),this.document.addEventListener("pointerup",this.onDocPointerDone,k),this.document.addEventListener("pointercancel",this.onDocPointerDone,k),!0)}unbindDocMove(){this.docMoveBound&&=(this.document.removeEventListener("pointermove",this.onDocPointerMove,k),this.document.removeEventListener("pointerup",this.onDocPointerDone,k),this.document.removeEventListener("pointercancel",this.onDocPointerDone,k),!1)}onCropPointerDown=a=>{let{crop:b,disabled:c}=this.props,d=this.getBox();if(!b)return;let e=i(b,d.width,d.height);if(c)return;a.cancelable&&a.preventDefault(),this.bindDocMove(),this.componentRef.current.focus({preventScroll:!0});let f=a.target.dataset.ord,g=a.clientX,h=a.clientY,j=e.x,k=e.y;if(f){let b=a.clientX-d.x,c=a.clientY-d.y,i=0,l=0;"ne"===f||"e"==f?(i=b-(e.x+e.width),l=c-e.y,j=e.x,k=e.y+e.height):"se"===f||"s"===f?(i=b-(e.x+e.width),l=c-(e.y+e.height),j=e.x,k=e.y):"sw"===f||"w"==f?(i=b-e.x,l=c-(e.y+e.height),j=e.x+e.width,k=e.y):("nw"===f||"n"==f)&&(i=b-e.x,l=c-e.y,j=e.x+e.width,k=e.y+e.height),g=j+d.x+i,h=k+d.y+l}this.evData={startClientX:g,startClientY:h,startCropX:j,startCropY:k,clientX:a.clientX,clientY:a.clientY,isResize:!!f,ord:f},this.mouseDownOnCrop=!0,this.setState({cropIsActive:!0})};onComponentPointerDown=a=>{let{crop:b,disabled:c,locked:d,keepSelection:e,onChange:f}=this.props,g=this.getBox();if(c||d||e&&b)return;a.cancelable&&a.preventDefault(),this.bindDocMove(),this.componentRef.current.focus({preventScroll:!0});let j=a.clientX-g.x,k=a.clientY-g.y,l={unit:"px",x:j,y:k,width:0,height:0};this.evData={startClientX:a.clientX,startClientY:a.clientY,startCropX:j,startCropY:k,clientX:a.clientX,clientY:a.clientY,isResize:!0},this.mouseDownOnCrop=!0,f(i(l,g.width,g.height),h(l,g.width,g.height)),this.setState({cropIsActive:!0,newCropIsBeingDrawn:!0})};onDocPointerMove=a=>{let b,{crop:c,disabled:d,onChange:e,onDragStart:f}=this.props,j=this.getBox();if(d||!c||!this.mouseDownOnCrop)return;a.cancelable&&a.preventDefault(),this.dragStarted||(this.dragStarted=!0,f&&f(a));let{evData:k}=this;k.clientX=a.clientX,k.clientY=a.clientY,g(c,b=k.isResize?this.resizeCrop():this.dragCrop())||e(i(b,j.width,j.height),h(b,j.width,j.height))};onComponentKeyDown=b=>{let{crop:c,disabled:d,onChange:e,onComplete:g}=this.props;if(d)return;let j=b.key,k=!1;if(!c)return;let l=this.getBox(),m=this.makePixelCrop(l),n=(navigator.platform.match("Mac")?b.metaKey:b.ctrlKey)?a.nudgeStepLarge:b.shiftKey?a.nudgeStepMedium:a.nudgeStep;if("ArrowLeft"===j?(m.x-=n,k=!0):"ArrowRight"===j?(m.x+=n,k=!0):"ArrowUp"===j?(m.y-=n,k=!0):"ArrowDown"===j&&(m.y+=n,k=!0),k){b.cancelable&&b.preventDefault(),m.x=f(m.x,0,l.width-m.width),m.y=f(m.y,0,l.height-m.height);let a=i(m,l.width,l.height),c=h(m,l.width,l.height);e(a,c),g&&g(a,c)}};onHandlerKeyDown=(b,c)=>{var d,e;let f,{aspect:k=0,crop:l,disabled:m,minWidth:n=0,minHeight:o=0,maxWidth:p,maxHeight:q,onChange:r,onComplete:s}=this.props,t=this.getBox();if(m||!l||"ArrowUp"!==b.key&&"ArrowDown"!==b.key&&"ArrowLeft"!==b.key&&"ArrowRight"!==b.key)return;b.stopPropagation(),b.preventDefault();let u=(navigator.platform.match("Mac")?b.metaKey:b.ctrlKey)?a.nudgeStepLarge:b.shiftKey?a.nudgeStepMedium:a.nudgeStep,v=j((d=i(l,t.width,t.height),e=b.key,f={...d},"ArrowLeft"===e?"nw"===c?(f.x-=u,f.y-=u,f.width+=u,f.height+=u):"w"===c?(f.x-=u,f.width+=u):"sw"===c?(f.x-=u,f.width+=u,f.height+=u):"ne"===c?(f.y+=u,f.width-=u,f.height-=u):"e"===c?f.width-=u:"se"===c&&(f.width-=u,f.height-=u):"ArrowRight"===e&&("nw"===c?(f.x+=u,f.y+=u,f.width-=u,f.height-=u):"w"===c?(f.x+=u,f.width-=u):"sw"===c?(f.x+=u,f.width-=u,f.height-=u):"ne"===c?(f.y-=u,f.width+=u,f.height+=u):"e"===c?f.width+=u:"se"===c&&(f.width+=u,f.height+=u)),"ArrowUp"===e?"nw"===c?(f.x-=u,f.y-=u,f.width+=u,f.height+=u):"n"===c?(f.y-=u,f.height+=u):"ne"===c?(f.y-=u,f.width+=u,f.height+=u):"sw"===c?(f.x+=u,f.width-=u,f.height-=u):"s"===c?f.height-=u:"se"===c&&(f.width-=u,f.height-=u):"ArrowDown"===e&&("nw"===c?(f.x+=u,f.y+=u,f.width-=u,f.height-=u):"n"===c?(f.y+=u,f.height-=u):"ne"===c?(f.y+=u,f.width-=u,f.height-=u):"sw"===c?(f.x-=u,f.width+=u,f.height+=u):"s"===c?f.height+=u:"se"===c&&(f.width+=u,f.height+=u)),f),k,c,t.width,t.height,n,o,p,q);if(!g(l,v)){let a=h(v,t.width,t.height);r(v,a),s&&s(v,a)}};onDocPointerDone=a=>{let{crop:b,disabled:c,onComplete:d,onDragEnd:e}=this.props,f=this.getBox();this.unbindDocMove(),!(c||!b)&&this.mouseDownOnCrop&&(this.mouseDownOnCrop=!1,this.dragStarted=!1,e&&e(a),d&&d(i(b,f.width,f.height),h(b,f.width,f.height)),this.setState({cropIsActive:!1,newCropIsBeingDrawn:!1}))};onDragFocus=()=>{this.componentRef.current?.scrollTo(0,0)};getCropStyle(){let{crop:a}=this.props;if(a)return{top:`${a.y}${a.unit}`,left:`${a.x}${a.unit}`,width:`${a.width}${a.unit}`,height:`${a.height}${a.unit}`}}dragCrop(){let{evData:a}=this,b=this.getBox(),c=this.makePixelCrop(b),d=a.clientX-a.startClientX,e=a.clientY-a.startClientY;return c.x=f(a.startCropX+d,0,b.width-c.width),c.y=f(a.startCropY+e,0,b.height-c.height),c}getPointRegion(a,b,c,d){let{evData:e}=this,f=e.clientX-a.x,g=e.clientY-a.y,h;return h=d&&b?"nw"===b||"n"===b||"ne"===b:g<e.startCropY,(c&&b?"nw"===b||"w"===b||"sw"===b:f<e.startCropX)?h?"nw":"sw":h?"ne":"se"}resolveMinDimensions(a,b,c=0,d=0){let e=Math.min(c,a.width),f=Math.min(d,a.height);return b&&(e||f)?b>1?e?[e,e/b]:[f*b,f]:f?[f*b,f]:[e,e/b]:[e,f]}resizeCrop(){let{evData:b}=this,{aspect:c=0,maxWidth:d,maxHeight:e}=this.props,g=this.getBox(),[h,i]=this.resolveMinDimensions(g,c,this.props.minWidth,this.props.minHeight),k=this.makePixelCrop(g),l=this.getPointRegion(g,b.ord,h,i),m=b.ord||l,n=b.clientX-b.startClientX,o=b.clientY-b.startClientY;(h&&"nw"===m||"w"===m||"sw"===m)&&(n=Math.min(n,-h)),(i&&"nw"===m||"n"===m||"ne"===m)&&(o=Math.min(o,-i));let p={unit:"px",x:0,y:0,width:0,height:0};"ne"===l?(p.x=b.startCropX,p.width=n,c?p.height=p.width/c:p.height=Math.abs(o),p.y=b.startCropY-p.height):"se"===l?(p.x=b.startCropX,p.y=b.startCropY,p.width=n,c?p.height=p.width/c:p.height=o):"sw"===l?(p.x=b.startCropX+n,p.y=b.startCropY,p.width=Math.abs(n),c?p.height=p.width/c:p.height=o):"nw"===l&&(p.x=b.startCropX+n,p.width=Math.abs(n),c?(p.height=p.width/c,p.y=b.startCropY-p.height):(p.height=Math.abs(o),p.y=b.startCropY+o));let q=j(p,c,l,g.width,g.height,h,i,d,e);return c||a.xyOrds.indexOf(m)>-1?k=q:a.xOrds.indexOf(m)>-1?(k.x=q.x,k.width=q.width):a.yOrds.indexOf(m)>-1&&(k.y=q.y,k.height=q.height),k.x=f(k.x,0,g.width-k.width),k.y=f(k.y,0,g.height-k.height),k}renderCropSelection(){let{ariaLabels:b=a.defaultProps.ariaLabels,disabled:c,locked:e,renderSelectionAddon:f,ruleOfThirds:g,crop:h}=this.props,i=this.getCropStyle();if(h)return d.default.createElement("div",{style:i,className:"ReactCrop__crop-selection",onPointerDown:this.onCropPointerDown,"aria-label":b.cropArea,tabIndex:0,onKeyDown:this.onComponentKeyDown,role:"group"},!c&&!e&&d.default.createElement("div",{className:"ReactCrop__drag-elements",onFocus:this.onDragFocus},d.default.createElement("div",{className:"ReactCrop__drag-bar ord-n","data-ord":"n"}),d.default.createElement("div",{className:"ReactCrop__drag-bar ord-e","data-ord":"e"}),d.default.createElement("div",{className:"ReactCrop__drag-bar ord-s","data-ord":"s"}),d.default.createElement("div",{className:"ReactCrop__drag-bar ord-w","data-ord":"w"}),d.default.createElement("div",{className:"ReactCrop__drag-handle ord-nw","data-ord":"nw",tabIndex:0,"aria-label":b.nwDragHandle,onKeyDown:a=>this.onHandlerKeyDown(a,"nw"),role:"button"}),d.default.createElement("div",{className:"ReactCrop__drag-handle ord-n","data-ord":"n",tabIndex:0,"aria-label":b.nDragHandle,onKeyDown:a=>this.onHandlerKeyDown(a,"n"),role:"button"}),d.default.createElement("div",{className:"ReactCrop__drag-handle ord-ne","data-ord":"ne",tabIndex:0,"aria-label":b.neDragHandle,onKeyDown:a=>this.onHandlerKeyDown(a,"ne"),role:"button"}),d.default.createElement("div",{className:"ReactCrop__drag-handle ord-e","data-ord":"e",tabIndex:0,"aria-label":b.eDragHandle,onKeyDown:a=>this.onHandlerKeyDown(a,"e"),role:"button"}),d.default.createElement("div",{className:"ReactCrop__drag-handle ord-se","data-ord":"se",tabIndex:0,"aria-label":b.seDragHandle,onKeyDown:a=>this.onHandlerKeyDown(a,"se"),role:"button"}),d.default.createElement("div",{className:"ReactCrop__drag-handle ord-s","data-ord":"s",tabIndex:0,"aria-label":b.sDragHandle,onKeyDown:a=>this.onHandlerKeyDown(a,"s"),role:"button"}),d.default.createElement("div",{className:"ReactCrop__drag-handle ord-sw","data-ord":"sw",tabIndex:0,"aria-label":b.swDragHandle,onKeyDown:a=>this.onHandlerKeyDown(a,"sw"),role:"button"}),d.default.createElement("div",{className:"ReactCrop__drag-handle ord-w","data-ord":"w",tabIndex:0,"aria-label":b.wDragHandle,onKeyDown:a=>this.onHandlerKeyDown(a,"w"),role:"button"})),f&&d.default.createElement("div",{className:"ReactCrop__selection-addon",onPointerDown:a=>a.stopPropagation()},f(this.state)),g&&d.default.createElement(d.default.Fragment,null,d.default.createElement("div",{className:"ReactCrop__rule-of-thirds-hz"}),d.default.createElement("div",{className:"ReactCrop__rule-of-thirds-vt"})))}makePixelCrop(a){return i({...e,...this.props.crop||{}},a.width,a.height)}render(){let{aspect:a,children:b,circularCrop:c,className:e,crop:f,disabled:g,locked:h,style:i,ruleOfThirds:j}=this.props,{cropIsActive:k,newCropIsBeingDrawn:l}=this.state,m=f?this.renderCropSelection():null,n=((...a)=>a.filter(a=>a&&"string"==typeof a).join(" "))("ReactCrop",e,k&&"ReactCrop--active",g&&"ReactCrop--disabled",h&&"ReactCrop--locked",l&&"ReactCrop--new-crop",f&&a&&"ReactCrop--fixed-aspect",f&&c&&"ReactCrop--circular-crop",f&&j&&"ReactCrop--rule-of-thirds",!this.dragStarted&&f&&!f.width&&!f.height&&"ReactCrop--invisible-crop",c&&"ReactCrop--no-animate");return d.default.createElement("div",{ref:this.componentRef,className:n,style:i},d.default.createElement("div",{ref:this.mediaRef,className:"ReactCrop__child-wrapper",onPointerDown:this.onComponentPointerDown},b),f?d.default.createElement("svg",{className:"ReactCrop__crop-mask",width:"100%",height:"100%"},d.default.createElement("defs",null,d.default.createElement("mask",{id:`hole-${this.instanceId}`},d.default.createElement("rect",{width:"100%",height:"100%",fill:"white"}),c?d.default.createElement("ellipse",{cx:`${f.x+f.width/2}${f.unit}`,cy:`${f.y+f.height/2}${f.unit}`,rx:`${f.width/2}${f.unit}`,ry:`${f.height/2}${f.unit}`,fill:"black"}):d.default.createElement("rect",{x:`${f.x}${f.unit}`,y:`${f.y}${f.unit}`,width:`${f.width}${f.unit}`,height:`${f.height}${f.unit}`,fill:"black"}))),d.default.createElement("rect",{fill:"black",fillOpacity:.5,width:"100%",height:"100%",mask:`url(#hole-${this.instanceId})`})):void 0,m)}},n=a.i(699570),o=a.i(814574),p=a.i(474215),q=a.i(550194);async function r(a,b){let{naturalWidth:c,naturalHeight:d}=a;return Promise.all(b.map(b=>new Promise((e,f)=>{let g=document.createElement("canvas"),h=Math.round(b.x*c),i=Math.round(b.y*d);g.width=Math.max(1,Math.round(b.width*c)),g.height=Math.max(1,Math.round(b.height*d));let j=g.getContext("2d");j?(j.drawImage(a,h,i,g.width,g.height,0,0,g.width,g.height),g.toBlob(a=>a?e(a):f(Error("Canvas is empty")),"image/jpeg",.95)):f(Error("Canvas is not supported"))})))}let s={maxHeight:"65vh",maxWidth:"100%",objectFit:"contain"},t=(0,c.forwardRef)(function({imageSrc:a,regions:d,onChange:e,imageStyle:f=s,onImageLoad:g},h){let{t:i}=(0,q.b)(),j=(0,c.useRef)(null),k=(0,c.useRef)(null),[l,m]=(0,c.useState)(null),n=a=>{let b=j.current.getBoundingClientRect();return{x:(a.clientX-b.left)/b.width,y:(a.clientY-b.top)/b.height}},o=()=>{l&&l.width>=.02&&l.height>=.02&&e([...d,l]),k.current=null,m(null)},r=a=>({left:`${100*a.x}%`,top:`${100*a.y}%`,width:`${100*a.width}%`,height:`${100*a.height}%`});return(0,b.jsxs)("div",{className:"relative inline-block select-none",children:[(0,b.jsx)("img",{ref:h,src:a,alt:"",draggable:!1,style:f,onLoad:g,className:"block"}),(0,b.jsxs)("div",{ref:j,className:"absolute inset-0 cursor-crosshair",style:{touchAction:"none"},onPointerDown:a=>{0===a.button&&(j.current?.setPointerCapture(a.pointerId),k.current=n(a),m(null))},onPointerMove:a=>{var b,c,d,e;let f,g,h;if(!k.current)return;let i=n(a);m((b=k.current.x,c=k.current.y,d=i.x,e=i.y,g=(f=a=>Math.min(1,Math.max(0,a)))(Math.min(b,d)),h=f(Math.min(c,e)),{x:g,y:h,width:f(Math.max(b,d))-g,height:f(Math.max(c,e))-h}))},onPointerUp:o,onPointerCancel:o,children:[d.map((a,c)=>(0,b.jsxs)("div",{className:"absolute border-2 border-sky-400 bg-sky-400/15",style:r(a),children:[(0,b.jsx)("span",{className:"absolute left-0 top-0 bg-sky-500 px-1.5 text-xs font-bold text-white",children:c+1}),(0,b.jsx)("button",{type:"button",className:"absolute -right-3 -top-3 flex h-6 w-6 items-center justify-center rounded-full bg-red-500 text-white shadow","aria-label":i.batchImport.removeRegion.replace("{index}",String(c+1)),onPointerDown:a=>a.stopPropagation(),onClick:()=>e(d.filter((a,b)=>b!==c)),children:(0,b.jsx)(p.X,{className:"h-3 w-3"})})]},c)),l&&(0,b.jsx)("div",{className:"absolute border-2 border-dashed border-yellow-300 bg-yellow-300/10",style:r(l)})]})]})});var u=a.i(164831);let v={name:"zoom-in",size:24,node:[["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}],["line",{x1:"21",x2:"16.65",y1:"21",y2:"16.65",key:"13gj7c"}],["line",{x1:"11",x2:"11",y1:"8",y2:"14",key:"1vmskp"}],["line",{x1:"8",x2:"14",y1:"11",y2:"11",key:"durymu"}]]};v.node;let w=(0,u.f)(v),x={name:"zoom-out",size:24,node:[["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}],["line",{x1:"21",x2:"16.65",y1:"21",y2:"16.65",key:"13gj7c"}],["line",{x1:"8",x2:"14",y1:"11",y2:"11",key:"durymu"}]]};x.node;let y=(0,u.f)(x);function z({zoom:a,onZoomIn:c,onZoomOut:d,onReset:e}){let{t:f}=(0,q.b)(),g="outline-none focus-visible:ring-2 focus-visible:ring-white/70",h=`flex h-9 w-9 items-center justify-center rounded-full text-white transition-colors hover:bg-white/20 disabled:opacity-40 disabled:hover:bg-transparent ${g}`;return(0,b.jsxs)("div",{className:"flex items-center gap-0.5 rounded-full bg-black/60 p-1 shadow-lg backdrop-blur-sm",children:[(0,b.jsx)("button",{type:"button",className:h,onClick:d,disabled:a<=1,"aria-label":f.common.cropper.zoomOut,title:f.common.cropper.zoomOut,children:(0,b.jsx)(y,{className:"h-4 w-4"})}),(0,b.jsxs)("button",{type:"button",className:`h-9 min-w-14 rounded-full px-2 text-center text-xs font-medium tabular-nums text-white hover:bg-white/20 ${g}`,onClick:e,"aria-label":f.common.cropper.resetZoom,title:f.common.cropper.resetZoom,children:[Math.round(100*a),"%"]}),(0,b.jsx)("button",{type:"button",className:h,onClick:c,disabled:a>=5,"aria-label":f.common.cropper.zoomIn,title:f.common.cropper.zoomIn,children:(0,b.jsx)(w,{className:"h-4 w-4"})})]})}var A=a.i(630534);let B={single:{maxHeight:"70vh",maxWidth:"100%",objectFit:"contain"},multi:{maxHeight:"65vh",maxWidth:"100%",objectFit:"contain"}};a.s(["f",0,function({imageSrc:a,open:d,onClose:e,onCropComplete:f,onMultiCropComplete:g}){let{t:h}=(0,q.b)(),i=/^(blob:|data:image\/)/i.test(a)?a:void 0,[j,k]=(0,c.useState)(),l=(0,c.useRef)(null),[p,s]=(0,c.useState)("single"),{containerRef:u,zoom:v,imageStyle:w,measureImage:x,zoomIn:y,zoomOut:C,reset:D}=function(a){let[b,d]=(0,c.useState)(null),e=(0,c.useRef)(null),f=(0,c.useCallback)(a=>{e.current=a,d(a)},[]),[g,h]=(0,c.useState)(1),i=(0,c.useRef)(1),[j,k]=(0,c.useState)(null),l=(0,c.useRef)(null),m=(0,c.useRef)(!1),n=(0,c.useCallback)((a,b,c)=>{let d=e.current,f=i.current,g=Math.min(5,Math.max(1,a));if(!d||g===f)return;if(1===f){let a=d.querySelector("img");a&&k(a.clientWidth)}let j=d.getBoundingClientRect(),m=(b??j.left+j.width/2)-j.left,n=(c??j.top+j.height/2)-j.top;l.current={viewX:m,viewY:n,contentX:d.scrollLeft+m,contentY:d.scrollTop+n,ratio:g/f},i.current=g,h(g)},[]);(0,c.useLayoutEffect)(()=>{let a=e.current,b=l.current;a&&b&&(a.scrollLeft=b.contentX*b.ratio-b.viewX,a.scrollTop=b.contentY*b.ratio-b.viewY,l.current=null)},[g]),(0,c.useEffect)(()=>{if(!b)return;let a=a=>{a.preventDefault(),n(i.current*Math.exp(-(.0015*a.deltaY)),a.clientX,a.clientY)},c=null,d=a=>{let[b,c]=[a[0],a[1]];return{distance:Math.hypot(b.clientX-c.clientX,b.clientY-c.clientY),centerX:(b.clientX+c.clientX)/2,centerY:(b.clientY+c.clientY)/2}},e=a=>{2===a.touches.length&&(c={distance:d(a.touches).distance,zoom:i.current},m.current=!0)},f=a=>{if(!c||2!==a.touches.length)return;a.preventDefault();let{distance:b,centerX:e,centerY:f}=d(a.touches);c.distance>0&&n(c.zoom*(b/c.distance),e,f)},g=a=>{a.touches.length<2&&(c=null,m.current=!1)},h=a=>{m.current&&a.stopPropagation()};return b.addEventListener("wheel",a,{passive:!1}),b.addEventListener("touchstart",e,{passive:!0}),b.addEventListener("touchmove",f,{passive:!1}),b.addEventListener("touchend",g),b.addEventListener("touchcancel",g),b.addEventListener("pointermove",h,{capture:!0}),()=>{b.removeEventListener("wheel",a),b.removeEventListener("touchstart",e),b.removeEventListener("touchmove",f),b.removeEventListener("touchend",g),b.removeEventListener("touchcancel",g),b.removeEventListener("pointermove",h,{capture:!0})}},[b,n]);let o=(0,c.useCallback)(a=>{a&&1===i.current&&k(a.clientWidth)},[]),p=(0,c.useCallback)(()=>n(1.25*i.current),[n]),q=(0,c.useCallback)(()=>n(i.current/1.25),[n]),r=(0,c.useCallback)(()=>{i.current=1,l.current=null,h(1)},[]),s=1!==g&&j?{...a,width:j*g,height:"auto",maxWidth:"none",maxHeight:"none"}:a;return{containerRef:f,zoom:g,imageStyle:s,measureImage:o,zoomIn:p,zoomOut:q,reset:r}}(B[p]);(0,c.useEffect)(()=>{D()},[a,D]);let[E,F]=(0,c.useState)({src:a,regions:[]}),G=E.src===a?E.regions:[],H=b=>F({src:a,regions:b}),I=(0,c.useRef)(null),J=async()=>{if(I.current&&0!==G.length&&g)try{g(await r(I.current,G)),H([])}catch(a){A.f.error("[ImageCropper]","Multi-image crop failed",{error:a})}},K=async()=>{if(!l.current)return;let a=j&&j.width>0&&j.height>0?{x:j.x/100,y:j.y/100,width:j.width/100,height:j.height/100}:{x:0,y:0,width:1,height:1};try{let[b]=await r(l.current,[a]);f(b)}catch(a){A.f.error("[ImageCropper]","Crop failed",{error:a})}};return(0,b.jsx)(o.N,{open:d,onOpenChange:a=>!a&&e(),children:(0,b.jsxs)(o.d,{className:"max-w-3xl h-[90vh] flex flex-col p-0 gap-0",children:[(0,b.jsx)(o.s,{className:"p-4 border-b shrink-0",children:(0,b.jsx)(o.F,{children:h.common.cropper?.title||"Crop Image"})}),(0,b.jsxs)("div",{className:"relative min-h-0 flex-1 bg-black",children:[(0,b.jsx)("div",{ref:u,className:"flex h-full w-full overflow-auto p-4",children:(0,b.jsx)("div",{className:"m-auto",children:"multi"===p?(0,b.jsx)(t,{ref:I,imageSrc:i,regions:G,onChange:H,imageStyle:w,onImageLoad:a=>x(a.currentTarget)}):(0,b.jsx)(m,{crop:j,onChange:(a,b)=>k(b),children:(0,b.jsx)("img",{ref:l,alt:"Crop me",src:i,onLoad:function(a){k({unit:"%",x:0,y:0,width:100,height:100}),x(a.currentTarget)},style:w})})})}),(0,b.jsx)("div",{className:"absolute right-3 top-3",children:(0,b.jsx)(z,{zoom:v,onZoomIn:y,onZoomOut:C,onReset:D})})]}),(0,b.jsxs)("div",{className:"p-4 border-t bg-background shrink-0 space-y-3",children:[g&&(0,b.jsx)("div",{className:"grid grid-cols-2 gap-1 rounded-md bg-muted p-1 sm:w-80",children:["single","multi"].map(a=>(0,b.jsx)("button",{type:"button",onClick:()=>{D(),s(a)},className:`rounded px-3 py-1.5 text-sm font-medium transition-colors ${p===a?"bg-background shadow-sm":"text-muted-foreground"}`,children:"single"===a?h.batchImport.singleMode:h.batchImport.multiMode},a))}),(0,b.jsxs)("div",{className:"flex flex-col sm:flex-row sm:justify-between sm:items-center gap-3",children:[(0,b.jsx)("p",{className:"text-sm text-muted-foreground",children:"multi"===p?`${h.batchImport.hint} ${h.batchImport.regionCount.replace("{count}",String(G.length))}`:h.common.cropper?.hint||"💡 Drag to adjust crop area"}),(0,b.jsxs)("div",{className:"flex gap-2 justify-end",children:["multi"===p&&G.length>0&&(0,b.jsx)(n.f,{variant:"ghost",onClick:()=>H([]),children:h.batchImport.clear}),(0,b.jsx)(n.f,{variant:"outline",onClick:e,children:h.common.cancel||"Cancel"}),"multi"===p?(0,b.jsx)(n.f,{onClick:J,disabled:0===G.length,children:h.batchImport.start.replace("{count}",String(G.length))}):(0,b.jsx)(n.f,{onClick:K,children:h.common.confirm||"Confirm"})]})]})]})]})})}],797521)},460081,a=>{var b=a.i(187924),c=a.i(572131),d=a.i(164831);let e={name:"code-xml",size:24,node:[["path",{d:"m18 16 4-4-4-4",key:"1inbqp"}],["path",{d:"m6 8-4 4 4 4",key:"15zrgr"}],["path",{d:"m14.5 4-5 16",key:"e7oirm"}]],aliases:["code-2"]};e.node;let f=(0,d.f)(e);var g=a.i(755681),h=a.i(93907),i=a.i(429246),j=a.i(550194),k=a.i(368114);a.s(["f",0,function({value:a,onChange:d,className:e,...l}){let{t:m}=(0,j.b)(),[n,o]=(0,c.useState)("source"),p=(0,c.useId)(),q=[{mode:"source",label:m.markdownEditor.source,icon:f},{mode:"preview",label:m.markdownEditor.preview,icon:g.f}];return(0,b.jsxs)("div",{className:"space-y-1.5",children:[(0,b.jsx)("div",{role:"tablist","aria-label":m.markdownEditor.modeLabel,className:"flex justify-end",children:(0,b.jsx)("div",{className:"inline-flex rounded-md border bg-muted/40 p-0.5",children:q.map(({mode:a,label:c,icon:d})=>(0,b.jsxs)("button",{type:"button",role:"tab","aria-selected":n===a,"aria-controls":p,onClick:()=>o(a),className:(0,k.f)("flex items-center gap-1 rounded px-2.5 py-1 text-xs transition-colors",n===a?"bg-background font-medium shadow-sm":"text-muted-foreground hover:text-foreground"),children:[(0,b.jsx)(d,{className:"h-3.5 w-3.5"}),c]},a))})}),(0,b.jsx)("div",{id:p,role:"tabpanel",children:"source"===n?(0,b.jsx)(i.f,{value:a,onChange:a=>d(a.target.value),className:e,...l}):(0,b.jsx)("div",{className:"min-h-24 cursor-text rounded-md border bg-muted/20 px-3 py-2",onDoubleClick:()=>o("source"),title:m.markdownEditor.doubleClickToEdit,children:a.trim()?(0,b.jsx)(h.f,{content:a}):(0,b.jsx)("p",{className:"text-sm italic text-muted-foreground",children:m.markdownEditor.empty})})})]})}],460081)},350659,a=>{var b=a.i(187924),c=a.i(572131),d=a.i(580701),e=a.i(118688),f=a.i(291938),g=a.i(630534),h=a.i(550194);a.s(["f",0,function({value:a,onChange:i,className:j}){let[k,l]=(0,c.useState)([]),{t:m}=(0,h.b)();return(0,c.useEffect)(()=>{(async()=>{try{let a=await f.f.get("/api/notebooks");l(a)}catch(a){g.f.error("[NotebookSelector]","Failed to fetch notebooks",{error:a})}})()},[]),(0,b.jsxs)(d.d,{value:a,onValueChange:i,children:[(0,b.jsx)(d.P,{className:j,children:(0,b.jsxs)("div",{className:"flex items-center gap-2",children:[(0,b.jsx)(e.f,{className:"h-4 w-4 text-muted-foreground"}),(0,b.jsx)(d.U,{placeholder:m.notebooks?.selector?.placeholder||"Select Notebook"})]})}),(0,b.jsx)(d.r,{children:0===k.length?(0,b.jsx)("div",{className:"p-2 text-sm text-muted-foreground text-center",children:m.notebooks?.selector?.empty||"No notebooks available"}):k.map(a=>(0,b.jsx)(d.T,{value:a.id,children:a.name},a.id))})]})}])},43542,a=>{var b=a.i(630534);async function c(a,d=1,e=1920,f=.8){return new Promise((c,g)=>{let h=new FileReader;h.onload=h=>{let i=new Image;i.onload=()=>{let h=document.createElement("canvas"),j=h.getContext("2d");if(!j)return void g(Error("无法获取 Canvas 上下文"));let k=i.width,l=i.height;k>e&&(l=l*e/k,k=e),h.width=k,h.height=l,j.drawImage(i,0,0,k,l);let m=f,n=h.toDataURL("image/jpeg",m),o=3*n.length/4/1024/1024;for(;o>d&&m>.1;){m-=.1;let a=3*(n=h.toDataURL("image/jpeg",m)).length/4/1024/1024;if(b.f.info("[ImageCompress]","Compression step",{quality:Number(m.toFixed(1)),sizeMB:Number(a.toFixed(2))},{sendToBackend:!1}),a<=d)break}b.f.info("[ImageCompress]","Compression finished",{originalMB:Number((a.size/1024/1024).toFixed(2)),compressedMB:Number((3*n.length/4/1024/1024).toFixed(2))}),c(n)},i.onerror=()=>g(Error("图片加载失败")),i.src=h.target?.result},h.onerror=()=>g(Error("文件读取失败")),h.readAsDataURL(a)})}async function d(a){let d=a.size/1024/1024;return(b.f.info("[ImageCompress]","File size checked",{sizeMB:Number(d.toFixed(2))},{sendToBackend:!1}),d>1)?(b.f.info("[ImageCompress]","File exceeds threshold, compressing",void 0,{sendToBackend:!1}),await c(a,1)):(b.f.info("[ImageCompress]","File size OK, no compression needed",void 0,{sendToBackend:!1}),new Promise((b,c)=>{let d=new FileReader;d.onload=()=>b(d.result),d.onerror=c,d.readAsDataURL(a)}))}a.s(["f",0,d])},851795,a=>{a.s(["f",0,function(a){return"number"!=typeof a||!Number.isInteger(a)||a<1||a>5?null:a<=3?"a":"b"}])}]})();
|
|
1
|
+
(()=>{"use strict";module.exports=[63331,310395,a=>{var b=a.i(164831);let c={name:"box",size:24,node:[["path",{d:"M21 8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73l7 4a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16Z",key:"hh9hay"}],["path",{d:"m3.3 7 8.7 5 8.7-5",key:"g66t2b"}],["path",{d:"M12 22V12",key:"d0xqtd"}]]};c.node;let d=(0,b.f)(c);a.s(["f",0,d],63331);var e=a.i(187924),f=a.i(572131),g=a.i(875160);let h={name:"maximize-2",size:24,node:[["path",{d:"M15 3h6v6",key:"1q9fwt"}],["path",{d:"m21 3-7 7",key:"1l2asr"}],["path",{d:"m3 21 7-7",key:"tjx5ai"}],["path",{d:"M9 21H3v-6",key:"wtvkvv"}]]};h.node;let i=(0,b.f)(h),j={name:"minimize-2",size:24,node:[["path",{d:"m14 10 7-7",key:"oa77jy"}],["path",{d:"M20 10h-6V4",key:"mjg0md"}],["path",{d:"m3 21 7-7",key:"tjx5ai"}],["path",{d:"M4 14h6v6",key:"rmj7iw"}]]};j.node;let k=(0,b.f)(j);var l=a.i(533838),m=a.i(519783),n=a.i(951675),o=a.i(699570),p=a.i(550194),q=a.i(710302),r=a.i(630534),s=a.i(62832);a.s(["f",0,function({commands:a,height:b=700,showToolBar:c=!1,showAlgebraInput:d=!1,showMenuBar:h=!1,className:j="",onRegenerate:t,onDelete:u}){let{t:v}=(0,p.b)(),w=(0,f.useRef)(null),x=(0,f.useRef)(null),y=(0,f.useRef)(void 0),z=(0,f.useId)();(0,f.useRef)(`ggb-${z.replace(/[^a-zA-Z0-9_-]/g,"")}`);let[A,B]=(0,f.useState)(!0),[C,D]=(0,f.useState)(null),[E,F]=(0,f.useState)(!0),[G,H]=(0,f.useState)(!1),[I,J]=(0,f.useState)(!1),K=(0,f.useMemo)(()=>(0,s.i)(a),[a]);(0,f.useEffect)(()=>{},[K,c,d,h]),(0,f.useEffect)(()=>{var a,c,d;let e;a=w.current,c=x.current,d=E?700:b,(e=a?.firstElementChild)&&(e.style.width="100%",e.style.height=`${d}px`,c?.setSize(a?.offsetWidth||e.offsetWidth||800,d))},[E,b]);let L=(0,f.useCallback)(()=>{let a=x.current;if(a)try{a.resetConstruction(),setTimeout(()=>{x.current&&(y.current=function(a,b){let c=(0,s.L)(a,b);for(let a of c)r.V.warn("[GGB]","命令执行失败",{...a});return c.map(a=>a.command+":"+a.message).join("\n")||void 0}(x.current,K))},300)}catch(a){r.V.warn("[GGB]","Reset failed",{error:a})}},[K]),M=(0,f.useCallback)(async()=>{if(t&&!G){H(!0);try{await t(y.current)}finally{H(!1)}}},[t,G]),N=(0,f.useCallback)(async()=>{if(u&&!I&&await (0,q.u)(v.geogebra.confirmDelete,{destructive:!0})){J(!0);try{await u()}catch{q.c.error(v.geogebra.deleteFailed)}finally{J(!1)}}},[u,I,v]);return 0===K.length?null:(0,e.jsxs)("div",{className:`relative rounded-lg border bg-card ${j}`,children:[(0,e.jsxs)("div",{className:"flex items-center justify-between px-3 py-2 border-b bg-muted/30",children:[(0,e.jsxs)("div",{className:"flex items-center gap-2",children:[(0,e.jsx)("span",{className:"text-xs font-medium text-muted-foreground",children:v.geogebra.title}),A&&(0,e.jsx)(g.f,{className:"h-3 w-3 animate-spin text-muted-foreground"})]}),(0,e.jsxs)("div",{className:"flex items-center gap-1",children:[t&&(0,e.jsxs)(o.f,{variant:"ghost",size:"sm",className:"h-7 px-2 text-xs gap-1",onClick:M,title:v.geogebra.regenerate,disabled:G||A,children:[G?(0,e.jsx)(g.f,{className:"h-3.5 w-3.5 animate-spin"}):(0,e.jsx)(m.f,{className:"h-3.5 w-3.5"}),(0,e.jsx)("span",{children:v.geogebra.regenerate})]}),u&&(0,e.jsxs)(o.f,{variant:"ghost",size:"sm",className:"h-7 px-2 text-xs gap-1 text-destructive hover:text-destructive",onClick:N,title:v.geogebra.delete,disabled:I||G,children:[I?(0,e.jsx)(g.f,{className:"h-3.5 w-3.5 animate-spin"}):(0,e.jsx)(n.f,{className:"h-3.5 w-3.5"}),(0,e.jsx)("span",{children:v.geogebra.delete})]}),(0,e.jsx)(o.f,{variant:"ghost",size:"sm",className:"h-7 w-7 p-0",onClick:L,title:v.geogebra.reset,disabled:A,children:(0,e.jsx)(l.f,{className:"h-3.5 w-3.5"})}),(0,e.jsx)(o.f,{variant:"ghost",size:"sm",className:"h-7 w-7 p-0",onClick:()=>F(a=>!a),title:E?v.geogebra.shrink:v.geogebra.enlarge,children:E?(0,e.jsx)(k,{className:"h-3.5 w-3.5"}):(0,e.jsx)(i,{className:"h-3.5 w-3.5"})})]})]}),(0,e.jsx)("div",{ref:w,style:{width:"100%"}}),A&&(0,e.jsx)("div",{className:"absolute inset-0 z-10 flex items-center justify-center bg-background/80 rounded-b-lg",style:{top:37},children:(0,e.jsxs)("div",{className:"flex flex-col items-center gap-2",children:[(0,e.jsx)(g.f,{className:"h-6 w-6 animate-spin text-primary"}),(0,e.jsx)("span",{className:"text-sm text-muted-foreground",children:v.geogebra.loading})]})}),C&&(0,e.jsx)("div",{className:"flex items-center justify-center text-sm text-destructive",style:{minHeight:b},children:C})]})}],310395)},797521,a=>{var b=a.i(187924),c=a.i(572131),d=c,e={x:0,y:0,width:0,height:0,unit:"px"},f=(a,b,c)=>Math.min(Math.max(a,b),c),g=(a,b)=>a===b||a.width===b.width&&a.height===b.height&&a.x===b.x&&a.y===b.y&&a.unit===b.unit;function h(a,b,c){return"%"===a.unit?{...e,...a,unit:"%"}:{unit:"%",x:a.x?a.x/b*100:0,y:a.y?a.y/c*100:0,width:a.width?a.width/b*100:0,height:a.height?a.height/c*100:0}}function i(a,b,c){return a.unit&&"px"!==a.unit?{unit:"px",x:a.x?a.x*b/100:0,y:a.y?a.y*c/100:0,width:a.width?a.width*b/100:0,height:a.height?a.height*c/100:0}:{...e,...a,unit:"px"}}function j(a,b,c,d,e,f=0,g=0,h=d,i=e){let k={...a},l=Math.min(f,d),m=Math.min(g,e),n=Math.min(h,d),o=Math.min(i,e);b&&(b>1?(m=(l=g?g*b:l)/b,n=h*b):(l=(m=f?f/b:m)*b,o=i/b)),k.y<0&&(k.height=Math.max(k.height+k.y,m),k.y=0),k.x<0&&(k.width=Math.max(k.width+k.x,l),k.x=0);let p=d-(k.x+k.width);p<0&&(k.x=Math.min(k.x,d-l),k.width+=p);let q=e-(k.y+k.height);if(q<0&&(k.y=Math.min(k.y,e-m),k.height+=q),k.width<l&&(("sw"===c||"nw"==c)&&(k.x-=l-k.width),k.width=l),k.height<m&&(("nw"===c||"ne"==c)&&(k.y-=m-k.height),k.height=m),k.width>n&&(("sw"===c||"nw"==c)&&(k.x-=n-k.width),k.width=n),k.height>o&&(("nw"===c||"ne"==c)&&(k.y-=o-k.height),k.height=o),b){let a=k.width/k.height;if(a<b){let a=Math.max(k.width/b,m);("nw"===c||"ne"==c)&&(k.y-=a-k.height),k.height=a}else if(a>b){let a=Math.max(k.height*b,l);("sw"===c||"nw"==c)&&(k.x-=a-k.width),k.width=a}}return k}var k={capture:!0,passive:!1},l=0,m=class a extends d.PureComponent{static xOrds=["e","w"];static yOrds=["n","s"];static xyOrds=["nw","ne","se","sw"];static nudgeStep=1;static nudgeStepMedium=10;static nudgeStepLarge=100;static defaultProps={ariaLabels:{cropArea:"Use the arrow keys to move the crop selection area",nwDragHandle:"Use the arrow keys to move the north west drag handle to change the crop selection area",nDragHandle:"Use the up and down arrow keys to move the north drag handle to change the crop selection area",neDragHandle:"Use the arrow keys to move the north east drag handle to change the crop selection area",eDragHandle:"Use the up and down arrow keys to move the east drag handle to change the crop selection area",seDragHandle:"Use the arrow keys to move the south east drag handle to change the crop selection area",sDragHandle:"Use the up and down arrow keys to move the south drag handle to change the crop selection area",swDragHandle:"Use the arrow keys to move the south west drag handle to change the crop selection area",wDragHandle:"Use the up and down arrow keys to move the west drag handle to change the crop selection area"}};get document(){return document}docMoveBound=!1;mouseDownOnCrop=!1;dragStarted=!1;evData={startClientX:0,startClientY:0,startCropX:0,startCropY:0,clientX:0,clientY:0,isResize:!0};componentRef=(0,d.createRef)();mediaRef=(0,d.createRef)();resizeObserver;initChangeCalled=!1;instanceId=`rc-${l++}`;state={cropIsActive:!1,newCropIsBeingDrawn:!1};getBox(){let a=this.mediaRef.current;if(!a)return{x:0,y:0,width:0,height:0};let{x:b,y:c,width:d,height:e}=a.getBoundingClientRect();return{x:b,y:c,width:d,height:e}}componentDidUpdate(a){let{crop:b,onComplete:c}=this.props;if(c&&!a.crop&&b){let{width:a,height:d}=this.getBox();a&&d&&c(i(b,a,d),h(b,a,d))}}componentWillUnmount(){this.resizeObserver&&this.resizeObserver.disconnect(),this.unbindDocMove()}bindDocMove(){this.docMoveBound||=(this.document.addEventListener("pointermove",this.onDocPointerMove,k),this.document.addEventListener("pointerup",this.onDocPointerDone,k),this.document.addEventListener("pointercancel",this.onDocPointerDone,k),!0)}unbindDocMove(){this.docMoveBound&&=(this.document.removeEventListener("pointermove",this.onDocPointerMove,k),this.document.removeEventListener("pointerup",this.onDocPointerDone,k),this.document.removeEventListener("pointercancel",this.onDocPointerDone,k),!1)}onCropPointerDown=a=>{let{crop:b,disabled:c}=this.props,d=this.getBox();if(!b)return;let e=i(b,d.width,d.height);if(c)return;a.cancelable&&a.preventDefault(),this.bindDocMove(),this.componentRef.current.focus({preventScroll:!0});let f=a.target.dataset.ord,g=a.clientX,h=a.clientY,j=e.x,k=e.y;if(f){let b=a.clientX-d.x,c=a.clientY-d.y,i=0,l=0;"ne"===f||"e"==f?(i=b-(e.x+e.width),l=c-e.y,j=e.x,k=e.y+e.height):"se"===f||"s"===f?(i=b-(e.x+e.width),l=c-(e.y+e.height),j=e.x,k=e.y):"sw"===f||"w"==f?(i=b-e.x,l=c-(e.y+e.height),j=e.x+e.width,k=e.y):("nw"===f||"n"==f)&&(i=b-e.x,l=c-e.y,j=e.x+e.width,k=e.y+e.height),g=j+d.x+i,h=k+d.y+l}this.evData={startClientX:g,startClientY:h,startCropX:j,startCropY:k,clientX:a.clientX,clientY:a.clientY,isResize:!!f,ord:f},this.mouseDownOnCrop=!0,this.setState({cropIsActive:!0})};onComponentPointerDown=a=>{let{crop:b,disabled:c,locked:d,keepSelection:e,onChange:f}=this.props,g=this.getBox();if(c||d||e&&b)return;a.cancelable&&a.preventDefault(),this.bindDocMove(),this.componentRef.current.focus({preventScroll:!0});let j=a.clientX-g.x,k=a.clientY-g.y,l={unit:"px",x:j,y:k,width:0,height:0};this.evData={startClientX:a.clientX,startClientY:a.clientY,startCropX:j,startCropY:k,clientX:a.clientX,clientY:a.clientY,isResize:!0},this.mouseDownOnCrop=!0,f(i(l,g.width,g.height),h(l,g.width,g.height)),this.setState({cropIsActive:!0,newCropIsBeingDrawn:!0})};onDocPointerMove=a=>{let b,{crop:c,disabled:d,onChange:e,onDragStart:f}=this.props,j=this.getBox();if(d||!c||!this.mouseDownOnCrop)return;a.cancelable&&a.preventDefault(),this.dragStarted||(this.dragStarted=!0,f&&f(a));let{evData:k}=this;k.clientX=a.clientX,k.clientY=a.clientY,g(c,b=k.isResize?this.resizeCrop():this.dragCrop())||e(i(b,j.width,j.height),h(b,j.width,j.height))};onComponentKeyDown=b=>{let{crop:c,disabled:d,onChange:e,onComplete:g}=this.props;if(d)return;let j=b.key,k=!1;if(!c)return;let l=this.getBox(),m=this.makePixelCrop(l),n=(navigator.platform.match("Mac")?b.metaKey:b.ctrlKey)?a.nudgeStepLarge:b.shiftKey?a.nudgeStepMedium:a.nudgeStep;if("ArrowLeft"===j?(m.x-=n,k=!0):"ArrowRight"===j?(m.x+=n,k=!0):"ArrowUp"===j?(m.y-=n,k=!0):"ArrowDown"===j&&(m.y+=n,k=!0),k){b.cancelable&&b.preventDefault(),m.x=f(m.x,0,l.width-m.width),m.y=f(m.y,0,l.height-m.height);let a=i(m,l.width,l.height),c=h(m,l.width,l.height);e(a,c),g&&g(a,c)}};onHandlerKeyDown=(b,c)=>{var d,e;let f,{aspect:k=0,crop:l,disabled:m,minWidth:n=0,minHeight:o=0,maxWidth:p,maxHeight:q,onChange:r,onComplete:s}=this.props,t=this.getBox();if(m||!l||"ArrowUp"!==b.key&&"ArrowDown"!==b.key&&"ArrowLeft"!==b.key&&"ArrowRight"!==b.key)return;b.stopPropagation(),b.preventDefault();let u=(navigator.platform.match("Mac")?b.metaKey:b.ctrlKey)?a.nudgeStepLarge:b.shiftKey?a.nudgeStepMedium:a.nudgeStep,v=j((d=i(l,t.width,t.height),e=b.key,f={...d},"ArrowLeft"===e?"nw"===c?(f.x-=u,f.y-=u,f.width+=u,f.height+=u):"w"===c?(f.x-=u,f.width+=u):"sw"===c?(f.x-=u,f.width+=u,f.height+=u):"ne"===c?(f.y+=u,f.width-=u,f.height-=u):"e"===c?f.width-=u:"se"===c&&(f.width-=u,f.height-=u):"ArrowRight"===e&&("nw"===c?(f.x+=u,f.y+=u,f.width-=u,f.height-=u):"w"===c?(f.x+=u,f.width-=u):"sw"===c?(f.x+=u,f.width-=u,f.height-=u):"ne"===c?(f.y-=u,f.width+=u,f.height+=u):"e"===c?f.width+=u:"se"===c&&(f.width+=u,f.height+=u)),"ArrowUp"===e?"nw"===c?(f.x-=u,f.y-=u,f.width+=u,f.height+=u):"n"===c?(f.y-=u,f.height+=u):"ne"===c?(f.y-=u,f.width+=u,f.height+=u):"sw"===c?(f.x+=u,f.width-=u,f.height-=u):"s"===c?f.height-=u:"se"===c&&(f.width-=u,f.height-=u):"ArrowDown"===e&&("nw"===c?(f.x+=u,f.y+=u,f.width-=u,f.height-=u):"n"===c?(f.y+=u,f.height-=u):"ne"===c?(f.y+=u,f.width-=u,f.height-=u):"sw"===c?(f.x-=u,f.width+=u,f.height+=u):"s"===c?f.height+=u:"se"===c&&(f.width+=u,f.height+=u)),f),k,c,t.width,t.height,n,o,p,q);if(!g(l,v)){let a=h(v,t.width,t.height);r(v,a),s&&s(v,a)}};onDocPointerDone=a=>{let{crop:b,disabled:c,onComplete:d,onDragEnd:e}=this.props,f=this.getBox();this.unbindDocMove(),!(c||!b)&&this.mouseDownOnCrop&&(this.mouseDownOnCrop=!1,this.dragStarted=!1,e&&e(a),d&&d(i(b,f.width,f.height),h(b,f.width,f.height)),this.setState({cropIsActive:!1,newCropIsBeingDrawn:!1}))};onDragFocus=()=>{this.componentRef.current?.scrollTo(0,0)};getCropStyle(){let{crop:a}=this.props;if(a)return{top:`${a.y}${a.unit}`,left:`${a.x}${a.unit}`,width:`${a.width}${a.unit}`,height:`${a.height}${a.unit}`}}dragCrop(){let{evData:a}=this,b=this.getBox(),c=this.makePixelCrop(b),d=a.clientX-a.startClientX,e=a.clientY-a.startClientY;return c.x=f(a.startCropX+d,0,b.width-c.width),c.y=f(a.startCropY+e,0,b.height-c.height),c}getPointRegion(a,b,c,d){let{evData:e}=this,f=e.clientX-a.x,g=e.clientY-a.y,h;return h=d&&b?"nw"===b||"n"===b||"ne"===b:g<e.startCropY,(c&&b?"nw"===b||"w"===b||"sw"===b:f<e.startCropX)?h?"nw":"sw":h?"ne":"se"}resolveMinDimensions(a,b,c=0,d=0){let e=Math.min(c,a.width),f=Math.min(d,a.height);return b&&(e||f)?b>1?e?[e,e/b]:[f*b,f]:f?[f*b,f]:[e,e/b]:[e,f]}resizeCrop(){let{evData:b}=this,{aspect:c=0,maxWidth:d,maxHeight:e}=this.props,g=this.getBox(),[h,i]=this.resolveMinDimensions(g,c,this.props.minWidth,this.props.minHeight),k=this.makePixelCrop(g),l=this.getPointRegion(g,b.ord,h,i),m=b.ord||l,n=b.clientX-b.startClientX,o=b.clientY-b.startClientY;(h&&"nw"===m||"w"===m||"sw"===m)&&(n=Math.min(n,-h)),(i&&"nw"===m||"n"===m||"ne"===m)&&(o=Math.min(o,-i));let p={unit:"px",x:0,y:0,width:0,height:0};"ne"===l?(p.x=b.startCropX,p.width=n,c?p.height=p.width/c:p.height=Math.abs(o),p.y=b.startCropY-p.height):"se"===l?(p.x=b.startCropX,p.y=b.startCropY,p.width=n,c?p.height=p.width/c:p.height=o):"sw"===l?(p.x=b.startCropX+n,p.y=b.startCropY,p.width=Math.abs(n),c?p.height=p.width/c:p.height=o):"nw"===l&&(p.x=b.startCropX+n,p.width=Math.abs(n),c?(p.height=p.width/c,p.y=b.startCropY-p.height):(p.height=Math.abs(o),p.y=b.startCropY+o));let q=j(p,c,l,g.width,g.height,h,i,d,e);return c||a.xyOrds.indexOf(m)>-1?k=q:a.xOrds.indexOf(m)>-1?(k.x=q.x,k.width=q.width):a.yOrds.indexOf(m)>-1&&(k.y=q.y,k.height=q.height),k.x=f(k.x,0,g.width-k.width),k.y=f(k.y,0,g.height-k.height),k}renderCropSelection(){let{ariaLabels:b=a.defaultProps.ariaLabels,disabled:c,locked:e,renderSelectionAddon:f,ruleOfThirds:g,crop:h}=this.props,i=this.getCropStyle();if(h)return d.default.createElement("div",{style:i,className:"ReactCrop__crop-selection",onPointerDown:this.onCropPointerDown,"aria-label":b.cropArea,tabIndex:0,onKeyDown:this.onComponentKeyDown,role:"group"},!c&&!e&&d.default.createElement("div",{className:"ReactCrop__drag-elements",onFocus:this.onDragFocus},d.default.createElement("div",{className:"ReactCrop__drag-bar ord-n","data-ord":"n"}),d.default.createElement("div",{className:"ReactCrop__drag-bar ord-e","data-ord":"e"}),d.default.createElement("div",{className:"ReactCrop__drag-bar ord-s","data-ord":"s"}),d.default.createElement("div",{className:"ReactCrop__drag-bar ord-w","data-ord":"w"}),d.default.createElement("div",{className:"ReactCrop__drag-handle ord-nw","data-ord":"nw",tabIndex:0,"aria-label":b.nwDragHandle,onKeyDown:a=>this.onHandlerKeyDown(a,"nw"),role:"button"}),d.default.createElement("div",{className:"ReactCrop__drag-handle ord-n","data-ord":"n",tabIndex:0,"aria-label":b.nDragHandle,onKeyDown:a=>this.onHandlerKeyDown(a,"n"),role:"button"}),d.default.createElement("div",{className:"ReactCrop__drag-handle ord-ne","data-ord":"ne",tabIndex:0,"aria-label":b.neDragHandle,onKeyDown:a=>this.onHandlerKeyDown(a,"ne"),role:"button"}),d.default.createElement("div",{className:"ReactCrop__drag-handle ord-e","data-ord":"e",tabIndex:0,"aria-label":b.eDragHandle,onKeyDown:a=>this.onHandlerKeyDown(a,"e"),role:"button"}),d.default.createElement("div",{className:"ReactCrop__drag-handle ord-se","data-ord":"se",tabIndex:0,"aria-label":b.seDragHandle,onKeyDown:a=>this.onHandlerKeyDown(a,"se"),role:"button"}),d.default.createElement("div",{className:"ReactCrop__drag-handle ord-s","data-ord":"s",tabIndex:0,"aria-label":b.sDragHandle,onKeyDown:a=>this.onHandlerKeyDown(a,"s"),role:"button"}),d.default.createElement("div",{className:"ReactCrop__drag-handle ord-sw","data-ord":"sw",tabIndex:0,"aria-label":b.swDragHandle,onKeyDown:a=>this.onHandlerKeyDown(a,"sw"),role:"button"}),d.default.createElement("div",{className:"ReactCrop__drag-handle ord-w","data-ord":"w",tabIndex:0,"aria-label":b.wDragHandle,onKeyDown:a=>this.onHandlerKeyDown(a,"w"),role:"button"})),f&&d.default.createElement("div",{className:"ReactCrop__selection-addon",onPointerDown:a=>a.stopPropagation()},f(this.state)),g&&d.default.createElement(d.default.Fragment,null,d.default.createElement("div",{className:"ReactCrop__rule-of-thirds-hz"}),d.default.createElement("div",{className:"ReactCrop__rule-of-thirds-vt"})))}makePixelCrop(a){return i({...e,...this.props.crop||{}},a.width,a.height)}render(){let{aspect:a,children:b,circularCrop:c,className:e,crop:f,disabled:g,locked:h,style:i,ruleOfThirds:j}=this.props,{cropIsActive:k,newCropIsBeingDrawn:l}=this.state,m=f?this.renderCropSelection():null,n=((...a)=>a.filter(a=>a&&"string"==typeof a).join(" "))("ReactCrop",e,k&&"ReactCrop--active",g&&"ReactCrop--disabled",h&&"ReactCrop--locked",l&&"ReactCrop--new-crop",f&&a&&"ReactCrop--fixed-aspect",f&&c&&"ReactCrop--circular-crop",f&&j&&"ReactCrop--rule-of-thirds",!this.dragStarted&&f&&!f.width&&!f.height&&"ReactCrop--invisible-crop",c&&"ReactCrop--no-animate");return d.default.createElement("div",{ref:this.componentRef,className:n,style:i},d.default.createElement("div",{ref:this.mediaRef,className:"ReactCrop__child-wrapper",onPointerDown:this.onComponentPointerDown},b),f?d.default.createElement("svg",{className:"ReactCrop__crop-mask",width:"100%",height:"100%"},d.default.createElement("defs",null,d.default.createElement("mask",{id:`hole-${this.instanceId}`},d.default.createElement("rect",{width:"100%",height:"100%",fill:"white"}),c?d.default.createElement("ellipse",{cx:`${f.x+f.width/2}${f.unit}`,cy:`${f.y+f.height/2}${f.unit}`,rx:`${f.width/2}${f.unit}`,ry:`${f.height/2}${f.unit}`,fill:"black"}):d.default.createElement("rect",{x:`${f.x}${f.unit}`,y:`${f.y}${f.unit}`,width:`${f.width}${f.unit}`,height:`${f.height}${f.unit}`,fill:"black"}))),d.default.createElement("rect",{fill:"black",fillOpacity:.5,width:"100%",height:"100%",mask:`url(#hole-${this.instanceId})`})):void 0,m)}},n=a.i(699570),o=a.i(814574),p=a.i(474215),q=a.i(550194);async function r(a,b){let{naturalWidth:c,naturalHeight:d}=a;return Promise.all(b.map(b=>new Promise((e,f)=>{let g=document.createElement("canvas"),h=Math.round(b.x*c),i=Math.round(b.y*d);g.width=Math.max(1,Math.round(b.width*c)),g.height=Math.max(1,Math.round(b.height*d));let j=g.getContext("2d");j?(j.drawImage(a,h,i,g.width,g.height,0,0,g.width,g.height),g.toBlob(a=>a?e(a):f(Error("Canvas is empty")),"image/jpeg",.95)):f(Error("Canvas is not supported"))})))}let s={maxHeight:"65vh",maxWidth:"100%",objectFit:"contain"},t=(0,c.forwardRef)(function({imageSrc:a,regions:d,onChange:e,imageStyle:f=s,onImageLoad:g},h){let{t:i}=(0,q.b)(),j=(0,c.useRef)(null),k=(0,c.useRef)(null),[l,m]=(0,c.useState)(null),n=a=>{let b=j.current.getBoundingClientRect();return{x:(a.clientX-b.left)/b.width,y:(a.clientY-b.top)/b.height}},o=()=>{l&&l.width>=.02&&l.height>=.02&&e([...d,l]),k.current=null,m(null)},r=a=>({left:`${100*a.x}%`,top:`${100*a.y}%`,width:`${100*a.width}%`,height:`${100*a.height}%`});return(0,b.jsxs)("div",{className:"relative inline-block select-none",children:[(0,b.jsx)("img",{ref:h,src:a,alt:"",draggable:!1,style:f,onLoad:g,className:"block"}),(0,b.jsxs)("div",{ref:j,className:"absolute inset-0 cursor-crosshair",style:{touchAction:"none"},onPointerDown:a=>{0===a.button&&(j.current?.setPointerCapture(a.pointerId),k.current=n(a),m(null))},onPointerMove:a=>{var b,c,d,e;let f,g,h;if(!k.current)return;let i=n(a);m((b=k.current.x,c=k.current.y,d=i.x,e=i.y,g=(f=a=>Math.min(1,Math.max(0,a)))(Math.min(b,d)),h=f(Math.min(c,e)),{x:g,y:h,width:f(Math.max(b,d))-g,height:f(Math.max(c,e))-h}))},onPointerUp:o,onPointerCancel:o,children:[d.map((a,c)=>(0,b.jsxs)("div",{className:"absolute border-2 border-sky-400 bg-sky-400/15",style:r(a),children:[(0,b.jsx)("span",{className:"absolute left-0 top-0 bg-sky-500 px-1.5 text-xs font-bold text-white",children:c+1}),(0,b.jsx)("button",{type:"button",className:"absolute -right-3 -top-3 flex h-6 w-6 items-center justify-center rounded-full bg-red-500 text-white shadow","aria-label":i.batchImport.removeRegion.replace("{index}",String(c+1)),onPointerDown:a=>a.stopPropagation(),onClick:()=>e(d.filter((a,b)=>b!==c)),children:(0,b.jsx)(p.X,{className:"h-3 w-3"})})]},c)),l&&(0,b.jsx)("div",{className:"absolute border-2 border-dashed border-yellow-300 bg-yellow-300/10",style:r(l)})]})]})});var u=a.i(164831);let v={name:"zoom-in",size:24,node:[["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}],["line",{x1:"21",x2:"16.65",y1:"21",y2:"16.65",key:"13gj7c"}],["line",{x1:"11",x2:"11",y1:"8",y2:"14",key:"1vmskp"}],["line",{x1:"8",x2:"14",y1:"11",y2:"11",key:"durymu"}]]};v.node;let w=(0,u.f)(v),x={name:"zoom-out",size:24,node:[["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}],["line",{x1:"21",x2:"16.65",y1:"21",y2:"16.65",key:"13gj7c"}],["line",{x1:"8",x2:"14",y1:"11",y2:"11",key:"durymu"}]]};x.node;let y=(0,u.f)(x);function z({zoom:a,onZoomIn:c,onZoomOut:d,onReset:e}){let{t:f}=(0,q.b)(),g="outline-none focus-visible:ring-2 focus-visible:ring-white/70",h=`flex h-9 w-9 items-center justify-center rounded-full text-white transition-colors hover:bg-white/20 disabled:opacity-40 disabled:hover:bg-transparent ${g}`;return(0,b.jsxs)("div",{className:"flex items-center gap-0.5 rounded-full bg-black/60 p-1 shadow-lg backdrop-blur-sm",children:[(0,b.jsx)("button",{type:"button",className:h,onClick:d,disabled:a<=1,"aria-label":f.common.cropper.zoomOut,title:f.common.cropper.zoomOut,children:(0,b.jsx)(y,{className:"h-4 w-4"})}),(0,b.jsxs)("button",{type:"button",className:`h-9 min-w-14 rounded-full px-2 text-center text-xs font-medium tabular-nums text-white hover:bg-white/20 ${g}`,onClick:e,"aria-label":f.common.cropper.resetZoom,title:f.common.cropper.resetZoom,children:[Math.round(100*a),"%"]}),(0,b.jsx)("button",{type:"button",className:h,onClick:c,disabled:a>=5,"aria-label":f.common.cropper.zoomIn,title:f.common.cropper.zoomIn,children:(0,b.jsx)(w,{className:"h-4 w-4"})})]})}var A=a.i(630534);let B={single:{maxHeight:"70vh",maxWidth:"100%",objectFit:"contain"},multi:{maxHeight:"65vh",maxWidth:"100%",objectFit:"contain"}};a.s(["f",0,function({imageSrc:a,open:d,onClose:e,onCropComplete:f,onMultiCropComplete:g}){let{t:h}=(0,q.b)(),i=/^(blob:|data:image\/)/i.test(a)?a:void 0,[j,k]=(0,c.useState)(),l=(0,c.useRef)(null),[p,s]=(0,c.useState)("single"),{containerRef:u,zoom:v,imageStyle:w,measureImage:x,zoomIn:y,zoomOut:C,reset:D}=function(a){let[b,d]=(0,c.useState)(null),e=(0,c.useRef)(null),f=(0,c.useCallback)(a=>{e.current=a,d(a)},[]),[g,h]=(0,c.useState)(1),i=(0,c.useRef)(1),[j,k]=(0,c.useState)(null),l=(0,c.useRef)(null),m=(0,c.useRef)(!1),n=(0,c.useCallback)((a,b,c)=>{let d=e.current,f=i.current,g=Math.min(5,Math.max(1,a));if(!d||g===f)return;if(1===f){let a=d.querySelector("img");a&&k(a.clientWidth)}let j=d.getBoundingClientRect(),m=(b??j.left+j.width/2)-j.left,n=(c??j.top+j.height/2)-j.top;l.current={viewX:m,viewY:n,contentX:d.scrollLeft+m,contentY:d.scrollTop+n,ratio:g/f},i.current=g,h(g)},[]);(0,c.useLayoutEffect)(()=>{let a=e.current,b=l.current;a&&b&&(a.scrollLeft=b.contentX*b.ratio-b.viewX,a.scrollTop=b.contentY*b.ratio-b.viewY,l.current=null)},[g]),(0,c.useEffect)(()=>{if(!b)return;let a=a=>{a.preventDefault(),n(i.current*Math.exp(-(.0015*a.deltaY)),a.clientX,a.clientY)},c=null,d=a=>{let[b,c]=[a[0],a[1]];return{distance:Math.hypot(b.clientX-c.clientX,b.clientY-c.clientY),centerX:(b.clientX+c.clientX)/2,centerY:(b.clientY+c.clientY)/2}},e=a=>{2===a.touches.length&&(c={distance:d(a.touches).distance,zoom:i.current},m.current=!0)},f=a=>{if(!c||2!==a.touches.length)return;a.preventDefault();let{distance:b,centerX:e,centerY:f}=d(a.touches);c.distance>0&&n(c.zoom*(b/c.distance),e,f)},g=a=>{a.touches.length<2&&(c=null,m.current=!1)},h=a=>{m.current&&a.stopPropagation()};return b.addEventListener("wheel",a,{passive:!1}),b.addEventListener("touchstart",e,{passive:!0}),b.addEventListener("touchmove",f,{passive:!1}),b.addEventListener("touchend",g),b.addEventListener("touchcancel",g),b.addEventListener("pointermove",h,{capture:!0}),()=>{b.removeEventListener("wheel",a),b.removeEventListener("touchstart",e),b.removeEventListener("touchmove",f),b.removeEventListener("touchend",g),b.removeEventListener("touchcancel",g),b.removeEventListener("pointermove",h,{capture:!0})}},[b,n]);let o=(0,c.useCallback)(a=>{a&&1===i.current&&k(a.clientWidth)},[]),p=(0,c.useCallback)(()=>n(1.25*i.current),[n]),q=(0,c.useCallback)(()=>n(i.current/1.25),[n]),r=(0,c.useCallback)(()=>{i.current=1,l.current=null,h(1)},[]),s=1!==g&&j?{...a,width:j*g,height:"auto",maxWidth:"none",maxHeight:"none"}:a;return{containerRef:f,zoom:g,imageStyle:s,measureImage:o,zoomIn:p,zoomOut:q,reset:r}}(B[p]);(0,c.useEffect)(()=>{D()},[a,D]);let[E,F]=(0,c.useState)({src:a,regions:[]}),G=E.src===a?E.regions:[],H=b=>F({src:a,regions:b}),I=(0,c.useRef)(null),J=async()=>{if(I.current&&0!==G.length&&g)try{g(await r(I.current,G)),H([])}catch(a){A.V.error("[ImageCropper]","Multi-image crop failed",{error:a})}},K=async()=>{if(!l.current)return;let a=j&&j.width>0&&j.height>0?{x:j.x/100,y:j.y/100,width:j.width/100,height:j.height/100}:{x:0,y:0,width:1,height:1};try{let[b]=await r(l.current,[a]);f(b)}catch(a){A.V.error("[ImageCropper]","Crop failed",{error:a})}};return(0,b.jsx)(o.N,{open:d,onOpenChange:a=>!a&&e(),children:(0,b.jsxs)(o.d,{className:"max-w-3xl h-[90vh] flex flex-col p-0 gap-0",children:[(0,b.jsx)(o.s,{className:"p-4 border-b shrink-0",children:(0,b.jsx)(o.F,{children:h.common.cropper?.title||"Crop Image"})}),(0,b.jsxs)("div",{className:"relative min-h-0 flex-1 bg-black",children:[(0,b.jsx)("div",{ref:u,className:"flex h-full w-full overflow-auto p-4",children:(0,b.jsx)("div",{className:"m-auto",children:"multi"===p?(0,b.jsx)(t,{ref:I,imageSrc:i,regions:G,onChange:H,imageStyle:w,onImageLoad:a=>x(a.currentTarget)}):(0,b.jsx)(m,{crop:j,onChange:(a,b)=>k(b),children:(0,b.jsx)("img",{ref:l,alt:"Crop me",src:i,onLoad:function(a){k({unit:"%",x:0,y:0,width:100,height:100}),x(a.currentTarget)},style:w})})})}),(0,b.jsx)("div",{className:"absolute right-3 top-3",children:(0,b.jsx)(z,{zoom:v,onZoomIn:y,onZoomOut:C,onReset:D})})]}),(0,b.jsxs)("div",{className:"p-4 border-t bg-background shrink-0 space-y-3",children:[g&&(0,b.jsx)("div",{className:"grid grid-cols-2 gap-1 rounded-md bg-muted p-1 sm:w-80",children:["single","multi"].map(a=>(0,b.jsx)("button",{type:"button",onClick:()=>{D(),s(a)},className:`rounded px-3 py-1.5 text-sm font-medium transition-colors ${p===a?"bg-background shadow-sm":"text-muted-foreground"}`,children:"single"===a?h.batchImport.singleMode:h.batchImport.multiMode},a))}),(0,b.jsxs)("div",{className:"flex flex-col sm:flex-row sm:justify-between sm:items-center gap-3",children:[(0,b.jsx)("p",{className:"text-sm text-muted-foreground",children:"multi"===p?`${h.batchImport.hint} ${h.batchImport.regionCount.replace("{count}",String(G.length))}`:h.common.cropper?.hint||"💡 Drag to adjust crop area"}),(0,b.jsxs)("div",{className:"flex gap-2 justify-end",children:["multi"===p&&G.length>0&&(0,b.jsx)(n.f,{variant:"ghost",onClick:()=>H([]),children:h.batchImport.clear}),(0,b.jsx)(n.f,{variant:"outline",onClick:e,children:h.common.cancel||"Cancel"}),"multi"===p?(0,b.jsx)(n.f,{onClick:J,disabled:0===G.length,children:h.batchImport.start.replace("{count}",String(G.length))}):(0,b.jsx)(n.f,{onClick:K,children:h.common.confirm||"Confirm"})]})]})]})]})})}],797521)},460081,a=>{var b=a.i(187924),c=a.i(572131),d=a.i(164831);let e={name:"code-xml",size:24,node:[["path",{d:"m18 16 4-4-4-4",key:"1inbqp"}],["path",{d:"m6 8-4 4 4 4",key:"15zrgr"}],["path",{d:"m14.5 4-5 16",key:"e7oirm"}]],aliases:["code-2"]};e.node;let f=(0,d.f)(e);var g=a.i(755681),h=a.i(93907),i=a.i(429246),j=a.i(550194),k=a.i(368114);a.s(["f",0,function({value:a,onChange:d,className:e,...l}){let{t:m}=(0,j.b)(),[n,o]=(0,c.useState)("source"),p=(0,c.useId)(),q=[{mode:"source",label:m.markdownEditor.source,icon:f},{mode:"preview",label:m.markdownEditor.preview,icon:g.f}];return(0,b.jsxs)("div",{className:"space-y-1.5",children:[(0,b.jsx)("div",{role:"tablist","aria-label":m.markdownEditor.modeLabel,className:"flex justify-end",children:(0,b.jsx)("div",{className:"inline-flex rounded-md border bg-muted/40 p-0.5",children:q.map(({mode:a,label:c,icon:d})=>(0,b.jsxs)("button",{type:"button",role:"tab","aria-selected":n===a,"aria-controls":p,onClick:()=>o(a),className:(0,k.f)("flex items-center gap-1 rounded px-2.5 py-1 text-xs transition-colors",n===a?"bg-background font-medium shadow-sm":"text-muted-foreground hover:text-foreground"),children:[(0,b.jsx)(d,{className:"h-3.5 w-3.5"}),c]},a))})}),(0,b.jsx)("div",{id:p,role:"tabpanel",children:"source"===n?(0,b.jsx)(i.f,{value:a,onChange:a=>d(a.target.value),className:e,...l}):(0,b.jsx)("div",{className:"min-h-24 cursor-text rounded-md border bg-muted/20 px-3 py-2",onDoubleClick:()=>o("source"),title:m.markdownEditor.doubleClickToEdit,children:a.trim()?(0,b.jsx)(h.f,{content:a}):(0,b.jsx)("p",{className:"text-sm italic text-muted-foreground",children:m.markdownEditor.empty})})})]})}],460081)},350659,a=>{var b=a.i(187924),c=a.i(572131),d=a.i(580701),e=a.i(118688),f=a.i(291938),g=a.i(630534),h=a.i(550194);a.s(["f",0,function({value:a,onChange:i,className:j}){let[k,l]=(0,c.useState)([]),{t:m}=(0,h.b)();return(0,c.useEffect)(()=>{(async()=>{try{let a=await f.f.get("/api/notebooks");l(a)}catch(a){g.V.error("[NotebookSelector]","Failed to fetch notebooks",{error:a})}})()},[]),(0,b.jsxs)(d.d,{value:a,onValueChange:i,children:[(0,b.jsx)(d.P,{className:j,children:(0,b.jsxs)("div",{className:"flex items-center gap-2",children:[(0,b.jsx)(e.f,{className:"h-4 w-4 text-muted-foreground"}),(0,b.jsx)(d.U,{placeholder:m.notebooks?.selector?.placeholder||"Select Notebook"})]})}),(0,b.jsx)(d.r,{children:0===k.length?(0,b.jsx)("div",{className:"p-2 text-sm text-muted-foreground text-center",children:m.notebooks?.selector?.empty||"No notebooks available"}):k.map(a=>(0,b.jsx)(d.T,{value:a.id,children:a.name},a.id))})]})}])},43542,a=>{var b=a.i(630534);async function c(a,d=1,e=1920,f=.8){return new Promise((c,g)=>{let h=new FileReader;h.onload=h=>{let i=new Image;i.onload=()=>{let h=document.createElement("canvas"),j=h.getContext("2d");if(!j)return void g(Error("无法获取 Canvas 上下文"));let k=i.width,l=i.height;k>e&&(l=l*e/k,k=e),h.width=k,h.height=l,j.drawImage(i,0,0,k,l);let m=f,n=h.toDataURL("image/jpeg",m),o=3*n.length/4/1024/1024;for(;o>d&&m>.1;){m-=.1;let a=3*(n=h.toDataURL("image/jpeg",m)).length/4/1024/1024;if(b.V.info("[ImageCompress]","Compression step",{quality:Number(m.toFixed(1)),sizeMB:Number(a.toFixed(2))},{sendToBackend:!1}),a<=d)break}b.V.info("[ImageCompress]","Compression finished",{originalMB:Number((a.size/1024/1024).toFixed(2)),compressedMB:Number((3*n.length/4/1024/1024).toFixed(2))}),c(n)},i.onerror=()=>g(Error("图片加载失败")),i.src=h.target?.result},h.onerror=()=>g(Error("文件读取失败")),h.readAsDataURL(a)})}async function d(a){let d=a.size/1024/1024;return(b.V.info("[ImageCompress]","File size checked",{sizeMB:Number(d.toFixed(2))},{sendToBackend:!1}),d>1)?(b.V.info("[ImageCompress]","File exceeds threshold, compressing",void 0,{sendToBackend:!1}),await c(a,1)):(b.V.info("[ImageCompress]","File size OK, no compression needed",void 0,{sendToBackend:!1}),new Promise((b,c)=>{let d=new FileReader;d.onload=()=>b(d.result),d.onerror=c,d.readAsDataURL(a)}))}a.s(["f",0,d])},851795,a=>{a.s(["f",0,function(a){return"number"!=typeof a||!Number.isInteger(a)||a<1||a>5?null:a<=3?"a":"b"}])}]})();
|
|
2
2
|
|
|
3
3
|
//# sourceMappingURL=_0am6ugw1ulqzu._.js.map
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
(()=>{"use strict";module.exports=[557230,563658,a=>{var b=a.i(164831);let c={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"}]]};c.node;let d=(0,b.f)(c);a.s(["f",0,d],557230);var e=a.i(187924),f=a.i(572131),g=a.i(507554),h=a.i(470121),i=a.i(750104),j=a.i(225152),k=a.i(3688),l=a.i(30553),m=Object.defineProperty,n=(a,b)=>m(a,"name",{value:b,configurable:!0}),o="Switch",[p,q]=(0,i.f)(o),[r,s]=p(o);function t(a){let{__scopeSwitch:b,checked:c,children:d,defaultChecked:g,disabled:h,form:i,name:k,onCheckedChange:l,required:m,value:n="on",internal_do_not_use_render:p}=a,[q,s]=(0,j.f)({prop:c,defaultProp:g??!1,onChange:l,caller:o}),[t,u]=f.useState(null),[v,w]=f.useState(null),[x,z]=f.useState(null),A=!t||!!i||!!t.closest("form"),B={checked:q,setChecked:s,disabled:h,control:t,setControl:u,name:k,form:i,value:n,userClick:x,onUserClick:z,required:m,defaultChecked:g,isFormControl:A,bubbleInput:v,setBubbleInput:w};return(0,e.jsx)(r,{scope:b,...B,children:y(p)?p(B):d})}n(t,"SwitchProvider");var u=f.forwardRef(n(function({__scopeSwitch:a,onClick:b,...c},d){let{control:i,form:j,value:k,disabled:m,checked:o,required:p,setControl:q,setChecked:r,onUserClick:t,isFormControl:u,bubbleInput:v}=s("SwitchTrigger",a),w=(0,h.f)(d,q),x=f.useRef(o);return f.useEffect(()=>{let a=j?i?.ownerDocument.getElementById(j):i?.form;if(a instanceof HTMLFormElement){let b=n(()=>r(x.current),"reset");return a.addEventListener("reset",b),()=>a.removeEventListener("reset",b)}},[i,j,r]),(0,e.jsx)(l.V.button,{type:"button",role:"switch","aria-checked":o,"aria-required":p,"data-state":z(o),"data-disabled":m?"":void 0,disabled:m,value:k,...c,ref:w,onClick:(0,g.f)(b,a=>{let b=a.isPropagationStopped();t({requestedChecked:!o,hasConsumerStoppedPropagation:b}),r(a=>!a),v&&u&&!b&&a.stopPropagation()})})},"SwitchTrigger")),v=f.forwardRef(n(function(a,b){let{__scopeSwitch:c,name:d,checked:f,defaultChecked:g,required:h,disabled:i,value:j,onCheckedChange:k,form:l,...m}=a;return(0,e.jsx)(t,{__scopeSwitch:c,checked:f,defaultChecked:g,disabled:i,required:h,onCheckedChange:k,name:d,form:l,value:j,internal_do_not_use_render:({isFormControl:a})=>(0,e.jsxs)(e.Fragment,{children:[(0,e.jsx)(u,{...m,ref:b,__scopeSwitch:c}),a&&(0,e.jsx)(x,{__scopeSwitch:c})]})})},"Switch")),w=f.forwardRef(n(function(a,b){let{__scopeSwitch:c,...d}=a,f=s("SwitchThumb",c);return(0,e.jsx)(l.V.span,{"data-state":z(f.checked),"data-disabled":f.disabled?"":void 0,...d,ref:b})},"SwitchThumb")),x=f.forwardRef(n(function({__scopeSwitch:a,onClick:b,...c},d){let{control:i,userClick:j,checked:m,defaultChecked:n,required:o,disabled:p,name:q,value:r,form:t,bubbleInput:u,setBubbleInput:v}=s("SwitchBubbleInput",a),w=(0,h.f)(d,v),x=(0,k.f)(i),y=f.useRef(!1),z=f.useRef(m),A=f.useRef(j),B=f.useRef(null);f.useEffect(()=>{if(!u)return;let a=Object.getOwnPropertyDescriptor(window.HTMLInputElement.prototype,"checked").set;if(!a)return;let b=z.current!==m;z.current=m;let c=null!==j&&j!==A.current;if(A.current=j,c)B.current=b?null:j,b&&a.call(u,m),u.dispatchEvent(new Event("click",{bubbles:!j.hasConsumerStoppedPropagation}));else if(b){let b=B.current;B.current=null;let c=b?.requestedChecked===m;y.current=!0,a.call(u,m),u.dispatchEvent(new Event("click",{bubbles:!(c&&b.hasConsumerStoppedPropagation)})),y.current=!1}},[u,m,j]);let C=f.useRef(m);return(0,e.jsx)(l.V.input,{type:"checkbox","aria-hidden":!0,defaultChecked:n??C.current,required:o,disabled:p,name:q,value:r,form:t,...c,tabIndex:-1,ref:w,onClick:(0,g.f)(b,a=>{y.current&&a.stopPropagation()}),style:{...c.style,...x,position:"absolute",pointerEvents:"none",opacity:0,margin:0,transform:"translateX(-100%)"}})},"SwitchBubbleInput"));function y(a){return"function"==typeof a}function z(a){return a?"checked":"unchecked"}n(y,"isFunction"),n(z,"getState");var A=a.i(368114);let B=f.forwardRef(({className:a,...b},c)=>(0,e.jsx)(v,{className:(0,A.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",a),...b,ref:c,children:(0,e.jsx)(w,{className:(0,A.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")})}));B.displayName=v.displayName,a.s(["f",0,B],563658)},144952,613412,206194,190622,a=>{var b=a.i(187924),c=a.i(572131),d=a.i(164831);let e={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"]};e.node;let f=(0,d.f)(e);a.s(["f",0,f],613412);var g=a.i(875160),h=a.i(211134);let i={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"}]]};i.node;let j=(0,d.f)(i);var k=a.i(699570),l=a.i(550194);function m({detail:a}){let{t:c}=(0,l.b)();return a?(0,b.jsxs)("p",{className:"mt-1 rounded bg-background/60 px-2 py-1 font-mono text-[11px] leading-relaxed text-red-700 break-all select-text",children:[(0,b.jsx)("span",{className:"font-sans text-muted-foreground",children:c.settings.ai.providerErrorDetail}),a]}):null}a.s(["f",0,m],206194);let n={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"}}},o=Object.keys(n);function p(a){return"string"==typeof a&&Object.prototype.hasOwnProperty.call(n,a)}a.s(["$",0,n,"U",0,o,"z",0,function(a,b){let c=n[a];return"zh"===b?c.name:c.nameEn},"j",0,p,"k",0,function(a,b){let c=n[a];return{apiKey:b?.apiKey||"",baseUrl:b?.baseUrl||c.baseUrl,model:b?.model||c.model}}],190622);var q=a.i(291938),r=a.i(960927),s=a.i(630534);a.s(["f",0,function({config:a,saving:d,saveButton:e}){let{t:i,language:n}=(0,l.b)(),[o,t]=(0,c.useState)(!1),[u,v]=(0,c.useState)(null),w=a=>i.settings?.ai?.errors?.[a]||a.replace("UNKNOWN:",""),x=async()=>{let b=function(a,b){let c=a.aiProvider;if("openai"===c){let d=a.openai?.instances?.find(b=>b.id===a.openai?.activeInstanceId);return d?.apiKey?{ok:!0,body:{provider:c,apiKey:d.apiKey,baseUrl:d.baseUrl,model:d.model,language:b}}:{ok:!1,error:"API_KEY_REQUIRED"}}if("azure"===c){let d=a.azure;return d?.apiKey&&d.endpoint&&d.deploymentName?{ok:!0,body:{provider:c,apiKey:d.apiKey,endpoint:d.endpoint,deploymentName:d.deploymentName,apiVersion:d.apiVersion,model:d.model,language:b}}:{ok:!1,error:"AZURE_CONFIG_INCOMPLETE"}}if("minimax-code"===c)return{ok:!0,body:{provider:c,model:a.minimaxCode?.model,language:b}};if("gemini"===c||"anthropic"===c||p(c)){let d=a[c];return d?.apiKey?{ok:!0,body:{provider:c,apiKey:d.apiKey,baseUrl:d.baseUrl,model:d.model,language:b}}:{ok:!1,error:"API_KEY_REQUIRED"}}return{ok:!1,error:"UNSUPPORTED_PROVIDER"}}(a,n);if(!b.ok){if("UNSUPPORTED_PROVIDER"===b.error)return;v({success:!1,textSupport:!1,visionSupport:!1,textError:"AZURE_CONFIG_INCOMPLETE"===b.error?i.settings?.ai?.validationAzureEndpointRequired||"Azure config is incomplete":i.settings?.ai?.validationApiKeyRequired||"API Key is required"});return}t(!0),v(null);try{v(await q.f.post("/api/ai/test",b.body))}catch(a){s.f.error("[AiConnectionTest]","AI connection test failed",{error:a}),v({success:!1,textSupport:!1,visionSupport:!1,textError:(0,r.Z)(a)})}finally{t(!1)}};return(0,b.jsxs)("div",{className:"space-y-3 pt-3 border-t",children:[(0,b.jsxs)("div",{className:"flex gap-2",children:[(0,b.jsxs)(k.f,{type:"button",variant:"outline",onClick:x,disabled:o||d,className:"flex-1",children:[o?(0,b.jsx)(g.f,{className:"mr-2 h-4 w-4 animate-spin"}):(0,b.jsx)(j,{className:"mr-2 h-4 w-4"}),o?i.settings?.ai?.testing||"Testing...":i.settings?.ai?.testConnection||"Test Connection"]}),e]}),u&&(0,b.jsxs)("div",{className:`p-3 rounded-md text-sm ${u.success?"bg-green-50 border border-green-200":"bg-red-50 border border-red-200"}`,children:[(0,b.jsx)("div",{className:"flex items-center gap-2 font-medium mb-2",children:u.success?(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)(f,{className:"h-4 w-4 text-green-600"}),(0,b.jsx)("span",{className:"text-green-700",children:i.settings?.ai?.testSuccess||"Connection Successful"}),u.modelInfo&&(0,b.jsxs)("span",{className:"text-green-600 text-xs",children:["(",u.modelInfo,")"]})]}):(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)(h.f,{className:"h-4 w-4 text-red-600"}),(0,b.jsx)("span",{className:"text-red-700",children:i.settings?.ai?.testFailed||"Connection Failed"})]})}),u.success&&(0,b.jsxs)("div",{className:"space-y-1 text-xs",children:[(0,b.jsxs)("div",{className:"flex items-center gap-2",children:[(0,b.jsxs)("span",{className:"text-muted-foreground",children:[i.settings?.ai?.textSupport||"Text Generation",":"]}),(0,b.jsxs)("span",{className:"text-green-600",children:["✓ ",i.settings?.ai?.supported||"Supported"]})]}),(0,b.jsxs)("div",{className:"flex items-center gap-2",children:[(0,b.jsxs)("span",{className:"text-muted-foreground",children:[i.settings?.ai?.visionSupport||"Vision/Multimodal",":"]}),u.visionSupport?(0,b.jsxs)("span",{className:"text-green-600",children:["✓ ",i.settings?.ai?.supported||"Supported"]}):(0,b.jsxs)("span",{className:"text-amber-600",children:["✗ ",u.visionError?w(u.visionError):i.settings?.ai?.notSupported||"Not Supported"]})]}),!u.visionSupport&&(0,b.jsx)(m,{detail:u.visionErrorDetail}),(0,b.jsx)("p",{className:"text-muted-foreground/60 text-[10px] pl-1",children:i.settings?.ai?.testNetworkNote})]}),!u.success&&u.textError&&(0,b.jsx)("p",{className:"text-red-600 text-xs mt-1",children:w(u.textError)}),!u.success&&(0,b.jsx)(m,{detail:u.textErrorDetail})]})]})}],144952)},151304,439830,a=>{var b=a.i(187924),c=a.i(875160),d=a.i(699570),e=a.i(870430),f=a.i(580701),g=a.i(144952),h=a.i(492710),i=a.i(612416),j=a.i(340898),k=a.i(168370),l=a.i(474896),m=a.i(557230),n=a.i(519783),o=a.i(786304),p=a.i(866718),q=a.i(895605),r=a.i(563658),s=a.i(550194),t=a.i(529759),u=a.i(986705);function v({checkin:a,autoCheckin:f,onAutoCheckinChange:g,busy:h,onCheckin:i}){let j,{t:k}=(0,s.b)(),{timeZone:l}=(0,t.M)(),m=k.settings?.ai?.minimaxCode,{today:n,last:p}=a,w=p&&"failed"!==p.status?p:null,x=!!(n?.checkedToday||w),y=String(w?.points??(n?n.points+n.bonusPoints:0)),z=String(w?.streakDays??n?.streakDays??0);return j=w?.trigger==="auto"&&"checked-in"===w.status?(m?.checkinAuto||"Checked in automatically today at {time} (+{points} credits, day {days} in a row)").replace("{time}",(0,u.r)(w.at,"HH:mm",l)).replace("{points}",y).replace("{days}",z):x?(m?.checkinDone||"Checked in today (+{points} credits, day {days} in a row)").replace("{points}",y).replace("{days}",z):p?.status==="failed"?(m?.checkinFailed||"Check-in failed: {error}").replace("{error}",p.error||""):a.autoCheckin?m?.checkinWillAuto||"Not checked in yet today. The app will check in automatically within the hour.":m?.checkinNotYet||"Not checked in yet today",(0,b.jsxs)("div",{className:"space-y-3 border-t pt-3",children:[(0,b.jsxs)("div",{className:"flex flex-wrap items-center justify-between gap-2 text-sm",children:[(0,b.jsxs)("div",{className:"flex min-w-0 items-center gap-2",children:[(0,b.jsx)("span",{className:"text-muted-foreground",children:m?.checkinToday||"Today's check-in"}),(0,b.jsxs)(o.f,{variant:x?"default":p?.status==="failed"?"destructive":"secondary",children:[(0,b.jsx)(q.f,{className:"mr-1 h-3 w-3"}),x?m?.checkinSuccess||"Checked in":m?.checkinNotYet||"Not yet"]})]}),!x&&(0,b.jsxs)(d.f,{size:"sm",variant:"outline",onClick:i,disabled:h,children:[h&&(0,b.jsx)(c.f,{className:"mr-2 h-4 w-4 animate-spin"}),m?.checkinNow||"Check in now"]})]}),(0,b.jsx)("p",{className:"text-xs text-muted-foreground break-words",children:j}),(0,b.jsxs)("div",{className:"flex items-start justify-between gap-3",children:[(0,b.jsxs)("div",{className:"space-y-1",children:[(0,b.jsx)(e.f,{htmlFor:"minimax-code-auto-checkin",children:m?.autoCheckin||"Daily auto check-in"}),(0,b.jsx)("p",{className:"text-xs text-muted-foreground",children:m?.autoCheckinHint})]}),(0,b.jsx)(r.f,{id:"minimax-code-auto-checkin",checked:f,onCheckedChange:g})]})]})}let w=["MiniMax-M3.1-Flash","MiniMax-M3","MiniMax-M2.7-highspeed","MiniMax-M2.7"];var x=a.i(572131),y=a.i(291938),z=a.i(960927),A=a.i(710302),B=a.i(630534);function C({value:a,onChange:f}){let{t:g}=(0,s.b)(),h=g.settings?.ai?.minimaxCode,{status:i,loading:j,pending:q,busy:r,refresh:t,login:u,logout:D,checkin:E}=function(){let{t:a}=(0,s.b)(),b=a.settings?.ai?.minimaxCode,[c,d]=(0,x.useState)(null),[e,f]=(0,x.useState)(!0),[g,h]=(0,x.useState)(null),[i,j]=(0,x.useState)(!1),k=(0,x.useRef)(null),l=(0,x.useCallback)(async()=>{f(!0);try{let a=await y.f.get("/api/minimax-code");d(a),a.pendingLogin&&h(a.pendingLogin)}catch(a){B.f.error("[MiniMaxCode]","Failed to load status",{error:a})}finally{f(!1)}},[]);(0,x.useEffect)(()=>{l()},[l]),(0,x.useEffect)(()=>{if(!g)return;let a=!1,c=async()=>{try{let d=await y.f.get("/api/minimax-code/login");if(a)return;if("pending"===d.status){k.current=setTimeout(c,g.intervalMs);return}h(null),"ok"===d.status?A.c.success(b?.loginSuccess||"Signed in"):"expired"===d.status?A.c.error(b?.loginExpired||"Authorization timed out"):"denied"===d.status&&A.c.error(b?.loginDenied||"Authorization declined"),l()}catch(c){if(a)return;h(null),A.c.error(`${b?.loginFailed||"Sign-in failed"}: ${(0,z.Z)(c)}`)}};return k.current=setTimeout(c,g.intervalMs),()=>{a=!0,k.current&&clearTimeout(k.current)}},[g,l,b]);let m=async()=>{j(!0);try{await y.f.delete("/api/minimax-code"),h(null),await l()}catch(a){A.c.error((0,z.Z)(a))}finally{j(!1)}},n=async()=>{j(!0);try{let a=await y.f.post("/api/minimax-code/checkin",{});"failed"===a.status?A.c.error((b?.checkinFailed||"Check-in failed: {error}").replace("{error}",a.error||"")):A.c.success(b?.checkinSuccess||"Checked in"),await l()}catch(a){A.c.error((0,z.Z)(a))}finally{j(!1)}};return{status:c,loading:e,pending:g,busy:i,refresh:l,login:async()=>{j(!0);try{let a=await y.f.post("/api/minimax-code/login",{});h(a),window.open(a.url,"_blank","noopener,noreferrer")}catch(a){A.c.error(`${b?.loginFailed||"Sign-in failed"}: ${(0,z.Z)(a)}`)}finally{j(!1)}},logout:m,checkin:n}}(),F=i?.login??"none",G=i?.account,H=i?.credits,I={none:h?.statusNone||"Not signed in",active:h?.statusActive||"Signed in",expired:h?.statusExpired||"Login expired"}[F];return(0,b.jsxs)("div",{className:"space-y-3 animate-in fade-in slide-in-from-top-2",children:[(0,b.jsx)("p",{className:"text-xs text-muted-foreground",children:h?.intro}),(0,b.jsxs)("section",{className:"space-y-3 rounded-md border bg-background p-3","aria-label":h?.title||"MiniMax Code account",children:[(0,b.jsxs)("div",{className:"flex items-center justify-between gap-2",children:[(0,b.jsx)("h4",{className:"text-sm font-medium",children:h?.title||"MiniMax Code account"}),(0,b.jsx)(d.f,{variant:"ghost",size:"sm",onClick:()=>void t(),disabled:j,"aria-label":h?.refresh||"Refresh",children:(0,b.jsx)(n.f,{className:`h-4 w-4 ${j?"animate-spin":""}`})})]}),(0,b.jsxs)("dl",{className:"grid grid-cols-[auto_1fr] gap-x-4 gap-y-2 text-sm",children:[(0,b.jsx)("dt",{className:"text-muted-foreground",children:h?.loginStatus||"Login status"}),(0,b.jsxs)("dd",{className:"flex min-w-0 flex-wrap items-center gap-2",children:[(0,b.jsx)(o.f,{variant:"active"===F?"default":"expired"===F?"destructive":"secondary",children:I}),G&&(0,b.jsx)("span",{className:"truncate text-muted-foreground",children:G.name||G.email||G.userId})]}),"active"===F&&(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)("dt",{className:"text-muted-foreground",children:h?.credits||"Remaining credits"}),(0,b.jsx)("dd",{children:H?(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)("span",{className:"font-medium tabular-nums",children:H.total}),(0,b.jsx)("span",{className:"ml-2 text-xs text-muted-foreground",children:(h?.creditsDetail||"Free {free} · Purchased {purchased}").replace("{free}",String(H.free)).replace("{purchased}",String(H.purchased))})]}):(0,b.jsx)("span",{className:"text-muted-foreground",children:h?.creditsUnavailable||"Unavailable"})})]})]}),"active"===F&&i&&(0,b.jsx)(v,{checkin:i.checkin,autoCheckin:a?.autoCheckin!==!1,onAutoCheckinChange:b=>f({...a,autoCheckin:b}),busy:r,onCheckin:()=>void E()}),q?(0,b.jsxs)("div",{className:"space-y-1 rounded-md bg-muted/50 p-3 text-sm",children:[(0,b.jsxs)("p",{className:"flex items-center gap-2",children:[(0,b.jsx)(c.f,{className:"h-4 w-4 animate-spin"}),h?.waiting]}),q.userCode&&(0,b.jsxs)("p",{children:[h?.userCode||"Verification code",": ",(0,b.jsx)("span",{className:"font-mono font-medium",children:q.userCode})]}),(0,b.jsxs)("a",{href:q.url,target:"_blank",rel:"noopener noreferrer",className:"inline-flex items-center gap-1 underline",children:[h?.openLink||"Open the authorization page"," ",(0,b.jsx)(k.f,{className:"h-3 w-3"})]})]}):(0,b.jsxs)("div",{className:"flex flex-wrap gap-2",children:[(0,b.jsxs)(d.f,{size:"sm",onClick:()=>void u(),disabled:r,children:[r?(0,b.jsx)(c.f,{className:"mr-2 h-4 w-4 animate-spin"}):(0,b.jsx)(l.f,{className:"mr-2 h-4 w-4"}),"none"===F?h?.login||"Sign in with browser":h?.relogin||"Sign in again"]}),"none"!==F&&(0,b.jsxs)(d.f,{size:"sm",variant:"outline",onClick:()=>void D(),disabled:r,children:[(0,b.jsx)(m.f,{className:"mr-2 h-4 w-4"}),h?.logout||"Sign out"]})]})]}),(0,b.jsxs)("div",{className:"space-y-2",children:[(0,b.jsx)(e.f,{htmlFor:"minimax-code-model",children:h?.model||"Model"}),(0,b.jsx)(p.f,{id:"minimax-code-model",list:"minimax-code-models",value:a?.model||"",onChange:b=>f({...a,model:b.target.value}),placeholder:"MiniMax-M3.1-Flash"}),(0,b.jsx)("datalist",{id:"minimax-code-models",children:w.map(a=>(0,b.jsx)("option",{value:a},a))}),(0,b.jsx)("p",{className:"text-xs text-muted-foreground",children:h?.modelHint})]}),(0,b.jsx)("p",{className:"text-xs text-muted-foreground",children:h?.risk})]})}var D=a.i(403512),E=a.i(951675),F=a.i(175592),G=a.i(676330),H=a.i(152679),I=a.i(148463);function J({value:a,onChange:c}){let{t:g}=(0,s.b)(),h=(0,I.f)("openai"),i=a?.instances||[],j=a?.activeInstanceId,k=i.find(a=>a.id===j),l=(b,d)=>{c({...a,instances:i.map(a=>a.id===j?{...a,[b]:d}:a)})},m=async()=>{if(!j||!await (0,A.u)(g.settings?.ai?.confirmDelete||"Delete this instance?",{destructive:!0}))return;let a=i.filter(a=>a.id!==j);c({instances:a,activeInstanceId:a[0]?.id})};return(0,b.jsxs)("div",{className:"space-y-3 animate-in fade-in slide-in-from-top-2",children:[(0,b.jsxs)("div",{className:"space-y-2",children:[(0,b.jsxs)("div",{className:"flex items-center justify-between",children:[(0,b.jsx)(e.f,{children:g.settings?.ai?.instances||"Instance"}),(0,b.jsxs)(d.f,{type:"button",variant:"outline",size:"sm",onClick:()=>{if(i.length>=10)return;let a={id:"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,a=>{let b=16*Math.random()|0;return("x"===a?b:3&b|8).toString(16)}),name:`Instance ${i.length+1}`,apiKey:"",baseUrl:"https://api.openai.com/v1",model:"gpt-6.1-sol"};c({instances:[...i,a],activeInstanceId:a.id})},disabled:i.length>=10,className:"h-7 px-2 text-xs",children:[(0,b.jsx)(D.f,{className:"h-3 w-3 mr-1"}),g.settings?.ai?.addInstance||"Add"]})]}),i.length>0?(0,b.jsxs)("div",{className:"flex gap-2",children:[(0,b.jsxs)(f.d,{value:j||"",onValueChange:b=>c({...a,activeInstanceId:b}),children:[(0,b.jsx)(f.P,{className:"flex-1",children:(0,b.jsx)(f.U,{placeholder:g.settings?.ai?.selectInstance||"Select Instance"})}),(0,b.jsx)(f.r,{children:i.map(a=>(0,b.jsx)(f.T,{value:a.id,children:a.name},a.id))})]}),i.length>1&&(0,b.jsx)(d.f,{type:"button",variant:"outline",size:"icon",onClick:m,className:"h-10 w-10 text-destructive hover:text-destructive",children:(0,b.jsx)(E.f,{className:"h-4 w-4"})})]}):(0,b.jsx)("p",{className:"text-sm text-muted-foreground",children:g.settings?.ai?.noInstances||"No instances configured. Click 'Add' to create one."}),i.length>=10&&(0,b.jsx)("p",{className:"text-xs text-amber-600",children:g.settings?.ai?.maxInstancesReached||"Maximum instances reached (10)"})]}),k&&(0,b.jsxs)("div",{className:"space-y-3 p-3 border rounded-md bg-background",children:[(0,b.jsxs)("div",{className:"space-y-2",children:[(0,b.jsxs)(e.f,{children:[g.settings?.ai?.instanceName||"Instance Name"," ",(0,b.jsx)("span",{className:"text-destructive",children:"*"})]}),(0,b.jsx)(p.f,{value:k.name||"",onChange:a=>l("name",a.target.value),placeholder:"e.g. GLM-4V",className:k.name?.trim()?"":"border-destructive"})]}),(0,b.jsxs)("div",{className:"space-y-2",children:[(0,b.jsx)(G.f,{label:(0,b.jsxs)(b.Fragment,{children:["API Key ",(0,b.jsx)("span",{className:"text-destructive",children:"*"})]}),href:h?.apiKey,linkText:g.settings.ai.docLinks.apiKey}),(0,b.jsx)(H.f,{value:k.apiKey||"",onChange:a=>l("apiKey",a.target.value),placeholder:"sk-...",className:k.apiKey?.trim()?"":"border-destructive"})]}),(0,b.jsxs)("div",{className:"space-y-2 pt-4 border-t",children:[(0,b.jsxs)(e.f,{children:["Base URL ",(0,b.jsx)("span",{className:"text-destructive",children:"*"})]}),(0,b.jsx)(p.f,{value:k.baseUrl||"",onChange:a=>l("baseUrl",a.target.value),placeholder:"https://api.openai.com/v1",className:k.baseUrl?.trim()?"":"border-destructive"})]}),(0,b.jsx)(F.f,{provider:"openai",apiKey:k.apiKey,baseUrl:k.baseUrl,currentModel:k.model,onModelChange:a=>l("model",a),docsHref:h?.models})]})]})}function K({provider:a}){let{t:c}=(0,s.b)(),d=c.settings.ai.providerDocs,e=(0,I.f)(a);if(!e)return null;let f=[e.cn&&{href:e.cn,label:e.intl?d.cn:d.official},e.intl&&{href:e.intl,label:e.cn?d.intl:d.official}].filter(a=>!!a);return(0,b.jsxs)("p",{className:"flex flex-wrap items-center gap-x-3 gap-y-1 text-xs text-muted-foreground",children:[(0,b.jsx)("span",{children:d.title}),f.map(a=>(0,b.jsxs)("a",{href:a.href,target:"_blank",rel:"noopener noreferrer",className:"inline-flex items-center gap-1 underline",children:[a.label,(0,b.jsx)(k.f,{className:"h-3 w-3"})]},a.href))]})}var L=a.i(190622);function M({provider:a,value:c,onChange:d}){let{t:f}=(0,s.b)(),g=L.$[a],h=(a,b)=>d({...c,[a]:b}),i={qwen:f.settings?.ai?.qwenBaseUrlHint,stepfun:f.settings?.ai?.stepfunBaseUrlHint,volcengine:f.settings?.ai?.volcengineBaseUrlHint,"volcengine-agent":f.settings?.ai?.volcengineAgentBaseUrlHint,"volcengine-coding":f.settings?.ai?.volcengineCodingBaseUrlHint};return(0,b.jsxs)("div",{className:"space-y-3 animate-in fade-in slide-in-from-top-2",children:["volcengine-free"===a&&(0,b.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,b.jsx)("p",{className:"font-medium",children:f.settings.ai.volcengineFree.title}),(0,b.jsx)("p",{className:"mt-1",children:f.settings.ai.volcengineFree.body})]}),(0,b.jsxs)("div",{className:"space-y-2",children:[(0,b.jsx)(G.f,{label:"API Key",href:g.docs.apiKey,linkText:f.settings.ai.docLinks.apiKey}),(0,b.jsx)(H.f,{value:c?.apiKey||"",onChange:a=>h("apiKey",a.target.value),placeholder:"sk-..."}),(0,b.jsxs)("p",{className:"text-xs text-muted-foreground",children:[f.settings?.ai?.vendorApiKeyHint||"Get an API key from the console:"," ",(0,b.jsx)("a",{href:g.consoleUrl,target:"_blank",rel:"noopener noreferrer",className:"underline break-all",children:g.consoleUrl})]})]}),(0,b.jsxs)("div",{className:"space-y-2",children:[(0,b.jsx)(e.f,{children:"Base URL (Optional)"}),(0,b.jsx)(p.f,{value:c?.baseUrl||"",onChange:a=>h("baseUrl",a.target.value),placeholder:g.baseUrl}),(0,b.jsx)("p",{className:"text-xs text-muted-foreground",children:i[a]??f.settings?.ai?.vendorBaseUrlHint})]}),(0,b.jsx)(F.f,{provider:a,apiKey:c?.apiKey,baseUrl:c?.baseUrl,currentModel:c?.model||g.model,onModelChange:a=>h("model",a),docsHref:g.docs.models})]})}a.s(["f",0,function({config:a,setConfig:k,loading:l,saving:m,onSave:n}){let{t:o,language:p}=(0,s.b)();return l?(0,b.jsx)("div",{className:"flex justify-center py-4",children:(0,b.jsx)(c.f,{className:"h-6 w-6 animate-spin text-muted-foreground"})}):(0,b.jsxs)("div",{className:"space-y-4 border rounded-lg p-4 bg-muted/30",children:[(0,b.jsxs)("div",{className:"space-y-2",children:[(0,b.jsx)(e.f,{children:o.settings?.tabs?.ai||"AI Provider"}),(0,b.jsxs)(f.d,{value:a.aiProvider,onValueChange:a=>k(b=>({...b,aiProvider:a})),children:[(0,b.jsx)(f.P,{children:(0,b.jsx)(f.U,{})}),(0,b.jsxs)(f.r,{children:[(0,b.jsx)(f.T,{value:"minimax",children:(0,L.z)("minimax",p)}),(0,b.jsx)(f.T,{value:"minimax-code",children:"MiniMax Code OAuth"}),L.U.filter(a=>"minimax"!==a).map(a=>(0,b.jsx)(f.T,{value:a,children:(0,L.z)(a,p)},a)),(0,b.jsx)(f.T,{value:"anthropic",children:"Anthropic / Compatible"}),(0,b.jsx)(f.T,{value:"azure",children:"Azure OpenAI"}),(0,b.jsx)(f.T,{value:"openai",children:"OpenAI / Compatible"}),(0,b.jsx)(f.T,{value:"gemini",children:"Google Gemini"})]})]}),(0,b.jsx)(K,{provider:a.aiProvider})]}),"openai"===a.aiProvider&&(0,b.jsx)(J,{value:a.openai,onChange:a=>k(b=>({...b,openai:a}))}),"gemini"===a.aiProvider&&(0,b.jsx)(j.f,{value:a.gemini,onChange:a=>k(b=>({...b,gemini:a}))}),"minimax-code"===a.aiProvider&&(0,b.jsx)(C,{value:a.minimaxCode,onChange:a=>k(b=>({...b,minimaxCode:a}))}),"anthropic"===a.aiProvider&&(0,b.jsx)(h.f,{value:a.anthropic,onChange:a=>k(b=>({...b,anthropic:a}))}),(0,L.j)(a.aiProvider)&&(0,b.jsx)(M,{provider:a.aiProvider,value:a[a.aiProvider],onChange:a=>k(b=>({...b,[b.aiProvider]:a}))},a.aiProvider),"azure"===a.aiProvider&&(0,b.jsx)(i.f,{value:a.azure,onChange:a=>k(b=>({...b,azure:a}))}),(0,b.jsx)(g.f,{config:a,saving:m,saveButton:(0,b.jsxs)(d.f,{onClick:n,disabled:m,className:"flex-1",children:[m&&(0,b.jsx)(c.f,{className:"mr-2 h-4 w-4 animate-spin"}),o.settings?.ai?.save||"Save AI Settings"]})})]})}],151304),a.s(["f",0,function(a,b){if(!(0,u.L)(a.timeZone??u.J))return b.settings.general.invalidTimeZone;if("openai"===a.aiProvider)for(let c of a.openai?.instances||[]){if(!c.name?.trim())return b.settings?.ai?.validationNameRequired||"Instance name is required";if(!c.apiKey?.trim())return b.settings?.ai?.validationApiKeyRequired||"API Key is required";if(!c.baseUrl?.trim())return b.settings?.ai?.validationBaseUrlRequired||"Base URL is required";if(!c.model?.trim())return b.settings?.ai?.validationModelRequired||"Model name is required"}if("azure"===a.aiProvider){if(!a.azure?.endpoint?.trim())return b.settings?.ai?.validationAzureEndpointRequired||"Azure Endpoint is required";if(!a.azure?.deploymentName?.trim())return b.settings?.ai?.validationAzureDeploymentRequired||"Deployment Name is required";if(!a.azure?.apiKey?.trim())return b.settings?.ai?.validationApiKeyRequired||"API Key is required"}return null}],439830)},492710,175592,676330,148463,612416,340898,474896,a=>{var b=a.i(187924),c=a.i(866718),d=a.i(152679),e=a.i(870430),f=a.i(572131),g=a.i(699570),h=a.i(580701),i=a.i(168370),j=a.i(519783),k=a.i(875160),l=a.i(291938),m=a.i(550194),n=a.i(190622),o=a.i(630534);function p({provider:a,apiKey:d,baseUrl:q,currentModel:r,onModelChange:s,docsHref:t}){let{t:u}=(0,m.b)(),[v,w]=(0,f.useState)([]),[x,y]=(0,f.useState)(!1),[z,A]=(0,f.useState)(null),[B,C]=(0,f.useState)(r||""),[D,E]=(0,f.useState)(!1),[F,G]=(0,f.useState)(r);r!==F&&(G(r),C(r||""));let H=async()=>{if(!d)return void A(u.modelSelector?.enterApiKeyFirst||"Please enter API Key first");y(!0),A(null);try{let b=await l.f.post("/api/ai/models",{provider:a,apiKey:d,...q&&{baseUrl:q}});if("error"in b&&"string"==typeof b.error){A(b.error),E(!0),w([]);return}w(b.models),0===b.models.length&&(A(u.modelSelector?.noVisionModel||"No vision model found, please enter manually"),E(!0))}catch(b){o.f.error("[ModelSelector]","Failed to fetch models",{error:b});let a=b instanceof Error&&b.message||u.modelSelector?.fetchFailed||"Failed to fetch models";A(a+(u.modelSelector?.enterManually||", please enter manually")),E(!0)}finally{y(!1)}};return(0,b.jsxs)("div",{className:"space-y-2",children:[(0,b.jsxs)("div",{className:"flex items-center gap-2",children:[(0,b.jsx)(e.f,{className:"flex-1",children:u.modelSelector?.modelName||"Model Name"}),t&&(0,b.jsxs)("a",{href:t,target:"_blank",rel:"noopener noreferrer",className:"inline-flex shrink-0 items-center gap-1 text-xs text-muted-foreground underline",children:[u.settings.ai.docLinks.models,(0,b.jsx)(i.f,{className:"h-3 w-3"})]}),(0,b.jsx)(g.f,{type:"button",variant:"outline",size:"sm",onClick:H,disabled:x||!d,children:x?(0,b.jsx)(k.f,{className:"h-3 w-3 animate-spin"}):(0,b.jsx)(j.f,{className:"h-3 w-3"})})]}),z&&(0,b.jsx)("p",{className:"text-xs text-yellow-600",children:z}),D||0===v.length?(0,b.jsxs)("div",{className:"space-y-2",children:[(0,b.jsx)(c.f,{value:B,onChange:a=>{var b;C(b=a.target.value),s(b)},placeholder:(0,n.j)(a)?n.$[a].model:"openai"===a?"gpt-6.1-sol":"gemini-1.5-flash"}),v.length>0&&(0,b.jsx)(g.f,{type:"button",variant:"link",size:"sm",className:"h-auto p-0 text-xs",onClick:()=>E(!1),children:u.modelSelector?.selectFromList||"Select from List"})]}):(0,b.jsx)("div",{className:"space-y-2",children:(0,b.jsxs)(h.d,{value:r,onValueChange:a=>{"_custom"===a?E(!0):(E(!1),C(a),s(a))},children:[(0,b.jsx)(h.P,{children:(0,b.jsx)(h.U,{placeholder:u.modelSelector?.selectModel||"Select Model"})}),(0,b.jsxs)(h.r,{children:[v.map(a=>(0,b.jsxs)(h.T,{value:a.id,children:[a.name,a.owned_by&&` (${a.owned_by})`]},a.id)),(0,b.jsx)(h.T,{value:"_custom",children:u.modelSelector?.customInput||"Custom Input..."})]})]})})]})}function q({label:a,href:c,linkText:d}){return c?(0,b.jsxs)("div",{className:"flex items-center justify-between gap-2",children:[(0,b.jsx)(e.f,{children:a}),(0,b.jsxs)("a",{href:c,target:"_blank",rel:"noopener noreferrer",className:"inline-flex shrink-0 items-center gap-1 text-xs text-muted-foreground underline",children:[d,(0,b.jsx)(i.f,{className:"h-3 w-3"})]})]}):(0,b.jsx)(e.f,{children:a})}a.s(["f",0,p],175592),a.s(["f",0,q],676330);let r={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 s(a){return(0,n.j)(a)?n.$[a].docs:r[a]??null}a.s(["f",0,s],148463),a.s(["f",0,function({value:a,onChange:f}){let{t:g}=(0,m.b)(),h=s("anthropic"),i=(b,c)=>f({...a,[b]:c});return(0,b.jsxs)("div",{className:"space-y-3 animate-in fade-in slide-in-from-top-2",children:[(0,b.jsxs)("div",{className:"space-y-2",children:[(0,b.jsx)(q,{label:"API Key",href:h?.apiKey,linkText:g.settings.ai.docLinks.apiKey}),(0,b.jsx)(d.f,{value:a?.apiKey||"",onChange:a=>i("apiKey",a.target.value),placeholder:"sk-ant-..."})]}),(0,b.jsxs)("div",{className:"space-y-2",children:[(0,b.jsx)(e.f,{children:"Base URL (Optional)"}),(0,b.jsx)(c.f,{value:a?.baseUrl||"",onChange:a=>i("baseUrl",a.target.value),placeholder:"https://api.anthropic.com"}),(0,b.jsx)("p",{className:"text-xs text-muted-foreground",children:g.settings?.ai?.anthropicBaseUrlHint})]}),(0,b.jsx)(p,{provider:"anthropic",apiKey:a?.apiKey,baseUrl:a?.baseUrl,currentModel:a?.model,onModelChange:a=>i("model",a),docsHref:h?.models})]})}],492710),a.s(["f",0,function({value:a,onChange:f}){let{t:g}=(0,m.b)(),h=s("azure"),i=(b,c)=>f({...a,[b]:c}),j=a=>a?.trim()?"":"border-destructive";return(0,b.jsxs)("div",{className:"space-y-3 animate-in fade-in slide-in-from-top-2",children:[(0,b.jsxs)("div",{className:"space-y-2",children:[(0,b.jsxs)(e.f,{children:[g.settings?.ai?.azureEndpoint||"Azure Endpoint"," ",(0,b.jsx)("span",{className:"text-destructive",children:"*"})]}),(0,b.jsx)(c.f,{value:a?.endpoint||"",onChange:a=>i("endpoint",a.target.value),placeholder:g.settings?.ai?.azureEndpointPlaceholder||"https://your-resource.openai.azure.com",className:j(a?.endpoint)})]}),(0,b.jsxs)("div",{className:"space-y-2",children:[(0,b.jsx)(q,{label:(0,b.jsxs)(b.Fragment,{children:[g.settings?.ai?.azureDeployment||"Deployment Name"," ",(0,b.jsx)("span",{className:"text-destructive",children:"*"})]}),href:h?.models,linkText:g.settings.ai.docLinks.models}),(0,b.jsx)(c.f,{value:a?.deploymentName||"",onChange:a=>i("deploymentName",a.target.value),placeholder:g.settings?.ai?.azureDeploymentPlaceholder||"gpt-4o-deployment",className:j(a?.deploymentName)})]}),(0,b.jsxs)("div",{className:"space-y-2",children:[(0,b.jsx)(q,{label:(0,b.jsxs)(b.Fragment,{children:["API Key ",(0,b.jsx)("span",{className:"text-destructive",children:"*"})]}),href:h?.apiKey,linkText:g.settings.ai.docLinks.apiKey}),(0,b.jsx)(d.f,{value:a?.apiKey||"",onChange:a=>i("apiKey",a.target.value),placeholder:"xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",className:j(a?.apiKey)})]}),(0,b.jsxs)("div",{className:"space-y-2",children:[(0,b.jsx)(e.f,{children:g.settings?.ai?.azureApiVersion||"API Version"}),(0,b.jsx)(c.f,{value:a?.apiVersion||"",onChange:a=>i("apiVersion",a.target.value),placeholder:g.settings?.ai?.azureApiVersionPlaceholder||"2024-02-15-preview"})]}),(0,b.jsxs)("div",{className:"space-y-2",children:[(0,b.jsx)(e.f,{children:g.settings?.ai?.azureModel||"Model Display Name"}),(0,b.jsx)(c.f,{value:a?.model||"",onChange:a=>i("model",a.target.value),placeholder:"gpt-4o"})]})]})}],612416),a.s(["f",0,function({value:a,onChange:f}){let{t:g}=(0,m.b)(),h=s("gemini"),i=(b,c)=>f({...a,[b]:c});return(0,b.jsxs)("div",{className:"space-y-3 animate-in fade-in slide-in-from-top-2",children:[(0,b.jsxs)("div",{className:"space-y-2",children:[(0,b.jsx)(q,{label:"API Key",href:h?.apiKey,linkText:g.settings.ai.docLinks.apiKey}),(0,b.jsx)(d.f,{value:a?.apiKey||"",onChange:a=>i("apiKey",a.target.value),placeholder:"AIza..."})]}),(0,b.jsxs)("div",{className:"space-y-2",children:[(0,b.jsx)(e.f,{children:"Base URL (Optional)"}),(0,b.jsx)(c.f,{value:a?.baseUrl||"",onChange:a=>i("baseUrl",a.target.value),placeholder:"https://generativelanguage.googleapis.com"})]}),(0,b.jsx)(p,{provider:"gemini",apiKey:a?.apiKey,baseUrl:a?.baseUrl,currentModel:a?.model,onModelChange:a=>i("model",a),docsHref:h?.models})]})}],340898);var t=a.i(164831);let u={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"}]]};u.node;let v=(0,t.f)(u);a.s(["f",0,v],474896)},152679,a=>{var b=a.i(187924),c=a.i(572131),d=a.i(755681),e=a.i(777064),f=a.i(699570),g=a.i(866718),h=a.i(550194),i=a.i(368114);a.s(["f",0,function({className:a,...j}){let{t:k}=(0,h.b)(),[l,m]=(0,c.useState)(!1);return(0,b.jsxs)("div",{className:"relative",children:[(0,b.jsx)(g.f,{type:l?"text":"password",className:(0,i.f)("pr-10",a),...j}),(0,b.jsx)(f.f,{type:"button",variant:"ghost",size:"icon",className:"absolute right-0 top-0 h-full px-3 py-2 hover:bg-transparent",onClick:()=>m(!l),"aria-label":l?k.common.hidePassword:k.common.showPassword,tabIndex:-1,children:l?(0,b.jsx)(e.f,{className:"h-4 w-4 text-muted-foreground"}):(0,b.jsx)(d.f,{className:"h-4 w-4 text-muted-foreground"})})]})}])}]})();
|
|
1
|
+
(()=>{"use strict";module.exports=[557230,563658,a=>{var b=a.i(164831);let c={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"}]]};c.node;let d=(0,b.f)(c);a.s(["f",0,d],557230);var e=a.i(187924),f=a.i(572131),g=a.i(507554),h=a.i(470121),i=a.i(750104),j=a.i(225152),k=a.i(3688),l=a.i(30553),m=Object.defineProperty,n=(a,b)=>m(a,"name",{value:b,configurable:!0}),o="Switch",[p,q]=(0,i.f)(o),[r,s]=p(o);function t(a){let{__scopeSwitch:b,checked:c,children:d,defaultChecked:g,disabled:h,form:i,name:k,onCheckedChange:l,required:m,value:n="on",internal_do_not_use_render:p}=a,[q,s]=(0,j.f)({prop:c,defaultProp:g??!1,onChange:l,caller:o}),[t,u]=f.useState(null),[v,w]=f.useState(null),[x,z]=f.useState(null),A=!t||!!i||!!t.closest("form"),B={checked:q,setChecked:s,disabled:h,control:t,setControl:u,name:k,form:i,value:n,userClick:x,onUserClick:z,required:m,defaultChecked:g,isFormControl:A,bubbleInput:v,setBubbleInput:w};return(0,e.jsx)(r,{scope:b,...B,children:y(p)?p(B):d})}n(t,"SwitchProvider");var u=f.forwardRef(n(function({__scopeSwitch:a,onClick:b,...c},d){let{control:i,form:j,value:k,disabled:m,checked:o,required:p,setControl:q,setChecked:r,onUserClick:t,isFormControl:u,bubbleInput:v}=s("SwitchTrigger",a),w=(0,h.f)(d,q),x=f.useRef(o);return f.useEffect(()=>{let a=j?i?.ownerDocument.getElementById(j):i?.form;if(a instanceof HTMLFormElement){let b=n(()=>r(x.current),"reset");return a.addEventListener("reset",b),()=>a.removeEventListener("reset",b)}},[i,j,r]),(0,e.jsx)(l.V.button,{type:"button",role:"switch","aria-checked":o,"aria-required":p,"data-state":z(o),"data-disabled":m?"":void 0,disabled:m,value:k,...c,ref:w,onClick:(0,g.f)(b,a=>{let b=a.isPropagationStopped();t({requestedChecked:!o,hasConsumerStoppedPropagation:b}),r(a=>!a),v&&u&&!b&&a.stopPropagation()})})},"SwitchTrigger")),v=f.forwardRef(n(function(a,b){let{__scopeSwitch:c,name:d,checked:f,defaultChecked:g,required:h,disabled:i,value:j,onCheckedChange:k,form:l,...m}=a;return(0,e.jsx)(t,{__scopeSwitch:c,checked:f,defaultChecked:g,disabled:i,required:h,onCheckedChange:k,name:d,form:l,value:j,internal_do_not_use_render:({isFormControl:a})=>(0,e.jsxs)(e.Fragment,{children:[(0,e.jsx)(u,{...m,ref:b,__scopeSwitch:c}),a&&(0,e.jsx)(x,{__scopeSwitch:c})]})})},"Switch")),w=f.forwardRef(n(function(a,b){let{__scopeSwitch:c,...d}=a,f=s("SwitchThumb",c);return(0,e.jsx)(l.V.span,{"data-state":z(f.checked),"data-disabled":f.disabled?"":void 0,...d,ref:b})},"SwitchThumb")),x=f.forwardRef(n(function({__scopeSwitch:a,onClick:b,...c},d){let{control:i,userClick:j,checked:m,defaultChecked:n,required:o,disabled:p,name:q,value:r,form:t,bubbleInput:u,setBubbleInput:v}=s("SwitchBubbleInput",a),w=(0,h.f)(d,v),x=(0,k.f)(i),y=f.useRef(!1),z=f.useRef(m),A=f.useRef(j),B=f.useRef(null);f.useEffect(()=>{if(!u)return;let a=Object.getOwnPropertyDescriptor(window.HTMLInputElement.prototype,"checked").set;if(!a)return;let b=z.current!==m;z.current=m;let c=null!==j&&j!==A.current;if(A.current=j,c)B.current=b?null:j,b&&a.call(u,m),u.dispatchEvent(new Event("click",{bubbles:!j.hasConsumerStoppedPropagation}));else if(b){let b=B.current;B.current=null;let c=b?.requestedChecked===m;y.current=!0,a.call(u,m),u.dispatchEvent(new Event("click",{bubbles:!(c&&b.hasConsumerStoppedPropagation)})),y.current=!1}},[u,m,j]);let C=f.useRef(m);return(0,e.jsx)(l.V.input,{type:"checkbox","aria-hidden":!0,defaultChecked:n??C.current,required:o,disabled:p,name:q,value:r,form:t,...c,tabIndex:-1,ref:w,onClick:(0,g.f)(b,a=>{y.current&&a.stopPropagation()}),style:{...c.style,...x,position:"absolute",pointerEvents:"none",opacity:0,margin:0,transform:"translateX(-100%)"}})},"SwitchBubbleInput"));function y(a){return"function"==typeof a}function z(a){return a?"checked":"unchecked"}n(y,"isFunction"),n(z,"getState");var A=a.i(368114);let B=f.forwardRef(({className:a,...b},c)=>(0,e.jsx)(v,{className:(0,A.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",a),...b,ref:c,children:(0,e.jsx)(w,{className:(0,A.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")})}));B.displayName=v.displayName,a.s(["f",0,B],563658)},144952,613412,206194,190622,a=>{var b=a.i(187924),c=a.i(572131),d=a.i(164831);let e={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"]};e.node;let f=(0,d.f)(e);a.s(["f",0,f],613412);var g=a.i(875160),h=a.i(211134);let i={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"}]]};i.node;let j=(0,d.f)(i);var k=a.i(699570),l=a.i(550194);function m({detail:a}){let{t:c}=(0,l.b)();return a?(0,b.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,b.jsx)("span",{className:"font-sans text-muted-foreground",children:c.settings.ai.providerErrorDetail}),a]}):null}a.s(["f",0,m],206194);let n={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"}}},o=Object.keys(n);function p(a){return"string"==typeof a&&Object.prototype.hasOwnProperty.call(n,a)}a.s(["$",0,n,"U",0,o,"z",0,function(a,b){let c=n[a];return"zh"===b?c.name:c.nameEn},"j",0,p,"k",0,function(a,b){let c=n[a];return{apiKey:b?.apiKey||"",baseUrl:b?.baseUrl||c.baseUrl,model:b?.model||c.model}}],190622);var q=a.i(291938),r=a.i(960927),s=a.i(630534);a.s(["f",0,function({config:a,saving:d,saveButton:e}){let{t:i,language:n}=(0,l.b)(),[o,t]=(0,c.useState)(!1),[u,v]=(0,c.useState)(null),w=a=>i.settings?.ai?.errors?.[a]||a.replace("UNKNOWN:",""),x=async()=>{let b=function(a,b){let c=a.aiProvider;if("openai"===c){let d=a.openai?.instances?.find(b=>b.id===a.openai?.activeInstanceId);return d?.apiKey?{ok:!0,body:{provider:c,apiKey:d.apiKey,baseUrl:d.baseUrl,model:d.model,language:b}}:{ok:!1,error:"API_KEY_REQUIRED"}}if("azure"===c){let d=a.azure;return d?.apiKey&&d.endpoint&&d.deploymentName?{ok:!0,body:{provider:c,apiKey:d.apiKey,endpoint:d.endpoint,deploymentName:d.deploymentName,apiVersion:d.apiVersion,model:d.model,language:b}}:{ok:!1,error:"AZURE_CONFIG_INCOMPLETE"}}if("minimax-code"===c)return{ok:!0,body:{provider:c,model:a.minimaxCode?.model,language:b}};if("gemini"===c||"anthropic"===c||p(c)){let d=a[c];return d?.apiKey?{ok:!0,body:{provider:c,apiKey:d.apiKey,baseUrl:d.baseUrl,model:d.model,language:b}}:{ok:!1,error:"API_KEY_REQUIRED"}}return{ok:!1,error:"UNSUPPORTED_PROVIDER"}}(a,n);if(!b.ok){if("UNSUPPORTED_PROVIDER"===b.error)return;v({success:!1,textSupport:!1,visionSupport:!1,textError:"AZURE_CONFIG_INCOMPLETE"===b.error?i.settings?.ai?.validationAzureEndpointRequired||"Azure config is incomplete":i.settings?.ai?.validationApiKeyRequired||"API Key is required"});return}t(!0),v(null);try{v(await q.f.post("/api/ai/test",b.body))}catch(a){s.V.error("[AiConnectionTest]","AI connection test failed",{error:a}),v({success:!1,textSupport:!1,visionSupport:!1,textError:(0,r.Z)(a)})}finally{t(!1)}};return(0,b.jsxs)("div",{className:"space-y-3 pt-3 border-t",children:[(0,b.jsxs)("div",{className:"flex gap-2",children:[(0,b.jsxs)(k.f,{type:"button",variant:"outline",onClick:x,disabled:o||d,className:"flex-1",children:[o?(0,b.jsx)(g.f,{className:"mr-2 h-4 w-4 animate-spin"}):(0,b.jsx)(j,{className:"mr-2 h-4 w-4"}),o?i.settings?.ai?.testing||"Testing...":i.settings?.ai?.testConnection||"Test Connection"]}),e]}),u&&(0,b.jsxs)("div",{className:`p-3 rounded-md text-sm ${u.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,b.jsx)("div",{className:"flex items-center gap-2 font-medium mb-2",children:u.success?(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)(f,{className:"h-4 w-4 text-green-600"}),(0,b.jsx)("span",{className:"text-green-700 dark:text-green-300",children:i.settings?.ai?.testSuccess||"Connection Successful"}),u.modelInfo&&(0,b.jsxs)("span",{className:"text-green-600 text-xs",children:["(",u.modelInfo,")"]})]}):(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)(h.f,{className:"h-4 w-4 text-red-600"}),(0,b.jsx)("span",{className:"text-red-700 dark:text-red-300",children:i.settings?.ai?.testFailed||"Connection Failed"})]})}),u.success&&(0,b.jsxs)("div",{className:"space-y-1 text-xs",children:[(0,b.jsxs)("div",{className:"flex items-center gap-2",children:[(0,b.jsxs)("span",{className:"text-muted-foreground",children:[i.settings?.ai?.textSupport||"Text Generation",":"]}),(0,b.jsxs)("span",{className:"text-green-600",children:["✓ ",i.settings?.ai?.supported||"Supported"]})]}),(0,b.jsxs)("div",{className:"flex items-center gap-2",children:[(0,b.jsxs)("span",{className:"text-muted-foreground",children:[i.settings?.ai?.visionSupport||"Vision/Multimodal",":"]}),u.visionSupport?(0,b.jsxs)("span",{className:"text-green-600",children:["✓ ",i.settings?.ai?.supported||"Supported"]}):(0,b.jsxs)("span",{className:"text-amber-600",children:["✗ ",u.visionError?w(u.visionError):i.settings?.ai?.notSupported||"Not Supported"]})]}),!u.visionSupport&&(0,b.jsx)(m,{detail:u.visionErrorDetail}),(0,b.jsx)("p",{className:"text-muted-foreground/60 text-[10px] pl-1",children:i.settings?.ai?.testNetworkNote})]}),!u.success&&u.textError&&(0,b.jsx)("p",{className:"text-red-600 text-xs mt-1",children:w(u.textError)}),!u.success&&(0,b.jsx)(m,{detail:u.textErrorDetail})]})]})}],144952)},151304,439830,a=>{var b=a.i(187924),c=a.i(875160),d=a.i(699570),e=a.i(870430),f=a.i(580701),g=a.i(144952),h=a.i(492710),i=a.i(612416),j=a.i(340898),k=a.i(168370),l=a.i(474896),m=a.i(557230),n=a.i(519783),o=a.i(786304),p=a.i(866718),q=a.i(895605),r=a.i(563658),s=a.i(550194),t=a.i(529759),u=a.i(986705);function v({checkin:a,autoCheckin:f,onAutoCheckinChange:g,busy:h,onCheckin:i}){let j,{t:k}=(0,s.b)(),{timeZone:l}=(0,t.M)(),m=k.settings?.ai?.minimaxCode,{today:n,last:p}=a,w=p&&"failed"!==p.status?p:null,x=!!(n?.checkedToday||w),y=String(w?.points??(n?n.points+n.bonusPoints:0)),z=String(w?.streakDays??n?.streakDays??0);return j=w?.trigger==="auto"&&"checked-in"===w.status?(m?.checkinAuto||"Checked in automatically today at {time} (+{points} credits, day {days} in a row)").replace("{time}",(0,u.r)(w.at,"HH:mm",l)).replace("{points}",y).replace("{days}",z):x?(m?.checkinDone||"Checked in today (+{points} credits, day {days} in a row)").replace("{points}",y).replace("{days}",z):p?.status==="failed"?(m?.checkinFailed||"Check-in failed: {error}").replace("{error}",p.error||""):a.autoCheckin?m?.checkinWillAuto||"Not checked in yet today. The app will check in automatically within the hour.":m?.checkinNotYet||"Not checked in yet today",(0,b.jsxs)("div",{className:"space-y-3 border-t pt-3",children:[(0,b.jsxs)("div",{className:"flex flex-wrap items-center justify-between gap-2 text-sm",children:[(0,b.jsxs)("div",{className:"flex min-w-0 items-center gap-2",children:[(0,b.jsx)("span",{className:"text-muted-foreground",children:m?.checkinToday||"Today's check-in"}),(0,b.jsxs)(o.f,{variant:x?"default":p?.status==="failed"?"destructive":"secondary",children:[(0,b.jsx)(q.f,{className:"mr-1 h-3 w-3"}),x?m?.checkinSuccess||"Checked in":m?.checkinNotYet||"Not yet"]})]}),!x&&(0,b.jsxs)(d.f,{size:"sm",variant:"outline",onClick:i,disabled:h,children:[h&&(0,b.jsx)(c.f,{className:"mr-2 h-4 w-4 animate-spin"}),m?.checkinNow||"Check in now"]})]}),(0,b.jsx)("p",{className:"text-xs text-muted-foreground break-words",children:j}),(0,b.jsxs)("div",{className:"flex items-start justify-between gap-3",children:[(0,b.jsxs)("div",{className:"space-y-1",children:[(0,b.jsx)(e.f,{htmlFor:"minimax-code-auto-checkin",children:m?.autoCheckin||"Daily auto check-in"}),(0,b.jsx)("p",{className:"text-xs text-muted-foreground",children:m?.autoCheckinHint})]}),(0,b.jsx)(r.f,{id:"minimax-code-auto-checkin",checked:f,onCheckedChange:g})]})]})}let w=["MiniMax-M3.1-Flash","MiniMax-M3","MiniMax-M2.7-highspeed","MiniMax-M2.7"];var x=a.i(572131),y=a.i(291938),z=a.i(960927),A=a.i(710302),B=a.i(630534);function C({value:a,onChange:f}){let{t:g}=(0,s.b)(),h=g.settings?.ai?.minimaxCode,{status:i,loading:j,pending:q,busy:r,refresh:t,login:u,logout:D,checkin:E}=function(){let{t:a}=(0,s.b)(),b=a.settings?.ai?.minimaxCode,[c,d]=(0,x.useState)(null),[e,f]=(0,x.useState)(!0),[g,h]=(0,x.useState)(null),[i,j]=(0,x.useState)(!1),k=(0,x.useRef)(null),l=(0,x.useCallback)(async()=>{f(!0);try{let a=await y.f.get("/api/minimax-code");d(a),a.pendingLogin&&h(a.pendingLogin)}catch(a){B.V.error("[MiniMaxCode]","Failed to load status",{error:a})}finally{f(!1)}},[]);(0,x.useEffect)(()=>{l()},[l]),(0,x.useEffect)(()=>{if(!g)return;let a=!1,c=async()=>{try{let d=await y.f.get("/api/minimax-code/login");if(a)return;if("pending"===d.status){k.current=setTimeout(c,g.intervalMs);return}h(null),"ok"===d.status?A.c.success(b?.loginSuccess||"Signed in"):"expired"===d.status?A.c.error(b?.loginExpired||"Authorization timed out"):"denied"===d.status&&A.c.error(b?.loginDenied||"Authorization declined"),l()}catch(c){if(a)return;h(null),A.c.error(`${b?.loginFailed||"Sign-in failed"}: ${(0,z.Z)(c)}`)}};return k.current=setTimeout(c,g.intervalMs),()=>{a=!0,k.current&&clearTimeout(k.current)}},[g,l,b]);let m=async()=>{j(!0);try{await y.f.delete("/api/minimax-code"),h(null),await l()}catch(a){A.c.error((0,z.Z)(a))}finally{j(!1)}},n=async()=>{j(!0);try{let a=await y.f.post("/api/minimax-code/checkin",{});"failed"===a.status?A.c.error((b?.checkinFailed||"Check-in failed: {error}").replace("{error}",a.error||"")):A.c.success(b?.checkinSuccess||"Checked in"),await l()}catch(a){A.c.error((0,z.Z)(a))}finally{j(!1)}};return{status:c,loading:e,pending:g,busy:i,refresh:l,login:async()=>{j(!0);try{let a=await y.f.post("/api/minimax-code/login",{});h(a),window.open(a.url,"_blank","noopener,noreferrer")}catch(a){A.c.error(`${b?.loginFailed||"Sign-in failed"}: ${(0,z.Z)(a)}`)}finally{j(!1)}},logout:m,checkin:n}}(),F=i?.login??"none",G=i?.account,H=i?.credits,I={none:h?.statusNone||"Not signed in",active:h?.statusActive||"Signed in",expired:h?.statusExpired||"Login expired"}[F];return(0,b.jsxs)("div",{className:"space-y-3 animate-in fade-in slide-in-from-top-2",children:[(0,b.jsx)("p",{className:"text-xs text-muted-foreground",children:h?.intro}),(0,b.jsxs)("section",{className:"space-y-3 rounded-md border bg-background p-3","aria-label":h?.title||"MiniMax Code account",children:[(0,b.jsxs)("div",{className:"flex items-center justify-between gap-2",children:[(0,b.jsx)("h4",{className:"text-sm font-medium",children:h?.title||"MiniMax Code account"}),(0,b.jsx)(d.f,{variant:"ghost",size:"sm",onClick:()=>void t(),disabled:j,"aria-label":h?.refresh||"Refresh",children:(0,b.jsx)(n.f,{className:`h-4 w-4 ${j?"animate-spin":""}`})})]}),(0,b.jsxs)("dl",{className:"grid grid-cols-[auto_1fr] gap-x-4 gap-y-2 text-sm",children:[(0,b.jsx)("dt",{className:"text-muted-foreground",children:h?.loginStatus||"Login status"}),(0,b.jsxs)("dd",{className:"flex min-w-0 flex-wrap items-center gap-2",children:[(0,b.jsx)(o.f,{variant:"active"===F?"default":"expired"===F?"destructive":"secondary",children:I}),G&&(0,b.jsx)("span",{className:"truncate text-muted-foreground",children:G.name||G.email||G.userId})]}),"active"===F&&(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)("dt",{className:"text-muted-foreground",children:h?.credits||"Remaining credits"}),(0,b.jsx)("dd",{children:H?(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)("span",{className:"font-medium tabular-nums",children:H.total}),(0,b.jsx)("span",{className:"ml-2 text-xs text-muted-foreground",children:(h?.creditsDetail||"Free {free} · Purchased {purchased}").replace("{free}",String(H.free)).replace("{purchased}",String(H.purchased))})]}):(0,b.jsx)("span",{className:"text-muted-foreground",children:h?.creditsUnavailable||"Unavailable"})})]})]}),"active"===F&&i&&(0,b.jsx)(v,{checkin:i.checkin,autoCheckin:a?.autoCheckin!==!1,onAutoCheckinChange:b=>f({...a,autoCheckin:b}),busy:r,onCheckin:()=>void E()}),q?(0,b.jsxs)("div",{className:"space-y-1 rounded-md bg-muted/50 p-3 text-sm",children:[(0,b.jsxs)("p",{className:"flex items-center gap-2",children:[(0,b.jsx)(c.f,{className:"h-4 w-4 animate-spin"}),h?.waiting]}),q.userCode&&(0,b.jsxs)("p",{children:[h?.userCode||"Verification code",": ",(0,b.jsx)("span",{className:"font-mono font-medium",children:q.userCode})]}),(0,b.jsxs)("a",{href:q.url,target:"_blank",rel:"noopener noreferrer",className:"inline-flex items-center gap-1 underline",children:[h?.openLink||"Open the authorization page"," ",(0,b.jsx)(k.f,{className:"h-3 w-3"})]})]}):(0,b.jsxs)("div",{className:"flex flex-wrap gap-2",children:[(0,b.jsxs)(d.f,{size:"sm",onClick:()=>void u(),disabled:r,children:[r?(0,b.jsx)(c.f,{className:"mr-2 h-4 w-4 animate-spin"}):(0,b.jsx)(l.f,{className:"mr-2 h-4 w-4"}),"none"===F?h?.login||"Sign in with browser":h?.relogin||"Sign in again"]}),"none"!==F&&(0,b.jsxs)(d.f,{size:"sm",variant:"outline",onClick:()=>void D(),disabled:r,children:[(0,b.jsx)(m.f,{className:"mr-2 h-4 w-4"}),h?.logout||"Sign out"]})]})]}),(0,b.jsxs)("div",{className:"space-y-2",children:[(0,b.jsx)(e.f,{htmlFor:"minimax-code-model",children:h?.model||"Model"}),(0,b.jsx)(p.f,{id:"minimax-code-model",list:"minimax-code-models",value:a?.model||"",onChange:b=>f({...a,model:b.target.value}),placeholder:"MiniMax-M3.1-Flash"}),(0,b.jsx)("datalist",{id:"minimax-code-models",children:w.map(a=>(0,b.jsx)("option",{value:a},a))}),(0,b.jsx)("p",{className:"text-xs text-muted-foreground",children:h?.modelHint})]}),(0,b.jsx)("p",{className:"text-xs text-muted-foreground",children:h?.risk})]})}var D=a.i(403512),E=a.i(951675),F=a.i(175592),G=a.i(676330),H=a.i(152679),I=a.i(148463);function J({value:a,onChange:c}){let{t:g}=(0,s.b)(),h=(0,I.f)("openai"),i=a?.instances||[],j=a?.activeInstanceId,k=i.find(a=>a.id===j),l=(b,d)=>{c({...a,instances:i.map(a=>a.id===j?{...a,[b]:d}:a)})},m=async()=>{if(!j||!await (0,A.u)(g.settings?.ai?.confirmDelete||"Delete this instance?",{destructive:!0}))return;let a=i.filter(a=>a.id!==j);c({instances:a,activeInstanceId:a[0]?.id})};return(0,b.jsxs)("div",{className:"space-y-3 animate-in fade-in slide-in-from-top-2",children:[(0,b.jsxs)("div",{className:"space-y-2",children:[(0,b.jsxs)("div",{className:"flex items-center justify-between",children:[(0,b.jsx)(e.f,{children:g.settings?.ai?.instances||"Instance"}),(0,b.jsxs)(d.f,{type:"button",variant:"outline",size:"sm",onClick:()=>{if(i.length>=10)return;let a={id:"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,a=>{let b=16*Math.random()|0;return("x"===a?b:3&b|8).toString(16)}),name:`Instance ${i.length+1}`,apiKey:"",baseUrl:"https://api.openai.com/v1",model:"gpt-6.1-sol"};c({instances:[...i,a],activeInstanceId:a.id})},disabled:i.length>=10,className:"h-7 px-2 text-xs",children:[(0,b.jsx)(D.f,{className:"h-3 w-3 mr-1"}),g.settings?.ai?.addInstance||"Add"]})]}),i.length>0?(0,b.jsxs)("div",{className:"flex gap-2",children:[(0,b.jsxs)(f.d,{value:j||"",onValueChange:b=>c({...a,activeInstanceId:b}),children:[(0,b.jsx)(f.P,{className:"flex-1",children:(0,b.jsx)(f.U,{placeholder:g.settings?.ai?.selectInstance||"Select Instance"})}),(0,b.jsx)(f.r,{children:i.map(a=>(0,b.jsx)(f.T,{value:a.id,children:a.name},a.id))})]}),i.length>1&&(0,b.jsx)(d.f,{type:"button",variant:"outline",size:"icon",onClick:m,className:"h-10 w-10 text-destructive hover:text-destructive",children:(0,b.jsx)(E.f,{className:"h-4 w-4"})})]}):(0,b.jsx)("p",{className:"text-sm text-muted-foreground",children:g.settings?.ai?.noInstances||"No instances configured. Click 'Add' to create one."}),i.length>=10&&(0,b.jsx)("p",{className:"text-xs text-amber-600",children:g.settings?.ai?.maxInstancesReached||"Maximum instances reached (10)"})]}),k&&(0,b.jsxs)("div",{className:"space-y-3 p-3 border rounded-md bg-background",children:[(0,b.jsxs)("div",{className:"space-y-2",children:[(0,b.jsxs)(e.f,{children:[g.settings?.ai?.instanceName||"Instance Name"," ",(0,b.jsx)("span",{className:"text-destructive",children:"*"})]}),(0,b.jsx)(p.f,{value:k.name||"",onChange:a=>l("name",a.target.value),placeholder:"e.g. GLM-4V",className:k.name?.trim()?"":"border-destructive"})]}),(0,b.jsxs)("div",{className:"space-y-2",children:[(0,b.jsx)(G.f,{label:(0,b.jsxs)(b.Fragment,{children:["API Key ",(0,b.jsx)("span",{className:"text-destructive",children:"*"})]}),href:h?.apiKey,linkText:g.settings.ai.docLinks.apiKey}),(0,b.jsx)(H.f,{value:k.apiKey||"",onChange:a=>l("apiKey",a.target.value),placeholder:"sk-...",className:k.apiKey?.trim()?"":"border-destructive"})]}),(0,b.jsxs)("div",{className:"space-y-2 pt-4 border-t",children:[(0,b.jsxs)(e.f,{children:["Base URL ",(0,b.jsx)("span",{className:"text-destructive",children:"*"})]}),(0,b.jsx)(p.f,{value:k.baseUrl||"",onChange:a=>l("baseUrl",a.target.value),placeholder:"https://api.openai.com/v1",className:k.baseUrl?.trim()?"":"border-destructive"})]}),(0,b.jsx)(F.f,{provider:"openai",apiKey:k.apiKey,baseUrl:k.baseUrl,currentModel:k.model,onModelChange:a=>l("model",a),docsHref:h?.models})]})]})}function K({provider:a}){let{t:c}=(0,s.b)(),d=c.settings.ai.providerDocs,e=(0,I.f)(a);if(!e)return null;let f=[e.cn&&{href:e.cn,label:e.intl?d.cn:d.official},e.intl&&{href:e.intl,label:e.cn?d.intl:d.official}].filter(a=>!!a);return(0,b.jsxs)("p",{className:"flex flex-wrap items-center gap-x-3 gap-y-1 text-xs text-muted-foreground",children:[(0,b.jsx)("span",{children:d.title}),f.map(a=>(0,b.jsxs)("a",{href:a.href,target:"_blank",rel:"noopener noreferrer",className:"inline-flex items-center gap-1 underline",children:[a.label,(0,b.jsx)(k.f,{className:"h-3 w-3"})]},a.href))]})}var L=a.i(190622);function M({provider:a,value:c,onChange:d}){let{t:f}=(0,s.b)(),g=L.$[a],h=(a,b)=>d({...c,[a]:b}),i={qwen:f.settings?.ai?.qwenBaseUrlHint,stepfun:f.settings?.ai?.stepfunBaseUrlHint,volcengine:f.settings?.ai?.volcengineBaseUrlHint,"volcengine-agent":f.settings?.ai?.volcengineAgentBaseUrlHint,"volcengine-coding":f.settings?.ai?.volcengineCodingBaseUrlHint};return(0,b.jsxs)("div",{className:"space-y-3 animate-in fade-in slide-in-from-top-2",children:["volcengine-free"===a&&(0,b.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,b.jsx)("p",{className:"font-medium",children:f.settings.ai.volcengineFree.title}),(0,b.jsx)("p",{className:"mt-1",children:f.settings.ai.volcengineFree.body})]}),(0,b.jsxs)("div",{className:"space-y-2",children:[(0,b.jsx)(G.f,{label:"API Key",href:g.docs.apiKey,linkText:f.settings.ai.docLinks.apiKey}),(0,b.jsx)(H.f,{value:c?.apiKey||"",onChange:a=>h("apiKey",a.target.value),placeholder:"sk-..."}),(0,b.jsxs)("p",{className:"text-xs text-muted-foreground",children:[f.settings?.ai?.vendorApiKeyHint||"Get an API key from the console:"," ",(0,b.jsx)("a",{href:g.consoleUrl,target:"_blank",rel:"noopener noreferrer",className:"underline break-all",children:g.consoleUrl})]})]}),(0,b.jsxs)("div",{className:"space-y-2",children:[(0,b.jsx)(e.f,{children:"Base URL (Optional)"}),(0,b.jsx)(p.f,{value:c?.baseUrl||"",onChange:a=>h("baseUrl",a.target.value),placeholder:g.baseUrl}),(0,b.jsx)("p",{className:"text-xs text-muted-foreground",children:i[a]??f.settings?.ai?.vendorBaseUrlHint})]}),(0,b.jsx)(F.f,{provider:a,apiKey:c?.apiKey,baseUrl:c?.baseUrl,currentModel:c?.model||g.model,onModelChange:a=>h("model",a),docsHref:g.docs.models})]})}a.s(["f",0,function({config:a,setConfig:k,loading:l,saving:m,onSave:n}){let{t:o,language:p}=(0,s.b)();return l?(0,b.jsx)("div",{className:"flex justify-center py-4",children:(0,b.jsx)(c.f,{className:"h-6 w-6 animate-spin text-muted-foreground"})}):(0,b.jsxs)("div",{className:"space-y-4 border rounded-lg p-4 bg-muted/30",children:[(0,b.jsxs)("div",{className:"space-y-2",children:[(0,b.jsx)(e.f,{children:o.settings?.tabs?.ai||"AI Provider"}),(0,b.jsxs)(f.d,{value:a.aiProvider,onValueChange:a=>k(b=>({...b,aiProvider:a})),children:[(0,b.jsx)(f.P,{children:(0,b.jsx)(f.U,{})}),(0,b.jsxs)(f.r,{children:[(0,b.jsx)(f.T,{value:"minimax",children:(0,L.z)("minimax",p)}),(0,b.jsx)(f.T,{value:"minimax-code",children:"MiniMax Code OAuth"}),L.U.filter(a=>"minimax"!==a).map(a=>(0,b.jsx)(f.T,{value:a,children:(0,L.z)(a,p)},a)),(0,b.jsx)(f.T,{value:"anthropic",children:"Anthropic / Compatible"}),(0,b.jsx)(f.T,{value:"azure",children:"Azure OpenAI"}),(0,b.jsx)(f.T,{value:"openai",children:"OpenAI / Compatible"}),(0,b.jsx)(f.T,{value:"gemini",children:"Google Gemini"})]})]}),(0,b.jsx)(K,{provider:a.aiProvider})]}),"openai"===a.aiProvider&&(0,b.jsx)(J,{value:a.openai,onChange:a=>k(b=>({...b,openai:a}))}),"gemini"===a.aiProvider&&(0,b.jsx)(j.f,{value:a.gemini,onChange:a=>k(b=>({...b,gemini:a}))}),"minimax-code"===a.aiProvider&&(0,b.jsx)(C,{value:a.minimaxCode,onChange:a=>k(b=>({...b,minimaxCode:a}))}),"anthropic"===a.aiProvider&&(0,b.jsx)(h.f,{value:a.anthropic,onChange:a=>k(b=>({...b,anthropic:a}))}),(0,L.j)(a.aiProvider)&&(0,b.jsx)(M,{provider:a.aiProvider,value:a[a.aiProvider],onChange:a=>k(b=>({...b,[b.aiProvider]:a}))},a.aiProvider),"azure"===a.aiProvider&&(0,b.jsx)(i.f,{value:a.azure,onChange:a=>k(b=>({...b,azure:a}))}),(0,b.jsx)(g.f,{config:a,saving:m,saveButton:(0,b.jsxs)(d.f,{onClick:n,disabled:m,className:"flex-1",children:[m&&(0,b.jsx)(c.f,{className:"mr-2 h-4 w-4 animate-spin"}),o.settings?.ai?.save||"Save AI Settings"]})})]})}],151304),a.s(["f",0,function(a,b){if(!(0,u.L)(a.timeZone??u.J))return b.settings.general.invalidTimeZone;if("openai"===a.aiProvider)for(let c of a.openai?.instances||[]){if(!c.name?.trim())return b.settings?.ai?.validationNameRequired||"Instance name is required";if(!c.apiKey?.trim())return b.settings?.ai?.validationApiKeyRequired||"API Key is required";if(!c.baseUrl?.trim())return b.settings?.ai?.validationBaseUrlRequired||"Base URL is required";if(!c.model?.trim())return b.settings?.ai?.validationModelRequired||"Model name is required"}if("azure"===a.aiProvider){if(!a.azure?.endpoint?.trim())return b.settings?.ai?.validationAzureEndpointRequired||"Azure Endpoint is required";if(!a.azure?.deploymentName?.trim())return b.settings?.ai?.validationAzureDeploymentRequired||"Deployment Name is required";if(!a.azure?.apiKey?.trim())return b.settings?.ai?.validationApiKeyRequired||"API Key is required"}return null}],439830)},492710,175592,676330,148463,612416,340898,474896,a=>{var b=a.i(187924),c=a.i(866718),d=a.i(152679),e=a.i(870430),f=a.i(572131),g=a.i(699570),h=a.i(580701),i=a.i(168370),j=a.i(519783),k=a.i(875160),l=a.i(291938),m=a.i(550194),n=a.i(190622),o=a.i(630534);function p({provider:a,apiKey:d,baseUrl:q,currentModel:r,onModelChange:s,docsHref:t}){let{t:u}=(0,m.b)(),[v,w]=(0,f.useState)([]),[x,y]=(0,f.useState)(!1),[z,A]=(0,f.useState)(null),[B,C]=(0,f.useState)(r||""),[D,E]=(0,f.useState)(!1),[F,G]=(0,f.useState)(r);r!==F&&(G(r),C(r||""));let H=async()=>{if(!d)return void A(u.modelSelector?.enterApiKeyFirst||"Please enter API Key first");y(!0),A(null);try{let b=await l.f.post("/api/ai/models",{provider:a,apiKey:d,...q&&{baseUrl:q}});if("error"in b&&"string"==typeof b.error){A(b.error),E(!0),w([]);return}w(b.models),0===b.models.length&&(A(u.modelSelector?.noVisionModel||"No vision model found, please enter manually"),E(!0))}catch(b){o.V.error("[ModelSelector]","Failed to fetch models",{error:b});let a=b instanceof Error&&b.message||u.modelSelector?.fetchFailed||"Failed to fetch models";A(a+(u.modelSelector?.enterManually||", please enter manually")),E(!0)}finally{y(!1)}};return(0,b.jsxs)("div",{className:"space-y-2",children:[(0,b.jsxs)("div",{className:"flex items-center gap-2",children:[(0,b.jsx)(e.f,{className:"flex-1",children:u.modelSelector?.modelName||"Model Name"}),t&&(0,b.jsxs)("a",{href:t,target:"_blank",rel:"noopener noreferrer",className:"inline-flex shrink-0 items-center gap-1 text-xs text-muted-foreground underline",children:[u.settings.ai.docLinks.models,(0,b.jsx)(i.f,{className:"h-3 w-3"})]}),(0,b.jsx)(g.f,{type:"button",variant:"outline",size:"sm",onClick:H,disabled:x||!d,children:x?(0,b.jsx)(k.f,{className:"h-3 w-3 animate-spin"}):(0,b.jsx)(j.f,{className:"h-3 w-3"})})]}),z&&(0,b.jsx)("p",{className:"text-xs text-yellow-600",children:z}),D||0===v.length?(0,b.jsxs)("div",{className:"space-y-2",children:[(0,b.jsx)(c.f,{value:B,onChange:a=>{var b;C(b=a.target.value),s(b)},placeholder:(0,n.j)(a)?n.$[a].model:"openai"===a?"gpt-6.1-sol":"gemini-1.5-flash"}),v.length>0&&(0,b.jsx)(g.f,{type:"button",variant:"link",size:"sm",className:"h-auto p-0 text-xs",onClick:()=>E(!1),children:u.modelSelector?.selectFromList||"Select from List"})]}):(0,b.jsx)("div",{className:"space-y-2",children:(0,b.jsxs)(h.d,{value:r,onValueChange:a=>{"_custom"===a?E(!0):(E(!1),C(a),s(a))},children:[(0,b.jsx)(h.P,{children:(0,b.jsx)(h.U,{placeholder:u.modelSelector?.selectModel||"Select Model"})}),(0,b.jsxs)(h.r,{children:[v.map(a=>(0,b.jsxs)(h.T,{value:a.id,children:[a.name,a.owned_by&&` (${a.owned_by})`]},a.id)),(0,b.jsx)(h.T,{value:"_custom",children:u.modelSelector?.customInput||"Custom Input..."})]})]})})]})}function q({label:a,href:c,linkText:d}){return c?(0,b.jsxs)("div",{className:"flex items-center justify-between gap-2",children:[(0,b.jsx)(e.f,{children:a}),(0,b.jsxs)("a",{href:c,target:"_blank",rel:"noopener noreferrer",className:"inline-flex shrink-0 items-center gap-1 text-xs text-muted-foreground underline",children:[d,(0,b.jsx)(i.f,{className:"h-3 w-3"})]})]}):(0,b.jsx)(e.f,{children:a})}a.s(["f",0,p],175592),a.s(["f",0,q],676330);let r={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 s(a){return(0,n.j)(a)?n.$[a].docs:r[a]??null}a.s(["f",0,s],148463),a.s(["f",0,function({value:a,onChange:f}){let{t:g}=(0,m.b)(),h=s("anthropic"),i=(b,c)=>f({...a,[b]:c});return(0,b.jsxs)("div",{className:"space-y-3 animate-in fade-in slide-in-from-top-2",children:[(0,b.jsxs)("div",{className:"space-y-2",children:[(0,b.jsx)(q,{label:"API Key",href:h?.apiKey,linkText:g.settings.ai.docLinks.apiKey}),(0,b.jsx)(d.f,{value:a?.apiKey||"",onChange:a=>i("apiKey",a.target.value),placeholder:"sk-ant-..."})]}),(0,b.jsxs)("div",{className:"space-y-2",children:[(0,b.jsx)(e.f,{children:"Base URL (Optional)"}),(0,b.jsx)(c.f,{value:a?.baseUrl||"",onChange:a=>i("baseUrl",a.target.value),placeholder:"https://api.anthropic.com"}),(0,b.jsx)("p",{className:"text-xs text-muted-foreground",children:g.settings?.ai?.anthropicBaseUrlHint})]}),(0,b.jsx)(p,{provider:"anthropic",apiKey:a?.apiKey,baseUrl:a?.baseUrl,currentModel:a?.model,onModelChange:a=>i("model",a),docsHref:h?.models})]})}],492710),a.s(["f",0,function({value:a,onChange:f}){let{t:g}=(0,m.b)(),h=s("azure"),i=(b,c)=>f({...a,[b]:c}),j=a=>a?.trim()?"":"border-destructive";return(0,b.jsxs)("div",{className:"space-y-3 animate-in fade-in slide-in-from-top-2",children:[(0,b.jsxs)("div",{className:"space-y-2",children:[(0,b.jsxs)(e.f,{children:[g.settings?.ai?.azureEndpoint||"Azure Endpoint"," ",(0,b.jsx)("span",{className:"text-destructive",children:"*"})]}),(0,b.jsx)(c.f,{value:a?.endpoint||"",onChange:a=>i("endpoint",a.target.value),placeholder:g.settings?.ai?.azureEndpointPlaceholder||"https://your-resource.openai.azure.com",className:j(a?.endpoint)})]}),(0,b.jsxs)("div",{className:"space-y-2",children:[(0,b.jsx)(q,{label:(0,b.jsxs)(b.Fragment,{children:[g.settings?.ai?.azureDeployment||"Deployment Name"," ",(0,b.jsx)("span",{className:"text-destructive",children:"*"})]}),href:h?.models,linkText:g.settings.ai.docLinks.models}),(0,b.jsx)(c.f,{value:a?.deploymentName||"",onChange:a=>i("deploymentName",a.target.value),placeholder:g.settings?.ai?.azureDeploymentPlaceholder||"gpt-4o-deployment",className:j(a?.deploymentName)})]}),(0,b.jsxs)("div",{className:"space-y-2",children:[(0,b.jsx)(q,{label:(0,b.jsxs)(b.Fragment,{children:["API Key ",(0,b.jsx)("span",{className:"text-destructive",children:"*"})]}),href:h?.apiKey,linkText:g.settings.ai.docLinks.apiKey}),(0,b.jsx)(d.f,{value:a?.apiKey||"",onChange:a=>i("apiKey",a.target.value),placeholder:"xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",className:j(a?.apiKey)})]}),(0,b.jsxs)("div",{className:"space-y-2",children:[(0,b.jsx)(e.f,{children:g.settings?.ai?.azureApiVersion||"API Version"}),(0,b.jsx)(c.f,{value:a?.apiVersion||"",onChange:a=>i("apiVersion",a.target.value),placeholder:g.settings?.ai?.azureApiVersionPlaceholder||"2024-02-15-preview"})]}),(0,b.jsxs)("div",{className:"space-y-2",children:[(0,b.jsx)(e.f,{children:g.settings?.ai?.azureModel||"Model Display Name"}),(0,b.jsx)(c.f,{value:a?.model||"",onChange:a=>i("model",a.target.value),placeholder:"gpt-4o"})]})]})}],612416),a.s(["f",0,function({value:a,onChange:f}){let{t:g}=(0,m.b)(),h=s("gemini"),i=(b,c)=>f({...a,[b]:c});return(0,b.jsxs)("div",{className:"space-y-3 animate-in fade-in slide-in-from-top-2",children:[(0,b.jsxs)("div",{className:"space-y-2",children:[(0,b.jsx)(q,{label:"API Key",href:h?.apiKey,linkText:g.settings.ai.docLinks.apiKey}),(0,b.jsx)(d.f,{value:a?.apiKey||"",onChange:a=>i("apiKey",a.target.value),placeholder:"AIza..."})]}),(0,b.jsxs)("div",{className:"space-y-2",children:[(0,b.jsx)(e.f,{children:"Base URL (Optional)"}),(0,b.jsx)(c.f,{value:a?.baseUrl||"",onChange:a=>i("baseUrl",a.target.value),placeholder:"https://generativelanguage.googleapis.com"})]}),(0,b.jsx)(p,{provider:"gemini",apiKey:a?.apiKey,baseUrl:a?.baseUrl,currentModel:a?.model,onModelChange:a=>i("model",a),docsHref:h?.models})]})}],340898);var t=a.i(164831);let u={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"}]]};u.node;let v=(0,t.f)(u);a.s(["f",0,v],474896)},152679,a=>{var b=a.i(187924),c=a.i(572131),d=a.i(755681),e=a.i(777064),f=a.i(699570),g=a.i(866718),h=a.i(550194),i=a.i(368114);a.s(["f",0,function({className:a,...j}){let{t:k}=(0,h.b)(),[l,m]=(0,c.useState)(!1);return(0,b.jsxs)("div",{className:"relative",children:[(0,b.jsx)(g.f,{type:l?"text":"password",className:(0,i.f)("pr-10",a),...j}),(0,b.jsx)(f.f,{type:"button",variant:"ghost",size:"icon",className:"absolute right-0 top-0 h-full px-3 py-2 hover:bg-transparent",onClick:()=>m(!l),"aria-label":l?k.common.hidePassword:k.common.showPassword,tabIndex:-1,children:l?(0,b.jsx)(e.f,{className:"h-4 w-4 text-muted-foreground"}):(0,b.jsx)(d.f,{className:"h-4 w-4 text-muted-foreground"})})]})}])}]})();
|
|
2
2
|
|
|
3
3
|
//# sourceMappingURL=_0cmd1ubdlo_by._.js.map
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
(()=>{"use strict";module.exports=[308311,a=>{var b=a.i(164831);let c={name:"clock",size:24,node:[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 6v6l4 2",key:"mmk7yg"}]]};c.node;let d=(0,b.f)(c);a.s(["f",0,d],308311)},62140,a=>{var b=a.i(164831);let c={name:"list-checks",size:24,node:[["path",{d:"M13 5h8",key:"a7qcls"}],["path",{d:"M13 12h8",key:"h98zly"}],["path",{d:"M13 19h8",key:"c3s6r1"}],["path",{d:"m3 17 2 2 4-4",key:"1jhpwq"}],["path",{d:"m3 7 2 2 4-4",key:"1obspn"}]]};c.node;let d=(0,b.f)(c);a.s(["f",0,d],62140)},88444,a=>{var b=a.i(164831);let c={name:"printer",size:24,node:[["path",{d:"M6 18H4a2 2 0 0 1-2-2v-5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2v5a2 2 0 0 1-2 2h-2",key:"143wyd"}],["path",{d:"M6 9V3a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v6",key:"1itne7"}],["rect",{x:"6",y:"14",width:"12",height:"8",rx:"1",key:"1ue0tg"}]]};c.node;let d=(0,b.f)(c);a.s(["f",0,d],88444)},622418,a=>{var b=a.i(187924),c=a.i(79362),d=a.i(308311),e=a.i(519783),f=a.i(786304),g=a.i(550194);let h={new:{className:"bg-warning/15 text-amber-700 dark:text-warning",icon:d.f},reviewing:{className:"bg-primary/10 text-primary",icon:e.f},mastered:{className:"bg-success/15 text-success",icon:c.f}};a.s(["o",0,{new:"border-l-warning/70",reviewing:"border-l-primary/60",mastered:"border-l-success/70"},"x",0,function({status:a,className:c=""}){let{t:d}=(0,g.b)(),{className:e,icon:i}=h[a],j="mastered"===a?d.notebook.mastered:"reviewing"===a?d.notebook.reviewing:d.notebook.review;return(0,b.jsx)(f.f,{variant:"secondary",className:`${e} ${c}`,children:(0,b.jsxs)("span",{className:"flex items-center gap-1",children:[(0,b.jsx)(i,{className:"h-3 w-3"})," ",j]})})}])},697902,a=>{a.s(["$",0,18,"u",0,5,"A",0,200])},441069,a=>{a.s(["f",0,function(a){if(a.tags&&a.tags.length>0)return a.tags.map(a=>a.name);if(!a.knowledgePoints)return[];try{let b=JSON.parse(a.knowledgePoints);return Array.isArray(b)?b.filter(a=>"string"==typeof a):[]}catch{return[]}}])}]})();
|
|
2
|
+
|
|
3
|
+
//# sourceMappingURL=_0ecx95vqjqdc3._.js.map
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
(()=>{"use strict";module.exports=[875160,a=>{var b=a.i(164831);let c={name:"loader-circle",size:24,node:[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]],aliases:["loader-2"]};c.node;let d=(0,b.f)(c);a.s(["f",0,d],875160)},808591,(a,b,c)=>{Object.defineProperty(c,"__esModule",{value:!0}),Object.defineProperty(c,"useMergedRef",{enumerable:!0,get:function(){return e}});let d=a.r(572131);function e(a,b){let c=(0,d.useRef)(null),e=(0,d.useRef)(null);return(0,d.useCallback)(d=>{if(null===d){let a=c.current;a&&(c.current=null,a());let b=e.current;b&&(e.current=null,b())}else a&&(c.current=f(a,d)),b&&(e.current=f(b,d))},[a,b])}function f(a,b){if("function"!=typeof a)return a.current=b,()=>{a.current=null};{let c=a(b);return"function"==typeof c?c:()=>a(null)}}("function"==typeof c.default||"object"==typeof c.default&&null!==c.default)&&void 0===c.default.__esModule&&(Object.defineProperty(c.default,"__esModule",{value:!0}),Object.assign(c.default,c),b.exports=c.default)},68063,(a,b,c)=>{let d;Object.defineProperty(c,"__esModule",{value:!0});var e={getAssetToken:function(){return i},getAssetTokenQuery:function(){return j},getDeploymentId:function(){return g},getDeploymentIdQuery:function(){return h}};for(var f in e)Object.defineProperty(c,f,{enumerable:!0,get:e[f]});function g(){return d}function h(a=!1){return d?`${a?"&":"?"}dpl=${d}`:""}function i(){return!1}function j(a=!1){return""}d=void 0},866718,a=>{var b=a.i(187924),c=a.i(368114);a.s(["f",0,function({className:a,type:d,...e}){return(0,b.jsx)("input",{type:d,"data-slot":"input",className:(0,c.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",a),...e})}])}]})();
|
|
2
|
+
|
|
3
|
+
//# sourceMappingURL=_0gs_f7ri8ab-t._.js.map
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
(()=>{"use strict";module.exports=[219107,a=>{var b=a.i(164831);let c={name:"arrow-left",size:24,node:[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]]};c.node;let d=(0,b.f)(c);a.s(["f",0,d],219107)},695001,a=>{var b=a.i(187924),c=a.i(50944),d=a.i(699570),e=a.i(219107);a.s(["f",0,function({fallbackUrl:a,className:f}){let g=(0,c.useRouter)();return(0,b.jsx)(d.f,{variant:"ghost",size:"icon",onClick:()=>{g.push(a)},className:f,children:(0,b.jsx)(e.f,{className:"h-5 w-5"})})}])},579834,a=>{var b=a.i(187924),c=a.i(368114);a.s(["f",0,function({icon:a,title:d,description:e,action:f,className:g}){return(0,b.jsxs)("div",{className:(0,c.f)("flex flex-col items-center justify-center rounded-2xl border border-dashed bg-card/50 px-6 py-14 text-center",g),children:[(0,b.jsx)("div",{className:"mb-4 flex h-14 w-14 items-center justify-center rounded-2xl bg-accent text-accent-foreground",children:(0,b.jsx)(a,{className:"h-7 w-7"})}),(0,b.jsx)("p",{className:"font-medium",children:d}),e&&(0,b.jsx)("p",{className:"mt-1 max-w-sm text-sm text-muted-foreground",children:e}),f&&(0,b.jsx)("div",{className:"mt-5",children:f})]})}])},251538,a=>{var b=a.i(187924),c=a.i(695001),d=a.i(368114);a.s(["f",0,function({title:a,description:e,backHref:f,actions:g,titleAddon:h,className:i}){return(0,b.jsxs)("div",{className:(0,d.f)("flex items-start gap-3",i),children:[f&&(0,b.jsx)(c.f,{fallbackUrl:f,className:"-ml-2 shrink-0"}),(0,b.jsxs)("div",{className:"min-w-0 flex-1 space-y-1",children:[(0,b.jsxs)("div",{className:"flex items-center gap-1",children:[(0,b.jsx)("h1",{className:"truncate text-2xl font-bold tracking-tight sm:text-3xl",children:a}),h]}),e&&(0,b.jsx)("p",{className:"text-sm text-muted-foreground sm:text-base",children:e})]}),g&&(0,b.jsx)("div",{className:"flex shrink-0 items-center gap-2",children:g})]})}])},697902,a=>{a.s(["$",0,18,"u",0,5,"A",0,200])}]})();
|
|
2
|
+
|
|
3
|
+
//# sourceMappingURL=_0ha8gl7l6aod0._.js.map
|