wrong-notebook 2026.11.4-2 → 2026.11.4-3

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.
Files changed (737) hide show
  1. package/.next/BUILD_ID +1 -1
  2. package/.next/build-manifest.json +3 -3
  3. package/.next/server/app/_global-error.html +1 -1
  4. package/.next/server/app/_global-error.rsc +1 -1
  5. package/.next/server/app/_global-error.segments/__PAGE__.segment.rsc +1 -1
  6. package/.next/server/app/_global-error.segments/_full.segment.rsc +1 -1
  7. package/.next/server/app/_global-error.segments/_tree.segment.rsc +1 -1
  8. package/.next/server/app/_not-found/page.js.nft.json +1 -1
  9. package/.next/server/app/_not-found/page_client-reference-manifest.js +1 -1
  10. package/.next/server/app/admin/page.js.nft.json +1 -1
  11. package/.next/server/app/admin/page_client-reference-manifest.js +1 -1
  12. package/.next/server/app/admin/user/[id]/page.js.nft.json +1 -1
  13. package/.next/server/app/admin/user/[id]/page_client-reference-manifest.js +1 -1
  14. package/.next/server/app/api/admin/cnm-tags/route.js +8 -6
  15. package/.next/server/app/api/admin/cnm-tags/route.js.nft.json +1 -1
  16. package/.next/server/app/api/admin/dashboard/route.js +14 -13
  17. package/.next/server/app/api/admin/dashboard/route.js.nft.json +1 -1
  18. package/.next/server/app/api/admin/debug-logs/export/route.js +7 -6
  19. package/.next/server/app/api/admin/debug-logs/export/route.js.nft.json +1 -1
  20. package/.next/server/app/api/admin/debug-logs/route.js +6 -5
  21. package/.next/server/app/api/admin/debug-logs/route.js.nft.json +1 -1
  22. package/.next/server/app/api/admin/migrate-tags/route.js +5 -3
  23. package/.next/server/app/api/admin/migrate-tags/route.js.nft.json +1 -1
  24. package/.next/server/app/api/admin/system-reset/route.js +5 -5
  25. package/.next/server/app/api/admin/system-reset/route.js.nft.json +1 -1
  26. package/.next/server/app/api/admin/users/[id]/detail/route.js +14 -13
  27. package/.next/server/app/api/admin/users/[id]/detail/route.js.nft.json +1 -1
  28. package/.next/server/app/api/admin/users/[id]/route.js +7 -5
  29. package/.next/server/app/api/admin/users/[id]/route.js.nft.json +1 -1
  30. package/.next/server/app/api/admin/users/route.js +8 -7
  31. package/.next/server/app/api/admin/users/route.js.nft.json +1 -1
  32. package/.next/server/app/api/ai/models/route.js +14 -13
  33. package/.next/server/app/api/ai/models/route.js.nft.json +1 -1
  34. package/.next/server/app/api/ai/test/route.js +15 -13
  35. package/.next/server/app/api/ai/test/route.js.nft.json +1 -1
  36. package/.next/server/app/api/analytics/route.js +16 -16
  37. package/.next/server/app/api/analytics/route.js.nft.json +1 -1
  38. package/.next/server/app/api/analyze/route.js +18 -17
  39. package/.next/server/app/api/analyze/route.js.nft.json +1 -1
  40. package/.next/server/app/api/error-items/[id]/delete/route.js +5 -5
  41. package/.next/server/app/api/error-items/[id]/delete/route.js.nft.json +1 -1
  42. package/.next/server/app/api/error-items/[id]/figure/route.js +13 -12
  43. package/.next/server/app/api/error-items/[id]/figure/route.js.nft.json +1 -1
  44. package/.next/server/app/api/error-items/[id]/fix-latex/route.js +14 -13
  45. package/.next/server/app/api/error-items/[id]/fix-latex/route.js.nft.json +1 -1
  46. package/.next/server/app/api/error-items/[id]/geogebra/route.js +20 -18
  47. package/.next/server/app/api/error-items/[id]/geogebra/route.js.nft.json +1 -1
  48. package/.next/server/app/api/error-items/[id]/image/route.js +6 -5
  49. package/.next/server/app/api/error-items/[id]/image/route.js.nft.json +1 -1
  50. package/.next/server/app/api/error-items/[id]/notes/route.js +8 -5
  51. package/.next/server/app/api/error-items/[id]/notes/route.js.nft.json +1 -1
  52. package/.next/server/app/api/error-items/[id]/practice-records/route.js +5 -4
  53. package/.next/server/app/api/error-items/[id]/practice-records/route.js.nft.json +1 -1
  54. package/.next/server/app/api/error-items/[id]/reanswer/route.js +16 -14
  55. package/.next/server/app/api/error-items/[id]/reanswer/route.js.nft.json +1 -1
  56. package/.next/server/app/api/error-items/[id]/retag/route.js +19 -18
  57. package/.next/server/app/api/error-items/[id]/retag/route.js.nft.json +1 -1
  58. package/.next/server/app/api/error-items/[id]/route.js +9 -6
  59. package/.next/server/app/api/error-items/[id]/route.js.nft.json +1 -1
  60. package/.next/server/app/api/error-items/[id]/svg-animation/narration/route.js +16 -14
  61. package/.next/server/app/api/error-items/[id]/svg-animation/narration/route.js.nft.json +1 -1
  62. package/.next/server/app/api/error-items/[id]/svg-animation/route.js +16 -14
  63. package/.next/server/app/api/error-items/[id]/svg-animation/route.js.nft.json +1 -1
  64. package/.next/server/app/api/error-items/answer-space/route.js +6 -6
  65. package/.next/server/app/api/error-items/answer-space/route.js.nft.json +1 -1
  66. package/.next/server/app/api/error-items/batch-delete/route.js +8 -5
  67. package/.next/server/app/api/error-items/batch-delete/route.js.nft.json +1 -1
  68. package/.next/server/app/api/error-items/clear/route.js +5 -5
  69. package/.next/server/app/api/error-items/clear/route.js.nft.json +1 -1
  70. package/.next/server/app/api/error-items/list/route.js +8 -8
  71. package/.next/server/app/api/error-items/list/route.js.nft.json +1 -1
  72. package/.next/server/app/api/error-items/route.js +20 -20
  73. package/.next/server/app/api/error-items/route.js.nft.json +1 -1
  74. package/.next/server/app/api/error-items/short/[shortId]/route.js +5 -4
  75. package/.next/server/app/api/error-items/short/[shortId]/route.js.nft.json +1 -1
  76. package/.next/server/app/api/error-items/similarity/route.js +4 -3
  77. package/.next/server/app/api/error-items/similarity/route.js.nft.json +1 -1
  78. package/.next/server/app/api/exams/[id]/questions/[questionId]/regenerate/route.js +18 -17
  79. package/.next/server/app/api/exams/[id]/questions/[questionId]/regenerate/route.js.nft.json +1 -1
  80. package/.next/server/app/api/exams/[id]/results/route.js +17 -17
  81. package/.next/server/app/api/exams/[id]/results/route.js.nft.json +1 -1
  82. package/.next/server/app/api/exams/[id]/retry/route.js +17 -17
  83. package/.next/server/app/api/exams/[id]/retry/route.js.nft.json +1 -1
  84. package/.next/server/app/api/exams/[id]/route.js +18 -17
  85. package/.next/server/app/api/exams/[id]/route.js.nft.json +1 -1
  86. package/.next/server/app/api/exams/route.js +17 -17
  87. package/.next/server/app/api/exams/route.js.nft.json +1 -1
  88. package/.next/server/app/api/export/route.js +9 -8
  89. package/.next/server/app/api/export/route.js.nft.json +1 -1
  90. package/.next/server/app/api/geogebra-analyze/route.js +17 -16
  91. package/.next/server/app/api/geogebra-analyze/route.js.nft.json +1 -1
  92. package/.next/server/app/api/health/route.js.nft.json +1 -1
  93. package/.next/server/app/api/import/route.js +23 -22
  94. package/.next/server/app/api/import/route.js.nft.json +1 -1
  95. package/.next/server/app/api/import-batches/[id]/confirm-all/route.js +25 -24
  96. package/.next/server/app/api/import-batches/[id]/confirm-all/route.js.nft.json +1 -1
  97. package/.next/server/app/api/import-batches/[id]/fix-text/route.js +19 -19
  98. package/.next/server/app/api/import-batches/[id]/fix-text/route.js.nft.json +1 -1
  99. package/.next/server/app/api/import-batches/[id]/read/route.js +24 -23
  100. package/.next/server/app/api/import-batches/[id]/read/route.js.nft.json +1 -1
  101. package/.next/server/app/api/import-batches/[id]/retry/route.js +25 -24
  102. package/.next/server/app/api/import-batches/[id]/retry/route.js.nft.json +1 -1
  103. package/.next/server/app/api/import-batches/[id]/route.js +24 -23
  104. package/.next/server/app/api/import-batches/[id]/route.js.nft.json +1 -1
  105. package/.next/server/app/api/import-batches/[id]/start/route.js +24 -23
  106. package/.next/server/app/api/import-batches/[id]/start/route.js.nft.json +1 -1
  107. package/.next/server/app/api/import-batches/route.js +24 -23
  108. package/.next/server/app/api/import-batches/route.js.nft.json +1 -1
  109. package/.next/server/app/api/import-tasks/[id]/confirm/route.js +23 -22
  110. package/.next/server/app/api/import-tasks/[id]/confirm/route.js.nft.json +1 -1
  111. package/.next/server/app/api/import-tasks/[id]/read/route.js +23 -22
  112. package/.next/server/app/api/import-tasks/[id]/read/route.js.nft.json +1 -1
  113. package/.next/server/app/api/import-tasks/[id]/retry/route.js +24 -23
  114. package/.next/server/app/api/import-tasks/[id]/retry/route.js.nft.json +1 -1
  115. package/.next/server/app/api/import-tasks/[id]/route.js +23 -22
  116. package/.next/server/app/api/import-tasks/[id]/route.js.nft.json +1 -1
  117. package/.next/server/app/api/import-tasks/route.js +24 -23
  118. package/.next/server/app/api/import-tasks/route.js.nft.json +1 -1
  119. package/.next/server/app/api/initialize/route.js +1 -1
  120. package/.next/server/app/api/initialize/route.js.nft.json +1 -1
  121. package/.next/server/app/api/logs/frontend/route.js +6 -4
  122. package/.next/server/app/api/logs/frontend/route.js.nft.json +1 -1
  123. package/.next/server/app/api/minimax-code/checkin/route.js +6 -5
  124. package/.next/server/app/api/minimax-code/checkin/route.js.nft.json +1 -1
  125. package/.next/server/app/api/minimax-code/login/route.js +6 -5
  126. package/.next/server/app/api/minimax-code/login/route.js.nft.json +1 -1
  127. package/.next/server/app/api/minimax-code/route.js +7 -6
  128. package/.next/server/app/api/minimax-code/route.js.nft.json +1 -1
  129. package/.next/server/app/api/notebooks/[id]/retag/route.js +16 -16
  130. package/.next/server/app/api/notebooks/[id]/retag/route.js.nft.json +1 -1
  131. package/.next/server/app/api/notebooks/[id]/route.js +8 -4
  132. package/.next/server/app/api/notebooks/[id]/route.js.nft.json +1 -1
  133. package/.next/server/app/api/notebooks/route.js +8 -6
  134. package/.next/server/app/api/notebooks/route.js.nft.json +1 -1
  135. package/.next/server/app/api/openclaw/batch-upload/route.js +19 -18
  136. package/.next/server/app/api/openclaw/batch-upload/route.js.nft.json +1 -1
  137. package/.next/server/app/api/paper-groups/[id]/route.js +5 -4
  138. package/.next/server/app/api/paper-groups/[id]/route.js.nft.json +1 -1
  139. package/.next/server/app/api/paper-groups/route.js +4 -3
  140. package/.next/server/app/api/paper-groups/route.js.nft.json +1 -1
  141. package/.next/server/app/api/practice/generate/route.js +18 -17
  142. package/.next/server/app/api/practice/generate/route.js.nft.json +1 -1
  143. package/.next/server/app/api/practice/grade/route.js +14 -13
  144. package/.next/server/app/api/practice/grade/route.js.nft.json +1 -1
  145. package/.next/server/app/api/practice/record/[id]/route.js +15 -14
  146. package/.next/server/app/api/practice/record/[id]/route.js.nft.json +1 -1
  147. package/.next/server/app/api/practice/record/route.js +17 -16
  148. package/.next/server/app/api/practice/record/route.js.nft.json +1 -1
  149. package/.next/server/app/api/reanswer/route.js +18 -17
  150. package/.next/server/app/api/reanswer/route.js.nft.json +1 -1
  151. package/.next/server/app/api/register/route.js +5 -5
  152. package/.next/server/app/api/register/route.js.nft.json +1 -1
  153. package/.next/server/app/api/register/status/route.js +5 -5
  154. package/.next/server/app/api/register/status/route.js.nft.json +1 -1
  155. package/.next/server/app/api/requests/[id]/route.js +5 -4
  156. package/.next/server/app/api/requests/[id]/route.js.nft.json +1 -1
  157. package/.next/server/app/api/review/due/route.js +15 -14
  158. package/.next/server/app/api/review/due/route.js.nft.json +1 -1
  159. package/.next/server/app/api/settings/route.js +8 -7
  160. package/.next/server/app/api/settings/route.js.nft.json +1 -1
  161. package/.next/server/app/api/setup/route.js +7 -6
  162. package/.next/server/app/api/setup/route.js.nft.json +1 -1
  163. package/.next/server/app/api/stats/activity/route.js +7 -6
  164. package/.next/server/app/api/stats/activity/route.js.nft.json +1 -1
  165. package/.next/server/app/api/stats/practice/clear/route.js +5 -5
  166. package/.next/server/app/api/stats/practice/clear/route.js.nft.json +1 -1
  167. package/.next/server/app/api/stats/practice/route.js +7 -6
  168. package/.next/server/app/api/stats/practice/route.js.nft.json +1 -1
  169. package/.next/server/app/api/stats/repeated-mistakes/route.js +16 -16
  170. package/.next/server/app/api/stats/repeated-mistakes/route.js.nft.json +1 -1
  171. package/.next/server/app/api/stats/weak-tags/route.js +16 -16
  172. package/.next/server/app/api/stats/weak-tags/route.js.nft.json +1 -1
  173. package/.next/server/app/api/tags/route.js +7 -4
  174. package/.next/server/app/api/tags/route.js.nft.json +1 -1
  175. package/.next/server/app/api/tags/stats/route.js +1 -1
  176. package/.next/server/app/api/tags/stats/route.js.nft.json +1 -1
  177. package/.next/server/app/api/tasks/route.js +5 -4
  178. package/.next/server/app/api/tasks/route.js.nft.json +1 -1
  179. package/.next/server/app/api/tts/[id]/route.js +9 -8
  180. package/.next/server/app/api/tts/[id]/route.js.nft.json +1 -1
  181. package/.next/server/app/api/tts/batch/route.js +10 -9
  182. package/.next/server/app/api/tts/batch/route.js.nft.json +1 -1
  183. package/.next/server/app/api/tts/route.js +9 -8
  184. package/.next/server/app/api/tts/route.js.nft.json +1 -1
  185. package/.next/server/app/api/tts/status/route.js +9 -9
  186. package/.next/server/app/api/tts/status/route.js.nft.json +1 -1
  187. package/.next/server/app/api/user/route.js +15 -15
  188. package/.next/server/app/api/user/route.js.nft.json +1 -1
  189. package/.next/server/app/api/version/route.js.nft.json +1 -1
  190. package/.next/server/app/error-items/[id]/page.js.nft.json +1 -1
  191. package/.next/server/app/error-items/[id]/page_client-reference-manifest.js +1 -1
  192. package/.next/server/app/exams/[id]/page.js.nft.json +1 -1
  193. package/.next/server/app/exams/[id]/page_client-reference-manifest.js +1 -1
  194. package/.next/server/app/exams/[id]/print/page.js.nft.json +1 -1
  195. package/.next/server/app/exams/[id]/print/page_client-reference-manifest.js +1 -1
  196. package/.next/server/app/exams/page.js.nft.json +1 -1
  197. package/.next/server/app/exams/page_client-reference-manifest.js +1 -1
  198. package/.next/server/app/import-batches/[id]/page.js.nft.json +1 -1
  199. package/.next/server/app/import-batches/[id]/page_client-reference-manifest.js +1 -1
  200. package/.next/server/app/import-tasks/[id]/page.js.nft.json +1 -1
  201. package/.next/server/app/import-tasks/[id]/page_client-reference-manifest.js +1 -1
  202. package/.next/server/app/import-tasks/page.js.nft.json +1 -1
  203. package/.next/server/app/import-tasks/page_client-reference-manifest.js +1 -1
  204. package/.next/server/app/initialize/page.js.nft.json +1 -1
  205. package/.next/server/app/initialize/page_client-reference-manifest.js +1 -1
  206. package/.next/server/app/login/page.js.nft.json +1 -1
  207. package/.next/server/app/login/page_client-reference-manifest.js +1 -1
  208. package/.next/server/app/notebooks/[id]/add/page.js.nft.json +1 -1
  209. package/.next/server/app/notebooks/[id]/add/page_client-reference-manifest.js +1 -1
  210. package/.next/server/app/notebooks/[id]/page.js.nft.json +1 -1
  211. package/.next/server/app/notebooks/[id]/page_client-reference-manifest.js +1 -1
  212. package/.next/server/app/notebooks/page.js.nft.json +1 -1
  213. package/.next/server/app/notebooks/page_client-reference-manifest.js +1 -1
  214. package/.next/server/app/page.js.nft.json +1 -1
  215. package/.next/server/app/page_client-reference-manifest.js +1 -1
  216. package/.next/server/app/practice/page.js.nft.json +1 -1
  217. package/.next/server/app/practice/page_client-reference-manifest.js +1 -1
  218. package/.next/server/app/print-preview/page.js.nft.json +1 -1
  219. package/.next/server/app/print-preview/page_client-reference-manifest.js +1 -1
  220. package/.next/server/app/register/page.js.nft.json +1 -1
  221. package/.next/server/app/register/page_client-reference-manifest.js +1 -1
  222. package/.next/server/app/review/page.js.nft.json +1 -1
  223. package/.next/server/app/review/page_client-reference-manifest.js +1 -1
  224. package/.next/server/app/setup/page.js.nft.json +1 -1
  225. package/.next/server/app/setup/page_client-reference-manifest.js +1 -1
  226. package/.next/server/app/stats/page.js.nft.json +1 -1
  227. package/.next/server/app/stats/page_client-reference-manifest.js +1 -1
  228. package/.next/server/app/tags/page.js.nft.json +1 -1
  229. package/.next/server/app/tags/page_client-reference-manifest.js +1 -1
  230. package/.next/server/chunks/[externals]__1j5vgk-wr4vpe._.js +3 -0
  231. package/.next/server/chunks/[externals]_fs_0pplqgcyv2l7l._.js +3 -0
  232. package/.next/server/chunks/[externals]_fs_1d5jh8vp8y6zt._.js +3 -0
  233. package/.next/server/chunks/{[root-of-the-server]__05tyrbfzivoeq._.js → [root-of-the-server]__0-5ex-1jwf2so._.js} +1 -1
  234. package/.next/server/chunks/{[root-of-the-server]__01-14hxale6jz._.js → [root-of-the-server]__000xbr1s0pxwr._.js} +1 -1
  235. package/.next/server/chunks/[root-of-the-server]__00_59ioz3-clx._.js +3 -0
  236. package/.next/server/chunks/[root-of-the-server]__00cl_lnn-40t3._.js +3 -0
  237. package/.next/server/chunks/{[root-of-the-server]__01rm65xnqj0z-._.js → [root-of-the-server]__00cvwb7xtihiy._.js} +1 -1
  238. package/.next/server/chunks/[root-of-the-server]__00g0do0mkiaol._.js +3 -0
  239. package/.next/server/chunks/{[root-of-the-server]__02nbzp-n9g9_o._.js → [root-of-the-server]__00u81uwtn433h._.js} +1 -1
  240. package/.next/server/chunks/{[root-of-the-server]__09pkxauucdf_0._.js → [root-of-the-server]__02osgjesv2sc1._.js} +2 -2
  241. package/.next/server/chunks/{[root-of-the-server]__0z0knsep33lsx._.js → [root-of-the-server]__02rd5j6up78m2._.js} +2 -2
  242. package/.next/server/chunks/[root-of-the-server]__02t-_4nuz92ls._.js +3 -0
  243. package/.next/server/chunks/[root-of-the-server]__0384w26qgo9xm._.js +3 -0
  244. package/.next/server/chunks/[root-of-the-server]__04ofq5esp33on._.js +3 -0
  245. package/.next/server/chunks/[root-of-the-server]__04rit3x7n87ku._.js +3 -0
  246. package/.next/server/chunks/{[root-of-the-server]__006u92h_madgn._.js → [root-of-the-server]__05d81asaxsts8._.js} +1 -1
  247. package/.next/server/chunks/[root-of-the-server]__06dvthqk5vh87._.js +3 -0
  248. package/.next/server/chunks/{[root-of-the-server]__0n5l60oyv1n-1._.js → [root-of-the-server]__06i2kswg2zb80._.js} +1 -1
  249. package/.next/server/chunks/{[root-of-the-server]__1eu_g0k_nr3i-._.js → [root-of-the-server]__0702vmlo8jrsa._.js} +2 -2
  250. package/.next/server/chunks/[root-of-the-server]__075pb7_pb654o._.js +3 -0
  251. package/.next/server/chunks/{[root-of-the-server]__0k4cyyyh6z6_p._.js → [root-of-the-server]__08wi504al-t3f._.js} +2 -2
  252. package/.next/server/chunks/{[root-of-the-server]__0bmczgpuggwki._.js → [root-of-the-server]__0_gf1ay3sa41e._.js} +1 -1
  253. package/.next/server/chunks/[root-of-the-server]__0_zz_zj6cp7hy._.js +3 -0
  254. package/.next/server/chunks/[root-of-the-server]__0bgi7pc7dogwe._.js +3 -0
  255. package/.next/server/chunks/[root-of-the-server]__0cjj_9c_1d-eb._.js +3 -0
  256. package/.next/server/chunks/[root-of-the-server]__0d315c1v02ny0._.js +3 -0
  257. package/.next/server/chunks/{[root-of-the-server]__0eba9rni-2_tw._.js → [root-of-the-server]__0dyqmjzl1b_1f._.js} +1 -1
  258. package/.next/server/chunks/[root-of-the-server]__0ehph__dmu6pf._.js +3 -0
  259. package/.next/server/chunks/[root-of-the-server]__0evv12a34qcy6._.js +27 -0
  260. package/.next/server/chunks/[root-of-the-server]__0fdvaccw9slrb._.js +3 -0
  261. package/.next/server/chunks/[root-of-the-server]__0fr_y2a0149cd._.js +3 -0
  262. package/.next/server/chunks/[root-of-the-server]__0fscx2v333vm8._.js +3 -0
  263. package/.next/server/chunks/[root-of-the-server]__0g9zoc0653-fw._.js +3 -0
  264. package/.next/server/chunks/[root-of-the-server]__0h-qm7nop9330._.js +3 -0
  265. package/.next/server/chunks/[root-of-the-server]__0hcbw1sliw973._.js +1 -1
  266. package/.next/server/chunks/[root-of-the-server]__0hsl0y0knqi-1._.js +3 -0
  267. package/.next/server/chunks/{[root-of-the-server]__029n0r2v92pcc._.js → [root-of-the-server]__0htnw-q6r_ple._.js} +2 -2
  268. package/.next/server/chunks/{[root-of-the-server]__0lqv0n5j2fg24._.js → [root-of-the-server]__0i3k26mx8ndsy._.js} +2 -2
  269. package/.next/server/chunks/[root-of-the-server]__0ifmgp3wd_za_._.js +3 -0
  270. package/.next/server/chunks/[root-of-the-server]__0joi1yae2ehm4._.js +3 -0
  271. package/.next/server/chunks/{[root-of-the-server]__0imuc7gi1ii-e._.js → [root-of-the-server]__0k0dc64mmh6m3._.js} +2 -2
  272. package/.next/server/chunks/[root-of-the-server]__0kehix4ojdnhw._.js +1 -1
  273. package/.next/server/chunks/[root-of-the-server]__0l104gjwyuf1b._.js +3 -0
  274. package/.next/server/chunks/[root-of-the-server]__0l5ybk_p285gl._.js +3 -0
  275. package/.next/server/chunks/[root-of-the-server]__0lgbdth9-z6qg._.js +3 -0
  276. package/.next/server/chunks/[root-of-the-server]__0lm6l50r5n5di._.js +3 -0
  277. package/.next/server/chunks/[root-of-the-server]__0lsvd81f6kf59._.js +3 -0
  278. package/.next/server/chunks/[root-of-the-server]__0oh43a4yzv1os._.js +3 -0
  279. package/.next/server/chunks/[root-of-the-server]__0si2-m5an9zl7._.js +3 -0
  280. package/.next/server/chunks/[root-of-the-server]__0svdqovwfpro2._.js +3 -0
  281. package/.next/server/chunks/{[root-of-the-server]__0fx0s5_6sjw-d._.js → [root-of-the-server]__0tn4z733mbm06._.js} +1 -1
  282. package/.next/server/chunks/[root-of-the-server]__0torie7kq-_7m._.js +3 -0
  283. package/.next/server/chunks/[root-of-the-server]__0tvp4sm4zx3wt._.js +3 -0
  284. package/.next/server/chunks/{[root-of-the-server]__0geynfn2xmdle._.js → [root-of-the-server]__0tzkw11a1tdju._.js} +2 -2
  285. package/.next/server/chunks/[root-of-the-server]__0uhfq-cs0r44u._.js +3 -0
  286. package/.next/server/chunks/[root-of-the-server]__0unr-g_-8kx90._.js +3 -0
  287. package/.next/server/chunks/[root-of-the-server]__0v6kysx0rq-1m._.js +3 -0
  288. package/.next/server/chunks/[root-of-the-server]__0vrag-4p6eznc._.js +3 -0
  289. package/.next/server/chunks/[root-of-the-server]__0vrs8pd3vzslw._.js +3 -0
  290. package/.next/server/chunks/[root-of-the-server]__0wfpx1grz3ds6._.js +3 -0
  291. package/.next/server/chunks/[root-of-the-server]__0x-02x70-ewqa._.js +3 -0
  292. package/.next/server/chunks/[root-of-the-server]__0ya2x1q-h3scx._.js +3 -0
  293. package/.next/server/chunks/[root-of-the-server]__0zhm5smhb-gdm._.js +3 -0
  294. package/.next/server/chunks/[root-of-the-server]__0zmnn5ww2etgw._.js +3 -0
  295. package/.next/server/chunks/[root-of-the-server]__10_9ca38kz5au._.js +3 -0
  296. package/.next/server/chunks/{[root-of-the-server]__1kiolpvl5u4e-._.js → [root-of-the-server]__10gw_yrtllol4._.js} +2 -2
  297. package/.next/server/chunks/[root-of-the-server]__11d2q9o0f28s0._.js +3 -0
  298. package/.next/server/chunks/[root-of-the-server]__11oto6h82pnhn._.js +3 -0
  299. package/.next/server/chunks/[root-of-the-server]__12wn_ef3w7f8l._.js +3 -0
  300. package/.next/server/chunks/[root-of-the-server]__132-2tja1hzjw._.js +3 -0
  301. package/.next/server/chunks/[root-of-the-server]__13aq01o_yamyz._.js +3 -0
  302. package/.next/server/chunks/[root-of-the-server]__13x167nrb3y6w._.js +3 -0
  303. package/.next/server/chunks/[root-of-the-server]__1438_x9vkg2ow._.js +3 -0
  304. package/.next/server/chunks/[root-of-the-server]__14qqa5fifm2rn._.js +3 -0
  305. package/.next/server/chunks/[root-of-the-server]__16jaf2eom1mlc._.js +3 -0
  306. package/.next/server/chunks/[root-of-the-server]__16pezaw35f9j1._.js +3 -0
  307. package/.next/server/chunks/[root-of-the-server]__16qwprn5u6gjt._.js +3 -0
  308. package/.next/server/chunks/[root-of-the-server]__176zyagwjex4i._.js +3 -0
  309. package/.next/server/chunks/[root-of-the-server]__180yz6lfwyg1x._.js +3 -0
  310. package/.next/server/chunks/[root-of-the-server]__197qvpegys2sj._.js +3 -0
  311. package/.next/server/chunks/[root-of-the-server]__19cfobnhf4rgh._.js +3 -0
  312. package/.next/server/chunks/[root-of-the-server]__19r0-5tk-zh9i._.js +3 -0
  313. package/.next/server/chunks/[root-of-the-server]__1_sr40zcjsx6y._.js +3 -0
  314. package/.next/server/chunks/[root-of-the-server]__1c_nbrrytj02e._.js +3 -0
  315. package/.next/server/chunks/[root-of-the-server]__1dgb5al4upb9v._.js +3 -0
  316. package/.next/server/chunks/[root-of-the-server]__1dkmclmcfr_o2._.js +3 -0
  317. package/.next/server/chunks/[root-of-the-server]__1e8_j43j1t1m3._.js +27 -0
  318. package/.next/server/chunks/[root-of-the-server]__1fmsngpmgt-p-._.js +3 -0
  319. package/.next/server/chunks/[root-of-the-server]__1frkpeaqco77c._.js +3 -0
  320. package/.next/server/chunks/[root-of-the-server]__1gfpzuz6qe78x._.js +3 -0
  321. package/.next/server/chunks/[root-of-the-server]__1gvappei6o8kd._.js +3 -0
  322. package/.next/server/chunks/[root-of-the-server]__1h0tye6lfskvl._.js +3 -0
  323. package/.next/server/chunks/[root-of-the-server]__1hc_s6bb3tqn2._.js +3 -0
  324. package/.next/server/chunks/[root-of-the-server]__1hy_enkxk2q7n._.js +3 -0
  325. package/.next/server/chunks/[root-of-the-server]__1icr5yq0kmxsk._.js +3 -0
  326. package/.next/server/chunks/[root-of-the-server]__1j92hfszx6_cs._.js +3 -0
  327. package/.next/server/chunks/[root-of-the-server]__1jd9zchusdb14._.js +3 -0
  328. package/.next/server/chunks/[root-of-the-server]__1jey4pj050ie1._.js +3 -0
  329. package/.next/server/chunks/[root-of-the-server]__1ji7iwt_w00lv._.js +3 -0
  330. package/.next/server/chunks/[root-of-the-server]__1okwln3g2ifvb._.js +3 -0
  331. package/.next/server/chunks/[root-of-the-server]__1oy49h1nfcsne._.js +3 -0
  332. package/.next/server/chunks/[root-of-the-server]__1p4_cgasfcy73._.js +3 -0
  333. package/.next/server/chunks/[root-of-the-server]__1s21nmek1dpsc._.js +3 -0
  334. package/.next/server/chunks/[root-of-the-server]__1sk7ctcxmkco3._.js +3 -0
  335. package/.next/server/chunks/[root-of-the-server]__1sl3foar6w087._.js +3 -0
  336. package/.next/server/chunks/[root-of-the-server]__1ui10_ypv4qrw._.js +3 -0
  337. package/.next/server/chunks/[root-of-the-server]__1v5o1ch2vz7iw._.js +3 -0
  338. package/.next/server/chunks/[root-of-the-server]__1vm13gnfyoh6u._.js +3 -0
  339. package/.next/server/chunks/[root-of-the-server]__1vrtsz6125q__._.js +3 -0
  340. package/.next/server/chunks/[root-of-the-server]__1wnuzqkneu1ws._.js +3 -0
  341. package/.next/server/chunks/[root-of-the-server]__1xv0q7bppzr-w._.js +3 -0
  342. package/.next/server/chunks/[root-of-the-server]__1yzqi7jexvvzc._.js +3 -0
  343. package/.next/server/chunks/[root-of-the-server]__1zq5g6-uodrek._.js +3 -0
  344. package/.next/server/chunks/_0-ne-bwuvd_6w._.js +1 -1
  345. package/.next/server/chunks/_011-ll5i30j2e._.js +1 -1
  346. package/.next/server/chunks/_01bayc6kg7upi._.js +1 -1
  347. package/.next/server/chunks/_029zt0rilrwvt._.js +1 -1
  348. package/.next/server/chunks/_03ovgh1-4xf3f._.js +1 -1
  349. package/.next/server/chunks/_03wxfgqq6wpf_._.js +3 -0
  350. package/.next/server/chunks/_0431fxnqiloso._.js +1 -1
  351. package/.next/server/chunks/_05ans30vcd4s-._.js +1 -1
  352. package/.next/server/chunks/{_04rjm4ctjqrba._.js → _06pseal2zu-71._.js} +2 -2
  353. package/.next/server/chunks/_076-jjzrfdsdk._.js +1 -1
  354. package/.next/server/chunks/_07amw8ha9rney._.js +1 -1
  355. package/.next/server/chunks/_0819wmh2_bgt-._.js +3 -0
  356. package/.next/server/chunks/{_1fki7pamd4s-7._.js → _087uva8dkvxwz._.js} +2 -2
  357. package/.next/server/chunks/_08i9pskmlafnp._.js +1 -1
  358. package/.next/server/chunks/_09o9zamz75n5d._.js +1 -1
  359. package/.next/server/chunks/_0_3_65z6ak-5i._.js +1 -1
  360. package/.next/server/chunks/_0_5s2mrhxb3-u._.js +3 -0
  361. package/.next/server/chunks/_0_e736ff6uhew._.js +1 -1
  362. package/.next/server/chunks/_0anbzuivml30d._.js +1 -1
  363. package/.next/server/chunks/{_0edfmbz_jbxsu._.js → _0b9gke5b17vzh._.js} +2 -2
  364. package/.next/server/chunks/_0d66myj_8567o._.js +1 -1
  365. package/.next/server/chunks/_0gxi3zrkhyvx_._.js +1 -1
  366. package/.next/server/chunks/_0h1rbua_hqkox._.js +1 -1
  367. package/.next/server/chunks/_0hk9z9rqga4x-._.js +1 -1
  368. package/.next/server/chunks/_0kjatc7pcrkvz._.js +1 -1
  369. package/.next/server/chunks/_0kreo-8xn80hb._.js +1 -1
  370. package/.next/server/chunks/_0l2j3br2g32zp._.js +1 -1
  371. package/.next/server/chunks/_0lepv-j_r8kfv._.js +3 -0
  372. package/.next/server/chunks/_0lmh33cdt_1fr._.js +1 -1
  373. package/.next/server/chunks/_0lob14xk0ko5z._.js +1 -1
  374. package/.next/server/chunks/_0mt2ctbvzfero._.js +1 -1
  375. package/.next/server/chunks/_0p-sas2zxy3iv._.js +1 -1
  376. package/.next/server/chunks/_0po48rvqz03dg._.js +1 -1
  377. package/.next/server/chunks/_0pzdohc1mz5ts._.js +1 -1
  378. package/.next/server/chunks/_0qaoat396e0_3._.js +1 -1
  379. package/.next/server/chunks/_0r8u30vd4lix4._.js +3 -0
  380. package/.next/server/chunks/_0r9ejvgz0l0-0._.js +1 -1
  381. package/.next/server/chunks/_0rnn090b4_3pb._.js +3 -0
  382. package/.next/server/chunks/_0suqhfy3e5sv6._.js +1 -1
  383. package/.next/server/chunks/{_03dn7v_h3d-v8._.js → _0tkov27xr068i._.js} +8 -7
  384. package/.next/server/chunks/_0tl0cy5j96d7h._.js +1 -1
  385. package/.next/server/chunks/_0tz5wpjdgntj3._.js +1 -1
  386. package/.next/server/chunks/_0wegi_sv1s4wx._.js +1 -1
  387. package/.next/server/chunks/_0xv7-7d6dyo9-._.js +1 -1
  388. package/.next/server/chunks/_0xx4y9tk1qclc._.js +1 -1
  389. package/.next/server/chunks/_0zs7jfzzshbfq._.js +1 -1
  390. package/.next/server/chunks/_11w6ynlxuzl55._.js +1 -1
  391. package/.next/server/chunks/_12fz_vwm9jemi._.js +3 -0
  392. package/.next/server/chunks/_12i51zlq-xxrl._.js +1 -1
  393. package/.next/server/chunks/_12w5k19rc45j_._.js +1 -1
  394. package/.next/server/chunks/_12xi_xqvtrn3k._.js +3 -0
  395. package/.next/server/chunks/_13ffmxv8qrwi0._.js +1 -1
  396. package/.next/server/chunks/_14w9nrdlajz24._.js +1 -1
  397. package/.next/server/chunks/_15fpgekhvv214._.js +1 -1
  398. package/.next/server/chunks/{_043-r529chcri._.js → _1638xaazsmf2m._.js} +8 -7
  399. package/.next/server/chunks/_1647rfjflw_iq._.js +1 -1
  400. package/.next/server/chunks/_1654ui1ph-3x8._.js +3 -0
  401. package/.next/server/chunks/_16jdov0rxh99d._.js +1 -1
  402. package/.next/server/chunks/_17zw8m241gfs3._.js +1 -1
  403. package/.next/server/chunks/_18amra5328v90._.js +1 -1
  404. package/.next/server/chunks/_18hm5aaxkr500._.js +1 -1
  405. package/.next/server/chunks/_1_273cgnpyl9j._.js +1 -1
  406. package/.next/server/chunks/_1a1aqmie1d3u_._.js +1 -1
  407. package/.next/server/chunks/_1a1udq0c4_6ad._.js +1 -1
  408. package/.next/server/chunks/_1ab7h8-how0le._.js +3 -0
  409. package/.next/server/chunks/_1ahefh9733vmk._.js +3 -0
  410. package/.next/server/chunks/_1ahi8466v1b3l._.js +1 -1
  411. package/.next/server/chunks/_1almac7c09mp4._.js +3 -0
  412. package/.next/server/chunks/_1b-7g4thtxfnp._.js +3 -0
  413. package/.next/server/chunks/_1b0269xt-c8f7._.js +1 -1
  414. package/.next/server/chunks/_1b7qjlv0nxovi._.js +1 -1
  415. package/.next/server/chunks/_1be-y660a8z-q._.js +1 -1
  416. package/.next/server/chunks/_1cydcmia78z15._.js +1 -1
  417. package/.next/server/chunks/_1e8w9uuebtrcb._.js +1 -1
  418. package/.next/server/chunks/_1ev3hw7jrpp8r._.js +3 -0
  419. package/.next/server/chunks/_1ex6ovo_j2jzv._.js +1 -1
  420. package/.next/server/chunks/_1gdet1v2zk2gy._.js +1 -1
  421. package/.next/server/chunks/_1hj7iit2u6xez._.js +1 -1
  422. package/.next/server/chunks/_1hp9mnz19v199._.js +1 -1
  423. package/.next/server/chunks/_1j10upti9l6da._.js +1 -1
  424. package/.next/server/chunks/_1j8kqz21_i728._.js +1 -1
  425. package/.next/server/chunks/_1muwmr6j76v3m._.js +1 -1
  426. package/.next/server/chunks/_1pvqo-qnv-nqm._.js +1 -1
  427. package/.next/server/chunks/_1q65ai1_dwgjp._.js +1 -1
  428. package/.next/server/chunks/_1s5-ldt8xhtpp._.js +1 -1
  429. package/.next/server/chunks/_1s55l1bx-1cxp._.js +1 -1
  430. package/.next/server/chunks/_1sp0xk1c5jx5r._.js +1 -1
  431. package/.next/server/chunks/_1srq5kxah38r6._.js +1 -1
  432. package/.next/server/chunks/_1t632kndbc0tj._.js +3 -0
  433. package/.next/server/chunks/_1tahh9ric8la3._.js +1 -1
  434. package/.next/server/chunks/_1tvl0cm629nyc._.js +1 -1
  435. package/.next/server/chunks/_1u6r2cuueltfn._.js +3 -0
  436. package/.next/server/chunks/{_1-6i59jd1zhly._.js → _1vddun9dxzaqo._.js} +8 -7
  437. package/.next/server/chunks/_1xpj9uk-9zhl8._.js +1 -1
  438. package/.next/server/chunks/_1z_ujac_e_65s._.js +1 -1
  439. package/.next/server/chunks/_1zbkha-v5mkk0._.js +3 -0
  440. package/.next/server/chunks/_1zvf_gki7-g0n._.js +1 -1
  441. package/.next/server/chunks/{_0r0hnbjdq-k9-._.js → _20snsd6f1xc63._.js} +2 -2
  442. package/.next/server/chunks/_20tjujotvor53._.js +1 -1
  443. package/.next/server/chunks/node_modules_@anthropic-ai_sdk_1ulo822751toa._.js +3 -0
  444. package/.next/server/chunks/node_modules_zod_v4_classic_external_0qoqh-q5drsgn.js +4 -4
  445. package/.next/server/chunks/node_modules_zod_v4_classic_external_14kwlambv9opd.js +3 -0
  446. package/.next/server/chunks/node_modules_zod_v4_classic_external_17gmk506tz413.js +3 -0
  447. package/.next/server/chunks/node_modules_zod_v4_classic_external_1exeae-p81c94.js +3 -0
  448. package/.next/server/chunks/node_modules_zod_v4_classic_external_1giv406od1whf.js +3 -0
  449. package/.next/server/chunks/node_modules_zod_v4_classic_external_1wq100x5o7-hi.js +3 -0
  450. package/.next/server/chunks/node_modules_zod_v4_classic_external_1x8fhte3frhrw.js +3 -0
  451. package/.next/server/chunks/src_lib_0cmg152v4yi6o._.js +3 -0
  452. package/.next/server/chunks/src_lib_0dxltm34zaclb._.js +3 -0
  453. package/.next/server/chunks/src_lib_0g4wu08m-gibu._.js +3 -0
  454. package/.next/server/chunks/src_lib_0l0j89xrerf8m._.js +3 -0
  455. package/.next/server/chunks/src_lib_0osgsup3n2ypg._.js +3 -0
  456. package/.next/server/chunks/src_lib_0so-2topfosjo._.js +3 -0
  457. package/.next/server/chunks/src_lib_0whd_w99i5vmm._.js +3 -0
  458. package/.next/server/chunks/src_lib_0zeksho3data7._.js +3 -0
  459. package/.next/server/chunks/src_lib_15op6xa369-51._.js +3 -0
  460. package/.next/server/chunks/src_lib_1_m3-y2t3e4xi._.js +131 -131
  461. package/.next/server/chunks/src_lib_1d0nldjpxxl8t._.js +3 -0
  462. package/.next/server/chunks/src_lib_1d99xj4d-pofa._.js +3 -0
  463. package/.next/server/chunks/src_lib_1v5vdsc8-zp2z._.js +3 -0
  464. package/.next/server/chunks/src_lib_ai_index_ts_0m0hlq4d9zy9i._.js +1 -1
  465. package/.next/server/chunks/{src_lib_exam_ts_0d3a4q4r41hcf._.js → src_lib_exam_exam_ts_18c3t7bnr1z5k._.js} +2 -2
  466. package/.next/server/chunks/src_lib_import_import-batches_ts_0nq3mn0v5uj28._.js +3 -0
  467. package/.next/server/chunks/src_lib_import_import-tasks_ts_01f-g_upv7llt._.js +3 -0
  468. package/.next/server/chunks/src_lib_mastery-status_ts_0e9jnp-14tby5._.js +3 -0
  469. package/.next/server/chunks/src_lib_minimax-code_checkin_ts_1j1mpuxc1vgoz._.js +1 -1
  470. package/.next/server/chunks/src_lib_notebook-scope_ts_06eipvr6xztlf._.js +3 -0
  471. package/.next/server/chunks/src_lib_question_0uw17e6at-i_h._.js +3 -0
  472. package/.next/server/chunks/src_lib_question_question-analysis_ts_1-3x2cfxlr3fs._.js +3 -0
  473. package/.next/server/chunks/src_lib_question_question-deduplication_ts_0gumctesi3szc._.js +3 -0
  474. package/.next/server/chunks/src_lib_recoverable-response_ts_00y54idhlj_0e._.js +3 -0
  475. package/.next/server/chunks/src_lib_schemas_error-items_ts_0vdof4417rd3y._.js +3 -0
  476. package/.next/server/chunks/src_lib_short-id_0adg7-htn2dq_._.js +3 -0
  477. package/.next/server/chunks/src_lib_tags_retag_ts_09s5xwrzcy144._.js +3 -0
  478. package/.next/server/chunks/src_lib_tags_seed_1_ej3w-2450a0._.js +3 -0
  479. package/.next/server/chunks/src_lib_tts_19zri-v8-l_4u._.js +1 -1
  480. package/.next/server/chunks/ssr/{[root-of-the-server]__0sb3jhytba2xr._.js → [root-of-the-server]__01epe_65_8e8r._.js} +1 -1
  481. package/.next/server/chunks/ssr/{[root-of-the-server]__0ht0nkzazbnl9._.js → [root-of-the-server]__0iqnvufl6qrve._.js} +2 -2
  482. package/.next/server/chunks/ssr/{[root-of-the-server]__0mqo18mv_ooyq._.js → [root-of-the-server]__0xjcdrflb40xr._.js} +2 -2
  483. package/.next/server/chunks/ssr/{[root-of-the-server]__0x_ihemma9171._.js → [root-of-the-server]__0z7upqzuqtse6._.js} +2 -2
  484. package/.next/server/chunks/ssr/{[root-of-the-server]__03208_liub81h._.js → [root-of-the-server]__1babe6vdwxbtq._.js} +2 -2
  485. package/.next/server/chunks/ssr/_0gsk7ce3mjc-h._.js +3 -0
  486. package/.next/server/chunks/ssr/_0haie2cnycj6w._.js +32 -0
  487. package/.next/server/chunks/ssr/{_01qu892bisrf0._.js → _0j-r3zhz2ucmg._.js} +2 -2
  488. package/.next/server/chunks/ssr/{_0zacgi5-qgqwr._.js → _0mfy8kk0_omxw._.js} +1 -1
  489. package/.next/server/chunks/ssr/_0mvuvawj5-r--._.js +1 -1
  490. package/.next/server/chunks/ssr/_0rd-teluypcd2._.js +1 -1
  491. package/.next/server/chunks/ssr/_0svbyo-zufys9._.js +3 -0
  492. package/.next/server/chunks/ssr/{_186fwf-hcr_ua._.js → _101w__e2w9gr0._.js} +2 -2
  493. package/.next/server/chunks/ssr/_19hxsrrruepym._.js +1 -1
  494. package/.next/server/chunks/ssr/_1qgg_ll5hkjaf._.js +1 -1
  495. package/.next/server/chunks/ssr/{_1xv0q8o3g3r5d._.js → _1s3gqrczubor-._.js} +2 -2
  496. package/.next/server/chunks/ssr/{_1a4u3f5sc05kb._.js → _1th-xa6ci3ryc._.js} +2 -2
  497. package/.next/server/chunks/ssr/_1ux6eqqkupo6v._.js +1 -1
  498. package/.next/server/chunks/ssr/{_1pdnzaad7hk0d._.js → _1x_zn17exkc4t._.js} +2 -2
  499. package/.next/server/chunks/ssr/{_0w83jztp72o20._.js → _20593q3u-y025._.js} +2 -2
  500. package/.next/server/chunks/ssr/{node_modules_02k42jp0_uoqr._.js → node_modules_16_nl7nawmp3n._.js} +1 -1
  501. package/.next/server/chunks/ssr/{node_modules_heic-to_dist_csp_heic-to_0byqh-lbfcigr.js → node_modules_heic-to_dist_csp_heic-to_0i0ydbk94w-r3.js} +1 -1
  502. package/.next/server/chunks/ssr/{node_modules_heic-to_dist_csp_heic-to_19_dv9gdzg_e7.js → node_modules_heic-to_dist_csp_heic-to_1h62imz_ct0w_.js} +1 -1
  503. package/.next/server/chunks/ssr/src_0_qzoo_03n_v-._.js +3 -0
  504. package/.next/server/chunks/ssr/src_1gayunqs8u2e2._.js +1 -1
  505. package/.next/server/chunks/ssr/{src_0z149pjrheeb7._.js → src_1iewbwi2267a1._.js} +2 -2
  506. package/.next/server/chunks/ssr/{src_1jhctayt9gxoc._.js → src_1o5f_wr8vv-x0._.js} +2 -2
  507. package/.next/server/chunks/ssr/src_app_error-items_[id]_page_tsx_04xwwdmyh7_9q._.js +1 -1
  508. package/.next/server/chunks/ssr/src_app_exams_[id]_print_page_tsx_1i-xvhk8ul1l1._.js +1 -1
  509. package/.next/server/chunks/ssr/src_app_exams_page_tsx_17_d4_gy2i1ds._.js +1 -1
  510. package/.next/server/chunks/ssr/src_app_import-batches_[id]_page_tsx_0mhg_vriwmkkw._.js +1 -1
  511. package/.next/server/chunks/ssr/src_app_import-tasks_[id]_page_tsx_0_grj11-jdqqc._.js +1 -1
  512. package/.next/server/chunks/ssr/src_app_import-tasks_page_tsx_01983hytm-x08._.js +1 -1
  513. package/.next/server/chunks/ssr/src_app_notebooks_[id]_add_page_tsx_179tow1ql6vc_._.js +1 -1
  514. package/.next/server/chunks/ssr/src_app_notebooks_[id]_page_tsx_08njm-5-txm8_._.js +1 -1
  515. package/.next/server/chunks/ssr/src_app_notebooks_page_tsx_1p9src5gnz_40._.js +1 -1
  516. package/.next/server/chunks/ssr/src_app_page_tsx_1chiuahujsxm1._.js +1 -1
  517. package/.next/server/chunks/ssr/src_app_print-preview_page_tsx_001yt-fzrj7tf._.js +1 -1
  518. package/.next/server/chunks/ssr/src_components_correction-editor_tsx_1p7z02t66tndx._.js +2 -2
  519. package/.next/server/chunks/ssr/src_components_error-list_error-item-card_tsx_1zsiqsrj-jjd7._.js +1 -1
  520. package/.next/server/chunks/ssr/src_components_import-tasks_import-task-card_tsx_01r47qh8ryspb._.js +1 -1
  521. package/.next/server/chunks/ssr/src_components_print-preview_answer-space-control_tsx_02kuswyxklzp_._.js +1 -1
  522. package/.next/server/chunks/ssr/src_components_providers_tsx_09kw-mv3nb6xs._.js +10 -10
  523. package/.next/server/chunks/ssr/{src_lib_1vv0-aje_e-zh._.js → src_lib_0773v8b5gb93o._.js} +2 -2
  524. package/.next/server/chunks/ssr/{src_lib_0-wirad5ziskp._.js → src_lib_1qhs590-z9xnh._.js} +2 -2
  525. package/.next/server/chunks/ssr/src_lib_api-client_ts_04r2_ex-gua5i._.js +1 -1
  526. package/.next/server/chunks/ssr/src_lib_i18n_en_ts_08zkpwnoqey5s._.js +3 -0
  527. package/.next/server/chunks/ssr/src_lib_short-id_short-id-client_ts_03nnd3s0tat3l._.js +3 -0
  528. package/.next/server/middleware-build-manifest.js +3 -3
  529. package/.next/server/pages/500.html +1 -1
  530. package/.next/static/chunks/{1pdlii0oox0-7.js → 037g92rz3qjm_.js} +1 -1
  531. package/.next/static/chunks/{2cfz0fumc6ghe.js → 045cs_rolnmjd.js} +1 -1
  532. package/.next/static/chunks/077y4nms_vzwe.js +1 -0
  533. package/.next/static/chunks/{1746y345zti-9.js → 0eize8lf2hp4i.js} +2 -2
  534. package/.next/static/chunks/{3tv07cyoo_hat.js → 0gxr8rcvy4zzg.js} +1 -1
  535. package/.next/static/chunks/0njrl9jn2yde_.js +1 -0
  536. package/.next/static/chunks/{02wft51kf3t9f.js → 0ovv_fq59i4y4.js} +1 -1
  537. package/.next/static/chunks/{1uaqnxl-xshw6.js → 0uay0bmznf3g-.js} +1 -1
  538. package/.next/static/chunks/{0wcwopwk4us6h.js → 0vlsab1wxbcnl.js} +2 -2
  539. package/.next/static/chunks/{31-r0kqqw-wfd.js → 0xwz3h9d_e7kb.js} +1 -1
  540. package/.next/static/chunks/{17-num1x7o1m2.js → 1-dh1gads_tda.js} +1 -1
  541. package/.next/static/chunks/{0_xcjg47jv3ur.js → 1-qu_z3i5b8ul.js} +1 -1
  542. package/.next/static/chunks/164mvykuvwd-0.js +1 -0
  543. package/.next/static/chunks/{3oz37kz8n7y3b.js → 18bumc8ezaiy4.js} +1 -1
  544. package/.next/static/chunks/{42rupczfyygo1.js → 1ado9no6s8r2t.js} +1 -1
  545. package/.next/static/chunks/{2r5aeenvfl93p.js → 1j8eduwold2uf.js} +1 -1
  546. package/.next/static/chunks/{3fh32b9da9l_5.js → 1k2m_f0nu22fb.js} +1 -1
  547. package/.next/static/chunks/{3s_fq__cff-ps.js → 1pw6djqafgpo7.js} +2 -2
  548. package/.next/static/chunks/{2ebh36q8lvor_.js → 1xpxy-ja2ym0o.js} +1 -1
  549. package/.next/static/chunks/2jt0139jd2-i3.js +12 -0
  550. package/.next/static/chunks/2qjb14pd2n3x_.js +1 -0
  551. package/.next/static/chunks/2s6ae7khf13mi.js +12 -0
  552. package/.next/static/chunks/33fakli20_bmk.js +1 -0
  553. package/.next/static/chunks/{1egd1e1483_lj.js → 34dstd5pyqifj.js} +1 -1
  554. package/.next/static/chunks/{2924d0kl-68z7.js → 39lbv0arntrnf.js} +10 -10
  555. package/.next/static/chunks/3_w-p8241f5rv.js +1 -0
  556. package/.next/static/chunks/{3wch6vphcivq5.js → 3j92h-4k4_o_f.js} +1 -1
  557. package/.next/static/chunks/{4441xuc3i-yb7.js → 3rnbnqcge4lza.js} +1 -1
  558. package/.next/static/chunks/{2qqyq-iqkv_oa.js → 3snn9aaz5n95k.js} +2 -2
  559. package/.next/static/chunks/{1o_q928xcfjs3.js → 43btem6mtf_gh.js} +1 -1
  560. package/dist-scripts/scripts/rebuild-system-tags.js +11 -107
  561. package/dist-scripts/scripts/seed-chinese-primary.js +1 -1
  562. package/dist-scripts/src/lib/logger.js +1 -0
  563. package/dist-scripts/src/lib/tags/seed/rebuild.js +103 -0
  564. package/dist-scripts/src/lib/{seed-chinese-tags.js → tags/seed/seed-chinese-tags.js} +2 -1
  565. package/package.json +1 -1
  566. package/prisma/seed.db +0 -0
  567. package/.next/server/chunks/[root-of-the-server]__012pau7crikop._.js +0 -3
  568. package/.next/server/chunks/[root-of-the-server]__01jc87mm42cex._.js +0 -3
  569. package/.next/server/chunks/[root-of-the-server]__01newhoirvvb2._.js +0 -3
  570. package/.next/server/chunks/[root-of-the-server]__02oqd6w58wymi._.js +0 -3
  571. package/.next/server/chunks/[root-of-the-server]__057qz9ucs7lib._.js +0 -3
  572. package/.next/server/chunks/[root-of-the-server]__06_pvs6rg70ri._.js +0 -3
  573. package/.next/server/chunks/[root-of-the-server]__06jad9cnzeci-._.js +0 -3
  574. package/.next/server/chunks/[root-of-the-server]__0_uvtfu0yr-na._.js +0 -27
  575. package/.next/server/chunks/[root-of-the-server]__0_vinl1oembls._.js +0 -3
  576. package/.next/server/chunks/[root-of-the-server]__0ahni9caaouya._.js +0 -3
  577. package/.next/server/chunks/[root-of-the-server]__0aq01totjzgkp._.js +0 -3
  578. package/.next/server/chunks/[root-of-the-server]__0b5mh_vi6e246._.js +0 -3
  579. package/.next/server/chunks/[root-of-the-server]__0b5qyqwq6mk5v._.js +0 -3
  580. package/.next/server/chunks/[root-of-the-server]__0b79cd6lae7ep._.js +0 -3
  581. package/.next/server/chunks/[root-of-the-server]__0b_zf20owrv7l._.js +0 -3
  582. package/.next/server/chunks/[root-of-the-server]__0cel4yig3zcho._.js +0 -3
  583. package/.next/server/chunks/[root-of-the-server]__0cu5jz9b3f0i1._.js +0 -3
  584. package/.next/server/chunks/[root-of-the-server]__0d818ux928r5h._.js +0 -3
  585. package/.next/server/chunks/[root-of-the-server]__0dclcdg0hwxxj._.js +0 -3
  586. package/.next/server/chunks/[root-of-the-server]__0e13o3ny66zb3._.js +0 -3
  587. package/.next/server/chunks/[root-of-the-server]__0fg20m1i6x4y9._.js +0 -3
  588. package/.next/server/chunks/[root-of-the-server]__0fhy87hr0_glw._.js +0 -3
  589. package/.next/server/chunks/[root-of-the-server]__0fnte1x8xdn5o._.js +0 -3
  590. package/.next/server/chunks/[root-of-the-server]__0glupa52ge074._.js +0 -3
  591. package/.next/server/chunks/[root-of-the-server]__0gphporvvjc0d._.js +0 -3
  592. package/.next/server/chunks/[root-of-the-server]__0gs7-3gi0pdws._.js +0 -3
  593. package/.next/server/chunks/[root-of-the-server]__0i2mt6zjxbq--._.js +0 -3
  594. package/.next/server/chunks/[root-of-the-server]__0ijq_d0gr5zo8._.js +0 -3
  595. package/.next/server/chunks/[root-of-the-server]__0iqp1f0-yvbhw._.js +0 -3
  596. package/.next/server/chunks/[root-of-the-server]__0jk-9m6ra-_um._.js +0 -3
  597. package/.next/server/chunks/[root-of-the-server]__0jvusk64khb-a._.js +0 -3
  598. package/.next/server/chunks/[root-of-the-server]__0k0c90ih7n0te._.js +0 -3
  599. package/.next/server/chunks/[root-of-the-server]__0maxg52nxqrzi._.js +0 -3
  600. package/.next/server/chunks/[root-of-the-server]__0ml-m3il4unb6._.js +0 -3
  601. package/.next/server/chunks/[root-of-the-server]__0nkrql6or-tf_._.js +0 -3
  602. package/.next/server/chunks/[root-of-the-server]__0nujsu6qbn-8o._.js +0 -27
  603. package/.next/server/chunks/[root-of-the-server]__0ovdiut1h8kkt._.js +0 -3
  604. package/.next/server/chunks/[root-of-the-server]__0p5_lv_pjxr5f._.js +0 -3
  605. package/.next/server/chunks/[root-of-the-server]__0p8wlug4uvmvi._.js +0 -3
  606. package/.next/server/chunks/[root-of-the-server]__0ptn9j1rleieh._.js +0 -3
  607. package/.next/server/chunks/[root-of-the-server]__0r7f34_38kmvk._.js +0 -3
  608. package/.next/server/chunks/[root-of-the-server]__0u3m78xhq8b3l._.js +0 -3
  609. package/.next/server/chunks/[root-of-the-server]__0ualui9b50ufh._.js +0 -3
  610. package/.next/server/chunks/[root-of-the-server]__0ujfft7untkmq._.js +0 -3
  611. package/.next/server/chunks/[root-of-the-server]__0vw7u-y__gk7p._.js +0 -3
  612. package/.next/server/chunks/[root-of-the-server]__0w53aflmo1keg._.js +0 -3
  613. package/.next/server/chunks/[root-of-the-server]__0wdjzoxwwh6bn._.js +0 -3
  614. package/.next/server/chunks/[root-of-the-server]__0wx65sza19ou-._.js +0 -3
  615. package/.next/server/chunks/[root-of-the-server]__0xj_313186tqc._.js +0 -3
  616. package/.next/server/chunks/[root-of-the-server]__0yv_kznxz5qzn._.js +0 -3
  617. package/.next/server/chunks/[root-of-the-server]__0zldj8zxo-hvc._.js +0 -3
  618. package/.next/server/chunks/[root-of-the-server]__1-djdd7tnb-n7._.js +0 -3
  619. package/.next/server/chunks/[root-of-the-server]__109pj952qxtan._.js +0 -3
  620. package/.next/server/chunks/[root-of-the-server]__10gp75p89v9a2._.js +0 -3
  621. package/.next/server/chunks/[root-of-the-server]__111jxitdjhuoj._.js +0 -3
  622. package/.next/server/chunks/[root-of-the-server]__112w8xm57okk5._.js +0 -3
  623. package/.next/server/chunks/[root-of-the-server]__12h4ckd6f76pb._.js +0 -3
  624. package/.next/server/chunks/[root-of-the-server]__12ig6-5hpb7s-._.js +0 -3
  625. package/.next/server/chunks/[root-of-the-server]__13_k7w8nrx7ie._.js +0 -3
  626. package/.next/server/chunks/[root-of-the-server]__14c50fhuh_abo._.js +0 -3
  627. package/.next/server/chunks/[root-of-the-server]__14jpfgwnpc9gl._.js +0 -3
  628. package/.next/server/chunks/[root-of-the-server]__14m8fewwq1xs6._.js +0 -3
  629. package/.next/server/chunks/[root-of-the-server]__15qkqztuygnfg._.js +0 -3
  630. package/.next/server/chunks/[root-of-the-server]__166997w1su5wq._.js +0 -3
  631. package/.next/server/chunks/[root-of-the-server]__16xl11-irmhu3._.js +0 -3
  632. package/.next/server/chunks/[root-of-the-server]__19i64i9v32y8o._.js +0 -3
  633. package/.next/server/chunks/[root-of-the-server]__19jqc7tzna13p._.js +0 -3
  634. package/.next/server/chunks/[root-of-the-server]__1asgy7sah0mo6._.js +0 -3
  635. package/.next/server/chunks/[root-of-the-server]__1av1l48rnghpa._.js +0 -3
  636. package/.next/server/chunks/[root-of-the-server]__1azaa45m60iqm._.js +0 -3
  637. package/.next/server/chunks/[root-of-the-server]__1d159cxbdta68._.js +0 -3
  638. package/.next/server/chunks/[root-of-the-server]__1dmp3ynxbcyjz._.js +0 -3
  639. package/.next/server/chunks/[root-of-the-server]__1dom1le7wqh7d._.js +0 -3
  640. package/.next/server/chunks/[root-of-the-server]__1e5tjfwab0exu._.js +0 -3
  641. package/.next/server/chunks/[root-of-the-server]__1f-7-l2abs15s._.js +0 -3
  642. package/.next/server/chunks/[root-of-the-server]__1fe2v2mv5-rgo._.js +0 -3
  643. package/.next/server/chunks/[root-of-the-server]__1fepss7g57apj._.js +0 -3
  644. package/.next/server/chunks/[root-of-the-server]__1ff3h7ockrpdf._.js +0 -3
  645. package/.next/server/chunks/[root-of-the-server]__1g11271g0z55n._.js +0 -3
  646. package/.next/server/chunks/[root-of-the-server]__1g6jrwm72xr8a._.js +0 -3
  647. package/.next/server/chunks/[root-of-the-server]__1he8kk4382-0h._.js +0 -3
  648. package/.next/server/chunks/[root-of-the-server]__1hk5kgctlp2wn._.js +0 -3
  649. package/.next/server/chunks/[root-of-the-server]__1j44_t992y-1-._.js +0 -3
  650. package/.next/server/chunks/[root-of-the-server]__1k4f33-z95_7c._.js +0 -3
  651. package/.next/server/chunks/[root-of-the-server]__1k4pnhbw4rgzs._.js +0 -3
  652. package/.next/server/chunks/[root-of-the-server]__1kx3a0dm7l2wl._.js +0 -3
  653. package/.next/server/chunks/[root-of-the-server]__1lea5m7hl1n7f._.js +0 -3
  654. package/.next/server/chunks/[root-of-the-server]__1m7pja8jp27eh._.js +0 -3
  655. package/.next/server/chunks/[root-of-the-server]__1m_y4afrn94oy._.js +0 -3
  656. package/.next/server/chunks/[root-of-the-server]__1ruzcenko2gi1._.js +0 -3
  657. package/.next/server/chunks/[root-of-the-server]__1sf2oa2wkqf_0._.js +0 -3
  658. package/.next/server/chunks/[root-of-the-server]__1t6aypqxgjkg_._.js +0 -3
  659. package/.next/server/chunks/[root-of-the-server]__1tffqae521gxo._.js +0 -3
  660. package/.next/server/chunks/[root-of-the-server]__1to25zgnk7xk-._.js +0 -3
  661. package/.next/server/chunks/[root-of-the-server]__1u5c7agj_phnb._.js +0 -3
  662. package/.next/server/chunks/[root-of-the-server]__1vbof6uu4he_-._.js +0 -3
  663. package/.next/server/chunks/[root-of-the-server]__1wfhdwfdvc6j3._.js +0 -3
  664. package/.next/server/chunks/[root-of-the-server]__1y0n2tg-0l636._.js +0 -3
  665. package/.next/server/chunks/[root-of-the-server]__1zc0bmdyn1lg4._.js +0 -3
  666. package/.next/server/chunks/[root-of-the-server]__1zqfz2rc4i280._.js +0 -3
  667. package/.next/server/chunks/[root-of-the-server]__207c97dbcdb0z._.js +0 -3
  668. package/.next/server/chunks/[root-of-the-server]__20cdqectwle3j._.js +0 -3
  669. package/.next/server/chunks/[root-of-the-server]__20dy4zclqbnw8._.js +0 -3
  670. package/.next/server/chunks/[root-of-the-server]__212aaltyh6kc2._.js +0 -3
  671. package/.next/server/chunks/_01y7-j4vx6cu5._.js +0 -3
  672. package/.next/server/chunks/_0_rhee7wb6tcg._.js +0 -3
  673. package/.next/server/chunks/_0at03z7sgwdv3._.js +0 -3
  674. package/.next/server/chunks/_0ge95_bkwrkmc._.js +0 -3
  675. package/.next/server/chunks/_0lj59y-ytysr5._.js +0 -3
  676. package/.next/server/chunks/_0v762_h-sp94d._.js +0 -3
  677. package/.next/server/chunks/_0vshwghrjetxu._.js +0 -3
  678. package/.next/server/chunks/_0z0zrluul2idw._.js +0 -3
  679. package/.next/server/chunks/_1a1oatugfke1p._.js +0 -3
  680. package/.next/server/chunks/_1fgb9ve_nfat4._.js +0 -3
  681. package/.next/server/chunks/_1fsfy4c3rj36b._.js +0 -3
  682. package/.next/server/chunks/_1hc_es1a3cl6a._.js +0 -3
  683. package/.next/server/chunks/_1m-yyz-pl9-03._.js +0 -3
  684. package/.next/server/chunks/_1ns6y6y2tq8sh._.js +0 -3
  685. package/.next/server/chunks/_1yujnc0thk8ab._.js +0 -3
  686. package/.next/server/chunks/_211va-dk9519v._.js +0 -3
  687. package/.next/server/chunks/src_lib_0_g_0q-n01g-x._.js +0 -3
  688. package/.next/server/chunks/src_lib_0au5a9-5rxkab._.js +0 -3
  689. package/.next/server/chunks/src_lib_0d7kmnt7v2np8._.js +0 -3
  690. package/.next/server/chunks/src_lib_0fedb0fkc3km1._.js +0 -3
  691. package/.next/server/chunks/src_lib_0okewfjk6p2ci._.js +0 -3
  692. package/.next/server/chunks/src_lib_0ptvn4_15zxu0._.js +0 -3
  693. package/.next/server/chunks/src_lib_0rb6u4i7kn30r._.js +0 -3
  694. package/.next/server/chunks/src_lib_0svj7bkzyw9oc._.js +0 -3
  695. package/.next/server/chunks/src_lib_10is5pyogge95._.js +0 -3
  696. package/.next/server/chunks/src_lib_12j7n__96zd0q._.js +0 -3
  697. package/.next/server/chunks/src_lib_13hd5uoi-53hn._.js +0 -3
  698. package/.next/server/chunks/src_lib_1chbt4n9_vpoj._.js +0 -3
  699. package/.next/server/chunks/src_lib_1geq39r7va9gy._.js +0 -3
  700. package/.next/server/chunks/src_lib_1h4xeb9lyx31r._.js +0 -3
  701. package/.next/server/chunks/src_lib_1qvj-3jt4jbq7._.js +0 -3
  702. package/.next/server/chunks/src_lib_1smlosz37xitx._.js +0 -3
  703. package/.next/server/chunks/src_lib_1squodf4swo_a._.js +0 -3
  704. package/.next/server/chunks/src_lib_1uei_xjjj3g7_._.js +0 -3
  705. package/.next/server/chunks/src_lib_1vt5vsj108u_q._.js +0 -3
  706. package/.next/server/chunks/src_lib_api-errors_ts_1gfd4ojz7efro._.js +0 -3
  707. package/.next/server/chunks/src_lib_figure-scale_ts_215n0ebzz7mr7._.js +0 -3
  708. package/.next/server/chunks/src_lib_import-batches_ts_0aekmggdwo_9-._.js +0 -3
  709. package/.next/server/chunks/src_lib_import-tasks_ts_1f4ejsy00-v1t._.js +0 -3
  710. package/.next/server/chunks/src_lib_question-analysis_ts_15_8r_pxmtd06._.js +0 -3
  711. package/.next/server/chunks/src_lib_question-deduplication_ts_1p1bik-vwl9ue._.js +0 -3
  712. package/.next/server/chunks/src_lib_retag_ts_0eu8ld_86kt3a._.js +0 -3
  713. package/.next/server/chunks/ssr/_01rfvhncgnpvl._.js +0 -3
  714. package/.next/server/chunks/ssr/_11820i-k62560._.js +0 -3
  715. package/.next/server/chunks/ssr/_1ujx-n3muyaxs._.js +0 -32
  716. package/.next/server/chunks/ssr/src_1vhiktxz2_jj3._.js +0 -3
  717. package/.next/server/chunks/ssr/src_lib_short-id-client_ts_1v7n6pg50kguj._.js +0 -3
  718. package/.next/static/chunks/0-hqh6zs3hidn.js +0 -12
  719. package/.next/static/chunks/02xikk3wlibg1.js +0 -1
  720. package/.next/static/chunks/0e6ximjg-pqgt.js +0 -1
  721. package/.next/static/chunks/0y5zywo-ll2w3.js +0 -1
  722. package/.next/static/chunks/17dk_oppf9-hv.js +0 -12
  723. package/.next/static/chunks/38vt_4ntvy02e.js +0 -1
  724. /package/.next/static/{E10D9dv115hLNvX7vE6qA → P3mJPGERki1060-s7tC9h}/_buildManifest.js +0 -0
  725. /package/.next/static/{E10D9dv115hLNvX7vE6qA → P3mJPGERki1060-s7tC9h}/_clientMiddlewareManifest.js +0 -0
  726. /package/.next/static/{E10D9dv115hLNvX7vE6qA → P3mJPGERki1060-s7tC9h}/_ssgManifest.js +0 -0
  727. /package/dist-scripts/src/lib/{tag-data → tags/data}/biology.js +0 -0
  728. /package/dist-scripts/src/lib/{tag-data → tags/data}/chemistry.js +0 -0
  729. /package/dist-scripts/src/lib/{tag-data → tags/data}/chinese.js +0 -0
  730. /package/dist-scripts/src/lib/{tag-data → tags/data}/english.js +0 -0
  731. /package/dist-scripts/src/lib/{tag-data → tags/data}/geography.js +0 -0
  732. /package/dist-scripts/src/lib/{tag-data → tags/data}/history.js +0 -0
  733. /package/dist-scripts/src/lib/{tag-data → tags/data}/index.js +0 -0
  734. /package/dist-scripts/src/lib/{tag-data → tags/data}/math-gaosi.js +0 -0
  735. /package/dist-scripts/src/lib/{tag-data → tags/data}/math.js +0 -0
  736. /package/dist-scripts/src/lib/{tag-data → tags/data}/physics.js +0 -0
  737. /package/dist-scripts/src/lib/{tag-data → tags/data}/politics.js +0 -0
@@ -3,7 +3,7 @@
3
3
  - less than the value passed to \`max\` (or 100 if no \`max\` prop is set)
4
4
  - \`null\` or \`undefined\` if the progress is indeterminate.
5
5
 
6
- Defaulting to \`null\`.`}d(p,"defaultGetValueLabel"),d(v,"getProgressState"),d(y,"isNumber"),d(j,"isValidMaxNumber"),d(w,"isValidValueNumber"),d(b,"getInvalidMaxError"),d(k,"getInvalidValueError");var N=e.i(975157);let S=i.forwardRef(({className:e,value:t,...r},s)=>(0,a.jsx)(g,{ref:s,value:t,className:(0,N.f)("relative h-4 w-full overflow-hidden rounded-full bg-secondary",e),...r,children:(0,a.jsx)(h,{className:"h-full w-full flex-1 bg-primary transition-all",style:{transform:`translateX(-${100-(t||0)}%)`}})}));S.displayName=g.displayName,e.s(["f",0,S],168148)},856522,e=>{var t=e.i(456420);let r={name:"save",size:24,node:[["path",{d:"M15.2 3a2 2 0 0 1 1.4.6l3.8 3.8a2 2 0 0 1 .6 1.4V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2z",key:"1c8476"}],["path",{d:"M17 21v-7a1 1 0 0 0-1-1H8a1 1 0 0 0-1 1v7",key:"1ydtos"}],["path",{d:"M7 3v4a1 1 0 0 0 1 1h7",key:"t51u73"}]]};r.node;let s=(0,t.f)(r);e.s(["f",0,s],856522)},786563,e=>{var t=e.i(456420);let r={name:"star",size:24,node:[["path",{d:"M11.525 2.295a.53.53 0 0 1 .95 0l2.31 4.679a2.123 2.123 0 0 0 1.595 1.16l5.166.756a.53.53 0 0 1 .294.904l-3.736 3.638a2.123 2.123 0 0 0-.611 1.878l.882 5.14a.53.53 0 0 1-.771.56l-4.618-2.428a2.122 2.122 0 0 0-1.973 0L6.396 21.01a.53.53 0 0 1-.77-.56l.881-5.139a2.122 2.122 0 0 0-.611-1.879L2.16 9.795a.53.53 0 0 1 .294-.906l5.165-.755a2.122 2.122 0 0 0 1.597-1.16z",key:"r04s7s"}]]};r.node;let s=(0,t.f)(r);e.s(["f",0,s],786563)},866531,497346,752012,e=>{var t=e.i(843476),r=e.i(271645),s=e.i(632781),a=e.i(741120),i=e.i(856522),n=e.i(314381),l=e.i(3198),o=e.i(519455),d=e.i(111110),c=e.i(41931),u=e.i(294114),m=e.i(201276);function f({data:e,onChange:a}){let{t:i}=(0,d.b)(),[x,g]=(0,r.useState)(!1),[h,p]=(0,r.useState)(null),v=async()=>{if(!e.questionText.trim())return void u.c.warning(i.editor.enterQuestionFirst||"Please enter question text first");if(!e.answerText.trim())return void u.c.warning(i.geogebra.answerRequired);g(!0),p(null);try{let t=await c.k.post("/api/geogebra-analyze",{questionText:e.questionText,answerText:e.answerText,analysis:e.analysis},{timeout:18e4,recoverable:!0});t.suitable&&t.commands&&t.commands.length>0?a({geogebraCommands:JSON.stringify(t.commands)}):p(t.description||i.geogebra.notSuitable)}catch(e){m.V.error("[CorrectionEditor]","GeoGebra analysis failed",{error:e}),p(i.geogebra.analyzeFailed)}finally{g(!1)}};return e.geogebraCommands?(0,t.jsx)(l.f,{commands:e.geogebraCommands,height:350,onRegenerate:v,onDelete:async()=>a({geogebraCommands:void 0})}):e.questionText.trim()&&e.answerText.trim()?(0,t.jsxs)("div",{className:"rounded-lg border border-dashed p-4",children:[(0,t.jsxs)("div",{className:"flex items-center justify-between",children:[(0,t.jsxs)("div",{className:"flex items-center gap-2 text-sm text-muted-foreground",children:[(0,t.jsx)(n.f,{className:"h-4 w-4"}),(0,t.jsx)("span",{children:i.geogebra.title})]}),(0,t.jsx)(o.f,{variant:"outline",size:"sm",onClick:v,disabled:x,children:x?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(s.f,{className:"mr-2 h-4 w-4 animate-spin"}),i.geogebra.analyzing]}):(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(n.f,{className:"mr-2 h-4 w-4"}),i.geogebra.generate]})})]}),h&&(0,t.jsx)("p",{className:"text-xs text-muted-foreground mt-2",children:h}),(0,t.jsx)("p",{className:"text-xs text-muted-foreground mt-2",children:i.geogebra.hint})]}):null}var x=e.i(469937),g=e.i(28342),h=e.i(438465),p=e.i(674166),v=e.i(110204);function y({data:e,paperLevel:r,onChange:s}){let{t:a}=(0,d.b)();return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsx)(v.f,{children:a.editor.selectNotebook||"Select Notebook"}),(0,t.jsx)(h.f,{value:e.subjectId,onChange:e=>s({subjectId:e})})]}),(0,t.jsxs)("div",{className:"grid grid-cols-2 gap-4",children:[(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsx)(v.f,{htmlFor:"correction-grade-semester",children:a.editor.gradeSemester||"Grade/Semester"}),(0,t.jsx)(g.f,{id:"correction-grade-semester",value:e.gradeSemester||"",onChange:e=>s({gradeSemester:e})})]}),(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsx)(v.f,{children:a.editor.paperLevel||"Paper Level"}),(0,t.jsx)(p.f,{value:r,onChange:e=>s({paperLevel:e})})]})]}),(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsx)(v.f,{children:a.difficulty.label}),(0,t.jsx)("div",{children:(0,t.jsx)(x.f,{size:"md",value:e.difficultyStars,onChange:e=>s({difficultyStars:e})})})]})]})}var j=e.i(141176),w=e.i(515288),b=e.i(967489);function k({data:e,onChange:r}){let{t:s}=(0,d.b)();return(0,t.jsxs)(w.N,{children:[(0,t.jsx)(w.Y,{children:(0,t.jsx)(w.v,{children:s.editor.mistakeAnalysisTitle||"Mistake Analysis"})}),(0,t.jsxs)(w.O,{className:"space-y-4",children:[(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsx)(v.f,{children:s.editor.mistakeStatus||"Attempt Status"}),(0,t.jsxs)(b.d,{value:e.mistakeStatus||"unknown",onValueChange:e=>r({mistakeStatus:e}),children:[(0,t.jsx)(b.P,{children:(0,t.jsx)(b.U,{})}),(0,t.jsxs)(b.r,{children:[(0,t.jsx)(b.T,{value:"not_attempted",children:s.editor.mistakeStatuses?.notAttempted||"Not attempted"}),(0,t.jsx)(b.T,{value:"wrong_attempt",children:s.editor.mistakeStatuses?.wrongAttempt||"Wrong attempt"}),(0,t.jsx)(b.T,{value:"unknown",children:s.editor.mistakeStatuses?.unknown||"Unknown"})]})]})]}),(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsx)(v.f,{children:s.editor.wrongAnswerText||"Wrong Answer / Work"}),(0,t.jsx)(j.f,{value:e.wrongAnswerText||"",onChange:t=>r({wrongAnswerText:t,mistakeStatus:t.trim()?"wrong_attempt":e.mistakeStatus}),className:"min-h-[100px] font-mono text-sm",placeholder:s.editor.wrongAnswerPlaceholder||"Leave blank if no wrong answer is visible"})]}),(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsx)(v.f,{children:s.editor.mistakeAnalysis||"Mistake Cause Analysis"}),(0,t.jsx)(j.f,{value:e.mistakeAnalysis||"",onChange:e=>r({mistakeAnalysis:e}),className:"min-h-[140px] font-mono text-sm",placeholder:s.editor.mistakeAnalysisPlaceholder||"Explain where and why the mistake happened"})]})]})]})}var N=e.i(511445),S=e.i(149704);function A({title:e,children:r,className:s}){return(0,t.jsxs)(w.N,{children:[(0,t.jsx)(w.Y,{children:(0,t.jsx)(w.v,{children:e})}),(0,t.jsx)(w.O,{className:s,children:r})]})}function T({data:e,children:r}){let{t:s}=(0,d.b)(),a={wrong_attempt:s.editor.mistakeStatuses?.wrongAttempt||"Wrong attempt",not_attempted:s.editor.mistakeStatuses?.notAttempted||"Not attempted",unknown:s.editor.mistakeStatuses?.unknown||"Unknown"};return(0,t.jsxs)("div",{className:"space-y-6",children:[(0,t.jsxs)(A,{title:s.editor.preview?.question||"Question Preview",children:[(0,t.jsx)(N.f,{content:e.questionText}),(0,t.jsx)(S.f,{svg:e.figureSvg})]}),r,(0,t.jsx)(A,{title:s.editor.preview?.answer||"Answer Preview",children:(0,t.jsx)(N.f,{content:e.answerText})}),(0,t.jsx)(A,{title:s.editor.preview?.analysis||"Analysis Preview",children:(0,t.jsx)(N.f,{content:e.analysis})}),(0,t.jsxs)(A,{title:s.editor.preview?.mistakeAnalysis||"Mistake Analysis Preview",className:"space-y-3 text-sm",children:[(0,t.jsxs)("div",{className:"text-muted-foreground",children:[s.editor.mistakeStatus||"Attempt Status",s.common.colon,a[e.mistakeStatus]??a.unknown]}),e.wrongAnswerText&&(0,t.jsxs)("div",{children:[(0,t.jsx)("div",{className:"font-medium mb-1",children:s.editor.wrongAnswerText||"Wrong Answer / Work"}),(0,t.jsx)(N.f,{content:e.wrongAnswerText})]}),e.mistakeAnalysis&&(0,t.jsxs)("div",{children:[(0,t.jsx)("div",{className:"font-medium mb-1",children:s.editor.mistakeAnalysis||"Mistake Cause Analysis"}),(0,t.jsx)(N.f,{content:e.mistakeAnalysis})]})]})]})}var E=e.i(574041),I=e.i(215519),C=e.i(306831);e.i(676167);var _=e.i(952122),R=e.i(62825),V=e.i(664030),$=e.i(303163);e.s(["f",0,function({initialData:e,onSave:n,onCancel:l,imagePreview:x,initialSubjectId:g,aiTimeout:h}){let{timeZone:p}=(0,I.M)(),{t:b,language:N}=(0,d.b)(),[S,A]=(0,r.useState)({...e,wrongAnswerText:e.wrongAnswerText||"",mistakeAnalysis:e.mistakeAnalysis||"",mistakeStatus:e.mistakeStatus||"unknown",subjectId:g,gradeSemester:e.gradeSemester||""}),M=(0,r.useRef)(!1),O=e=>{"gradeSemester"in e&&(M.current=!0),A(t=>({...t,...e}))},{groups:z}=(0,V.f)(),L=(()=>{if(S.paperLevel)return S.paperLevel;let e="number"==typeof S.difficultyStars&&S.difficultyStars>=4?"b":"a";return z.find(t=>t.key===e&&t.isActive)?.id||""})(),G=S.paperLevel??L,[P,U]=(0,r.useState)(!1),[F,D]=(0,r.useState)(!1),[q,H]=(0,r.useState)(!1),[Q,B]=(0,r.useState)(void 0),[W,Z]=(0,r.useState)([]);(0,r.useEffect)(()=>{c.k.get("/api/notebooks").then(Z).catch(e=>m.V.error("[CorrectionEditor]","Failed to fetch notebooks",{error:e})),c.k.get("/api/user").then(e=>{if(H(!!e?.enableGeogebra),e){let t=function(e,t=C.J){return"ai"===e.gradeRecognitionMode?null:e.fixedGradeSemester?e.fixedGradeSemester:e.educationStage&&e.enrollmentYear?function(e,t,r=new Date,s="en",a=C.J){let i=(0,C.c)(r,a),n=i.getFullYear(),l=i.getMonth()+1,o=n-t,d="2nd";l>=9?(o+=1,d="1st"):d=l<2?"1st":"2nd";let c="zh"===s,u=c?"1st"===d?"上期":"下期":"1st"===d?"1st Semester":"2nd Semester",m=(c?{primary:["一年级","二年级","三年级","四年级","五年级","六年级"],junior_high:["初一","初二","初三"],senior_high:["高一","高二","高三"],university:["大一","大二","大三","大四"]}:{primary:["Grade 1","Grade 2","Grade 3","Grade 4","Grade 5","Grade 6"],junior_high:["Junior High Grade 1","Junior High Grade 2","Junior High Grade 3"],senior_high:["Senior High Grade 1","Senior High Grade 2","Senior High Grade 3"],university:["Freshman","Sophomore","Junior","Senior"]})[e]||[],f=`${o}`;if(f=o>0&&o<=m.length?m[o-1]:o>m.length?c?"已毕业":"Graduated":c?"学前":"Pre-school",!c)return`${f}, ${u}`;{let e="1st"===d?"上":"下";return`${f}${e}`}}(e.educationStage,e.enrollmentYear,new Date,"zh",t):null}(e,p);A(e=>e.gradeSemester||M.current?e:{...e,gradeSemester:t||""}),B(e.educationStage||void 0)}}).catch(e=>m.V.error("[CorrectionEditor]","Failed to fetch user info for grade calculation",{error:e}))},[N,p]);let J=async()=>{if(!S.questionText.trim())return void u.c.warning(b.editor.enterQuestionFirst||"Please enter question text first");U(!0);try{let e=function({questionText:e,language:t,subject:r,imagePreview:s,gradeSemester:a,subjectId:i}){let n={questionText:e,language:t,subject:r};return s&&(n.imageBase64=s),a&&(n.gradeSemester=a),i&&(n.subjectId=i),n}({questionText:S.questionText,language:N,subject:S.subject,imagePreview:x,gradeSemester:S.gradeSemester??void 0,subjectId:S.subjectId});m.V.info("[Reanswer]",e.imageBase64?"Sending image + text (image available for mistake analysis)":"Sending text only (no image available)",{timeout:h});let t=await c.k.post("/api/reanswer",e,{timeout:h||18e4,recoverable:!0});A(e=>({...e,answerText:t.answerText,analysis:t.analysis,knowledgePoints:t.knowledgePoints,wrongAnswerText:t.wrongAnswerText||"",mistakeAnalysis:t.mistakeAnalysis||"",mistakeStatus:(0,R.x)(t.mistakeStatus,t.wrongAnswerText),difficultyStars:t.difficultyStars??e.difficultyStars})),u.c.success(b.editor.reanswerSuccess||"✅ Answer and analysis updated!")}catch(s){let e,t,r;m.V.error("[CorrectionEditor]","Reanswer failed",{error:s}),u.c.error((e=(0,$.d)(s)||"",r=(t=b.errors?.reanswer||{}).default||"Reanswer failed",e.includes("AI_AUTH_ERROR")?t.authError||b.errors?.AI_AUTH_ERROR||r:e.includes("AI_CONNECTION_FAILED")?t.connectionFailed||b.errors?.AI_CONNECTION_FAILED||r:e.includes("AI_RESPONSE_ERROR")&&(t.responseError||b.errors?.AI_RESPONSE_ERROR)||r))}finally{U(!1)}},Y=async()=>{if(!S.subjectId)return void u.c.warning(b.editor.messages?.selectNotebook||"Please select a notebook");if(!F){D(!0);try{await n({...S,paperLevel:G,mistakeStatus:(0,R.x)(S.mistakeStatus,S.wrongAnswerText)})}finally{D(!1)}}},X=b.editor.placeholder||"Supports Markdown and LaTeX...",K=(0,_.f)(W.find(e=>e.id===S.subjectId)?.name||null)||(0,_.f)(S.subject||null)||void 0;return(0,t.jsxs)("div",{className:"space-y-6",children:[(0,t.jsxs)("div",{className:"flex items-center justify-between",children:[(0,t.jsx)("h2",{className:"text-2xl font-bold",children:b.editor.title}),(0,t.jsxs)("div",{className:"flex gap-2",children:[(0,t.jsx)(o.f,{variant:"outline",onClick:l,children:b.editor.cancel}),(0,t.jsxs)(o.f,{onClick:Y,disabled:F,children:[F?(0,t.jsx)(s.f,{className:"mr-2 h-4 w-4 animate-spin"}):(0,t.jsx)(i.f,{className:"mr-2 h-4 w-4"}),F?b.common?.pleaseWait||"Please wait...":b.editor.save]})]})]}),(0,t.jsxs)("div",{className:"grid gap-6 lg:grid-cols-2",children:[(0,t.jsxs)("div",{className:"space-y-6",children:[x&&(0,t.jsx)(w.N,{children:(0,t.jsx)(w.O,{className:"p-4",children:(0,t.jsx)("img",{src:x,alt:"Original",className:"w-full rounded-md"})})}),(0,t.jsx)(y,{data:S,paperLevel:G,onChange:O}),(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsx)(v.f,{children:b.editor.question}),(0,t.jsx)(j.f,{value:S.questionText,onChange:e=>O({questionText:e}),className:"min-h-[150px] font-mono text-sm",placeholder:X}),(0,t.jsx)(o.f,{variant:"default",size:"sm",onClick:J,disabled:P||!S.questionText.trim(),className:"w-full bg-gradient-to-r from-indigo-600 to-violet-500 hover:from-indigo-700 hover:to-violet-600 text-white font-medium",children:P?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(s.f,{className:"mr-2 h-4 w-4 animate-spin"}),b.editor.reanswering||"AI solving..."]}):(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(a.f,{className:"mr-2 h-4 w-4"}),b.editor.reanswer||"🔄 Reanswer (based on corrected question)"]})}),(0,t.jsx)("p",{className:"text-xs text-muted-foreground",children:b.editor.reanswerHint||"💡 If the question was misrecognized, correct it and click to regenerate answer"})]}),(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsx)(v.f,{children:b.editor.tags}),(0,t.jsx)(E.f,{value:S.knowledgePoints,onChange:e=>O({knowledgePoints:e}),placeholder:b.editor.tagsPlaceholder||"Enter knowledge tags...",enterHint:b.editor.createTagHint,subject:K,gradeStage:Q}),(0,t.jsx)("p",{className:"text-xs text-muted-foreground",children:b.editor.tagsHint||"💡 Tag suggestions will appear as you type"})]}),(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsx)(v.f,{children:b.editor.answer}),(0,t.jsx)(j.f,{value:S.answerText,onChange:e=>O({answerText:e}),className:"min-h-[100px] font-mono text-sm",placeholder:X})]}),(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsx)(v.f,{children:b.editor.analysis}),(0,t.jsx)(j.f,{value:S.analysis,onChange:e=>O({analysis:e}),className:"min-h-[200px] font-mono text-sm",placeholder:X})]}),(0,t.jsx)(k,{data:S,onChange:O})]}),(0,t.jsx)(T,{data:S,children:q&&(0,t.jsx)(f,{data:S,onChange:O})})]})]})}],866531);var M=e.i(853138),O=e.i(263676);e.s(["f",0,function({message:e,onDismiss:r}){let{t:s}=(0,d.b)();return e?(0,t.jsxs)("div",{role:"alert",className:"flex items-start gap-3 rounded-xl border border-destructive/30 bg-destructive/5 p-4 text-sm text-destructive",children:[(0,t.jsx)(M.f,{"aria-hidden":"true",className:"mt-0.5 h-4 w-4 shrink-0"}),(0,t.jsx)("p",{className:"min-w-0 flex-1 whitespace-pre-line break-words leading-relaxed",children:e}),(0,t.jsx)("button",{type:"button",onClick:r,"aria-label":s.common.close,className:"shrink-0 rounded p-1 hover:bg-destructive/10",children:(0,t.jsx)(O.X,{"aria-hidden":"true",className:"h-4 w-4"})})]}):null}],497346);var z=e.i(618566);function L(e){return"object"!=typeof e||null===e||Array.isArray(e)?void 0:e}function G(e,t){if("string"!=typeof e||!/^(QUESTION_SAVE_|AI_)[A-Z_]+$/.test(e))return;let r=t.errors[e];return"string"==typeof r?r:void 0}e.s(["f",0,function(e){let{t}=(0,d.b)(),s=(0,z.useRouter)(),[a,i]=(0,r.useState)(null),n=async(r,a,n=!0)=>{i(null);try{let e=await r();return u.c.success(e.duplicate?t.importFlow.duplicate:t.common.messages.saveSuccess),n&&(e.duplicate?s.push(`/error-items/${e.id}`):a&&s.push(`/notebooks/${a}`)),!0}catch(s){m.V.error(e,"Save failed",{errorMessage:(0,$.d)(s)??(0,$.Z)(s)});let r=function(e,t){let r=L(e),s=L(r?.data),a="number"==typeof r?.status?r.status:void 0,i=(0,$.d)(e),n=G(i,t)??G(s?.code,t),l={400:t.errors.QUESTION_SAVE_INVALID_INPUT,401:t.errors.QUESTION_SAVE_UNAUTHORIZED,403:t.errors.QUESTION_SAVE_FORBIDDEN,408:t.errors.QUESTION_SAVE_TIMEOUT,409:t.errors.QUESTION_SAVE_CONFLICT,413:t.errors.QUESTION_SAVE_TOO_LARGE,429:t.errors.QUESTION_SAVE_RATE_LIMITED,502:t.errors.QUESTION_SAVE_SERVER_UNAVAILABLE,503:t.errors.QUESTION_SAVE_SERVER_UNAVAILABLE,504:t.errors.QUESTION_SAVE_TIMEOUT},o=n??(a?l[a]:void 0)??t.errors.QUESTION_SAVE_FAILED;!a&&(e instanceof TypeError||/fetch|network|load failed/i.test((0,$.Z)(e)))&&(o=t.errors.QUESTION_SAVE_NETWORK_ERROR);let d=L(s?.details);if("QUESTION_SAVE_GRADE_FAILED"===i){let e=G(d?.reason,t);e&&(o+=`
6
+ Defaulting to \`null\`.`}d(p,"defaultGetValueLabel"),d(v,"getProgressState"),d(y,"isNumber"),d(j,"isValidMaxNumber"),d(w,"isValidValueNumber"),d(b,"getInvalidMaxError"),d(k,"getInvalidValueError");var N=e.i(975157);let S=i.forwardRef(({className:e,value:t,...r},s)=>(0,a.jsx)(g,{ref:s,value:t,className:(0,N.f)("relative h-4 w-full overflow-hidden rounded-full bg-secondary",e),...r,children:(0,a.jsx)(h,{className:"h-full w-full flex-1 bg-primary transition-all",style:{transform:`translateX(-${100-(t||0)}%)`}})}));S.displayName=g.displayName,e.s(["f",0,S],168148)},856522,e=>{var t=e.i(456420);let r={name:"save",size:24,node:[["path",{d:"M15.2 3a2 2 0 0 1 1.4.6l3.8 3.8a2 2 0 0 1 .6 1.4V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2z",key:"1c8476"}],["path",{d:"M17 21v-7a1 1 0 0 0-1-1H8a1 1 0 0 0-1 1v7",key:"1ydtos"}],["path",{d:"M7 3v4a1 1 0 0 0 1 1h7",key:"t51u73"}]]};r.node;let s=(0,t.f)(r);e.s(["f",0,s],856522)},786563,e=>{var t=e.i(456420);let r={name:"star",size:24,node:[["path",{d:"M11.525 2.295a.53.53 0 0 1 .95 0l2.31 4.679a2.123 2.123 0 0 0 1.595 1.16l5.166.756a.53.53 0 0 1 .294.904l-3.736 3.638a2.123 2.123 0 0 0-.611 1.878l.882 5.14a.53.53 0 0 1-.771.56l-4.618-2.428a2.122 2.122 0 0 0-1.973 0L6.396 21.01a.53.53 0 0 1-.77-.56l.881-5.139a2.122 2.122 0 0 0-.611-1.879L2.16 9.795a.53.53 0 0 1 .294-.906l5.165-.755a2.122 2.122 0 0 0 1.597-1.16z",key:"r04s7s"}]]};r.node;let s=(0,t.f)(r);e.s(["f",0,s],786563)},866531,497346,183444,e=>{var t=e.i(843476),r=e.i(271645),s=e.i(632781),a=e.i(741120),i=e.i(856522),n=e.i(314381),l=e.i(3198),o=e.i(519455),d=e.i(111110),c=e.i(41931),u=e.i(294114),m=e.i(201276);function f({data:e,onChange:a}){let{t:i}=(0,d.b)(),[x,g]=(0,r.useState)(!1),[h,p]=(0,r.useState)(null),v=async()=>{if(!e.questionText.trim())return void u.c.warning(i.editor.enterQuestionFirst||"Please enter question text first");if(!e.answerText.trim())return void u.c.warning(i.geogebra.answerRequired);g(!0),p(null);try{let t=await c.k.post("/api/geogebra-analyze",{questionText:e.questionText,answerText:e.answerText,analysis:e.analysis},{timeout:18e4,recoverable:!0});t.suitable&&t.commands&&t.commands.length>0?a({geogebraCommands:JSON.stringify(t.commands)}):p(t.description||i.geogebra.notSuitable)}catch(e){m.V.error("[CorrectionEditor]","GeoGebra analysis failed",{error:e}),p(i.geogebra.analyzeFailed)}finally{g(!1)}};return e.geogebraCommands?(0,t.jsx)(l.f,{commands:e.geogebraCommands,height:350,onRegenerate:v,onDelete:async()=>a({geogebraCommands:void 0})}):e.questionText.trim()&&e.answerText.trim()?(0,t.jsxs)("div",{className:"rounded-lg border border-dashed p-4",children:[(0,t.jsxs)("div",{className:"flex items-center justify-between",children:[(0,t.jsxs)("div",{className:"flex items-center gap-2 text-sm text-muted-foreground",children:[(0,t.jsx)(n.f,{className:"h-4 w-4"}),(0,t.jsx)("span",{children:i.geogebra.title})]}),(0,t.jsx)(o.f,{variant:"outline",size:"sm",onClick:v,disabled:x,children:x?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(s.f,{className:"mr-2 h-4 w-4 animate-spin"}),i.geogebra.analyzing]}):(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(n.f,{className:"mr-2 h-4 w-4"}),i.geogebra.generate]})})]}),h&&(0,t.jsx)("p",{className:"text-xs text-muted-foreground mt-2",children:h}),(0,t.jsx)("p",{className:"text-xs text-muted-foreground mt-2",children:i.geogebra.hint})]}):null}var x=e.i(469937),g=e.i(28342),h=e.i(438465),p=e.i(674166),v=e.i(110204);function y({data:e,paperLevel:r,onChange:s}){let{t:a}=(0,d.b)();return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsx)(v.f,{children:a.editor.selectNotebook||"Select Notebook"}),(0,t.jsx)(h.f,{value:e.subjectId,onChange:e=>s({subjectId:e})})]}),(0,t.jsxs)("div",{className:"grid grid-cols-2 gap-4",children:[(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsx)(v.f,{htmlFor:"correction-grade-semester",children:a.editor.gradeSemester||"Grade/Semester"}),(0,t.jsx)(g.f,{id:"correction-grade-semester",value:e.gradeSemester||"",onChange:e=>s({gradeSemester:e})})]}),(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsx)(v.f,{children:a.editor.paperLevel||"Paper Level"}),(0,t.jsx)(p.f,{value:r,onChange:e=>s({paperLevel:e})})]})]}),(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsx)(v.f,{children:a.difficulty.label}),(0,t.jsx)("div",{children:(0,t.jsx)(x.f,{size:"md",value:e.difficultyStars,onChange:e=>s({difficultyStars:e})})})]})]})}var j=e.i(141176),w=e.i(515288),b=e.i(967489);function k({data:e,onChange:r}){let{t:s}=(0,d.b)();return(0,t.jsxs)(w.N,{children:[(0,t.jsx)(w.Y,{children:(0,t.jsx)(w.v,{children:s.editor.mistakeAnalysisTitle||"Mistake Analysis"})}),(0,t.jsxs)(w.O,{className:"space-y-4",children:[(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsx)(v.f,{children:s.editor.mistakeStatus||"Attempt Status"}),(0,t.jsxs)(b.d,{value:e.mistakeStatus||"unknown",onValueChange:e=>r({mistakeStatus:e}),children:[(0,t.jsx)(b.P,{children:(0,t.jsx)(b.U,{})}),(0,t.jsxs)(b.r,{children:[(0,t.jsx)(b.T,{value:"not_attempted",children:s.editor.mistakeStatuses?.notAttempted||"Not attempted"}),(0,t.jsx)(b.T,{value:"wrong_attempt",children:s.editor.mistakeStatuses?.wrongAttempt||"Wrong attempt"}),(0,t.jsx)(b.T,{value:"unknown",children:s.editor.mistakeStatuses?.unknown||"Unknown"})]})]})]}),(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsx)(v.f,{children:s.editor.wrongAnswerText||"Wrong Answer / Work"}),(0,t.jsx)(j.f,{value:e.wrongAnswerText||"",onChange:t=>r({wrongAnswerText:t,mistakeStatus:t.trim()?"wrong_attempt":e.mistakeStatus}),className:"min-h-[100px] font-mono text-sm",placeholder:s.editor.wrongAnswerPlaceholder||"Leave blank if no wrong answer is visible"})]}),(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsx)(v.f,{children:s.editor.mistakeAnalysis||"Mistake Cause Analysis"}),(0,t.jsx)(j.f,{value:e.mistakeAnalysis||"",onChange:e=>r({mistakeAnalysis:e}),className:"min-h-[140px] font-mono text-sm",placeholder:s.editor.mistakeAnalysisPlaceholder||"Explain where and why the mistake happened"})]})]})]})}var N=e.i(511445),S=e.i(149704);function A({title:e,children:r,className:s}){return(0,t.jsxs)(w.N,{children:[(0,t.jsx)(w.Y,{children:(0,t.jsx)(w.v,{children:e})}),(0,t.jsx)(w.O,{className:s,children:r})]})}function T({data:e,children:r}){let{t:s}=(0,d.b)(),a={wrong_attempt:s.editor.mistakeStatuses?.wrongAttempt||"Wrong attempt",not_attempted:s.editor.mistakeStatuses?.notAttempted||"Not attempted",unknown:s.editor.mistakeStatuses?.unknown||"Unknown"};return(0,t.jsxs)("div",{className:"space-y-6",children:[(0,t.jsxs)(A,{title:s.editor.preview?.question||"Question Preview",children:[(0,t.jsx)(N.f,{content:e.questionText}),(0,t.jsx)(S.f,{svg:e.figureSvg})]}),r,(0,t.jsx)(A,{title:s.editor.preview?.answer||"Answer Preview",children:(0,t.jsx)(N.f,{content:e.answerText})}),(0,t.jsx)(A,{title:s.editor.preview?.analysis||"Analysis Preview",children:(0,t.jsx)(N.f,{content:e.analysis})}),(0,t.jsxs)(A,{title:s.editor.preview?.mistakeAnalysis||"Mistake Analysis Preview",className:"space-y-3 text-sm",children:[(0,t.jsxs)("div",{className:"text-muted-foreground",children:[s.editor.mistakeStatus||"Attempt Status",s.common.colon,a[e.mistakeStatus]??a.unknown]}),e.wrongAnswerText&&(0,t.jsxs)("div",{children:[(0,t.jsx)("div",{className:"font-medium mb-1",children:s.editor.wrongAnswerText||"Wrong Answer / Work"}),(0,t.jsx)(N.f,{content:e.wrongAnswerText})]}),e.mistakeAnalysis&&(0,t.jsxs)("div",{children:[(0,t.jsx)("div",{className:"font-medium mb-1",children:s.editor.mistakeAnalysis||"Mistake Cause Analysis"}),(0,t.jsx)(N.f,{content:e.mistakeAnalysis})]})]})]})}var E=e.i(574041),I=e.i(215519),C=e.i(306831);e.i(676167);var _=e.i(597138),R=e.i(991722),V=e.i(470279),$=e.i(303163);e.s(["f",0,function({initialData:e,onSave:n,onCancel:l,imagePreview:x,initialSubjectId:g,aiTimeout:h}){let{timeZone:p}=(0,I.M)(),{t:b,language:N}=(0,d.b)(),[S,A]=(0,r.useState)({...e,wrongAnswerText:e.wrongAnswerText||"",mistakeAnalysis:e.mistakeAnalysis||"",mistakeStatus:e.mistakeStatus||"unknown",subjectId:g,gradeSemester:e.gradeSemester||""}),M=(0,r.useRef)(!1),O=e=>{"gradeSemester"in e&&(M.current=!0),A(t=>({...t,...e}))},{groups:z}=(0,V.f)(),L=(()=>{if(S.paperLevel)return S.paperLevel;let e="number"==typeof S.difficultyStars&&S.difficultyStars>=4?"b":"a";return z.find(t=>t.key===e&&t.isActive)?.id||""})(),G=S.paperLevel??L,[P,U]=(0,r.useState)(!1),[F,D]=(0,r.useState)(!1),[q,H]=(0,r.useState)(!1),[Q,B]=(0,r.useState)(void 0),[W,Z]=(0,r.useState)([]);(0,r.useEffect)(()=>{c.k.get("/api/notebooks").then(Z).catch(e=>m.V.error("[CorrectionEditor]","Failed to fetch notebooks",{error:e})),c.k.get("/api/user").then(e=>{if(H(!!e?.enableGeogebra),e){let t=function(e,t=C.J){return"ai"===e.gradeRecognitionMode?null:e.fixedGradeSemester?e.fixedGradeSemester:e.educationStage&&e.enrollmentYear?function(e,t,r=new Date,s="en",a=C.J){let i=(0,C.c)(r,a),n=i.getFullYear(),l=i.getMonth()+1,o=n-t,d="2nd";l>=9?(o+=1,d="1st"):d=l<2?"1st":"2nd";let c="zh"===s,u=c?"1st"===d?"上期":"下期":"1st"===d?"1st Semester":"2nd Semester",m=(c?{primary:["一年级","二年级","三年级","四年级","五年级","六年级"],junior_high:["初一","初二","初三"],senior_high:["高一","高二","高三"],university:["大一","大二","大三","大四"]}:{primary:["Grade 1","Grade 2","Grade 3","Grade 4","Grade 5","Grade 6"],junior_high:["Junior High Grade 1","Junior High Grade 2","Junior High Grade 3"],senior_high:["Senior High Grade 1","Senior High Grade 2","Senior High Grade 3"],university:["Freshman","Sophomore","Junior","Senior"]})[e]||[],f=`${o}`;if(f=o>0&&o<=m.length?m[o-1]:o>m.length?c?"已毕业":"Graduated":c?"学前":"Pre-school",!c)return`${f}, ${u}`;{let e="1st"===d?"上":"下";return`${f}${e}`}}(e.educationStage,e.enrollmentYear,new Date,"zh",t):null}(e,p);A(e=>e.gradeSemester||M.current?e:{...e,gradeSemester:t||""}),B(e.educationStage||void 0)}}).catch(e=>m.V.error("[CorrectionEditor]","Failed to fetch user info for grade calculation",{error:e}))},[N,p]);let J=async()=>{if(!S.questionText.trim())return void u.c.warning(b.editor.enterQuestionFirst||"Please enter question text first");U(!0);try{let e=function({questionText:e,language:t,subject:r,imagePreview:s,gradeSemester:a,subjectId:i}){let n={questionText:e,language:t,subject:r};return s&&(n.imageBase64=s),a&&(n.gradeSemester=a),i&&(n.subjectId=i),n}({questionText:S.questionText,language:N,subject:S.subject,imagePreview:x,gradeSemester:S.gradeSemester??void 0,subjectId:S.subjectId});m.V.info("[Reanswer]",e.imageBase64?"Sending image + text (image available for mistake analysis)":"Sending text only (no image available)",{timeout:h});let t=await c.k.post("/api/reanswer",e,{timeout:h||18e4,recoverable:!0});A(e=>({...e,answerText:t.answerText,analysis:t.analysis,knowledgePoints:t.knowledgePoints,wrongAnswerText:t.wrongAnswerText||"",mistakeAnalysis:t.mistakeAnalysis||"",mistakeStatus:(0,R.x)(t.mistakeStatus,t.wrongAnswerText),difficultyStars:t.difficultyStars??e.difficultyStars})),u.c.success(b.editor.reanswerSuccess||"✅ Answer and analysis updated!")}catch(s){let e,t,r;m.V.error("[CorrectionEditor]","Reanswer failed",{error:s}),u.c.error((e=(0,$.d)(s)||"",r=(t=b.errors?.reanswer||{}).default||"Reanswer failed",e.includes("AI_AUTH_ERROR")?t.authError||b.errors?.AI_AUTH_ERROR||r:e.includes("AI_CONNECTION_FAILED")?t.connectionFailed||b.errors?.AI_CONNECTION_FAILED||r:e.includes("AI_RESPONSE_ERROR")&&(t.responseError||b.errors?.AI_RESPONSE_ERROR)||r))}finally{U(!1)}},Y=async()=>{if(!S.subjectId)return void u.c.warning(b.editor.messages?.selectNotebook||"Please select a notebook");if(!F){D(!0);try{await n({...S,paperLevel:G,mistakeStatus:(0,R.x)(S.mistakeStatus,S.wrongAnswerText)})}finally{D(!1)}}},X=b.editor.placeholder||"Supports Markdown and LaTeX...",K=(0,_.f)(W.find(e=>e.id===S.subjectId)?.name||null)||(0,_.f)(S.subject||null)||void 0;return(0,t.jsxs)("div",{className:"space-y-6",children:[(0,t.jsxs)("div",{className:"flex items-center justify-between",children:[(0,t.jsx)("h2",{className:"text-2xl font-bold",children:b.editor.title}),(0,t.jsxs)("div",{className:"flex gap-2",children:[(0,t.jsx)(o.f,{variant:"outline",onClick:l,children:b.editor.cancel}),(0,t.jsxs)(o.f,{onClick:Y,disabled:F,children:[F?(0,t.jsx)(s.f,{className:"mr-2 h-4 w-4 animate-spin"}):(0,t.jsx)(i.f,{className:"mr-2 h-4 w-4"}),F?b.common?.pleaseWait||"Please wait...":b.editor.save]})]})]}),(0,t.jsxs)("div",{className:"grid gap-6 lg:grid-cols-2",children:[(0,t.jsxs)("div",{className:"space-y-6",children:[x&&(0,t.jsx)(w.N,{children:(0,t.jsx)(w.O,{className:"p-4",children:(0,t.jsx)("img",{src:x,alt:"Original",className:"w-full rounded-md"})})}),(0,t.jsx)(y,{data:S,paperLevel:G,onChange:O}),(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsx)(v.f,{children:b.editor.question}),(0,t.jsx)(j.f,{value:S.questionText,onChange:e=>O({questionText:e}),className:"min-h-[150px] font-mono text-sm",placeholder:X}),(0,t.jsx)(o.f,{variant:"default",size:"sm",onClick:J,disabled:P||!S.questionText.trim(),className:"w-full bg-gradient-to-r from-indigo-600 to-violet-500 hover:from-indigo-700 hover:to-violet-600 text-white font-medium",children:P?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(s.f,{className:"mr-2 h-4 w-4 animate-spin"}),b.editor.reanswering||"AI solving..."]}):(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(a.f,{className:"mr-2 h-4 w-4"}),b.editor.reanswer||"🔄 Reanswer (based on corrected question)"]})}),(0,t.jsx)("p",{className:"text-xs text-muted-foreground",children:b.editor.reanswerHint||"💡 If the question was misrecognized, correct it and click to regenerate answer"})]}),(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsx)(v.f,{children:b.editor.tags}),(0,t.jsx)(E.f,{value:S.knowledgePoints,onChange:e=>O({knowledgePoints:e}),placeholder:b.editor.tagsPlaceholder||"Enter knowledge tags...",enterHint:b.editor.createTagHint,subject:K,gradeStage:Q}),(0,t.jsx)("p",{className:"text-xs text-muted-foreground",children:b.editor.tagsHint||"💡 Tag suggestions will appear as you type"})]}),(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsx)(v.f,{children:b.editor.answer}),(0,t.jsx)(j.f,{value:S.answerText,onChange:e=>O({answerText:e}),className:"min-h-[100px] font-mono text-sm",placeholder:X})]}),(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsx)(v.f,{children:b.editor.analysis}),(0,t.jsx)(j.f,{value:S.analysis,onChange:e=>O({analysis:e}),className:"min-h-[200px] font-mono text-sm",placeholder:X})]}),(0,t.jsx)(k,{data:S,onChange:O})]}),(0,t.jsx)(T,{data:S,children:q&&(0,t.jsx)(f,{data:S,onChange:O})})]})]})}],866531);var M=e.i(853138),O=e.i(263676);e.s(["f",0,function({message:e,onDismiss:r}){let{t:s}=(0,d.b)();return e?(0,t.jsxs)("div",{role:"alert",className:"flex items-start gap-3 rounded-xl border border-destructive/30 bg-destructive/5 p-4 text-sm text-destructive",children:[(0,t.jsx)(M.f,{"aria-hidden":"true",className:"mt-0.5 h-4 w-4 shrink-0"}),(0,t.jsx)("p",{className:"min-w-0 flex-1 whitespace-pre-line break-words leading-relaxed",children:e}),(0,t.jsx)("button",{type:"button",onClick:r,"aria-label":s.common.close,className:"shrink-0 rounded p-1 hover:bg-destructive/10",children:(0,t.jsx)(O.X,{"aria-hidden":"true",className:"h-4 w-4"})})]}):null}],497346);var z=e.i(618566);function L(e){return"object"!=typeof e||null===e||Array.isArray(e)?void 0:e}function G(e,t){if("string"!=typeof e||!/^(QUESTION_SAVE_|AI_)[A-Z_]+$/.test(e))return;let r=t.errors[e];return"string"==typeof r?r:void 0}e.s(["f",0,function(e){let{t}=(0,d.b)(),s=(0,z.useRouter)(),[a,i]=(0,r.useState)(null),n=async(r,a,n=!0)=>{i(null);try{let e=await r();return u.c.success(e.duplicate?t.importFlow.duplicate:t.common.messages.saveSuccess),n&&(e.duplicate?s.push(`/error-items/${e.id}`):a&&s.push(`/notebooks/${a}`)),!0}catch(s){m.V.error(e,"Save failed",{errorMessage:(0,$.d)(s)??(0,$.Z)(s)});let r=function(e,t){let r=L(e),s=L(r?.data),a="number"==typeof r?.status?r.status:void 0,i=(0,$.d)(e),n=G(i,t)??G(s?.code,t),l={400:t.errors.QUESTION_SAVE_INVALID_INPUT,401:t.errors.QUESTION_SAVE_UNAUTHORIZED,403:t.errors.QUESTION_SAVE_FORBIDDEN,408:t.errors.QUESTION_SAVE_TIMEOUT,409:t.errors.QUESTION_SAVE_CONFLICT,413:t.errors.QUESTION_SAVE_TOO_LARGE,429:t.errors.QUESTION_SAVE_RATE_LIMITED,502:t.errors.QUESTION_SAVE_SERVER_UNAVAILABLE,503:t.errors.QUESTION_SAVE_SERVER_UNAVAILABLE,504:t.errors.QUESTION_SAVE_TIMEOUT},o=n??(a?l[a]:void 0)??t.errors.QUESTION_SAVE_FAILED;!a&&(e instanceof TypeError||/fetch|network|load failed/i.test((0,$.Z)(e)))&&(o=t.errors.QUESTION_SAVE_NETWORK_ERROR);let d=L(s?.details);if("QUESTION_SAVE_GRADE_FAILED"===i){let e=G(d?.reason,t);e&&(o+=`
7
7
  ${e}`)}return 400===a&&(o+=(function(e,t){if(!Array.isArray(e))return[];let r={questionText:t.editor.question,answerText:t.editor.answer,analysis:t.editor.analysis,wrongAnswerText:t.editor.wrongAnswerText,mistakeAnalysis:t.editor.mistakeAnalysis,knowledgePoints:t.editor.tags,subjectId:t.editor.selectNotebook,gradeSemester:t.editor.gradeSemester,paperLevel:t.editor.paperLevel};return e.slice(0,3).flatMap(e=>{let s=L(e),a=s?.path,i=Array.isArray(a)&&"string"==typeof a[0]?r[a[0]]:void 0;if(!i)return[];let n=s?.maximum,l=t.questionSave.invalidField;return s?.code==="too_big"&&"number"==typeof n&&Number.isSafeInteger(n)&&n>=0&&(l="array"===s.origin?t.questionSave.tooMany:t.questionSave.tooLong),[l.replace("{field}",i).replace("{maximum}",String(n))]})})(s?.details,t).map(e=>`
8
8
  ${e}`).join("")),"string"==typeof d?.databaseCode&&/^P\d{4}$/.test(d.databaseCode)&&(o+=`
9
- ${t.questionSave.databaseCode.replace("{code}",d.databaseCode)}`),a&&(o+=` (HTTP ${a})`),o}(s,t);return i(r),"AI_DAILY_LIMIT_EXCEEDED"!==(0,$.d)(s)&&u.c.error(r),!1}};return{saveError:a,setSaveError:i,dismissSaveError:()=>i(null),run:n}}],752012)},469937,e=>{var t=e.i(843476),r=e.i(786563),s=e.i(111110),a=e.i(975157);let i=[1,2,3,4,5];e.s(["f",0,function({value:e,onChange:n,disabled:l,size:o="sm",showUnrated:d=!0,className:c}){let{t:u}=(0,s.b)(),m=e??0,f="sm"===o?"h-3.5 w-3.5":"h-5 w-5",x=m?u.difficulty.starsLabel.replace("{n}",String(m)):u.difficulty.unrated;return n?(0,t.jsxs)("span",{className:(0,a.f)("inline-flex items-center gap-0.5",c),role:"group","aria-label":`${u.difficulty.label}${u.common.colon}${x}`,title:u.difficulty.clearHint,children:[i.map(e=>(0,t.jsx)("button",{type:"button",disabled:l,onClick:()=>n(e===m?null:e),"aria-label":u.difficulty.setStars.replace("{n}",String(e)),"aria-pressed":e<=m,className:"rounded p-0.5 hover:bg-muted disabled:opacity-50 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring",children:(0,t.jsx)(r.f,{className:(0,a.f)(f,e<=m?"fill-amber-400 text-amber-400":"text-muted-foreground/40")})},e)),!m&&d&&(0,t.jsx)("span",{className:"ml-1 text-xs text-muted-foreground",children:u.difficulty.unrated})]}):m?(0,t.jsx)("span",{className:(0,a.f)("inline-flex items-center",c),role:"img","aria-label":`${u.difficulty.label}${u.common.colon}${x}`,title:x,children:i.map(e=>(0,t.jsx)(r.f,{className:(0,a.f)(f,e<=m?"fill-amber-400 text-amber-400":"text-muted-foreground/30"),"aria-hidden":!0},e))}):d?(0,t.jsx)("span",{className:(0,a.f)("text-xs text-muted-foreground",c),children:u.difficulty.unrated}):null}])},731335,579321,927904,e=>{var t=e.i(843476),r=e.i(399847),s=e.i(551757),a=e.i(456420);let i={name:"clock-3",size:24,node:[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 6v6h4",key:"135r8i"}]]};i.node;let n=(0,a.f)(i);var l=e.i(632781),o=e.i(615568),d=e.i(487486),c=e.i(519455),u=e.i(168148),m=e.i(111110),f=e.i(215519),x=e.i(306831);let g=["read","convert","crop","compress","upload"],h=["receive","analyze","save"];function p(e){if(!Number.isFinite(e)||e<0)return"-";if(e<1e3)return`${Math.round(e)}ms`;let t=e/1e3;if(t<60)return`${t.toFixed(+(t<10))}s`;let r=Math.round(t);return`${Math.floor(r/60)}:${String(r%60).padStart(2,"0")}`}var v=e.i(975157);let y={analyzing:50,saving:90},j={analyzing:l.f,saving:l.f,review:o.f,saved:s.f,failed:r.f};e.s(["f",0,function({task:e,now:r,onReview:s,onViewItem:a,onRetry:i,onDiscard:l}){let{t:o}=(0,m.b)(),{timeZone:w}=(0,f.M)(),b=j[e.status],k="analyzing"===e.status||"saving"===e.status,N=o.errors,S=e.error?"string"==typeof N[e.error]?N[e.error]:e.error:null,A=function(e){let t=[];for(let r of g){let s=e?.client?.[r];"number"==typeof s&&t.push({stage:r,ms:s})}for(let r of h){let s=e?.server?.[r];"number"==typeof s&&t.push({stage:r,ms:s})}return t}(e.timings),T=k&&r?r-Date.parse(e.createdAt):null;return(0,t.jsxs)("div",{className:(0,v.f)("space-y-2 rounded-lg border p-3 text-sm",e.unread&&"border-primary/50 bg-primary/5"),"data-testid":"import-task-card","data-status":e.status,children:[(0,t.jsxs)("div",{className:"flex items-start gap-2",children:[(0,t.jsx)(b,{className:(0,v.f)("mt-0.5 h-4 w-4 shrink-0",k&&"animate-spin text-primary","saved"===e.status&&"text-green-600","failed"===e.status&&"text-destructive","review"===e.status&&"text-primary")}),(0,t.jsxs)("div",{className:"min-w-0 flex-1 space-y-1",children:[(0,t.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[(0,t.jsx)("span",{className:"font-medium",children:o.importTasks.status[e.status]}),(0,t.jsx)("span",{className:"text-xs text-muted-foreground",children:o.importTasks.mode[e.mode]}),e.unread&&(0,t.jsx)(d.f,{children:o.importTasks.unread})]}),k&&(0,t.jsx)(u.f,{value:y[e.status],"aria-label":o.importTasks.stageEstimate,"aria-valuetext":o.common.progress.estimated.replace("{percent}",String(y[e.status])),className:"h-1.5"}),e.excerpt&&(0,t.jsx)("p",{className:"break-words text-muted-foreground",children:e.excerpt}),"saved"===e.status&&!e.errorItemId&&(0,t.jsx)("p",{className:"text-xs text-muted-foreground",children:o.importTasks.itemDeleted}),"saved"===e.status&&e.errorItemId&&(0,t.jsx)("p",{className:"text-xs text-green-700 dark:text-green-300",children:e.duplicate?o.importTasks.duplicateSaved:o.importTasks.savedTo.replace("{notebook}",e.notebookName||"-").replace("{id}",e.errorItemShortId||"-")}),S&&(0,t.jsx)("p",{className:"text-xs text-destructive",children:S}),(0,t.jsxs)("div",{className:"flex flex-wrap items-center gap-x-3 gap-y-1 text-xs text-muted-foreground",children:[(0,t.jsxs)("span",{className:"flex items-center gap-1",children:[(0,t.jsx)(n,{className:"h-3 w-3"}),o.importTasks.createdAt.replace("{time}",(0,x.r)(e.createdAt,"MM-dd HH:mm",w))]}),null!==T&&(0,t.jsx)("span",{children:o.importTasks.elapsed.replace("{time}",p(T))}),e.attempts>1&&(0,t.jsx)("span",{children:o.importTasks.attempts.replace("{count}",String(e.attempts))})]}),A.length>0&&(0,t.jsx)("ul",{className:"flex flex-wrap gap-x-3 gap-y-1 text-xs text-muted-foreground tabular-nums","aria-label":"timings",children:A.map(({stage:e,ms:r})=>(0,t.jsxs)("li",{children:[o.importTasks.timings[e]," ",p(r)]},e))})]})]}),(0,t.jsxs)("div",{className:"flex flex-wrap justify-end gap-2",children:["review"===e.status&&s&&(0,t.jsx)(c.f,{size:"sm",onClick:s,children:o.importTasks.continueReview}),"saved"===e.status&&e.errorItemId&&a&&(0,t.jsx)(c.f,{size:"sm",variant:"outline",onClick:a,children:o.importTasks.viewItem}),"failed"===e.status&&i&&(0,t.jsx)(c.f,{size:"sm",onClick:i,children:o.importTasks.retry}),"saving"!==e.status&&"saved"!==e.status&&l&&(0,t.jsx)(c.f,{size:"sm",variant:"ghost",onClick:l,children:o.importTasks.discard})]})]})}],731335);var w=e.i(618566),b=e.i(61425),k=e.i(294114),N=e.i(201276),S=e.i(116331);e.s(["f",0,function(e){let{t}=(0,m.b)(),r=(0,w.useRouter)(),s=e=>{e.unread&&(0,S.N)(e.id).catch(e=>N.V.warn("[ImportTasks]","Mark read failed",{error:e}))};return{openReview:e=>{s(e),r.push(`/import-tasks/${e.id}`)},viewItem:e=>{e.errorItemId&&(s(e),r.push(`/error-items/${e.errorItemId}`))},markRead:s,retry:async r=>{try{await (0,S.R)(r.id),k.c.info(t.importTasks.retried)}catch(e){k.c.error((0,b.f)(e,t))}e?.()},discard:async r=>{if(!await (0,k.u)(t.importTasks.discardConfirm))return!1;let s=!1;try{await (0,S.x)(r.id),k.c.success(t.importTasks.discarded),s=!0}catch(e){k.c.error((0,b.f)(e,t))}return e?.(),s}}}],579321);var A=e.i(271645);e.s(["f",0,function(e,t=1e3){let[r,s]=(0,A.useState)(()=>Date.now());return(0,A.useEffect)(()=>{if(!e)return;let r=setInterval(()=>s(Date.now()),t);return()=>clearInterval(r)},[e,t]),r}],927904)},141176,e=>{var t=e.i(843476),r=e.i(271645),s=e.i(456420);let a={name:"code-xml",size:24,node:[["path",{d:"m18 16 4-4-4-4",key:"1inbqp"}],["path",{d:"m6 8-4 4 4 4",key:"15zrgr"}],["path",{d:"m14.5 4-5 16",key:"e7oirm"}]],aliases:["code-2"]};a.node;let i=(0,s.f)(a);var n=e.i(772382),l=e.i(511445),o=e.i(624687),d=e.i(111110),c=e.i(975157);e.s(["f",0,function({value:e,onChange:s,className:a,...u}){let{t:m}=(0,d.b)(),[f,x]=(0,r.useState)("source"),g=(0,r.useId)(),h=[{mode:"source",label:m.markdownEditor.source,icon:i},{mode:"preview",label:m.markdownEditor.preview,icon:n.f}];return(0,t.jsxs)("div",{className:"space-y-1.5",children:[(0,t.jsx)("div",{role:"tablist","aria-label":m.markdownEditor.modeLabel,className:"flex justify-end",children:(0,t.jsx)("div",{className:"inline-flex rounded-md border bg-muted/40 p-0.5",children:h.map(({mode:e,label:r,icon:s})=>(0,t.jsxs)("button",{type:"button",role:"tab","aria-selected":f===e,"aria-controls":g,onClick:()=>x(e),className:(0,c.f)("flex items-center gap-1 rounded px-2.5 py-1 text-xs transition-colors",f===e?"bg-background font-medium shadow-sm":"text-muted-foreground hover:text-foreground"),children:[(0,t.jsx)(s,{className:"h-3.5 w-3.5"}),r]},e))})}),(0,t.jsx)("div",{id:g,role:"tabpanel",children:"source"===f?(0,t.jsx)(o.f,{value:e,onChange:e=>s(e.target.value),className:a,...u}):(0,t.jsx)("div",{className:"min-h-24 cursor-text rounded-md border bg-muted/20 px-3 py-2",onDoubleClick:()=>x("source"),title:m.markdownEditor.doubleClickToEdit,children:e.trim()?(0,t.jsx)(l.f,{content:e}):(0,t.jsx)("p",{className:"text-sm italic text-muted-foreground",children:m.markdownEditor.empty})})})]})}],141176)},438465,674166,e=>{var t=e.i(843476),r=e.i(271645),s=e.i(967489),a=e.i(856423),i=e.i(41931),n=e.i(201276),l=e.i(111110);e.s(["f",0,function({value:e,onChange:o,className:d}){let[c,u]=(0,r.useState)([]),{t:m}=(0,l.b)();return(0,r.useEffect)(()=>{(async()=>{try{let e=await i.k.get("/api/notebooks");u(e)}catch(e){n.V.error("[NotebookSelector]","Failed to fetch notebooks",{error:e})}})()},[]),(0,t.jsxs)(s.d,{value:e,onValueChange:o,children:[(0,t.jsx)(s.P,{className:d,children:(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)(a.f,{className:"h-4 w-4 text-muted-foreground"}),(0,t.jsx)(s.U,{placeholder:m.notebooks?.selector?.placeholder||"Select Notebook"})]})}),(0,t.jsx)(s.r,{children:0===c.length?(0,t.jsx)("div",{className:"p-2 text-sm text-muted-foreground text-center",children:m.notebooks?.selector?.empty||"No notebooks available"}):c.map(e=>(0,t.jsx)(s.T,{value:e.id,children:e.name},e.id))})]})}],438465);var o=e.i(664030);e.s(["f",0,function({value:e,onChange:r,disabled:a}){let{groups:i,loading:n}=(0,o.f)(),l=i.filter(e=>e.isActive);return(0,t.jsxs)(s.d,{value:e,onValueChange:r,disabled:a||n,children:[(0,t.jsx)(s.P,{children:(0,t.jsx)(s.U,{placeholder:"选择卷别"})}),(0,t.jsx)(s.r,{children:l.map(e=>(0,t.jsx)(s.T,{value:e.id,children:e.name},e.id))})]})}],674166)},149704,e=>{var t=e.i(843476),r=e.i(111110),s=e.i(398019),a=e.i(184110),i=e.i(975157);let n={left:"mr-auto",center:"mx-auto",right:"ml-auto"};e.s(["f",0,function({svg:e,scale:l,align:o,className:d}){let{t:c}=(0,r.b)();if(!e)return null;let u=(0,a.V)(l),m=(0,a.o)(o);return(0,t.jsx)("figure",{className:(0,i.f)("question-figure my-3",d),children:(0,t.jsx)("img",{src:(0,s.f)(e),alt:c.figure.alt,className:(0,i.f)(n[m],"block h-auto max-w-full rounded border bg-white p-2"),style:{..."left"===m?{marginLeft:0,marginRight:"auto"}:"right"===m?{marginLeft:"auto",marginRight:0}:{},maxHeight:360,zoom:u/100,maxWidth:`${Math.min(u,100)}%`}})})}])},574041,e=>{var t=e.i(843476),r=e.i(271645),s=e.i(263676),a=e.i(487486),i=e.i(793479),n=e.i(41931),l=e.i(201276);e.s(["f",0,function({value:e=[],onChange:o,placeholder:d="Enter tags...",className:c="",enterHint:u,subject:m,gradeStage:f}){let[x,g]=(0,r.useState)(""),[h,p]=(0,r.useState)([]),[v,y]=(0,r.useState)(!1),[j,w]=(0,r.useState)(0),b=(0,r.useRef)(null),k=(0,r.useRef)(null),N=(0,r.useCallback)(async t=>{try{let r=new URLSearchParams({q:t});m&&r.append("subject",m),f&&r.append("stage",f);let s=((await n.k.get(`/api/tags/suggestions?${r.toString()}`)).suggestions||[]).filter(t=>!e.includes(t));p(s.slice(0,20)),y(s.length>0),w(0)}catch(e){l.V.error("[TagInput]","Failed to fetch suggestions",{error:e})}},[m,f,e]);(0,r.useEffect)(()=>{x.trim()&&N(x)},[x,N]);let S=t=>{t.trim()&&!e.includes(t.trim())&&(o([...e,t.trim()]),g(""),p([]),y(!1),w(0))},A=t=>{o(e.filter(e=>e!==t))};return(0,r.useEffect)(()=>{let e=e=>{!k.current||k.current.contains(e.target)||b.current?.contains(e.target)||y(!1)};return document.addEventListener("mousedown",e),()=>document.removeEventListener("mousedown",e)},[]),(0,t.jsxs)("div",{className:`relative ${c}`,children:[(0,t.jsxs)("div",{className:"flex flex-wrap gap-2 p-2 border rounded-lg bg-background min-h-[42px]",children:[e.map(e=>(0,t.jsxs)(a.f,{variant:"secondary",className:"flex items-center gap-1 px-2 py-1",children:[e,(0,t.jsx)("button",{type:"button",onClick:()=>A(e),className:"hover:text-destructive ml-1",children:(0,t.jsx)(s.X,{className:"h-3 w-3"})})]},e)),(0,t.jsx)(i.f,{ref:b,type:"text",value:x,onChange:e=>{g(e.target.value),e.target.value.trim()||(p([]),y(!1))},onKeyDown:t=>{"Enter"===t.key?(t.preventDefault(),j>=0&&h[j]?S(h[j]):x.trim()&&S(x)):"ArrowDown"===t.key?(t.preventDefault(),w(e=>Math.min(e+1,h.length-1))):"ArrowUp"===t.key?(t.preventDefault(),w(e=>Math.max(e-1,0))):"Escape"===t.key?(y(!1),w(0)):"Backspace"===t.key&&!x&&e.length>0&&A(e[e.length-1])},onFocus:()=>{h.length>0&&y(!0)},placeholder:0===e.length?d:"",className:"flex-1 min-w-[120px] border-none focus-visible:ring-0 focus-visible:ring-offset-0 h-8 px-0"})]}),v&&h.length>0&&(0,t.jsx)("div",{ref:k,className:"absolute z-50 w-full mt-1 bg-popover border rounded-md shadow-md max-h-48 overflow-y-auto",children:h.map((e,r)=>(0,t.jsx)("div",{className:`px-3 py-2 cursor-pointer hover:bg-accent ${r===j?"bg-accent":""}`,onClick:()=>S(e),onMouseEnter:()=>w(r),children:e},e))}),x&&!v&&(0,t.jsx)("div",{className:"text-xs text-muted-foreground mt-1",children:u?`${u} "${x}"`:`Press Enter to create "${x}"`})]})}])},61425,e=>{var t=e.i(303163);e.s(["f",0,function(e,r){let s=r.common?.messages?.analysisFailed||"Analysis failed, please try again",a=(0,t.d)(e);if(a){let e=r.errors??{};if(!(a in e))return a;let t=e[a];return"string"==typeof t?t:s}let i=(0,t.Z)(e);if(i.includes("fetch")||i.includes("network"))return r.errors?.AI_CONNECTION_FAILED||"网络连接失败";if("object"==typeof e&&null!==e&&"data"in e&&"string"==typeof e.data){let t="status"in e&&"number"==typeof e.status?e.status:"Error";return`${s} (${t})`}return s}])},184110,e=>{let t=["left","center","right"],r="center";function s(e){return"number"==typeof e&&Number.isInteger(e)&&e>=10&&e<=200}e.s(["E",0,r,"n",0,100,"j",0,t,"a",0,200,"_",0,10,"x",0,s,"o",0,function(e){return"string"==typeof e&&t.includes(e)?e:r},"V",0,function(e){return s(e)?e:100}])},398019,e=>{e.s(["f",0,function(e){return`data:image/svg+xml;charset=utf-8,${encodeURIComponent(e)}`}])},952122,e=>{e.i(306831),e.s(["f",0,function(e){if(!e)return null;let t=e.toLowerCase();return t.includes("math")||t.includes("数学")?"math":t.includes("physics")||t.includes("物理")?"physics":t.includes("chemistry")||t.includes("化学")?"chemistry":t.includes("biology")||t.includes("生物")?"biology":t.includes("english")||t.includes("英语")?"english":t.includes("chinese")||t.includes("语文")?"chinese":t.includes("history")||t.includes("历史")?"history":t.includes("geography")||t.includes("地理")?"geography":t.includes("politics")||t.includes("政治")?"politics":null}])},62825,e=>{function t(e){return"not_attempted"===e||"wrong_attempt"===e||"unknown"===e?e:"unknown"}e.s(["i",0,function(e,r="zh"){return("en"===r?{not_attempted:"Not attempted",wrong_attempt:"Wrong attempt",unknown:"Unknown"}:{not_attempted:"不会做",wrong_attempt:"做错了",unknown:"未判断"})[t(e)]},"h",0,t,"x",0,function(e,r){return(r||"").trim()?"wrong_attempt":t(e)}])}])})();
9
+ ${t.questionSave.databaseCode.replace("{code}",d.databaseCode)}`),a&&(o+=` (HTTP ${a})`),o}(s,t);return i(r),"AI_DAILY_LIMIT_EXCEEDED"!==(0,$.d)(s)&&u.c.error(r),!1}};return{saveError:a,setSaveError:i,dismissSaveError:()=>i(null),run:n}}],183444)},469937,e=>{var t=e.i(843476),r=e.i(786563),s=e.i(111110),a=e.i(975157);let i=[1,2,3,4,5];e.s(["f",0,function({value:e,onChange:n,disabled:l,size:o="sm",showUnrated:d=!0,className:c}){let{t:u}=(0,s.b)(),m=e??0,f="sm"===o?"h-3.5 w-3.5":"h-5 w-5",x=m?u.difficulty.starsLabel.replace("{n}",String(m)):u.difficulty.unrated;return n?(0,t.jsxs)("span",{className:(0,a.f)("inline-flex items-center gap-0.5",c),role:"group","aria-label":`${u.difficulty.label}${u.common.colon}${x}`,title:u.difficulty.clearHint,children:[i.map(e=>(0,t.jsx)("button",{type:"button",disabled:l,onClick:()=>n(e===m?null:e),"aria-label":u.difficulty.setStars.replace("{n}",String(e)),"aria-pressed":e<=m,className:"rounded p-0.5 hover:bg-muted disabled:opacity-50 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring",children:(0,t.jsx)(r.f,{className:(0,a.f)(f,e<=m?"fill-amber-400 text-amber-400":"text-muted-foreground/40")})},e)),!m&&d&&(0,t.jsx)("span",{className:"ml-1 text-xs text-muted-foreground",children:u.difficulty.unrated})]}):m?(0,t.jsx)("span",{className:(0,a.f)("inline-flex items-center",c),role:"img","aria-label":`${u.difficulty.label}${u.common.colon}${x}`,title:x,children:i.map(e=>(0,t.jsx)(r.f,{className:(0,a.f)(f,e<=m?"fill-amber-400 text-amber-400":"text-muted-foreground/30"),"aria-hidden":!0},e))}):d?(0,t.jsx)("span",{className:(0,a.f)("text-xs text-muted-foreground",c),children:u.difficulty.unrated}):null}])},731335,532377,339501,e=>{var t=e.i(843476),r=e.i(399847),s=e.i(551757),a=e.i(456420);let i={name:"clock-3",size:24,node:[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 6v6h4",key:"135r8i"}]]};i.node;let n=(0,a.f)(i);var l=e.i(632781),o=e.i(615568),d=e.i(487486),c=e.i(519455),u=e.i(168148),m=e.i(111110),f=e.i(215519),x=e.i(306831);let g=["read","convert","crop","compress","upload"],h=["receive","analyze","save"];function p(e){if(!Number.isFinite(e)||e<0)return"-";if(e<1e3)return`${Math.round(e)}ms`;let t=e/1e3;if(t<60)return`${t.toFixed(+(t<10))}s`;let r=Math.round(t);return`${Math.floor(r/60)}:${String(r%60).padStart(2,"0")}`}var v=e.i(975157);let y={analyzing:50,saving:90},j={analyzing:l.f,saving:l.f,review:o.f,saved:s.f,failed:r.f};e.s(["f",0,function({task:e,now:r,onReview:s,onViewItem:a,onRetry:i,onDiscard:l}){let{t:o}=(0,m.b)(),{timeZone:w}=(0,f.M)(),b=j[e.status],k="analyzing"===e.status||"saving"===e.status,N=o.errors,S=e.error?"string"==typeof N[e.error]?N[e.error]:e.error:null,A=function(e){let t=[];for(let r of g){let s=e?.client?.[r];"number"==typeof s&&t.push({stage:r,ms:s})}for(let r of h){let s=e?.server?.[r];"number"==typeof s&&t.push({stage:r,ms:s})}return t}(e.timings),T=k&&r?r-Date.parse(e.createdAt):null;return(0,t.jsxs)("div",{className:(0,v.f)("space-y-2 rounded-lg border p-3 text-sm",e.unread&&"border-primary/50 bg-primary/5"),"data-testid":"import-task-card","data-status":e.status,children:[(0,t.jsxs)("div",{className:"flex items-start gap-2",children:[(0,t.jsx)(b,{className:(0,v.f)("mt-0.5 h-4 w-4 shrink-0",k&&"animate-spin text-primary","saved"===e.status&&"text-green-600","failed"===e.status&&"text-destructive","review"===e.status&&"text-primary")}),(0,t.jsxs)("div",{className:"min-w-0 flex-1 space-y-1",children:[(0,t.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[(0,t.jsx)("span",{className:"font-medium",children:o.importTasks.status[e.status]}),(0,t.jsx)("span",{className:"text-xs text-muted-foreground",children:o.importTasks.mode[e.mode]}),e.unread&&(0,t.jsx)(d.f,{children:o.importTasks.unread})]}),k&&(0,t.jsx)(u.f,{value:y[e.status],"aria-label":o.importTasks.stageEstimate,"aria-valuetext":o.common.progress.estimated.replace("{percent}",String(y[e.status])),className:"h-1.5"}),e.excerpt&&(0,t.jsx)("p",{className:"break-words text-muted-foreground",children:e.excerpt}),"saved"===e.status&&!e.errorItemId&&(0,t.jsx)("p",{className:"text-xs text-muted-foreground",children:o.importTasks.itemDeleted}),"saved"===e.status&&e.errorItemId&&(0,t.jsx)("p",{className:"text-xs text-green-700 dark:text-green-300",children:e.duplicate?o.importTasks.duplicateSaved:o.importTasks.savedTo.replace("{notebook}",e.notebookName||"-").replace("{id}",e.errorItemShortId||"-")}),S&&(0,t.jsx)("p",{className:"text-xs text-destructive",children:S}),(0,t.jsxs)("div",{className:"flex flex-wrap items-center gap-x-3 gap-y-1 text-xs text-muted-foreground",children:[(0,t.jsxs)("span",{className:"flex items-center gap-1",children:[(0,t.jsx)(n,{className:"h-3 w-3"}),o.importTasks.createdAt.replace("{time}",(0,x.r)(e.createdAt,"MM-dd HH:mm",w))]}),null!==T&&(0,t.jsx)("span",{children:o.importTasks.elapsed.replace("{time}",p(T))}),e.attempts>1&&(0,t.jsx)("span",{children:o.importTasks.attempts.replace("{count}",String(e.attempts))})]}),A.length>0&&(0,t.jsx)("ul",{className:"flex flex-wrap gap-x-3 gap-y-1 text-xs text-muted-foreground tabular-nums","aria-label":"timings",children:A.map(({stage:e,ms:r})=>(0,t.jsxs)("li",{children:[o.importTasks.timings[e]," ",p(r)]},e))})]})]}),(0,t.jsxs)("div",{className:"flex flex-wrap justify-end gap-2",children:["review"===e.status&&s&&(0,t.jsx)(c.f,{size:"sm",onClick:s,children:o.importTasks.continueReview}),"saved"===e.status&&e.errorItemId&&a&&(0,t.jsx)(c.f,{size:"sm",variant:"outline",onClick:a,children:o.importTasks.viewItem}),"failed"===e.status&&i&&(0,t.jsx)(c.f,{size:"sm",onClick:i,children:o.importTasks.retry}),"saving"!==e.status&&"saved"!==e.status&&l&&(0,t.jsx)(c.f,{size:"sm",variant:"ghost",onClick:l,children:o.importTasks.discard})]})]})}],731335);var w=e.i(618566),b=e.i(767077),k=e.i(294114),N=e.i(201276),S=e.i(127175);e.s(["f",0,function(e){let{t}=(0,m.b)(),r=(0,w.useRouter)(),s=e=>{e.unread&&(0,S.N)(e.id).catch(e=>N.V.warn("[ImportTasks]","Mark read failed",{error:e}))};return{openReview:e=>{s(e),r.push(`/import-tasks/${e.id}`)},viewItem:e=>{e.errorItemId&&(s(e),r.push(`/error-items/${e.errorItemId}`))},markRead:s,retry:async r=>{try{await (0,S.R)(r.id),k.c.info(t.importTasks.retried)}catch(e){k.c.error((0,b.f)(e,t))}e?.()},discard:async r=>{if(!await (0,k.u)(t.importTasks.discardConfirm))return!1;let s=!1;try{await (0,S.x)(r.id),k.c.success(t.importTasks.discarded),s=!0}catch(e){k.c.error((0,b.f)(e,t))}return e?.(),s}}}],532377);var A=e.i(271645);e.s(["f",0,function(e,t=1e3){let[r,s]=(0,A.useState)(()=>Date.now());return(0,A.useEffect)(()=>{if(!e)return;let r=setInterval(()=>s(Date.now()),t);return()=>clearInterval(r)},[e,t]),r}],339501)},141176,e=>{var t=e.i(843476),r=e.i(271645),s=e.i(456420);let a={name:"code-xml",size:24,node:[["path",{d:"m18 16 4-4-4-4",key:"1inbqp"}],["path",{d:"m6 8-4 4 4 4",key:"15zrgr"}],["path",{d:"m14.5 4-5 16",key:"e7oirm"}]],aliases:["code-2"]};a.node;let i=(0,s.f)(a);var n=e.i(772382),l=e.i(511445),o=e.i(624687),d=e.i(111110),c=e.i(975157);e.s(["f",0,function({value:e,onChange:s,className:a,...u}){let{t:m}=(0,d.b)(),[f,x]=(0,r.useState)("source"),g=(0,r.useId)(),h=[{mode:"source",label:m.markdownEditor.source,icon:i},{mode:"preview",label:m.markdownEditor.preview,icon:n.f}];return(0,t.jsxs)("div",{className:"space-y-1.5",children:[(0,t.jsx)("div",{role:"tablist","aria-label":m.markdownEditor.modeLabel,className:"flex justify-end",children:(0,t.jsx)("div",{className:"inline-flex rounded-md border bg-muted/40 p-0.5",children:h.map(({mode:e,label:r,icon:s})=>(0,t.jsxs)("button",{type:"button",role:"tab","aria-selected":f===e,"aria-controls":g,onClick:()=>x(e),className:(0,c.f)("flex items-center gap-1 rounded px-2.5 py-1 text-xs transition-colors",f===e?"bg-background font-medium shadow-sm":"text-muted-foreground hover:text-foreground"),children:[(0,t.jsx)(s,{className:"h-3.5 w-3.5"}),r]},e))})}),(0,t.jsx)("div",{id:g,role:"tabpanel",children:"source"===f?(0,t.jsx)(o.f,{value:e,onChange:e=>s(e.target.value),className:a,...u}):(0,t.jsx)("div",{className:"min-h-24 cursor-text rounded-md border bg-muted/20 px-3 py-2",onDoubleClick:()=>x("source"),title:m.markdownEditor.doubleClickToEdit,children:e.trim()?(0,t.jsx)(l.f,{content:e}):(0,t.jsx)("p",{className:"text-sm italic text-muted-foreground",children:m.markdownEditor.empty})})})]})}],141176)},438465,674166,e=>{var t=e.i(843476),r=e.i(271645),s=e.i(967489),a=e.i(856423),i=e.i(41931),n=e.i(201276),l=e.i(111110);e.s(["f",0,function({value:e,onChange:o,className:d}){let[c,u]=(0,r.useState)([]),{t:m}=(0,l.b)();return(0,r.useEffect)(()=>{(async()=>{try{let e=await i.k.get("/api/notebooks");u(e)}catch(e){n.V.error("[NotebookSelector]","Failed to fetch notebooks",{error:e})}})()},[]),(0,t.jsxs)(s.d,{value:e,onValueChange:o,children:[(0,t.jsx)(s.P,{className:d,children:(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)(a.f,{className:"h-4 w-4 text-muted-foreground"}),(0,t.jsx)(s.U,{placeholder:m.notebooks?.selector?.placeholder||"Select Notebook"})]})}),(0,t.jsx)(s.r,{children:0===c.length?(0,t.jsx)("div",{className:"p-2 text-sm text-muted-foreground text-center",children:m.notebooks?.selector?.empty||"No notebooks available"}):c.map(e=>(0,t.jsx)(s.T,{value:e.id,children:e.name},e.id))})]})}],438465);var o=e.i(470279);e.s(["f",0,function({value:e,onChange:r,disabled:a}){let{groups:i,loading:n}=(0,o.f)(),l=i.filter(e=>e.isActive);return(0,t.jsxs)(s.d,{value:e,onValueChange:r,disabled:a||n,children:[(0,t.jsx)(s.P,{children:(0,t.jsx)(s.U,{placeholder:"选择卷别"})}),(0,t.jsx)(s.r,{children:l.map(e=>(0,t.jsx)(s.T,{value:e.id,children:e.name},e.id))})]})}],674166)},149704,e=>{var t=e.i(843476),r=e.i(111110),s=e.i(398019),a=e.i(184110),i=e.i(975157);let n={left:"mr-auto",center:"mx-auto",right:"ml-auto"};e.s(["f",0,function({svg:e,scale:l,align:o,className:d}){let{t:c}=(0,r.b)();if(!e)return null;let u=(0,a.V)(l),m=(0,a.o)(o);return(0,t.jsx)("figure",{className:(0,i.f)("question-figure my-3",d),children:(0,t.jsx)("img",{src:(0,s.f)(e),alt:c.figure.alt,className:(0,i.f)(n[m],"block h-auto max-w-full rounded border bg-white p-2"),style:{..."left"===m?{marginLeft:0,marginRight:"auto"}:"right"===m?{marginLeft:"auto",marginRight:0}:{},maxHeight:360,zoom:u/100,maxWidth:`${Math.min(u,100)}%`}})})}])},574041,e=>{var t=e.i(843476),r=e.i(271645),s=e.i(263676),a=e.i(487486),i=e.i(793479),n=e.i(41931),l=e.i(201276);e.s(["f",0,function({value:e=[],onChange:o,placeholder:d="Enter tags...",className:c="",enterHint:u,subject:m,gradeStage:f}){let[x,g]=(0,r.useState)(""),[h,p]=(0,r.useState)([]),[v,y]=(0,r.useState)(!1),[j,w]=(0,r.useState)(0),b=(0,r.useRef)(null),k=(0,r.useRef)(null),N=(0,r.useCallback)(async t=>{try{let r=new URLSearchParams({q:t});m&&r.append("subject",m),f&&r.append("stage",f);let s=((await n.k.get(`/api/tags/suggestions?${r.toString()}`)).suggestions||[]).filter(t=>!e.includes(t));p(s.slice(0,20)),y(s.length>0),w(0)}catch(e){l.V.error("[TagInput]","Failed to fetch suggestions",{error:e})}},[m,f,e]);(0,r.useEffect)(()=>{x.trim()&&N(x)},[x,N]);let S=t=>{t.trim()&&!e.includes(t.trim())&&(o([...e,t.trim()]),g(""),p([]),y(!1),w(0))},A=t=>{o(e.filter(e=>e!==t))};return(0,r.useEffect)(()=>{let e=e=>{!k.current||k.current.contains(e.target)||b.current?.contains(e.target)||y(!1)};return document.addEventListener("mousedown",e),()=>document.removeEventListener("mousedown",e)},[]),(0,t.jsxs)("div",{className:`relative ${c}`,children:[(0,t.jsxs)("div",{className:"flex flex-wrap gap-2 p-2 border rounded-lg bg-background min-h-[42px]",children:[e.map(e=>(0,t.jsxs)(a.f,{variant:"secondary",className:"flex items-center gap-1 px-2 py-1",children:[e,(0,t.jsx)("button",{type:"button",onClick:()=>A(e),className:"hover:text-destructive ml-1",children:(0,t.jsx)(s.X,{className:"h-3 w-3"})})]},e)),(0,t.jsx)(i.f,{ref:b,type:"text",value:x,onChange:e=>{g(e.target.value),e.target.value.trim()||(p([]),y(!1))},onKeyDown:t=>{"Enter"===t.key?(t.preventDefault(),j>=0&&h[j]?S(h[j]):x.trim()&&S(x)):"ArrowDown"===t.key?(t.preventDefault(),w(e=>Math.min(e+1,h.length-1))):"ArrowUp"===t.key?(t.preventDefault(),w(e=>Math.max(e-1,0))):"Escape"===t.key?(y(!1),w(0)):"Backspace"===t.key&&!x&&e.length>0&&A(e[e.length-1])},onFocus:()=>{h.length>0&&y(!0)},placeholder:0===e.length?d:"",className:"flex-1 min-w-[120px] border-none focus-visible:ring-0 focus-visible:ring-offset-0 h-8 px-0"})]}),v&&h.length>0&&(0,t.jsx)("div",{ref:k,className:"absolute z-50 w-full mt-1 bg-popover border rounded-md shadow-md max-h-48 overflow-y-auto",children:h.map((e,r)=>(0,t.jsx)("div",{className:`px-3 py-2 cursor-pointer hover:bg-accent ${r===j?"bg-accent":""}`,onClick:()=>S(e),onMouseEnter:()=>w(r),children:e},e))}),x&&!v&&(0,t.jsx)("div",{className:"text-xs text-muted-foreground mt-1",children:u?`${u} "${x}"`:`Press Enter to create "${x}"`})]})}])},184110,e=>{let t=["left","center","right"],r="center";function s(e){return"number"==typeof e&&Number.isInteger(e)&&e>=10&&e<=200}e.s(["E",0,r,"n",0,100,"j",0,t,"a",0,200,"_",0,10,"x",0,s,"o",0,function(e){return"string"==typeof e&&t.includes(e)?e:r},"V",0,function(e){return s(e)?e:100}])},398019,e=>{e.s(["f",0,function(e){return`data:image/svg+xml;charset=utf-8,${encodeURIComponent(e)}`}])},767077,e=>{var t=e.i(303163);e.s(["f",0,function(e,r){let s=r.common?.messages?.analysisFailed||"Analysis failed, please try again",a=(0,t.d)(e);if(a){let e=r.errors??{};if(!(a in e))return a;let t=e[a];return"string"==typeof t?t:s}let i=(0,t.Z)(e);if(i.includes("fetch")||i.includes("network"))return r.errors?.AI_CONNECTION_FAILED||"网络连接失败";if("object"==typeof e&&null!==e&&"data"in e&&"string"==typeof e.data){let t="status"in e&&"number"==typeof e.status?e.status:"Error";return`${s} (${t})`}return s}])},991722,e=>{function t(e){return"not_attempted"===e||"wrong_attempt"===e||"unknown"===e?e:"unknown"}e.s(["i",0,function(e,r="zh"){return("en"===r?{not_attempted:"Not attempted",wrong_attempt:"Wrong attempt",unknown:"Unknown"}:{not_attempted:"不会做",wrong_attempt:"做错了",unknown:"未判断"})[t(e)]},"h",0,t,"x",0,function(e,r){return(r||"").trim()?"wrong_attempt":t(e)}])},597138,e=>{e.i(306831),e.s(["f",0,function(e){if(!e)return null;let t=e.toLowerCase();return t.includes("math")||t.includes("数学")?"math":t.includes("physics")||t.includes("物理")?"physics":t.includes("chemistry")||t.includes("化学")?"chemistry":t.includes("biology")||t.includes("生物")?"biology":t.includes("english")||t.includes("英语")?"english":t.includes("chinese")||t.includes("语文")?"chinese":t.includes("history")||t.includes("历史")?"history":t.includes("geography")||t.includes("地理")?"geography":t.includes("politics")||t.includes("政治")?"politics":null}])}])})();
@@ -3,4 +3,4 @@
3
3
  - less than the value passed to \`max\` (or 100 if no \`max\` prop is set)
4
4
  - \`null\` or \`undefined\` if the progress is indeterminate.
5
5
 
6
- Defaulting to \`null\`.`}d(v,"defaultGetValueLabel"),d(g,"getProgressState"),d(j,"isNumber"),d(y,"isValidMaxNumber"),d(k,"isValidValueNumber"),d(N,"getInvalidMaxError"),d(b,"getInvalidValueError");var w=e.i(975157);let T=i.forwardRef(({className:e,value:t,...a},s)=>(0,r.jsx)(x,{ref:s,value:t,className:(0,w.f)("relative h-4 w-full overflow-hidden rounded-full bg-secondary",e),...a,children:(0,r.jsx)(h,{className:"h-full w-full flex-1 bg-primary transition-all",style:{transform:`translateX(-${100-(t||0)}%)`}})}));T.displayName=x.displayName,e.s(["f",0,T],168148)},419327,e=>{var t=e.i(843476),a=e.i(522016),s=e.i(980105),r=e.i(399847),i=e.i(551757),n=e.i(13285),l=e.i(632781),c=e.i(615568),d=e.i(487486),o=e.i(519455),m=e.i(111110),u=e.i(215519),p=e.i(306831),f=e.i(975157);let x={splitting:l.f,processing:l.f,draft:c.f,attention:r.f,failed:r.f,done:i.f};function h({batch:e}){let{t:s}=(0,m.b)(),{timeZone:r}=(0,u.M)(),i=x[e.phase],l="splitting"===e.phase||"processing"===e.phase,c="started"===e.status?e.counts.total:e.itemCount,{counts:v}=e,g="started"===e.status?[v.saved>0&&s.importBatch.counts.saved.replace("{count}",String(v.saved-v.duplicate)),v.duplicate>0&&s.importBatch.counts.duplicate.replace("{count}",String(v.duplicate)),v.review>0&&s.importBatch.counts.review.replace("{count}",String(v.review)),v.failed>0&&s.importBatch.counts.failed.replace("{count}",String(v.failed)),v.active>0&&s.importBatch.counts.active.replace("{count}",String(v.active))].filter(Boolean):[];return(0,t.jsxs)("div",{className:(0,f.f)("space-y-2 rounded-lg border p-3 text-sm",e.unread&&"border-primary/50 bg-primary/5"),"data-testid":"import-batch-card","data-phase":e.phase,children:[(0,t.jsxs)("div",{className:"flex items-start gap-2",children:[(0,t.jsx)(i,{className:(0,f.f)("mt-0.5 h-4 w-4 shrink-0",l&&"animate-spin text-primary","done"===e.phase&&"text-green-600",("failed"===e.phase||"attention"===e.phase)&&"text-destructive")}),(0,t.jsxs)("div",{className:"min-w-0 flex-1 space-y-1",children:[(0,t.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[(0,t.jsx)(n.f,{className:"h-4 w-4 text-muted-foreground"}),(0,t.jsx)("span",{className:"font-medium",children:c>0?s.importBatch.batchOf.replace("{count}",String(c)):s.importBatch.title}),(0,t.jsxs)("span",{className:"text-xs text-muted-foreground",children:[s.importBatch.source[e.source]," · ",s.importBatch.phase[e.phase]]}),e.unread&&(0,t.jsx)(d.f,{children:s.importTasks.unread})]}),e.excerpt&&(0,t.jsx)("p",{className:"line-clamp-2 break-words text-muted-foreground",children:e.excerpt}),g.length>0&&(0,t.jsx)("p",{className:"text-xs",children:g.join(" · ")}),(0,t.jsx)("p",{className:"text-xs text-muted-foreground",children:s.importTasks.createdAt.replace("{time}",(0,p.r)(e.createdAt,"MM-dd HH:mm",r))})]})]}),(0,t.jsx)("div",{className:"flex justify-end",children:(0,t.jsx)(o.f,{asChild:!0,size:"sm",variant:"draft"===e.phase||"attention"===e.phase?"default":"outline",children:(0,t.jsx)(a.default,{href:`/import-batches/${e.id}`,children:s.importBatch.open})})})]})}var v=e.i(731335),g=e.i(912505),j=e.i(393842),y=e.i(86963),k=e.i(35209),N=e.i(579321),b=e.i(768339),w=e.i(927904);e.s(["default",0,function(){let{t:e}=(0,m.b)();(0,k.f)(e.importTasks.title);let{data:r,refresh:i}=(0,b.b)(),n=(0,N.f)(i),l=(0,w.f)((r?.activeCount??0)>0);return(0,t.jsxs)("main",{className:"mx-auto max-w-3xl space-y-4 px-4 py-6 md:px-8 md:py-8",children:[(0,t.jsx)(j.f,{backHref:"/",title:e.importTasks.title,description:e.importTasks.description}),r?0!==r.tasks.length||r.batches?.length?(0,t.jsx)("ul",{className:"space-y-3",children:[...(r.batches??[]).map(e=>({kind:"batch",createdAt:e.createdAt,batch:e})),...r.tasks.map(e=>({kind:"task",createdAt:e.createdAt,task:e}))].sort((e,t)=>t.createdAt.localeCompare(e.createdAt)).map(e=>"batch"===e.kind?(0,t.jsx)("li",{children:(0,t.jsx)(h,{batch:e.batch})},`batch-${e.batch.id}`):(0,t.jsx)("li",{children:(0,t.jsx)(v.f,{task:e.task,now:l,onReview:()=>n.openReview(e.task),onViewItem:()=>n.viewItem(e.task),onRetry:()=>n.retry(e.task),onDiscard:()=>n.discard(e.task)})},e.task.id))}):(0,t.jsx)(g.f,{icon:s.f,title:e.importTasks.empty,action:(0,t.jsx)(a.default,{href:"/",children:(0,t.jsx)(o.f,{children:e.importTasks.backHome})})}):(0,t.jsx)(y.f,{}),(0,t.jsx)("p",{className:"text-xs text-muted-foreground",children:e.importTasks.retentionHint})]})}],419327)},731335,579321,927904,e=>{var t=e.i(843476),a=e.i(399847),s=e.i(551757),r=e.i(456420);let i={name:"clock-3",size:24,node:[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 6v6h4",key:"135r8i"}]]};i.node;let n=(0,r.f)(i);var l=e.i(632781),c=e.i(615568),d=e.i(487486),o=e.i(519455),m=e.i(168148),u=e.i(111110),p=e.i(215519),f=e.i(306831);let x=["read","convert","crop","compress","upload"],h=["receive","analyze","save"];function v(e){if(!Number.isFinite(e)||e<0)return"-";if(e<1e3)return`${Math.round(e)}ms`;let t=e/1e3;if(t<60)return`${t.toFixed(+(t<10))}s`;let a=Math.round(t);return`${Math.floor(a/60)}:${String(a%60).padStart(2,"0")}`}var g=e.i(975157);let j={analyzing:50,saving:90},y={analyzing:l.f,saving:l.f,review:c.f,saved:s.f,failed:a.f};e.s(["f",0,function({task:e,now:a,onReview:s,onViewItem:r,onRetry:i,onDiscard:l}){let{t:c}=(0,u.b)(),{timeZone:k}=(0,p.M)(),N=y[e.status],b="analyzing"===e.status||"saving"===e.status,w=c.errors,T=e.error?"string"==typeof w[e.error]?w[e.error]:e.error:null,I=function(e){let t=[];for(let a of x){let s=e?.client?.[a];"number"==typeof s&&t.push({stage:a,ms:s})}for(let a of h){let s=e?.server?.[a];"number"==typeof s&&t.push({stage:a,ms:s})}return t}(e.timings),z=b&&a?a-Date.parse(e.createdAt):null;return(0,t.jsxs)("div",{className:(0,g.f)("space-y-2 rounded-lg border p-3 text-sm",e.unread&&"border-primary/50 bg-primary/5"),"data-testid":"import-task-card","data-status":e.status,children:[(0,t.jsxs)("div",{className:"flex items-start gap-2",children:[(0,t.jsx)(N,{className:(0,g.f)("mt-0.5 h-4 w-4 shrink-0",b&&"animate-spin text-primary","saved"===e.status&&"text-green-600","failed"===e.status&&"text-destructive","review"===e.status&&"text-primary")}),(0,t.jsxs)("div",{className:"min-w-0 flex-1 space-y-1",children:[(0,t.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[(0,t.jsx)("span",{className:"font-medium",children:c.importTasks.status[e.status]}),(0,t.jsx)("span",{className:"text-xs text-muted-foreground",children:c.importTasks.mode[e.mode]}),e.unread&&(0,t.jsx)(d.f,{children:c.importTasks.unread})]}),b&&(0,t.jsx)(m.f,{value:j[e.status],"aria-label":c.importTasks.stageEstimate,"aria-valuetext":c.common.progress.estimated.replace("{percent}",String(j[e.status])),className:"h-1.5"}),e.excerpt&&(0,t.jsx)("p",{className:"break-words text-muted-foreground",children:e.excerpt}),"saved"===e.status&&!e.errorItemId&&(0,t.jsx)("p",{className:"text-xs text-muted-foreground",children:c.importTasks.itemDeleted}),"saved"===e.status&&e.errorItemId&&(0,t.jsx)("p",{className:"text-xs text-green-700 dark:text-green-300",children:e.duplicate?c.importTasks.duplicateSaved:c.importTasks.savedTo.replace("{notebook}",e.notebookName||"-").replace("{id}",e.errorItemShortId||"-")}),T&&(0,t.jsx)("p",{className:"text-xs text-destructive",children:T}),(0,t.jsxs)("div",{className:"flex flex-wrap items-center gap-x-3 gap-y-1 text-xs text-muted-foreground",children:[(0,t.jsxs)("span",{className:"flex items-center gap-1",children:[(0,t.jsx)(n,{className:"h-3 w-3"}),c.importTasks.createdAt.replace("{time}",(0,f.r)(e.createdAt,"MM-dd HH:mm",k))]}),null!==z&&(0,t.jsx)("span",{children:c.importTasks.elapsed.replace("{time}",v(z))}),e.attempts>1&&(0,t.jsx)("span",{children:c.importTasks.attempts.replace("{count}",String(e.attempts))})]}),I.length>0&&(0,t.jsx)("ul",{className:"flex flex-wrap gap-x-3 gap-y-1 text-xs text-muted-foreground tabular-nums","aria-label":"timings",children:I.map(({stage:e,ms:a})=>(0,t.jsxs)("li",{children:[c.importTasks.timings[e]," ",v(a)]},e))})]})]}),(0,t.jsxs)("div",{className:"flex flex-wrap justify-end gap-2",children:["review"===e.status&&s&&(0,t.jsx)(o.f,{size:"sm",onClick:s,children:c.importTasks.continueReview}),"saved"===e.status&&e.errorItemId&&r&&(0,t.jsx)(o.f,{size:"sm",variant:"outline",onClick:r,children:c.importTasks.viewItem}),"failed"===e.status&&i&&(0,t.jsx)(o.f,{size:"sm",onClick:i,children:c.importTasks.retry}),"saving"!==e.status&&"saved"!==e.status&&l&&(0,t.jsx)(o.f,{size:"sm",variant:"ghost",onClick:l,children:c.importTasks.discard})]})]})}],731335);var k=e.i(618566),N=e.i(61425),b=e.i(294114),w=e.i(201276),T=e.i(116331);e.s(["f",0,function(e){let{t}=(0,u.b)(),a=(0,k.useRouter)(),s=e=>{e.unread&&(0,T.N)(e.id).catch(e=>w.V.warn("[ImportTasks]","Mark read failed",{error:e}))};return{openReview:e=>{s(e),a.push(`/import-tasks/${e.id}`)},viewItem:e=>{e.errorItemId&&(s(e),a.push(`/error-items/${e.errorItemId}`))},markRead:s,retry:async a=>{try{await (0,T.R)(a.id),b.c.info(t.importTasks.retried)}catch(e){b.c.error((0,N.f)(e,t))}e?.()},discard:async a=>{if(!await (0,b.u)(t.importTasks.discardConfirm))return!1;let s=!1;try{await (0,T.x)(a.id),b.c.success(t.importTasks.discarded),s=!0}catch(e){b.c.error((0,N.f)(e,t))}return e?.(),s}}}],579321);var I=e.i(271645);e.s(["f",0,function(e,t=1e3){let[a,s]=(0,I.useState)(()=>Date.now());return(0,I.useEffect)(()=>{if(!e)return;let a=setInterval(()=>s(Date.now()),t);return()=>clearInterval(a)},[e,t]),a}],927904)},590546,e=>{var t=e.i(843476),a=e.i(618566),s=e.i(519455),r=e.i(711241);e.s(["f",0,function({fallbackUrl:e,className:i}){let n=(0,a.useRouter)();return(0,t.jsx)(s.f,{variant:"ghost",size:"icon",onClick:()=>{n.push(e)},className:i,children:(0,t.jsx)(r.f,{className:"h-5 w-5"})})}])},912505,e=>{var t=e.i(843476),a=e.i(975157);e.s(["f",0,function({icon:e,title:s,description:r,action:i,className:n}){return(0,t.jsxs)("div",{className:(0,a.f)("flex flex-col items-center justify-center rounded-2xl border border-dashed bg-card/50 px-6 py-14 text-center",n),children:[(0,t.jsx)("div",{className:"mb-4 flex h-14 w-14 items-center justify-center rounded-2xl bg-accent text-accent-foreground",children:(0,t.jsx)(e,{className:"h-7 w-7"})}),(0,t.jsx)("p",{className:"font-medium",children:s}),r&&(0,t.jsx)("p",{className:"mt-1 max-w-sm text-sm text-muted-foreground",children:r}),i&&(0,t.jsx)("div",{className:"mt-5",children:i})]})}])},393842,e=>{var t=e.i(843476),a=e.i(590546),s=e.i(975157);e.s(["f",0,function({title:e,description:r,backHref:i,actions:n,titleAddon:l,className:c}){return(0,t.jsxs)("div",{className:(0,s.f)("flex items-start gap-3",c),children:[i&&(0,t.jsx)(a.f,{fallbackUrl:i,className:"-ml-2 shrink-0"}),(0,t.jsxs)("div",{className:"min-w-0 flex-1 space-y-1",children:[(0,t.jsxs)("div",{className:"flex items-center gap-1",children:[(0,t.jsx)("h1",{className:"truncate text-2xl font-bold tracking-tight sm:text-3xl",children:e}),l]}),r&&(0,t.jsx)("p",{className:"text-sm text-muted-foreground sm:text-base",children:r})]}),n&&(0,t.jsx)("div",{className:"flex shrink-0 items-center gap-2",children:n})]})}])},86963,e=>{var t=e.i(843476),a=e.i(632781);e.s(["f",0,function({label:e}){return(0,t.jsxs)("div",{className:"flex min-h-[50vh] flex-col items-center justify-center gap-3 text-muted-foreground",children:[(0,t.jsx)(a.f,{className:"h-7 w-7 animate-spin text-primary"}),e&&(0,t.jsx)("p",{className:"text-sm",children:e})]})}])},61425,e=>{var t=e.i(303163);e.s(["f",0,function(e,a){let s=a.common?.messages?.analysisFailed||"Analysis failed, please try again",r=(0,t.d)(e);if(r){let e=a.errors??{};if(!(r in e))return r;let t=e[r];return"string"==typeof t?t:s}let i=(0,t.Z)(e);if(i.includes("fetch")||i.includes("network"))return a.errors?.AI_CONNECTION_FAILED||"网络连接失败";if("object"==typeof e&&null!==e&&"data"in e&&"string"==typeof e.data){let t="status"in e&&"number"==typeof e.status?e.status:"Error";return`${s} (${t})`}return s}])},35209,e=>{var t=e.i(271645),a=e.i(111110);e.s(["f",0,function(...e){let{t:s}=(0,a.b)(),r=[s.pageTitle.base,...e.map(e=>"string"==typeof e?e.trim():"").filter(e=>e.length>0)].join("-");(0,t.useEffect)(()=>{document.title=r},[r])}])}])})();
6
+ Defaulting to \`null\`.`}d(v,"defaultGetValueLabel"),d(g,"getProgressState"),d(j,"isNumber"),d(y,"isValidMaxNumber"),d(k,"isValidValueNumber"),d(N,"getInvalidMaxError"),d(b,"getInvalidValueError");var w=e.i(975157);let T=i.forwardRef(({className:e,value:t,...a},s)=>(0,r.jsx)(x,{ref:s,value:t,className:(0,w.f)("relative h-4 w-full overflow-hidden rounded-full bg-secondary",e),...a,children:(0,r.jsx)(h,{className:"h-full w-full flex-1 bg-primary transition-all",style:{transform:`translateX(-${100-(t||0)}%)`}})}));T.displayName=x.displayName,e.s(["f",0,T],168148)},419327,e=>{var t=e.i(843476),a=e.i(522016),s=e.i(980105),r=e.i(399847),i=e.i(551757),n=e.i(13285),l=e.i(632781),c=e.i(615568),d=e.i(487486),o=e.i(519455),m=e.i(111110),u=e.i(215519),p=e.i(306831),f=e.i(975157);let x={splitting:l.f,processing:l.f,draft:c.f,attention:r.f,failed:r.f,done:i.f};function h({batch:e}){let{t:s}=(0,m.b)(),{timeZone:r}=(0,u.M)(),i=x[e.phase],l="splitting"===e.phase||"processing"===e.phase,c="started"===e.status?e.counts.total:e.itemCount,{counts:v}=e,g="started"===e.status?[v.saved>0&&s.importBatch.counts.saved.replace("{count}",String(v.saved-v.duplicate)),v.duplicate>0&&s.importBatch.counts.duplicate.replace("{count}",String(v.duplicate)),v.review>0&&s.importBatch.counts.review.replace("{count}",String(v.review)),v.failed>0&&s.importBatch.counts.failed.replace("{count}",String(v.failed)),v.active>0&&s.importBatch.counts.active.replace("{count}",String(v.active))].filter(Boolean):[];return(0,t.jsxs)("div",{className:(0,f.f)("space-y-2 rounded-lg border p-3 text-sm",e.unread&&"border-primary/50 bg-primary/5"),"data-testid":"import-batch-card","data-phase":e.phase,children:[(0,t.jsxs)("div",{className:"flex items-start gap-2",children:[(0,t.jsx)(i,{className:(0,f.f)("mt-0.5 h-4 w-4 shrink-0",l&&"animate-spin text-primary","done"===e.phase&&"text-green-600",("failed"===e.phase||"attention"===e.phase)&&"text-destructive")}),(0,t.jsxs)("div",{className:"min-w-0 flex-1 space-y-1",children:[(0,t.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[(0,t.jsx)(n.f,{className:"h-4 w-4 text-muted-foreground"}),(0,t.jsx)("span",{className:"font-medium",children:c>0?s.importBatch.batchOf.replace("{count}",String(c)):s.importBatch.title}),(0,t.jsxs)("span",{className:"text-xs text-muted-foreground",children:[s.importBatch.source[e.source]," · ",s.importBatch.phase[e.phase]]}),e.unread&&(0,t.jsx)(d.f,{children:s.importTasks.unread})]}),e.excerpt&&(0,t.jsx)("p",{className:"line-clamp-2 break-words text-muted-foreground",children:e.excerpt}),g.length>0&&(0,t.jsx)("p",{className:"text-xs",children:g.join(" · ")}),(0,t.jsx)("p",{className:"text-xs text-muted-foreground",children:s.importTasks.createdAt.replace("{time}",(0,p.r)(e.createdAt,"MM-dd HH:mm",r))})]})]}),(0,t.jsx)("div",{className:"flex justify-end",children:(0,t.jsx)(o.f,{asChild:!0,size:"sm",variant:"draft"===e.phase||"attention"===e.phase?"default":"outline",children:(0,t.jsx)(a.default,{href:`/import-batches/${e.id}`,children:s.importBatch.open})})})]})}var v=e.i(731335),g=e.i(912505),j=e.i(393842),y=e.i(86963),k=e.i(35209),N=e.i(532377),b=e.i(901219),w=e.i(339501);e.s(["default",0,function(){let{t:e}=(0,m.b)();(0,k.f)(e.importTasks.title);let{data:r,refresh:i}=(0,b.b)(),n=(0,N.f)(i),l=(0,w.f)((r?.activeCount??0)>0);return(0,t.jsxs)("main",{className:"mx-auto max-w-3xl space-y-4 px-4 py-6 md:px-8 md:py-8",children:[(0,t.jsx)(j.f,{backHref:"/",title:e.importTasks.title,description:e.importTasks.description}),r?0!==r.tasks.length||r.batches?.length?(0,t.jsx)("ul",{className:"space-y-3",children:[...(r.batches??[]).map(e=>({kind:"batch",createdAt:e.createdAt,batch:e})),...r.tasks.map(e=>({kind:"task",createdAt:e.createdAt,task:e}))].sort((e,t)=>t.createdAt.localeCompare(e.createdAt)).map(e=>"batch"===e.kind?(0,t.jsx)("li",{children:(0,t.jsx)(h,{batch:e.batch})},`batch-${e.batch.id}`):(0,t.jsx)("li",{children:(0,t.jsx)(v.f,{task:e.task,now:l,onReview:()=>n.openReview(e.task),onViewItem:()=>n.viewItem(e.task),onRetry:()=>n.retry(e.task),onDiscard:()=>n.discard(e.task)})},e.task.id))}):(0,t.jsx)(g.f,{icon:s.f,title:e.importTasks.empty,action:(0,t.jsx)(a.default,{href:"/",children:(0,t.jsx)(o.f,{children:e.importTasks.backHome})})}):(0,t.jsx)(y.f,{}),(0,t.jsx)("p",{className:"text-xs text-muted-foreground",children:e.importTasks.retentionHint})]})}],419327)},731335,532377,339501,e=>{var t=e.i(843476),a=e.i(399847),s=e.i(551757),r=e.i(456420);let i={name:"clock-3",size:24,node:[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 6v6h4",key:"135r8i"}]]};i.node;let n=(0,r.f)(i);var l=e.i(632781),c=e.i(615568),d=e.i(487486),o=e.i(519455),m=e.i(168148),u=e.i(111110),p=e.i(215519),f=e.i(306831);let x=["read","convert","crop","compress","upload"],h=["receive","analyze","save"];function v(e){if(!Number.isFinite(e)||e<0)return"-";if(e<1e3)return`${Math.round(e)}ms`;let t=e/1e3;if(t<60)return`${t.toFixed(+(t<10))}s`;let a=Math.round(t);return`${Math.floor(a/60)}:${String(a%60).padStart(2,"0")}`}var g=e.i(975157);let j={analyzing:50,saving:90},y={analyzing:l.f,saving:l.f,review:c.f,saved:s.f,failed:a.f};e.s(["f",0,function({task:e,now:a,onReview:s,onViewItem:r,onRetry:i,onDiscard:l}){let{t:c}=(0,u.b)(),{timeZone:k}=(0,p.M)(),N=y[e.status],b="analyzing"===e.status||"saving"===e.status,w=c.errors,T=e.error?"string"==typeof w[e.error]?w[e.error]:e.error:null,I=function(e){let t=[];for(let a of x){let s=e?.client?.[a];"number"==typeof s&&t.push({stage:a,ms:s})}for(let a of h){let s=e?.server?.[a];"number"==typeof s&&t.push({stage:a,ms:s})}return t}(e.timings),z=b&&a?a-Date.parse(e.createdAt):null;return(0,t.jsxs)("div",{className:(0,g.f)("space-y-2 rounded-lg border p-3 text-sm",e.unread&&"border-primary/50 bg-primary/5"),"data-testid":"import-task-card","data-status":e.status,children:[(0,t.jsxs)("div",{className:"flex items-start gap-2",children:[(0,t.jsx)(N,{className:(0,g.f)("mt-0.5 h-4 w-4 shrink-0",b&&"animate-spin text-primary","saved"===e.status&&"text-green-600","failed"===e.status&&"text-destructive","review"===e.status&&"text-primary")}),(0,t.jsxs)("div",{className:"min-w-0 flex-1 space-y-1",children:[(0,t.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[(0,t.jsx)("span",{className:"font-medium",children:c.importTasks.status[e.status]}),(0,t.jsx)("span",{className:"text-xs text-muted-foreground",children:c.importTasks.mode[e.mode]}),e.unread&&(0,t.jsx)(d.f,{children:c.importTasks.unread})]}),b&&(0,t.jsx)(m.f,{value:j[e.status],"aria-label":c.importTasks.stageEstimate,"aria-valuetext":c.common.progress.estimated.replace("{percent}",String(j[e.status])),className:"h-1.5"}),e.excerpt&&(0,t.jsx)("p",{className:"break-words text-muted-foreground",children:e.excerpt}),"saved"===e.status&&!e.errorItemId&&(0,t.jsx)("p",{className:"text-xs text-muted-foreground",children:c.importTasks.itemDeleted}),"saved"===e.status&&e.errorItemId&&(0,t.jsx)("p",{className:"text-xs text-green-700 dark:text-green-300",children:e.duplicate?c.importTasks.duplicateSaved:c.importTasks.savedTo.replace("{notebook}",e.notebookName||"-").replace("{id}",e.errorItemShortId||"-")}),T&&(0,t.jsx)("p",{className:"text-xs text-destructive",children:T}),(0,t.jsxs)("div",{className:"flex flex-wrap items-center gap-x-3 gap-y-1 text-xs text-muted-foreground",children:[(0,t.jsxs)("span",{className:"flex items-center gap-1",children:[(0,t.jsx)(n,{className:"h-3 w-3"}),c.importTasks.createdAt.replace("{time}",(0,f.r)(e.createdAt,"MM-dd HH:mm",k))]}),null!==z&&(0,t.jsx)("span",{children:c.importTasks.elapsed.replace("{time}",v(z))}),e.attempts>1&&(0,t.jsx)("span",{children:c.importTasks.attempts.replace("{count}",String(e.attempts))})]}),I.length>0&&(0,t.jsx)("ul",{className:"flex flex-wrap gap-x-3 gap-y-1 text-xs text-muted-foreground tabular-nums","aria-label":"timings",children:I.map(({stage:e,ms:a})=>(0,t.jsxs)("li",{children:[c.importTasks.timings[e]," ",v(a)]},e))})]})]}),(0,t.jsxs)("div",{className:"flex flex-wrap justify-end gap-2",children:["review"===e.status&&s&&(0,t.jsx)(o.f,{size:"sm",onClick:s,children:c.importTasks.continueReview}),"saved"===e.status&&e.errorItemId&&r&&(0,t.jsx)(o.f,{size:"sm",variant:"outline",onClick:r,children:c.importTasks.viewItem}),"failed"===e.status&&i&&(0,t.jsx)(o.f,{size:"sm",onClick:i,children:c.importTasks.retry}),"saving"!==e.status&&"saved"!==e.status&&l&&(0,t.jsx)(o.f,{size:"sm",variant:"ghost",onClick:l,children:c.importTasks.discard})]})]})}],731335);var k=e.i(618566),N=e.i(767077),b=e.i(294114),w=e.i(201276),T=e.i(127175);e.s(["f",0,function(e){let{t}=(0,u.b)(),a=(0,k.useRouter)(),s=e=>{e.unread&&(0,T.N)(e.id).catch(e=>w.V.warn("[ImportTasks]","Mark read failed",{error:e}))};return{openReview:e=>{s(e),a.push(`/import-tasks/${e.id}`)},viewItem:e=>{e.errorItemId&&(s(e),a.push(`/error-items/${e.errorItemId}`))},markRead:s,retry:async a=>{try{await (0,T.R)(a.id),b.c.info(t.importTasks.retried)}catch(e){b.c.error((0,N.f)(e,t))}e?.()},discard:async a=>{if(!await (0,b.u)(t.importTasks.discardConfirm))return!1;let s=!1;try{await (0,T.x)(a.id),b.c.success(t.importTasks.discarded),s=!0}catch(e){b.c.error((0,N.f)(e,t))}return e?.(),s}}}],532377);var I=e.i(271645);e.s(["f",0,function(e,t=1e3){let[a,s]=(0,I.useState)(()=>Date.now());return(0,I.useEffect)(()=>{if(!e)return;let a=setInterval(()=>s(Date.now()),t);return()=>clearInterval(a)},[e,t]),a}],339501)},590546,e=>{var t=e.i(843476),a=e.i(618566),s=e.i(519455),r=e.i(711241);e.s(["f",0,function({fallbackUrl:e,className:i}){let n=(0,a.useRouter)();return(0,t.jsx)(s.f,{variant:"ghost",size:"icon",onClick:()=>{n.push(e)},className:i,children:(0,t.jsx)(r.f,{className:"h-5 w-5"})})}])},912505,e=>{var t=e.i(843476),a=e.i(975157);e.s(["f",0,function({icon:e,title:s,description:r,action:i,className:n}){return(0,t.jsxs)("div",{className:(0,a.f)("flex flex-col items-center justify-center rounded-2xl border border-dashed bg-card/50 px-6 py-14 text-center",n),children:[(0,t.jsx)("div",{className:"mb-4 flex h-14 w-14 items-center justify-center rounded-2xl bg-accent text-accent-foreground",children:(0,t.jsx)(e,{className:"h-7 w-7"})}),(0,t.jsx)("p",{className:"font-medium",children:s}),r&&(0,t.jsx)("p",{className:"mt-1 max-w-sm text-sm text-muted-foreground",children:r}),i&&(0,t.jsx)("div",{className:"mt-5",children:i})]})}])},393842,e=>{var t=e.i(843476),a=e.i(590546),s=e.i(975157);e.s(["f",0,function({title:e,description:r,backHref:i,actions:n,titleAddon:l,className:c}){return(0,t.jsxs)("div",{className:(0,s.f)("flex items-start gap-3",c),children:[i&&(0,t.jsx)(a.f,{fallbackUrl:i,className:"-ml-2 shrink-0"}),(0,t.jsxs)("div",{className:"min-w-0 flex-1 space-y-1",children:[(0,t.jsxs)("div",{className:"flex items-center gap-1",children:[(0,t.jsx)("h1",{className:"truncate text-2xl font-bold tracking-tight sm:text-3xl",children:e}),l]}),r&&(0,t.jsx)("p",{className:"text-sm text-muted-foreground sm:text-base",children:r})]}),n&&(0,t.jsx)("div",{className:"flex shrink-0 items-center gap-2",children:n})]})}])},86963,e=>{var t=e.i(843476),a=e.i(632781);e.s(["f",0,function({label:e}){return(0,t.jsxs)("div",{className:"flex min-h-[50vh] flex-col items-center justify-center gap-3 text-muted-foreground",children:[(0,t.jsx)(a.f,{className:"h-7 w-7 animate-spin text-primary"}),e&&(0,t.jsx)("p",{className:"text-sm",children:e})]})}])},35209,e=>{var t=e.i(271645),a=e.i(111110);e.s(["f",0,function(...e){let{t:s}=(0,a.b)(),r=[s.pageTitle.base,...e.map(e=>"string"==typeof e?e.trim():"").filter(e=>e.length>0)].join("-");(0,t.useEffect)(()=>{document.title=r},[r])}])},767077,e=>{var t=e.i(303163);e.s(["f",0,function(e,a){let s=a.common?.messages?.analysisFailed||"Analysis failed, please try again",r=(0,t.d)(e);if(r){let e=a.errors??{};if(!(r in e))return r;let t=e[r];return"string"==typeof t?t:s}let i=(0,t.Z)(e);if(i.includes("fetch")||i.includes("network"))return a.errors?.AI_CONNECTION_FAILED||"网络连接失败";if("object"==typeof e&&null!==e&&"data"in e&&"string"==typeof e.data){let t="status"in e&&"number"==typeof e.status?e.status:"Error";return`${s} (${t})`}return s}])}])})();
@@ -1 +1 @@
1
- (()=>{"use strict";(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,711241,e=>{var t=e.i(456420);let r={name:"arrow-left",size:24,node:[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]]};r.node;let s=(0,t.f)(r);e.s(["f",0,s],711241)},952801,e=>{var t=e.i(843476),r=e.i(271645),s=e.i(522016),a=e.i(215519),n=e.i(306831),i=e.i(226091),l=e.i(77071),d=e.i(519455),c=e.i(515288),o=e.i(912505),m=e.i(393842),u=e.i(86963),x=e.i(618566),f=e.i(632781),h=e.i(994533),p=e.i(257428),g=e.i(793479),b=e.i(110204),j=e.i(574041),v=e.i(111110);let y=["generate","original"];function k({value:e,onChange:r}){let{t:s}=(0,v.b)();return(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsx)(b.f,{children:s.exam.modeLabel}),(0,t.jsx)("div",{className:"grid grid-cols-2 gap-1 rounded-md bg-muted p-1 sm:max-w-sm",role:"group","aria-label":s.exam.modeLabel,children:y.map(a=>(0,t.jsx)("button",{type:"button","aria-pressed":e===a,onClick:()=>r(a),className:`rounded px-2 py-1.5 text-sm transition-colors ${e===a?"bg-background shadow-sm font-medium":"text-muted-foreground"}`,children:s.exam.modes[a]},a))}),"original"===e&&(0,t.jsx)("p",{className:"text-xs text-muted-foreground",children:s.exam.originalHint})]})}var N=e.i(41931),w=e.i(664030);let C=["unmastered","mastered","all"],S=["least_practiced","random"],E=["easy","medium","hard","harder"];function R(){let{t:e,language:s}=(0,v.b)(),a=(0,x.useRouter)(),[n,i]=(0,r.useState)([]),[l,o]=(0,r.useState)([]),[m,u]=(0,r.useState)([]),[y,R]=(0,r.useState)([]),[P,$]=(0,r.useState)("unmastered"),[I,L]=(0,r.useState)("least_practiced"),[M,T]=(0,r.useState)(10),[O,D]=(0,r.useState)("medium"),[F,_]=(0,r.useState)("generate"),[A,U]=(0,r.useState)(""),[q,H]=(0,r.useState)(!1),[B,z]=(0,r.useState)(null),{groups:K,loading:V}=(0,w.f)();(0,r.useEffect)(()=>{N.k.get("/api/notebooks").then(e=>{i(e),1===e.length&&o([e[0].id])}).catch(()=>i([]))},[]);let X=async t=>{if(t.preventDefault(),0===l.length)return void z(e.exam.noNotebook);H(!0),z(null);try{let e=await N.k.post("/api/exams",{subjectIds:l,tagNames:m,paperLevelIds:y.length>0?y:void 0,scope:P,pickRule:I,count:M,difficulty:"original"===F?void 0:O,mode:F,title:A.trim()||void 0,language:s});a.push(`/exams/${e.id}`)}catch(t){z("NO_SOURCE_ITEMS"===t?.data?.message?e.exam.noSource:e.common.messages?.saveFailed||"Failed"),H(!1)}},Y=e.practice.difficulty;return(0,t.jsxs)(c.N,{children:[(0,t.jsx)(c.Y,{children:(0,t.jsx)(c.v,{className:"text-lg",children:e.exam.createTitle})}),(0,t.jsx)(c.O,{children:(0,t.jsxs)("form",{onSubmit:X,className:"space-y-5",children:[(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsxs)("div",{className:"flex items-center justify-between",children:[(0,t.jsx)(b.f,{children:e.exam.notebooks}),n.length>1&&(0,t.jsx)("button",{type:"button",className:"text-xs text-primary hover:underline",onClick:()=>o(l.length===n.length?[]:n.map(e=>e.id)),children:e.exam.selectAll})]}),(0,t.jsx)("div",{className:"grid grid-cols-2 sm:grid-cols-3 gap-2",children:n.map(e=>(0,t.jsxs)("label",{className:"flex items-center gap-2 rounded-md border p-2 text-sm cursor-pointer hover:bg-muted/50",children:[(0,t.jsx)(p.f,{checked:l.includes(e.id),onCheckedChange:()=>{var t;return t=e.id,void o(e=>e.includes(t)?e.filter(e=>e!==t):[...e,t])}}),(0,t.jsx)("span",{className:"truncate",children:e.name}),(0,t.jsx)("span",{className:"ml-auto text-xs text-muted-foreground",children:e._count?.errorItems??""})]},e.id))})]}),(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsx)(b.f,{children:e.exam.tags}),(0,t.jsx)(j.f,{value:m,onChange:u,placeholder:e.exam.tagsPlaceholder})]}),!V&&K.filter(e=>e.isActive).length>0&&(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsx)(b.f,{children:e.filter.paperLevel}),(0,t.jsx)("div",{className:"flex flex-wrap gap-2",children:K.filter(e=>e.isActive).map(e=>(0,t.jsx)("button",{type:"button",onClick:()=>{var t;return t=e.id,void R(e=>e.includes(t)?e.filter(e=>e!==t):[...e,t])},className:`rounded-full border px-3 py-1.5 text-sm transition-colors ${y.includes(e.id)?"border-primary bg-primary text-primary-foreground":"border-input bg-background hover:bg-muted"}`,children:e.name},e.id))})]}),(0,t.jsx)(k,{value:F,onChange:_}),(0,t.jsxs)("div",{className:`grid gap-4 ${"generate"===F?"sm:grid-cols-3":"sm:grid-cols-2"}`,children:[(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsx)(b.f,{children:e.exam.scope}),(0,t.jsx)("div",{className:"grid grid-cols-3 gap-1 rounded-md bg-muted p-1",children:C.map(r=>(0,t.jsx)("button",{type:"button",onClick:()=>$(r),className:`rounded px-2 py-1.5 text-sm transition-colors ${P===r?"bg-background shadow-sm font-medium":"text-muted-foreground"}`,children:e.exam.scopes[r]},r))})]}),(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsx)(b.f,{htmlFor:"exam-count",children:e.exam.count}),(0,t.jsx)(g.f,{id:"exam-count",type:"number",min:1,max:50,value:M,onChange:e=>T(Math.min(50,Math.max(1,parseInt(e.target.value,10)||1)))})]}),"generate"===F&&(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsx)(b.f,{htmlFor:"exam-difficulty",children:e.exam.difficulty}),(0,t.jsx)("select",{id:"exam-difficulty",value:O,onChange:e=>D(e.target.value),className:"h-9 w-full rounded-md border bg-background px-3 text-sm",children:E.map(e=>(0,t.jsx)("option",{value:e,children:Y[e]},e))})]})]}),(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsx)(b.f,{children:e.exam.pickRule}),(0,t.jsx)("div",{className:"grid grid-cols-2 gap-1 rounded-md bg-muted p-1 sm:max-w-sm",children:S.map(r=>(0,t.jsx)("button",{type:"button",onClick:()=>L(r),className:`rounded px-2 py-1.5 text-sm transition-colors ${I===r?"bg-background shadow-sm font-medium":"text-muted-foreground"}`,children:e.exam.pickRules[r]},r))}),(0,t.jsx)("p",{className:"text-xs text-muted-foreground",children:e.exam.pickRuleHints[I]})]}),(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsx)(b.f,{htmlFor:"exam-title",children:e.exam.titleLabel}),(0,t.jsx)(g.f,{id:"exam-title",value:A,maxLength:100,onChange:e=>U(e.target.value)})]}),B&&(0,t.jsx)("p",{className:"text-sm text-destructive",children:B}),(0,t.jsxs)(d.f,{type:"submit",disabled:q,className:"w-full sm:w-auto",children:[q?(0,t.jsx)(f.f,{className:"mr-2 h-4 w-4 animate-spin"}):(0,t.jsx)(h.f,{className:"mr-2 h-4 w-4"}),q?e.exam.creating:"original"===F?e.exam.createOriginal:e.exam.generate]})]})})]})}var P=e.i(663661),$=e.i(487486),I=e.i(35209);e.s(["default",0,function(){let{timeZone:e}=(0,a.M)(),{t:x}=(0,v.b)();(0,I.f)(x.exam.title);let[f,h]=(0,r.useState)(null),[p,g]=(0,r.useState)(!1);(0,r.useEffect)(()=>{N.k.get("/api/exams").then(e=>{h(e),0===e.length&&g(!0)}).catch(()=>h([]))},[]);let b=x.practice.difficulty;return(0,t.jsx)("main",{className:"mx-auto min-h-screen max-w-6xl px-4 py-6 md:px-8 md:py-8",children:(0,t.jsxs)("div",{className:"space-y-6",children:[(0,t.jsx)(m.f,{title:x.exam.title,description:x.exam.subtitle,actions:!p&&(0,t.jsxs)(d.f,{onClick:()=>g(!0),"aria-label":x.exam.create,children:[(0,t.jsx)(l.f,{className:"h-4 w-4"}),(0,t.jsx)("span",{className:"hidden sm:inline",children:x.exam.create})]})}),p&&(0,t.jsx)(R,{}),(0,t.jsxs)("section",{className:"space-y-3",children:[(0,t.jsx)("h2",{className:"text-lg font-semibold",children:x.exam.list}),null===f?(0,t.jsx)(u.f,{}):0===f.length?(0,t.jsx)(o.f,{icon:i.f,title:x.exam.empty,className:"py-10"}):(0,t.jsx)("div",{className:"grid gap-3 md:grid-cols-2",children:f.map(r=>(0,t.jsx)(s.default,{href:`/exams/${r.id}`,children:(0,t.jsx)(c.N,{className:"h-full rounded-2xl transition-all hover:-translate-y-0.5 hover:border-primary/40 hover:shadow-md",children:(0,t.jsxs)(c.O,{className:"space-y-2 pt-4",children:[(0,t.jsxs)("div",{className:"flex items-start justify-between gap-2",children:[(0,t.jsxs)("span",{className:"flex items-center gap-2 font-medium",children:[(0,t.jsx)(i.f,{className:"h-4 w-4 shrink-0 text-primary"}),r.title]}),(0,t.jsx)(P.f,{status:r.status,recorded:r.recordedCount>0})]}),(0,t.jsxs)("div",{className:"flex flex-wrap gap-x-3 gap-y-1 text-xs text-muted-foreground",children:[(0,t.jsx)("span",{children:(0,n.r)(r.createdAt,"yyyy-MM-dd HH:mm",e)}),(0,t.jsx)("span",{children:x.exam.questionCount.replace("{count}",String(r.questionCount))}),(0,t.jsx)("span",{children:x.exam.scopes[r.scope]}),"original"===r.mode?(0,t.jsx)($.f,{variant:"secondary",children:x.exam.modes.original}):(0,t.jsx)("span",{children:b[r.difficulty]||r.difficulty}),(0,t.jsx)("span",{children:r.recordedCount>0?x.exam.recorded:x.exam.notRecorded})]})]})})},r.id))})]})]})})}],952801)},663661,e=>{var t=e.i(843476),r=e.i(487486),s=e.i(111110);let a={generating:"bg-blue-100 dark:bg-blue-900/40 text-blue-700 dark:text-blue-300 border-blue-200 dark:border-blue-900",ready:"bg-indigo-100 dark:bg-indigo-900/40 text-indigo-700 dark:text-indigo-300 border-indigo-200 dark:border-indigo-900",partial:"bg-amber-100 dark:bg-amber-900/40 text-amber-700 dark:text-amber-300 border-amber-200 dark:border-amber-900",failed:"bg-red-100 dark:bg-red-900/40 text-red-700 dark:text-red-300 border-red-200 dark:border-red-900",completed:"bg-green-100 dark:bg-green-900/40 text-green-700 dark:text-green-300 border-green-200 dark:border-green-900"};e.s(["f",0,function({status:e,recorded:n}){let{t:i}=(0,s.b)(),l=n&&("ready"===e||"partial"===e)?"completed":e;return(0,t.jsx)(r.f,{variant:"outline",className:a[l],children:i.exam.status[l]})}])},574041,e=>{var t=e.i(843476),r=e.i(271645),s=e.i(263676),a=e.i(487486),n=e.i(793479),i=e.i(41931),l=e.i(201276);e.s(["f",0,function({value:e=[],onChange:d,placeholder:c="Enter tags...",className:o="",enterHint:m,subject:u,gradeStage:x}){let[f,h]=(0,r.useState)(""),[p,g]=(0,r.useState)([]),[b,j]=(0,r.useState)(!1),[v,y]=(0,r.useState)(0),k=(0,r.useRef)(null),N=(0,r.useRef)(null),w=(0,r.useCallback)(async t=>{try{let r=new URLSearchParams({q:t});u&&r.append("subject",u),x&&r.append("stage",x);let s=((await i.k.get(`/api/tags/suggestions?${r.toString()}`)).suggestions||[]).filter(t=>!e.includes(t));g(s.slice(0,20)),j(s.length>0),y(0)}catch(e){l.V.error("[TagInput]","Failed to fetch suggestions",{error:e})}},[u,x,e]);(0,r.useEffect)(()=>{f.trim()&&w(f)},[f,w]);let C=t=>{t.trim()&&!e.includes(t.trim())&&(d([...e,t.trim()]),h(""),g([]),j(!1),y(0))},S=t=>{d(e.filter(e=>e!==t))};return(0,r.useEffect)(()=>{let e=e=>{!N.current||N.current.contains(e.target)||k.current?.contains(e.target)||j(!1)};return document.addEventListener("mousedown",e),()=>document.removeEventListener("mousedown",e)},[]),(0,t.jsxs)("div",{className:`relative ${o}`,children:[(0,t.jsxs)("div",{className:"flex flex-wrap gap-2 p-2 border rounded-lg bg-background min-h-[42px]",children:[e.map(e=>(0,t.jsxs)(a.f,{variant:"secondary",className:"flex items-center gap-1 px-2 py-1",children:[e,(0,t.jsx)("button",{type:"button",onClick:()=>S(e),className:"hover:text-destructive ml-1",children:(0,t.jsx)(s.X,{className:"h-3 w-3"})})]},e)),(0,t.jsx)(n.f,{ref:k,type:"text",value:f,onChange:e=>{h(e.target.value),e.target.value.trim()||(g([]),j(!1))},onKeyDown:t=>{"Enter"===t.key?(t.preventDefault(),v>=0&&p[v]?C(p[v]):f.trim()&&C(f)):"ArrowDown"===t.key?(t.preventDefault(),y(e=>Math.min(e+1,p.length-1))):"ArrowUp"===t.key?(t.preventDefault(),y(e=>Math.max(e-1,0))):"Escape"===t.key?(j(!1),y(0)):"Backspace"===t.key&&!f&&e.length>0&&S(e[e.length-1])},onFocus:()=>{p.length>0&&j(!0)},placeholder:0===e.length?c:"",className:"flex-1 min-w-[120px] border-none focus-visible:ring-0 focus-visible:ring-offset-0 h-8 px-0"})]}),b&&p.length>0&&(0,t.jsx)("div",{ref:N,className:"absolute z-50 w-full mt-1 bg-popover border rounded-md shadow-md max-h-48 overflow-y-auto",children:p.map((e,r)=>(0,t.jsx)("div",{className:`px-3 py-2 cursor-pointer hover:bg-accent ${r===v?"bg-accent":""}`,onClick:()=>C(e),onMouseEnter:()=>y(r),children:e},e))}),f&&!b&&(0,t.jsx)("div",{className:"text-xs text-muted-foreground mt-1",children:m?`${m} "${f}"`:`Press Enter to create "${f}"`})]})}])},590546,e=>{var t=e.i(843476),r=e.i(618566),s=e.i(519455),a=e.i(711241);e.s(["f",0,function({fallbackUrl:e,className:n}){let i=(0,r.useRouter)();return(0,t.jsx)(s.f,{variant:"ghost",size:"icon",onClick:()=>{i.push(e)},className:n,children:(0,t.jsx)(a.f,{className:"h-5 w-5"})})}])},257428,e=>{var t=e.i(843476),r=e.i(271645),s=e.i(820783),a=e.i(30030),n=e.i(981140),i=e.i(369340),l=e.i(635804),d=e.i(296626),c=e.i(248425),o=Object.defineProperty,m=(e,t)=>o(e,"name",{value:t,configurable:!0}),u="Checkbox",[x,f]=(0,a.f)(u),[h,p]=x(u);function g(e){let{__scopeCheckbox:s,checked:a,children:n,defaultChecked:l,disabled:d,form:c,name:o,onCheckedChange:m,required:x,value:f="on",internal_do_not_use_render:p}=e,[g,b]=(0,i.f)({prop:a,defaultProp:l??!1,onChange:m,caller:u}),[j,v]=r.useState(null),[y,w]=r.useState(null),[C,S]=r.useState(null),E=!j||!!c||!!j.closest("form"),R={checked:g,disabled:d,setChecked:b,control:j,setControl:v,name:o,form:c,value:f,userClick:C,onUserClick:S,required:x,defaultChecked:!N(l)&&l,isFormControl:E,bubbleInput:y,setBubbleInput:w};return(0,t.jsx)(h,{scope:s,...R,children:k(p)?p(R):n})}m(g,"CheckboxProvider");var b=r.forwardRef(m(function({__scopeCheckbox:e,onKeyDown:a,onClick:i,...l},d){let{control:o,value:u,disabled:x,checked:f,required:h,setControl:g,setChecked:b,onUserClick:j,isFormControl:v,bubbleInput:y}=p("CheckboxTrigger",e),k=(0,s.f)(d,g),C=r.useRef(f);return r.useEffect(()=>{let e=o?.form;if(e){let t=m(()=>b(C.current),"reset");return e.addEventListener("reset",t),()=>e.removeEventListener("reset",t)}},[o,b]),(0,t.jsx)(c.V.button,{type:"button",role:"checkbox","aria-checked":N(f)?"mixed":f,"aria-required":h,"data-state":w(f),"data-disabled":x?"":void 0,disabled:x,value:u,...l,ref:k,onKeyDown:(0,n.f)(a,e=>{"Enter"===e.key&&e.preventDefault()}),onClick:(0,n.f)(i,e=>{let t=e.isPropagationStopped();j({requestedChecked:!!N(f)||!f,hasConsumerStoppedPropagation:t}),b(e=>!!N(e)||!e),y&&v&&!t&&e.stopPropagation()})})},"CheckboxTrigger")),j=r.forwardRef(m(function(e,r){let{__scopeCheckbox:s,name:a,checked:n,defaultChecked:i,required:l,disabled:d,value:c,onCheckedChange:o,form:m,...u}=e;return(0,t.jsx)(g,{__scopeCheckbox:s,checked:n,defaultChecked:i,disabled:d,required:l,onCheckedChange:o,name:a,form:m,value:c,internal_do_not_use_render:({isFormControl:e})=>(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(b,{...u,ref:r,__scopeCheckbox:s}),e&&(0,t.jsx)(y,{__scopeCheckbox:s})]})})},"Checkbox")),v=r.forwardRef(m(function(e,r){let{__scopeCheckbox:s,forceMount:a,...n}=e,i=p("CheckboxIndicator",s);return(0,t.jsx)(d.f,{present:a||N(i.checked)||!0===i.checked,children:(0,t.jsx)(c.V.span,{"data-state":w(i.checked),"data-disabled":i.disabled?"":void 0,...n,ref:r,style:{pointerEvents:"none",...e.style}})})},"CheckboxIndicator")),y=r.forwardRef(m(function({__scopeCheckbox:e,onClick:a,...i},d){let{control:o,userClick:m,checked:u,defaultChecked:x,required:f,disabled:h,name:g,value:b,form:j,bubbleInput:v,setBubbleInput:y}=p("CheckboxBubbleInput",e),k=(0,s.f)(d,y),w=(0,l.f)(o),C=r.useRef(!1),S=r.useRef(u),E=r.useRef(m),R=r.useRef(null);r.useEffect(()=>{if(!v)return;let e=Object.getOwnPropertyDescriptor(window.HTMLInputElement.prototype,"checked").set;if(!e)return;let t=S.current!==u;S.current=u;let r=null!==m&&m!==E.current;if(E.current=m,r)R.current=t?null:m,t&&(v.indeterminate=N(u),e.call(v,!N(u)&&u)),v.dispatchEvent(new Event("click",{bubbles:!m.hasConsumerStoppedPropagation}));else if(t){let t=R.current;R.current=null;let r=t?.requestedChecked===u;C.current=!0,v.indeterminate=N(u),e.call(v,!N(u)&&u),v.dispatchEvent(new Event("click",{bubbles:!(r&&t.hasConsumerStoppedPropagation)})),C.current=!1}},[v,u,m]);let P=r.useRef(!N(u)&&u);return(0,t.jsx)(c.V.input,{type:"checkbox","aria-hidden":!0,defaultChecked:x??P.current,required:f,disabled:h,name:g,value:b,form:j,...i,tabIndex:-1,ref:k,onClick:(0,n.f)(a,e=>{C.current&&e.stopPropagation()}),style:{...i.style,...w,position:"absolute",pointerEvents:"none",opacity:0,margin:0,transform:"translateX(-100%)"}})},"CheckboxBubbleInput"));function k(e){return"function"==typeof e}function N(e){return"indeterminate"===e}function w(e){return N(e)?"indeterminate":e?"checked":"unchecked"}m(k,"isFunction"),m(N,"isIndeterminate"),m(w,"getState");var C=e.i(689664),S=e.i(975157);let E=r.forwardRef(({className:e,...r},s)=>(0,t.jsx)(j,{ref:s,className:(0,S.f)("peer h-4 w-4 shrink-0 rounded-sm border border-primary ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground",e),...r,children:(0,t.jsx)(v,{className:(0,S.f)("flex items-center justify-center text-current"),children:(0,t.jsx)(C.f,{className:"h-4 w-4"})})}));E.displayName=j.displayName,e.s(["f",0,E],257428)},912505,e=>{var t=e.i(843476),r=e.i(975157);e.s(["f",0,function({icon:e,title:s,description:a,action:n,className:i}){return(0,t.jsxs)("div",{className:(0,r.f)("flex flex-col items-center justify-center rounded-2xl border border-dashed bg-card/50 px-6 py-14 text-center",i),children:[(0,t.jsx)("div",{className:"mb-4 flex h-14 w-14 items-center justify-center rounded-2xl bg-accent text-accent-foreground",children:(0,t.jsx)(e,{className:"h-7 w-7"})}),(0,t.jsx)("p",{className:"font-medium",children:s}),a&&(0,t.jsx)("p",{className:"mt-1 max-w-sm text-sm text-muted-foreground",children:a}),n&&(0,t.jsx)("div",{className:"mt-5",children:n})]})}])},393842,e=>{var t=e.i(843476),r=e.i(590546),s=e.i(975157);e.s(["f",0,function({title:e,description:a,backHref:n,actions:i,titleAddon:l,className:d}){return(0,t.jsxs)("div",{className:(0,s.f)("flex items-start gap-3",d),children:[n&&(0,t.jsx)(r.f,{fallbackUrl:n,className:"-ml-2 shrink-0"}),(0,t.jsxs)("div",{className:"min-w-0 flex-1 space-y-1",children:[(0,t.jsxs)("div",{className:"flex items-center gap-1",children:[(0,t.jsx)("h1",{className:"truncate text-2xl font-bold tracking-tight sm:text-3xl",children:e}),l]}),a&&(0,t.jsx)("p",{className:"text-sm text-muted-foreground sm:text-base",children:a})]}),i&&(0,t.jsx)("div",{className:"flex shrink-0 items-center gap-2",children:i})]})}])},86963,e=>{var t=e.i(843476),r=e.i(632781);e.s(["f",0,function({label:e}){return(0,t.jsxs)("div",{className:"flex min-h-[50vh] flex-col items-center justify-center gap-3 text-muted-foreground",children:[(0,t.jsx)(r.f,{className:"h-7 w-7 animate-spin text-primary"}),e&&(0,t.jsx)("p",{className:"text-sm",children:e})]})}])},35209,e=>{var t=e.i(271645),r=e.i(111110);e.s(["f",0,function(...e){let{t:s}=(0,r.b)(),a=[s.pageTitle.base,...e.map(e=>"string"==typeof e?e.trim():"").filter(e=>e.length>0)].join("-");(0,t.useEffect)(()=>{document.title=a},[a])}])}])})();
1
+ (()=>{"use strict";(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,711241,e=>{var t=e.i(456420);let r={name:"arrow-left",size:24,node:[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]]};r.node;let s=(0,t.f)(r);e.s(["f",0,s],711241)},952801,e=>{var t=e.i(843476),r=e.i(271645),s=e.i(522016),a=e.i(215519),n=e.i(306831),i=e.i(226091),l=e.i(77071),d=e.i(519455),c=e.i(515288),o=e.i(912505),m=e.i(393842),u=e.i(86963),x=e.i(618566),f=e.i(632781),h=e.i(994533),p=e.i(257428),g=e.i(793479),b=e.i(110204),j=e.i(574041),v=e.i(111110);let y=["generate","original"];function k({value:e,onChange:r}){let{t:s}=(0,v.b)();return(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsx)(b.f,{children:s.exam.modeLabel}),(0,t.jsx)("div",{className:"grid grid-cols-2 gap-1 rounded-md bg-muted p-1 sm:max-w-sm",role:"group","aria-label":s.exam.modeLabel,children:y.map(a=>(0,t.jsx)("button",{type:"button","aria-pressed":e===a,onClick:()=>r(a),className:`rounded px-2 py-1.5 text-sm transition-colors ${e===a?"bg-background shadow-sm font-medium":"text-muted-foreground"}`,children:s.exam.modes[a]},a))}),"original"===e&&(0,t.jsx)("p",{className:"text-xs text-muted-foreground",children:s.exam.originalHint})]})}var N=e.i(41931),w=e.i(470279);let C=["unmastered","mastered","all"],S=["least_practiced","random"],E=["easy","medium","hard","harder"];function R(){let{t:e,language:s}=(0,v.b)(),a=(0,x.useRouter)(),[n,i]=(0,r.useState)([]),[l,o]=(0,r.useState)([]),[m,u]=(0,r.useState)([]),[y,R]=(0,r.useState)([]),[P,$]=(0,r.useState)("unmastered"),[I,L]=(0,r.useState)("least_practiced"),[M,T]=(0,r.useState)(10),[O,D]=(0,r.useState)("medium"),[F,_]=(0,r.useState)("generate"),[A,U]=(0,r.useState)(""),[q,H]=(0,r.useState)(!1),[B,z]=(0,r.useState)(null),{groups:K,loading:V}=(0,w.f)();(0,r.useEffect)(()=>{N.k.get("/api/notebooks").then(e=>{i(e),1===e.length&&o([e[0].id])}).catch(()=>i([]))},[]);let X=async t=>{if(t.preventDefault(),0===l.length)return void z(e.exam.noNotebook);H(!0),z(null);try{let e=await N.k.post("/api/exams",{subjectIds:l,tagNames:m,paperLevelIds:y.length>0?y:void 0,scope:P,pickRule:I,count:M,difficulty:"original"===F?void 0:O,mode:F,title:A.trim()||void 0,language:s});a.push(`/exams/${e.id}`)}catch(t){z("NO_SOURCE_ITEMS"===t?.data?.message?e.exam.noSource:e.common.messages?.saveFailed||"Failed"),H(!1)}},Y=e.practice.difficulty;return(0,t.jsxs)(c.N,{children:[(0,t.jsx)(c.Y,{children:(0,t.jsx)(c.v,{className:"text-lg",children:e.exam.createTitle})}),(0,t.jsx)(c.O,{children:(0,t.jsxs)("form",{onSubmit:X,className:"space-y-5",children:[(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsxs)("div",{className:"flex items-center justify-between",children:[(0,t.jsx)(b.f,{children:e.exam.notebooks}),n.length>1&&(0,t.jsx)("button",{type:"button",className:"text-xs text-primary hover:underline",onClick:()=>o(l.length===n.length?[]:n.map(e=>e.id)),children:e.exam.selectAll})]}),(0,t.jsx)("div",{className:"grid grid-cols-2 sm:grid-cols-3 gap-2",children:n.map(e=>(0,t.jsxs)("label",{className:"flex items-center gap-2 rounded-md border p-2 text-sm cursor-pointer hover:bg-muted/50",children:[(0,t.jsx)(p.f,{checked:l.includes(e.id),onCheckedChange:()=>{var t;return t=e.id,void o(e=>e.includes(t)?e.filter(e=>e!==t):[...e,t])}}),(0,t.jsx)("span",{className:"truncate",children:e.name}),(0,t.jsx)("span",{className:"ml-auto text-xs text-muted-foreground",children:e._count?.errorItems??""})]},e.id))})]}),(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsx)(b.f,{children:e.exam.tags}),(0,t.jsx)(j.f,{value:m,onChange:u,placeholder:e.exam.tagsPlaceholder})]}),!V&&K.filter(e=>e.isActive).length>0&&(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsx)(b.f,{children:e.filter.paperLevel}),(0,t.jsx)("div",{className:"flex flex-wrap gap-2",children:K.filter(e=>e.isActive).map(e=>(0,t.jsx)("button",{type:"button",onClick:()=>{var t;return t=e.id,void R(e=>e.includes(t)?e.filter(e=>e!==t):[...e,t])},className:`rounded-full border px-3 py-1.5 text-sm transition-colors ${y.includes(e.id)?"border-primary bg-primary text-primary-foreground":"border-input bg-background hover:bg-muted"}`,children:e.name},e.id))})]}),(0,t.jsx)(k,{value:F,onChange:_}),(0,t.jsxs)("div",{className:`grid gap-4 ${"generate"===F?"sm:grid-cols-3":"sm:grid-cols-2"}`,children:[(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsx)(b.f,{children:e.exam.scope}),(0,t.jsx)("div",{className:"grid grid-cols-3 gap-1 rounded-md bg-muted p-1",children:C.map(r=>(0,t.jsx)("button",{type:"button",onClick:()=>$(r),className:`rounded px-2 py-1.5 text-sm transition-colors ${P===r?"bg-background shadow-sm font-medium":"text-muted-foreground"}`,children:e.exam.scopes[r]},r))})]}),(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsx)(b.f,{htmlFor:"exam-count",children:e.exam.count}),(0,t.jsx)(g.f,{id:"exam-count",type:"number",min:1,max:50,value:M,onChange:e=>T(Math.min(50,Math.max(1,parseInt(e.target.value,10)||1)))})]}),"generate"===F&&(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsx)(b.f,{htmlFor:"exam-difficulty",children:e.exam.difficulty}),(0,t.jsx)("select",{id:"exam-difficulty",value:O,onChange:e=>D(e.target.value),className:"h-9 w-full rounded-md border bg-background px-3 text-sm",children:E.map(e=>(0,t.jsx)("option",{value:e,children:Y[e]},e))})]})]}),(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsx)(b.f,{children:e.exam.pickRule}),(0,t.jsx)("div",{className:"grid grid-cols-2 gap-1 rounded-md bg-muted p-1 sm:max-w-sm",children:S.map(r=>(0,t.jsx)("button",{type:"button",onClick:()=>L(r),className:`rounded px-2 py-1.5 text-sm transition-colors ${I===r?"bg-background shadow-sm font-medium":"text-muted-foreground"}`,children:e.exam.pickRules[r]},r))}),(0,t.jsx)("p",{className:"text-xs text-muted-foreground",children:e.exam.pickRuleHints[I]})]}),(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsx)(b.f,{htmlFor:"exam-title",children:e.exam.titleLabel}),(0,t.jsx)(g.f,{id:"exam-title",value:A,maxLength:100,onChange:e=>U(e.target.value)})]}),B&&(0,t.jsx)("p",{className:"text-sm text-destructive",children:B}),(0,t.jsxs)(d.f,{type:"submit",disabled:q,className:"w-full sm:w-auto",children:[q?(0,t.jsx)(f.f,{className:"mr-2 h-4 w-4 animate-spin"}):(0,t.jsx)(h.f,{className:"mr-2 h-4 w-4"}),q?e.exam.creating:"original"===F?e.exam.createOriginal:e.exam.generate]})]})})]})}var P=e.i(663661),$=e.i(487486),I=e.i(35209);e.s(["default",0,function(){let{timeZone:e}=(0,a.M)(),{t:x}=(0,v.b)();(0,I.f)(x.exam.title);let[f,h]=(0,r.useState)(null),[p,g]=(0,r.useState)(!1);(0,r.useEffect)(()=>{N.k.get("/api/exams").then(e=>{h(e),0===e.length&&g(!0)}).catch(()=>h([]))},[]);let b=x.practice.difficulty;return(0,t.jsx)("main",{className:"mx-auto min-h-screen max-w-6xl px-4 py-6 md:px-8 md:py-8",children:(0,t.jsxs)("div",{className:"space-y-6",children:[(0,t.jsx)(m.f,{title:x.exam.title,description:x.exam.subtitle,actions:!p&&(0,t.jsxs)(d.f,{onClick:()=>g(!0),"aria-label":x.exam.create,children:[(0,t.jsx)(l.f,{className:"h-4 w-4"}),(0,t.jsx)("span",{className:"hidden sm:inline",children:x.exam.create})]})}),p&&(0,t.jsx)(R,{}),(0,t.jsxs)("section",{className:"space-y-3",children:[(0,t.jsx)("h2",{className:"text-lg font-semibold",children:x.exam.list}),null===f?(0,t.jsx)(u.f,{}):0===f.length?(0,t.jsx)(o.f,{icon:i.f,title:x.exam.empty,className:"py-10"}):(0,t.jsx)("div",{className:"grid gap-3 md:grid-cols-2",children:f.map(r=>(0,t.jsx)(s.default,{href:`/exams/${r.id}`,children:(0,t.jsx)(c.N,{className:"h-full rounded-2xl transition-all hover:-translate-y-0.5 hover:border-primary/40 hover:shadow-md",children:(0,t.jsxs)(c.O,{className:"space-y-2 pt-4",children:[(0,t.jsxs)("div",{className:"flex items-start justify-between gap-2",children:[(0,t.jsxs)("span",{className:"flex items-center gap-2 font-medium",children:[(0,t.jsx)(i.f,{className:"h-4 w-4 shrink-0 text-primary"}),r.title]}),(0,t.jsx)(P.f,{status:r.status,recorded:r.recordedCount>0})]}),(0,t.jsxs)("div",{className:"flex flex-wrap gap-x-3 gap-y-1 text-xs text-muted-foreground",children:[(0,t.jsx)("span",{children:(0,n.r)(r.createdAt,"yyyy-MM-dd HH:mm",e)}),(0,t.jsx)("span",{children:x.exam.questionCount.replace("{count}",String(r.questionCount))}),(0,t.jsx)("span",{children:x.exam.scopes[r.scope]}),"original"===r.mode?(0,t.jsx)($.f,{variant:"secondary",children:x.exam.modes.original}):(0,t.jsx)("span",{children:b[r.difficulty]||r.difficulty}),(0,t.jsx)("span",{children:r.recordedCount>0?x.exam.recorded:x.exam.notRecorded})]})]})})},r.id))})]})]})})}],952801)},663661,e=>{var t=e.i(843476),r=e.i(487486),s=e.i(111110);let a={generating:"bg-blue-100 dark:bg-blue-900/40 text-blue-700 dark:text-blue-300 border-blue-200 dark:border-blue-900",ready:"bg-indigo-100 dark:bg-indigo-900/40 text-indigo-700 dark:text-indigo-300 border-indigo-200 dark:border-indigo-900",partial:"bg-amber-100 dark:bg-amber-900/40 text-amber-700 dark:text-amber-300 border-amber-200 dark:border-amber-900",failed:"bg-red-100 dark:bg-red-900/40 text-red-700 dark:text-red-300 border-red-200 dark:border-red-900",completed:"bg-green-100 dark:bg-green-900/40 text-green-700 dark:text-green-300 border-green-200 dark:border-green-900"};e.s(["f",0,function({status:e,recorded:n}){let{t:i}=(0,s.b)(),l=n&&("ready"===e||"partial"===e)?"completed":e;return(0,t.jsx)(r.f,{variant:"outline",className:a[l],children:i.exam.status[l]})}])},574041,e=>{var t=e.i(843476),r=e.i(271645),s=e.i(263676),a=e.i(487486),n=e.i(793479),i=e.i(41931),l=e.i(201276);e.s(["f",0,function({value:e=[],onChange:d,placeholder:c="Enter tags...",className:o="",enterHint:m,subject:u,gradeStage:x}){let[f,h]=(0,r.useState)(""),[p,g]=(0,r.useState)([]),[b,j]=(0,r.useState)(!1),[v,y]=(0,r.useState)(0),k=(0,r.useRef)(null),N=(0,r.useRef)(null),w=(0,r.useCallback)(async t=>{try{let r=new URLSearchParams({q:t});u&&r.append("subject",u),x&&r.append("stage",x);let s=((await i.k.get(`/api/tags/suggestions?${r.toString()}`)).suggestions||[]).filter(t=>!e.includes(t));g(s.slice(0,20)),j(s.length>0),y(0)}catch(e){l.V.error("[TagInput]","Failed to fetch suggestions",{error:e})}},[u,x,e]);(0,r.useEffect)(()=>{f.trim()&&w(f)},[f,w]);let C=t=>{t.trim()&&!e.includes(t.trim())&&(d([...e,t.trim()]),h(""),g([]),j(!1),y(0))},S=t=>{d(e.filter(e=>e!==t))};return(0,r.useEffect)(()=>{let e=e=>{!N.current||N.current.contains(e.target)||k.current?.contains(e.target)||j(!1)};return document.addEventListener("mousedown",e),()=>document.removeEventListener("mousedown",e)},[]),(0,t.jsxs)("div",{className:`relative ${o}`,children:[(0,t.jsxs)("div",{className:"flex flex-wrap gap-2 p-2 border rounded-lg bg-background min-h-[42px]",children:[e.map(e=>(0,t.jsxs)(a.f,{variant:"secondary",className:"flex items-center gap-1 px-2 py-1",children:[e,(0,t.jsx)("button",{type:"button",onClick:()=>S(e),className:"hover:text-destructive ml-1",children:(0,t.jsx)(s.X,{className:"h-3 w-3"})})]},e)),(0,t.jsx)(n.f,{ref:k,type:"text",value:f,onChange:e=>{h(e.target.value),e.target.value.trim()||(g([]),j(!1))},onKeyDown:t=>{"Enter"===t.key?(t.preventDefault(),v>=0&&p[v]?C(p[v]):f.trim()&&C(f)):"ArrowDown"===t.key?(t.preventDefault(),y(e=>Math.min(e+1,p.length-1))):"ArrowUp"===t.key?(t.preventDefault(),y(e=>Math.max(e-1,0))):"Escape"===t.key?(j(!1),y(0)):"Backspace"===t.key&&!f&&e.length>0&&S(e[e.length-1])},onFocus:()=>{p.length>0&&j(!0)},placeholder:0===e.length?c:"",className:"flex-1 min-w-[120px] border-none focus-visible:ring-0 focus-visible:ring-offset-0 h-8 px-0"})]}),b&&p.length>0&&(0,t.jsx)("div",{ref:N,className:"absolute z-50 w-full mt-1 bg-popover border rounded-md shadow-md max-h-48 overflow-y-auto",children:p.map((e,r)=>(0,t.jsx)("div",{className:`px-3 py-2 cursor-pointer hover:bg-accent ${r===v?"bg-accent":""}`,onClick:()=>C(e),onMouseEnter:()=>y(r),children:e},e))}),f&&!b&&(0,t.jsx)("div",{className:"text-xs text-muted-foreground mt-1",children:m?`${m} "${f}"`:`Press Enter to create "${f}"`})]})}])},590546,e=>{var t=e.i(843476),r=e.i(618566),s=e.i(519455),a=e.i(711241);e.s(["f",0,function({fallbackUrl:e,className:n}){let i=(0,r.useRouter)();return(0,t.jsx)(s.f,{variant:"ghost",size:"icon",onClick:()=>{i.push(e)},className:n,children:(0,t.jsx)(a.f,{className:"h-5 w-5"})})}])},257428,e=>{var t=e.i(843476),r=e.i(271645),s=e.i(820783),a=e.i(30030),n=e.i(981140),i=e.i(369340),l=e.i(635804),d=e.i(296626),c=e.i(248425),o=Object.defineProperty,m=(e,t)=>o(e,"name",{value:t,configurable:!0}),u="Checkbox",[x,f]=(0,a.f)(u),[h,p]=x(u);function g(e){let{__scopeCheckbox:s,checked:a,children:n,defaultChecked:l,disabled:d,form:c,name:o,onCheckedChange:m,required:x,value:f="on",internal_do_not_use_render:p}=e,[g,b]=(0,i.f)({prop:a,defaultProp:l??!1,onChange:m,caller:u}),[j,v]=r.useState(null),[y,w]=r.useState(null),[C,S]=r.useState(null),E=!j||!!c||!!j.closest("form"),R={checked:g,disabled:d,setChecked:b,control:j,setControl:v,name:o,form:c,value:f,userClick:C,onUserClick:S,required:x,defaultChecked:!N(l)&&l,isFormControl:E,bubbleInput:y,setBubbleInput:w};return(0,t.jsx)(h,{scope:s,...R,children:k(p)?p(R):n})}m(g,"CheckboxProvider");var b=r.forwardRef(m(function({__scopeCheckbox:e,onKeyDown:a,onClick:i,...l},d){let{control:o,value:u,disabled:x,checked:f,required:h,setControl:g,setChecked:b,onUserClick:j,isFormControl:v,bubbleInput:y}=p("CheckboxTrigger",e),k=(0,s.f)(d,g),C=r.useRef(f);return r.useEffect(()=>{let e=o?.form;if(e){let t=m(()=>b(C.current),"reset");return e.addEventListener("reset",t),()=>e.removeEventListener("reset",t)}},[o,b]),(0,t.jsx)(c.V.button,{type:"button",role:"checkbox","aria-checked":N(f)?"mixed":f,"aria-required":h,"data-state":w(f),"data-disabled":x?"":void 0,disabled:x,value:u,...l,ref:k,onKeyDown:(0,n.f)(a,e=>{"Enter"===e.key&&e.preventDefault()}),onClick:(0,n.f)(i,e=>{let t=e.isPropagationStopped();j({requestedChecked:!!N(f)||!f,hasConsumerStoppedPropagation:t}),b(e=>!!N(e)||!e),y&&v&&!t&&e.stopPropagation()})})},"CheckboxTrigger")),j=r.forwardRef(m(function(e,r){let{__scopeCheckbox:s,name:a,checked:n,defaultChecked:i,required:l,disabled:d,value:c,onCheckedChange:o,form:m,...u}=e;return(0,t.jsx)(g,{__scopeCheckbox:s,checked:n,defaultChecked:i,disabled:d,required:l,onCheckedChange:o,name:a,form:m,value:c,internal_do_not_use_render:({isFormControl:e})=>(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(b,{...u,ref:r,__scopeCheckbox:s}),e&&(0,t.jsx)(y,{__scopeCheckbox:s})]})})},"Checkbox")),v=r.forwardRef(m(function(e,r){let{__scopeCheckbox:s,forceMount:a,...n}=e,i=p("CheckboxIndicator",s);return(0,t.jsx)(d.f,{present:a||N(i.checked)||!0===i.checked,children:(0,t.jsx)(c.V.span,{"data-state":w(i.checked),"data-disabled":i.disabled?"":void 0,...n,ref:r,style:{pointerEvents:"none",...e.style}})})},"CheckboxIndicator")),y=r.forwardRef(m(function({__scopeCheckbox:e,onClick:a,...i},d){let{control:o,userClick:m,checked:u,defaultChecked:x,required:f,disabled:h,name:g,value:b,form:j,bubbleInput:v,setBubbleInput:y}=p("CheckboxBubbleInput",e),k=(0,s.f)(d,y),w=(0,l.f)(o),C=r.useRef(!1),S=r.useRef(u),E=r.useRef(m),R=r.useRef(null);r.useEffect(()=>{if(!v)return;let e=Object.getOwnPropertyDescriptor(window.HTMLInputElement.prototype,"checked").set;if(!e)return;let t=S.current!==u;S.current=u;let r=null!==m&&m!==E.current;if(E.current=m,r)R.current=t?null:m,t&&(v.indeterminate=N(u),e.call(v,!N(u)&&u)),v.dispatchEvent(new Event("click",{bubbles:!m.hasConsumerStoppedPropagation}));else if(t){let t=R.current;R.current=null;let r=t?.requestedChecked===u;C.current=!0,v.indeterminate=N(u),e.call(v,!N(u)&&u),v.dispatchEvent(new Event("click",{bubbles:!(r&&t.hasConsumerStoppedPropagation)})),C.current=!1}},[v,u,m]);let P=r.useRef(!N(u)&&u);return(0,t.jsx)(c.V.input,{type:"checkbox","aria-hidden":!0,defaultChecked:x??P.current,required:f,disabled:h,name:g,value:b,form:j,...i,tabIndex:-1,ref:k,onClick:(0,n.f)(a,e=>{C.current&&e.stopPropagation()}),style:{...i.style,...w,position:"absolute",pointerEvents:"none",opacity:0,margin:0,transform:"translateX(-100%)"}})},"CheckboxBubbleInput"));function k(e){return"function"==typeof e}function N(e){return"indeterminate"===e}function w(e){return N(e)?"indeterminate":e?"checked":"unchecked"}m(k,"isFunction"),m(N,"isIndeterminate"),m(w,"getState");var C=e.i(689664),S=e.i(975157);let E=r.forwardRef(({className:e,...r},s)=>(0,t.jsx)(j,{ref:s,className:(0,S.f)("peer h-4 w-4 shrink-0 rounded-sm border border-primary ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground",e),...r,children:(0,t.jsx)(v,{className:(0,S.f)("flex items-center justify-center text-current"),children:(0,t.jsx)(C.f,{className:"h-4 w-4"})})}));E.displayName=j.displayName,e.s(["f",0,E],257428)},912505,e=>{var t=e.i(843476),r=e.i(975157);e.s(["f",0,function({icon:e,title:s,description:a,action:n,className:i}){return(0,t.jsxs)("div",{className:(0,r.f)("flex flex-col items-center justify-center rounded-2xl border border-dashed bg-card/50 px-6 py-14 text-center",i),children:[(0,t.jsx)("div",{className:"mb-4 flex h-14 w-14 items-center justify-center rounded-2xl bg-accent text-accent-foreground",children:(0,t.jsx)(e,{className:"h-7 w-7"})}),(0,t.jsx)("p",{className:"font-medium",children:s}),a&&(0,t.jsx)("p",{className:"mt-1 max-w-sm text-sm text-muted-foreground",children:a}),n&&(0,t.jsx)("div",{className:"mt-5",children:n})]})}])},393842,e=>{var t=e.i(843476),r=e.i(590546),s=e.i(975157);e.s(["f",0,function({title:e,description:a,backHref:n,actions:i,titleAddon:l,className:d}){return(0,t.jsxs)("div",{className:(0,s.f)("flex items-start gap-3",d),children:[n&&(0,t.jsx)(r.f,{fallbackUrl:n,className:"-ml-2 shrink-0"}),(0,t.jsxs)("div",{className:"min-w-0 flex-1 space-y-1",children:[(0,t.jsxs)("div",{className:"flex items-center gap-1",children:[(0,t.jsx)("h1",{className:"truncate text-2xl font-bold tracking-tight sm:text-3xl",children:e}),l]}),a&&(0,t.jsx)("p",{className:"text-sm text-muted-foreground sm:text-base",children:a})]}),i&&(0,t.jsx)("div",{className:"flex shrink-0 items-center gap-2",children:i})]})}])},86963,e=>{var t=e.i(843476),r=e.i(632781);e.s(["f",0,function({label:e}){return(0,t.jsxs)("div",{className:"flex min-h-[50vh] flex-col items-center justify-center gap-3 text-muted-foreground",children:[(0,t.jsx)(r.f,{className:"h-7 w-7 animate-spin text-primary"}),e&&(0,t.jsx)("p",{className:"text-sm",children:e})]})}])},35209,e=>{var t=e.i(271645),r=e.i(111110);e.s(["f",0,function(...e){let{t:s}=(0,r.b)(),a=[s.pageTitle.base,...e.map(e=>"string"==typeof e?e.trim():"").filter(e=>e.length>0)].join("-");(0,t.useEffect)(()=>{document.title=a},[a])}])}])})();
@@ -1 +1 @@
1
- (()=>{"use strict";(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,711241,e=>{var t=e.i(456420);let n={name:"arrow-left",size:24,node:[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]]};n.node;let a=(0,t.f)(n);e.s(["f",0,a],711241)},399847,e=>{var t=e.i(456420);let n={name:"circle-alert",size:24,node:[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["line",{x1:"12",x2:"12",y1:"8",y2:"12",key:"1pkeuh"}],["line",{x1:"12",x2:"12.01",y1:"16",y2:"16",key:"4dfq90"}]],aliases:["alert-circle"]};n.node;let a=(0,t.f)(n);e.s(["f",0,a],399847)},474544,e=>{var t=e.i(456420);let n={name:"clock",size:24,node:[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 6v6l4 2",key:"mmk7yg"}]]};n.node;let a=(0,t.f)(n);e.s(["f",0,a],474544)},444594,e=>{var t=e.i(456420);let n={name:"inbox",size:24,node:[["polyline",{points:"22 12 16 12 14 15 10 15 8 12 2 12",key:"o97t9d"}],["path",{d:"M5.45 5.11 2 12v6a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2v-6l-3.45-6.89A2 2 0 0 0 16.76 4H7.24a2 2 0 0 0-1.79 1.11z",key:"oot6mr"}]]};n.node;let a=(0,t.f)(n);e.s(["f",0,a],444594)},786563,e=>{var t=e.i(456420);let n={name:"star",size:24,node:[["path",{d:"M11.525 2.295a.53.53 0 0 1 .95 0l2.31 4.679a2.123 2.123 0 0 0 1.595 1.16l5.166.756a.53.53 0 0 1 .294.904l-3.736 3.638a2.123 2.123 0 0 0-.611 1.878l.882 5.14a.53.53 0 0 1-.771.56l-4.618-2.428a2.122 2.122 0 0 0-1.973 0L6.396 21.01a.53.53 0 0 1-.77-.56l.881-5.139a2.122 2.122 0 0 0-.611-1.879L2.16 9.795a.53.53 0 0 1 .294-.906l5.165-.755a2.122 2.122 0 0 0 1.597-1.16z",key:"r04s7s"}]]};n.node;let a=(0,t.f)(n);e.s(["f",0,a],786563)},697886,e=>{var t=e.i(456420);let n={name:"target",size:24,node:[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["circle",{cx:"12",cy:"12",r:"6",key:"1vlfrh"}],["circle",{cx:"12",cy:"12",r:"2",key:"1c9p78"}]]};n.node;let a=(0,t.f)(n);e.s(["f",0,a],697886)},7219,e=>{var t=e.i(456420);let n={name:"trending-up",size:24,node:[["path",{d:"M16 7h6v6",key:"box55l"}],["path",{d:"m22 7-8.5 8.5-5-5L2 17",key:"1t1m79"}]]};n.node;let a=(0,t.f)(n);e.s(["f",0,a],7219)},282492,e=>{var t=e.i(722219);e.s(["z",0,t])},590546,e=>{var t=e.i(843476),n=e.i(618566),a=e.i(519455),l=e.i(711241);e.s(["f",0,function({fallbackUrl:e,className:i}){let s=(0,n.useRouter)();return(0,t.jsx)(a.f,{variant:"ghost",size:"icon",onClick:()=>{s.push(e)},className:i,children:(0,t.jsx)(l.f,{className:"h-5 w-5"})})}])},393842,e=>{var t=e.i(843476),n=e.i(590546),a=e.i(975157);e.s(["f",0,function({title:e,description:l,backHref:i,actions:s,titleAddon:r,className:c}){return(0,t.jsxs)("div",{className:(0,a.f)("flex items-start gap-3",c),children:[i&&(0,t.jsx)(n.f,{fallbackUrl:i,className:"-ml-2 shrink-0"}),(0,t.jsxs)("div",{className:"min-w-0 flex-1 space-y-1",children:[(0,t.jsxs)("div",{className:"flex items-center gap-1",children:[(0,t.jsx)("h1",{className:"truncate text-2xl font-bold tracking-tight sm:text-3xl",children:e}),r]}),l&&(0,t.jsx)("p",{className:"text-sm text-muted-foreground sm:text-base",children:l})]}),s&&(0,t.jsx)("div",{className:"flex shrink-0 items-center gap-2",children:s})]})}])},62825,e=>{function t(e){return"not_attempted"===e||"wrong_attempt"===e||"unknown"===e?e:"unknown"}e.s(["i",0,function(e,n="zh"){return("en"===n?{not_attempted:"Not attempted",wrong_attempt:"Wrong attempt",unknown:"Unknown"}:{not_attempted:"不会做",wrong_attempt:"做错了",unknown:"未判断"})[t(e)]},"h",0,t,"x",0,function(e,n){return(n||"").trim()?"wrong_attempt":t(e)}])},35209,e=>{var t=e.i(271645),n=e.i(111110);e.s(["f",0,function(...e){let{t:a}=(0,n.b)(),l=[a.pageTitle.base,...e.map(e=>"string"==typeof e?e.trim():"").filter(e=>e.length>0)].join("-");(0,t.useEffect)(()=>{document.title=l},[l])}])}])})();
1
+ (()=>{"use strict";(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,711241,e=>{var t=e.i(456420);let n={name:"arrow-left",size:24,node:[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]]};n.node;let a=(0,t.f)(n);e.s(["f",0,a],711241)},399847,e=>{var t=e.i(456420);let n={name:"circle-alert",size:24,node:[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["line",{x1:"12",x2:"12",y1:"8",y2:"12",key:"1pkeuh"}],["line",{x1:"12",x2:"12.01",y1:"16",y2:"16",key:"4dfq90"}]],aliases:["alert-circle"]};n.node;let a=(0,t.f)(n);e.s(["f",0,a],399847)},474544,e=>{var t=e.i(456420);let n={name:"clock",size:24,node:[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 6v6l4 2",key:"mmk7yg"}]]};n.node;let a=(0,t.f)(n);e.s(["f",0,a],474544)},444594,e=>{var t=e.i(456420);let n={name:"inbox",size:24,node:[["polyline",{points:"22 12 16 12 14 15 10 15 8 12 2 12",key:"o97t9d"}],["path",{d:"M5.45 5.11 2 12v6a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2v-6l-3.45-6.89A2 2 0 0 0 16.76 4H7.24a2 2 0 0 0-1.79 1.11z",key:"oot6mr"}]]};n.node;let a=(0,t.f)(n);e.s(["f",0,a],444594)},786563,e=>{var t=e.i(456420);let n={name:"star",size:24,node:[["path",{d:"M11.525 2.295a.53.53 0 0 1 .95 0l2.31 4.679a2.123 2.123 0 0 0 1.595 1.16l5.166.756a.53.53 0 0 1 .294.904l-3.736 3.638a2.123 2.123 0 0 0-.611 1.878l.882 5.14a.53.53 0 0 1-.771.56l-4.618-2.428a2.122 2.122 0 0 0-1.973 0L6.396 21.01a.53.53 0 0 1-.77-.56l.881-5.139a2.122 2.122 0 0 0-.611-1.879L2.16 9.795a.53.53 0 0 1 .294-.906l5.165-.755a2.122 2.122 0 0 0 1.597-1.16z",key:"r04s7s"}]]};n.node;let a=(0,t.f)(n);e.s(["f",0,a],786563)},697886,e=>{var t=e.i(456420);let n={name:"target",size:24,node:[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["circle",{cx:"12",cy:"12",r:"6",key:"1vlfrh"}],["circle",{cx:"12",cy:"12",r:"2",key:"1c9p78"}]]};n.node;let a=(0,t.f)(n);e.s(["f",0,a],697886)},7219,e=>{var t=e.i(456420);let n={name:"trending-up",size:24,node:[["path",{d:"M16 7h6v6",key:"box55l"}],["path",{d:"m22 7-8.5 8.5-5-5L2 17",key:"1t1m79"}]]};n.node;let a=(0,t.f)(n);e.s(["f",0,a],7219)},282492,e=>{var t=e.i(722219);e.s(["z",0,t])},590546,e=>{var t=e.i(843476),n=e.i(618566),a=e.i(519455),l=e.i(711241);e.s(["f",0,function({fallbackUrl:e,className:i}){let s=(0,n.useRouter)();return(0,t.jsx)(a.f,{variant:"ghost",size:"icon",onClick:()=>{s.push(e)},className:i,children:(0,t.jsx)(l.f,{className:"h-5 w-5"})})}])},393842,e=>{var t=e.i(843476),n=e.i(590546),a=e.i(975157);e.s(["f",0,function({title:e,description:l,backHref:i,actions:s,titleAddon:r,className:c}){return(0,t.jsxs)("div",{className:(0,a.f)("flex items-start gap-3",c),children:[i&&(0,t.jsx)(n.f,{fallbackUrl:i,className:"-ml-2 shrink-0"}),(0,t.jsxs)("div",{className:"min-w-0 flex-1 space-y-1",children:[(0,t.jsxs)("div",{className:"flex items-center gap-1",children:[(0,t.jsx)("h1",{className:"truncate text-2xl font-bold tracking-tight sm:text-3xl",children:e}),r]}),l&&(0,t.jsx)("p",{className:"text-sm text-muted-foreground sm:text-base",children:l})]}),s&&(0,t.jsx)("div",{className:"flex shrink-0 items-center gap-2",children:s})]})}])},35209,e=>{var t=e.i(271645),n=e.i(111110);e.s(["f",0,function(...e){let{t:a}=(0,n.b)(),l=[a.pageTitle.base,...e.map(e=>"string"==typeof e?e.trim():"").filter(e=>e.length>0)].join("-");(0,t.useEffect)(()=>{document.title=l},[l])}])},991722,e=>{function t(e){return"not_attempted"===e||"wrong_attempt"===e||"unknown"===e?e:"unknown"}e.s(["i",0,function(e,n="zh"){return("en"===n?{not_attempted:"Not attempted",wrong_attempt:"Wrong attempt",unknown:"Unknown"}:{not_attempted:"不会做",wrong_attempt:"做错了",unknown:"未判断"})[t(e)]},"h",0,t,"x",0,function(e,n){return(n||"").trim()?"wrong_attempt":t(e)}])}])})();
@@ -0,0 +1 @@
1
+ (globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,204573,e=>{"use strict";var t=e.i(843476),a=e.i(271645),s=e.i(522016),n=e.i(618566),r=e.i(711241),i=e.i(456420);let l={name:"file-question-mark",size:24,node:[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M12 17h.01",key:"p32p05"}],["path",{d:"M9.1 9a3 3 0 0 1 5.82 1c0 2-3 3-3 3",key:"mhlwft"}]],aliases:["file-question"]};l.node;let o=(0,i.f)(l);var c=e.i(741120),d=e.i(759659),u=e.i(469937),m=e.i(314381),g=e.i(632781),h=e.i(3198),f=e.i(519455),x=e.i(111110),p=e.i(41931),v=e.i(303163),j=e.i(201276);function b({errorItemId:e,commands:s,onUpdate:n}){let{t:r}=(0,x.b)(),[i,l]=(0,a.useState)(!1),[o,c]=(0,a.useState)(null),d=async()=>{l(!0),c(null);try{let t=await p.k.post(`/api/error-items/${e}/geogebra`,{},{recoverable:!0});t.suitable&&t.commands.length>0?n({geogebraCommands:JSON.stringify(t.commands)}):c(t.description||r.geogebra.notSuitable)}catch(t){j.V.error("[ErrorDetail]","GeoGebra analysis failed",{error:t});let e=(0,v.d)(t)||(0,v.Z)(t);e.includes("AI_AUTH_ERROR")?c(r.geogebra.authFailed):e.includes("AI_CONNECTION")?c(r.geogebra.connectionFailed):c(r.geogebra.analyzeFailed)}finally{l(!1)}},u=async t=>{await p.k.put(`/api/error-items/${e}`,{geogebraCommands:t}),n({geogebraCommands:t})},y=async()=>{await p.k.delete(`/api/error-items/${e}/geogebra`),n({geogebraCommands:null})};return s?(0,t.jsx)(h.f,{commands:s,height:700,showToolBar:!0,showAlgebraInput:!1,showMenuBar:!1,onRegenerate:d,onSaveCommands:u,onDelete:y}):(0,t.jsxs)("div",{className:"rounded-lg border border-dashed p-4",children:[(0,t.jsxs)("div",{className:"flex items-center justify-between",children:[(0,t.jsxs)("div",{className:"flex items-center gap-2 text-sm text-muted-foreground",children:[(0,t.jsx)(m.f,{className:"h-4 w-4"}),(0,t.jsx)("span",{children:r.geogebra.title})]}),(0,t.jsx)(f.f,{variant:"outline",size:"sm",onClick:d,disabled:i,children:i?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(g.f,{className:"mr-2 h-4 w-4 animate-spin"}),r.geogebra.analyzing]}):(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(m.f,{className:"mr-2 h-4 w-4"}),r.geogebra.generate]})})]}),o&&(0,t.jsx)("p",{className:"text-xs text-muted-foreground mt-2",children:o}),(0,t.jsx)("p",{className:"text-xs text-muted-foreground mt-2",children:r.geogebra.hint})]})}function y({src:e,onClose:a}){let{t:s}=(0,x.b)();return e?(0,t.jsx)("div",{className:"fixed inset-0 z-50 bg-black/90 flex items-center justify-center p-4",onClick:a,children:(0,t.jsxs)("div",{className:"relative max-w-7xl max-h-full",children:[(0,t.jsx)("button",{className:"absolute -top-12 right-0 text-white hover:text-gray-300 text-lg font-semibold bg-black/50 px-4 py-2 rounded",onClick:a,children:s.detail?.close||"✕ Close"}),(0,t.jsx)("img",{src:e,alt:"Full size",className:"max-w-full max-h-[90vh] object-contain rounded-lg",onClick:e=>e.stopPropagation()}),(0,t.jsx)("p",{className:"text-center text-white/70 text-sm mt-4",children:s.detail?.clickOutside||"Click outside to close"})]})}):null}var w=e.i(141176),N=e.i(511445),k=e.i(515288);let S={name:"square-pen",size:24,node:[["path",{d:"M12 3H5a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-7",key:"1m0v6g"}],["path",{d:"M18.375 2.625a1 1 0 0 1 3 3l-9.013 9.014a2 2 0 0 1-.853.505l-2.873.84a.5.5 0 0 1-.62-.62l.84-2.873a2 2 0 0 1 .506-.852z",key:"ohrbg2"}]],aliases:["pen-box","edit","pen-square"]};S.node;let A=(0,i.f)(S);var C=e.i(856522),I=e.i(263676);function E({onClick:e,label:a}){let{t:s}=(0,x.b)();return(0,t.jsxs)(f.f,{variant:"ghost",size:"sm",onClick:e,children:[(0,t.jsx)(A,{className:"h-4 w-4 mr-1"}),a||s.common?.edit||"Edit"]})}function T({onSave:e,onCancel:a,children:s}){let{t:n}=(0,x.b)();return(0,t.jsxs)("div",{className:"flex flex-wrap gap-2",children:[(0,t.jsxs)(f.f,{size:"sm",onClick:e,children:[(0,t.jsx)(C.f,{className:"h-4 w-4 mr-1"}),n.common?.save||"Save"]}),(0,t.jsxs)(f.f,{size:"sm",variant:"outline",onClick:a,children:[(0,t.jsx)(I.X,{className:"h-4 w-4 mr-1"}),n.common?.cancel||"Cancel"]}),s]})}function F({title:e,actions:a}){return(0,t.jsxs)("div",{className:"flex justify-between items-center",children:[e,a]})}var M=e.i(294114);function L({read:e,save:t,logLabel:s,successMessage:n,failureMessage:r}){let{t:i}=(0,x.b)(),[l,o]=(0,a.useState)(!1),[c,d]=(0,a.useState)(e),u=async()=>{try{await t(c),o(!1),M.c.success(n||i.common?.messages?.saveSuccess||"Saved successfully")}catch(e){j.V.error("[ErrorDetail]",`Failed to save ${s}`,{error:e}),M.c.error(r||i.common?.messages?.saveFailed||"Save failed")}};return{editing:l,value:c,setValue:d,start:()=>{d(e()),o(!0)},cancel:()=>o(!1),submit:u}}function z({title:e,value:a,onSave:s,logLabel:n,rows:r,placeholder:i,editorLabel:l,emptyText:o,cardClassName:c,titleClassName:d,contentClassName:u,headerActions:m,children:g}){let h=L({read:()=>a||"",save:s,logLabel:n}),f=(0,t.jsx)(w.f,{value:h.value,onChange:h.setValue,placeholder:i,rows:r,className:"w-full font-mono text-sm"});return(0,t.jsxs)(k.N,{className:c,children:[(0,t.jsx)(k.Y,{children:(0,t.jsx)(F,{title:(0,t.jsx)(k.v,{className:d,children:e}),actions:!h.editing&&(0,t.jsxs)("div",{className:"flex flex-wrap justify-end",children:[m,(0,t.jsx)(E,{onClick:h.start})]})})}),(0,t.jsxs)(k.O,{className:"space-y-4",children:[h.editing?(0,t.jsxs)("div",{className:"space-y-3",children:[l?(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsx)("label",{className:"text-sm text-muted-foreground",children:l}),f]}):f,(0,t.jsx)(T,{onSave:h.submit,onCancel:h.cancel})]}):!a&&o?(0,t.jsx)("p",{className:"text-sm text-muted-foreground italic",children:o}):(0,t.jsx)(N.f,{content:a,className:u}),g]})]})}var $=e.i(624687);function R({item:e,onUpdate:a}){let{t:s}=(0,x.b)(),n=L({read:()=>e.userNotes||"",save:async t=>{await p.k.patch(`/api/error-items/${e.id}/notes`,{userNotes:t}),a({userNotes:t})},logLabel:"notes",successMessage:s.common?.messages?.noteSaveSuccess||"Notes saved successfully"});return(0,t.jsxs)(k.N,{children:[(0,t.jsx)(k.Y,{children:(0,t.jsx)(F,{title:(0,t.jsx)(k.v,{children:s.detail.yourNotes}),actions:!n.editing&&(0,t.jsx)(E,{onClick:n.start,label:s.detail.editNotes})})}),(0,t.jsx)(k.O,{children:n.editing?(0,t.jsxs)("div",{className:"space-y-3",children:[(0,t.jsx)($.f,{value:n.value,onChange:e=>n.setValue(e.target.value),placeholder:s.detail.notesPlaceholder||"Enter your notes...",rows:5,className:"w-full"}),(0,t.jsx)(T,{onSave:n.submit,onCancel:n.cancel})]}):(0,t.jsx)("div",{className:"whitespace-pre-wrap",children:e.userNotes?(0,t.jsx)("p",{className:"text-foreground",children:e.userNotes}):(0,t.jsx)("p",{className:"text-muted-foreground italic",children:s.detail.noNotes})})})]})}let V={name:"shapes",size:24,node:[["path",{d:"M8.3 10a.7.7 0 0 1-.626-1.079L11.4 3a.7.7 0 0 1 1.198-.043L16.3 8.9a.7.7 0 0 1-.572 1.1Z",key:"1bo67w"}],["rect",{x:"3",y:"14",width:"7",height:"7",rx:"1",key:"1bkyp8"}],["circle",{cx:"17.5",cy:"17.5",r:"3.5",key:"w3z12y"}]]};V.node;let O=(0,i.f)(V);function D({errorItemId:e,onDone:s}){let{t:n}=(0,x.b)(),[r,i]=(0,a.useState)(!1),l=async()=>{i(!0);try{let t=await p.k.post(`/api/error-items/${e}/figure`,{},{recoverable:!0});s(t),t.figureSvg||M.c.warning(n.figure.noFigure)}catch(a){let e=a?.data?.message||"",t=n.errors[e];j.V.error("[RegenerateFigure]","Failed to regenerate figure",{code:e}),M.c.error("NO_ORIGINAL_IMAGE"===e?n.figure.noImage:"string"==typeof t?t:n.figure.failed)}finally{i(!1)}};return(0,t.jsxs)(f.f,{variant:"outline",size:"sm",onClick:l,disabled:r,className:"flex items-center gap-2",children:[r?(0,t.jsx)(g.f,{className:"h-4 w-4 animate-spin"}):(0,t.jsx)(O,{className:"h-4 w-4"}),r?n.figure.regenerating:n.figure.regenerate]})}let U={name:"image-plus",size:24,node:[["path",{d:"M16 5h6",key:"1vod17"}],["path",{d:"M19 2v6",key:"4bpg5p"}],["path",{d:"M21 11.5V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h7.5",key:"1ue2ih"}],["path",{d:"m21 15-3.086-3.086a2 2 0 0 0-2.828 0L6 21",key:"1xmnt7"}],["circle",{cx:"9",cy:"9",r:"2",key:"af1f0g"}]]};U.node;let q=(0,i.f)(U);var _=e.i(12130),H=e.i(213761);function P({errorItemId:e,hasImage:s,onDone:n}){let{t:r}=(0,x.b)(),i=(0,a.useRef)(null),[l,o]=(0,a.useState)(!1),[c,d]=(0,a.useState)(null);(0,a.useEffect)(()=>()=>c?.dispose(),[c]);let u=async()=>{(!s||await (0,M.u)(r.replaceImage.confirm))&&i.current?.click()},m=async e=>{if(e){o(!0);try{d(await (0,H.p)(e))}catch(e){M.c.error(e instanceof H.o?r.upload.decodeErrors[e.code].replace("{format}",e.format.toUpperCase()):r.replaceImage.invalid)}finally{o(!1)}}},h=async t=>{if(c&&0!==t.length){o(!0);try{let{dataUrl:a}=await (0,H.X)(c,t[0]);d(null);let s=await p.k.put(`/api/error-items/${e}/image`,{imageDataUrl:a});n(s.originalImageUrl),M.c.success(r.replaceImage.done)}catch(t){let e=t?.data?.message||"";j.V.error("[ReplaceImage]","Failed to replace original image",{code:e}),M.c.error("INVALID_IMAGE"===e?r.replaceImage.invalid:r.replaceImage.failed)}finally{o(!1)}}};return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("input",{ref:i,type:"file",accept:"image/*,.heic,.heif",className:"hidden",onChange:e=>{m(e.target.files?.[0]),e.target.value=""}}),c&&(0,t.jsx)(_.f,{imageSrc:c.previewUrl,open:!l,onClose:()=>d(null),allowMulti:!1,onRegionsSelected:e=>void h(e)}),(0,t.jsxs)(f.f,{variant:"outline",size:"sm",onClick:u,disabled:l,className:"flex items-center gap-2",children:[l?(0,t.jsx)(g.f,{className:"h-4 w-4 animate-spin"}):(0,t.jsx)(q,{className:"h-4 w-4"}),l?r.replaceImage.uploading:s?r.replaceImage.replace:r.replaceImage.add]})]})}var G=e.i(520732),B=e.i(438465),X=e.i(28342),W=e.i(674166),Z=e.i(470279);function K({item:e,onChanged:a}){let{t:s}=(0,x.b)(),n=s.common?.notSet||"Not set",{groups:r}=(0,Z.f)(),i=L({read:()=>({subjectId:e.subjectId||null,gradeSemester:e.gradeSemester||"",paperLevel:e.paperLevel||""}),save:async t=>{let{subjectId:s,paperLevel:n,...r}=t;await p.k.put(`/api/error-items/${e.id}`,{...r,...n!==(e.paperLevel||"")?{paperLevel:n||null}:{},...s!==(e.subjectId||null)?{subjectId:s}:{}}),await a()},logLabel:"metadata",successMessage:s.common?.messages?.metaUpdateSuccess||"Metadata updated successfully!",failureMessage:s.common?.messages?.updateFailed||"Update failed"}),l=e=>i.setValue({...i.value,...e});return(0,t.jsxs)("div",{className:"space-y-2 pt-4 border-t",children:[(0,t.jsx)(F,{title:(0,t.jsx)("h4",{className:"text-sm font-semibold",children:s.detail?.questionInfo||"Question Info"}),actions:!i.editing&&(0,t.jsx)(E,{onClick:i.start})}),i.editing?(0,t.jsxs)("div",{className:"space-y-3",children:[(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsx)("label",{className:"text-sm text-muted-foreground",children:s.notebooks?.title||"Notebook"}),(0,t.jsx)(B.f,{value:i.value.subjectId||void 0,onChange:e=>l({subjectId:e})})]}),(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsx)("label",{htmlFor:"detail-grade-semester",className:"text-sm text-muted-foreground",children:s.editor.gradeSemester}),(0,t.jsx)(X.f,{id:"detail-grade-semester",value:i.value.gradeSemester,onChange:e=>l({gradeSemester:e})})]}),(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsx)("label",{className:"text-sm text-muted-foreground",children:s.filter.paperLevel}),(0,t.jsx)(W.f,{value:i.value.paperLevel,onChange:e=>l({paperLevel:e})})]}),(0,t.jsx)(T,{onSave:i.submit,onCancel:i.cancel})]}):(0,t.jsxs)("div",{className:"space-y-2 text-sm",children:[(0,t.jsxs)("div",{className:"flex justify-between",children:[(0,t.jsxs)("span",{className:"text-muted-foreground",children:[s.notebooks?.title||"Notebook",":"]}),(0,t.jsx)("span",{className:"font-medium",children:e.subject?.name||n})]}),(0,t.jsxs)("div",{className:"flex justify-between",children:[(0,t.jsxs)("span",{className:"text-muted-foreground",children:[s.editor.gradeSemester,":"]}),(0,t.jsx)("span",{className:"font-medium",children:e.gradeSemester||n})]}),(0,t.jsxs)("div",{className:"flex justify-between",children:[(0,t.jsxs)("span",{className:"text-muted-foreground",children:[s.filter.paperLevel,":"]}),(0,t.jsx)("span",{className:"font-medium",children:(e=>{if(!e)return n;let t=r.find(t=>t.id===e);return t?.name||e})(e.paperLevel)})]})]})]})}var Q=e.i(487486),Y=e.i(328623);function J({errorItemId:e,onDone:s,onSuggested:n}){let{t:r}=(0,x.b)(),[i,l]=(0,a.useState)(!1),o=async()=>{l(!0);try{if(n){let t=await p.k.post(`/api/error-items/${e}/retag`,{preview:!0},{recoverable:!0});n(t.tags)}else await p.k.post(`/api/error-items/${e}/retag`,{},{recoverable:!0}),s?.()}catch(a){let e=a?.data?.message||"",t=r.errors[e];j.V.error("[RetagItem]","Failed to regenerate tags",{code:e}),M.c.error("NO_TAGS_SELECTED"===e?r.retag.noTags:"string"==typeof t?t:r.retag.itemFailed)}finally{l(!1)}};return(0,t.jsxs)(f.f,{variant:"ghost",size:"sm",onClick:o,disabled:i,children:[i?(0,t.jsx)(g.f,{className:"h-4 w-4 mr-1 animate-spin"}):(0,t.jsx)(Y.f,{className:"h-4 w-4 mr-1"}),n?i?r.retag.suggestRunning:r.retag.suggestButton:i?r.retag.itemRunning:r.retag.itemButton]})}var ee=e.i(574041),et=e.i(597138),ea=e.i(428602);function es({item:e,educationStage:a,onChanged:s}){let{t:n}=(0,x.b)(),r=(0,ea.f)(e),i=L({read:()=>(0,ea.f)(e),save:async t=>{await p.k.put(`/api/error-items/${e.id}`,{knowledgePoints:t}),await s()},logLabel:"tags",successMessage:n.common?.messages?.tagUpdateSuccess||"Tags updated successfully!",failureMessage:n.common?.messages?.updateFailed||"Update failed"});return(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsx)(F,{title:(0,t.jsx)("h4",{className:"text-sm font-semibold",children:n.editor?.tags||"Knowledge Tags"}),actions:!i.editing&&(0,t.jsxs)("div",{className:"flex",children:[(0,t.jsx)(J,{errorItemId:e.id,onDone:s}),(0,t.jsx)(E,{onClick:i.start})]})}),i.editing?(0,t.jsxs)("div",{className:"space-y-3",children:[(0,t.jsx)(ee.f,{value:i.value,onChange:i.setValue,placeholder:n.editor?.tagsPlaceholder||"Enter or select knowledge tags...",subject:(0,et.f)(e.subject?.name||null)||void 0,gradeStage:a}),(0,t.jsx)("p",{className:"text-xs text-muted-foreground",children:n.editor?.tagsHint||"Select from standard or custom tags"}),(0,t.jsx)(T,{onSave:i.submit,onCancel:i.cancel,children:(0,t.jsx)(J,{errorItemId:e.id,onSuggested:i.setValue})})]}):(0,t.jsx)("div",{className:"flex flex-wrap gap-2",children:r.map(e=>(0,t.jsx)(Q.f,{variant:"secondary",children:e},e))})]})}var en=e.i(580860);let er={name:"image",size:24,node:[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",ry:"2",key:"1m3agn"}],["circle",{cx:"9",cy:"9",r:"2",key:"af1f0g"}],["path",{d:"m21 15-3.086-3.086a2 2 0 0 0-2.828 0L6 21",key:"1xmnt7"}]]};er.node;let ei=(0,i.f)(er);function el({src:e,alt:a,showLabel:s,hideLabel:n,visible:r,onVisibleChange:i,onEnlarge:l,variant:o="ghost",actions:c}){let{t:d}=(0,x.b)();return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)("div",{className:"flex flex-wrap gap-2",children:[e&&(0,t.jsx)(f.f,{variant:o,size:"sm",onClick:()=>i(!r),className:`flex items-center gap-2 ${"ghost"===o?"text-muted-foreground":""}`,children:r?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(en.f,{className:"h-4 w-4"}),n]}):(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(ei,{className:"h-4 w-4"}),s]})}),c]}),e&&r&&(0,t.jsxs)("div",{className:"mt-4",children:[(0,t.jsx)("img",{src:e,alt:a,className:"w-full rounded-lg border cursor-pointer hover:opacity-90 transition-opacity",onClick:()=>l(e)}),(0,t.jsx)("p",{className:"text-xs text-muted-foreground mt-1 text-center",children:d.detail?.clickToEnlarge||"Click to enlarge"})]})]})}function eo({item:e,educationStage:s,saveFields:n,onUpdate:r,reload:i,onEnlarge:l}){let{t:o}=(0,x.b)(),[c,d]=(0,a.useState)(!1),u=L({read:()=>e.questionText,save:e=>n({questionText:e}),logLabel:"question"});return(0,t.jsxs)(k.N,{children:[(0,t.jsx)(k.Y,{children:(0,t.jsx)(F,{title:(0,t.jsx)(k.v,{children:o.detail.question}),actions:!u.editing&&(0,t.jsx)(E,{onClick:u.start})})}),(0,t.jsxs)(k.O,{className:"space-y-4",children:[u.editing?(0,t.jsxs)("div",{className:"space-y-3",children:[(0,t.jsx)(w.f,{value:u.value,onChange:u.setValue,placeholder:"Enter question text...",rows:8,className:"w-full font-mono text-sm"}),(0,t.jsx)(T,{onSave:u.submit,onCancel:u.cancel})]}):(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(N.f,{content:e.questionText}),(0,t.jsx)(G.f,{svg:e.figureSvg,scale:e.figureScale,align:e.figureAlign,onSave:(e,t)=>n({figureScale:e,figureAlign:t})},`${e.id}-${e.figureScale??100}-${e.figureAlign??"center"}`)]}),(0,t.jsx)(es,{item:e,educationStage:s,onChanged:i}),(0,t.jsx)(K,{item:e,onChanged:i}),(0,t.jsx)("div",{className:"pt-3",children:(0,t.jsx)(el,{src:e.originalImageUrl,alt:o.detail.originalProblem||"Original Problem",showLabel:o.replaceImage?.view||"View original image",hideLabel:o.replaceImage?.hide||"Hide original image",variant:"outline",visible:c,onVisibleChange:d,onEnlarge:l,actions:(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(P,{errorItemId:e.id,hasImage:!!e.originalImageUrl,onDone:e=>{r({originalImageUrl:e}),d(!0)}}),e.originalImageUrl&&(0,t.jsx)(D,{errorItemId:e.id,onDone:r})]})})})]})]})}var ec=e.i(967489),ed=e.i(991722);function eu({item:e,saveFields:s,onEnlarge:n}){let{t:r,language:i}=(0,x.b)(),[l,o]=(0,a.useState)(!1),c=L({read:()=>({text:e.wrongAnswerText||"",status:e.mistakeStatus||"unknown"}),save:({text:e,status:t})=>s({wrongAnswerText:e,mistakeStatus:(0,ed.x)(t,e)}),logLabel:"wrong answer"});return(0,t.jsxs)(k.N,{children:[(0,t.jsx)(k.Y,{children:(0,t.jsx)(F,{title:(0,t.jsx)(k.v,{children:r.editor?.wrongAnswerText||"Wrong Answer / Work"}),actions:!c.editing&&(0,t.jsx)(E,{onClick:c.start})})}),(0,t.jsx)(k.O,{className:"space-y-4",children:c.editing?(0,t.jsxs)("div",{className:"space-y-4",children:[(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsx)("label",{className:"text-sm text-muted-foreground",children:r.editor?.mistakeStatus||"Attempt Status"}),(0,t.jsxs)(ec.d,{value:c.value.status,onValueChange:e=>c.setValue({...c.value,status:e}),children:[(0,t.jsx)(ec.P,{children:(0,t.jsx)(ec.U,{})}),(0,t.jsxs)(ec.r,{children:[(0,t.jsx)(ec.T,{value:"not_attempted",children:r.editor?.mistakeStatuses?.notAttempted||"Not attempted"}),(0,t.jsx)(ec.T,{value:"wrong_attempt",children:r.editor?.mistakeStatuses?.wrongAttempt||"Wrong attempt"}),(0,t.jsx)(ec.T,{value:"unknown",children:r.editor?.mistakeStatuses?.unknown||"Unknown"})]})]})]}),(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsx)("label",{className:"text-sm text-muted-foreground",children:r.editor?.wrongAnswerText||"Wrong Answer / Work"}),(0,t.jsx)(w.f,{value:c.value.text,onChange:e=>c.setValue({text:e,status:e.trim()?"wrong_attempt":c.value.status}),rows:5,className:"w-full font-mono text-sm"})]}),(0,t.jsx)(T,{onSave:c.submit,onCancel:c.cancel})]}):(0,t.jsxs)("div",{className:"space-y-4",children:[(0,t.jsx)(Q.f,{variant:"secondary",children:(0,ed.i)(e.mistakeStatus,i)}),e.wrongAnswerText?(0,t.jsx)(N.f,{content:e.wrongAnswerText}):(0,t.jsx)("p",{className:"text-sm text-muted-foreground italic",children:r.detail?.noMistakeAnalysis||"No mistake analysis yet."}),e.wrongAnswerImageUrl&&(0,t.jsx)("div",{className:"pt-3",children:(0,t.jsx)(el,{src:e.wrongAnswerImageUrl,alt:r.detail.wrongAnswerImageAlt,showLabel:r.detail.viewImage,hideLabel:r.detail.hideImage,visible:l,onVisibleChange:o,onEnlarge:n})})]})})]})}let em={name:"square-function",size:24,node:[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",ry:"2",key:"1m3agn"}],["path",{d:"M9 17c2 0 2.8-1 2.8-2.8V10c0-2 1-3.3 3.2-3",key:"m1af9g"}],["path",{d:"M9 11.2h5.7",key:"3zgcl2"}]],aliases:["function-square"]};em.node;let eg=(0,i.f)(em);var eh=e.i(716400),ef=e.i(369939);let ex=new Set(["ne","neq","nabla","nu","not","notin","ni","nexists","ngeq","nleq","nmid","nparallel","nsubseteq"]);function ep(e){return e.length>80?`${e.slice(0,80)}…`:e}let ev=["questionText","answerText","analysis","wrongAnswerText","mistakeAnalysis"];function ej({errorItemId:e,fields:s,onDone:n}){let{t:r}=(0,x.b)(),[i,l]=(0,a.useState)(!1),o=(0,a.useMemo)(()=>Object.values(function(e){let t={};for(let a of ev){let s=function(e){if(!e?.trim())return[];let{masked:t,segments:a}=(0,ef.F)(e),s=[];for(let e of a)try{eh.f.renderToString(e.tex,{displayMode:e.displayMode,throwOnError:!0,strict:"ignore"})}catch(a){let t=a instanceof Error?a.message.replace(/^KaTeX parse error:\s*/,""):String(a);s.push({snippet:ep(e.source),message:t})}let n=t.replace(/@@MATH\d+@@/g," "),r=n.replace(/\\\$/g,"").match(/\$/g);r&&s.push({snippet:"$",message:`有 ${r.length} 个未配对的 $ 定界符`});let i=n.match(/\\[()[\]]/g);i&&s.push({snippet:i.join(" "),message:"有未配对的 \\( \\) 或 \\[ \\] 定界符"});let l=[...new Set(n.match(/\\[a-zA-Z]{2,}/g)||[])].filter(e=>!e.startsWith("\\n")||ex.has(e.slice(1)));return l.length>0&&s.push({snippet:ep(l.join(" ")),message:"LaTeX 命令没有放在 $…$ 中,会原样显示"}),s}(e[a]);s.length>0&&(t[a]=s)}return t}(s)).reduce((e,t)=>e+(t?.length??0),0),[s]),c=async()=>{l(!0);try{let t=await p.k.post(`/api/error-items/${e}/fix-latex`,{},{timeout:3e5,recoverable:!0});n(t.updated);let a=t.fixedFields.map(e=>r.fixLatex.fields[e]).join(r.common.listSeparator);M.c.info(0===t.issuesBefore?r.fixLatex.noIssues:0===t.fixedFields.length?r.fixLatex.notFixed:0===t.issuesAfter?r.fixLatex.fixedAll.replace("{fields}",a):r.fixLatex.fixedPartly.replace("{fields}",a).replace("{count}",String(t.issuesAfter)))}catch(a){let e=a?.data?.message||"",t=r.errors[e];j.V.error("[FixLatex]","Failed to fix LaTeX",{code:e}),M.c.error("string"==typeof t?t:r.fixLatex.failed)}finally{l(!1)}};return 0!==o||i?(0,t.jsxs)(f.f,{variant:"outline",size:"sm",onClick:c,disabled:i,className:"border-amber-500 text-amber-700 dark:text-amber-400",title:r.fixLatex.issuesFound.replace("{count}",String(o)),children:[i?(0,t.jsx)(g.f,{className:"mr-2 h-4 w-4 animate-spin"}):(0,t.jsx)(eg,{className:"mr-2 h-4 w-4"}),i?r.fixLatex.running:r.fixLatex.button,!i&&o>0&&(0,t.jsxs)("span",{className:"ml-1",children:["(",o,")"]})]}):null}var eb=e.i(991686),ey=e.i(846968),ew=e.i(931454);function eN({errorItemId:e,onDone:s}){let{t:n,language:r}=(0,x.b)(),[i,l]=(0,a.useState)(!1),o=async()=>{if(await (0,M.u)(n.reanswerItem.confirm)){l(!0);try{let t=await p.k.post(`/api/error-items/${e}/reanswer`,{language:r},{timeout:6e5,recoverable:!0});s(t)}catch(a){let e=a?.data?.message||"",t=n.errors[e];j.V.error("[RegenerateAnswer]","Failed to regenerate answer",{code:e}),M.c.error("NO_QUESTION_TEXT"===e?n.reanswerItem.noQuestionText:"string"==typeof t?t:n.reanswerItem.failed)}finally{l(!1)}}};return(0,t.jsxs)(f.f,{variant:"ghost",size:"sm",onClick:o,disabled:i,children:[i?(0,t.jsx)(g.f,{className:"h-4 w-4 mr-1 animate-spin"}):(0,t.jsx)(ew.f,{className:"h-4 w-4 mr-1"}),i?n.reanswerItem.running:n.reanswerItem.button]})}var ek=e.i(689664),eS=e.i(508734);function eA({shortId:e,className:s=""}){let{t:n}=(0,x.b)(),[r,i]=(0,a.useState)(!1);if(!e)return null;let l=async t=>{t.preventDefault(),t.stopPropagation();try{await navigator.clipboard.writeText(e),i(!0),setTimeout(()=>i(!1),1500)}catch{window.prompt(n.shortId.copy,e)}};return(0,t.jsxs)("button",{type:"button",onClick:l,title:r?n.shortId.copied:n.shortId.copy,className:`inline-flex items-center gap-1 rounded-md border bg-muted/50 px-2 py-0.5 font-mono text-xs text-muted-foreground hover:text-foreground transition-colors ${s}`,children:[(0,t.jsx)("span",{children:n.shortId.label}),(0,t.jsx)("span",{className:"font-semibold text-foreground",children:e}),r?(0,t.jsx)(ek.f,{className:"h-3 w-3 text-green-600"}):(0,t.jsx)(eS.f,{className:"h-3 w-3"})]})}let eC={name:"audio-lines",size:24,node:[["path",{d:"M2 10v3",key:"1fnikh"}],["path",{d:"M6 6v11",key:"11sgs0"}],["path",{d:"M10 3v18",key:"yhl04a"}],["path",{d:"M14 8v7",key:"3a1oy3"}],["path",{d:"M18 5v13",key:"123xd1"}],["path",{d:"M22 10v3",key:"154ddg"}]]};eC.node;let eI=(0,i.f)(eC),eE={name:"clapperboard",size:24,node:[["path",{d:"m12.296 3.464 3.02 3.956",key:"qash78"}],["path",{d:"M20.2 6 3 11l-.9-2.4c-.3-1.1.3-2.2 1.3-2.5l13.5-4c1.1-.3 2.2.3 2.5 1.3z",key:"1h7j8b"}],["path",{d:"M3 11h18v8a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z",key:"4lm6w1"}],["path",{d:"m6.18 5.276 3.1 3.899",key:"zjj9t3"}]]};eE.node;let eT=(0,i.f)(eE),eF={name:"maximize",size:24,node:[["path",{d:"M8 3H5a2 2 0 0 0-2 2v3",key:"1dcmit"}],["path",{d:"M21 8V5a2 2 0 0 0-2-2h-3",key:"1e4gt3"}],["path",{d:"M3 16v3a2 2 0 0 0 2 2h3",key:"wsl5sc"}],["path",{d:"M16 21h3a2 2 0 0 0 2-2v-3",key:"18trek"}]]};eF.node;let eM=(0,i.f)(eF),eL={name:"minimize",size:24,node:[["path",{d:"M8 3v3a2 2 0 0 1-2 2H3",key:"hohbtr"}],["path",{d:"M21 8h-3a2 2 0 0 1-2-2V3",key:"5jw1f3"}],["path",{d:"M3 16h3a2 2 0 0 1 2 2v3",key:"198tvr"}],["path",{d:"M16 21v-3a2 2 0 0 1 2-2h3",key:"ph8mxp"}]]};eL.node;let ez=(0,i.f)(eL),e$={name:"pause",size:24,node:[["rect",{x:"14",y:"3",width:"5",height:"18",rx:"1",key:"kaeet6"}],["rect",{x:"5",y:"3",width:"5",height:"18",rx:"1",key:"1wsw3u"}]]};e$.node;let eR=(0,i.f)(e$);var eV=e.i(21357),eO=e.i(395925);let eD={name:"volume-2",size:24,node:[["path",{d:"M11 4.702a.705.705 0 0 0-1.203-.498L6.413 7.587A1.4 1.4 0 0 1 5.416 8H3a1 1 0 0 0-1 1v6a1 1 0 0 0 1 1h2.416a1.4 1.4 0 0 1 .997.413l3.383 3.384A.705.705 0 0 0 11 19.298z",key:"uqj9uw"}],["path",{d:"M16 9a5 5 0 0 1 0 6",key:"1q6k2b"}],["path",{d:"M19.364 18.364a9 9 0 0 0 0-12.728",key:"ijwkga"}]]};eD.node;let eU=(0,i.f)(eD),eq={name:"volume-x",size:24,node:[["path",{d:"M11 4.702a.7.7 0 0 0-1.203-.498L6.413 7.587A1.4 1.4 0 0 1 5.416 8H3a1 1 0 0 0-1 1v6a1 1 0 0 0 1 1h2.416a1.4 1.4 0 0 1 .997.413l3.383 3.384A.7.7 0 0 0 11 19.298z",key:"1p7khw"}],["path",{d:"m16.5 14.5 5-5",key:"cul3yw"}],["path",{d:"m16.5 9.5 5 5",key:"1akey5"}]]};eq.node;let e_=(0,i.f)(eq);var eH=e.i(975157);function eP({supported:e,enabled:a,rate:s,fullscreen:n,onToggle:r,onCycleRate:i}){let{t:l}=(0,x.b)(),o=(0,eH.f)("h-8 shrink-0",n&&"text-white hover:bg-white/20 hover:text-white"),c=e?a?l.svgAnimation.voiceOff:l.svgAnimation.voiceOn:l.svgAnimation.voiceUnsupported;return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("span",{title:c,className:"shrink-0",children:(0,t.jsx)(f.f,{variant:"ghost",size:"sm",className:(0,eH.f)(o,"w-8 p-0",a&&e&&!n&&"text-primary"),onClick:r,disabled:!e,"aria-label":c,"aria-pressed":a&&e,children:a&&e?(0,t.jsx)(eU,{className:"h-4 w-4"}):(0,t.jsx)(e_,{className:"h-4 w-4"})})}),a&&e&&(0,t.jsxs)(f.f,{variant:"ghost",size:"sm",className:(0,eH.f)(o,"px-1.5 text-xs tabular-nums"),onClick:i,"aria-label":l.svgAnimation.voiceRate,title:l.svgAnimation.voiceRate,children:[s,"×"]})]})}let eG=/<metadata\b[^>]*\bid\s*=\s*["']narration["'][^>]*>([\s\S]*?)<\/metadata\s*>/gi,eB={lt:"<",gt:">",amp:"&",quot:'"',apos:"'"};function eX(e){let t=e;if("string"==typeof t){let e=t.indexOf("["),a=t.lastIndexOf("]");if(-1===e||a<e)return null;try{t=JSON.parse(t.slice(e,a+1))}catch{return null}}if(!Array.isArray(t))return null;let a=[];for(let e of t){if(!e||"object"!=typeof e)continue;let{begin:t,text:s}=e,n="number"==typeof t?t:"string"==typeof t?eQ(t):null;if(null===n||!Number.isFinite(n)||n<0||"string"!=typeof s)continue;let r=s.replace(/\s+/g," ").trim();r&&a.push({begin:Math.round(100*n)/100,text:r})}a.sort((e,t)=>e.begin-t.begin);let s=[];for(let e of a){let t=s[s.length-1];t&&t.begin===e.begin?t.text=`${t.text} ${e.text}`:s.push({...e})}let n=s.slice(0,20).map(e=>({...e,text:e.text.slice(0,300)}));return n.length>0?n:null}function eW(e){for(let t of e.matchAll(eG)){let e=eX(t[1].replace(/&(#x[0-9a-f]+|#\d+|lt|gt|amp|quot|apos);/gi,(e,t)=>{if("#"!==t[0])return eB[t.toLowerCase()];let a="x"===t[1]||"X"===t[1]?parseInt(t.slice(2),16):Number(t.slice(1));return Number.isFinite(a)&&a<=1114111?String.fromCodePoint(a):e}));if(e)return e}return null}let eZ=/<(?:animate|animateTransform|animateMotion|set)\b[^>]*>/gi;function eK(e,t){let a=e.match(RegExp(`\\s${t}\\s*=\\s*("([^"]*)"|'([^']*)')`,"i"));return a?(a[2]??a[3]??"").trim():null}function eQ(e){if(!e)return null;let t=e.trim(),a=t.match(/^(?:(\d+):)?(\d+):(\d+(?:\.\d+)?)$/);if(a)return 3600*Number(a[1]??0)+60*Number(a[2])+Number(a[3]);let s=t.match(/^(\d+(?:\.\d+)?)(h|min|s|ms)?$/);if(!s)return null;let n={h:3600,min:60,s:1,ms:.001}[s[2]??"s"]??1;return Number(s[1])*n}let eY=new Set(["opacity","visibility","display","fill-opacity"]);function eJ(e){let t=e.getAttribute("viewBox")?.split(/[\s,]+/).map(Number),a=t?.length===4&&t[3]>0?t[1]+t[3]:parseFloat(e.getAttribute("height")??"");if(!(a>0))return null;let s=t?.length===4?t[1]+.78*t[3]:.78*a,n=[];for(let t of Array.from(e.querySelectorAll("text"))){if(t.closest("defs, metadata"))continue;let a=parseFloat(t.getAttribute("y")??t.querySelector("tspan[y]")?.getAttribute("y")??"");if(!(a>=s))continue;let r=Array.from(t.querySelectorAll("tspan")),i=(r.length>0?r.map(e=>e.textContent??"").join(" "):t.textContent??"").replace(/\s+/g," ").trim(),l=function(e,t){for(let a=e;a&&a!==t;a=a.parentElement)for(let e of Array.from(a.children)){let t=e.localName;if("set"!==t&&"animate"!==t)continue;let a=e.getAttribute("attributeName")??"";if(eY.has(a)&&!function(e,t){if(null===t)return!1;let a=t.trim();return"visibility"===e?"hidden"===a:"display"===e?"none"===a:0===Number(a)}(a,e.getAttribute("to")??e.getAttribute("values")?.split(";").pop()??null))return eQ((e.getAttribute("begin")??"0").split(";")[0])}return 0}(t,e);i&&null!==l&&n.push({begin:l,y:a,text:i})}return n.sort((e,t)=>e.begin-t.begin||e.y-t.y),eX(n.map(({begin:e,text:t})=>({begin:e,text:t})))}var e0=e.i(79058);let e1={zh:["zh","cmn"],en:["en"]};function e2(){return"speechSynthesis"in window&&"u">typeof SpeechSynthesisUtterance?window.speechSynthesis:null}let e3=!1;function e4(){let e=e2();if(!e||e3)return;e3=!0;let t=new SpeechSynthesisUtterance(" ");t.volume=0,e.speak(t)}let e5=[1,1.25,1.5,.75],e8="svg-narration-enabled",e6="svg-narration-rate";function e7(e){try{return localStorage.getItem(e)}catch{return null}}function e9(e,t){try{localStorage.setItem(e,t)}catch{}}function te(e,t){return Math.max(8e3,400*e.length/t+5e3)}function tt(e,t){let a=-1;for(let s=0;s<e.length&&e[s].begin<=t+.05;s++)a=s;return a}function ta(e){let t=Math.max(0,Math.floor(e));return`${Math.floor(t/60)}:${String(t%60).padStart(2,"0")}`}function ts({svg:e,errorItemId:s}){let{t:n,language:r}=(0,x.b)(),i=(0,a.useRef)(null),l=(0,a.useRef)(null),o=(0,a.useRef)(null),[c,d]=(0,a.useState)(null),[u,m]=(0,a.useState)(!1),[g,h]=(0,a.useState)(0),[p,v]=(0,a.useState)(!1),[j,b]=(0,a.useState)(!1),y=p||j,w=(0,a.useMemo)(()=>(function(e){let t=0;for(let a of e.match(eZ)||[]){let e=eK(a,"begin"),s=null===e?0:eQ(e.split(";")[0]);if(null===s)continue;let n=eK(a,"repeatCount");if("indefinite"!==n&&"indefinite"!==eK(a,"repeatDur"))t=Math.max(t,s+(eQ(eK(a,"dur"))??0)*(n&&Number.isFinite(Number(n))?Number(n):1))}return t})(e),[e]),N=(0,a.useMemo)(()=>(function(e){let t=e.match(/<svg\b[^>]*>/i)?.[0]??"",a=eK(t,"viewBox")?.split(/[\s,]+/).map(Number);if(a?.length===4&&a[2]>0&&a[3]>0)return a[2]/a[3];let s=parseFloat(eK(t,"width")??""),n=parseFloat(eK(t,"height")??"");return s>0&&n>0?s/n:1.6})(e),[e]),k=(0,a.useMemo)(()=>`<!doctype html><html><head><meta charset="utf-8"><meta http-equiv="Content-Security-Policy" content="default-src 'none'; style-src 'unsafe-inline'; img-src data:"><style>html,body{margin:0;height:100%;background:#fff;overflow:hidden}svg{display:block;width:100%;height:100%}</style></head><body>${e}</body></html>`,[e]),S=(0,a.useMemo)(()=>eW(e),[e]),[A,C]=(0,a.useState)(null),I=S??A,E=(0,a.useCallback)(()=>{let e=l.current?.contentDocument;return"function"==typeof e?.getAnimations?e.getAnimations():[]},[]),T=function({segments:e,language:t,errorItemId:s,holdAnimation:n}){let{supported:r,mode:i,modeRef:l,voiceRef:o}=function(e){let[t,s]=(0,a.useState)(!1),[n,r]=(0,a.useState)("browser"),i=(0,a.useRef)(void 0),l=(0,a.useRef)("browser");return(0,a.useEffect)(()=>{let e=!0;return(0,e0.v)().then(t=>{e&&(l.current=t,r(t))}),()=>{e=!1}},[]),(0,a.useEffect)(()=>{let t=e2();if(!t)return;let a=()=>{let a,n,r,l=t.getVoices();a=e1[e],n=l.filter(e=>a.some(t=>e.lang.toLowerCase().startsWith(t))),r="zh"===e?/^(zh|cmn)[-_](cn|hans)/i:/^en[-_]us/i,i.current=n.find(e=>r.test(e.lang)&&e.localService)??n.find(e=>r.test(e.lang))??n[0],s(0===l.length||!!i.current)};return a(),t.addEventListener?.("voiceschanged",a),()=>t.removeEventListener?.("voiceschanged",a)},[e]),{supported:t,mode:n,modeRef:l,voiceRef:i}}(t),[c,d]=(0,a.useState)(!1),[u,m]=(0,a.useState)(1),[g,h]=(0,a.useState)(!1),[f,x]=(0,a.useState)(!1),p=(0,a.useRef)(!1),v=(0,a.useRef)(!1),j=(0,a.useRef)(1),b=(0,a.useRef)(n);(0,a.useEffect)(()=>{b.current=n},[n]),(0,a.useEffect)(()=>{v.current="1"===e7(e8),d(v.current);let e=Number(e7(e6));e5.includes(e)&&(j.current=e,m(e))},[]);let y=(0,a.useRef)(null);(0,a.useEffect)(()=>{let a=y.current;a&&(a.deps.segments=e,a.deps.language=t,a.deps.enabled=v.current,a.deps.mode=l.current,a.deps.voice=o.current,a.deps.rate=j.current)}),(0,a.useEffect)(()=>{let a={segments:e,language:t,enabled:v.current,mode:l.current,voice:o.current,rate:j.current,setSpeaking:h,setHolding:x,hold:e=>{b.current(e)}},s=function(e){let t=-1,a=!1,s=null,n=0,r=null,i=!1,l=!1;function o(){i&&(i=!1,null===s&&(e.setHolding(!1),e.hold(!1)))}function c(t,n){n(),t()&&(r=null,a=!1,e.setSpeaking(!1),o(),null!==s&&(s=null,e.setHolding(!1),e.hold(!1)))}function d(t,a,s,n){if(!t()||l)return;l=!0,o();let r=e2();if(!r)return void c(t,s);let i=new SpeechSynthesisUtterance(a.text);i.lang=e.voice?.lang??("en"===e.language?"en-US":"zh-CN"),e.voice&&(i.voice=e.voice),i.rate=e.rate,i.onend=()=>c(t,s),i.onerror=()=>c(t,s),i.onstart=()=>n(te(a.text,i.rate)),n(2500),r.speak(i)}return{update:function(u){let m=e.segments;if(!e.enabled||!m?.length||null!==s)return;if(a){let a=t+1;if(a>=m.length)return;let n=a>0?m[a].begin-m[a-1].begin:m[a].begin;if(u<m[a].begin-Math.min(.8,n/2))return;s=a,e.setHolding(!0),e.hold(!0);return}let g=tt(m,u);g<=t||(t=g,function(t){let u,m=e.segments,g=m?.[t];if(!g)return;let h=n,f={},x=()=>n===h&&r===f,p=()=>clearTimeout(u),v=e=>{clearTimeout(u),u=setTimeout(()=>c(x,p),e)};if(l=!1,r=f,a=!0,e.setSpeaking(!0),"cloud"!==e.mode)return d(x,g,p,v);let j=e.language,b=m?.[t+1];b&&(0,e0.U)(b.text,j).catch(()=>void 0);let y=setTimeout(()=>{x()&&null===s&&(i=!0,e.setHolding(!0),e.hold(!0))},300);(0,e0.U)(g.text,j).then(t=>{let a=(0,e0.l)();if(!x())return;if(!a){clearTimeout(y),d(x,g,p,v);return}let s=e=>()=>{x()&&!l&&e()};a.onplaying=s(()=>{clearTimeout(y),o(),v(te(g.text,a.playbackRate))}),a.onended=s(()=>c(x,p)),a.onerror=s(()=>d(x,g,p,v)),a.src=t,a.playbackRate=e.rate,v(8e3),a.play().catch(s(()=>{clearTimeout(y),d(x,g,p,v)}))},()=>{clearTimeout(y),d(x,g,p,v)})}(g))},stop:function(l){n++,r=null,a=!1,e.setSpeaking(!1),(null!==s||i)&&(s=null,i=!1,e.setHolding(!1),e.hold(!1)),t=e.segments?tt(e.segments,l)-1:-1,e2()?.cancel(),"cloud"===e.mode&&(0,e0.l)()?.pause()},dispose:function(){n++,e2()?.cancel(),"cloud"===e.mode&&(0,e0.l)()?.pause()}}}(a);return y.current={playback:s,deps:a},()=>{s.dispose(),y.current=null}},[]);let w=(0,a.useCallback)(()=>y.current?.playback??null,[]);(0,a.useEffect)(()=>()=>{w()?.dispose()},[e,w]);let N=(0,a.useCallback)(e=>{w()?.stop(e)},[w]),k=(0,a.useCallback)(e=>{w()?.update(e)},[w]),S=(0,a.useCallback)(()=>{v.current&&(e4(),"cloud"===l.current&&(0,e0.p)())},[l]),A=(0,a.useCallback)((e,t)=>{p.current=!0,w()?.stop(t),v.current=e,d(e),e9(e8,e?"1":"0"),S()},[w,S]),C=(0,a.useCallback)(()=>{var e;let t,a=(e=j.current,t=e5.indexOf(e),e5[(t+1)%e5.length]);if(j.current=a,m(a),"cloud"===l.current){let e=(0,e0.l)();e&&(e.playbackRate=a)}e9(e6,String(a))},[l]);return(0,a.useEffect)(()=>{let e="cloud"===i&&!(0,e0.h)();if(!c||(e3||!e2())&&!e)return;let t=()=>{e4(),e&&(0,e0.p)()};return document.addEventListener("click",t,{capture:!0,once:!0}),document.addEventListener("touchend",t,{capture:!0,once:!0}),()=>{document.removeEventListener("click",t,{capture:!0}),document.removeEventListener("touchend",t,{capture:!0})}},[c,i]),(0,a.useEffect)(()=>{c&&"cloud"===i&&e?.length&&(0,e0.w)(e.map(e=>e.text),t,s).catch(()=>void 0)},[c,i,e,t,s]),(0,a.useEffect)(()=>{if("cloud"!==i||!e?.length||v.current)return;let a=!0;return(0,e0.z)(e.map(e=>e.text),t).then(e=>{a&&e&&!v.current&&!p.current&&(v.current=!0,d(!0))}),()=>{a=!1}},[i,e,t]),{supported:r||"cloud"===i,enabled:c,rate:u,speaking:g,holding:f,setEnabled:A,cycleRate:C,update:k,stop:N,prime:S}}({segments:I,language:r,errorItemId:s,holdAnimation:(0,a.useCallback)(e=>{e?o.current?.pauseAnimations():o.current?.unpauseAnimations(),E().forEach(t=>e?t.pause():t.play())},[E])}),F=T.enabled&&(T.holding||!u&&T.speaking),{stop:M,update:L,prime:z}=T,$=(0,a.useCallback)(()=>{o.current?.pauseAnimations(),E().forEach(e=>e.pause()),m(!1)},[E]),R=(0,a.useCallback)(()=>{M(o.current?.getCurrentTime()??0),$()},[$,M]),V=(0,a.useCallback)(e=>{o.current?.setCurrentTime(e),E().forEach(t=>{t.currentTime=1e3*e}),h(e),M(e)},[E,M]),O=(0,a.useCallback)(()=>{let e=o.current;e&&(w>0&&e.getCurrentTime()>=w&&V(0),e.unpauseAnimations(),E().forEach(e=>e.play()),m(!0),z())},[E,w,V,z]),D=async()=>{if(j)return void b(!1);if(document.fullscreenElement)return void await document.exitFullscreen().catch(()=>void 0);let e=i.current;if(e&&"function"==typeof e.requestFullscreen)try{await e.requestFullscreen();return}catch{}b(!0)};return(0,a.useEffect)(()=>{let e=()=>v(document.fullscreenElement===i.current);return document.addEventListener("fullscreenchange",e),()=>document.removeEventListener("fullscreenchange",e)},[]),(0,a.useEffect)(()=>{if(!j)return;let e=e=>{"Escape"===e.key&&b(!1)},t=document.body.style.overflow;return document.body.style.overflow="hidden",document.addEventListener("keydown",e),()=>{document.body.style.overflow=t,document.removeEventListener("keydown",e)}},[j]),(0,a.useEffect)(()=>{if(!u)return;let e=0,t=()=>{let a=o.current?.getCurrentTime()??0;if(L(a),w>0&&a>=w){o.current?.setCurrentTime(w),$(),h(w);return}h(a),e=requestAnimationFrame(t)};return e=requestAnimationFrame(t),()=>cancelAnimationFrame(e)},[u,w,$,L]),(0,t.jsxs)("div",{ref:i,className:(0,eH.f)("space-y-2",y&&"flex flex-col items-center justify-center bg-black p-4",j&&"fixed inset-0 z-50"),children:[(0,t.jsx)("iframe",{ref:l,srcDoc:k,sandbox:"allow-same-origin",title:n.svgAnimation.alt,onLoad:()=>{o.current=l.current?.contentDocument?.querySelector("svg")??null,M(0),$(),o.current?.setCurrentTime(0),E().forEach(e=>{e.currentTime=0}),C(o.current?eJ(o.current):null),h(0),d(o.current?e:null)},className:(0,eH.f)("mx-auto block rounded border bg-white transition-shadow",!y&&"w-full max-w-3xl",F&&"border-primary ring-2 ring-primary/40"),style:{visibility:c===e?"visible":"hidden",...y?{aspectRatio:N,width:`min(100%, calc((100dvh - 96px) * ${N}))`}:{aspectRatio:N}}}),(0,t.jsxs)("div",{className:(0,eH.f)("mx-auto flex w-full items-center gap-2",y?"max-w-5xl text-white":"max-w-3xl"),children:[(0,t.jsx)(f.f,{variant:"outline",size:"sm",className:"h-8 w-8 shrink-0 p-0 text-foreground",onClick:u?R:O,disabled:c!==e,"aria-label":u?n.svgAnimation.pause:n.svgAnimation.play,title:u?n.svgAnimation.pause:n.svgAnimation.play,children:u?(0,t.jsx)(eR,{className:"h-4 w-4"}):(0,t.jsx)(eV.f,{className:"h-4 w-4"})}),(0,t.jsx)(f.f,{variant:"ghost",size:"sm",className:(0,eH.f)("h-8 w-8 shrink-0 p-0",y&&"text-white hover:bg-white/20 hover:text-white"),onClick:()=>{V(0),O()},disabled:c!==e,"aria-label":n.svgAnimation.replay,title:n.svgAnimation.replay,children:(0,t.jsx)(eO.f,{className:"h-4 w-4"})}),w>0&&(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("input",{type:"range",min:0,max:w,step:.1,value:Math.min(g,w),onChange:e=>V(Number(e.target.value)),"aria-label":n.svgAnimation.progress,className:"h-2 min-w-0 flex-1 cursor-pointer accent-primary"}),(0,t.jsxs)("span",{className:(0,eH.f)("shrink-0 text-xs tabular-nums",y?"text-white/80":"text-muted-foreground"),children:[ta(g)," / ",ta(w)]})]}),(0,t.jsxs)("div",{className:"ml-auto flex shrink-0 items-center gap-1",children:[!!I?.length&&(0,t.jsx)(eP,{supported:T.supported,enabled:T.enabled,rate:T.rate,fullscreen:y,onToggle:()=>T.setEnabled(!T.enabled,o.current?.getCurrentTime()??0),onCycleRate:T.cycleRate}),(0,t.jsx)(f.f,{variant:"ghost",size:"sm",className:(0,eH.f)("h-8 w-8 shrink-0 p-0",y&&"text-white hover:bg-white/20 hover:text-white"),onClick:D,"aria-label":y?n.svgAnimation.exitFullscreen:n.svgAnimation.fullscreen,title:y?n.svgAnimation.exitFullscreen:n.svgAnimation.fullscreen,children:y?(0,t.jsx)(ez,{className:"h-4 w-4"}):(0,t.jsx)(eM,{className:"h-4 w-4"})})]})]})]})}function tn({svg:e,errorItemId:s,disabled:n,onBusyChange:r}){let{t:i,language:l}=(0,x.b)(),[o,c]=(0,a.useState)(!1),[d,u]=(0,a.useState)(!1),m=(0,a.useMemo)(()=>(function(e){let t=eW(e);if(t)return t;try{let t=new DOMParser().parseFromString(e,"image/svg+xml").documentElement;return"svg"===t.nodeName?eJ(t):null}catch{return null}})(e),[e]);if((0,a.useEffect)(()=>{let e=!0;return(0,e0.v)().then(t=>{e&&c("cloud"===t)}),()=>{e=!1}},[]),!o||!m?.length)return null;let h=async()=>{u(!0),r(!0);try{await (0,e0.H)(m.map(e=>e.text),l,s),M.c.success(i.svgAnimation.voiceRegenerateDone)}catch(s){let e=(0,v.d)(s)||"";j.V.error("[SvgAnimation]","Failed to regenerate cloud voice",{code:e,error:(0,v.Z)(s)});let t=(0,v.L)(s),a="TTS_DISABLED"===e?i.svgAnimation.voiceRegenerateDisabled:i.svgAnimation.voiceRegenerateFailed;M.c.error(t?`${a} (${t})`:a)}finally{u(!1),r(!1)}};return(0,t.jsxs)(f.f,{variant:"ghost",size:"sm",className:"h-7 px-2 text-xs gap-1",onClick:h,disabled:n||d,title:i.svgAnimation.voiceRegenerateHint,children:[d?(0,t.jsx)(g.f,{className:"h-3.5 w-3.5 animate-spin"}):(0,t.jsx)(eO.f,{className:"h-3.5 w-3.5"}),(0,t.jsx)("span",{children:d?i.svgAnimation.voiceRegenerating:i.svgAnimation.voiceRegenerate})]})}function tr({errorItemId:e,svgAnimation:s,hasOtherLanguage:n,onChange:r}){let{t:i,language:l}=(0,x.b)(),[o,u]=(0,a.useState)(!1),[m,h]=(0,a.useState)(!1),[b,y]=(0,a.useState)(!1),[w,N]=(0,a.useState)(!1),[k,S]=(0,a.useState)(null),A=(0,a.useMemo)(()=>!!s&&!!eW(s),[s]),C=(e,t)=>{let a=i.errors[e];return"string"==typeof a?a:t},I=async()=>{u(!0),S(null);try{let t=await p.k.post(`/api/error-items/${e}/svg-animation`,{language:l},{timeout:6e5,recoverable:!0});r(l,t.svgAnimation)}catch(t){let e=(0,v.d)(t)||"";j.V.error("[SvgAnimation]","Failed to generate SVG animation",{code:e,error:(0,v.Z)(t)}),S("NO_QUESTION_TEXT"===e?i.svgAnimation.noQuestionText:"NO_VALID_ANIMATION"===e?i.svgAnimation.invalid:C(e,i.svgAnimation.failed))}finally{u(!1)}},E=async()=>{y(!0),S(null);try{let t=await p.k.post(`/api/error-items/${e}/svg-animation/narration`,{language:l},{timeout:3e5,recoverable:!0});r(l,t.svgAnimation),M.c.success(i.svgAnimation.narrationDone)}catch(t){let e=(0,v.d)(t)||"";j.V.error("[SvgAnimation]","Failed to generate SVG narration",{code:e,error:(0,v.Z)(t)}),S("NO_VALID_NARRATION"===e?i.svgAnimation.narrationInvalid:C(e,i.svgAnimation.narrationFailed))}finally{y(!1)}},T=async()=>{if(await (0,M.u)(i.svgAnimation.confirmDelete,{destructive:!0})){h(!0);try{await p.k.delete(`/api/error-items/${e}/svg-animation?language=${l}`),r(l,null),S(null)}catch(e){j.V.error("[SvgAnimation]","Failed to delete SVG animation",{error:e instanceof Error?e.message:String(e)}),M.c.error(i.svgAnimation.deleteFailed)}finally{h(!1)}}};if(!s)return(0,t.jsxs)("div",{className:"rounded-lg border border-dashed p-4",children:[(0,t.jsxs)("div",{className:"flex flex-wrap items-center justify-between gap-2",children:[(0,t.jsxs)("div",{className:"flex items-center gap-2 text-sm text-muted-foreground",children:[(0,t.jsx)(eT,{className:"h-4 w-4"}),(0,t.jsx)("span",{children:i.svgAnimation.title})]}),(0,t.jsxs)(f.f,{variant:"outline",size:"sm",onClick:I,disabled:o,children:[o?(0,t.jsx)(g.f,{className:"mr-2 h-4 w-4 animate-spin"}):(0,t.jsx)(eT,{className:"mr-2 h-4 w-4"}),o?i.svgAnimation.generating:i.svgAnimation.generate]})]}),k&&(0,t.jsx)("p",{className:"text-xs text-destructive mt-2",children:k}),(0,t.jsx)("p",{className:"text-xs text-muted-foreground mt-2",children:n?i.svgAnimation.otherLanguageAvailable:i.svgAnimation.hint})]});let F=o||m||b||w;return(0,t.jsxs)("div",{className:"rounded-lg border bg-card",children:[(0,t.jsxs)("div",{className:"flex flex-wrap items-center justify-between gap-2 px-3 py-2 border-b bg-muted/30",children:[(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)("span",{className:"text-xs font-medium text-muted-foreground",children:i.svgAnimation.title}),F&&(0,t.jsx)(g.f,{className:"h-3 w-3 animate-spin text-muted-foreground"})]}),(0,t.jsxs)("div",{className:"flex flex-wrap items-center gap-1",children:[(0,t.jsxs)(f.f,{variant:"ghost",size:"sm",className:"h-7 px-2 text-xs gap-1",onClick:E,disabled:F,title:i.svgAnimation.narrationHint,children:[b?(0,t.jsx)(g.f,{className:"h-3.5 w-3.5 animate-spin"}):(0,t.jsx)(eI,{className:"h-3.5 w-3.5"}),(0,t.jsx)("span",{children:b?i.svgAnimation.narrationGenerating:A?i.svgAnimation.narrationRegenerate:i.svgAnimation.narrationGenerate})]}),(0,t.jsx)(tn,{svg:s,errorItemId:e,disabled:F,onBusyChange:N}),(0,t.jsxs)(f.f,{variant:"ghost",size:"sm",className:"h-7 px-2 text-xs gap-1",onClick:I,disabled:F,children:[o?(0,t.jsx)(g.f,{className:"h-3.5 w-3.5 animate-spin"}):(0,t.jsx)(c.f,{className:"h-3.5 w-3.5"}),(0,t.jsx)("span",{children:o?i.svgAnimation.generating:i.svgAnimation.regenerate})]}),(0,t.jsxs)(f.f,{variant:"ghost",size:"sm",className:"h-7 px-2 text-xs gap-1 text-destructive hover:text-destructive",onClick:T,disabled:F,children:[(0,t.jsx)(d.f,{className:"h-3.5 w-3.5"}),(0,t.jsx)("span",{children:i.svgAnimation.delete})]})]})]}),k&&(0,t.jsx)("p",{className:"px-3 pt-2 text-xs text-destructive",children:k}),(0,t.jsx)("div",{className:"p-2 sm:p-3",children:(0,t.jsx)(ts,{svg:s,errorItemId:e})})]})}var ti=e.i(912505),tl=e.i(86963),to=e.i(35209);e.s(["default",0,function(){let e=(0,n.useParams)(),i=(0,n.useRouter)(),{t:l,language:m}=(0,x.b)(),[g,h]=(0,a.useState)(null);(0,to.f)(l.detail.title,g?.subject?.name,g?.shortId);let[v,w]=(0,a.useState)(!0),[N,k]=(0,a.useState)(null),[S,A]=(0,a.useState)(!1),[C,I]=(0,a.useState)(void 0),[E,T]=(0,a.useState)(!1),[F,L]=(0,a.useState)(!0),[$,V]=(0,a.useState)(null),[O,D]=(0,a.useState)(!1),U=(0,a.useCallback)(async e=>{try{let t=await p.k.get(`/api/error-items/${e}`);h(t)}catch(e){j.V.error("[ErrorDetail]","Failed to fetch error item",{error:e}),M.c.error(l.common?.messages?.loadFailed||"Failed to load item"),i.push("/notebooks")}finally{w(!1)}},[i,l]);(0,a.useEffect)(()=>{p.k.get("/api/user").then(e=>{e&&e.educationStage&&I(e.educationStage),T(!!e?.enableGeogebra),L(e?.enableSvgAnimation!==!1)}).catch(e=>j.V.error("[ErrorDetail]","Failed to fetch user info",{error:e})),e.id&&U(e.id)},[e.id,U]);let q=(0,a.useCallback)(e=>{h(t=>t&&{...t,...e})},[]),_=async e=>{g&&(await p.k.put(`/api/error-items/${g.id}`,e),q(e))},H=async()=>{g&&await U(g.id)},P=async e=>{if(!g)return;let t=g.difficultyStars??null;q({difficultyStars:e}),D(!0);try{let t=await p.k.put(`/api/error-items/${g.id}`,{difficultyStars:e});q({paperLevel:t.paperLevel})}catch(e){q({difficultyStars:t}),j.V.error("[ErrorDetail]","Failed to save difficulty",{error:e}),M.c.error(l.difficulty.saveFailed)}finally{D(!1)}},G=(0,a.useCallback)((e,t)=>{q({["en"===e?"svgAnimationEn":"svgAnimation"]:t})},[q]),B=async()=>{if(g&&await (0,M.u)(l.common?.messages?.confirmDelete||"Are you sure you want to delete this error item?",{destructive:!0}))try{await p.k.delete(`/api/error-items/${g.id}/delete`),M.c.success(l.common?.messages?.deleteSuccess||"Deleted successfully"),i.push(g.subjectId?`/notebooks/${g.subjectId}`:"/notebooks")}catch(e){j.V.error("[ErrorDetail]","Failed to delete error item",{error:e}),M.c.error(l.common?.messages?.deleteFailed||"Delete failed")}};return v?(0,t.jsx)(tl.f,{label:l.common.loading}):g?(0,t.jsxs)("main",{className:"min-h-screen",children:[(0,t.jsxs)("div",{className:"mx-auto max-w-6xl space-y-6 px-4 py-6 md:px-8 md:py-8",children:[(0,t.jsxs)("div",{className:"flex flex-col md:flex-row justify-between items-start md:items-center gap-4",children:[(0,t.jsxs)("div",{className:"flex flex-wrap items-center gap-x-4 gap-y-2",children:[(0,t.jsx)(s.default,{href:g.subjectId?`/notebooks/${g.subjectId}`:"/notebooks",children:(0,t.jsx)(f.f,{variant:"ghost",size:"icon",className:"-ml-2",children:(0,t.jsx)(r.f,{className:"h-5 w-5"})})}),(0,t.jsx)("h1",{className:"text-2xl font-bold tracking-tight",children:l.detail.title}),(0,t.jsx)(eA,{shortId:g.shortId}),(0,t.jsx)(u.f,{size:"md",value:g.difficultyStars,onChange:P,disabled:O})]}),(0,t.jsxs)("div",{className:"flex flex-wrap gap-2",children:[(0,t.jsx)(ej,{errorItemId:g.id,fields:g,onDone:q}),(0,t.jsx)(s.default,{href:`/practice?id=${g.id}`,children:(0,t.jsxs)(f.f,{variant:"outline",size:"sm",children:[(0,t.jsx)(c.f,{className:"mr-2 h-4 w-4"}),l.detail.practice]})}),$&&(0,t.jsx)(ey.x,{status:$,className:"h-8 self-center px-3"}),(0,t.jsxs)(f.f,{variant:"ghost",size:"sm",onClick:B,className:"text-red-600 dark:text-red-400 hover:text-red-700 dark:hover:text-red-300 hover:bg-red-50 dark:hover:bg-red-950/40",children:[(0,t.jsx)(d.f,{className:"mr-2 h-4 w-4"}),l.detail.delete||"Delete"]})]})]}),(0,t.jsx)(eo,{item:g,educationStage:C,saveFields:_,onUpdate:q,reload:H,onEnlarge:k}),(0,t.jsx)(eb.K,{errorItemId:g.id,onMasteryStatusChange:V}),(0,t.jsxs)("div",{className:"grid gap-6 lg:grid-cols-2",children:[(0,t.jsx)(z,{title:l.detail.correctAnswer,value:g.answerText,onSave:e=>_({answerText:e}),logLabel:"answer",rows:5,placeholder:"Enter answer...",cardClassName:"border-primary/20",titleClassName:"text-primary",contentClassName:"font-semibold",headerActions:(0,t.jsx)(eN,{errorItemId:g.id,onDone:e=>q({answerText:e.answerText??"",analysis:e.analysis??""})}),children:g.referenceImageUrl&&(0,t.jsx)("div",{className:"pt-3",children:(0,t.jsx)(el,{src:g.referenceImageUrl,alt:l.detail.referenceImageAlt,showLabel:l.detail.viewImage,hideLabel:l.detail.hideImage,visible:S,onVisibleChange:A,onEnlarge:k})})}),(0,t.jsx)(eu,{item:g,saveFields:_,onEnlarge:k})]}),(0,t.jsxs)("div",{className:"grid gap-6 lg:grid-cols-2",children:[(0,t.jsx)(z,{title:l.detail.analysis,value:g.analysis,onSave:e=>_({analysis:e}),logLabel:"analysis",rows:12,placeholder:"Enter analysis..."}),(0,t.jsx)(z,{title:l.detail?.mistakeAnalysis||"Mistake Analysis",value:g.mistakeAnalysis,onSave:e=>_({mistakeAnalysis:e}),logLabel:"mistake analysis",rows:8,editorLabel:l.editor?.mistakeAnalysis||"Mistake Cause Analysis",emptyText:l.detail?.noMistakeAnalysis||"No mistake analysis yet."})]}),(0,t.jsxs)("div",{className:"space-y-6",children:[F&&(0,t.jsx)(tr,{errorItemId:g.id,svgAnimation:"en"===m?g.svgAnimationEn:g.svgAnimation,hasOtherLanguage:!!("en"===m?g.svgAnimation:g.svgAnimationEn),onChange:G},m),E&&(0,t.jsx)(b,{errorItemId:g.id,commands:g.geogebraCommands,onUpdate:q}),(0,t.jsx)(R,{item:g,onUpdate:q})]})]}),(0,t.jsx)(y,{src:N,onClose:()=>k(null)})]}):(0,t.jsx)(ti.f,{icon:o,title:l.detail.notFound||"Item not found",className:"m-4 md:m-8"})}],204573)}]);