wrong-notebook 2026.11.4-2 → 2026.11.4-4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (850) hide show
  1. package/.next/BUILD_ID +1 -1
  2. package/.next/app-path-routes-manifest.json +1 -0
  3. package/.next/build-manifest.json +3 -3
  4. package/.next/routes-manifest.json +6 -0
  5. package/.next/server/app/_global-error.html +1 -1
  6. package/.next/server/app/_global-error.rsc +1 -1
  7. package/.next/server/app/_global-error.segments/__PAGE__.segment.rsc +1 -1
  8. package/.next/server/app/_global-error.segments/_full.segment.rsc +1 -1
  9. package/.next/server/app/_global-error.segments/_tree.segment.rsc +1 -1
  10. package/.next/server/app/_not-found/page.js.nft.json +1 -1
  11. package/.next/server/app/_not-found/page_client-reference-manifest.js +1 -1
  12. package/.next/server/app/admin/page.js.nft.json +1 -1
  13. package/.next/server/app/admin/page_client-reference-manifest.js +1 -1
  14. package/.next/server/app/admin/user/[id]/page.js.nft.json +1 -1
  15. package/.next/server/app/admin/user/[id]/page_client-reference-manifest.js +1 -1
  16. package/.next/server/app/api/admin/cnm-tags/route.js +8 -6
  17. package/.next/server/app/api/admin/cnm-tags/route.js.nft.json +1 -1
  18. package/.next/server/app/api/admin/dashboard/route.js +16 -14
  19. package/.next/server/app/api/admin/dashboard/route.js.nft.json +1 -1
  20. package/.next/server/app/api/admin/debug-logs/export/route.js +7 -6
  21. package/.next/server/app/api/admin/debug-logs/export/route.js.nft.json +1 -1
  22. package/.next/server/app/api/admin/debug-logs/route.js +6 -5
  23. package/.next/server/app/api/admin/debug-logs/route.js.nft.json +1 -1
  24. package/.next/server/app/api/admin/migrate-tags/route.js +5 -3
  25. package/.next/server/app/api/admin/migrate-tags/route.js.nft.json +1 -1
  26. package/.next/server/app/api/admin/system-reset/route.js +5 -5
  27. package/.next/server/app/api/admin/system-reset/route.js.nft.json +1 -1
  28. package/.next/server/app/api/admin/users/[id]/detail/route.js +16 -14
  29. package/.next/server/app/api/admin/users/[id]/detail/route.js.nft.json +1 -1
  30. package/.next/server/app/api/admin/users/[id]/route.js +7 -5
  31. package/.next/server/app/api/admin/users/[id]/route.js.nft.json +1 -1
  32. package/.next/server/app/api/admin/users/route.js +8 -7
  33. package/.next/server/app/api/admin/users/route.js.nft.json +1 -1
  34. package/.next/server/app/api/ai/models/route.js +15 -14
  35. package/.next/server/app/api/ai/models/route.js.nft.json +1 -1
  36. package/.next/server/app/api/ai/test/route.js +16 -13
  37. package/.next/server/app/api/ai/test/route.js.nft.json +1 -1
  38. package/.next/server/app/api/analytics/route.js +15 -14
  39. package/.next/server/app/api/analytics/route.js.nft.json +1 -1
  40. package/.next/server/app/api/analyze/route.js +20 -18
  41. package/.next/server/app/api/analyze/route.js.nft.json +1 -1
  42. package/.next/server/app/api/auth/[...nextauth]/route.js.nft.json +1 -1
  43. package/.next/server/app/api/error-items/[id]/delete/route.js +5 -5
  44. package/.next/server/app/api/error-items/[id]/delete/route.js.nft.json +1 -1
  45. package/.next/server/app/api/error-items/[id]/figure/route.js +20 -18
  46. package/.next/server/app/api/error-items/[id]/figure/route.js.nft.json +1 -1
  47. package/.next/server/app/api/error-items/[id]/fix-latex/route.js +18 -16
  48. package/.next/server/app/api/error-items/[id]/fix-latex/route.js.nft.json +1 -1
  49. package/.next/server/app/api/error-items/[id]/geogebra/route.js +20 -17
  50. package/.next/server/app/api/error-items/[id]/geogebra/route.js.nft.json +1 -1
  51. package/.next/server/app/api/error-items/[id]/image/route.js +6 -5
  52. package/.next/server/app/api/error-items/[id]/image/route.js.nft.json +1 -1
  53. package/.next/server/app/api/error-items/[id]/notes/route.js +8 -5
  54. package/.next/server/app/api/error-items/[id]/notes/route.js.nft.json +1 -1
  55. package/.next/server/app/api/error-items/[id]/practice-records/route.js +5 -4
  56. package/.next/server/app/api/error-items/[id]/practice-records/route.js.nft.json +1 -1
  57. package/.next/server/app/api/error-items/[id]/reanswer/route.js +18 -15
  58. package/.next/server/app/api/error-items/[id]/reanswer/route.js.nft.json +1 -1
  59. package/.next/server/app/api/error-items/[id]/retag/route.js +18 -16
  60. package/.next/server/app/api/error-items/[id]/retag/route.js.nft.json +1 -1
  61. package/.next/server/app/api/error-items/[id]/route.js +13 -9
  62. package/.next/server/app/api/error-items/[id]/route.js.nft.json +1 -1
  63. package/.next/server/app/api/error-items/[id]/svg-animation/narration/route.js +18 -15
  64. package/.next/server/app/api/error-items/[id]/svg-animation/narration/route.js.nft.json +1 -1
  65. package/.next/server/app/api/error-items/[id]/svg-animation/route.js +18 -15
  66. package/.next/server/app/api/error-items/[id]/svg-animation/route.js.nft.json +1 -1
  67. package/.next/server/app/api/error-items/answer-space/route.js +6 -6
  68. package/.next/server/app/api/error-items/answer-space/route.js.nft.json +1 -1
  69. package/.next/server/app/api/error-items/batch-delete/route.js +8 -5
  70. package/.next/server/app/api/error-items/batch-delete/route.js.nft.json +1 -1
  71. package/.next/server/app/api/error-items/clear/route.js +5 -5
  72. package/.next/server/app/api/error-items/clear/route.js.nft.json +1 -1
  73. package/.next/server/app/api/error-items/export-questions/route/app-paths-manifest.json +3 -0
  74. package/.next/server/app/api/error-items/export-questions/route/build-manifest.json +12 -0
  75. package/.next/server/app/api/error-items/export-questions/route/server-reference-manifest.json +4 -0
  76. package/.next/server/app/api/error-items/export-questions/route.js +17 -0
  77. package/.next/server/app/api/error-items/export-questions/route.js.map +5 -0
  78. package/.next/server/app/api/error-items/export-questions/route.js.nft.json +1 -0
  79. package/.next/server/app/api/error-items/export-questions/route_client-reference-manifest.js +3 -0
  80. package/.next/server/app/api/error-items/list/route.js +8 -7
  81. package/.next/server/app/api/error-items/list/route.js.nft.json +1 -1
  82. package/.next/server/app/api/error-items/route.js +22 -21
  83. package/.next/server/app/api/error-items/route.js.nft.json +1 -1
  84. package/.next/server/app/api/error-items/short/[shortId]/route.js +5 -4
  85. package/.next/server/app/api/error-items/short/[shortId]/route.js.nft.json +1 -1
  86. package/.next/server/app/api/error-items/similarity/route.js +4 -3
  87. package/.next/server/app/api/error-items/similarity/route.js.nft.json +1 -1
  88. package/.next/server/app/api/exams/[id]/questions/[questionId]/regenerate/route.js +20 -18
  89. package/.next/server/app/api/exams/[id]/questions/[questionId]/regenerate/route.js.nft.json +1 -1
  90. package/.next/server/app/api/exams/[id]/results/route.js +19 -18
  91. package/.next/server/app/api/exams/[id]/results/route.js.nft.json +1 -1
  92. package/.next/server/app/api/exams/[id]/retry/route.js +18 -17
  93. package/.next/server/app/api/exams/[id]/retry/route.js.nft.json +1 -1
  94. package/.next/server/app/api/exams/[id]/route.js +21 -19
  95. package/.next/server/app/api/exams/[id]/route.js.nft.json +1 -1
  96. package/.next/server/app/api/exams/route.js +20 -19
  97. package/.next/server/app/api/exams/route.js.nft.json +1 -1
  98. package/.next/server/app/api/export/route.js +9 -7
  99. package/.next/server/app/api/export/route.js.nft.json +1 -1
  100. package/.next/server/app/api/geogebra-analyze/route.js +18 -16
  101. package/.next/server/app/api/geogebra-analyze/route.js.nft.json +1 -1
  102. package/.next/server/app/api/health/route.js.nft.json +1 -1
  103. package/.next/server/app/api/import/route.js +22 -20
  104. package/.next/server/app/api/import/route.js.nft.json +1 -1
  105. package/.next/server/app/api/import-batches/[id]/confirm-all/route.js +25 -22
  106. package/.next/server/app/api/import-batches/[id]/confirm-all/route.js.nft.json +1 -1
  107. package/.next/server/app/api/import-batches/[id]/fix-text/route.js +19 -18
  108. package/.next/server/app/api/import-batches/[id]/fix-text/route.js.nft.json +1 -1
  109. package/.next/server/app/api/import-batches/[id]/read/route.js +27 -24
  110. package/.next/server/app/api/import-batches/[id]/read/route.js.nft.json +1 -1
  111. package/.next/server/app/api/import-batches/[id]/retry/route.js +25 -22
  112. package/.next/server/app/api/import-batches/[id]/retry/route.js.nft.json +1 -1
  113. package/.next/server/app/api/import-batches/[id]/route.js +27 -24
  114. package/.next/server/app/api/import-batches/[id]/route.js.nft.json +1 -1
  115. package/.next/server/app/api/import-batches/[id]/start/route.js +27 -24
  116. package/.next/server/app/api/import-batches/[id]/start/route.js.nft.json +1 -1
  117. package/.next/server/app/api/import-batches/route.js +27 -24
  118. package/.next/server/app/api/import-batches/route.js.nft.json +1 -1
  119. package/.next/server/app/api/import-tasks/[id]/confirm/route.js +25 -22
  120. package/.next/server/app/api/import-tasks/[id]/confirm/route.js.nft.json +1 -1
  121. package/.next/server/app/api/import-tasks/[id]/read/route.js +25 -22
  122. package/.next/server/app/api/import-tasks/[id]/read/route.js.nft.json +1 -1
  123. package/.next/server/app/api/import-tasks/[id]/retry/route.js +25 -22
  124. package/.next/server/app/api/import-tasks/[id]/retry/route.js.nft.json +1 -1
  125. package/.next/server/app/api/import-tasks/[id]/route.js +25 -22
  126. package/.next/server/app/api/import-tasks/[id]/route.js.nft.json +1 -1
  127. package/.next/server/app/api/import-tasks/route.js +27 -24
  128. package/.next/server/app/api/import-tasks/route.js.nft.json +1 -1
  129. package/.next/server/app/api/initialize/route.js +1 -1
  130. package/.next/server/app/api/initialize/route.js.nft.json +1 -1
  131. package/.next/server/app/api/logs/frontend/route.js +6 -4
  132. package/.next/server/app/api/logs/frontend/route.js.nft.json +1 -1
  133. package/.next/server/app/api/minimax-code/checkin/route.js +6 -5
  134. package/.next/server/app/api/minimax-code/checkin/route.js.nft.json +1 -1
  135. package/.next/server/app/api/minimax-code/login/route.js +6 -5
  136. package/.next/server/app/api/minimax-code/login/route.js.nft.json +1 -1
  137. package/.next/server/app/api/minimax-code/route.js +7 -6
  138. package/.next/server/app/api/minimax-code/route.js.nft.json +1 -1
  139. package/.next/server/app/api/notebooks/[id]/retag/route.js +18 -17
  140. package/.next/server/app/api/notebooks/[id]/retag/route.js.nft.json +1 -1
  141. package/.next/server/app/api/notebooks/[id]/route.js +8 -4
  142. package/.next/server/app/api/notebooks/[id]/route.js.nft.json +1 -1
  143. package/.next/server/app/api/notebooks/route.js +8 -6
  144. package/.next/server/app/api/notebooks/route.js.nft.json +1 -1
  145. package/.next/server/app/api/openclaw/batch-upload/route.js +21 -19
  146. package/.next/server/app/api/openclaw/batch-upload/route.js.nft.json +1 -1
  147. package/.next/server/app/api/paper-groups/[id]/route.js +5 -4
  148. package/.next/server/app/api/paper-groups/[id]/route.js.nft.json +1 -1
  149. package/.next/server/app/api/paper-groups/route.js +4 -3
  150. package/.next/server/app/api/paper-groups/route.js.nft.json +1 -1
  151. package/.next/server/app/api/practice/generate/route.js +18 -16
  152. package/.next/server/app/api/practice/generate/route.js.nft.json +1 -1
  153. package/.next/server/app/api/practice/grade/route.js +15 -13
  154. package/.next/server/app/api/practice/grade/route.js.nft.json +1 -1
  155. package/.next/server/app/api/practice/record/[id]/route.js +18 -16
  156. package/.next/server/app/api/practice/record/[id]/route.js.nft.json +1 -1
  157. package/.next/server/app/api/practice/record/route.js +16 -14
  158. package/.next/server/app/api/practice/record/route.js.nft.json +1 -1
  159. package/.next/server/app/api/reanswer/route.js +19 -17
  160. package/.next/server/app/api/reanswer/route.js.nft.json +1 -1
  161. package/.next/server/app/api/register/route.js +5 -5
  162. package/.next/server/app/api/register/route.js.nft.json +1 -1
  163. package/.next/server/app/api/register/status/route.js +5 -5
  164. package/.next/server/app/api/register/status/route.js.nft.json +1 -1
  165. package/.next/server/app/api/requests/[id]/route.js +5 -4
  166. package/.next/server/app/api/requests/[id]/route.js.nft.json +1 -1
  167. package/.next/server/app/api/review/due/route.js +17 -15
  168. package/.next/server/app/api/review/due/route.js.nft.json +1 -1
  169. package/.next/server/app/api/settings/route.js +8 -7
  170. package/.next/server/app/api/settings/route.js.nft.json +1 -1
  171. package/.next/server/app/api/setup/route.js +7 -6
  172. package/.next/server/app/api/setup/route.js.nft.json +1 -1
  173. package/.next/server/app/api/stats/activity/route.js +7 -6
  174. package/.next/server/app/api/stats/activity/route.js.nft.json +1 -1
  175. package/.next/server/app/api/stats/practice/clear/route.js +5 -5
  176. package/.next/server/app/api/stats/practice/clear/route.js.nft.json +1 -1
  177. package/.next/server/app/api/stats/practice/route.js +7 -6
  178. package/.next/server/app/api/stats/practice/route.js.nft.json +1 -1
  179. package/.next/server/app/api/stats/repeated-mistakes/route.js +17 -16
  180. package/.next/server/app/api/stats/repeated-mistakes/route.js.nft.json +1 -1
  181. package/.next/server/app/api/stats/weak-tags/route.js +17 -16
  182. package/.next/server/app/api/stats/weak-tags/route.js.nft.json +1 -1
  183. package/.next/server/app/api/tags/route.js +7 -4
  184. package/.next/server/app/api/tags/route.js.nft.json +1 -1
  185. package/.next/server/app/api/tags/stats/route.js +1 -1
  186. package/.next/server/app/api/tags/stats/route.js.nft.json +1 -1
  187. package/.next/server/app/api/tags/suggestions/route.js.nft.json +1 -1
  188. package/.next/server/app/api/tasks/route.js +5 -4
  189. package/.next/server/app/api/tasks/route.js.nft.json +1 -1
  190. package/.next/server/app/api/tts/[id]/route.js +9 -8
  191. package/.next/server/app/api/tts/[id]/route.js.nft.json +1 -1
  192. package/.next/server/app/api/tts/batch/route.js +10 -9
  193. package/.next/server/app/api/tts/batch/route.js.nft.json +1 -1
  194. package/.next/server/app/api/tts/route.js +11 -10
  195. package/.next/server/app/api/tts/route.js.nft.json +1 -1
  196. package/.next/server/app/api/tts/status/route.js +11 -10
  197. package/.next/server/app/api/tts/status/route.js.nft.json +1 -1
  198. package/.next/server/app/api/user/route.js +16 -15
  199. package/.next/server/app/api/user/route.js.nft.json +1 -1
  200. package/.next/server/app/api/version/route.js.nft.json +1 -1
  201. package/.next/server/app/error-items/[id]/page.js.nft.json +1 -1
  202. package/.next/server/app/error-items/[id]/page_client-reference-manifest.js +1 -1
  203. package/.next/server/app/exams/[id]/page.js.nft.json +1 -1
  204. package/.next/server/app/exams/[id]/page_client-reference-manifest.js +1 -1
  205. package/.next/server/app/exams/[id]/print/page.js.nft.json +1 -1
  206. package/.next/server/app/exams/[id]/print/page_client-reference-manifest.js +1 -1
  207. package/.next/server/app/exams/page.js.nft.json +1 -1
  208. package/.next/server/app/exams/page_client-reference-manifest.js +1 -1
  209. package/.next/server/app/import-batches/[id]/page.js.nft.json +1 -1
  210. package/.next/server/app/import-batches/[id]/page_client-reference-manifest.js +1 -1
  211. package/.next/server/app/import-tasks/[id]/page.js.nft.json +1 -1
  212. package/.next/server/app/import-tasks/[id]/page_client-reference-manifest.js +1 -1
  213. package/.next/server/app/import-tasks/page.js.nft.json +1 -1
  214. package/.next/server/app/import-tasks/page_client-reference-manifest.js +1 -1
  215. package/.next/server/app/initialize/page.js.nft.json +1 -1
  216. package/.next/server/app/initialize/page_client-reference-manifest.js +1 -1
  217. package/.next/server/app/login/page.js.nft.json +1 -1
  218. package/.next/server/app/login/page_client-reference-manifest.js +1 -1
  219. package/.next/server/app/notebooks/[id]/add/page.js.nft.json +1 -1
  220. package/.next/server/app/notebooks/[id]/add/page_client-reference-manifest.js +1 -1
  221. package/.next/server/app/notebooks/[id]/page.js.nft.json +1 -1
  222. package/.next/server/app/notebooks/[id]/page_client-reference-manifest.js +1 -1
  223. package/.next/server/app/notebooks/page.js.nft.json +1 -1
  224. package/.next/server/app/notebooks/page_client-reference-manifest.js +1 -1
  225. package/.next/server/app/page.js.nft.json +1 -1
  226. package/.next/server/app/page_client-reference-manifest.js +1 -1
  227. package/.next/server/app/practice/page.js.nft.json +1 -1
  228. package/.next/server/app/practice/page_client-reference-manifest.js +1 -1
  229. package/.next/server/app/print-preview/page.js.nft.json +1 -1
  230. package/.next/server/app/print-preview/page_client-reference-manifest.js +1 -1
  231. package/.next/server/app/register/page.js.nft.json +1 -1
  232. package/.next/server/app/register/page_client-reference-manifest.js +1 -1
  233. package/.next/server/app/review/page.js.nft.json +1 -1
  234. package/.next/server/app/review/page_client-reference-manifest.js +1 -1
  235. package/.next/server/app/setup/page.js.nft.json +1 -1
  236. package/.next/server/app/setup/page_client-reference-manifest.js +1 -1
  237. package/.next/server/app/stats/page.js.nft.json +1 -1
  238. package/.next/server/app/stats/page_client-reference-manifest.js +1 -1
  239. package/.next/server/app/tags/page.js.nft.json +1 -1
  240. package/.next/server/app/tags/page_client-reference-manifest.js +1 -1
  241. package/.next/server/app-paths-manifest.json +1 -0
  242. package/.next/server/chunks/1oeh_server_app_api_error-items_export-questions_route_actions_02nsquej76mp1.js +3 -0
  243. package/.next/server/chunks/[externals]__1j5vgk-wr4vpe._.js +3 -0
  244. package/.next/server/chunks/[externals]_fs_0pplqgcyv2l7l._.js +3 -0
  245. package/.next/server/chunks/[root-of-the-server]__0-d_vh1kcmw7g._.js +3 -0
  246. package/.next/server/chunks/[root-of-the-server]__001wdwos9fkgg._.js +3 -0
  247. package/.next/server/chunks/[root-of-the-server]__00cl_lnn-40t3._.js +3 -0
  248. package/.next/server/chunks/{[root-of-the-server]__05tyrbfzivoeq._.js → [root-of-the-server]__00w9qhjl8kvr4._.js} +1 -1
  249. package/.next/server/chunks/{[root-of-the-server]__01-14hxale6jz._.js → [root-of-the-server]__00w_kxg7h-9_p._.js} +1 -1
  250. package/.next/server/chunks/[root-of-the-server]__00x5ad3w5zwfp._.js +3 -0
  251. package/.next/server/chunks/{[root-of-the-server]__01rm65xnqj0z-._.js → [root-of-the-server]__01jxyfokd6l4_._.js} +1 -1
  252. package/.next/server/chunks/{[root-of-the-server]__02nbzp-n9g9_o._.js → [root-of-the-server]__025dluj5es8w4._.js} +1 -1
  253. package/.next/server/chunks/{[root-of-the-server]__09pkxauucdf_0._.js → [root-of-the-server]__02fu_lp66613e._.js} +2 -2
  254. package/.next/server/chunks/[root-of-the-server]__04w57bdna9ax0._.js +3 -0
  255. package/.next/server/chunks/{[root-of-the-server]__0z0knsep33lsx._.js → [root-of-the-server]__05a4j8yu5_bg1._.js} +2 -2
  256. package/.next/server/chunks/{[root-of-the-server]__006u92h_madgn._.js → [root-of-the-server]__05pxdy586nh8a._.js} +1 -1
  257. package/.next/server/chunks/{[root-of-the-server]__0n5l60oyv1n-1._.js → [root-of-the-server]__06i2kswg2zb80._.js} +1 -1
  258. package/.next/server/chunks/[root-of-the-server]__07i32k2sv285o._.js +3 -0
  259. package/.next/server/chunks/{[root-of-the-server]__0k4cyyyh6z6_p._.js → [root-of-the-server]__0855dkhk7zs77._.js} +2 -2
  260. package/.next/server/chunks/{[root-of-the-server]__0lqv0n5j2fg24._.js → [root-of-the-server]__08iizowhy6p3l._.js} +2 -2
  261. package/.next/server/chunks/{[root-of-the-server]__1eu_g0k_nr3i-._.js → [root-of-the-server]__094ybs6y_fmt5._.js} +2 -2
  262. package/.next/server/chunks/[root-of-the-server]__09aolocrwucnt._.js +3 -0
  263. package/.next/server/chunks/[root-of-the-server]__0_le78e9b2yno._.js +3 -0
  264. package/.next/server/chunks/[root-of-the-server]__0_uup9ppknahw._.js +3 -0
  265. package/.next/server/chunks/[root-of-the-server]__0b8rxaox_x2n1._.js +3 -0
  266. package/.next/server/chunks/[root-of-the-server]__0bvf731upd2_w._.js +3 -0
  267. package/.next/server/chunks/[root-of-the-server]__0cgpuhmu87blm._.js +3 -0
  268. package/.next/server/chunks/[root-of-the-server]__0dqy62vnjwvwp._.js +3 -0
  269. package/.next/server/chunks/{[root-of-the-server]__0bmczgpuggwki._.js → [root-of-the-server]__0ef-17j7yp2n5._.js} +1 -1
  270. package/.next/server/chunks/[root-of-the-server]__0ej9lsrmus5m4._.js +3 -0
  271. package/.next/server/chunks/[root-of-the-server]__0evv12a34qcy6._.js +27 -0
  272. package/.next/server/chunks/[root-of-the-server]__0fdkyswheen4o._.js +3 -0
  273. package/.next/server/chunks/{[root-of-the-server]__0eba9rni-2_tw._.js → [root-of-the-server]__0fhi9g3nqu6k3._.js} +1 -1
  274. package/.next/server/chunks/{[root-of-the-server]__0fx0s5_6sjw-d._.js → [root-of-the-server]__0g3w0_9__ljck._.js} +1 -1
  275. package/.next/server/chunks/[root-of-the-server]__0g848ha1gy56h._.js +3 -0
  276. package/.next/server/chunks/[root-of-the-server]__0hcbw1sliw973._.js +1 -1
  277. package/.next/server/chunks/[root-of-the-server]__0ig1r6paxqzt0._.js +3 -0
  278. package/.next/server/chunks/[root-of-the-server]__0j7ua4rsijb4c._.js +3 -0
  279. package/.next/server/chunks/[root-of-the-server]__0jh610iscvrmp._.js +3 -0
  280. package/.next/server/chunks/[root-of-the-server]__0kehix4ojdnhw._.js +1 -1
  281. package/.next/server/chunks/{[root-of-the-server]__0imuc7gi1ii-e._.js → [root-of-the-server]__0l3io0vyav4if._.js} +2 -2
  282. package/.next/server/chunks/[root-of-the-server]__0l7jho_lr2z5g._.js +3 -0
  283. package/.next/server/chunks/[root-of-the-server]__0lgbdth9-z6qg._.js +3 -0
  284. package/.next/server/chunks/[root-of-the-server]__0llbkrw8l2ib9._.js +3 -0
  285. package/.next/server/chunks/[root-of-the-server]__0mfr1ne23y4yo._.js +3 -0
  286. package/.next/server/chunks/{[root-of-the-server]__0geynfn2xmdle._.js → [root-of-the-server]__0mslax132s9jp._.js} +2 -2
  287. package/.next/server/chunks/[root-of-the-server]__0nin5p-dwlpf9._.js +3 -0
  288. package/.next/server/chunks/[root-of-the-server]__0nye-53zadylr._.js +3 -0
  289. package/.next/server/chunks/[root-of-the-server]__0p8cwd_go8pid._.js +3 -0
  290. package/.next/server/chunks/[root-of-the-server]__0pojh2d6n1kp6._.js +3 -0
  291. package/.next/server/chunks/[root-of-the-server]__0rspref34j958._.js +3 -0
  292. package/.next/server/chunks/[root-of-the-server]__0si2-m5an9zl7._.js +3 -0
  293. package/.next/server/chunks/[root-of-the-server]__0svdqovwfpro2._.js +3 -0
  294. package/.next/server/chunks/[root-of-the-server]__0tsi6_qmtro9q._.js +3 -0
  295. package/.next/server/chunks/[root-of-the-server]__0tvp4sm4zx3wt._.js +3 -0
  296. package/.next/server/chunks/[root-of-the-server]__0u1fu9dvxmlxd._.js +3 -0
  297. package/.next/server/chunks/[root-of-the-server]__0ujhx0glgcxja._.js +3 -0
  298. package/.next/server/chunks/{[root-of-the-server]__029n0r2v92pcc._.js → [root-of-the-server]__0v8mfczhz1ax1._.js} +2 -2
  299. package/.next/server/chunks/[root-of-the-server]__0vf3rgatj1f3u._.js +3 -0
  300. package/.next/server/chunks/[root-of-the-server]__0vrag-4p6eznc._.js +3 -0
  301. package/.next/server/chunks/[root-of-the-server]__0vt48u-0ebzdv._.js +3 -0
  302. package/.next/server/chunks/[root-of-the-server]__0w9f5-xtpane-._.js +3 -0
  303. package/.next/server/chunks/[root-of-the-server]__0wea836zkhvlj._.js +3 -0
  304. package/.next/server/chunks/[root-of-the-server]__0wex3czgya39o._.js +3 -0
  305. package/.next/server/chunks/[root-of-the-server]__0x8ehtaj_x2pf._.js +3 -0
  306. package/.next/server/chunks/[root-of-the-server]__0xobqdj2u2s67._.js +3 -0
  307. package/.next/server/chunks/[root-of-the-server]__0y3ui5-k9baec._.js +3 -0
  308. package/.next/server/chunks/[root-of-the-server]__0yq7jm5ja3r6t._.js +3 -0
  309. package/.next/server/chunks/[root-of-the-server]__0zrg03ldx65tk._.js +3 -0
  310. package/.next/server/chunks/[root-of-the-server]__1-1ld657rjip5._.js +3 -0
  311. package/.next/server/chunks/[root-of-the-server]__1-6r_3pmgkz13._.js +3 -0
  312. package/.next/server/chunks/[root-of-the-server]__10ngcci8pf29l._.js +3 -0
  313. package/.next/server/chunks/[root-of-the-server]__11-fk0-4iuf_k._.js +3 -0
  314. package/.next/server/chunks/[root-of-the-server]__11x5u4zg5i2c6._.js +3 -0
  315. package/.next/server/chunks/[root-of-the-server]__120o1w9mcwgta._.js +3 -0
  316. package/.next/server/chunks/[root-of-the-server]__12f6t_ozjtn42._.js +3 -0
  317. package/.next/server/chunks/[root-of-the-server]__13a3izu1xb4m4._.js +3 -0
  318. package/.next/server/chunks/{[root-of-the-server]__1kiolpvl5u4e-._.js → [root-of-the-server]__14e45mqzb1vjt._.js} +2 -2
  319. package/.next/server/chunks/[root-of-the-server]__14jf33wwjqbw1._.js +3 -0
  320. package/.next/server/chunks/[root-of-the-server]__14n0eki4tdk02._.js +3 -0
  321. package/.next/server/chunks/[root-of-the-server]__15a3t94ps7jx2._.js +3 -0
  322. package/.next/server/chunks/[root-of-the-server]__15dipxocczlvx._.js +3 -0
  323. package/.next/server/chunks/[root-of-the-server]__15r55xy6cyrg3._.js +3 -0
  324. package/.next/server/chunks/[root-of-the-server]__176zyagwjex4i._.js +3 -0
  325. package/.next/server/chunks/[root-of-the-server]__17ed9rw-rhun-._.js +3 -0
  326. package/.next/server/chunks/[root-of-the-server]__19kic_glbz32b._.js +3 -0
  327. package/.next/server/chunks/[root-of-the-server]__1ae5zzeo8_c2s._.js +3 -0
  328. package/.next/server/chunks/[root-of-the-server]__1b-acwmm5hhg0._.js +3 -0
  329. package/.next/server/chunks/[root-of-the-server]__1d6ftxzea6h0a._.js +3 -0
  330. package/.next/server/chunks/[root-of-the-server]__1dovdb1wrr_0e._.js +3 -0
  331. package/.next/server/chunks/[root-of-the-server]__1e7_e83zxstdw._.js +3 -0
  332. package/.next/server/chunks/[root-of-the-server]__1e81i8l09skcp._.js +3 -0
  333. package/.next/server/chunks/[root-of-the-server]__1e8_j43j1t1m3._.js +27 -0
  334. package/.next/server/chunks/[root-of-the-server]__1f-ve8idsq57l._.js +3 -0
  335. package/.next/server/chunks/[root-of-the-server]__1f0zocrmsd5p8._.js +3 -0
  336. package/.next/server/chunks/[root-of-the-server]__1f5_yaclxhuvj._.js +3 -0
  337. package/.next/server/chunks/[root-of-the-server]__1gf_vv57qtjh0._.js +3 -0
  338. package/.next/server/chunks/[root-of-the-server]__1h0tye6lfskvl._.js +3 -0
  339. package/.next/server/chunks/[root-of-the-server]__1hn69stngi4kc._.js +3 -0
  340. package/.next/server/chunks/[root-of-the-server]__1hnyj47zdzrxo._.js +3 -0
  341. package/.next/server/chunks/[root-of-the-server]__1k0fuhrt1iiad._.js +3 -0
  342. package/.next/server/chunks/[root-of-the-server]__1kxecl8v-_px5._.js +3 -0
  343. package/.next/server/chunks/[root-of-the-server]__1l6v9x8xm11pl._.js +3 -0
  344. package/.next/server/chunks/[root-of-the-server]__1m8m5io-tr21e._.js +3 -0
  345. package/.next/server/chunks/[root-of-the-server]__1pfhgjwnx_--j._.js +3 -0
  346. package/.next/server/chunks/[root-of-the-server]__1r5lj-ffov9r0._.js +3 -0
  347. package/.next/server/chunks/[root-of-the-server]__1rxi33p9h8zrj._.js +3 -0
  348. package/.next/server/chunks/[root-of-the-server]__1uqnotrppylmw._.js +3 -0
  349. package/.next/server/chunks/[root-of-the-server]__1utvl-1o6mb8y._.js +3 -0
  350. package/.next/server/chunks/[root-of-the-server]__1vc89u7_xxhyf._.js +3 -0
  351. package/.next/server/chunks/[root-of-the-server]__1x_kq-6h3utmo._.js +3 -0
  352. package/.next/server/chunks/[root-of-the-server]__1xqcu4ft3d7id._.js +3 -0
  353. package/.next/server/chunks/[root-of-the-server]__1xuw793xxu29t._.js +3 -0
  354. package/.next/server/chunks/[root-of-the-server]__1yaf9vp_o6cro._.js +3 -0
  355. package/.next/server/chunks/[root-of-the-server]__1ybmwcbaqk63j._.js +3 -0
  356. package/.next/server/chunks/[root-of-the-server]__1yyezurgy7e3k._.js +3 -0
  357. package/.next/server/chunks/[root-of-the-server]__1z4-5hlzq34fw._.js +3 -0
  358. package/.next/server/chunks/[root-of-the-server]__1z9hl9qdokxpu._.js +3 -0
  359. package/.next/server/chunks/_0-ne-bwuvd_6w._.js +1 -1
  360. package/.next/server/chunks/_011-ll5i30j2e._.js +1 -1
  361. package/.next/server/chunks/_01bayc6kg7upi._.js +1 -1
  362. package/.next/server/chunks/_029zt0rilrwvt._.js +1 -1
  363. package/.next/server/chunks/_03ovgh1-4xf3f._.js +1 -1
  364. package/.next/server/chunks/_0431fxnqiloso._.js +1 -1
  365. package/.next/server/chunks/_04vbgvl2gl5bc._.js +3 -0
  366. package/.next/server/chunks/_055vhdh_7iydn._.js +3 -0
  367. package/.next/server/chunks/_05ans30vcd4s-._.js +1 -1
  368. package/.next/server/chunks/{_04rjm4ctjqrba._.js → _06pseal2zu-71._.js} +2 -2
  369. package/.next/server/chunks/_076-jjzrfdsdk._.js +1 -1
  370. package/.next/server/chunks/_07amw8ha9rney._.js +1 -1
  371. package/.next/server/chunks/{_1fki7pamd4s-7._.js → _087uva8dkvxwz._.js} +2 -2
  372. package/.next/server/chunks/_08i9pskmlafnp._.js +1 -1
  373. package/.next/server/chunks/_09o9zamz75n5d._.js +1 -1
  374. package/.next/server/chunks/_0_3_65z6ak-5i._.js +1 -1
  375. package/.next/server/chunks/_0_5s2mrhxb3-u._.js +3 -0
  376. package/.next/server/chunks/_0_e736ff6uhew._.js +1 -1
  377. package/.next/server/chunks/_0anbzuivml30d._.js +1 -1
  378. package/.next/server/chunks/{_0edfmbz_jbxsu._.js → _0b9gke5b17vzh._.js} +2 -2
  379. package/.next/server/chunks/_0d66myj_8567o._.js +1 -1
  380. package/.next/server/chunks/_0gxi3zrkhyvx_._.js +1 -1
  381. package/.next/server/chunks/_0h1rbua_hqkox._.js +1 -1
  382. package/.next/server/chunks/_0hk9z9rqga4x-._.js +1 -1
  383. package/.next/server/chunks/_0i58-g30ox5-8._.js +3 -0
  384. package/.next/server/chunks/_0kjatc7pcrkvz._.js +1 -1
  385. package/.next/server/chunks/_0kreo-8xn80hb._.js +1 -1
  386. package/.next/server/chunks/_0l2j3br2g32zp._.js +1 -1
  387. package/.next/server/chunks/_0lepv-j_r8kfv._.js +3 -0
  388. package/.next/server/chunks/_0lmh33cdt_1fr._.js +1 -1
  389. package/.next/server/chunks/_0lob14xk0ko5z._.js +1 -1
  390. package/.next/server/chunks/_0mt2ctbvzfero._.js +1 -1
  391. package/.next/server/chunks/_0numcpxd_n25x._.js +3 -0
  392. package/.next/server/chunks/_0p-sas2zxy3iv._.js +1 -1
  393. package/.next/server/chunks/_0po48rvqz03dg._.js +1 -1
  394. package/.next/server/chunks/_0pzdohc1mz5ts._.js +1 -1
  395. package/.next/server/chunks/_0qaoat396e0_3._.js +1 -1
  396. package/.next/server/chunks/_0r8u30vd4lix4._.js +3 -0
  397. package/.next/server/chunks/_0r9ejvgz0l0-0._.js +1 -1
  398. package/.next/server/chunks/_0s8v0xiwcw6od._.js +3 -0
  399. package/.next/server/chunks/_0suqhfy3e5sv6._.js +1 -1
  400. package/.next/server/chunks/_0ta62b-tktnk8._.js +3 -0
  401. package/.next/server/chunks/{_03dn7v_h3d-v8._.js → _0tkov27xr068i._.js} +11 -7
  402. package/.next/server/chunks/_0tl0cy5j96d7h._.js +1 -1
  403. package/.next/server/chunks/_0tz5wpjdgntj3._.js +1 -1
  404. package/.next/server/chunks/_0wegi_sv1s4wx._.js +1 -1
  405. package/.next/server/chunks/_0xv7-7d6dyo9-._.js +1 -1
  406. package/.next/server/chunks/_0xx4y9tk1qclc._.js +1 -1
  407. package/.next/server/chunks/_0zs7jfzzshbfq._.js +1 -1
  408. package/.next/server/chunks/_11w6ynlxuzl55._.js +1 -1
  409. package/.next/server/chunks/_12fz_vwm9jemi._.js +3 -0
  410. package/.next/server/chunks/_12i51zlq-xxrl._.js +1 -1
  411. package/.next/server/chunks/_12w5k19rc45j_._.js +1 -1
  412. package/.next/server/chunks/_12xi_xqvtrn3k._.js +3 -0
  413. package/.next/server/chunks/_13ffmxv8qrwi0._.js +1 -1
  414. package/.next/server/chunks/_14w9nrdlajz24._.js +1 -1
  415. package/.next/server/chunks/_15fpgekhvv214._.js +1 -1
  416. package/.next/server/chunks/{_043-r529chcri._.js → _1638xaazsmf2m._.js} +11 -7
  417. package/.next/server/chunks/_1647rfjflw_iq._.js +1 -1
  418. package/.next/server/chunks/_16jdov0rxh99d._.js +1 -1
  419. package/.next/server/chunks/_17zw8m241gfs3._.js +1 -1
  420. package/.next/server/chunks/_18amra5328v90._.js +1 -1
  421. package/.next/server/chunks/_18hm5aaxkr500._.js +1 -1
  422. package/.next/server/chunks/_1_273cgnpyl9j._.js +1 -1
  423. package/.next/server/chunks/_1a1aqmie1d3u_._.js +1 -1
  424. package/.next/server/chunks/_1a1udq0c4_6ad._.js +1 -1
  425. package/.next/server/chunks/_1ab7h8-how0le._.js +3 -0
  426. package/.next/server/chunks/_1ahi8466v1b3l._.js +1 -1
  427. package/.next/server/chunks/_1almac7c09mp4._.js +3 -0
  428. package/.next/server/chunks/_1b-7g4thtxfnp._.js +3 -0
  429. package/.next/server/chunks/_1b0269xt-c8f7._.js +1 -1
  430. package/.next/server/chunks/_1b7qjlv0nxovi._.js +1 -1
  431. package/.next/server/chunks/_1be-y660a8z-q._.js +1 -1
  432. package/.next/server/chunks/_1cydcmia78z15._.js +1 -1
  433. package/.next/server/chunks/_1e8w9uuebtrcb._.js +1 -1
  434. package/.next/server/chunks/_1ev3hw7jrpp8r._.js +3 -0
  435. package/.next/server/chunks/_1gdet1v2zk2gy._.js +1 -1
  436. package/.next/server/chunks/_1hj7iit2u6xez._.js +1 -1
  437. package/.next/server/chunks/_1hp9mnz19v199._.js +1 -1
  438. package/.next/server/chunks/_1j10upti9l6da._.js +1 -1
  439. package/.next/server/chunks/_1j8kqz21_i728._.js +1 -1
  440. package/.next/server/chunks/_1lesklvhr_pfq._.js +3 -0
  441. package/.next/server/chunks/_1muwmr6j76v3m._.js +1 -1
  442. package/.next/server/chunks/_1pvqo-qnv-nqm._.js +1 -1
  443. package/.next/server/chunks/_1q65ai1_dwgjp._.js +1 -1
  444. package/.next/server/chunks/_1qcv4muwnx82-._.js +3 -0
  445. package/.next/server/chunks/_1s5-ldt8xhtpp._.js +1 -1
  446. package/.next/server/chunks/_1s55l1bx-1cxp._.js +1 -1
  447. package/.next/server/chunks/_1sp0xk1c5jx5r._.js +1 -1
  448. package/.next/server/chunks/_1srq5kxah38r6._.js +1 -1
  449. package/.next/server/chunks/_1t632kndbc0tj._.js +3 -0
  450. package/.next/server/chunks/_1tahh9ric8la3._.js +1 -1
  451. package/.next/server/chunks/_1tvl0cm629nyc._.js +1 -1
  452. package/.next/server/chunks/_1u6r2cuueltfn._.js +3 -0
  453. package/.next/server/chunks/{_1-6i59jd1zhly._.js → _1vddun9dxzaqo._.js} +11 -7
  454. package/.next/server/chunks/_1xpj9uk-9zhl8._.js +1 -1
  455. package/.next/server/chunks/_1xx5l4x084brt._.js +3 -0
  456. package/.next/server/chunks/_1z_ujac_e_65s._.js +1 -1
  457. package/.next/server/chunks/_1zbkha-v5mkk0._.js +3 -0
  458. package/.next/server/chunks/_1zvf_gki7-g0n._.js +1 -1
  459. package/.next/server/chunks/{_0r0hnbjdq-k9-._.js → _20snsd6f1xc63._.js} +2 -2
  460. package/.next/server/chunks/_20tjujotvor53._.js +1 -1
  461. package/.next/server/chunks/node_modules_zod_v4_classic_external_0qoqh-q5drsgn.js +4 -4
  462. package/.next/server/chunks/node_modules_zod_v4_classic_external_14kwlambv9opd.js +3 -0
  463. package/.next/server/chunks/node_modules_zod_v4_classic_external_17gmk506tz413.js +3 -0
  464. package/.next/server/chunks/node_modules_zod_v4_classic_external_1b_q1zc0x8d76.js +3 -0
  465. package/.next/server/chunks/node_modules_zod_v4_classic_external_1exeae-p81c94.js +3 -0
  466. package/.next/server/chunks/node_modules_zod_v4_classic_external_1giv406od1whf.js +3 -0
  467. package/.next/server/chunks/node_modules_zod_v4_classic_external_1wq100x5o7-hi.js +3 -0
  468. package/.next/server/chunks/node_modules_zod_v4_classic_external_1x8fhte3frhrw.js +3 -0
  469. package/.next/server/chunks/src_lib_0dxltm34zaclb._.js +3 -0
  470. package/.next/server/chunks/src_lib_0g4wu08m-gibu._.js +3 -0
  471. package/.next/server/chunks/src_lib_0l0j89xrerf8m._.js +3 -0
  472. package/.next/server/chunks/src_lib_0osgsup3n2ypg._.js +3 -0
  473. package/.next/server/chunks/src_lib_0so-2topfosjo._.js +3 -0
  474. package/.next/server/chunks/src_lib_0whd_w99i5vmm._.js +3 -0
  475. package/.next/server/chunks/src_lib_0z4je8wchtdws._.js +3 -0
  476. package/.next/server/chunks/src_lib_0zeksho3data7._.js +3 -0
  477. package/.next/server/chunks/src_lib_15op6xa369-51._.js +3 -0
  478. package/.next/server/chunks/src_lib_1_m3-y2t3e4xi._.js +143 -131
  479. package/.next/server/chunks/src_lib_1d0nldjpxxl8t._.js +3 -0
  480. package/.next/server/chunks/src_lib_1d99xj4d-pofa._.js +3 -0
  481. package/.next/server/chunks/src_lib_1v7rk87xys5cb._.js +3 -0
  482. package/.next/server/chunks/src_lib_1w0niu4i8hnaq._.js +3 -0
  483. package/.next/server/chunks/src_lib_ai_index_ts_0m0hlq4d9zy9i._.js +1 -1
  484. package/.next/server/chunks/src_lib_exam_1vzmn90_kh7eg._.js +3 -0
  485. package/.next/server/chunks/src_lib_exam_exam_ts_18c3t7bnr1z5k._.js +3 -0
  486. package/.next/server/chunks/src_lib_import_import-batches_ts_0nq3mn0v5uj28._.js +5 -0
  487. package/.next/server/chunks/src_lib_import_import-tasks_ts_01f-g_upv7llt._.js +3 -0
  488. package/.next/server/chunks/src_lib_mastery-status_ts_0e9jnp-14tby5._.js +3 -0
  489. package/.next/server/chunks/src_lib_minimax-code_checkin_ts_1j1mpuxc1vgoz._.js +1 -1
  490. package/.next/server/chunks/src_lib_notebook-scope_ts_06eipvr6xztlf._.js +3 -0
  491. package/.next/server/chunks/src_lib_question_0uw17e6at-i_h._.js +3 -0
  492. package/.next/server/chunks/src_lib_question_question-analysis_ts_1-3x2cfxlr3fs._.js +3 -0
  493. package/.next/server/chunks/src_lib_question_question-deduplication_ts_0gumctesi3szc._.js +3 -0
  494. package/.next/server/chunks/src_lib_recoverable-response_ts_00y54idhlj_0e._.js +3 -0
  495. package/.next/server/chunks/src_lib_schemas_error-items_ts_0vdof4417rd3y._.js +3 -0
  496. package/.next/server/chunks/src_lib_short-id_0adg7-htn2dq_._.js +3 -0
  497. package/.next/server/chunks/src_lib_svg-animation_ts_0-noskwg6sysg._.js +3 -0
  498. package/.next/server/chunks/src_lib_tags_retag_ts_09s5xwrzcy144._.js +3 -0
  499. package/.next/server/chunks/src_lib_tags_seed_1_ej3w-2450a0._.js +3 -0
  500. package/.next/server/chunks/src_lib_tts_19zri-v8-l_4u._.js +1 -1
  501. package/.next/server/chunks/ssr/[root-of-the-server]__032-uso7x2eqk._.js +3 -0
  502. package/.next/server/chunks/ssr/[root-of-the-server]__0ks-9bza_y-tn._.js +3 -0
  503. package/.next/server/chunks/ssr/[root-of-the-server]__0te5kr0_7nmrv._.js +3 -0
  504. package/.next/server/chunks/ssr/[root-of-the-server]__0uezowk-9l0x4._.js +3 -0
  505. package/.next/server/chunks/ssr/[root-of-the-server]__0x4us8rfvt68s._.js +3 -0
  506. package/.next/server/chunks/ssr/{[root-of-the-server]__0mqo18mv_ooyq._.js → [root-of-the-server]__0xjcdrflb40xr._.js} +2 -2
  507. package/.next/server/chunks/ssr/{[root-of-the-server]__0x_ihemma9171._.js → [root-of-the-server]__0z7upqzuqtse6._.js} +2 -2
  508. package/.next/server/chunks/ssr/[root-of-the-server]__10y8dor72926b._.js +3 -0
  509. package/.next/server/chunks/ssr/[root-of-the-server]__12jk2bmesr4gc._.js +3 -0
  510. package/.next/server/chunks/ssr/[root-of-the-server]__1rrcp_77jpv98._.js +3 -0
  511. package/.next/server/chunks/ssr/_05k02824g2tpo._.js +3 -0
  512. package/.next/server/chunks/ssr/_0cmd1ubdlo_by._.js +1 -1
  513. package/.next/server/chunks/ssr/_0fp_p60hb9ex8._.js +3 -0
  514. package/.next/server/chunks/ssr/_0gsk7ce3mjc-h._.js +3 -0
  515. package/.next/server/chunks/ssr/_0haie2cnycj6w._.js +32 -0
  516. package/.next/server/chunks/ssr/{_01qu892bisrf0._.js → _0j-r3zhz2ucmg._.js} +2 -2
  517. package/.next/server/chunks/ssr/_0m1jjbrzk71io._.js +3 -0
  518. package/.next/server/chunks/ssr/_0mvuvawj5-r--._.js +1 -1
  519. package/.next/server/chunks/ssr/_0rd-teluypcd2._.js +1 -1
  520. package/.next/server/chunks/ssr/_0xlbgtld9_r3o._.js +3 -0
  521. package/.next/server/chunks/ssr/{_186fwf-hcr_ua._.js → _101w__e2w9gr0._.js} +2 -2
  522. package/.next/server/chunks/ssr/_126p5i1ynlykc._.js +3 -0
  523. package/.next/server/chunks/ssr/_127aw5h992s9d._.js +4 -0
  524. package/.next/server/chunks/ssr/_19hxsrrruepym._.js +1 -1
  525. package/.next/server/chunks/ssr/_1bhvzfiuz3s7j._.js +3 -0
  526. package/.next/server/chunks/ssr/_1d3pxsso6zv_w._.js +3 -0
  527. package/.next/server/chunks/ssr/_1hp3fw-gk2r-3._.js +3 -0
  528. package/.next/server/chunks/ssr/_1k45xb7mu-emd._.js +3 -0
  529. package/.next/server/chunks/ssr/_1lltqgoq4vqfe._.js +3 -0
  530. package/.next/server/chunks/ssr/_1ore70w45768b._.js +3 -0
  531. package/.next/server/chunks/ssr/{_1xv0q8o3g3r5d._.js → _1s3gqrczubor-._.js} +2 -2
  532. package/.next/server/chunks/ssr/_1t-o815u40ng2._.js +3 -0
  533. package/.next/server/chunks/ssr/{_1pdnzaad7hk0d._.js → _1x_zn17exkc4t._.js} +2 -2
  534. package/.next/server/chunks/ssr/_1yclgq1umgl4p._.js +4 -0
  535. package/.next/server/chunks/ssr/node_modules_08vtqzu_wfcb5._.js +3 -0
  536. package/.next/server/chunks/ssr/node_modules_0y-9u3ez_29oz._.js +3 -0
  537. package/.next/server/chunks/ssr/node_modules_109z-y1z_gtxg._.js +3 -0
  538. package/.next/server/chunks/ssr/node_modules_docx_dist_index_mjs_07znba89yz2vi._.js +3 -0
  539. package/.next/server/chunks/ssr/{node_modules_heic-to_dist_csp_heic-to_0byqh-lbfcigr.js → node_modules_heic-to_dist_csp_heic-to_1_jdv4y0yz52i.js} +1 -1
  540. 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_1zqrtb3kykd7q.js} +1 -1
  541. package/.next/server/chunks/ssr/node_modules_lucide-react_dist_esm_icons_printer_mjs_0jbt269gi19_7._.js +3 -0
  542. package/.next/server/chunks/ssr/node_modules_pdfjs-dist_build_pdf_mjs_0z37jkkqfce7_._.js +47 -0
  543. package/.next/server/chunks/ssr/node_modules_read-excel-file_universal_index_0ayslfrutmja5.js +3 -0
  544. package/.next/server/chunks/ssr/node_modules_write-excel-file_browser_index_0l2-di6rcng1b.js +3 -0
  545. package/.next/server/chunks/ssr/node_modules_zod_v4_classic_external_0veaboc415l0m.js +3 -3
  546. package/.next/server/chunks/ssr/src_0_qzoo_03n_v-._.js +3 -0
  547. package/.next/server/chunks/ssr/src_130ww76krpws_._.js +1 -1
  548. package/.next/server/chunks/ssr/src_1gayunqs8u2e2._.js +1 -1
  549. package/.next/server/chunks/ssr/src_1nbi4yrww3r1m._.js +3 -0
  550. package/.next/server/chunks/ssr/{src_1jhctayt9gxoc._.js → src_1o5f_wr8vv-x0._.js} +2 -2
  551. package/.next/server/chunks/ssr/src_1rmus42s388dk._.js +3 -0
  552. package/.next/server/chunks/ssr/src_1seqsa8jiwu83._.js +3 -0
  553. package/.next/server/chunks/ssr/src_1xvnkkhvub372._.js +1 -1
  554. package/.next/server/chunks/ssr/src_app_error-items_[id]_page_tsx_04xwwdmyh7_9q._.js +1 -1
  555. package/.next/server/chunks/ssr/src_app_exams_[id]_page_tsx_0xcjflkgkwzgd._.js +1 -1
  556. package/.next/server/chunks/ssr/src_app_exams_[id]_print_page_tsx_1i-xvhk8ul1l1._.js +11 -6
  557. package/.next/server/chunks/ssr/src_app_exams_page_tsx_17_d4_gy2i1ds._.js +1 -1
  558. package/.next/server/chunks/ssr/src_app_import-batches_[id]_page_tsx_0mhg_vriwmkkw._.js +1 -1
  559. package/.next/server/chunks/ssr/src_app_import-tasks_[id]_page_tsx_0_grj11-jdqqc._.js +1 -1
  560. package/.next/server/chunks/ssr/src_app_import-tasks_page_tsx_01983hytm-x08._.js +1 -1
  561. package/.next/server/chunks/ssr/src_app_notebooks_[id]_add_page_tsx_179tow1ql6vc_._.js +1 -1
  562. package/.next/server/chunks/ssr/src_app_notebooks_[id]_page_tsx_08njm-5-txm8_._.js +1 -1
  563. package/.next/server/chunks/ssr/src_app_notebooks_page_tsx_1p9src5gnz_40._.js +1 -1
  564. package/.next/server/chunks/ssr/src_app_page_tsx_1chiuahujsxm1._.js +6 -1
  565. package/.next/server/chunks/ssr/src_app_print-preview_page_tsx_001yt-fzrj7tf._.js +1 -1
  566. package/.next/server/chunks/ssr/src_components_correction-editor_tsx_1p7z02t66tndx._.js +3 -3
  567. package/.next/server/chunks/ssr/src_components_error-list_error-item-card_tsx_1zsiqsrj-jjd7._.js +1 -1
  568. package/.next/server/chunks/ssr/src_components_exam_exam-figure-scale-bar_tsx_1dxk6lzvp_d28._.js +1 -1
  569. package/.next/server/chunks/ssr/src_components_import-tasks_import-task-card_tsx_01r47qh8ryspb._.js +1 -1
  570. package/.next/server/chunks/ssr/src_components_providers_tsx_09kw-mv3nb6xs._.js +15 -10
  571. package/.next/server/chunks/ssr/src_components_ui_switch_tsx_054tyo61pehla._.js +3 -0
  572. package/.next/server/chunks/ssr/src_lib_0773v8b5gb93o._.js +9 -0
  573. package/.next/server/chunks/ssr/src_lib_1qhs590-z9xnh._.js +9 -0
  574. package/.next/server/chunks/ssr/src_lib_1z8akixo3j8ti._.js +9 -0
  575. package/.next/server/chunks/ssr/src_lib_api-client_ts_04r2_ex-gua5i._.js +1 -1
  576. package/.next/server/chunks/ssr/src_lib_i18n_en_ts_08zkpwnoqey5s._.js +3 -0
  577. package/.next/server/chunks/ssr/src_lib_short-id_short-id-client_ts_03nnd3s0tat3l._.js +3 -0
  578. package/.next/server/middleware-build-manifest.js +3 -3
  579. package/.next/server/pages/500.html +1 -1
  580. package/.next/static/chunks/01zokrwums-fz.js +55 -0
  581. package/.next/static/chunks/{1pdlii0oox0-7.js → 037g92rz3qjm_.js} +1 -1
  582. package/.next/static/chunks/040et8v6_v-s6.js +1 -0
  583. package/.next/static/chunks/{2cfz0fumc6ghe.js → 045cs_rolnmjd.js} +1 -1
  584. package/.next/static/chunks/079f88y9j6sf-.js +45 -0
  585. package/.next/static/chunks/0g1lk2opoyqly.js +1 -0
  586. package/.next/static/chunks/0ge9zqd21b4xd.js +15 -0
  587. package/.next/static/chunks/0gu34v572tj7o.js +1 -0
  588. package/.next/static/chunks/0mnb66hvp3czv.js +2 -0
  589. package/.next/static/chunks/0mun2h4uaj4eh.js +1 -0
  590. package/.next/static/chunks/{02wft51kf3t9f.js → 0ovv_fq59i4y4.js} +1 -1
  591. package/.next/static/chunks/0sl4wa-ghh5g7.js +2 -0
  592. package/.next/static/chunks/0xbohpfp7x9jn.js +1 -0
  593. package/.next/static/chunks/{31-r0kqqw-wfd.js → 0xwz3h9d_e7kb.js} +1 -1
  594. package/.next/static/chunks/{0_xcjg47jv3ur.js → 1-qu_z3i5b8ul.js} +1 -1
  595. package/.next/static/chunks/10hk15u8jc7o1.js +38 -0
  596. package/.next/static/chunks/113lhm-f9le_y.js +2 -0
  597. package/.next/static/chunks/{42rupczfyygo1.js → 15zro21ycjjle.js} +1 -1
  598. package/.next/static/chunks/{3difxy8vzqlxn.js → 1fmrzsulv-ddd.js} +1 -1
  599. package/.next/static/chunks/{3fh32b9da9l_5.js → 1k2m_f0nu22fb.js} +1 -1
  600. package/.next/static/chunks/1uso50ewx5j8v.js +1 -0
  601. package/.next/static/chunks/1vtq_er8xir3c.css +3 -0
  602. package/.next/static/chunks/1y0cjudvnz4la.js +6 -0
  603. package/.next/static/chunks/20f7m1txoey_w.js +1 -0
  604. package/.next/static/chunks/21ghhv1twe4or.js +12 -0
  605. package/.next/static/chunks/23h8i_poncr7i.js +1 -0
  606. package/.next/static/chunks/28bc-wd48lcls.js +1 -0
  607. package/.next/static/chunks/2acga0__tn9yl.js +1 -0
  608. package/.next/static/chunks/2j3bisradcgfv.js +1 -0
  609. package/.next/static/chunks/2lhxk-8dpncxq.js +1 -0
  610. package/.next/static/chunks/2xww3vrggzkc3.js +15 -0
  611. package/.next/static/chunks/3-5otbeiq86n5.js +1 -0
  612. package/.next/static/chunks/31uxxyexyu66p.js +198 -0
  613. package/.next/static/chunks/33z7oz1790x50.js +1 -0
  614. package/.next/static/chunks/37309r9ttt-oa.js +1 -0
  615. package/.next/static/chunks/3_w-p8241f5rv.js +1 -0
  616. package/.next/static/chunks/{1uaqnxl-xshw6.js → 3f9t8cne6yfyl.js} +1 -1
  617. package/.next/static/chunks/{3wch6vphcivq5.js → 3j92h-4k4_o_f.js} +1 -1
  618. package/.next/static/chunks/3jkntcd5fwsid.js +1 -0
  619. package/.next/static/chunks/3ldaxwwj8i1r_.js +9 -0
  620. package/.next/static/chunks/3nq-bgq8lumv9.js +1 -0
  621. package/.next/static/chunks/{4441xuc3i-yb7.js → 3rnbnqcge4lza.js} +1 -1
  622. package/.next/static/chunks/3t9tbm4atwmw8.js +1 -0
  623. package/.next/static/chunks/3u-qpv02dkpmu.js +1 -0
  624. package/.next/static/chunks/438pvifm_o4g_.js +1 -0
  625. package/.next/static/media/pdf.worker.min.0zcq5mj7t-qsr.mjs +28 -0
  626. package/dist-scripts/scripts/rebuild-system-tags.js +11 -107
  627. package/dist-scripts/scripts/seed-chinese-primary.js +1 -1
  628. package/dist-scripts/src/lib/logger.js +1 -0
  629. package/dist-scripts/src/lib/tags/seed/rebuild.js +103 -0
  630. package/dist-scripts/src/lib/{seed-chinese-tags.js → tags/seed/seed-chinese-tags.js} +2 -1
  631. package/package.json +1 -1
  632. package/prisma/migrations/20261104033404_add_question_type/migration.sql +2 -0
  633. package/prisma/migrations/20261104040208_exam_question_score/migration.sql +2 -0
  634. package/prisma/migrations/20261104044246_exam_group_by_question_type/migration.sql +29 -0
  635. package/prisma/schema.prisma +7 -0
  636. package/prisma/seed.db +0 -0
  637. package/.next/server/chunks/[root-of-the-server]__012pau7crikop._.js +0 -3
  638. package/.next/server/chunks/[root-of-the-server]__01jc87mm42cex._.js +0 -3
  639. package/.next/server/chunks/[root-of-the-server]__01newhoirvvb2._.js +0 -3
  640. package/.next/server/chunks/[root-of-the-server]__02oqd6w58wymi._.js +0 -3
  641. package/.next/server/chunks/[root-of-the-server]__057qz9ucs7lib._.js +0 -3
  642. package/.next/server/chunks/[root-of-the-server]__06_pvs6rg70ri._.js +0 -3
  643. package/.next/server/chunks/[root-of-the-server]__06jad9cnzeci-._.js +0 -3
  644. package/.next/server/chunks/[root-of-the-server]__0_uvtfu0yr-na._.js +0 -27
  645. package/.next/server/chunks/[root-of-the-server]__0_vinl1oembls._.js +0 -3
  646. package/.next/server/chunks/[root-of-the-server]__0ahni9caaouya._.js +0 -3
  647. package/.next/server/chunks/[root-of-the-server]__0aq01totjzgkp._.js +0 -3
  648. package/.next/server/chunks/[root-of-the-server]__0b5mh_vi6e246._.js +0 -3
  649. package/.next/server/chunks/[root-of-the-server]__0b5qyqwq6mk5v._.js +0 -3
  650. package/.next/server/chunks/[root-of-the-server]__0b79cd6lae7ep._.js +0 -3
  651. package/.next/server/chunks/[root-of-the-server]__0b_zf20owrv7l._.js +0 -3
  652. package/.next/server/chunks/[root-of-the-server]__0cel4yig3zcho._.js +0 -3
  653. package/.next/server/chunks/[root-of-the-server]__0cu5jz9b3f0i1._.js +0 -3
  654. package/.next/server/chunks/[root-of-the-server]__0d818ux928r5h._.js +0 -3
  655. package/.next/server/chunks/[root-of-the-server]__0dclcdg0hwxxj._.js +0 -3
  656. package/.next/server/chunks/[root-of-the-server]__0e13o3ny66zb3._.js +0 -3
  657. package/.next/server/chunks/[root-of-the-server]__0fg20m1i6x4y9._.js +0 -3
  658. package/.next/server/chunks/[root-of-the-server]__0fhy87hr0_glw._.js +0 -3
  659. package/.next/server/chunks/[root-of-the-server]__0fnte1x8xdn5o._.js +0 -3
  660. package/.next/server/chunks/[root-of-the-server]__0glupa52ge074._.js +0 -3
  661. package/.next/server/chunks/[root-of-the-server]__0gphporvvjc0d._.js +0 -3
  662. package/.next/server/chunks/[root-of-the-server]__0gs7-3gi0pdws._.js +0 -3
  663. package/.next/server/chunks/[root-of-the-server]__0i2mt6zjxbq--._.js +0 -3
  664. package/.next/server/chunks/[root-of-the-server]__0ijq_d0gr5zo8._.js +0 -3
  665. package/.next/server/chunks/[root-of-the-server]__0iqp1f0-yvbhw._.js +0 -3
  666. package/.next/server/chunks/[root-of-the-server]__0jk-9m6ra-_um._.js +0 -3
  667. package/.next/server/chunks/[root-of-the-server]__0jvusk64khb-a._.js +0 -3
  668. package/.next/server/chunks/[root-of-the-server]__0k0c90ih7n0te._.js +0 -3
  669. package/.next/server/chunks/[root-of-the-server]__0maxg52nxqrzi._.js +0 -3
  670. package/.next/server/chunks/[root-of-the-server]__0ml-m3il4unb6._.js +0 -3
  671. package/.next/server/chunks/[root-of-the-server]__0nkrql6or-tf_._.js +0 -3
  672. package/.next/server/chunks/[root-of-the-server]__0nujsu6qbn-8o._.js +0 -27
  673. package/.next/server/chunks/[root-of-the-server]__0ovdiut1h8kkt._.js +0 -3
  674. package/.next/server/chunks/[root-of-the-server]__0p5_lv_pjxr5f._.js +0 -3
  675. package/.next/server/chunks/[root-of-the-server]__0p8wlug4uvmvi._.js +0 -3
  676. package/.next/server/chunks/[root-of-the-server]__0ptn9j1rleieh._.js +0 -3
  677. package/.next/server/chunks/[root-of-the-server]__0r7f34_38kmvk._.js +0 -3
  678. package/.next/server/chunks/[root-of-the-server]__0u3m78xhq8b3l._.js +0 -3
  679. package/.next/server/chunks/[root-of-the-server]__0ualui9b50ufh._.js +0 -3
  680. package/.next/server/chunks/[root-of-the-server]__0ujfft7untkmq._.js +0 -3
  681. package/.next/server/chunks/[root-of-the-server]__0vw7u-y__gk7p._.js +0 -3
  682. package/.next/server/chunks/[root-of-the-server]__0w53aflmo1keg._.js +0 -3
  683. package/.next/server/chunks/[root-of-the-server]__0wdjzoxwwh6bn._.js +0 -3
  684. package/.next/server/chunks/[root-of-the-server]__0wx65sza19ou-._.js +0 -3
  685. package/.next/server/chunks/[root-of-the-server]__0xj_313186tqc._.js +0 -3
  686. package/.next/server/chunks/[root-of-the-server]__0yv_kznxz5qzn._.js +0 -3
  687. package/.next/server/chunks/[root-of-the-server]__0zldj8zxo-hvc._.js +0 -3
  688. package/.next/server/chunks/[root-of-the-server]__1-djdd7tnb-n7._.js +0 -3
  689. package/.next/server/chunks/[root-of-the-server]__109pj952qxtan._.js +0 -3
  690. package/.next/server/chunks/[root-of-the-server]__10gp75p89v9a2._.js +0 -3
  691. package/.next/server/chunks/[root-of-the-server]__111jxitdjhuoj._.js +0 -3
  692. package/.next/server/chunks/[root-of-the-server]__112w8xm57okk5._.js +0 -3
  693. package/.next/server/chunks/[root-of-the-server]__12h4ckd6f76pb._.js +0 -3
  694. package/.next/server/chunks/[root-of-the-server]__12ig6-5hpb7s-._.js +0 -3
  695. package/.next/server/chunks/[root-of-the-server]__13_k7w8nrx7ie._.js +0 -3
  696. package/.next/server/chunks/[root-of-the-server]__14c50fhuh_abo._.js +0 -3
  697. package/.next/server/chunks/[root-of-the-server]__14jpfgwnpc9gl._.js +0 -3
  698. package/.next/server/chunks/[root-of-the-server]__14m8fewwq1xs6._.js +0 -3
  699. package/.next/server/chunks/[root-of-the-server]__15qkqztuygnfg._.js +0 -3
  700. package/.next/server/chunks/[root-of-the-server]__166997w1su5wq._.js +0 -3
  701. package/.next/server/chunks/[root-of-the-server]__16xl11-irmhu3._.js +0 -3
  702. package/.next/server/chunks/[root-of-the-server]__19i64i9v32y8o._.js +0 -3
  703. package/.next/server/chunks/[root-of-the-server]__19jqc7tzna13p._.js +0 -3
  704. package/.next/server/chunks/[root-of-the-server]__1asgy7sah0mo6._.js +0 -3
  705. package/.next/server/chunks/[root-of-the-server]__1av1l48rnghpa._.js +0 -3
  706. package/.next/server/chunks/[root-of-the-server]__1azaa45m60iqm._.js +0 -3
  707. package/.next/server/chunks/[root-of-the-server]__1d159cxbdta68._.js +0 -3
  708. package/.next/server/chunks/[root-of-the-server]__1dmp3ynxbcyjz._.js +0 -3
  709. package/.next/server/chunks/[root-of-the-server]__1dom1le7wqh7d._.js +0 -3
  710. package/.next/server/chunks/[root-of-the-server]__1e5tjfwab0exu._.js +0 -3
  711. package/.next/server/chunks/[root-of-the-server]__1f-7-l2abs15s._.js +0 -3
  712. package/.next/server/chunks/[root-of-the-server]__1fe2v2mv5-rgo._.js +0 -3
  713. package/.next/server/chunks/[root-of-the-server]__1fepss7g57apj._.js +0 -3
  714. package/.next/server/chunks/[root-of-the-server]__1ff3h7ockrpdf._.js +0 -3
  715. package/.next/server/chunks/[root-of-the-server]__1g11271g0z55n._.js +0 -3
  716. package/.next/server/chunks/[root-of-the-server]__1g6jrwm72xr8a._.js +0 -3
  717. package/.next/server/chunks/[root-of-the-server]__1he8kk4382-0h._.js +0 -3
  718. package/.next/server/chunks/[root-of-the-server]__1hk5kgctlp2wn._.js +0 -3
  719. package/.next/server/chunks/[root-of-the-server]__1j44_t992y-1-._.js +0 -3
  720. package/.next/server/chunks/[root-of-the-server]__1k4f33-z95_7c._.js +0 -3
  721. package/.next/server/chunks/[root-of-the-server]__1k4pnhbw4rgzs._.js +0 -3
  722. package/.next/server/chunks/[root-of-the-server]__1kx3a0dm7l2wl._.js +0 -3
  723. package/.next/server/chunks/[root-of-the-server]__1lea5m7hl1n7f._.js +0 -3
  724. package/.next/server/chunks/[root-of-the-server]__1m7pja8jp27eh._.js +0 -3
  725. package/.next/server/chunks/[root-of-the-server]__1m_y4afrn94oy._.js +0 -3
  726. package/.next/server/chunks/[root-of-the-server]__1ruzcenko2gi1._.js +0 -3
  727. package/.next/server/chunks/[root-of-the-server]__1sf2oa2wkqf_0._.js +0 -3
  728. package/.next/server/chunks/[root-of-the-server]__1t6aypqxgjkg_._.js +0 -3
  729. package/.next/server/chunks/[root-of-the-server]__1tffqae521gxo._.js +0 -3
  730. package/.next/server/chunks/[root-of-the-server]__1to25zgnk7xk-._.js +0 -3
  731. package/.next/server/chunks/[root-of-the-server]__1u5c7agj_phnb._.js +0 -3
  732. package/.next/server/chunks/[root-of-the-server]__1vbof6uu4he_-._.js +0 -3
  733. package/.next/server/chunks/[root-of-the-server]__1wfhdwfdvc6j3._.js +0 -3
  734. package/.next/server/chunks/[root-of-the-server]__1y0n2tg-0l636._.js +0 -3
  735. package/.next/server/chunks/[root-of-the-server]__1zc0bmdyn1lg4._.js +0 -3
  736. package/.next/server/chunks/[root-of-the-server]__1zqfz2rc4i280._.js +0 -3
  737. package/.next/server/chunks/[root-of-the-server]__207c97dbcdb0z._.js +0 -3
  738. package/.next/server/chunks/[root-of-the-server]__20cdqectwle3j._.js +0 -3
  739. package/.next/server/chunks/[root-of-the-server]__20dy4zclqbnw8._.js +0 -3
  740. package/.next/server/chunks/[root-of-the-server]__212aaltyh6kc2._.js +0 -3
  741. package/.next/server/chunks/_01y7-j4vx6cu5._.js +0 -3
  742. package/.next/server/chunks/_0_rhee7wb6tcg._.js +0 -3
  743. package/.next/server/chunks/_0at03z7sgwdv3._.js +0 -3
  744. package/.next/server/chunks/_0ge95_bkwrkmc._.js +0 -3
  745. package/.next/server/chunks/_0lj59y-ytysr5._.js +0 -3
  746. package/.next/server/chunks/_0v762_h-sp94d._.js +0 -3
  747. package/.next/server/chunks/_0vshwghrjetxu._.js +0 -3
  748. package/.next/server/chunks/_0z0zrluul2idw._.js +0 -3
  749. package/.next/server/chunks/_1a1oatugfke1p._.js +0 -3
  750. package/.next/server/chunks/_1ex6ovo_j2jzv._.js +0 -3
  751. package/.next/server/chunks/_1fgb9ve_nfat4._.js +0 -3
  752. package/.next/server/chunks/_1fsfy4c3rj36b._.js +0 -3
  753. package/.next/server/chunks/_1hc_es1a3cl6a._.js +0 -3
  754. package/.next/server/chunks/_1m-yyz-pl9-03._.js +0 -3
  755. package/.next/server/chunks/_1ns6y6y2tq8sh._.js +0 -3
  756. package/.next/server/chunks/_1yujnc0thk8ab._.js +0 -3
  757. package/.next/server/chunks/_211va-dk9519v._.js +0 -3
  758. package/.next/server/chunks/src_lib_0_g_0q-n01g-x._.js +0 -3
  759. package/.next/server/chunks/src_lib_0au5a9-5rxkab._.js +0 -3
  760. package/.next/server/chunks/src_lib_0d7kmnt7v2np8._.js +0 -3
  761. package/.next/server/chunks/src_lib_0fedb0fkc3km1._.js +0 -3
  762. package/.next/server/chunks/src_lib_0okewfjk6p2ci._.js +0 -3
  763. package/.next/server/chunks/src_lib_0ptvn4_15zxu0._.js +0 -3
  764. package/.next/server/chunks/src_lib_0rb6u4i7kn30r._.js +0 -3
  765. package/.next/server/chunks/src_lib_0svj7bkzyw9oc._.js +0 -3
  766. package/.next/server/chunks/src_lib_10is5pyogge95._.js +0 -3
  767. package/.next/server/chunks/src_lib_12j7n__96zd0q._.js +0 -3
  768. package/.next/server/chunks/src_lib_13hd5uoi-53hn._.js +0 -3
  769. package/.next/server/chunks/src_lib_1chbt4n9_vpoj._.js +0 -3
  770. package/.next/server/chunks/src_lib_1geq39r7va9gy._.js +0 -3
  771. package/.next/server/chunks/src_lib_1h4xeb9lyx31r._.js +0 -3
  772. package/.next/server/chunks/src_lib_1mno8g5cqmaet._.js +0 -3
  773. package/.next/server/chunks/src_lib_1qvj-3jt4jbq7._.js +0 -3
  774. package/.next/server/chunks/src_lib_1smlosz37xitx._.js +0 -3
  775. package/.next/server/chunks/src_lib_1squodf4swo_a._.js +0 -3
  776. package/.next/server/chunks/src_lib_1uei_xjjj3g7_._.js +0 -3
  777. package/.next/server/chunks/src_lib_1vt5vsj108u_q._.js +0 -3
  778. package/.next/server/chunks/src_lib_api-errors_ts_1gfd4ojz7efro._.js +0 -3
  779. package/.next/server/chunks/src_lib_exam_ts_0d3a4q4r41hcf._.js +0 -3
  780. package/.next/server/chunks/src_lib_figure-scale_ts_215n0ebzz7mr7._.js +0 -3
  781. package/.next/server/chunks/src_lib_import-batches_ts_0aekmggdwo_9-._.js +0 -3
  782. package/.next/server/chunks/src_lib_import-tasks_ts_1f4ejsy00-v1t._.js +0 -3
  783. package/.next/server/chunks/src_lib_question-analysis_ts_15_8r_pxmtd06._.js +0 -3
  784. package/.next/server/chunks/src_lib_question-deduplication_ts_1p1bik-vwl9ue._.js +0 -3
  785. package/.next/server/chunks/src_lib_retag_ts_0eu8ld_86kt3a._.js +0 -3
  786. package/.next/server/chunks/ssr/[root-of-the-server]__00_c9kpvx5075._.js +0 -3
  787. package/.next/server/chunks/ssr/[root-of-the-server]__03208_liub81h._.js +0 -3
  788. package/.next/server/chunks/ssr/[root-of-the-server]__08j-3_6cl3898._.js +0 -3
  789. package/.next/server/chunks/ssr/[root-of-the-server]__0ht0nkzazbnl9._.js +0 -3
  790. package/.next/server/chunks/ssr/[root-of-the-server]__0r18qmblwuijm._.js +0 -3
  791. package/.next/server/chunks/ssr/[root-of-the-server]__0sb3jhytba2xr._.js +0 -3
  792. package/.next/server/chunks/ssr/[root-of-the-server]__1o5pa8m50qyqa._.js +0 -3
  793. package/.next/server/chunks/ssr/_01rfvhncgnpvl._.js +0 -3
  794. package/.next/server/chunks/ssr/_0qgs--x99c558._.js +0 -3
  795. package/.next/server/chunks/ssr/_0w83jztp72o20._.js +0 -3
  796. package/.next/server/chunks/ssr/_0zacgi5-qgqwr._.js +0 -3
  797. package/.next/server/chunks/ssr/_11820i-k62560._.js +0 -3
  798. package/.next/server/chunks/ssr/_1a4u3f5sc05kb._.js +0 -3
  799. package/.next/server/chunks/ssr/_1j3yr2arbxd6a._.js +0 -3
  800. package/.next/server/chunks/ssr/_1qgg_ll5hkjaf._.js +0 -3
  801. package/.next/server/chunks/ssr/_1ujx-n3muyaxs._.js +0 -32
  802. package/.next/server/chunks/ssr/_1ux6eqqkupo6v._.js +0 -3
  803. package/.next/server/chunks/ssr/node_modules_02k42jp0_uoqr._.js +0 -3
  804. package/.next/server/chunks/ssr/node_modules_17lx40fyvpom3._.js +0 -3
  805. package/.next/server/chunks/ssr/node_modules_react-image-crop_dist_index_0khmp4mv3j9zr.js +0 -3
  806. package/.next/server/chunks/ssr/src_0z149pjrheeb7._.js +0 -3
  807. package/.next/server/chunks/ssr/src_1vhiktxz2_jj3._.js +0 -3
  808. package/.next/server/chunks/ssr/src_components_exam_exam-status-badge_tsx_0rozdbhlqsq71._.js +0 -3
  809. package/.next/server/chunks/ssr/src_components_print-preview_answer-space-control_tsx_02kuswyxklzp_._.js +0 -3
  810. package/.next/server/chunks/ssr/src_lib_0-wirad5ziskp._.js +0 -6
  811. package/.next/server/chunks/ssr/src_lib_1vv0-aje_e-zh._.js +0 -6
  812. package/.next/server/chunks/ssr/src_lib_short-id-client_ts_1v7n6pg50kguj._.js +0 -3
  813. package/.next/static/chunks/0-hqh6zs3hidn.js +0 -12
  814. package/.next/static/chunks/02xikk3wlibg1.js +0 -1
  815. package/.next/static/chunks/0e6ximjg-pqgt.js +0 -1
  816. package/.next/static/chunks/0wcwopwk4us6h.js +0 -9
  817. package/.next/static/chunks/0x9-b30mhne-_.js +0 -1
  818. package/.next/static/chunks/0y5zywo-ll2w3.js +0 -1
  819. package/.next/static/chunks/17-num1x7o1m2.js +0 -1
  820. package/.next/static/chunks/1746y345zti-9.js +0 -33
  821. package/.next/static/chunks/17dk_oppf9-hv.js +0 -12
  822. package/.next/static/chunks/1egd1e1483_lj.js +0 -1
  823. package/.next/static/chunks/1o_q928xcfjs3.js +0 -1
  824. package/.next/static/chunks/25flylmb_qz91.js +0 -1
  825. package/.next/static/chunks/2924d0kl-68z7.js +0 -193
  826. package/.next/static/chunks/2cpsg6e2vg7fx.css +0 -3
  827. package/.next/static/chunks/2ebh36q8lvor_.js +0 -1
  828. package/.next/static/chunks/2j0linvpqza7u.js +0 -55
  829. package/.next/static/chunks/2qqyq-iqkv_oa.js +0 -9
  830. package/.next/static/chunks/2r5aeenvfl93p.js +0 -1
  831. package/.next/static/chunks/38vt_4ntvy02e.js +0 -1
  832. package/.next/static/chunks/3c3cp7uzfhnyr.js +0 -1
  833. package/.next/static/chunks/3gy-_kb72v5lr.js +0 -1
  834. package/.next/static/chunks/3oz37kz8n7y3b.js +0 -1
  835. package/.next/static/chunks/3s_fq__cff-ps.js +0 -2
  836. package/.next/static/chunks/3tv07cyoo_hat.js +0 -1
  837. /package/.next/static/{E10D9dv115hLNvX7vE6qA → bFQJMw9c1NJ6NSOY8pN2N}/_buildManifest.js +0 -0
  838. /package/.next/static/{E10D9dv115hLNvX7vE6qA → bFQJMw9c1NJ6NSOY8pN2N}/_clientMiddlewareManifest.js +0 -0
  839. /package/.next/static/{E10D9dv115hLNvX7vE6qA → bFQJMw9c1NJ6NSOY8pN2N}/_ssgManifest.js +0 -0
  840. /package/dist-scripts/src/lib/{tag-data → tags/data}/biology.js +0 -0
  841. /package/dist-scripts/src/lib/{tag-data → tags/data}/chemistry.js +0 -0
  842. /package/dist-scripts/src/lib/{tag-data → tags/data}/chinese.js +0 -0
  843. /package/dist-scripts/src/lib/{tag-data → tags/data}/english.js +0 -0
  844. /package/dist-scripts/src/lib/{tag-data → tags/data}/geography.js +0 -0
  845. /package/dist-scripts/src/lib/{tag-data → tags/data}/history.js +0 -0
  846. /package/dist-scripts/src/lib/{tag-data → tags/data}/index.js +0 -0
  847. /package/dist-scripts/src/lib/{tag-data → tags/data}/math-gaosi.js +0 -0
  848. /package/dist-scripts/src/lib/{tag-data → tags/data}/math.js +0 -0
  849. /package/dist-scripts/src/lib/{tag-data → tags/data}/physics.js +0 -0
  850. /package/dist-scripts/src/lib/{tag-data → tags/data}/politics.js +0 -0
@@ -0,0 +1 @@
1
+ (globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,864272,e=>{"use strict";var t=e.i(843476),a=e.i(271645),s=e.i(522016),i=e.i(618566),r=e.i(13285),n=e.i(853138),l=e.i(632781),c=e.i(77071),o=e.i(456420);let d={name:"undo-2",size:24,node:[["path",{d:"M9 14 4 9l5-5",key:"102s5s"}],["path",{d:"M4 9h10.5a5.5 5.5 0 0 1 5.5 5.5a5.5 5.5 0 0 1-5.5 5.5H11",key:"f3b9sd"}]]};d.node;let m=(0,o.f)(d),u={name:"arrow-right",size:24,node:[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"m12 5 7 7-7 7",key:"xquz4c"}]]};u.node;let h=(0,o.f)(u);var x=e.i(111110);function p({inputProps:e,created:a}){let{t:i}=(0,x.b)();return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("input",{type:"file",accept:"image/*",className:"hidden","data-testid":"continuation-input",...e}),a.length>0&&(0,t.jsx)("ul",{className:"space-y-1 rounded-lg border border-primary/40 bg-primary/5 p-3 text-sm","data-testid":"continuation-notice",children:a.map((e,a)=>(0,t.jsxs)("li",{className:"flex flex-wrap items-center justify-between gap-2",children:[(0,t.jsxs)("span",{className:"flex items-center gap-1",children:[(0,t.jsx)(r.f,{className:"h-4 w-4 text-primary"}),i.importBatch.continuation.notice.replace("{n}",String(a+2))]}),(0,t.jsxs)(s.default,{href:`/import-batches/${e}`,className:"flex items-center gap-1 text-primary underline-offset-2 hover:underline",children:[i.importBatch.continuation.open,(0,t.jsx)(h,{className:"h-3 w-3"})]})]},e))})]})}let f={name:"arrow-down",size:24,node:[["path",{d:"M12 5v14",key:"s699le"}],["path",{d:"m19 12-7 7-7-7",key:"1idqje"}]]};f.node;let g=(0,o.f)(f),y={name:"arrow-up",size:24,node:[["path",{d:"m5 12 7-7 7 7",key:"hav0vg"}],["path",{d:"M12 19V5",key:"x0mq9r"}]]};y.node;let b=(0,o.f)(y);var j=e.i(716327),w=e.i(456539),v=e.i(508734);let k={name:"crop",size:24,node:[["path",{d:"M6 2v14a2 2 0 0 0 2 2h14",key:"ron5a4"}],["path",{d:"M18 22V8a2 2 0 0 0-2-2H2",key:"7s9ehn"}]]};k.node;let N=(0,o.f)(k),B={name:"file-plus-corner",size:24,node:[["path",{d:"M11.35 22H6a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.706.706l3.588 3.588A2.4 2.4 0 0 1 20 8v5.35",key:"17jvcc"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["path",{d:"M14 19h6",key:"bvotb8"}],["path",{d:"M17 16v6",key:"18yu1i"}]],aliases:["file-plus-2"]};B.node;let S=(0,o.f)(B),C={name:"merge",size:24,node:[["path",{d:"m8 6 4-4 4 4",key:"ybng9g"}],["path",{d:"M12 2v10.3a4 4 0 0 1-1.172 2.872L4 22",key:"1hyw0i"}],["path",{d:"m20 22-5-5",key:"1m27yz"}]]};C.node;let z=(0,o.f)(C),T={name:"scissors",size:24,node:[["circle",{cx:"6",cy:"6",r:"3",key:"1lh9wr"}],["path",{d:"M8.12 8.12 12 12",key:"1alkpv"}],["path",{d:"M20 4 8.12 15.88",key:"xgtan2"}],["circle",{cx:"6",cy:"18",r:"3",key:"fqmcym"}],["path",{d:"M14.8 14.8 20 20",key:"ptml3r"}]]};T.node;let A=(0,o.f)(T);var I=e.i(328623),M=e.i(759659),$=e.i(263676),R=e.i(793479),E=e.i(110204),P=e.i(967489),F=e.i(624687),q=e.i(411382),D=e.i(978056),H=e.i(54105),U=e.i(772325),_=e.i(722219),_=_,O=e.i(282492),L=e.i(825624);let V=q.z.object({x:D.z.number().min(0).max(1),y:D.z.number().min(0).max(1),width:D.z.number().min(.01).max(1),height:D.z.number().min(.01).max(1)}).refine(e=>e.x+e.width<=1.0001&&e.y+e.height<=1.0001,{message:"REGION_OUT_OF_BOUNDS"}),K=["unclear","partial","unlocated"],G=H.z.string().max(1572864,"DRAFT_IMAGE_TOO_LARGE").regex(/^data:image\/(?:jpeg|png|webp);base64,[A-Za-z0-9+/]+=*$/,"DRAFT_IMAGE_INVALID"),Q=q.z.object({original:H.z.string().max(2e4),text:H.z.string().max(2e4),uncertain:U.z.array(H.z.string().max(200)).max(20)}),W=q.z.object({key:H.z.string().regex(/^[A-Za-z0-9_-]{1,40}$/),label:H.z.string().max(20).nullable(),text:H.z.string().max(2e4),material:H.z.string().max(2e4).nullable(),section:H.z.string().max(500).nullable(),selected:_.boolean(),regions:U.z.array(V).max(4),hasFigure:_.boolean(),flags:U.z.array(O.z.enum(K)).max(K.length),fix:Q.nullish(),answer:H.z.string().max(2e4).nullish(),analysis:H.z.string().max(2e4).nullish(),knowledgePoints:U.z.array(H.z.string().max(200)).max(100).optional(),difficultyStars:D.z.number().int().min(1).max(5).nullish(),questionType:H.z.string().max(200).nullish(),wrongAnswer:H.z.string().max(2e4).nullish(),image:G.nullish()}),X=["blurry","partial","truncated","tooMany"];function Y(e=[]){let t=new Set(e);for(;;){let e=`q${Math.random().toString(36).slice(2,10)}`;if(!t.has(e))return e}}function Z(e,t){return"image"===t?e.regions.length>0:e.text.trim().length>0}function J(e,t){return e.items.filter(e=>e.selected&&Z(e,t))}function ee(e,t){return{...e,items:t}}function et(e,t){return e.items.findIndex(e=>e.key===t)}function ea(e,t,a){return ee(e,e.items.map(e=>{if(e.key!==t)return e;let s={...e,...a};return void 0!==a.text&&(s.text=a.text.slice(0,2e4),s.text!==e.text&&(s.fix=null)),void 0!==a.answer&&(s.answer=a.answer?.slice(0,2e4)??null),void 0!==a.analysis&&(s.analysis=a.analysis?.slice(0,2e4)??null),void 0!==a.knowledgePoints&&(s.knowledgePoints=a.knowledgePoints.slice(0,100).map(e=>e.slice(0,200))),void 0!==a.difficultyStars&&(s.difficultyStars=a.difficultyStars),void 0!==a.questionType&&(s.questionType=a.questionType),void 0!==a.wrongAnswer&&(s.wrongAnswer=a.wrongAnswer?.slice(0,2e4)??null),void 0!==a.regions&&(s.regions=a.regions.slice(0,4),s.flags=s.regions.length>0?e.flags.filter(e=>"unlocated"!==e):[...new Set([...e.flags,"unlocated"])]),s}))}function es(e,t){return ee(e,e.items.filter(e=>e.key!==t))}function ei(e,t,a){let s=et(e,t),i=s+a;if(s<0||i<0||i>=e.items.length)return e;let r=[...e.items];return[r[s],r[i]]=[r[i],r[s]],ee(e,r)}function er(e,t){return[e,t].filter(e=>e?.trim()).join("\n").trim()||null}function en(e,t){let a=t?new Set(t):null,s=!1,i=e.items.map(e=>e.fix&&(!a||a.has(e.key))?(s=!0,e.fix.original===e.text?{...e,text:e.fix.text,fix:null}:{...e,fix:null}):e);return s?ee(e,i):e}q.z.object({items:U.z.array(W).max(L.S),ignored:U.z.array(H.z.string().max(2e4)).max(200),warnings:U.z.array(O.z.enum(X)).max(X.length)}).superRefine((e,t)=>{let a=new Set;for(let s of e.items)a.has(s.key)&&t.addIssue({code:"custom",message:"DUPLICATE_ITEM_KEY"}),a.add(s.key)});var el=e.i(401280);let ec=[1,2,3,4,5],eo=[el.O,...el.V];function ed({item:e,onEdit:s}){let{t:i}=(0,x.b)(),[r,n]=(0,a.useState)(!1),l=!!(e.answer?.trim()||e.analysis?.trim()||e.knowledgePoints?.length||null!=e.difficultyStars||e.wrongAnswer?.trim());return(0,t.jsxs)("div",{className:"rounded-lg border border-dashed p-2",children:[(0,t.jsxs)("button",{type:"button",className:"flex w-full items-center justify-between text-xs font-medium text-muted-foreground",onClick:()=>n(e=>!e),"aria-expanded":r,children:[(0,t.jsx)("span",{children:i.importBatch.fields.title}),r?(0,t.jsx)(w.f,{className:"h-3.5 w-3.5"}):(0,t.jsx)(j.f,{className:"h-3.5 w-3.5"})]}),r&&(0,t.jsxs)("div",{className:"mt-2 space-y-3",children:[(0,t.jsxs)("div",{className:"space-y-1",children:[(0,t.jsx)(E.f,{htmlFor:`${e.key}-type`,className:"text-xs",children:i.questionType.label}),(0,t.jsxs)(P.d,{value:e.questionType??el.O,onValueChange:t=>s(a=>ea(a,e.key,{questionType:t===el.O?null:(0,el.P)(t)})),children:[(0,t.jsx)(P.P,{className:"h-8 w-full text-sm","aria-label":i.questionType.label,children:(0,t.jsx)(P.U,{})}),(0,t.jsx)(P.r,{children:eo.map(e=>(0,t.jsx)(P.T,{value:e,children:e===el.O?i.questionType.notSet:i.questionType.names[e]},e))})]})]}),(0,t.jsxs)("div",{className:"space-y-1",children:[(0,t.jsx)(E.f,{htmlFor:`${e.key}-answer`,className:"text-xs",children:i.importBatch.fields.answer}),(0,t.jsx)(F.f,{id:`${e.key}-answer`,value:e.answer??"",onChange:t=>s(a=>ea(a,e.key,{answer:t.target.value})),className:"min-h-16 text-sm",placeholder:i.importBatch.fields.answerPlaceholder})]}),(0,t.jsxs)("div",{className:"space-y-1",children:[(0,t.jsx)(E.f,{htmlFor:`${e.key}-analysis`,className:"text-xs",children:i.importBatch.fields.analysis}),(0,t.jsx)(F.f,{id:`${e.key}-analysis`,value:e.analysis??"",onChange:t=>s(a=>ea(a,e.key,{analysis:t.target.value})),className:"min-h-20 text-sm",placeholder:i.importBatch.fields.analysisPlaceholder})]}),(0,t.jsxs)("div",{className:"space-y-1",children:[(0,t.jsx)(E.f,{htmlFor:`${e.key}-knowledge`,className:"text-xs",children:i.importBatch.fields.knowledgePoints}),(0,t.jsx)(R.f,{id:`${e.key}-knowledge`,value:(e.knowledgePoints??[]).join(", "),onChange:t=>s(a=>ea(a,e.key,{knowledgePoints:t.target.value.split(/[,,、]/).map(e=>e.trim()).filter(Boolean)})),className:"text-sm",placeholder:i.importBatch.fields.knowledgePlaceholder})]}),(0,t.jsxs)("div",{className:"space-y-1",children:[(0,t.jsx)(E.f,{className:"text-xs",children:i.importBatch.fields.difficulty}),(0,t.jsxs)(P.d,{value:null!=e.difficultyStars?String(e.difficultyStars):"none",onValueChange:t=>s(a=>ea(a,e.key,{difficultyStars:"none"===t?null:Number(t)})),children:[(0,t.jsx)(P.P,{className:"h-8 w-full text-sm","aria-label":i.importBatch.fields.difficulty,children:(0,t.jsx)(P.U,{})}),(0,t.jsxs)(P.r,{children:[(0,t.jsx)(P.T,{value:"none",children:i.importBatch.fields.difficultyNone}),ec.map(e=>(0,t.jsx)(P.T,{value:String(e),children:"★".repeat(e)},e))]})]})]}),(0,t.jsxs)("div",{className:"space-y-1",children:[(0,t.jsx)(E.f,{htmlFor:`${e.key}-wrong`,className:"text-xs",children:i.importBatch.fields.wrongAnswer}),(0,t.jsx)(F.f,{id:`${e.key}-wrong`,value:e.wrongAnswer??"",onChange:t=>s(a=>ea(a,e.key,{wrongAnswer:t.target.value})),className:"min-h-16 text-sm",placeholder:i.importBatch.fields.wrongAnswerPlaceholder})]})]}),!r&&l&&(0,t.jsx)("p",{className:"mt-1 truncate text-xs text-muted-foreground",children:[e.answer?.trim()&&i.importBatch.fields.answer,e.analysis?.trim()&&i.importBatch.fields.analysis,e.knowledgePoints?.length&&`${i.importBatch.fields.knowledgePoints}(${e.knowledgePoints.length})`,null!=e.difficultyStars&&"★".repeat(e.difficultyStars),e.wrongAnswer?.trim()&&i.importBatch.fields.wrongAnswer].filter(Boolean).join(" · ")})]})}var em=e.i(975157);function eu({imageUrl:e,imageSize:a,regions:s,className:i}){let r=function(e){if(0===e.length)return null;let t=Math.min(...e.map(e=>e.x)),a=Math.min(...e.map(e=>e.y));return{x:t,y:a,width:Math.max(...e.map(e=>e.x+e.width))-t,height:Math.max(...e.map(e=>e.y+e.height))-a}}(s);if(!r)return null;let n=r.width*a.width/Math.max(1,r.height*a.height);return(0,t.jsx)("div",{className:(0,em.f)("relative w-full overflow-hidden rounded-md border bg-white",i),style:{aspectRatio:String(Math.max(.25,Math.min(8,n)))},"aria-hidden":!0,children:(0,t.jsx)("img",{src:e,alt:"",className:"absolute max-w-none select-none",draggable:!1,style:{width:`${100/r.width}%`,height:`${100/r.height}%`,left:`${-r.x/r.width*100}%`,top:`${-r.y/r.height*100}%`}})})}var eh=e.i(689664),ex=e.i(519455);function ep(e,t,a){if(!a)return;let s=e[e.length-1];s&&s.type===t?s.text+=a:e.push({type:t,text:a})}function ef({fix:e,onAccept:s,onReject:i}){let{t:r}=(0,x.b)(),n=(0,a.useMemo)(()=>(function(e,t){let a=Array.from(e),s=Array.from(t),i=0;for(;i<a.length&&i<s.length&&a[i]===s[i];)i++;let r=a.length,n=s.length;for(;r>i&&n>i&&a[r-1]===s[n-1];)r--,n--;let l=[];ep(l,"same",a.slice(0,i).join(""));let c=a.slice(i,r),o=s.slice(i,n),d=c.length,m=o.length;if(d*m>2e6)ep(l,"removed",c.join("")),ep(l,"added",o.join(""));else{let e=m+1,t=new Uint32Array((d+1)*e);for(let a=d-1;a>=0;a--)for(let s=m-1;s>=0;s--)t[a*e+s]=c[a]===o[s]?t[(a+1)*e+s+1]+1:Math.max(t[(a+1)*e+s],t[a*e+s+1]);let a=0,s=0;for(;a<d&&s<m;)c[a]===o[s]?(ep(l,"same",c[a]),a++,s++):t[(a+1)*e+s]>=t[a*e+s+1]?ep(l,"removed",c[a++]):ep(l,"added",o[s++]);ep(l,"removed",c.slice(a).join("")),ep(l,"added",o.slice(s).join(""))}return ep(l,"same",a.slice(r).join("")),l})(e.original,e.text),[e.original,e.text]);return(0,t.jsxs)("div",{className:"space-y-2 rounded-lg border border-violet-300 bg-violet-50/60 p-2 text-sm dark:border-violet-800 dark:bg-violet-950/30","data-testid":"text-fix-panel",children:[(0,t.jsxs)("div",{className:"flex flex-wrap items-center justify-between gap-1",children:[(0,t.jsxs)("span",{className:"flex items-center gap-1 text-xs font-medium text-violet-700 dark:text-violet-300",children:[(0,t.jsx)(I.f,{className:"h-3 w-3"}),r.importBatch.fixText.title]}),(0,t.jsx)("span",{className:"text-xs text-muted-foreground",children:r.importBatch.fixText.legend})]}),(0,t.jsx)("p",{className:"whitespace-pre-wrap break-words font-mono text-sm","data-testid":"text-fix-diff",children:n.map((e,a)=>"same"===e.type?(0,t.jsx)("span",{children:e.text},a):"removed"===e.type?(0,t.jsx)("del",{className:"bg-red-100 text-red-700 decoration-red-500 dark:bg-red-950/50 dark:text-red-300",children:e.text},a):(0,t.jsx)("ins",{className:"bg-emerald-100 text-emerald-800 no-underline dark:bg-emerald-950/50 dark:text-emerald-300",children:e.text},a))}),e.uncertain.length>0&&(0,t.jsxs)("div",{className:"text-xs text-amber-800 dark:text-amber-300",children:[(0,t.jsx)("span",{children:r.importBatch.fixText.uncertain}),(0,t.jsx)("ul",{className:"mt-0.5 list-inside list-disc",children:e.uncertain.map((e,a)=>(0,t.jsx)("li",{className:"break-words",children:e},a))})]}),(0,t.jsxs)("div",{className:"flex flex-wrap gap-2",children:[(0,t.jsxs)(ex.f,{type:"button",size:"sm",onClick:s,children:[(0,t.jsx)(eh.f,{className:"mr-1 h-4 w-4"}),r.importBatch.fixText.accept]}),(0,t.jsxs)(ex.f,{type:"button",size:"sm",variant:"ghost",onClick:i,children:[(0,t.jsx)($.X,{className:"mr-1 h-4 w-4"}),r.importBatch.fixText.reject]})]})]})}var eg=e.i(487486),ey=e.i(257428);function eb({image:e,alt:s,onRemove:i}){let[r,n]=(0,a.useState)(!1);return(0,t.jsxs)("div",{className:"relative inline-block",children:[(0,t.jsx)("button",{type:"button",onClick:()=>n(!0),className:"block overflow-hidden rounded-lg border","aria-label":s,children:(0,t.jsx)("img",{src:e,alt:s,className:"max-h-32 w-auto object-contain"})}),(0,t.jsx)(ex.f,{type:"button",size:"icon",variant:"ghost",className:"absolute -right-2 -top-2 h-6 w-6 rounded-full bg-background border shadow-sm",onClick:i,"aria-label":"删除图片",children:(0,t.jsx)($.X,{className:"h-3 w-3"})}),r&&(0,t.jsx)("button",{type:"button",className:"fixed inset-0 z-50 flex items-center justify-center bg-black/80 p-4",onClick:()=>n(!1),"aria-label":"关闭大图",children:(0,t.jsx)("img",{src:e,alt:s,className:"max-h-full max-w-full object-contain"})})]})}function ej({item:e,index:s,total:i,source:r,expanded:c,onToggleExpand:o,onEdit:d,image:m,onAdjustRegion:u,highlighted:h,onFixText:p,fixing:f,fixBusy:y,onContinue:k,continuing:B}){let{t:C}=(0,x.b)(),T=(0,a.useRef)(null),$=Z(e,r),R=`draft-item-${e.key}`,E=e.fix&&e.fix.original===e.text?e.fix:null;return(0,t.jsxs)("li",{id:R,className:(0,em.f)("rounded-xl border bg-card p-3 transition-colors",!e.selected&&"opacity-70",h&&"border-primary ring-2 ring-primary/30"),"data-testid":"draft-item","data-selected":e.selected,"data-fix-pending":E?"true":void 0,children:[(0,t.jsxs)("div",{className:"flex items-start gap-3",children:[(0,t.jsx)(ey.f,{className:"mt-1 h-5 w-5",checked:e.selected,disabled:!$,onCheckedChange:t=>d(a=>{var s,i;return s=e.key,i=!0===t,ee(a,a.items.map(e=>e.key===s?{...e,selected:i}:e))}),"aria-label":C.importBatch.question.replace("{index}",String(s+1))}),(0,t.jsxs)("button",{type:"button",className:"min-w-0 flex-1 text-left",onClick:o,"aria-expanded":c,"aria-controls":`${R}-body`,children:[(0,t.jsxs)("div",{className:"flex flex-wrap items-center gap-2 text-sm",children:[(0,t.jsx)("span",{className:"font-semibold",children:C.importBatch.question.replace("{index}",String(s+1))}),e.label&&(0,t.jsx)("span",{className:"text-xs text-muted-foreground",children:C.importBatch.originalLabel.replace("{label}",e.label)}),e.material&&(0,t.jsx)(eg.f,{variant:"secondary",children:C.importBatch.material}),e.hasFigure&&(0,t.jsx)(eg.f,{variant:"outline",children:C.importBatch.hasFigure}),E&&(0,t.jsx)(eg.f,{className:"bg-violet-600 text-white hover:bg-violet-600",children:C.importBatch.fixText.pending}),e.section&&(0,t.jsx)("span",{className:"truncate text-xs text-muted-foreground",children:e.section.split("\n")[0]})]}),!c&&!E&&e.text&&(0,t.jsx)("p",{className:"mt-1 line-clamp-3 whitespace-pre-line break-words text-sm text-muted-foreground",children:e.text}),e.flags.length>0&&(0,t.jsx)("ul",{className:"mt-1 space-y-0.5",children:e.flags.map(e=>(0,t.jsxs)("li",{className:"flex items-center gap-1 text-xs text-amber-700 dark:text-amber-300",children:[(0,t.jsx)(n.f,{className:"h-3 w-3 shrink-0"}),C.importBatch.flags[e]]},e))})]}),(0,t.jsx)(ex.f,{type:"button",size:"icon",variant:"ghost",className:"h-8 w-8 shrink-0",onClick:o,"aria-label":c?C.importBatch.collapse:C.importBatch.edit,children:c?(0,t.jsx)(w.f,{className:"h-4 w-4"}):(0,t.jsx)(j.f,{className:"h-4 w-4"})})]}),m&&e.regions.length>0&&(0,t.jsx)("button",{type:"button",className:"mt-2 block w-full max-w-md pl-8",onClick:u,"aria-label":C.importBatch.adjustRegion,children:(0,t.jsx)(eu,{imageUrl:m.url,imageSize:m,regions:e.regions,className:"max-h-48"})}),k&&(0,t.jsx)("div",{className:"mt-2 pl-8",children:(0,t.jsxs)(ex.f,{type:"button",size:"sm",variant:"outline",onClick:k,disabled:B,"data-testid":"draft-continue",children:[B?(0,t.jsx)(l.f,{className:"mr-1 h-4 w-4 animate-spin"}):(0,t.jsx)(S,{className:"mr-1 h-4 w-4"}),B?C.importBatch.continuation.working:C.importBatch.continuation.button]})}),E&&(0,t.jsx)("div",{className:"mt-2 pl-8",children:(0,t.jsx)(ef,{fix:E,onAccept:()=>d(t=>en(t,[e.key])),onReject:()=>d(t=>{var a;return a=e.key,ee(t,t.items.map(e=>e.key===a&&e.fix?{...e,fix:null}:e))})})}),c&&(0,t.jsxs)("div",{id:`${R}-body`,className:"mt-3 space-y-3 pl-8",children:[e.material&&(0,t.jsxs)("div",{className:"rounded-lg bg-muted/60 p-2 text-sm",children:[(0,t.jsxs)("div",{className:"mb-1 flex items-center justify-between gap-2",children:[(0,t.jsxs)("span",{className:"text-xs font-medium",children:[C.importBatch.material," · ",C.importBatch.materialHint]}),(0,t.jsx)(ex.f,{type:"button",size:"sm",variant:"ghost",className:"h-7 px-2 text-xs",onClick:()=>d(t=>ea(t,e.key,{material:null})),children:C.importBatch.removeMaterial})]}),(0,t.jsx)("p",{className:"line-clamp-6 whitespace-pre-line break-words text-muted-foreground",children:e.material})]}),"text"===r?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(F.f,{ref:T,"aria-label":C.importBatch.questionText,value:e.text,onChange:t=>d(a=>ea(a,e.key,{text:t.target.value}),`text-${e.key}`),className:"min-h-28 font-mono text-sm"}),(0,t.jsx)("p",{className:"text-xs text-muted-foreground",children:C.importBatch.splitHint}),e.image&&(0,t.jsx)(eb,{image:e.image,alt:C.importBatch.questionImage,onRemove:()=>d(t=>ea(t,e.key,{image:null}))}),(0,t.jsx)(ed,{item:e,onEdit:e=>d(e)})]}):(0,t.jsxs)(t.Fragment,{children:[e.text&&(0,t.jsx)("p",{className:"whitespace-pre-line break-words text-sm text-muted-foreground",children:e.text}),(0,t.jsx)("p",{className:"text-xs text-muted-foreground",children:C.importBatch.imageTextHint})]}),(0,t.jsxs)("div",{className:"flex flex-wrap gap-2",children:["text"===r?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)(ex.f,{type:"button",size:"sm",variant:"outline",onClick:()=>{let t=T.current?.selectionStart??0;d(a=>(function(e,t,a){let s=et(e,t);if(s<0||e.items.length>=L.S)return e;let i=e.items[s],r=i.text.slice(0,a).replace(/\s+$/,""),n=i.text.slice(a).replace(/^\s+/,"");if(!r||!n)return e;let l={...i,key:Y(e.items.map(e=>e.key)),label:null,text:n,regions:[],flags:i.regions.length>0?["unlocated"]:[],selected:!(i.regions.length>0)&&i.selected,answer:null,analysis:null,knowledgePoints:void 0,difficultyStars:null,questionType:null,wrongAnswer:null,fix:null},c=[...e.items];return c.splice(s,1,{...i,text:r,fix:null},l),ee(e,c)})(a,e.key,t))},children:[(0,t.jsx)(A,{className:"mr-1 h-4 w-4"}),C.importBatch.splitHere]}),p&&(0,t.jsxs)(ex.f,{type:"button",size:"sm",variant:"outline",onClick:p,disabled:y||!e.text.trim(),children:[f?(0,t.jsx)(l.f,{className:"mr-1 h-4 w-4 animate-spin"}):(0,t.jsx)(I.f,{className:"mr-1 h-4 w-4"}),f?C.importBatch.fixText.running:C.importBatch.fixText.one]})]}):(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)(ex.f,{type:"button",size:"sm",variant:"outline",onClick:u,children:[(0,t.jsx)(N,{className:"mr-1 h-4 w-4"}),e.regions.length?C.importBatch.adjustRegion:C.importBatch.locate]}),(0,t.jsxs)(ex.f,{type:"button",size:"sm",variant:"outline",onClick:()=>d(t=>(function(e,t){let a=et(e,t);if(a<0||e.items.length>=L.S)return e;let s=e.items[a],i={...s,key:Y(e.items.map(e=>e.key)),label:null,regions:s.regions.map(e=>({...e}))},r=[...e.items];return r.splice(a+1,0,i),ee(e,r)})(t,e.key)),children:[(0,t.jsx)(v.f,{className:"mr-1 h-4 w-4"}),C.importBatch.duplicate]})]}),(0,t.jsxs)(ex.f,{type:"button",size:"sm",variant:"outline",disabled:0===s,onClick:()=>d(t=>(function(e,t){let a=et(e,t);if(a<=0)return e;let s=e.items[a-1],i=e.items[a],r={...s,text:[s.text,i.text].filter(e=>e.trim()).join("\n").slice(0,2e4),material:s.material??i.material,selected:s.selected||i.selected,regions:[...s.regions,...i.regions].slice(0,4),hasFigure:s.hasFigure||i.hasFigure,flags:[...new Set([...s.flags,...i.flags])].filter(e=>"unlocated"!==e||s.regions.length+i.regions.length===0),answer:er(s.answer,i.answer)?.slice(0,2e4)??null,analysis:er(s.analysis,i.analysis)?.slice(0,2e4)??null,knowledgePoints:[...new Set([...s.knowledgePoints??[],...i.knowledgePoints??[]])].slice(0,100),difficultyStars:s.difficultyStars??i.difficultyStars,questionType:s.questionType??i.questionType,wrongAnswer:er(s.wrongAnswer,i.wrongAnswer)?.slice(0,2e4)??null,fix:null},n=[...e.items];return n.splice(a-1,2,r),ee(e,n)})(t,e.key)),children:[(0,t.jsx)(z,{className:"mr-1 h-4 w-4"}),C.importBatch.mergeUp]}),(0,t.jsx)(ex.f,{type:"button",size:"sm",variant:"ghost",disabled:0===s,onClick:()=>d(t=>ei(t,e.key,-1)),"aria-label":C.importBatch.moveUp,children:(0,t.jsx)(b,{className:"h-4 w-4"})}),(0,t.jsx)(ex.f,{type:"button",size:"sm",variant:"ghost",disabled:s===i-1,onClick:()=>d(t=>ei(t,e.key,1)),"aria-label":C.importBatch.moveDown,children:(0,t.jsx)(g,{className:"h-4 w-4"})}),(0,t.jsxs)(ex.f,{type:"button",size:"sm",variant:"ghost",className:"text-destructive",onClick:()=>d(t=>es(t,e.key)),children:[(0,t.jsx)(M.f,{className:"mr-1 h-4 w-4"}),C.importBatch.delete]})]})]})]})}function ew({count:e,missingRegions:a,pendingFixes:s=0,confirmBeforeImport:i,starting:r,onStart:n,onDiscard:c,source:o,analysisMode:d,onAnalysisModeChange:m,hasTargetNotebook:u}){let{t:h}=(0,x.b)(),p="none"===d,f="tags"===d,g=p?(i?h.importBatch.startNoneReview:h.importBatch.startNoneAuto).replace("{count}",String(e)):f?(i?h.importBatch.startTagsReview:h.importBatch.startTagsAuto).replace("{count}",String(e)):(i?h.importBatch.startReview:h.importBatch.startAuto).replace("{count}",String(e)),y=0===e?h.importBatch.nothingSelected:a>0?h.importBatch.needsRegion.replace("{count}",String(a)):p?h.importBatch.startHintNone:f?h.importBatch.startHintTags:s>0?h.importBatch.fixText.pendingHint.replace("{count}",String(s)):i?h.importBatch.startHintReview:h.importBatch.startHintAuto,b=(p||f)&&!u,j=b?h.importBatch.startNoneNoTarget:void 0;return(0,t.jsx)("div",{className:"fixed inset-x-0 bottom-[calc(4rem+env(safe-area-inset-bottom))] z-30 border-t bg-background/95 py-3 pl-4 pr-16 shadow-[0_-4px_12px_rgba(0,0,0,0.06)] backdrop-blur md:sticky md:bottom-4 md:rounded-xl md:border md:px-4","data-testid":"draft-start-bar",children:(0,t.jsxs)("div",{className:"mx-auto flex max-w-4xl flex-col gap-2 md:flex-row md:items-center md:justify-between",children:[(0,t.jsxs)("div",{className:"min-w-0 flex-1 space-y-1",children:["text"===o&&(0,t.jsxs)("div",{className:"flex flex-wrap items-center gap-2 text-xs",role:"radiogroup","aria-label":h.importBatch.analysisModeLabel,children:[(0,t.jsx)("button",{type:"button",role:"radio","aria-checked":"ai"===d,disabled:!!r,onClick:()=>m("ai"),className:`rounded-full border px-2.5 py-1 transition-colors ${"ai"===d?"border-primary bg-primary/10 text-primary":"border-border text-muted-foreground hover:border-primary/40"}`,"data-testid":"draft-analysis-ai",children:h.importBatch.analysisAi}),(0,t.jsx)("button",{type:"button",role:"radio","aria-checked":f,disabled:!!r||b,onClick:()=>m("tags"),title:j,className:`rounded-full border px-2.5 py-1 transition-colors ${f?"border-primary bg-primary/10 text-primary":"border-border text-muted-foreground hover:border-primary/40"} disabled:cursor-not-allowed disabled:opacity-50`,"data-testid":"draft-analysis-tags",children:h.importBatch.analysisTags}),(0,t.jsx)("button",{type:"button",role:"radio","aria-checked":p,disabled:!!r||b,onClick:()=>m("none"),title:j,className:`rounded-full border px-2.5 py-1 transition-colors ${p?"border-primary bg-primary/10 text-primary":"border-border text-muted-foreground hover:border-primary/40"} disabled:cursor-not-allowed disabled:opacity-50`,"data-testid":"draft-analysis-none",children:h.importBatch.analysisNone})]}),(0,t.jsx)("p",{className:"text-xs text-muted-foreground md:max-w-md","data-testid":"draft-start-hint",children:r??y})]}),(0,t.jsxs)("div",{className:"flex gap-2",children:[(0,t.jsx)(ex.f,{type:"button",variant:"ghost",onClick:c,disabled:!!r,className:"shrink-0",children:h.importBatch.discard}),(0,t.jsxs)(ex.f,{type:"button",onClick:n,disabled:0===e||!!r,className:"min-w-0 flex-1 md:flex-none","data-testid":"draft-start",children:[r?(0,t.jsx)(l.f,{className:"mr-2 h-4 w-4 animate-spin"}):(0,t.jsx)(I.f,{className:"mr-2 h-4 w-4"}),(0,t.jsx)("span",{className:"truncate",children:g})]})]})]})})}function ev({ignored:e,onRestore:s}){let{t:i}=(0,x.b)(),[r,n]=(0,a.useState)(!1);return 0===e.length?null:(0,t.jsxs)("section",{className:"rounded-xl border p-3",children:[(0,t.jsxs)("button",{type:"button",className:"flex w-full items-center justify-between text-left text-sm font-medium",onClick:()=>n(e=>!e),"aria-expanded":r,children:[i.importBatch.ignoredTitle.replace("{count}",String(e.length)),r?(0,t.jsx)(w.f,{className:"h-4 w-4"}):(0,t.jsx)(j.f,{className:"h-4 w-4"})]}),r&&(0,t.jsxs)("div",{className:"mt-2 space-y-2",children:[(0,t.jsx)("p",{className:"text-xs text-muted-foreground",children:i.importBatch.ignoredHint}),(0,t.jsx)("ul",{className:"space-y-2",children:e.map((e,a)=>(0,t.jsxs)("li",{className:"flex items-start gap-2 rounded-lg bg-muted/50 p-2 text-sm",children:[(0,t.jsx)("p",{className:"min-w-0 flex-1 whitespace-pre-line break-words text-muted-foreground",children:e}),(0,t.jsx)(ex.f,{type:"button",size:"sm",variant:"outline",className:"h-7 shrink-0",onClick:()=>s(a),children:i.importBatch.addAsQuestion})]},`${a}-${e.slice(0,20)}`))})]})]})}function ek({imageUrl:e,items:s,onSelectItem:i,highlightedKey:r}){let{t:n}=(0,x.b)(),[l,c]=(0,a.useState)(!0);return(0,t.jsxs)("section",{className:"rounded-xl border bg-card p-3","data-testid":"page-image-overview",children:[(0,t.jsxs)(ex.f,{type:"button",variant:"ghost",size:"sm",className:"mb-2 h-8 px-2 md:hidden",onClick:()=>c(e=>!e),"aria-expanded":l,children:[l?(0,t.jsx)(w.f,{className:"mr-1 h-4 w-4"}):(0,t.jsx)(j.f,{className:"mr-1 h-4 w-4"}),l?n.importBatch.hideImage:n.importBatch.showImage]}),(0,t.jsxs)("div",{className:(0,em.f)("relative mx-auto w-fit max-w-full",!l&&"hidden md:block"),children:[(0,t.jsx)("img",{src:e,alt:"",className:"block max-h-[70vh] max-w-full select-none rounded-md",draggable:!1}),s.map((e,a)=>e.regions.map((s,l)=>(0,t.jsx)("button",{type:"button",onClick:()=>i(e.key),className:(0,em.f)("absolute rounded-sm border-2 transition-colors",e.selected?"border-primary bg-primary/10":"border-dashed border-muted-foreground/70 bg-transparent",r===e.key&&"border-amber-500 bg-amber-400/20"),style:{left:`${100*s.x}%`,top:`${100*s.y}%`,width:`${100*s.width}%`,height:`${100*s.height}%`},"aria-label":n.importBatch.question.replace("{index}",String(a+1)),children:0===l&&(0,t.jsx)("span",{className:(0,em.f)("absolute -left-0.5 -top-0.5 rounded-br-md px-1.5 text-xs font-semibold text-white",e.selected?"bg-primary":"bg-muted-foreground"),children:a+1})},`${e.key}-${l}`)))]})]})}var eN=e.i(232660),eB=e.i(776639);let eS={x:.1,y:.1,width:.8,height:.3};function eC(e){return{unit:"%",x:100*e.x,y:100*e.y,width:100*e.width,height:100*e.height}}function ez(e){let t={x:e.x/100,y:e.y/100,width:e.width/100,height:e.height/100};return t.width>=.01&&t.height>=.01?t:null}function eT({open:e,imageUrl:s,regions:i,onClose:r,onSave:n}){let{t:l}=(0,x.b)(),[o,d]=(0,a.useState)(()=>(i.length?i:[eS]).map(eC)),[m,u]=(0,a.useState)(0),h=o[Math.min(m,o.length-1)];return(0,t.jsx)(eB.N,{open:e,onOpenChange:e=>!e&&r(),children:(0,t.jsxs)(eB.d,{className:"flex h-[90vh] max-w-3xl flex-col gap-0 p-0",children:[(0,t.jsxs)(eB.s,{className:"shrink-0 border-b p-4",children:[(0,t.jsx)(eB.F,{children:l.importBatch.regionDialogTitle}),(0,t.jsx)(eB.C,{children:l.importBatch.regionDialogHint})]}),(0,t.jsx)("div",{className:"min-h-0 flex-1 overflow-auto bg-black p-3",children:(0,t.jsx)("div",{className:"mx-auto w-fit",children:(0,t.jsx)(eN.f,{crop:h,onChange:(e,t)=>d(e=>e.map((e,a)=>a===m?t:e)),children:(0,t.jsx)("img",{src:s,alt:"",className:"block max-h-[65vh] max-w-full",draggable:!1})})})}),(0,t.jsxs)("div",{className:"shrink-0 space-y-3 border-t p-4",children:[(0,t.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[o.map((e,a)=>(0,t.jsx)("button",{type:"button",onClick:()=>u(a),className:(0,em.f)("rounded-md border px-3 py-1 text-sm",a===m?"border-primary bg-primary/10 font-medium":"text-muted-foreground"),children:l.importBatch.regionTab.replace("{index}",String(a+1))},a)),o.length<4&&(0,t.jsxs)(ex.f,{type:"button",size:"sm",variant:"ghost",onClick:()=>{d(e=>[...e,eC(eS)]),u(o.length)},children:[(0,t.jsx)(c.f,{className:"mr-1 h-4 w-4"}),l.importBatch.addRegion]}),o.length>1&&(0,t.jsxs)(ex.f,{type:"button",size:"sm",variant:"ghost",className:"text-destructive",onClick:()=>{d(e=>e.filter((e,t)=>t!==m)),u(0)},children:[(0,t.jsx)(M.f,{className:"mr-1 h-4 w-4"}),l.importBatch.removeRegion]})]}),(0,t.jsxs)("div",{className:"flex justify-end gap-2",children:[(0,t.jsx)(ex.f,{type:"button",variant:"outline",onClick:r,children:l.common.cancel}),(0,t.jsx)(ex.f,{type:"button",onClick:()=>{let e=o.map(ez).filter(e=>null!==e);e.length&&n(e)},children:l.importBatch.saveRegion})]})]})]})})}let eA={name:"check-check",size:24,node:[["path",{d:"M18 6 7 17l-5-5",key:"116fxf"}],["path",{d:"m22 10-7.5 7.5L13 16",key:"ke71qq"}]]};eA.node;let eI=(0,o.f)(eA);function eM({targetCount:e,pendingCount:a,fixing:s,onFix:i,onAcceptAll:r}){let{t:n}=(0,x.b)();return(0,t.jsxs)("div",{className:"space-y-1 rounded-lg border border-dashed p-3","data-testid":"text-fix-toolbar",children:[(0,t.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[(0,t.jsxs)(ex.f,{type:"button",size:"sm",variant:"outline",onClick:i,disabled:s||0===e,children:[s?(0,t.jsx)(l.f,{className:"mr-1 h-4 w-4 animate-spin"}):(0,t.jsx)(I.f,{className:"mr-1 h-4 w-4"}),s?n.importBatch.fixText.running:n.importBatch.fixText.selected.replace("{count}",String(e))]}),a>0&&(0,t.jsxs)(ex.f,{type:"button",size:"sm",onClick:r,children:[(0,t.jsx)(eI,{className:"mr-1 h-4 w-4"}),n.importBatch.fixText.acceptAll.replace("{count}",String(a))]})]}),(0,t.jsx)("p",{className:"text-xs text-muted-foreground",children:n.importBatch.fixText.hint})]})}var e$=e.i(767077),eR=e.i(499930),eE=e.i(294114),eP=e.i(201276),eF=e.i(119472),eq=e.i(213761);function eD({batch:e,draft:s,onEdit:i,onUndo:r,canUndo:o,saveState:d,image:u,confirmBeforeImport:h,starting:f,onStart:g,onDiscard:y,analysisMode:b,onAnalysisModeChange:j,hasConflictCopy:w,onRestoreConflict:v,onDismissConflict:k}){let{t:N}=(0,x.b)(),B=e.source,[S,C]=(0,a.useState)(null),[z,T]=(0,a.useState)(null),[A,I]=(0,a.useState)(null),M=s.items.filter(e=>e.selected&&Z(e,B)),$=s.items.length>0&&s.items.every(e=>e.selected||!Z(e,B)),R=s.items.filter(e=>e.selected&&!Z(e,B)).length,E=function(e,t,s){let{t:i}=(0,x.b)(),[r,n]=(0,a.useState)([]);return{fix:(0,a.useCallback)(async a=>{let r=t.items.filter(e=>a.includes(e.key)&&e.text.trim()).map(e=>({key:e.key,text:e.text}));if(0!==r.length){n(r.map(e=>e.key));try{let t=await (0,eF.$)(e,r);t.fixes.length>0&&s(e=>{let a,s,i;return a=new Map(t.fixes.map(e=>[e.key,e])),s=!1,i=e.items.map(e=>{let t=a.get(e.key);return t&&e.text===t.original&&t.text!==t.original?(s=!0,{...e,fix:{original:t.original,text:t.text,uncertain:t.uncertain}}):e}),s?ee(e,i):e});let a=[t.fixes.length>0?i.importBatch.fixText.done.replace("{count}",String(t.fixes.length)):null,t.unchanged.length>0?i.importBatch.fixText.unchanged.replace("{count}",String(t.unchanged.length)):null,t.failed.length>0?i.importBatch.fixText.failed.replace("{count}",String(t.failed.length)):null].filter(Boolean).join(" ");t.failed.length>0?eE.c.warning(a):eE.c.success(a)}catch(e){eP.V.error("[ImportBatch]","Text fix failed",{error:e}),eE.c.error((0,e$.f)(e,i))}finally{n([])}}},[e,t,s,i]),fixingKeys:r,fixing:r.length>0}}(e.id,s,i),P=function(e,t,s,i){let{t:r,language:n}=(0,x.b)(),l=(0,a.useRef)(null),c=(0,a.useRef)(null),[o,d]=(0,a.useState)(null),[m,u]=(0,a.useState)([]),h=async a=>{let l=a.target.files?.[0];a.target.value="";let o=s.items.find(e=>e.key===c.current);if(l&&o&&t){d(o.key);try{let a=await (0,eq.p)(l);try{let s=await (0,eR.y)(t),l=await (0,eR.k)(s,o.regions,a),c={...(0,eq.N)(a,l),sourceType:"continuation"},d=await (0,eF.v)({source:"image",imageBase64:l.dataUrl,imageInfo:c,language:n,subjectId:e.subjectId,targetSubjectId:e.targetSubjectId,paperLevel:e.paperLevel});i(e=>es(e,o.key)),u(e=>[...e,d.id]),eP.V.info("[ImportBatch]","Continuation batch created",{batchId:d.id,...c}),eE.c.success(r.importBatch.continuation.created)}finally{a.dispose()}}catch(e){eP.V.error("[ImportBatch]","Continuation failed",{error:e}),eE.c.error(e instanceof eq.o?r.upload.decodeErrors[e.code].replace("{format}",e.format.toUpperCase()):(0,e$.f)(e,r))}finally{d(null)}}};return{pick:e=>{c.current=e,l.current?.click()},busyKey:o,created:m,inputProps:{ref:l,onChange:e=>void h(e)}}}(e,u?.url??null,s,i),F="text"===B?s.items.filter(e=>e.fix&&e.fix.original===e.text).length:0,q="text"===B?M.filter(e=>!(e.fix&&e.fix.original===e.text)).map(e=>e.key):[];return(0,t.jsxs)("div",{className:"space-y-4 pb-36 md:pb-24",children:[(0,t.jsxs)("div",{className:"flex flex-wrap items-center justify-between gap-2",children:[(0,t.jsxs)("p",{className:"text-base font-semibold","data-testid":"draft-summary",children:[N.importBatch.detected.replace("{count}",String(s.items.length)),(0,t.jsx)("span",{className:"mx-2 text-muted-foreground",children:"·"}),N.importBatch.selected.replace("{count}",String(M.length))]}),(0,t.jsxs)("div",{className:"flex items-center gap-1",children:[(0,t.jsxs)("span",{className:"mr-2 flex items-center gap-1 text-xs text-muted-foreground","aria-live":"polite","data-testid":"draft-save-state","data-state":d,children:["saving"===d&&(0,t.jsx)(l.f,{className:"h-3 w-3 animate-spin"}),N.importBatch.save[d]]}),(0,t.jsxs)(ex.f,{type:"button",size:"sm",variant:"ghost",disabled:!o,onClick:r,children:[(0,t.jsx)(m,{className:"mr-1 h-4 w-4"}),N.importBatch.undo]}),(0,t.jsx)(ex.f,{type:"button",size:"sm",variant:"ghost",onClick:()=>i(e=>(function(e,t,a=()=>!0){return ee(e,e.items.map(e=>({...e,selected:t&&a(e)})))})(e,!$,e=>Z(e,B))),children:$?N.importBatch.selectNone:N.importBatch.selectAll})]})]}),w&&(0,t.jsxs)("div",{className:"space-y-2 rounded-lg border border-primary/40 bg-primary/5 p-3 text-sm",role:"status","data-testid":"draft-conflict",children:[(0,t.jsx)("p",{children:N.importBatch.conflictKept}),(0,t.jsxs)("div",{className:"flex flex-wrap gap-2",children:[(0,t.jsx)(ex.f,{type:"button",size:"sm",onClick:v,children:N.importBatch.restoreMine}),(0,t.jsx)(ex.f,{type:"button",size:"sm",variant:"ghost",onClick:k,children:N.importBatch.discardMine})]})]}),"text"===B&&s.items.length>0&&(0,t.jsx)(eM,{targetCount:q.length,pendingCount:F,fixing:E.fixing,onFix:()=>void E.fix(q),onAcceptAll:()=>i(e=>en(e))}),s.warnings.length>0&&(0,t.jsx)("ul",{className:"space-y-1 rounded-lg border border-amber-300 bg-amber-50 p-3 text-sm text-amber-900 dark:border-amber-700 dark:bg-amber-950/40 dark:text-amber-200",children:s.warnings.map(e=>(0,t.jsxs)("li",{className:"flex items-start gap-2",children:[(0,t.jsx)(n.f,{className:"mt-0.5 h-4 w-4 shrink-0"}),N.importBatch.warnings[e]]},e))}),(0,t.jsx)(p,{inputProps:P.inputProps,created:P.created}),u&&(0,t.jsx)(ek,{imageUrl:u.url,items:s.items,onSelectItem:e=>{T(e),C(e),document.getElementById(`draft-item-${e}`)?.scrollIntoView({behavior:"smooth",block:"center"})},highlightedKey:z}),0===s.items.length?(0,t.jsx)("p",{className:"rounded-xl border border-dashed p-6 text-center text-sm text-muted-foreground",children:N.importBatch.emptyDraft}):(0,t.jsx)("ol",{className:"space-y-3",children:s.items.map((e,a)=>{var r;return(0,t.jsx)(ej,{item:e,index:a,total:s.items.length,source:B,expanded:S===e.key,onToggleExpand:()=>C(t=>t===e.key?null:e.key),onEdit:i,image:u,onAdjustRegion:()=>I({key:e.key,regions:e.regions}),highlighted:z===e.key,onFixText:"text"===B?()=>void E.fix([e.key]):void 0,fixing:E.fixingKeys.includes(e.key),fixBusy:E.fixing,onContinue:u&&(r=s.items.length,e.regions.length>0&&(e.flags.includes("partial")||a===r-1))?()=>P.pick(e.key):void 0,continuing:P.busyKey===e.key},e.key)})}),u&&(0,t.jsxs)(ex.f,{type:"button",variant:"outline",size:"sm",onClick:()=>I({key:null,regions:[]}),children:[(0,t.jsx)(c.f,{className:"mr-1 h-4 w-4"}),N.importBatch.addQuestion]}),(0,t.jsx)(ev,{ignored:s.ignored,onRestore:e=>i(t=>(function(e,t){let a=e.ignored[t];if(void 0===a||e.items.length>=L.S)return e;let s={key:Y(e.items.map(e=>e.key)),label:null,text:a,material:null,section:null,selected:!0,regions:[],hasFigure:!1,flags:[]};return{...e,items:[...e.items,s],ignored:e.ignored.filter((e,a)=>a!==t)}})(t,e))}),(0,t.jsx)(ew,{count:M.length,missingRegions:R,pendingFixes:F,confirmBeforeImport:h,starting:f,onStart:g,onDiscard:y,source:B,analysisMode:b,onAnalysisModeChange:j,hasTargetNotebook:!!e.targetSubjectId||!!e.subjectId}),u&&A&&(0,t.jsx)(eT,{open:!0,imageUrl:u.url,regions:A.regions,onClose:()=>I(null),onSave:e=>{let t=A.key;i(a=>t?ea(a,t,{regions:e,selected:!0}):function(e,t){if(e.items.length>=L.S)return e;let a={key:Y(e.items.map(e=>e.key)),label:null,text:"",material:null,section:null,selected:!0,regions:[t],hasFigure:!1,flags:[]};return{...e,items:[...e.items,a]}}(a,e[0])),I(null)}})]})}var eH=e.i(399847),eU=e.i(395925);function e_({batch:e,busy:a,onRetry:s,onDiscard:i}){let{t:r}=(0,x.b)(),n=r.errors,c=e.error?"string"==typeof n[e.error]?n[e.error]:e.error:null;return"splitting"===e.phase?(0,t.jsxs)("section",{className:"flex items-start gap-3 rounded-xl border bg-card p-4",role:"status","data-testid":"batch-splitting",children:[(0,t.jsx)(l.f,{className:"mt-0.5 h-5 w-5 shrink-0 animate-spin text-primary"}),(0,t.jsxs)("div",{className:"min-w-0 flex-1 space-y-2",children:[(0,t.jsx)("p",{className:"font-medium",children:r.importBatch.phase.splitting}),(0,t.jsx)("p",{className:"text-sm text-muted-foreground",children:r.importBatch.splittingHint}),(0,t.jsx)(ex.f,{type:"button",size:"sm",variant:"ghost",onClick:i,children:r.importBatch.discard})]})]}):(0,t.jsxs)("section",{className:"flex items-start gap-3 rounded-xl border border-destructive/40 bg-card p-4","data-testid":"batch-failed",children:[(0,t.jsx)(eH.f,{className:"mt-0.5 h-5 w-5 shrink-0 text-destructive"}),(0,t.jsxs)("div",{className:"min-w-0 flex-1 space-y-2",children:[(0,t.jsx)("p",{className:"font-medium",children:r.importBatch.phase.failed}),c&&(0,t.jsx)("p",{className:"text-sm text-destructive",children:c}),"image"===e.source&&(0,t.jsx)("p",{className:"text-sm text-muted-foreground",children:r.importBatch.manualFallback}),(0,t.jsxs)("div",{className:"flex flex-wrap gap-2",children:[(0,t.jsxs)(ex.f,{type:"button",size:"sm",onClick:s,disabled:a,children:[(0,t.jsx)(eU.f,{className:"mr-1 h-4 w-4"}),r.importBatch.retrySplit]}),(0,t.jsx)(ex.f,{type:"button",size:"sm",variant:"ghost",onClick:i,children:r.importBatch.discard})]})]})]})}var eO=e.i(551757),eL=e.i(615568),eV=e.i(168148);let eK={analyzing:.5,saving:.9,review:1,saved:1,failed:1};function eG({task:e}){let{t:a}=(0,x.b)(),s=a.importBatch.itemStatus;if("saved"===e.status){let a=e.errorItemId?e.duplicate?s.duplicate:s.saved:s.deleted;return(0,t.jsxs)("span",{className:"flex items-center gap-1 text-green-700 dark:text-green-300",children:[(0,t.jsx)(eO.f,{className:"h-4 w-4"}),a]})}return"failed"===e.status?(0,t.jsxs)("span",{className:"flex items-center gap-1 text-destructive",children:[(0,t.jsx)(eH.f,{className:"h-4 w-4"}),s.failed]}):"review"===e.status?(0,t.jsxs)("span",{className:"flex items-center gap-1 text-primary",children:[(0,t.jsx)(eL.f,{className:"h-4 w-4"}),s.review]}):(0,t.jsxs)("span",{className:"flex items-center gap-1 text-muted-foreground",children:[(0,t.jsx)(l.f,{className:"h-4 w-4 animate-spin"}),s[e.status]]})}function eQ({batch:e,image:a,busy:i,onRetryFailed:r,onRetryOne:n,onConfirmAll:l}){let{t:c}=(0,x.b)(),{counts:o}=e,d=o.total-o.active,m=o.total?Math.round(e.tasks.reduce((e,t)=>e+eK[t.status],0)/o.total*100):0,u=new Map((e.draft?.items??[]).map((e,t)=>[e.key,{item:e,index:t}])),h=c.errors;return(0,t.jsxs)("div",{className:"space-y-4",children:[(0,t.jsxs)("section",{className:"space-y-3 rounded-xl border bg-card p-4","data-testid":"batch-progress","data-phase":e.phase,children:[(0,t.jsxs)("div",{className:"flex flex-wrap items-baseline justify-between gap-2",children:[(0,t.jsx)("p",{className:"text-base font-semibold",children:c.importBatch.progress.replace("{done}",String(d)).replace("{total}",String(o.total))}),(0,t.jsx)("p",{className:"text-xs text-muted-foreground",children:c.importTasks.stageEstimate})]}),(0,t.jsx)(eV.f,{value:m,"aria-label":c.importTasks.stageEstimate,"aria-valuetext":c.common.progress.estimated.replace("{percent}",String(m)),className:"h-2"}),(0,t.jsxs)("ul",{className:"flex flex-wrap gap-x-4 gap-y-1 text-sm","data-testid":"batch-counts",children:[(0,t.jsx)("li",{className:"text-green-700 dark:text-green-300",children:c.importBatch.counts.saved.replace("{count}",String(o.saved-o.duplicate))}),o.duplicate>0&&(0,t.jsx)("li",{className:"text-muted-foreground",children:c.importBatch.counts.duplicate.replace("{count}",String(o.duplicate))}),o.review>0&&(0,t.jsx)("li",{className:"text-primary",children:c.importBatch.counts.review.replace("{count}",String(o.review))}),o.failed>0&&(0,t.jsx)("li",{className:"text-destructive",children:c.importBatch.counts.failed.replace("{count}",String(o.failed))}),o.active>0&&(0,t.jsx)("li",{className:"text-muted-foreground",children:c.importBatch.counts.active.replace("{count}",String(o.active))})]}),o.active>0&&(0,t.jsx)("p",{className:"text-xs text-muted-foreground",children:c.importBatch.leaveHint}),(0,t.jsxs)("div",{className:"flex flex-wrap gap-2",children:[o.failed>0&&(0,t.jsxs)(ex.f,{type:"button",size:"sm",onClick:r,disabled:i,children:[(0,t.jsx)(eU.f,{className:"mr-1 h-4 w-4"}),c.importBatch.retryFailed.replace("{count}",String(o.failed))]}),o.review>0&&(0,t.jsx)(ex.f,{type:"button",size:"sm",variant:"outline",onClick:l,disabled:i,children:c.importBatch.confirmAll.replace("{count}",String(o.review))})]})]}),(0,t.jsx)("ol",{className:"space-y-3",children:e.tasks.map(e=>{let r=u.get(e.batchItemKey??""),l=e.error?"string"==typeof h[e.error]?h[e.error]:e.error:null;return(0,t.jsxs)("li",{className:(0,em.f)("flex gap-3 rounded-xl border bg-card p-3 text-sm",e.unread&&"review"===e.status&&"border-primary/50"),"data-testid":"batch-task","data-status":e.status,children:[a&&r&&r.item.regions.length>0&&(0,t.jsx)(eu,{imageUrl:a.url,imageSize:a,regions:r.item.regions,className:"w-20 shrink-0 self-start sm:w-28"}),(0,t.jsxs)("div",{className:"min-w-0 flex-1 space-y-1",children:[(0,t.jsxs)("div",{className:"flex flex-wrap items-center justify-between gap-2",children:[(0,t.jsx)("span",{className:"font-medium",children:c.importBatch.question.replace("{index}",String((r?.index??0)+1))}),(0,t.jsx)(eG,{task:e})]}),(0,t.jsx)("p",{className:"line-clamp-2 break-words text-muted-foreground",children:e.excerpt||r?.item.text}),"saved"===e.status&&e.errorItemId&&!e.duplicate&&e.notebookName&&(0,t.jsx)("p",{className:"text-xs text-muted-foreground",children:c.importTasks.savedTo.replace("{notebook}",e.notebookName).replace("{id}",e.errorItemShortId||"-")}),l&&"failed"===e.status&&(0,t.jsx)("p",{className:"text-xs text-destructive",children:l}),(0,t.jsxs)("div",{className:"flex flex-wrap gap-2 pt-1",children:["review"===e.status&&(0,t.jsx)(ex.f,{asChild:!0,size:"sm",children:(0,t.jsx)(s.default,{href:`/import-tasks/${e.id}`,children:c.importBatch.review})}),"saved"===e.status&&e.errorItemId&&(0,t.jsx)(ex.f,{asChild:!0,size:"sm",variant:"outline",children:(0,t.jsx)(s.default,{href:`/error-items/${e.errorItemId}`,children:c.importBatch.viewItem})}),"failed"===e.status&&(0,t.jsxs)(ex.f,{type:"button",size:"sm",variant:"outline",onClick:()=>n(e),disabled:i,children:[(0,t.jsx)(eU.f,{className:"mr-1 h-3 w-3"}),c.importTasks.retry]})]})]})]},e.id)})})]})}var eW=e.i(912505),eX=e.i(393842),eY=e.i(86963),eZ=e.i(127175),eJ=e.i(35209),e0=e.i(25197);e.s(["default",0,function(){let e=(0,i.useParams)(),n=(0,i.useRouter)(),l=e.id,{t:c}=(0,x.b)();(0,eJ.f)(c.importBatch.title);let o=function(e,t={}){let[s,i]=(0,a.useState)(null),[r,n]=(0,a.useState)(!1),[l,c]=(0,a.useState)(null),[o,d]=(0,a.useState)("saved"),m=(0,a.useRef)([]),[u,h]=(0,a.useState)(!1),x=(0,a.useRef)(0),p=(0,a.useRef)(0),f=(0,a.useRef)(0),g=(0,a.useRef)(null),y=(0,a.useRef)(null),b=(0,a.useRef)(null),j=(0,a.useRef)(async()=>!0),[w,v]=(0,a.useState)(null),k=(0,a.useRef)(t.onConflict);(0,a.useEffect)(()=>{k.current=t.onConflict},[t.onConflict]);let N=(0,a.useCallback)((e,t=!1)=>{i(t=>t&&!e.imageData&&t.imageData&&t.id===e.id?{...e,imageData:t.imageData}:e);let a=p.current!==f.current;(t||!a||"draft"!==e.status)&&(null!==g.current&&e.version!==x.current&&(m.current=[],h(!1)),x.current=e.version,g.current=e.draft,c(e.draft),f.current=p.current,d("saved"))},[]),B=(0,a.useCallback)(async()=>{if("u"<typeof document||"hidden"!==document.visibilityState)try{N(await (0,eF.w)(e)),n(!1)}catch(e){e?.status===404&&n(!0)}},[e,N]);(0,a.useEffect)(()=>{let t=!1;(0,eF.w)(e,{image:!0}).then(e=>{t||N(e,!0)}).catch(e=>{t||e?.status!==404||n(!0)});let a=(0,eZ.E)(()=>void B());return()=>{t=!0,a()}},[e,N,B]);let S=s?.phase==="splitting"||s?.phase==="processing";(0,a.useEffect)(()=>{if(!S)return;let e=setInterval(()=>void B(),2500);return()=>clearInterval(e)},[S,B]);let C=(0,a.useCallback)(async()=>{let t=p.current;d("saving");try{let a=await (0,eF.S)(e,x.current,g.current);return x.current=a.version,f.current=t,i(e=>e?{...a,imageData:e.imageData}:a),d(p.current===t?"saved":"dirty"),"ok"}catch(t){let e=(0,eF.n)(t);if(e){let t=g.current;return"draft"===e.status&&t&&v(t),N(e,!0),k.current?.(),"conflict"}return d("error"),b.current&&clearTimeout(b.current),b.current=setTimeout(()=>void j.current(),5e3),"error"}},[e,N]),z=(0,a.useCallback)(async()=>{for(b.current&&(clearTimeout(b.current),b.current=null);;){let e=y.current??(y.current=(async()=>{try{for(;p.current!==f.current&&g.current;)if(await C()!=="ok")return!1;return!0}finally{y.current=null}})());if(!await e)return!1;if(p.current===f.current)return!0}},[C]);(0,a.useEffect)(()=>{j.current=z},[z]),(0,a.useEffect)(()=>{let e=()=>{"hidden"===document.visibilityState&&p.current!==f.current&&z()};return document.addEventListener("visibilitychange",e),window.addEventListener("pagehide",e),()=>{document.removeEventListener("visibilitychange",e),window.removeEventListener("pagehide",e)}},[z]),(0,a.useEffect)(()=>()=>{b.current&&clearTimeout(b.current)},[]);let T=(0,a.useCallback)(e=>{g.current=e,c(e),p.current+=1,d("dirty"),b.current&&clearTimeout(b.current),b.current=setTimeout(()=>void z(),800)},[z]),A=(0,a.useRef)(null),I=(0,a.useCallback)((e,t)=>{let a=g.current;if(!a)return;let s=e(a);if(s===a)return;let i=Date.now(),r=t&&A.current?.group===t&&i-A.current.at<1500;A.current=t?{group:t,at:i}:null,r||(m.current=[...m.current.slice(-29),a],h(!0)),T(s)},[T]),M=(0,a.useCallback)(()=>{let e=m.current.pop();A.current=null,h(m.current.length>0),e&&T(e)},[T]),$=(0,a.useCallback)(()=>{v(null),w&&I(()=>w)},[w,I]);return{batch:s,draft:l,notFound:r,saveState:o,refresh:B,save:z,edit:I,undo:M,canUndo:u,conflictCopy:w,restoreConflictCopy:$,dismissConflictCopy:()=>v(null),version:()=>x.current,replace:e=>N(e,!0)}}(l,{onConflict:()=>eE.c.info(c.importBatch.conflict)}),{batch:d,draft:m,notFound:u}=o,h=function(e){let[t,s]=(0,a.useState)(null);return(0,a.useEffect)(()=>{if(!e)return;let t=!1,a=new Image;return a.onload=()=>{t||s({url:e,width:a.naturalWidth,height:a.naturalHeight})},a.src=e,()=>{t=!0}},[e]),t&&t.url===e?t:null}(d?.source==="image"?d.imageData:null),[p,f]=(0,a.useState)(null),[g,y]=(0,a.useState)(null),[b,j]=(0,a.useState)(!1),[w,v]=(0,a.useState)("ai"),k=(0,a.useRef)(null),[N,B]=(0,a.useState)(null);if(m!==N&&(B(m),m&&d?.source==="text")){let e=J(m,"text");v(e.length>0&&e.every(e=>e.answer?.trim())?"tags":"ai")}if((0,a.useEffect)(()=>{(0,e0.x)().then(f)},[]),(0,a.useEffect)(()=>{d?.unread&&k.current!==`${d.id}:${d.phase}:${d.counts.active}`&&(k.current=`${d.id}:${d.phase}:${d.counts.active}`,(0,eF.f)(d.id).catch(e=>eP.V.warn("[ImportBatch]","Mark read failed",{error:e})))},[d]),u)return(0,t.jsx)("main",{className:"mx-auto max-w-3xl px-4 py-6 md:px-8 md:py-8",children:(0,t.jsx)(eW.f,{icon:r.f,title:c.importBatch.notFound,action:(0,t.jsx)(s.default,{href:"/import-tasks",children:(0,t.jsx)(ex.f,{children:c.importTasks.viewTasks})})})});if(!d||null===p||"image"===d.source&&"draft"===d.status&&!h)return(0,t.jsx)(eY.f,{});let S=async e=>{j(!0);try{await e()}catch(t){let e=(0,eF.n)(t);e?(o.replace(e),eE.c.info(c.importBatch.conflict)):eE.c.error((0,e$.f)(t,c))}finally{j(!1)}},C=async()=>{if(m){y(c.importBatch.submitting);try{let e;if(!await o.save())return;if("image"===d.source){if(!d.imageData)throw Error("IMAGE_EMPTY");let t=await (0,eR.y)(d.imageData),a=J(m,"image");e=[];let s=0;for(let i of a){y(c.importBatch.cropping.replace("{done}",String(e.length+1)).replace("{total}",String(a.length)));let r=await (0,eR.M)(t,i.regions);s+=r.bytes,e.push({key:i.key,imageBase64:r.dataUrl,imageInfo:{outputWidth:r.width,outputHeight:r.height,outputBytes:r.bytes,quality:r.quality}})}if(e.reduce((e,t)=>e+t.imageBase64.length,0)>0x3c00000)return void eE.c.error(c.errors.IMPORT_BATCH_TOO_LARGE);y(c.importBatch.uploadingImages.replace("{count}",String(e.length)).replace("{size}",`${(s/1024/1024).toFixed(1)}MB`))}o.replace(await (0,eF.g)(d.id,o.version(),e,w)),window.scrollTo({top:0})}catch(t){eP.V.error("[ImportBatch]","Start failed",{error:t});let e=(0,eF.n)(t);e?(o.replace(e),eE.c.info(c.importBatch.conflict)):eE.c.error((0,e$.f)(t,c))}finally{y(null)}}},z=async()=>{await (0,eE.u)(c.importBatch.discardConfirm)&&await S(async()=>{await (0,eF.o)(d.id),eE.c.success(c.importBatch.discarded),n.push("/import-tasks")})},T=()=>S(async()=>{o.replace(await (0,eF.s)(d.id)),eE.c.info(c.importTasks.retried)}),A=`${c.importBatch.source[d.source]} \xb7 ${c.importBatch.phase[d.phase]}`;return(0,t.jsxs)("main",{className:"mx-auto max-w-4xl space-y-4 px-4 py-6 md:px-8 md:py-8",children:[(0,t.jsx)(eX.f,{backHref:"/import-tasks",title:c.importBatch.title,description:A}),"splitting"===d.phase||"failed"===d.phase?(0,t.jsx)(e_,{batch:d,busy:b,onRetry:T,onDiscard:z}):"draft"===d.status&&m?(0,t.jsx)(eD,{batch:d,draft:m,onEdit:o.edit,onUndo:o.undo,canUndo:o.canUndo,saveState:o.saveState,image:h,confirmBeforeImport:p,starting:g,onStart:C,onDiscard:z,analysisMode:w,onAnalysisModeChange:v,hasConflictCopy:!!o.conflictCopy,onRestoreConflict:o.restoreConflictCopy,onDismissConflict:o.dismissConflictCopy}):(0,t.jsx)(eQ,{batch:d,image:h,busy:b,onRetryFailed:T,onRetryOne:e=>S(async()=>{await (0,eZ.R)(e.id),eE.c.info(c.importTasks.retried),await o.refresh()}),onConfirmAll:()=>S(async()=>{let e=await (0,eF.J)(d.id);o.replace(e.batch),eE.c.success(c.importBatch.confirmAllDone.replace("{count}",String(e.saved)))})})]})}],864272)}]);
@@ -0,0 +1,15 @@
1
+ (()=>{"use strict";(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,399847,e=>{var t=e.i(456420);let s={name:"circle-alert",size:24,node:[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["line",{x1:"12",x2:"12",y1:"8",y2:"12",key:"1pkeuh"}],["line",{x1:"12",x2:"12.01",y1:"16",y2:"16",key:"4dfq90"}]],aliases:["alert-circle"]};s.node;let r=(0,t.f)(s);e.s(["f",0,r],399847)},13285,e=>{var t=e.i(456420);let s={name:"layers",size:24,node:[["path",{d:"M12.83 2.18a2 2 0 0 0-1.66 0L2.6 6.08a1 1 0 0 0 0 1.83l8.58 3.91a2 2 0 0 0 1.66 0l8.58-3.9a1 1 0 0 0 0-1.83z",key:"zw3jo"}],["path",{d:"M2 12a1 1 0 0 0 .58.91l8.6 3.91a2 2 0 0 0 1.65 0l8.58-3.9A1 1 0 0 0 22 12",key:"1wduqc"}],["path",{d:"M2 17a1 1 0 0 0 .58.91l8.6 3.91a2 2 0 0 0 1.65 0l8.58-3.9A1 1 0 0 0 22 17",key:"kqbvx6"}]],aliases:["layers-3"]};s.node;let r=(0,t.f)(s);e.s(["f",0,r],13285)},615568,168148,e=>{var t=e.i(456420);let s={name:"pencil-line",size:24,node:[["path",{d:"M13 21h8",key:"1jsn5i"}],["path",{d:"m15 5 4 4",key:"1mk7zo"}],["path",{d:"M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z",key:"1a8usu"}]]};s.node;let r=(0,t.f)(s);e.s(["f",0,r],615568);var a=e.i(843476),n=e.i(271645),i=e.i(30030),l=e.i(248425),o=Object.defineProperty,d=(e,t)=>o(e,"name",{value:t,configurable:!0}),u="Progress",[c,m]=(0,i.f)(u),[f,h]=c(u),p=n.forwardRef(d(function(e,t){let{__scopeProgress:s,value:r=null,max:n,getValueLabel:i=x,...o}=e;(n||0===n)&&!v(n)&&console.error(b(`${n}`,"Progress"));let d=v(n)?n:100;null===r||j(r,d)||console.error(k(`${r}`,"Progress"));let u=j(r,d)?r:null,c=w(u)?i(u,d):void 0;return(0,a.jsx)(f,{scope:s,value:u,max:d,children:(0,a.jsx)(l.V.div,{"aria-valuemax":d,"aria-valuemin":0,"aria-valuenow":w(u)?u:void 0,"aria-valuetext":c,role:"progressbar","data-state":y(u,d),"data-value":u??void 0,"data-max":d,...o,ref:t})})},"Progress")),g=n.forwardRef(d(function(e,t){let{__scopeProgress:s,...r}=e,n=h("ProgressIndicator",s);return(0,a.jsx)(l.V.div,{"data-state":y(n.value,n.max),"data-value":n.value??void 0,"data-max":n.max,...r,ref:t})},"ProgressIndicator"));function x(e,t){return`${Math.round(e/t*100)}%`}function y(e,t){return null==e?"indeterminate":e===t?"complete":"loading"}function w(e){return"number"==typeof e}function v(e){return w(e)&&!isNaN(e)&&e>0}function j(e,t){return w(e)&&!isNaN(e)&&e<=t&&e>=0}function b(e,t){return`Invalid prop \`max\` of value \`${e}\` supplied to \`${t}\`. Only numbers greater than 0 are valid max values. Defaulting to \`100\`.`}function k(e,t){return`Invalid prop \`value\` of value \`${e}\` supplied to \`${t}\`. The \`value\` prop must be:
2
+ - a positive number
3
+ - less than the value passed to \`max\` (or 100 if no \`max\` prop is set)
4
+ - \`null\` or \`undefined\` if the progress is indeterminate.
5
+
6
+ Defaulting to \`null\`.`}d(x,"defaultGetValueLabel"),d(y,"getProgressState"),d(w,"isNumber"),d(v,"isValidMaxNumber"),d(j,"isValidValueNumber"),d(b,"getInvalidMaxError"),d(k,"getInvalidValueError");var N=e.i(975157);let S=n.forwardRef(({className:e,value:t,...s},r)=>(0,a.jsx)(p,{ref:r,value:t,className:(0,N.f)("relative h-4 w-full overflow-hidden rounded-full bg-secondary",e),...s,children:(0,a.jsx)(g,{className:"h-full w-full flex-1 bg-primary transition-all",style:{transform:`translateX(-${100-(t||0)}%)`}})}));S.displayName=p.displayName,e.s(["f",0,S],168148)},866531,497346,183444,e=>{var t=e.i(843476),s=e.i(271645),r=e.i(632781),a=e.i(741120),n=e.i(856522),i=e.i(314381),l=e.i(3198),o=e.i(519455),d=e.i(111110),u=e.i(41931),c=e.i(294114),m=e.i(201276);function f({data:e,onChange:a}){let{t:n}=(0,d.b)(),[h,p]=(0,s.useState)(!1),[g,x]=(0,s.useState)(null),y=async()=>{if(!e.questionText.trim())return void c.c.warning(n.editor.enterQuestionFirst||"Please enter question text first");if(!e.answerText.trim())return void c.c.warning(n.geogebra.answerRequired);p(!0),x(null);try{let t=await u.k.post("/api/geogebra-analyze",{questionText:e.questionText,answerText:e.answerText,analysis:e.analysis},{timeout:18e4,recoverable:!0});t.suitable&&t.commands&&t.commands.length>0?a({geogebraCommands:JSON.stringify(t.commands)}):x(t.description||n.geogebra.notSuitable)}catch(e){m.V.error("[CorrectionEditor]","GeoGebra analysis failed",{error:e}),x(n.geogebra.analyzeFailed)}finally{p(!1)}};return e.geogebraCommands?(0,t.jsx)(l.f,{commands:e.geogebraCommands,height:350,onRegenerate:y,onDelete:async()=>a({geogebraCommands:void 0})}):e.questionText.trim()&&e.answerText.trim()?(0,t.jsxs)("div",{className:"rounded-lg border border-dashed p-4",children:[(0,t.jsxs)("div",{className:"flex items-center justify-between",children:[(0,t.jsxs)("div",{className:"flex items-center gap-2 text-sm text-muted-foreground",children:[(0,t.jsx)(i.f,{className:"h-4 w-4"}),(0,t.jsx)("span",{children:n.geogebra.title})]}),(0,t.jsx)(o.f,{variant:"outline",size:"sm",onClick:y,disabled:h,children:h?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(r.f,{className:"mr-2 h-4 w-4 animate-spin"}),n.geogebra.analyzing]}):(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(i.f,{className:"mr-2 h-4 w-4"}),n.geogebra.generate]})})]}),g&&(0,t.jsx)("p",{className:"text-xs text-muted-foreground mt-2",children:g}),(0,t.jsx)("p",{className:"text-xs text-muted-foreground mt-2",children:n.geogebra.hint})]}):null}var h=e.i(469937),p=e.i(28342),g=e.i(438465),x=e.i(674166),y=e.i(110204),w=e.i(967489),v=e.i(401280);function j({data:e,paperLevel:s,onChange:r}){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)(y.f,{children:a.editor.selectNotebook||"Select Notebook"}),(0,t.jsx)(g.f,{value:e.subjectId,onChange:e=>r({subjectId:e})})]}),(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsx)(y.f,{children:a.questionType.label||"Question Type"}),(0,t.jsxs)(w.d,{value:e.questionType||"",onValueChange:e=>r({questionType:e===v.O?null:e}),children:[(0,t.jsx)(w.P,{children:(0,t.jsx)(w.U,{placeholder:a.questionType.notSet||"Not set"})}),(0,t.jsxs)(w.r,{children:[(0,t.jsx)(w.T,{value:v.O,children:a.questionType.clear||"Clear"}),v.V.map(e=>(0,t.jsx)(w.T,{value:e,children:a.questionType.names?.[e]||e},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)(y.f,{htmlFor:"correction-grade-semester",children:a.editor.gradeSemester||"Grade/Semester"}),(0,t.jsx)(p.f,{id:"correction-grade-semester",value:e.gradeSemester||"",onChange:e=>r({gradeSemester:e})})]}),(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsx)(y.f,{children:a.editor.paperLevel||"Paper Level"}),(0,t.jsx)(x.f,{value:s,onChange:e=>r({paperLevel:e})})]})]}),(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsx)(y.f,{children:a.difficulty.label}),(0,t.jsx)("div",{children:(0,t.jsx)(h.f,{size:"md",value:e.difficultyStars,onChange:e=>r({difficultyStars:e})})})]})]})}var b=e.i(141176),k=e.i(515288);function N({data:e,onChange:s}){let{t:r}=(0,d.b)();return(0,t.jsxs)(k.N,{children:[(0,t.jsx)(k.Y,{children:(0,t.jsx)(k.v,{children:r.editor.mistakeAnalysisTitle||"Mistake Analysis"})}),(0,t.jsxs)(k.O,{className:"space-y-4",children:[(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsx)(y.f,{children:r.editor.mistakeStatus||"Attempt Status"}),(0,t.jsxs)(w.d,{value:e.mistakeStatus||"unknown",onValueChange:e=>s({mistakeStatus:e}),children:[(0,t.jsx)(w.P,{children:(0,t.jsx)(w.U,{})}),(0,t.jsxs)(w.r,{children:[(0,t.jsx)(w.T,{value:"not_attempted",children:r.editor.mistakeStatuses?.notAttempted||"Not attempted"}),(0,t.jsx)(w.T,{value:"wrong_attempt",children:r.editor.mistakeStatuses?.wrongAttempt||"Wrong attempt"}),(0,t.jsx)(w.T,{value:"unknown",children:r.editor.mistakeStatuses?.unknown||"Unknown"})]})]})]}),(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsx)(y.f,{children:r.editor.wrongAnswerText||"Wrong Answer / Work"}),(0,t.jsx)(b.f,{value:e.wrongAnswerText||"",onChange:t=>s({wrongAnswerText:t,mistakeStatus:t.trim()?"wrong_attempt":e.mistakeStatus}),className:"min-h-[100px] font-mono text-sm",placeholder:r.editor.wrongAnswerPlaceholder||"Leave blank if no wrong answer is visible"})]}),(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsx)(y.f,{children:r.editor.mistakeAnalysis||"Mistake Cause Analysis"}),(0,t.jsx)(b.f,{value:e.mistakeAnalysis||"",onChange:e=>s({mistakeAnalysis:e}),className:"min-h-[140px] font-mono text-sm",placeholder:r.editor.mistakeAnalysisPlaceholder||"Explain where and why the mistake happened"})]})]})]})}var S=e.i(511445),T=e.i(149704);function A({title:e,children:s,className:r}){return(0,t.jsxs)(k.N,{children:[(0,t.jsx)(k.Y,{children:(0,t.jsx)(k.v,{children:e})}),(0,t.jsx)(k.O,{className:r,children:s})]})}function I({data:e,children:s}){let{t:r}=(0,d.b)(),a={wrong_attempt:r.editor.mistakeStatuses?.wrongAttempt||"Wrong attempt",not_attempted:r.editor.mistakeStatuses?.notAttempted||"Not attempted",unknown:r.editor.mistakeStatuses?.unknown||"Unknown"};return(0,t.jsxs)("div",{className:"space-y-6",children:[(0,t.jsxs)(A,{title:r.editor.preview?.question||"Question Preview",children:[(0,t.jsx)(S.f,{content:e.questionText}),(0,t.jsx)(T.f,{svg:e.figureSvg})]}),s,(0,t.jsx)(A,{title:r.editor.preview?.answer||"Answer Preview",children:(0,t.jsx)(S.f,{content:e.answerText})}),(0,t.jsx)(A,{title:r.editor.preview?.analysis||"Analysis Preview",children:(0,t.jsx)(S.f,{content:e.analysis})}),(0,t.jsxs)(A,{title:r.editor.preview?.mistakeAnalysis||"Mistake Analysis Preview",className:"space-y-3 text-sm",children:[(0,t.jsxs)("div",{className:"text-muted-foreground",children:[r.editor.mistakeStatus||"Attempt Status",r.common.colon,a[e.mistakeStatus]??a.unknown]}),e.wrongAnswerText&&(0,t.jsxs)("div",{children:[(0,t.jsx)("div",{className:"font-medium mb-1",children:r.editor.wrongAnswerText||"Wrong Answer / Work"}),(0,t.jsx)(S.f,{content:e.wrongAnswerText})]}),e.mistakeAnalysis&&(0,t.jsxs)("div",{children:[(0,t.jsx)("div",{className:"font-medium mb-1",children:r.editor.mistakeAnalysis||"Mistake Cause Analysis"}),(0,t.jsx)(S.f,{content:e.mistakeAnalysis})]})]})]})}var E=e.i(574041),_=e.i(215519),$=e.i(306831);e.i(676167);var C=e.i(597138),M=e.i(991722),q=e.i(470279),R=e.i(303163);e.s(["f",0,function({initialData:e,onSave:i,onCancel:l,imagePreview:h,initialSubjectId:p,aiTimeout:g}){let{timeZone:x}=(0,_.M)(),{t:w,language:v}=(0,d.b)(),S=e=>e.trim()?e:"",[T,A]=(0,s.useState)({...e,answerText:S(e.answerText),analysis:S(e.analysis),wrongAnswerText:e.wrongAnswerText||"",mistakeAnalysis:e.mistakeAnalysis||"",mistakeStatus:e.mistakeStatus||"unknown",subjectId:p,gradeSemester:e.gradeSemester||""}),O=(0,s.useRef)(!1),P=e=>{"gradeSemester"in e&&(O.current=!0),A(t=>({...t,...e}))},{groups:U}=(0,q.f)(),L=(()=>{if(T.paperLevel)return T.paperLevel;let e="number"==typeof T.difficultyStars&&T.difficultyStars>=4?"b":"a";return U.find(t=>t.key===e&&t.isActive)?.id||""})(),V=T.paperLevel??L,[F,z]=(0,s.useState)(!1),[D,G]=(0,s.useState)(!1),[Q,H]=(0,s.useState)(!1),[W,B]=(0,s.useState)(void 0),[J,X]=(0,s.useState)([]);(0,s.useEffect)(()=>{u.k.get("/api/notebooks").then(X).catch(e=>m.V.error("[CorrectionEditor]","Failed to fetch notebooks",{error:e})),u.k.get("/api/user").then(e=>{if(H(!!e?.enableGeogebra),e){let t=function(e,t=$.J){return"ai"===e.gradeRecognitionMode?null:e.fixedGradeSemester?e.fixedGradeSemester:e.educationStage&&e.enrollmentYear?function(e,t,s=new Date,r="en",a=$.J){let n=(0,$.c)(s,a),i=n.getFullYear(),l=n.getMonth()+1,o=i-t,d="2nd";l>=9?(o+=1,d="1st"):d=l<2?"1st":"2nd";let u="zh"===r,c=u?"1st"===d?"上期":"下期":"1st"===d?"1st Semester":"2nd Semester",m=(u?{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?u?"已毕业":"Graduated":u?"学前":"Pre-school",!u)return`${f}, ${c}`;{let e="1st"===d?"上":"下";return`${f}${e}`}}(e.educationStage,e.enrollmentYear,new Date,"zh",t):null}(e,x);A(e=>e.gradeSemester||O.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}))},[v,x]);let Y=async()=>{if(!T.questionText.trim())return void c.c.warning(w.editor.enterQuestionFirst||"Please enter question text first");z(!0);try{let e=function({questionText:e,language:t,subject:s,imagePreview:r,gradeSemester:a,subjectId:n}){let i={questionText:e,language:t,subject:s};return r&&(i.imageBase64=r),a&&(i.gradeSemester=a),n&&(i.subjectId=n),i}({questionText:T.questionText,language:v,subject:T.subject,imagePreview:h,gradeSemester:T.gradeSemester??void 0,subjectId:T.subjectId});m.V.info("[Reanswer]",e.imageBase64?"Sending image + text (image available for mistake analysis)":"Sending text only (no image available)",{timeout:g});let t=await u.k.post("/api/reanswer",e,{timeout:g||18e4,recoverable:!0});A(e=>({...e,answerText:t.answerText,analysis:t.analysis,knowledgePoints:t.knowledgePoints,wrongAnswerText:t.wrongAnswerText||"",mistakeAnalysis:t.mistakeAnalysis||"",mistakeStatus:(0,M.x)(t.mistakeStatus,t.wrongAnswerText),difficultyStars:t.difficultyStars??e.difficultyStars,questionType:t.questionType??e.questionType})),c.c.success(w.editor.reanswerSuccess||"✅ Answer and analysis updated!")}catch(r){let e,t,s;m.V.error("[CorrectionEditor]","Reanswer failed",{error:r}),c.c.error((e=(0,R.d)(r)||"",s=(t=w.errors?.reanswer||{}).default||"Reanswer failed",e.includes("AI_AUTH_ERROR")?t.authError||w.errors?.AI_AUTH_ERROR||s:e.includes("AI_CONNECTION_FAILED")?t.connectionFailed||w.errors?.AI_CONNECTION_FAILED||s:e.includes("AI_RESPONSE_ERROR")&&(t.responseError||w.errors?.AI_RESPONSE_ERROR)||s))}finally{z(!1)}},Z=async()=>{if(!T.subjectId)return void c.c.warning(w.editor.messages?.selectNotebook||"Please select a notebook");if(!D){G(!0);try{await i({...T,paperLevel:V,mistakeStatus:(0,M.x)(T.mistakeStatus,T.wrongAnswerText)})}finally{G(!1)}}},K=w.editor.placeholder||"Supports Markdown and LaTeX...",ee=(0,C.f)(J.find(e=>e.id===T.subjectId)?.name||null)||(0,C.f)(T.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:w.editor.title}),(0,t.jsxs)("div",{className:"flex gap-2",children:[(0,t.jsx)(o.f,{variant:"outline",onClick:l,children:w.editor.cancel}),(0,t.jsxs)(o.f,{onClick:Z,disabled:D,children:[D?(0,t.jsx)(r.f,{className:"mr-2 h-4 w-4 animate-spin"}):(0,t.jsx)(n.f,{className:"mr-2 h-4 w-4"}),D?w.common?.pleaseWait||"Please wait...":w.editor.save]})]})]}),(0,t.jsxs)("div",{className:"grid gap-6 lg:grid-cols-2",children:[(0,t.jsxs)("div",{className:"space-y-6",children:[h&&(0,t.jsx)(k.N,{children:(0,t.jsx)(k.O,{className:"p-4",children:(0,t.jsx)("img",{src:h,alt:"Original",className:"w-full rounded-md"})})}),(0,t.jsx)(j,{data:T,paperLevel:V,onChange:P}),(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsx)(y.f,{children:w.editor.question}),(0,t.jsx)(b.f,{value:T.questionText,onChange:e=>P({questionText:e}),className:"min-h-[150px] font-mono text-sm",placeholder:K}),(0,t.jsx)(o.f,{variant:"default",size:"sm",onClick:Y,disabled:F||!T.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:F?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(r.f,{className:"mr-2 h-4 w-4 animate-spin"}),w.editor.reanswering||"AI solving..."]}):(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(a.f,{className:"mr-2 h-4 w-4"}),w.editor.reanswer||"🔄 Reanswer (based on corrected question)"]})}),(0,t.jsx)("p",{className:"text-xs text-muted-foreground",children:w.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)(y.f,{children:w.editor.tags}),(0,t.jsx)(E.f,{value:T.knowledgePoints,onChange:e=>P({knowledgePoints:e}),placeholder:w.editor.tagsPlaceholder||"Enter knowledge tags...",enterHint:w.editor.createTagHint,subject:ee,gradeStage:W}),(0,t.jsx)("p",{className:"text-xs text-muted-foreground",children:w.editor.tagsHint||"💡 Tag suggestions will appear as you type"})]}),(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsx)(y.f,{children:w.editor.answer}),(0,t.jsx)(b.f,{value:T.answerText,onChange:e=>P({answerText:e}),className:"min-h-[100px] font-mono text-sm",placeholder:K})]}),(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsx)(y.f,{children:w.editor.analysis}),(0,t.jsx)(b.f,{value:T.analysis,onChange:e=>P({analysis:e}),className:"min-h-[200px] font-mono text-sm",placeholder:K})]}),(0,t.jsx)(N,{data:T,onChange:P})]}),(0,t.jsx)(I,{data:T,children:Q&&(0,t.jsx)(f,{data:T,onChange:P})})]})]})}],866531);var O=e.i(853138),P=e.i(263676);e.s(["f",0,function({message:e,onDismiss:s}){let{t:r}=(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)(O.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:s,"aria-label":r.common.close,className:"shrink-0 rounded p-1 hover:bg-destructive/10",children:(0,t.jsx)(P.X,{"aria-hidden":"true",className:"h-4 w-4"})})]}):null}],497346);var U=e.i(618566);function L(e){return"object"!=typeof e||null===e||Array.isArray(e)?void 0:e}function V(e,t){if("string"!=typeof e||!/^(QUESTION_SAVE_|AI_)[A-Z_]+$/.test(e))return;let s=t.errors[e];return"string"==typeof s?s:void 0}e.s(["f",0,function(e){let{t}=(0,d.b)(),r=(0,U.useRouter)(),[a,n]=(0,s.useState)(null),i=async(s,a,i=!0)=>{n(null);try{let e=await s();return c.c.success(e.duplicate?t.importFlow.duplicate:t.common.messages.saveSuccess),i&&(e.duplicate?r.push(`/error-items/${e.id}`):a&&r.push(`/notebooks/${a}`)),!0}catch(r){m.V.error(e,"Save failed",{errorMessage:(0,R.d)(r)??(0,R.Z)(r)});let s=function(e,t){let s=L(e),r=L(s?.data),a="number"==typeof s?.status?s.status:void 0,n=(0,R.d)(e),i=V(n,t)??V(r?.code,t),l={400:t.errors.QUESTION_SAVE_INVALID_INPUT,401:t.errors.QUESTION_SAVE_UNAUTHORIZED,403:t.errors.QUESTION_SAVE_FORBIDDEN,408:t.errors.QUESTION_SAVE_TIMEOUT,409:t.errors.QUESTION_SAVE_CONFLICT,413:t.errors.QUESTION_SAVE_TOO_LARGE,429:t.errors.QUESTION_SAVE_RATE_LIMITED,502:t.errors.QUESTION_SAVE_SERVER_UNAVAILABLE,503:t.errors.QUESTION_SAVE_SERVER_UNAVAILABLE,504:t.errors.QUESTION_SAVE_TIMEOUT},o=i??(a?l[a]:void 0)??t.errors.QUESTION_SAVE_FAILED;!a&&(e instanceof TypeError||/fetch|network|load failed/i.test((0,R.Z)(e)))&&(o=t.errors.QUESTION_SAVE_NETWORK_ERROR);let d=L(r?.details);if("QUESTION_SAVE_GRADE_FAILED"===n){let e=V(d?.reason,t);e&&(o+=`
7
+ ${e}`)}return 400===a&&(o+=(function(e,t){if(!Array.isArray(e))return[];let s={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 r=L(e),a=r?.path,n=Array.isArray(a)&&"string"==typeof a[0]?s[a[0]]:void 0;if(!n)return[];let i=r?.maximum,l=t.questionSave.invalidField;return r?.code==="too_big"&&"number"==typeof i&&Number.isSafeInteger(i)&&i>=0&&(l="array"===r.origin?t.questionSave.tooMany:t.questionSave.tooLong),[l.replace("{field}",n).replace("{maximum}",String(i))]})})(r?.details,t).map(e=>`
8
+ ${e}`).join("")),"string"==typeof d?.databaseCode&&/^P\d{4}$/.test(d.databaseCode)&&(o+=`
9
+ ${t.questionSave.databaseCode.replace("{code}",d.databaseCode)}`),a&&(o+=` (HTTP ${a})`),o}(r,t);return n(s),"AI_DAILY_LIMIT_EXCEEDED"!==(0,R.d)(r)&&c.c.error(s),!1}};return{saveError:a,setSaveError:n,dismissSaveError:()=>n(null),run:i}}],183444)},731335,532377,339501,e=>{var t=e.i(843476),s=e.i(399847),r=e.i(551757),a=e.i(456420);let n={name:"clock-3",size:24,node:[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 6v6h4",key:"135r8i"}]]};n.node;let i=(0,a.f)(n);var l=e.i(632781),o=e.i(615568),d=e.i(487486),u=e.i(519455),c=e.i(168148),m=e.i(111110),f=e.i(215519),h=e.i(306831);let p=["read","convert","crop","compress","upload"],g=["receive","analyze","save"];function x(e){if(!Number.isFinite(e)||e<0)return"-";if(e<1e3)return`${Math.round(e)}ms`;let t=e/1e3;if(t<60)return`${t.toFixed(+(t<10))}s`;let s=Math.round(t);return`${Math.floor(s/60)}:${String(s%60).padStart(2,"0")}`}var y=e.i(975157);let w={analyzing:50,saving:90},v={analyzing:l.f,saving:l.f,review:o.f,saved:r.f,failed:s.f};e.s(["f",0,function({task:e,now:s,onReview:r,onViewItem:a,onRetry:n,onDiscard:l}){let{t:o}=(0,m.b)(),{timeZone:j}=(0,f.M)(),b=v[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,T=function(e){let t=[];for(let s of p){let r=e?.client?.[s];"number"==typeof r&&t.push({stage:s,ms:r})}for(let s of g){let r=e?.server?.[s];"number"==typeof r&&t.push({stage:s,ms:r})}return t}(e.timings),A=k&&s?s-Date.parse(e.createdAt):null;return(0,t.jsxs)("div",{className:(0,y.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,y.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)(c.f,{value:w[e.status],"aria-label":o.importTasks.stageEstimate,"aria-valuetext":o.common.progress.estimated.replace("{percent}",String(w[e.status])),className:"h-1.5"}),e.excerpt&&(0,t.jsx)("p",{className:"break-words text-muted-foreground",children:e.excerpt}),"saved"===e.status&&!e.errorItemId&&(0,t.jsx)("p",{className:"text-xs text-muted-foreground",children:o.importTasks.itemDeleted}),"saved"===e.status&&e.errorItemId&&(0,t.jsx)("p",{className:"text-xs text-green-700 dark:text-green-300",children:e.duplicate?o.importTasks.duplicateSaved:o.importTasks.savedTo.replace("{notebook}",e.notebookName||"-").replace("{id}",e.errorItemShortId||"-")}),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)(i,{className:"h-3 w-3"}),o.importTasks.createdAt.replace("{time}",(0,h.r)(e.createdAt,"MM-dd HH:mm",j))]}),null!==A&&(0,t.jsx)("span",{children:o.importTasks.elapsed.replace("{time}",x(A))}),e.attempts>1&&(0,t.jsx)("span",{children:o.importTasks.attempts.replace("{count}",String(e.attempts))})]}),T.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:T.map(({stage:e,ms:s})=>(0,t.jsxs)("li",{children:[o.importTasks.timings[e]," ",x(s)]},e))})]})]}),(0,t.jsxs)("div",{className:"flex flex-wrap justify-end gap-2",children:["review"===e.status&&r&&(0,t.jsx)(u.f,{size:"sm",onClick:r,children:o.importTasks.continueReview}),"saved"===e.status&&e.errorItemId&&a&&(0,t.jsx)(u.f,{size:"sm",variant:"outline",onClick:a,children:o.importTasks.viewItem}),"failed"===e.status&&n&&(0,t.jsx)(u.f,{size:"sm",onClick:n,children:o.importTasks.retry}),"saving"!==e.status&&"saved"!==e.status&&l&&(0,t.jsx)(u.f,{size:"sm",variant:"ghost",onClick:l,children:o.importTasks.discard})]})]})}],731335);var j=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)(),s=(0,j.useRouter)(),r=e=>{e.unread&&(0,S.N)(e.id).catch(e=>N.V.warn("[ImportTasks]","Mark read failed",{error:e}))};return{openReview:e=>{r(e),s.push(`/import-tasks/${e.id}`)},viewItem:e=>{e.errorItemId&&(r(e),s.push(`/error-items/${e.errorItemId}`))},markRead:r,retry:async s=>{try{await (0,S.R)(s.id),k.c.info(t.importTasks.retried)}catch(e){k.c.error((0,b.f)(e,t))}e?.()},discard:async s=>{if(!await (0,k.u)(t.importTasks.discardConfirm))return!1;let r=!1;try{await (0,S.x)(s.id),k.c.success(t.importTasks.discarded),r=!0}catch(e){k.c.error((0,b.f)(e,t))}return e?.(),r}}}],532377);var T=e.i(271645);e.s(["f",0,function(e,t=1e3){let[s,r]=(0,T.useState)(()=>Date.now());return(0,T.useEffect)(()=>{if(!e)return;let s=setInterval(()=>r(Date.now()),t);return()=>clearInterval(s)},[e,t]),s}],339501)},499930,e=>{var t=e.i(213761);function s(e,t=.008){let r=Math.max(0,e.x-t),a=Math.max(0,e.y-t);return{x:r,y:a,width:Math.min(1,e.x+e.width+t)-r,height:Math.min(1,e.y+e.height+t)-a}}async function r(e){let t=new Image;if(t.decoding="async",t.src=e,await t.decode(),!t.naturalWidth||!t.naturalHeight)throw Error("IMAGE_EMPTY");return t}async function a(e,s){let r=function(e,t=16,s=!1){let r=Math.max(...e.map(e=>e.width)),a=0,n=e.map(e=>{let n=s?r/e.width:e.scale??1,i={x:0,y:a,width:Math.round(e.width*n),height:Math.round(e.height*n)};return a+=i.height+t,i});return{width:Math.max(...n.map(e=>e.width)),height:a-t,rects:n}}(e.map(e=>({width:e.sw,height:e.sh,scale:e.scale})),16,s),a=document.createElement("canvas");a.width=r.width,a.height=r.height;let n=a.getContext("2d");if(!n)throw Error("CANVAS_UNSUPPORTED");n.fillStyle="#ffffff",n.fillRect(0,0,a.width,a.height),e.forEach((e,t)=>{let s=r.rects[t];n.drawImage(e.source,e.sx,e.sy,e.sw,e.sh,s.x,s.y,s.width,s.height)});let i=await createImageBitmap(a);try{return await (0,t.X)({source:i,width:a.width,height:a.height})}finally{i.close()}}async function n(e,r){let n=e.naturalWidth,i=e.naturalHeight,l=r.map(e=>s(e));return 1===l.length?(0,t.X)({source:e,width:n,height:i},l[0]):a(l.map(t=>({source:e,sx:Math.round(t.x*n),sy:Math.round(t.y*i),sw:Math.max(1,Math.round(t.width*n)),sh:Math.max(1,Math.round(t.height*i))})),!1)}async function i(e){return a((await Promise.all(e.map(r))).map(e=>({source:e,sx:0,sy:0,sw:e.naturalWidth,sh:e.naturalHeight})),!0)}async function l(e,t,r){let n=e.naturalWidth,i=e.naturalHeight,l=r.width/n,o=t.map(e=>s(e)).map(t=>({source:e,sx:Math.round(t.x*n),sy:Math.round(t.y*i),sw:Math.max(1,Math.round(t.width*n)),sh:Math.max(1,Math.round(t.height*i)),scale:l}));return o.push({source:r.source,sx:0,sy:0,sw:r.width,sh:r.height}),a(o,!1)}e.s(["y",0,r,"k",0,l,"M",0,n,"v",0,i])},119472,e=>{var t=e.i(41931),s=e.i(127175);async function r(e){let t;for(let s=0;s<3;s++)try{return await e()}catch(e){if(t=e,!function(e){let t=e?.status;return void 0===t||408===t||502===t||503===t||504===t}(e)||2===s)break;await new Promise(e=>setTimeout(e,1e3*(s+1)))}throw t}async function a(e,n=(0,s.c)()){let{batch:i}=await r(()=>t.k.post("/api/import-batches",{...e,clientRequestId:n,subjectId:e.subjectId||void 0,targetSubjectId:e.targetSubjectId||void 0,paperLevel:e.paperLevel||void 0,items:e.items?.map(e=>({...e})),origin:e.origin},{timeout:12e4}));return(0,s.P)(),i}async function n(e,s={}){let r=s.image?"?include=image":"",{batch:a}=await t.k.get(`/api/import-batches/${encodeURIComponent(e)}${r}`);return a}async function i(e,s,r){let{batch:a}=await t.k.patch(`/api/import-batches/${encodeURIComponent(e)}`,{version:s,draft:r});return a}async function l(e,a,n,i){let{batch:l}=await r(()=>t.k.post(`/api/import-batches/${encodeURIComponent(e)}/start`,{version:a,images:n,analysis:i},{timeout:12e4}));return(0,s.P)(),l}async function o(e){let{batch:r}=await t.k.post(`/api/import-batches/${encodeURIComponent(e)}/retry`,{});return(0,s.P)(),r}async function d(e){let r=await t.k.post(`/api/import-batches/${encodeURIComponent(e)}/confirm-all`,{});return(0,s.P)(),r}async function u(e){await t.k.delete(`/api/import-batches/${encodeURIComponent(e)}`),(0,s.P)()}async function c(e){await t.k.post(`/api/import-batches/${encodeURIComponent(e)}/read`,{}),(0,s.P)()}async function m(e,s){return t.k.post(`/api/import-batches/${encodeURIComponent(e)}/fix-text`,{items:s},{timeout:6e5,recoverable:!0})}e.s(["J",0,d,"n",0,function(e){return e?.status===409?e.data?.details?.batch??null:null},"v",0,a,"o",0,u,"w",0,n,"$",0,m,"f",0,c,"s",0,o,"S",0,i,"g",0,l])},25197,e=>{var t=e.i(41931);function s(e){return e.trim()?e:""}async function r(){try{return!!(await t.k.get("/api/user")).confirmBeforeImport}catch{return!1}}async function a(e,r){let a=await t.k.post("/api/error-items",{questionText:e.questionText,answerText:s(e.answerText),analysis:s(e.analysis),wrongAnswerText:e.wrongAnswerText||null,mistakeAnalysis:e.mistakeAnalysis||null,mistakeStatus:e.mistakeStatus||"unknown",knowledgePoints:e.knowledgePoints||[],difficultyStars:e.difficultyStars??null,recognizedGradeSemester:e.gradeSemester??null,hasFigure:e.hasFigure??!1,figureSvg:e.figureSvg??null,questionType:e.questionType??null,subjectId:r.subjectId||void 0,subjectName:r.subjectId?void 0:e.subject,originalImageUrl:r.imageUrl||"",paperLevel:r.paperLevel||void 0});return{id:a.id,shortId:a.shortId??null,subjectId:a.subjectId??null,notebookName:a.subject?.name??null,duplicate:a.duplicate}}e.i(201276),e.s(["x",0,r,"a",0,a],25197)},35209,e=>{var t=e.i(271645),s=e.i(111110);e.s(["f",0,function(...e){let{t:r}=(0,s.b)(),a=[r.pageTitle.base,...e.map(e=>"string"==typeof e?e.trim():"").filter(e=>e.length>0)].join("-");(0,t.useEffect)(()=>{document.title=a},[a])}])},825624,e=>{let t=/^[\s  ]+/,s="一二三四五六七八九十",r=[{family:"dot",pattern:/^(\d{1,3})\s*(?:.|\.(?!\d))\s*/},{family:"comma",pattern:/^(\d{1,3})\s*[、,,](?!\d)\s*/},{family:"paren",pattern:/^(\d{1,3})\s*[))]\s*/},{family:"colon",pattern:/^(\d{1,3})\s*[::](?!\d)\s*/},{family:"ti",pattern:/^第\s*(\d{1,3}|[一二三四五六七八九十]{1,3})\s*题\s*[..、::]?\s*/},{family:"example",pattern:/^(?:例题?|练习|习题)\s*(\d{1,3})\s*[..、::]?\s*/},{family:"q",pattern:/^(?:Q|Question|Problem|Exercise)\s*(\d{1,3})\s*[..::)]?\s+/i},{family:"cn",pattern:/^([一二三四五六七八九十]{1,3})\s*[、..]\s*/}];function a(e){let a=e.replace(t,"");for(let{family:e,pattern:t}of r){let r=a.match(t);if(!r||a.length<=r[0].length)continue;let n=function(e){if(/^\d+$/.test(e))return Number(e);if("十"===e)return 10;let t=e.indexOf("十");return -1===t?s.indexOf(e)+1:10*(0===t?1:s.indexOf(e[0])+1)+(t===e.length-1?0:s.indexOf(e[t+1])+1)}(r[1]);if(Number.isFinite(n)&&!(n<=0))return{value:n,family:e,prefixLength:r[0].length,label:r[1]}}return null}function n(e){let s=e.split("\n"),r=s[0]?.replace(t,"")??"",n=a(r);return n&&"cn"!==n.family&&(s[0]=r.slice(n.prefixLength)),s.join("\n")}function i(e){let t=[];for(let s of e)(s||0!==t.length&&""!==t[t.length-1])&&t.push(s);for(;t.length>0&&""===t[t.length-1];)t.pop();return t.join("\n")}let l=/(姓名|班级|学号|日期|得分|分数|评分|考号|座位号|家长签字|用时|Name\s*[::_]|Class\s*[::_]|Date\s*[::_]|Score\s*[::_])|_{3,}|共\s*\d+\s*(道|题|小题)|做完|答案(见|在)|最后一页|满分\s*\d+\s*分/i,o=/(阅读|材料|短文|文章|选文|诗歌|古诗|文言文|下[面列]的?(表格|图表|统计|信息)|根据.{0,20}(回答|完成)|passage|read the|according to the)/i,d=/^(参考答案|答案与解析|答案|Answers?|Answer Key)\s*[::]?$/i,u=/^(第[一二三四五六七八九十]+(部分|大题|节)|(Part|Section)\s+[A-Z0-9IVX]+\b)/i,c=/(选择|填空|判断|计算|解答|应用|解决问题|操作|作图|阅读|写作|作文|综合|口算|听力|单项|完形|题)/,m=/(\d{1,3})\s*[~~\-—–至到]\s*(\d{1,3})\s*(?:小?题|questions?)/i,f=/(小问|小题|下列问题|以下问题|下列各题|下面各题|完成下列|回答下列|回答以下|following questions|answer the following)/i;function h(e){let t=[],s=[];for(let r of e)r?s.push(r):s.length&&(t.push(s.join("\n")),s=[]);return s.length&&t.push(s.join("\n")),t}function p(e,t){let s=[];for(let r=0;r<e.length;r++){let a=e[r],n=[a];for(let s=r+1;s<e.length;s++){let r=e[s],i=n[n.length-1];if(r.family!==a.family)continue;let l=1===r.value&&[...t].some(e=>e>i.line&&e<r.line);(r.value===i.value+1||l)&&n.push(r)}n.length>s.length&&(s=n)}return s}function g(e,t,s){return!!u.test(e)||!!t&&"cn"===t.family&&"cn"!==s&&null!==s&&(e.length<=40||c.test(e.slice(0,20)))}function x(e){let t=e.match(m);if(!t)return null;let s=Number(t[1]),r=Number(t[2]);return s<=r?{from:s,to:r}:null}let y={answer:/^(?:【\s*(?:参考答案|答案)\s*】|(?:参考答案|答案)\s*[::]|Answer\s*[::])\s*(.*)$/i,analysis:/^(?:【\s*(?:解析|分析|详解|解答|点评)\s*】|(?:解析|分析|详解|解答|点评)\s*[::])\s*(.*)$/,knowledge:/^(?:【\s*(?:知识点|考点)\s*】|(?:知识点|考点)\s*[::])\s*(.*)$/,difficulty:/^(?:【\s*难度\s*】|难度\s*[::])\s*(.*)$/,questionType:/^(?:【\s*题型\s*】|题型\s*[::])\s*(.*)$/,wrongAnswer:/^(?:【\s*错答\s*】|我的答案\s*[::]|学生答案\s*[::])\s*(.*)$/},w={易:1,较易:2,中等:3,较难:4,难:5};function v(e){return e.split(/[、,,;;]/).map(e=>e.trim()).filter(Boolean)}function j(e){let t={answer:[],analysis:[],knowledge:[],difficulty:[],questionType:[],wrongAnswer:[]},s=[],r=null;for(let a of e){let e=null;for(let s of Object.keys(y)){let n=a.match(y[s]);if(!n)continue;e=s,r=s;let i=n[1].trim();i&&t[s].push(i);break}e||(r&&a.trim()?t[r].push(a.trim()):s.push(a))}let a={},n=t.answer.join("\n").trim();n&&(a.answer=n);let l=t.analysis.join("\n").trim();l&&(a.analysis=l);let o=t.knowledge.flatMap(v);o.length&&(a.knowledgePoints=o);let d=t.difficulty.join(" ").trim(),u=d?function(e){let t=e.trim();if(!t)return null;let s=t.match(/^(\d{1,2})\s*(?:星|级)?$/);if(s){let e=Number(s[1]);return e>=1&&e<=5?e:null}if(/^[★☆]{1,5}$/.test(t)){let e=(t.match(/★/g)??[]).length;return e>=1?e:null}return t in w?w[t]:null}(d):null;null!==u&&(a.difficultyStars=u);let c=t.questionType.join(" ").trim();c&&(a.questionType=c);let m=t.wrongAnswer.join("\n").trim();return m&&(a.wrongAnswer=m),{text:i(s),fields:a}}let b=/^(\d{1,3})\s*[..、,,)]\s*(\S[\s\S]*)$/,k=/^(\d{1,3})\s*[~~—–-]\s*(\d{1,3})\s*[::..、]?\s*([A-Za-z]+)$/;function N(e,t){let s=[],r=!1;for(let a of e){let e={value:!1},n=[];for(let s of a.split("\n")){let r=s.trim()?function(e){let t=e.trim();if(!t)return null;let s=function(e){let t=e.trim().match(k);if(!t)return null;let s=Number(t[1]),r=Number(t[2]),a=t[3];if(!Number.isFinite(s)||!Number.isFinite(r)||s<=0||r<=s||r-s+1>60)return null;let n=r-s+1;return a.length!==n?null:Array.from({length:n},(e,t)=>({label:String(s+t),text:a[t]}))}(t);if(s)return s;let r=function(e){let t=e.trim(),s=[];for(let e of t.matchAll(/(\d{1,3})\s*[..、,,;;]\s*/g)){let r=e.index??0,a=t[r+e[0].length];a&&/\d/.test(a)||s.push({index:r,label:e[1],afterIndex:r+e[0].length})}if(s.length<2)return null;for(let e=1;e<s.length;e++)if(Number(s[e].label)<=Number(s[e-1].label))return null;let r=[];for(let e=0;e<s.length;e++){let a=s[e].afterIndex,n=e+1<s.length?s[e+1].index:t.length,i=t.slice(a,n).trim().replace(/[;;]+$/,"").trim();if(!i||i.length>30||/[。!?!?]/.test(i))return null;r.push({label:s[e].label,text:i})}return r}(t);if(r)return r.map(e=>({label:e.label??"",text:e.text})).filter(e=>e.label);let a=t.match(b);if(!a)return null;let n=Number(a[1]);return!Number.isFinite(n)||n<=0?null:[{label:a[1],text:a[2].trim()}]}(s):null;if(!r){s.trim()&&n.push(s);continue}let a=!1;for(let i of r){let r=t.find(e=>e.label===i.label);if(!r){n.push(s);break}a=!0,e.value=!0;let l=function(e){let t=e.match(/^(.*?)(?:【?\s*(?:解析|分析|详解|解答|点评)\s*】?\s*[::])([\s\S]*)$/);if(t){let s=t[1].replace(/^(?:【?\s*(?:参考答案|答案)\s*】?\s*[::])\s*/,"").trim(),r=t[2].trim();return r?{answer:s,analysis:r}:{answer:e.trim()}}return{answer:e.replace(/^(?:【?\s*(?:参考答案|答案)\s*】?\s*[::])\s*/,"").trim()||e.trim()}}(i.text);l.answer&&!r.answer&&(r.answer=l.answer),l.analysis&&(r.analysis=r.analysis?`${r.analysis}
10
+ ${l.analysis}`:l.analysis)}!a&&!n.includes(s)&&s.trim()&&!n.includes(s)&&n.push(s)}r=r||e.value,e.value?n.length&&s.push(n.join("\n")):s.push(a)}return[s,r]}e.s(["k",0,2e3,"f",0,1e6,"S",0,60,"i",0,2e4,"J",0,function(e,s={}){let r,c=void 0===s.maxLength?2e4:Math.min(Math.max(s.maxLength,1e3),1e6),y=void 0===s.maxQuestions?60:Math.min(Math.max(s.maxQuestions,2),2e3),w=e.length>c,v=e.slice(0,c).replace(/\r\n?/g,"\n").split("\n").map(e=>e.replace(t,"").replace(/[\s ]+$/,"")),b=v.map(e=>e?a(e):null),k=v.length;for(let e=0;e<v.length;e++)if(d.test(v[e])){k=e;break}let S=[],T=[];for(let e=0;e<k;e++){let t=b[e];t&&("cn"===t.family?T:S).push({...t,line:e})}let A=new Set;for(let e=0;e<k;e++)(u.test(v[e])||b[e]?.family==="cn")&&A.add(e);let I=p(S,A);if(I.length<2){let e=p(T,new Set);e.length>=2&&(I=e)}let E=i(v.slice(0,k)),_=k<v.length?h(v.slice(k)):[],$=(r=a(v[I[0]?.line??0]??""))?r.label:null,C=e=>({questions:E?[{label:$,text:E,material:null,section:null}]:[],ignored:_,detected:!1,ambiguous:e,candidateCount:e?I.length:+!!E,overflow:0,tooLong:w});if(I.length<2){if(!E)return C(!1);let e=j(E.split("\n")),t=C(!1);if(t.questions.length>0&&Object.keys(e.fields).length>0&&(t.questions[0]={...t.questions[0],text:n(e.text),...e.fields}),t.questions.length>0&&_.length){let[e,s]=N(_,t.questions);t.ignored=e,s||(t.ignored=_)}return t}let M=I[0].family;if(!s.forceNumbered&&function(e,t,s,r){let a=null;for(let n=t-1;n>=0;n--)if(e[n]){a=g(e[n],r[n],s)?null:e[n];break}return!(!a||l.test(a)||m.test(a))&&("paren"===s?a.length>=15||/[。?!?!::,,;;]$/.test(a):/[::]$/.test(a)&&f.test(a))}(v,I[0].line,M,b)){let e=C(!0);if(e.questions.length>0&&E){let t=j(E.split("\n"));Object.keys(t.fields).length>0&&(e.questions[0]={...e.questions[0],text:n(t.text),...t.fields})}return e}let q=new Set(I.map(e=>e.line)),R=[],O=[],P=null,U=[],L=[],V=(e,t)=>{for(let s of h(e))(!l.test(s)||!(s.length<80))&&(o.test(s)||s.length>=80&&/[。!?.!?;;]/.test(s))?U.push({text:s,range:x(s)}):t?R.push(s):P&&!O.some(e=>e.section===P)?P=`${P}
11
+ ${s}`:R.push(s)},F=I[0].line,z=[];for(let e=0;e<F;e++)v[e]&&g(v[e],b[e],M)?(V(z.splice(0),!0),P=v[e],L=[]):z.push(v[e]);V(z,!0);for(let e=0;e<I.length;e++){let t=I[e].line,s=e+1<I.length?I[e+1].line:k;U.length&&(L=[...L.filter(e=>e.range),...U],U=[]);let r=s,a=null;for(let e=t+1;e<s;e++)if(v[e]&&!q.has(e)&&g(v[e],b[e],M)){r=e,a=v[e];break}let l=v.slice(t,r),d=h(l),u=[];for(;d.length>1&&o.test(d[d.length-1].slice(0,30));)u.unshift(d.pop());let c=u.length?d.join("\n"):i(l),m=I[e].value,f=L.filter(e=>!e.range||m>=e.range.from&&m<=e.range.to),p=j(n(c).split("\n"));for(let t of(O.push({label:I[e].label,text:p.text,material:f.length?f.map(e=>e.text).join("\n\n"):null,section:P,...p.fields}),u))U.push({text:t,range:x(t)});null!==a&&(P=a,L=[],V(v.slice(r+1,s),!1))}let[D]=N(_,O),G=O.slice(y);return{questions:O.slice(0,y),ignored:[...R,...D,...G.map(e=>{var t;let s,r,a,n;return s=(t=e).text.trim(),a=(r=t.material?.trim())?`${r}
12
+
13
+ ${s}`:s,n=[],(t.answer?.trim()&&n.push(`参考答案:${t.answer.trim()}`),t.analysis?.trim()&&n.push(`参考解析:${t.analysis.trim()}`),t.wrongAnswer?.trim()&&n.push(`学生作答:${t.wrongAnswer.trim()}`),n.length)?`${a}
14
+
15
+ ${n.join("\n\n")}`:a})],detected:!0,ambiguous:!1,candidateCount:O.length,overflow:G.length,tooLong:w}}])},767077,e=>{var t=e.i(303163);e.s(["f",0,function(e,s){let r=s.common?.messages?.analysisFailed||"Analysis failed, please try again",a=(0,t.d)(e);if(a){let e=s.errors??{};if(!(a in e))return a;let t=e[a];return"string"==typeof t?t:r}let n=(0,t.Z)(e);if(n.includes("fetch")||n.includes("network"))return s.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`${r} (${t})`}return r}])}])})();
@@ -0,0 +1 @@
1
+ (()=>{"use strict";(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,314381,3198,e=>{var t=e.i(456420);let r={name:"box",size:24,node:[["path",{d:"M21 8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73l7 4a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16Z",key:"hh9hay"}],["path",{d:"m3.3 7 8.7 5 8.7-5",key:"g66t2b"}],["path",{d:"M12 22V12",key:"d0xqtd"}]]};r.node;let n=(0,t.f)(r);e.s(["f",0,n],314381);var i=e.i(843476),a=e.i(271645),o=e.i(632781);let s={name:"maximize-2",size:24,node:[["path",{d:"M15 3h6v6",key:"1q9fwt"}],["path",{d:"m21 3-7 7",key:"1l2asr"}],["path",{d:"m3 21 7-7",key:"tjx5ai"}],["path",{d:"M9 21H3v-6",key:"wtvkvv"}]]};s.node;let l=(0,t.f)(s),h={name:"minimize-2",size:24,node:[["path",{d:"m14 10 7-7",key:"oa77jy"}],["path",{d:"M20 10h-6V4",key:"mjg0md"}],["path",{d:"m3 21 7-7",key:"tjx5ai"}],["path",{d:"M4 14h6v6",key:"rmj7iw"}]]};h.node;let c=(0,t.f)(h);var d=e.i(395925),u=e.i(741120),m=e.i(759659),g=e.i(519455),p=e.i(111110),f=e.i(294114),w=e.i(201276),x=e.i(113381);let y=null;function b(e,t,r){let n=e?.firstElementChild;n&&(n.style.width="100%",n.style.height=`${r}px`,t?.setSize(e?.offsetWidth||n.offsetWidth||800,r))}function v(e,t){let r=(0,x.L)(e,t);for(let e of r)w.V.warn("[GGB]","命令执行失败",{...e});return r.map(e=>e.command+":"+e.message).join("\n")||void 0}e.s(["f",0,function({commands:e,height:t=700,showToolBar:r=!1,showAlgebraInput:n=!1,showMenuBar:s=!1,className:h="",onRegenerate:C,onDelete:j}){let{t:k}=(0,p.b)(),D=(0,a.useRef)(null),E=(0,a.useRef)(null),M=(0,a.useRef)(void 0),N=(0,a.useId)(),R=(0,a.useRef)(`ggb-${N.replace(/[^a-zA-Z0-9_-]/g,"")}`),[S,L]=(0,a.useState)(!0),[I,_]=(0,a.useState)(null),[P,$]=(0,a.useState)(!0),[H,A]=(0,a.useState)(!1),[z,B]=(0,a.useState)(!1),Y=(0,a.useMemo)(()=>(0,x.i)(e),[e]);(0,a.useEffect)(()=>{if(0===Y.length)return;let e=!1,i=R.current,a=D.current;return(y||(y=new Promise((e,t)=>{if(window.GGBApplet)return void e();let r=document.createElement("script");r.src="https://www.geogebra.org/apps/deployggb.js",r.async=!0,r.onload=()=>e(),r.onerror=()=>{y=null,t(Error("Failed to load GeoGebra"))},document.head.appendChild(r)}))).then(()=>{if(e)return;let o=window.GGBApplet;if(!o){_(k.geogebra.notLoaded),L(!1);return}if(a){a.innerHTML=`<div id="${i}" style="width:100%;height:${t}px"></div>`;try{new o({appName:"classic",width:"100%",height:t,showToolBar:r,showAlgebraInput:n,showMenuBar:s,showResetIcon:!0,enableRightClick:!0,enableShiftDragZoom:!0,language:"zh",appletOnLoad:r=>{e||(E.current=r,b(a,r,t),M.current=v(r,Y),L(!1))}},!0).inject(i)}catch(t){w.V.error("[GGB]","Init failed",{error:t}),e||(_(k.geogebra.initFailed),L(!1))}}}).catch(t=>{w.V.error("[GGB]","Script load failed",{error:t}),e||(_(k.geogebra.scriptFailed),L(!1))}),()=>{e=!0;try{let e=E.current;e?.remove&&e.remove()}catch(e){w.V.warn("[GGB]","Cleanup failed",{error:e})}E.current=null,a&&(a.innerHTML="")}},[Y,r,n,s]),(0,a.useEffect)(()=>{b(D.current,E.current,P?700:t)},[P,t]);let X=(0,a.useCallback)(()=>{let e=E.current;if(e)try{e.resetConstruction(),setTimeout(()=>{E.current&&(M.current=v(E.current,Y))},300)}catch(e){w.V.warn("[GGB]","Reset failed",{error:e})}},[Y]),O=(0,a.useCallback)(async()=>{if(C&&!H){A(!0);try{await C(M.current)}finally{A(!1)}}},[C,H]),U=(0,a.useCallback)(async()=>{if(j&&!z&&await (0,f.u)(k.geogebra.confirmDelete,{destructive:!0})){B(!0);try{await j()}catch{f.c.error(k.geogebra.deleteFailed)}finally{B(!1)}}},[j,z,k]);return 0===Y.length?null:(0,i.jsxs)("div",{className:`relative rounded-lg border bg-card ${h}`,children:[(0,i.jsxs)("div",{className:"flex items-center justify-between px-3 py-2 border-b bg-muted/30",children:[(0,i.jsxs)("div",{className:"flex items-center gap-2",children:[(0,i.jsx)("span",{className:"text-xs font-medium text-muted-foreground",children:k.geogebra.title}),S&&(0,i.jsx)(o.f,{className:"h-3 w-3 animate-spin text-muted-foreground"})]}),(0,i.jsxs)("div",{className:"flex items-center gap-1",children:[C&&(0,i.jsxs)(g.f,{variant:"ghost",size:"sm",className:"h-7 px-2 text-xs gap-1",onClick:O,title:k.geogebra.regenerate,disabled:H||S,children:[H?(0,i.jsx)(o.f,{className:"h-3.5 w-3.5 animate-spin"}):(0,i.jsx)(u.f,{className:"h-3.5 w-3.5"}),(0,i.jsx)("span",{children:k.geogebra.regenerate})]}),j&&(0,i.jsxs)(g.f,{variant:"ghost",size:"sm",className:"h-7 px-2 text-xs gap-1 text-destructive hover:text-destructive",onClick:U,title:k.geogebra.delete,disabled:z||H,children:[z?(0,i.jsx)(o.f,{className:"h-3.5 w-3.5 animate-spin"}):(0,i.jsx)(m.f,{className:"h-3.5 w-3.5"}),(0,i.jsx)("span",{children:k.geogebra.delete})]}),(0,i.jsx)(g.f,{variant:"ghost",size:"sm",className:"h-7 w-7 p-0",onClick:X,title:k.geogebra.reset,disabled:S,children:(0,i.jsx)(d.f,{className:"h-3.5 w-3.5"})}),(0,i.jsx)(g.f,{variant:"ghost",size:"sm",className:"h-7 w-7 p-0",onClick:()=>$(e=>!e),title:P?k.geogebra.shrink:k.geogebra.enlarge,children:P?(0,i.jsx)(c,{className:"h-3.5 w-3.5"}):(0,i.jsx)(l,{className:"h-3.5 w-3.5"})})]})]}),(0,i.jsx)("div",{ref:D,style:{width:"100%"}}),S&&(0,i.jsx)("div",{className:"absolute inset-0 z-10 flex items-center justify-center bg-background/80 rounded-b-lg",style:{top:37},children:(0,i.jsxs)("div",{className:"flex flex-col items-center gap-2",children:[(0,i.jsx)(o.f,{className:"h-6 w-6 animate-spin text-primary"}),(0,i.jsx)("span",{className:"text-sm text-muted-foreground",children:k.geogebra.loading})]})}),I&&(0,i.jsx)("div",{className:"flex items-center justify-center text-sm text-destructive",style:{minHeight:t},children:I})]})}],3198)},856522,e=>{var t=e.i(456420);let r={name:"save",size:24,node:[["path",{d:"M15.2 3a2 2 0 0 1 1.4.6l3.8 3.8a2 2 0 0 1 .6 1.4V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2z",key:"1c8476"}],["path",{d:"M17 21v-7a1 1 0 0 0-1-1H8a1 1 0 0 0-1 1v7",key:"1ydtos"}],["path",{d:"M7 3v4a1 1 0 0 0 1 1h7",key:"t51u73"}]]};r.node;let n=(0,t.f)(r);e.s(["f",0,n],856522)},786563,e=>{var t=e.i(456420);let r={name:"star",size:24,node:[["path",{d:"M11.525 2.295a.53.53 0 0 1 .95 0l2.31 4.679a2.123 2.123 0 0 0 1.595 1.16l5.166.756a.53.53 0 0 1 .294.904l-3.736 3.638a2.123 2.123 0 0 0-.611 1.878l.882 5.14a.53.53 0 0 1-.771.56l-4.618-2.428a2.122 2.122 0 0 0-1.973 0L6.396 21.01a.53.53 0 0 1-.77-.56l.881-5.139a2.122 2.122 0 0 0-.611-1.879L2.16 9.795a.53.53 0 0 1 .294-.906l5.165-.755a2.122 2.122 0 0 0 1.597-1.16z",key:"r04s7s"}]]};r.node;let n=(0,t.f)(r);e.s(["f",0,n],786563)},232660,e=>{var t=e.i(271645),r={x:0,y:0,width:0,height:0,unit:"px"},n=(e,t,r)=>Math.min(Math.max(e,t),r),i=(e,t)=>e===t||e.width===t.width&&e.height===t.height&&e.x===t.x&&e.y===t.y&&e.unit===t.unit;function a(e,t,n){return"%"===e.unit?{...r,...e,unit:"%"}:{unit:"%",x:e.x?e.x/t*100:0,y:e.y?e.y/n*100:0,width:e.width?e.width/t*100:0,height:e.height?e.height/n*100:0}}function o(e,t,n){return e.unit&&"px"!==e.unit?{unit:"px",x:e.x?e.x*t/100:0,y:e.y?e.y*n/100:0,width:e.width?e.width*t/100:0,height:e.height?e.height*n/100:0}:{...r,...e,unit:"px"}}function s(e,t,r,n,i,a=0,o=0,l=n,h=i){let c={...e},d=Math.min(a,n),u=Math.min(o,i),m=Math.min(l,n),g=Math.min(h,i);t&&(t>1?(u=(d=o?o*t:d)/t,m=l*t):(d=(u=a?a/t:u)*t,g=h/t)),c.y<0&&(c.height=Math.max(c.height+c.y,u),c.y=0),c.x<0&&(c.width=Math.max(c.width+c.x,d),c.x=0);let p=n-(c.x+c.width);p<0&&(c.x=Math.min(c.x,n-d),c.width+=p);let f=i-(c.y+c.height);if(f<0&&(c.y=Math.min(c.y,i-u),c.height+=f),c.width<d&&(("sw"===r||"nw"==r)&&(c.x-=d-c.width),c.width=d),c.height<u&&(("nw"===r||"ne"==r)&&(c.y-=u-c.height),c.height=u),c.width>m&&(("sw"===r||"nw"==r)&&(c.x-=m-c.width),c.width=m),c.height>g&&(("nw"===r||"ne"==r)&&(c.y-=g-c.height),c.height=g),t){let e=c.width/c.height;if(e<t){let e=Math.max(c.width/t,u);("nw"===r||"ne"==r)&&(c.y-=e-c.height),c.height=e}else if(e>t){let e=Math.max(c.height*t,d);("sw"===r||"nw"==r)&&(c.x-=e-c.width),c.width=e}}return c}var l={capture:!0,passive:!1},h=0,c=class e extends t.PureComponent{static xOrds=["e","w"];static yOrds=["n","s"];static xyOrds=["nw","ne","se","sw"];static nudgeStep=1;static nudgeStepMedium=10;static nudgeStepLarge=100;static defaultProps={ariaLabels:{cropArea:"Use the arrow keys to move the crop selection area",nwDragHandle:"Use the arrow keys to move the north west drag handle to change the crop selection area",nDragHandle:"Use the up and down arrow keys to move the north drag handle to change the crop selection area",neDragHandle:"Use the arrow keys to move the north east drag handle to change the crop selection area",eDragHandle:"Use the up and down arrow keys to move the east drag handle to change the crop selection area",seDragHandle:"Use the arrow keys to move the south east drag handle to change the crop selection area",sDragHandle:"Use the up and down arrow keys to move the south drag handle to change the crop selection area",swDragHandle:"Use the arrow keys to move the south west drag handle to change the crop selection area",wDragHandle:"Use the up and down arrow keys to move the west drag handle to change the crop selection area"}};get document(){return document}docMoveBound=!1;mouseDownOnCrop=!1;dragStarted=!1;evData={startClientX:0,startClientY:0,startCropX:0,startCropY:0,clientX:0,clientY:0,isResize:!0};componentRef=(0,t.createRef)();mediaRef=(0,t.createRef)();resizeObserver;initChangeCalled=!1;instanceId=`rc-${h++}`;state={cropIsActive:!1,newCropIsBeingDrawn:!1};getBox(){let e=this.mediaRef.current;if(!e)return{x:0,y:0,width:0,height:0};let{x:t,y:r,width:n,height:i}=e.getBoundingClientRect();return{x:t,y:r,width:n,height:i}}componentDidUpdate(e){let{crop:t,onComplete:r}=this.props;if(r&&!e.crop&&t){let{width:e,height:n}=this.getBox();e&&n&&r(o(t,e,n),a(t,e,n))}}componentWillUnmount(){this.resizeObserver&&this.resizeObserver.disconnect(),this.unbindDocMove()}bindDocMove(){this.docMoveBound||=(this.document.addEventListener("pointermove",this.onDocPointerMove,l),this.document.addEventListener("pointerup",this.onDocPointerDone,l),this.document.addEventListener("pointercancel",this.onDocPointerDone,l),!0)}unbindDocMove(){this.docMoveBound&&=(this.document.removeEventListener("pointermove",this.onDocPointerMove,l),this.document.removeEventListener("pointerup",this.onDocPointerDone,l),this.document.removeEventListener("pointercancel",this.onDocPointerDone,l),!1)}onCropPointerDown=e=>{let{crop:t,disabled:r}=this.props,n=this.getBox();if(!t)return;let i=o(t,n.width,n.height);if(r)return;e.cancelable&&e.preventDefault(),this.bindDocMove(),this.componentRef.current.focus({preventScroll:!0});let a=e.target.dataset.ord,s=e.clientX,l=e.clientY,h=i.x,c=i.y;if(a){let t=e.clientX-n.x,r=e.clientY-n.y,o=0,d=0;"ne"===a||"e"==a?(o=t-(i.x+i.width),d=r-i.y,h=i.x,c=i.y+i.height):"se"===a||"s"===a?(o=t-(i.x+i.width),d=r-(i.y+i.height),h=i.x,c=i.y):"sw"===a||"w"==a?(o=t-i.x,d=r-(i.y+i.height),h=i.x+i.width,c=i.y):("nw"===a||"n"==a)&&(o=t-i.x,d=r-i.y,h=i.x+i.width,c=i.y+i.height),s=h+n.x+o,l=c+n.y+d}this.evData={startClientX:s,startClientY:l,startCropX:h,startCropY:c,clientX:e.clientX,clientY:e.clientY,isResize:!!a,ord:a},this.mouseDownOnCrop=!0,this.setState({cropIsActive:!0})};onComponentPointerDown=e=>{let{crop:t,disabled:r,locked:n,keepSelection:i,onChange:s}=this.props,l=this.getBox();if(r||n||i&&t)return;e.cancelable&&e.preventDefault(),this.bindDocMove(),this.componentRef.current.focus({preventScroll:!0});let h=e.clientX-l.x,c=e.clientY-l.y,d={unit:"px",x:h,y:c,width:0,height:0};this.evData={startClientX:e.clientX,startClientY:e.clientY,startCropX:h,startCropY:c,clientX:e.clientX,clientY:e.clientY,isResize:!0},this.mouseDownOnCrop=!0,s(o(d,l.width,l.height),a(d,l.width,l.height)),this.setState({cropIsActive:!0,newCropIsBeingDrawn:!0})};onDocPointerMove=e=>{let t,{crop:r,disabled:n,onChange:s,onDragStart:l}=this.props,h=this.getBox();if(n||!r||!this.mouseDownOnCrop)return;e.cancelable&&e.preventDefault(),this.dragStarted||(this.dragStarted=!0,l&&l(e));let{evData:c}=this;c.clientX=e.clientX,c.clientY=e.clientY,i(r,t=c.isResize?this.resizeCrop():this.dragCrop())||s(o(t,h.width,h.height),a(t,h.width,h.height))};onComponentKeyDown=t=>{let{crop:r,disabled:i,onChange:s,onComplete:l}=this.props;if(i)return;let h=t.key,c=!1;if(!r)return;let d=this.getBox(),u=this.makePixelCrop(d),m=(navigator.platform.match("Mac")?t.metaKey:t.ctrlKey)?e.nudgeStepLarge:t.shiftKey?e.nudgeStepMedium:e.nudgeStep;if("ArrowLeft"===h?(u.x-=m,c=!0):"ArrowRight"===h?(u.x+=m,c=!0):"ArrowUp"===h?(u.y-=m,c=!0):"ArrowDown"===h&&(u.y+=m,c=!0),c){t.cancelable&&t.preventDefault(),u.x=n(u.x,0,d.width-u.width),u.y=n(u.y,0,d.height-u.height);let e=o(u,d.width,d.height),r=a(u,d.width,d.height);s(e,r),l&&l(e,r)}};onHandlerKeyDown=(t,r)=>{var n,l;let h,{aspect:c=0,crop:d,disabled:u,minWidth:m=0,minHeight:g=0,maxWidth:p,maxHeight:f,onChange:w,onComplete:x}=this.props,y=this.getBox();if(u||!d||"ArrowUp"!==t.key&&"ArrowDown"!==t.key&&"ArrowLeft"!==t.key&&"ArrowRight"!==t.key)return;t.stopPropagation(),t.preventDefault();let b=(navigator.platform.match("Mac")?t.metaKey:t.ctrlKey)?e.nudgeStepLarge:t.shiftKey?e.nudgeStepMedium:e.nudgeStep,v=s((n=o(d,y.width,y.height),l=t.key,h={...n},"ArrowLeft"===l?"nw"===r?(h.x-=b,h.y-=b,h.width+=b,h.height+=b):"w"===r?(h.x-=b,h.width+=b):"sw"===r?(h.x-=b,h.width+=b,h.height+=b):"ne"===r?(h.y+=b,h.width-=b,h.height-=b):"e"===r?h.width-=b:"se"===r&&(h.width-=b,h.height-=b):"ArrowRight"===l&&("nw"===r?(h.x+=b,h.y+=b,h.width-=b,h.height-=b):"w"===r?(h.x+=b,h.width-=b):"sw"===r?(h.x+=b,h.width-=b,h.height-=b):"ne"===r?(h.y-=b,h.width+=b,h.height+=b):"e"===r?h.width+=b:"se"===r&&(h.width+=b,h.height+=b)),"ArrowUp"===l?"nw"===r?(h.x-=b,h.y-=b,h.width+=b,h.height+=b):"n"===r?(h.y-=b,h.height+=b):"ne"===r?(h.y-=b,h.width+=b,h.height+=b):"sw"===r?(h.x+=b,h.width-=b,h.height-=b):"s"===r?h.height-=b:"se"===r&&(h.width-=b,h.height-=b):"ArrowDown"===l&&("nw"===r?(h.x+=b,h.y+=b,h.width-=b,h.height-=b):"n"===r?(h.y+=b,h.height-=b):"ne"===r?(h.y+=b,h.width-=b,h.height-=b):"sw"===r?(h.x-=b,h.width+=b,h.height+=b):"s"===r?h.height+=b:"se"===r&&(h.width+=b,h.height+=b)),h),c,r,y.width,y.height,m,g,p,f);if(!i(d,v)){let e=a(v,y.width,y.height);w(v,e),x&&x(v,e)}};onDocPointerDone=e=>{let{crop:t,disabled:r,onComplete:n,onDragEnd:i}=this.props,s=this.getBox();this.unbindDocMove(),!(r||!t)&&this.mouseDownOnCrop&&(this.mouseDownOnCrop=!1,this.dragStarted=!1,i&&i(e),n&&n(o(t,s.width,s.height),a(t,s.width,s.height)),this.setState({cropIsActive:!1,newCropIsBeingDrawn:!1}))};onDragFocus=()=>{this.componentRef.current?.scrollTo(0,0)};getCropStyle(){let{crop:e}=this.props;if(e)return{top:`${e.y}${e.unit}`,left:`${e.x}${e.unit}`,width:`${e.width}${e.unit}`,height:`${e.height}${e.unit}`}}dragCrop(){let{evData:e}=this,t=this.getBox(),r=this.makePixelCrop(t),i=e.clientX-e.startClientX,a=e.clientY-e.startClientY;return r.x=n(e.startCropX+i,0,t.width-r.width),r.y=n(e.startCropY+a,0,t.height-r.height),r}getPointRegion(e,t,r,n){let{evData:i}=this,a=i.clientX-e.x,o=i.clientY-e.y,s;return s=n&&t?"nw"===t||"n"===t||"ne"===t:o<i.startCropY,(r&&t?"nw"===t||"w"===t||"sw"===t:a<i.startCropX)?s?"nw":"sw":s?"ne":"se"}resolveMinDimensions(e,t,r=0,n=0){let i=Math.min(r,e.width),a=Math.min(n,e.height);return t&&(i||a)?t>1?i?[i,i/t]:[a*t,a]:a?[a*t,a]:[i,i/t]:[i,a]}resizeCrop(){let{evData:t}=this,{aspect:r=0,maxWidth:i,maxHeight:a}=this.props,o=this.getBox(),[l,h]=this.resolveMinDimensions(o,r,this.props.minWidth,this.props.minHeight),c=this.makePixelCrop(o),d=this.getPointRegion(o,t.ord,l,h),u=t.ord||d,m=t.clientX-t.startClientX,g=t.clientY-t.startClientY;(l&&"nw"===u||"w"===u||"sw"===u)&&(m=Math.min(m,-l)),(h&&"nw"===u||"n"===u||"ne"===u)&&(g=Math.min(g,-h));let p={unit:"px",x:0,y:0,width:0,height:0};"ne"===d?(p.x=t.startCropX,p.width=m,r?p.height=p.width/r:p.height=Math.abs(g),p.y=t.startCropY-p.height):"se"===d?(p.x=t.startCropX,p.y=t.startCropY,p.width=m,r?p.height=p.width/r:p.height=g):"sw"===d?(p.x=t.startCropX+m,p.y=t.startCropY,p.width=Math.abs(m),r?p.height=p.width/r:p.height=g):"nw"===d&&(p.x=t.startCropX+m,p.width=Math.abs(m),r?(p.height=p.width/r,p.y=t.startCropY-p.height):(p.height=Math.abs(g),p.y=t.startCropY+g));let f=s(p,r,d,o.width,o.height,l,h,i,a);return r||e.xyOrds.indexOf(u)>-1?c=f:e.xOrds.indexOf(u)>-1?(c.x=f.x,c.width=f.width):e.yOrds.indexOf(u)>-1&&(c.y=f.y,c.height=f.height),c.x=n(c.x,0,o.width-c.width),c.y=n(c.y,0,o.height-c.height),c}renderCropSelection(){let{ariaLabels:r=e.defaultProps.ariaLabels,disabled:n,locked:i,renderSelectionAddon:a,ruleOfThirds:o,crop:s}=this.props,l=this.getCropStyle();if(s)return t.default.createElement("div",{style:l,className:"ReactCrop__crop-selection",onPointerDown:this.onCropPointerDown,"aria-label":r.cropArea,tabIndex:0,onKeyDown:this.onComponentKeyDown,role:"group"},!n&&!i&&t.default.createElement("div",{className:"ReactCrop__drag-elements",onFocus:this.onDragFocus},t.default.createElement("div",{className:"ReactCrop__drag-bar ord-n","data-ord":"n"}),t.default.createElement("div",{className:"ReactCrop__drag-bar ord-e","data-ord":"e"}),t.default.createElement("div",{className:"ReactCrop__drag-bar ord-s","data-ord":"s"}),t.default.createElement("div",{className:"ReactCrop__drag-bar ord-w","data-ord":"w"}),t.default.createElement("div",{className:"ReactCrop__drag-handle ord-nw","data-ord":"nw",tabIndex:0,"aria-label":r.nwDragHandle,onKeyDown:e=>this.onHandlerKeyDown(e,"nw"),role:"button"}),t.default.createElement("div",{className:"ReactCrop__drag-handle ord-n","data-ord":"n",tabIndex:0,"aria-label":r.nDragHandle,onKeyDown:e=>this.onHandlerKeyDown(e,"n"),role:"button"}),t.default.createElement("div",{className:"ReactCrop__drag-handle ord-ne","data-ord":"ne",tabIndex:0,"aria-label":r.neDragHandle,onKeyDown:e=>this.onHandlerKeyDown(e,"ne"),role:"button"}),t.default.createElement("div",{className:"ReactCrop__drag-handle ord-e","data-ord":"e",tabIndex:0,"aria-label":r.eDragHandle,onKeyDown:e=>this.onHandlerKeyDown(e,"e"),role:"button"}),t.default.createElement("div",{className:"ReactCrop__drag-handle ord-se","data-ord":"se",tabIndex:0,"aria-label":r.seDragHandle,onKeyDown:e=>this.onHandlerKeyDown(e,"se"),role:"button"}),t.default.createElement("div",{className:"ReactCrop__drag-handle ord-s","data-ord":"s",tabIndex:0,"aria-label":r.sDragHandle,onKeyDown:e=>this.onHandlerKeyDown(e,"s"),role:"button"}),t.default.createElement("div",{className:"ReactCrop__drag-handle ord-sw","data-ord":"sw",tabIndex:0,"aria-label":r.swDragHandle,onKeyDown:e=>this.onHandlerKeyDown(e,"sw"),role:"button"}),t.default.createElement("div",{className:"ReactCrop__drag-handle ord-w","data-ord":"w",tabIndex:0,"aria-label":r.wDragHandle,onKeyDown:e=>this.onHandlerKeyDown(e,"w"),role:"button"})),a&&t.default.createElement("div",{className:"ReactCrop__selection-addon",onPointerDown:e=>e.stopPropagation()},a(this.state)),o&&t.default.createElement(t.default.Fragment,null,t.default.createElement("div",{className:"ReactCrop__rule-of-thirds-hz"}),t.default.createElement("div",{className:"ReactCrop__rule-of-thirds-vt"})))}makePixelCrop(e){return o({...r,...this.props.crop||{}},e.width,e.height)}render(){let{aspect:e,children:r,circularCrop:n,className:i,crop:a,disabled:o,locked:s,style:l,ruleOfThirds:h}=this.props,{cropIsActive:c,newCropIsBeingDrawn:d}=this.state,u=a?this.renderCropSelection():null,m=((...e)=>e.filter(e=>e&&"string"==typeof e).join(" "))("ReactCrop",i,c&&"ReactCrop--active",o&&"ReactCrop--disabled",s&&"ReactCrop--locked",d&&"ReactCrop--new-crop",a&&e&&"ReactCrop--fixed-aspect",a&&n&&"ReactCrop--circular-crop",a&&h&&"ReactCrop--rule-of-thirds",!this.dragStarted&&a&&!a.width&&!a.height&&"ReactCrop--invisible-crop",n&&"ReactCrop--no-animate");return t.default.createElement("div",{ref:this.componentRef,className:m,style:l},t.default.createElement("div",{ref:this.mediaRef,className:"ReactCrop__child-wrapper",onPointerDown:this.onComponentPointerDown},r),a?t.default.createElement("svg",{className:"ReactCrop__crop-mask",width:"100%",height:"100%"},t.default.createElement("defs",null,t.default.createElement("mask",{id:`hole-${this.instanceId}`},t.default.createElement("rect",{width:"100%",height:"100%",fill:"white"}),n?t.default.createElement("ellipse",{cx:`${a.x+a.width/2}${a.unit}`,cy:`${a.y+a.height/2}${a.unit}`,rx:`${a.width/2}${a.unit}`,ry:`${a.height/2}${a.unit}`,fill:"black"}):t.default.createElement("rect",{x:`${a.x}${a.unit}`,y:`${a.y}${a.unit}`,width:`${a.width}${a.unit}`,height:`${a.height}${a.unit}`,fill:"black"}))),t.default.createElement("rect",{fill:"black",fillOpacity:.5,width:"100%",height:"100%",mask:`url(#hole-${this.instanceId})`})):void 0,u)}};e.s(["f",0,c])},469937,e=>{var t=e.i(843476),r=e.i(786563),n=e.i(111110),i=e.i(975157);let a=[1,2,3,4,5];e.s(["f",0,function({value:e,onChange:o,disabled:s,size:l="sm",showUnrated:h=!0,className:c}){let{t:d}=(0,n.b)(),u=e??0,m="sm"===l?"h-3.5 w-3.5":"h-5 w-5",g=u?d.difficulty.starsLabel.replace("{n}",String(u)):d.difficulty.unrated;return o?(0,t.jsxs)("span",{className:(0,i.f)("inline-flex items-center gap-0.5",c),role:"group","aria-label":`${d.difficulty.label}${d.common.colon}${g}`,title:d.difficulty.clearHint,children:[a.map(e=>(0,t.jsx)("button",{type:"button",disabled:s,onClick:()=>o(e===u?null:e),"aria-label":d.difficulty.setStars.replace("{n}",String(e)),"aria-pressed":e<=u,className:"rounded p-0.5 hover:bg-muted disabled:opacity-50 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring",children:(0,t.jsx)(r.f,{className:(0,i.f)(m,e<=u?"fill-amber-400 text-amber-400":"text-muted-foreground/40")})},e)),!u&&h&&(0,t.jsx)("span",{className:"ml-1 text-xs text-muted-foreground",children:d.difficulty.unrated})]}):u?(0,t.jsx)("span",{className:(0,i.f)("inline-flex items-center",c),role:"img","aria-label":`${d.difficulty.label}${d.common.colon}${g}`,title:g,children:a.map(e=>(0,t.jsx)(r.f,{className:(0,i.f)(m,e<=u?"fill-amber-400 text-amber-400":"text-muted-foreground/30"),"aria-hidden":!0},e))}):h?(0,t.jsx)("span",{className:(0,i.f)("text-xs text-muted-foreground",c),children:d.difficulty.unrated}):null}])},12130,e=>{var t=e.i(843476),r=e.i(271645),n=e.i(232660),i=e.i(519455),a=e.i(776639),o=e.i(263676),s=e.i(111110);async function l(e,t){let{naturalWidth:r,naturalHeight:n}=e;return Promise.all(t.map(t=>new Promise((i,a)=>{let o=document.createElement("canvas"),s=Math.round(t.x*r),l=Math.round(t.y*n);o.width=Math.max(1,Math.round(t.width*r)),o.height=Math.max(1,Math.round(t.height*n));let h=o.getContext("2d");h?(h.drawImage(e,s,l,o.width,o.height,0,0,o.width,o.height),o.toBlob(e=>e?i(e):a(Error("Canvas is empty")),"image/jpeg",.95)):a(Error("Canvas is not supported"))})))}let h={maxHeight:"65vh",maxWidth:"100%",objectFit:"contain"},c=(0,r.forwardRef)(function({imageSrc:e,regions:n,onChange:i,imageStyle:a=h,onImageLoad:l},c){let{t:d}=(0,s.b)(),u=(0,r.useRef)(null),m=(0,r.useRef)(null),[g,p]=(0,r.useState)(null),f=e=>{let t=u.current.getBoundingClientRect();return{x:(e.clientX-t.left)/t.width,y:(e.clientY-t.top)/t.height}},w=()=>{g&&g.width>=.02&&g.height>=.02&&i([...n,g]),m.current=null,p(null)},x=e=>({left:`${100*e.x}%`,top:`${100*e.y}%`,width:`${100*e.width}%`,height:`${100*e.height}%`});return(0,t.jsxs)("div",{className:"relative inline-block select-none",children:[(0,t.jsx)("img",{ref:c,src:e,alt:"",draggable:!1,style:a,onLoad:l,className:"block"}),(0,t.jsxs)("div",{ref:u,className:"absolute inset-0 cursor-crosshair",style:{touchAction:"none"},onPointerDown:e=>{0===e.button&&(u.current?.setPointerCapture(e.pointerId),m.current=f(e),p(null))},onPointerMove:e=>{var t,r,n,i;let a,o,s;if(!m.current)return;let l=f(e);p((t=m.current.x,r=m.current.y,n=l.x,i=l.y,o=(a=e=>Math.min(1,Math.max(0,e)))(Math.min(t,n)),s=a(Math.min(r,i)),{x:o,y:s,width:a(Math.max(t,n))-o,height:a(Math.max(r,i))-s}))},onPointerUp:w,onPointerCancel:w,children:[n.map((e,r)=>(0,t.jsxs)("div",{className:"absolute border-2 border-sky-400 bg-sky-400/15",style:x(e),children:[(0,t.jsx)("span",{className:"absolute left-0 top-0 bg-sky-500 px-1.5 text-xs font-bold text-white",children:r+1}),(0,t.jsx)("button",{type:"button",className:"absolute -right-3 -top-3 flex h-6 w-6 items-center justify-center rounded-full bg-red-500 text-white shadow","aria-label":d.batchImport.removeRegion.replace("{index}",String(r+1)),onPointerDown:e=>e.stopPropagation(),onClick:()=>i(n.filter((e,t)=>t!==r)),children:(0,t.jsx)(o.X,{className:"h-3 w-3"})})]},r)),g&&(0,t.jsx)("div",{className:"absolute border-2 border-dashed border-yellow-300 bg-yellow-300/10",style:x(g)})]})]})});var d=e.i(456420);let u={name:"zoom-in",size:24,node:[["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}],["line",{x1:"21",x2:"16.65",y1:"21",y2:"16.65",key:"13gj7c"}],["line",{x1:"11",x2:"11",y1:"8",y2:"14",key:"1vmskp"}],["line",{x1:"8",x2:"14",y1:"11",y2:"11",key:"durymu"}]]};u.node;let m=(0,d.f)(u),g={name:"zoom-out",size:24,node:[["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}],["line",{x1:"21",x2:"16.65",y1:"21",y2:"16.65",key:"13gj7c"}],["line",{x1:"8",x2:"14",y1:"11",y2:"11",key:"durymu"}]]};g.node;let p=(0,d.f)(g);function f({zoom:e,onZoomIn:r,onZoomOut:n,onReset:i}){let{t:a}=(0,s.b)(),o="outline-none focus-visible:ring-2 focus-visible:ring-white/70",l=`flex h-9 w-9 items-center justify-center rounded-full text-white transition-colors hover:bg-white/20 disabled:opacity-40 disabled:hover:bg-transparent ${o}`;return(0,t.jsxs)("div",{className:"flex items-center gap-0.5 rounded-full bg-black/60 p-1 shadow-lg backdrop-blur-sm",children:[(0,t.jsx)("button",{type:"button",className:l,onClick:n,disabled:e<=1,"aria-label":a.common.cropper.zoomOut,title:a.common.cropper.zoomOut,children:(0,t.jsx)(p,{className:"h-4 w-4"})}),(0,t.jsxs)("button",{type:"button",className:`h-9 min-w-14 rounded-full px-2 text-center text-xs font-medium tabular-nums text-white hover:bg-white/20 ${o}`,onClick:i,"aria-label":a.common.cropper.resetZoom,title:a.common.cropper.resetZoom,children:[Math.round(100*e),"%"]}),(0,t.jsx)("button",{type:"button",className:l,onClick:r,disabled:e>=5,"aria-label":a.common.cropper.zoomIn,title:a.common.cropper.zoomIn,children:(0,t.jsx)(m,{className:"h-4 w-4"})})]})}var w=e.i(201276);let x={single:{maxHeight:"70vh",maxWidth:"100%",objectFit:"contain"},auto:{maxHeight:"65vh",maxWidth:"100%",objectFit:"contain"},multi:{maxHeight:"65vh",maxWidth:"100%",objectFit:"contain"}};e.s(["f",0,function({imageSrc:e,open:o,onClose:h,onCropComplete:d,onMultiCropComplete:u,onRegionsSelected:m,allowMulti:g=!0,onAutoSplit:p,onAddPart:y,partCount:b=0}){let{t:v}=(0,s.b)(),C=/^(blob:|data:image\/)/i.test(e)?e:void 0,[j,k]=(0,r.useState)(),D=(0,r.useRef)(null),[E,M]=(0,r.useState)("single"),{containerRef:N,zoom:R,imageStyle:S,measureImage:L,zoomIn:I,zoomOut:_,reset:P}=function(e){let[t,n]=(0,r.useState)(null),i=(0,r.useRef)(null),a=(0,r.useCallback)(e=>{i.current=e,n(e)},[]),[o,s]=(0,r.useState)(1),l=(0,r.useRef)(1),[h,c]=(0,r.useState)(null),d=(0,r.useRef)(null),u=(0,r.useRef)(!1),m=(0,r.useCallback)((e,t,r)=>{let n=i.current,a=l.current,o=Math.min(5,Math.max(1,e));if(!n||o===a)return;if(1===a){let e=n.querySelector("img");e&&c(e.clientWidth)}let h=n.getBoundingClientRect(),u=(t??h.left+h.width/2)-h.left,m=(r??h.top+h.height/2)-h.top;d.current={viewX:u,viewY:m,contentX:n.scrollLeft+u,contentY:n.scrollTop+m,ratio:o/a},l.current=o,s(o)},[]);(0,r.useLayoutEffect)(()=>{let e=i.current,t=d.current;e&&t&&(e.scrollLeft=t.contentX*t.ratio-t.viewX,e.scrollTop=t.contentY*t.ratio-t.viewY,d.current=null)},[o]),(0,r.useEffect)(()=>{if(!t)return;let e=e=>{e.preventDefault(),m(l.current*Math.exp(-(.0015*e.deltaY)),e.clientX,e.clientY)},r=null,n=e=>{let[t,r]=[e[0],e[1]];return{distance:Math.hypot(t.clientX-r.clientX,t.clientY-r.clientY),centerX:(t.clientX+r.clientX)/2,centerY:(t.clientY+r.clientY)/2}},i=e=>{2===e.touches.length&&(r={distance:n(e.touches).distance,zoom:l.current},u.current=!0)},a=e=>{if(!r||2!==e.touches.length)return;e.preventDefault();let{distance:t,centerX:i,centerY:a}=n(e.touches);r.distance>0&&m(r.zoom*(t/r.distance),i,a)},o=e=>{e.touches.length<2&&(r=null,u.current=!1)},s=e=>{u.current&&e.stopPropagation()};return t.addEventListener("wheel",e,{passive:!1}),t.addEventListener("touchstart",i,{passive:!0}),t.addEventListener("touchmove",a,{passive:!1}),t.addEventListener("touchend",o),t.addEventListener("touchcancel",o),t.addEventListener("pointermove",s,{capture:!0}),()=>{t.removeEventListener("wheel",e),t.removeEventListener("touchstart",i),t.removeEventListener("touchmove",a),t.removeEventListener("touchend",o),t.removeEventListener("touchcancel",o),t.removeEventListener("pointermove",s,{capture:!0})}},[t,m]);let g=(0,r.useCallback)(e=>{e&&1===l.current&&c(e.clientWidth)},[]),p=(0,r.useCallback)(()=>m(1.25*l.current),[m]),f=(0,r.useCallback)(()=>m(l.current/1.25),[m]),w=(0,r.useCallback)(()=>{l.current=1,d.current=null,s(1)},[]),x=1!==o&&h?{...e,width:h*o,height:"auto",maxWidth:"none",maxHeight:"none"}:e;return{containerRef:a,zoom:o,imageStyle:x,measureImage:g,zoomIn:p,zoomOut:f,reset:w}}(x[E]);(0,r.useEffect)(()=>{P()},[e,P]);let[$,H]=(0,r.useState)({src:e,regions:[]}),A=$.src===e?$.regions:[],z=t=>H({src:e,regions:t}),B=(0,r.useRef)(null),Y=["single",...p?["auto"]:[],...u||m&&g?["multi"]:[]],X={single:v.batchImport.singleMode,auto:v.batchImport.autoMode,multi:v.batchImport.multiMode},O=async()=>{if(0!==A.length){if(m){m(A,!0),z([]);return}if(B.current&&u)try{u(await l(B.current,A)),z([])}catch(e){w.V.error("[ImageCropper]","Multi-image crop failed",{error:e})}}},U=()=>j&&j.width>0&&j.height>0?{x:j.x/100,y:j.y/100,width:j.width/100,height:j.height/100}:{x:0,y:0,width:1,height:1},K=async()=>{let e=U();if("auto"===E&&p)return void p(e);if(m)return void m([e],!1);if(D.current&&d)try{let[t]=await l(D.current,[e]);d(t)}catch(e){w.V.error("[ImageCropper]","Crop failed",{error:e})}};return(0,t.jsx)(a.N,{open:o,onOpenChange:e=>!e&&h(),children:(0,t.jsxs)(a.d,{className:"max-w-3xl h-[90vh] flex flex-col p-0 gap-0",children:[(0,t.jsx)(a.s,{className:"p-4 border-b shrink-0",children:(0,t.jsx)(a.F,{children:v.common.cropper?.title||"Crop Image"})}),(0,t.jsxs)("div",{className:"relative min-h-0 flex-1 bg-black",children:[(0,t.jsx)("div",{ref:N,className:"flex h-full w-full overflow-auto p-4",children:(0,t.jsx)("div",{className:"m-auto",children:"multi"===E?(0,t.jsx)(c,{ref:B,imageSrc:C,regions:A,onChange:z,imageStyle:S,onImageLoad:e=>L(e.currentTarget)}):(0,t.jsx)(n.f,{crop:j,onChange:(e,t)=>k(t),children:(0,t.jsx)("img",{ref:D,alt:"Crop me",src:C,onLoad:function(e){k({unit:"%",x:0,y:0,width:100,height:100}),L(e.currentTarget)},style:S})})})}),(0,t.jsx)("div",{className:"absolute right-3 top-3",children:(0,t.jsx)(f,{zoom:R,onZoomIn:I,onZoomOut:_,onReset:P})})]}),(0,t.jsxs)("div",{className:"p-4 border-t bg-background shrink-0 space-y-3",children:[Y.length>1&&(0,t.jsx)("div",{className:`grid gap-1 rounded-md bg-muted p-1 ${3===Y.length?"grid-cols-3 sm:w-[28rem]":"grid-cols-2 sm:w-80"}`,children:Y.map(e=>(0,t.jsx)("button",{type:"button","aria-pressed":E===e,onClick:()=>{P(),M(e)},className:`rounded px-2 py-1.5 text-sm font-medium transition-colors ${E===e?"bg-background shadow-sm":"text-muted-foreground"}`,children:X[e]},e))}),(0,t.jsxs)("div",{className:"flex flex-col sm:flex-row sm:justify-between sm:items-center gap-3",children:[(0,t.jsx)("p",{className:"text-sm text-muted-foreground",children:"multi"===E?`${v.batchImport.hint} ${v.batchImport.regionCount.replace("{count}",String(A.length))}`:"auto"===E?v.batchImport.autoHint:b>0?v.upload.parts.cropHint.replace("{n}",String(b+1)):v.common.cropper?.hint||"💡 Drag to adjust crop area"}),(0,t.jsxs)("div",{className:"flex flex-wrap gap-2 justify-end",children:["multi"===E&&A.length>0&&(0,t.jsx)(i.f,{variant:"ghost",onClick:()=>z([]),children:v.batchImport.clear}),(0,t.jsx)(i.f,{variant:"outline",onClick:h,children:v.common.cancel||"Cancel"}),"multi"===E?(0,t.jsx)(i.f,{onClick:O,disabled:0===A.length,children:v.batchImport.start.replace("{count}",String(A.length))}):(0,t.jsxs)(t.Fragment,{children:["single"===E&&y&&(0,t.jsx)(i.f,{variant:"secondary",onClick:()=>y(U()),"data-testid":"crop-add-part",children:v.upload.parts.addNext}),(0,t.jsx)(i.f,{onClick:K,children:"auto"===E?v.batchImport.autoStart:b>0?v.upload.parts.confirm.replace("{count}",String(b+1)):v.common.confirm||"Confirm"})]})]})]})]})]})})}],12130)},141176,e=>{var t=e.i(843476),r=e.i(271645),n=e.i(456420);let i={name:"code-xml",size:24,node:[["path",{d:"m18 16 4-4-4-4",key:"1inbqp"}],["path",{d:"m6 8-4 4 4 4",key:"15zrgr"}],["path",{d:"m14.5 4-5 16",key:"e7oirm"}]],aliases:["code-2"]};i.node;let a=(0,n.f)(i);var o=e.i(772382),s=e.i(511445),l=e.i(624687),h=e.i(111110),c=e.i(975157);e.s(["f",0,function({value:e,onChange:n,className:i,...d}){let{t:u}=(0,h.b)(),[m,g]=(0,r.useState)("source"),p=(0,r.useId)(),f=[{mode:"source",label:u.markdownEditor.source,icon:a},{mode:"preview",label:u.markdownEditor.preview,icon:o.f}];return(0,t.jsxs)("div",{className:"space-y-1.5",children:[(0,t.jsx)("div",{role:"tablist","aria-label":u.markdownEditor.modeLabel,className:"flex justify-end",children:(0,t.jsx)("div",{className:"inline-flex rounded-md border bg-muted/40 p-0.5",children:f.map(({mode:e,label:r,icon:n})=>(0,t.jsxs)("button",{type:"button",role:"tab","aria-selected":m===e,"aria-controls":p,onClick:()=>g(e),className:(0,c.f)("flex items-center gap-1 rounded px-2.5 py-1 text-xs transition-colors",m===e?"bg-background font-medium shadow-sm":"text-muted-foreground hover:text-foreground"),children:[(0,t.jsx)(n,{className:"h-3.5 w-3.5"}),r]},e))})}),(0,t.jsx)("div",{id:p,role:"tabpanel",children:"source"===m?(0,t.jsx)(l.f,{value:e,onChange:e=>n(e.target.value),className:i,...d}):(0,t.jsx)("div",{className:"min-h-24 cursor-text rounded-md border bg-muted/20 px-3 py-2",onDoubleClick:()=>g("source"),title:u.markdownEditor.doubleClickToEdit,children:e.trim()?(0,t.jsx)(s.f,{content:e}):(0,t.jsx)("p",{className:"text-sm italic text-muted-foreground",children:u.markdownEditor.empty})})})]})}],141176)},438465,674166,e=>{var t=e.i(843476),r=e.i(271645),n=e.i(967489),i=e.i(856423),a=e.i(41931),o=e.i(201276),s=e.i(111110);e.s(["f",0,function({value:e,onChange:l,className:h}){let[c,d]=(0,r.useState)([]),{t:u}=(0,s.b)();return(0,r.useEffect)(()=>{(async()=>{try{let e=await a.k.get("/api/notebooks");d(e)}catch(e){o.V.error("[NotebookSelector]","Failed to fetch notebooks",{error:e})}})()},[]),(0,t.jsxs)(n.d,{value:e,onValueChange:l,children:[(0,t.jsx)(n.P,{className:h,children:(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)(i.f,{className:"h-4 w-4 text-muted-foreground"}),(0,t.jsx)(n.U,{placeholder:u.notebooks?.selector?.placeholder||"Select Notebook"})]})}),(0,t.jsx)(n.r,{children:0===c.length?(0,t.jsx)("div",{className:"p-2 text-sm text-muted-foreground text-center",children:u.notebooks?.selector?.empty||"No notebooks available"}):c.map(e=>(0,t.jsx)(n.T,{value:e.id,children:e.name},e.id))})]})}],438465);var l=e.i(470279);e.s(["f",0,function({value:e,onChange:r,disabled:i}){let{groups:a,loading:o}=(0,l.f)(),s=a.filter(e=>e.isActive);return(0,t.jsxs)(n.d,{value:e,onValueChange:r,disabled:i||o,children:[(0,t.jsx)(n.P,{children:(0,t.jsx)(n.U,{placeholder:"选择卷别"})}),(0,t.jsx)(n.r,{children:s.map(e=>(0,t.jsx)(n.T,{value:e.id,children:e.name},e.id))})]})}],674166)},149704,e=>{var t=e.i(843476),r=e.i(111110),n=e.i(398019),i=e.i(184110),a=e.i(975157);let o={left:"mr-auto",center:"mx-auto",right:"ml-auto"};e.s(["f",0,function({svg:e,scale:s,align:l,className:h}){let{t:c}=(0,r.b)();if(!e)return null;let d=(0,i.V)(s),u=(0,i.o)(l);return(0,t.jsx)("figure",{className:(0,a.f)("question-figure my-3",h),children:(0,t.jsx)("img",{src:(0,n.d)(e),alt:c.figure.alt,className:(0,a.f)(o[u],"block h-auto max-w-full rounded border bg-white p-2"),style:{..."left"===u?{marginLeft:0,marginRight:"auto"}:"right"===u?{marginLeft:"auto",marginRight:0}:{},maxHeight:360,zoom:d/100,maxWidth:`${Math.min(d,100)}%`}})})}])},574041,e=>{var t=e.i(843476),r=e.i(271645),n=e.i(263676),i=e.i(487486),a=e.i(793479),o=e.i(41931),s=e.i(201276);e.s(["f",0,function({value:e=[],onChange:l,placeholder:h="Enter tags...",className:c="",enterHint:d,subject:u,gradeStage:m}){let[g,p]=(0,r.useState)(""),[f,w]=(0,r.useState)([]),[x,y]=(0,r.useState)(!1),[b,v]=(0,r.useState)(0),C=(0,r.useRef)(null),j=(0,r.useRef)(null),k=(0,r.useCallback)(async t=>{try{let r=new URLSearchParams({q:t});u&&r.append("subject",u),m&&r.append("stage",m);let n=((await o.k.get(`/api/tags/suggestions?${r.toString()}`)).suggestions||[]).filter(t=>!e.includes(t));w(n.slice(0,20)),y(n.length>0),v(0)}catch(e){s.V.error("[TagInput]","Failed to fetch suggestions",{error:e})}},[u,m,e]);(0,r.useEffect)(()=>{g.trim()&&k(g)},[g,k]);let D=t=>{t.trim()&&!e.includes(t.trim())&&(l([...e,t.trim()]),p(""),w([]),y(!1),v(0))},E=t=>{l(e.filter(e=>e!==t))};return(0,r.useEffect)(()=>{let e=e=>{!j.current||j.current.contains(e.target)||C.current?.contains(e.target)||y(!1)};return document.addEventListener("mousedown",e),()=>document.removeEventListener("mousedown",e)},[]),(0,t.jsxs)("div",{className:`relative ${c}`,children:[(0,t.jsxs)("div",{className:"flex flex-wrap gap-2 p-2 border rounded-lg bg-background min-h-[42px]",children:[e.map(e=>(0,t.jsxs)(i.f,{variant:"secondary",className:"flex items-center gap-1 px-2 py-1",children:[e,(0,t.jsx)("button",{type:"button",onClick:()=>E(e),className:"hover:text-destructive ml-1",children:(0,t.jsx)(n.X,{className:"h-3 w-3"})})]},e)),(0,t.jsx)(a.f,{ref:C,type:"text",value:g,onChange:e=>{p(e.target.value),e.target.value.trim()||(w([]),y(!1))},onKeyDown:t=>{"Enter"===t.key?(t.preventDefault(),b>=0&&f[b]?D(f[b]):g.trim()&&D(g)):"ArrowDown"===t.key?(t.preventDefault(),v(e=>Math.min(e+1,f.length-1))):"ArrowUp"===t.key?(t.preventDefault(),v(e=>Math.max(e-1,0))):"Escape"===t.key?(y(!1),v(0)):"Backspace"===t.key&&!g&&e.length>0&&E(e[e.length-1])},onFocus:()=>{f.length>0&&y(!0)},placeholder:0===e.length?h:"",className:"flex-1 min-w-[120px] border-none focus-visible:ring-0 focus-visible:ring-offset-0 h-8 px-0"})]}),x&&f.length>0&&(0,t.jsx)("div",{ref:j,className:"absolute z-50 w-full mt-1 bg-popover border rounded-md shadow-md max-h-48 overflow-y-auto",children:f.map((e,r)=>(0,t.jsx)("div",{className:`px-3 py-2 cursor-pointer hover:bg-accent ${r===b?"bg-accent":""}`,onClick:()=>D(e),onMouseEnter:()=>v(r),children:e},e))}),g&&!x&&(0,t.jsx)("div",{className:"text-xs text-muted-foreground mt-1",children:d?`${d} "${g}"`:`Press Enter to create "${g}"`})]})}])},184110,e=>{let t=["left","center","right"],r="center";function n(e){return"number"==typeof e&&Number.isInteger(e)&&e>=10&&e<=200}e.s(["E",0,r,"n",0,100,"j",0,t,"a",0,200,"_",0,10,"x",0,n,"o",0,function(e){return"string"==typeof e&&t.includes(e)?e:r},"V",0,function(e){return n(e)?e:100}])},398019,e=>{e.s(["K",0,1e5,"d",0,function(e){return`data:image/svg+xml;charset=utf-8,${encodeURIComponent(e)}`}])},213761,e=>{let t={maxLongEdge:4096,maxPixels:4915200,maxBytes:1572864,startQuality:.9,minQuality:.8};class r extends Error{code;format;constructor(e,t,r){super(e,void 0===r?void 0:{cause:r}),this.code=e,this.format=t,this.name="ImageDecodeError"}}let n=new Set(["heic","heix","heim","heis","hevc","hevx","hevm","hevs"]),i=new Set(["mif1","msf1","mif2"]),a=new Set(["avif","avis"]);function o(e,r,n=t){let i=Math.min(1,n.maxLongEdge/Math.max(e,r),Math.sqrt(n.maxPixels/Math.max(1,e*r)));return{width:Math.max(1,Math.floor(e*i)),height:Math.max(1,Math.floor(r*i)),scale:i}}async function s(e){let t,r;if("function"==typeof createImageBitmap)try{return await createImageBitmap(e,{imageOrientation:"from-image"})}catch{}let n=await (t=URL.createObjectURL(e),(r=new Image).decoding="async",new Promise((e,n)=>{r.onload=()=>e(r),r.onerror=()=>n(Error("IMAGE_ELEMENT_DECODE_FAILED")),r.src=t}).finally(()=>URL.revokeObjectURL(t)));if(!n.naturalWidth||!n.naturalHeight)throw Error("IMAGE_EMPTY");return n}async function l(t){let{heicTo:r}=await e.A(462684);return r({blob:t,type:"image/jpeg",quality:.95})}function h(e,t){return new Promise((r,n)=>{e.toBlob(e=>e?r(e):n(Error("CANVAS_EMPTY")),"image/jpeg",t)})}function c(e,t,r,n,i,a,o){let s,l=((s=document.createElement("canvas")).width=a,s.height=o,s),h=l.getContext("2d");if(!h)throw Error("CANVAS_UNSUPPORTED");return h.fillStyle="#ffffff",h.fillRect(0,0,a,o),h.imageSmoothingEnabled=!0,h.imageSmoothingQuality="high",h.drawImage(e,t,r,n,i,0,0,a,o),l}async function d(e,t){var d;let u,m=performance.now(),g=await e.arrayBuffer(),p=performance.now()-m,f=function(e){let t=(t,r)=>String.fromCharCode(...e.subarray(t,r));if(e.length>=3&&255===e[0]&&216===e[1]&&255===e[2])return"jpeg";if(e.length>=8&&137===e[0]&&"PNG"===t(1,4))return"png";if(e.length>=12&&"RIFF"===t(0,4)&&"WEBP"===t(8,12))return"webp";if(e.length>=6&&("GIF87a"===t(0,6)||"GIF89a"===t(0,6)))return"gif";if(e.length>=2&&"BM"===t(0,2))return"bmp";if(e.length>=12&&"ftyp"===t(4,8)){let r=Math.min(e.length,(e[0]<<24|e[1]<<16|e[2]<<8|e[3])>>>0||e.length),o=[t(8,12)];for(let e=16;e+4<=r;e+=4)o.push(t(e,e+4));if(o.some(e=>n.has(e)))return"heic";if(o.some(e=>a.has(e)))return"avif";if(o.some(e=>i.has(e)))return"heic"}return"unknown"}(new Uint8Array(g,0,Math.min(g.byteLength,64))),w=e.type||"",x=performance.now(),y="native",b=new Blob([g],{type:w||"application/octet-stream"});try{u=await s(b)}catch(e){if("heic"!==f)throw new r("unknown"===f?"UNSUPPORTED_IMAGE":"IMAGE_DECODE_FAILED",f,e);t?.();try{u=await s(await l(b)),y="heic"}catch(e){throw new r("HEIC_DECODE_FAILED",f,e)}}let{width:v,height:C}=(d=u)instanceof HTMLImageElement?{width:d.naturalWidth,height:d.naturalHeight}:{width:d.width,height:d.height};if(!v||!C)throw new r("IMAGE_DECODE_FAILED",f);let j=o(v,C,{maxLongEdge:1600,maxPixels:1/0}),k=await h(c(u,0,0,v,C,j.width,j.height),.85),D=URL.createObjectURL(k),E=performance.now()-x;return{source:u,width:v,height:C,format:f,decoder:y,previewUrl:D,sourceType:w,sourceBytes:e.size,timings:{read:Math.round(p),convert:Math.round(E)},dispose:()=>{URL.revokeObjectURL(D),u instanceof HTMLImageElement||u.close()}}}let u={x:0,y:0,width:1,height:1};async function m(e,r=u,n=t){var i;let a=performance.now(),s=e=>Math.min(1,Math.max(0,e)),l=Math.round(s(r.x)*e.width),d=Math.round(s(r.y)*e.height),g=Math.max(1,Math.min(e.width-l,Math.round(s(r.width)*e.width))),p=Math.max(1,Math.min(e.height-d,Math.round(s(r.height)*e.height))),f=o(g,p,n),w=c(e.source,l,d,g,p,f.width,f.height),x=performance.now()-a,y=performance.now(),b=n.startQuality,v=await h(w,b);for(let t=0;v.size>n.maxBytes&&t<12;t++)b-.05>=n.minQuality-1e-9?b=Math.round((b-.05)*100)/100:(f={width:Math.max(1,Math.floor(.85*f.width)),height:Math.max(1,Math.floor(.85*f.height)),scale:.85*f.scale},w=c(e.source,l,d,g,p,f.width,f.height)),v=await h(w,b);return{dataUrl:await (i=v,new Promise((e,t)=>{let r=new FileReader;r.onload=()=>e(r.result),r.onerror=()=>t(r.error??Error("READ_FAILED")),r.readAsDataURL(i)})),width:f.width,height:f.height,bytes:v.size,quality:b,timings:{crop:Math.round(x),compress:Math.round(performance.now()-y)}}}e.s(["K",0,t,"o",0,r,"N",0,function(e,t){return{sourceType:e.sourceType||e.format,sourceBytes:e.sourceBytes,sourceWidth:e.width,sourceHeight:e.height,outputWidth:t.width,outputHeight:t.height,outputBytes:t.bytes,decoder:e.decoder,quality:t.quality}},"p",0,d,"X",0,m])},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}])}])})();
@@ -0,0 +1,2 @@
1
+ (globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,[711241,e=>{var t=e.i(456420);let r={name:"arrow-left",size:24,node:[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]]};r.node;let n=(0,t.f)(r);e.s(["f",0,n],711241)},474544,e=>{var t=e.i(456420);let r={name:"clock",size:24,node:[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 6v6l4 2",key:"mmk7yg"}]]};r.node;let n=(0,t.f)(r);e.s(["f",0,n],474544)},444594,e=>{var t=e.i(456420);let r={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"}]]};r.node;let n=(0,t.f)(r);e.s(["f",0,n],444594)},218964,e=>{var t=e.i(456420);let r={name:"list-checks",size:24,node:[["path",{d:"M13 5h8",key:"a7qcls"}],["path",{d:"M13 12h8",key:"h98zly"}],["path",{d:"M13 19h8",key:"c3s6r1"}],["path",{d:"m3 17 2 2 4-4",key:"1jhpwq"}],["path",{d:"m3 7 2 2 4-4",key:"1obspn"}]]};r.node;let n=(0,t.f)(r);e.s(["f",0,n],218964)},77043,e=>{var t=e.i(456420);let r={name:"printer",size:24,node:[["path",{d:"M6 18H4a2 2 0 0 1-2-2v-5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2v5a2 2 0 0 1-2 2h-2",key:"143wyd"}],["path",{d:"M6 9V3a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v6",key:"1itne7"}],["rect",{x:"6",y:"14",width:"12",height:"8",rx:"1",key:"1ue0tg"}]]};r.node;let n=(0,t.f)(r);e.s(["f",0,n],77043)},566595,e=>{var t=e.i(456420);let r={name:"search",size:24,node:[["path",{d:"m21 21-4.34-4.34",key:"14j7rj"}],["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}]]};r.node;let n=(0,t.f)(r);e.s(["f",0,n],566595)},328623,e=>{var t=e.i(456420);let r={name:"sparkles",size:24,node:[["path",{d:"M11.017 2.814a1 1 0 0 1 1.966 0l1.051 5.558a2 2 0 0 0 1.594 1.594l5.558 1.051a1 1 0 0 1 0 1.966l-5.558 1.051a2 2 0 0 0-1.594 1.594l-1.051 5.558a1 1 0 0 1-1.966 0l-1.051-5.558a2 2 0 0 0-1.594-1.594l-5.558-1.051a1 1 0 0 1 0-1.966l5.558-1.051a2 2 0 0 0 1.594-1.594z",key:"1s2grr"}],["path",{d:"M20 2v4",key:"1rf3ol"}],["path",{d:"M22 4h-4",key:"gwowj6"}],["circle",{cx:"4",cy:"20",r:"2",key:"6kqj1y"}]],aliases:["stars"]};r.node;let n=(0,t.f)(r);e.s(["f",0,n],328623)},786563,e=>{var t=e.i(456420);let r={name:"star",size:24,node:[["path",{d:"M11.525 2.295a.53.53 0 0 1 .95 0l2.31 4.679a2.123 2.123 0 0 0 1.595 1.16l5.166.756a.53.53 0 0 1 .294.904l-3.736 3.638a2.123 2.123 0 0 0-.611 1.878l.882 5.14a.53.53 0 0 1-.771.56l-4.618-2.428a2.122 2.122 0 0 0-1.973 0L6.396 21.01a.53.53 0 0 1-.77-.56l.881-5.139a2.122 2.122 0 0 0-.611-1.879L2.16 9.795a.53.53 0 0 1 .294-.906l5.165-.755a2.122 2.122 0 0 0 1.597-1.16z",key:"r04s7s"}]]};r.node;let n=(0,t.f)(r);e.s(["f",0,n],786563)},469937,e=>{var t=e.i(843476),r=e.i(786563),n=e.i(111110),i=e.i(975157);let o=[1,2,3,4,5];e.s(["f",0,function({value:e,onChange:s,disabled:a,size:f="sm",showUnrated:u=!0,className:l}){let{t:c}=(0,n.b)(),h=e??0,p="sm"===f?"h-3.5 w-3.5":"h-5 w-5",d=h?c.difficulty.starsLabel.replace("{n}",String(h)):c.difficulty.unrated;return s?(0,t.jsxs)("span",{className:(0,i.f)("inline-flex items-center gap-0.5",l),role:"group","aria-label":`${c.difficulty.label}${c.common.colon}${d}`,title:c.difficulty.clearHint,children:[o.map(e=>(0,t.jsx)("button",{type:"button",disabled:a,onClick:()=>s(e===h?null:e),"aria-label":c.difficulty.setStars.replace("{n}",String(e)),"aria-pressed":e<=h,className:"rounded p-0.5 hover:bg-muted disabled:opacity-50 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring",children:(0,t.jsx)(r.f,{className:(0,i.f)(p,e<=h?"fill-amber-400 text-amber-400":"text-muted-foreground/40")})},e)),!h&&u&&(0,t.jsx)("span",{className:"ml-1 text-xs text-muted-foreground",children:c.difficulty.unrated})]}):h?(0,t.jsx)("span",{className:(0,i.f)("inline-flex items-center",l),role:"img","aria-label":`${c.difficulty.label}${c.common.colon}${d}`,title:d,children:o.map(e=>(0,t.jsx)(r.f,{className:(0,i.f)(p,e<=h?"fill-amber-400 text-amber-400":"text-muted-foreground/30"),"aria-hidden":!0},e))}):u?(0,t.jsx)("span",{className:(0,i.f)("text-xs text-muted-foreground",l),children:c.difficulty.unrated}):null}])},846968,e=>{var t=e.i(843476),r=e.i(548161),n=e.i(474544),i=e.i(741120),o=e.i(487486),s=e.i(111110);let a={new:{className:"bg-warning/15 text-amber-700 dark:text-warning",icon:n.f},reviewing:{className:"bg-primary/10 text-primary",icon:i.f},mastered:{className:"bg-success/15 text-success",icon:r.f}};e.s(["o",0,{new:"border-l-warning/70",reviewing:"border-l-primary/60",mastered:"border-l-success/70"},"x",0,function({status:e,className:r=""}){let{t:n}=(0,s.b)(),{className:i,icon:f}=a[e],u="mastered"===e?n.notebook.mastered:"reviewing"===e?n.notebook.reviewing:n.notebook.review;return(0,t.jsx)(o.f,{variant:"secondary",className:`${i} ${r}`,children:(0,t.jsxs)("span",{className:"flex items-center gap-1",children:[(0,t.jsx)(f,{className:"h-3 w-3"})," ",u]})})}])},709830,76824,e=>{var t=e.i(843476),r=e.i(111110),n=e.i(597138);let i=["primary","junior_high","senior_high"],o="primary",s=["math","english","chinese","physics","chemistry","biology","history","geography","politics"];function a(e){return"string"==typeof e&&s.includes(e)}function f(e){var t;let r=a(e.subjectKey)?e.subjectKey:(0,n.f)(e.name);return{stage:"string"==typeof(t=e.stage)&&i.includes(t)?e.stage:o,subject:r&&a(r)?r:null}}function u(){let{t:e}=(0,r.b)();return{stageLabel:t=>({primary:e.auth.primary,junior_high:e.auth.juniorHigh,senior_high:e.auth.seniorHigh})[t],subjectLabel:t=>e.tags.subjects[t]}}e.s(["j",0,o,"c",0,i,"W",0,{primary:["math","english","chinese"],junior_high:s,senior_high:s},"v",0,f],76824),e.s(["E",0,function({notebook:e,className:r}){let{stageLabel:n,subjectLabel:i}=u(),o=f(e);return(0,t.jsxs)("span",{className:r,children:[n(o.stage),o.subject?` \xb7 ${i(o.subject)}`:""]})},"O",0,u],709830)},590546,e=>{var t=e.i(843476),r=e.i(618566),n=e.i(519455),i=e.i(711241);e.s(["f",0,function({fallbackUrl:e,className:o}){let s=(0,r.useRouter)();return(0,t.jsx)(n.f,{variant:"ghost",size:"icon",onClick:()=>{s.push(e)},className:o,children:(0,t.jsx)(i.f,{className:"h-5 w-5"})})}])},257428,e=>{var t=e.i(843476),r=e.i(271645),n=e.i(820783),i=e.i(30030),o=e.i(981140),s=e.i(369340),a=e.i(635804),f=e.i(296626),u=e.i(248425),l=Object.defineProperty,c=(e,t)=>l(e,"name",{value:t,configurable:!0}),h="Checkbox",[p,d]=(0,i.f)(h),[g,y]=p(h);function m(e){let{__scopeCheckbox:n,checked:i,children:o,defaultChecked:a,disabled:f,form:u,name:l,onCheckedChange:c,required:p,value:d="on",internal_do_not_use_render:y}=e,[m,b]=(0,s.f)({prop:i,defaultProp:a??!1,onChange:c,caller:h}),[v,w]=r.useState(null),[x,j]=r.useState(null),[_,A]=r.useState(null),B=!v||!!u||!!v.closest("form"),C={checked:m,disabled:f,setChecked:b,control:v,setControl:w,name:l,form:u,value:d,userClick:_,onUserClick:A,required:p,defaultChecked:!E(a)&&a,isFormControl:B,bubbleInput:x,setBubbleInput:j};return(0,t.jsx)(g,{scope:n,...C,children:k(y)?y(C):o})}c(m,"CheckboxProvider");var b=r.forwardRef(c(function({__scopeCheckbox:e,onKeyDown:i,onClick:s,...a},f){let{control:l,value:h,disabled:p,checked:d,required:g,setControl:m,setChecked:b,onUserClick:v,isFormControl:w,bubbleInput:x}=y("CheckboxTrigger",e),k=(0,n.f)(f,m),_=r.useRef(d);return r.useEffect(()=>{let e=l?.form;if(e){let t=c(()=>b(_.current),"reset");return e.addEventListener("reset",t),()=>e.removeEventListener("reset",t)}},[l,b]),(0,t.jsx)(u.V.button,{type:"button",role:"checkbox","aria-checked":E(d)?"mixed":d,"aria-required":g,"data-state":j(d),"data-disabled":p?"":void 0,disabled:p,value:h,...a,ref:k,onKeyDown:(0,o.f)(i,e=>{"Enter"===e.key&&e.preventDefault()}),onClick:(0,o.f)(s,e=>{let t=e.isPropagationStopped();v({requestedChecked:!!E(d)||!d,hasConsumerStoppedPropagation:t}),b(e=>!!E(e)||!e),x&&w&&!t&&e.stopPropagation()})})},"CheckboxTrigger")),v=r.forwardRef(c(function(e,r){let{__scopeCheckbox:n,name:i,checked:o,defaultChecked:s,required:a,disabled:f,value:u,onCheckedChange:l,form:c,...h}=e;return(0,t.jsx)(m,{__scopeCheckbox:n,checked:o,defaultChecked:s,disabled:f,required:a,onCheckedChange:l,name:i,form:c,value:u,internal_do_not_use_render:({isFormControl:e})=>(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(b,{...h,ref:r,__scopeCheckbox:n}),e&&(0,t.jsx)(x,{__scopeCheckbox:n})]})})},"Checkbox")),w=r.forwardRef(c(function(e,r){let{__scopeCheckbox:n,forceMount:i,...o}=e,s=y("CheckboxIndicator",n);return(0,t.jsx)(f.f,{present:i||E(s.checked)||!0===s.checked,children:(0,t.jsx)(u.V.span,{"data-state":j(s.checked),"data-disabled":s.disabled?"":void 0,...o,ref:r,style:{pointerEvents:"none",...e.style}})})},"CheckboxIndicator")),x=r.forwardRef(c(function({__scopeCheckbox:e,onClick:i,...s},f){let{control:l,userClick:c,checked:h,defaultChecked:p,required:d,disabled:g,name:m,value:b,form:v,bubbleInput:w,setBubbleInput:x}=y("CheckboxBubbleInput",e),k=(0,n.f)(f,x),j=(0,a.f)(l),_=r.useRef(!1),A=r.useRef(h),B=r.useRef(c),C=r.useRef(null);r.useEffect(()=>{if(!w)return;let e=Object.getOwnPropertyDescriptor(window.HTMLInputElement.prototype,"checked").set;if(!e)return;let t=A.current!==h;A.current=h;let r=null!==c&&c!==B.current;if(B.current=c,r)C.current=t?null:c,t&&(w.indeterminate=E(h),e.call(w,!E(h)&&h)),w.dispatchEvent(new Event("click",{bubbles:!c.hasConsumerStoppedPropagation}));else if(t){let t=C.current;C.current=null;let r=t?.requestedChecked===h;_.current=!0,w.indeterminate=E(h),e.call(w,!E(h)&&h),w.dispatchEvent(new Event("click",{bubbles:!(r&&t.hasConsumerStoppedPropagation)})),_.current=!1}},[w,h,c]);let N=r.useRef(!E(h)&&h);return(0,t.jsx)(u.V.input,{type:"checkbox","aria-hidden":!0,defaultChecked:p??N.current,required:d,disabled:g,name:m,value:b,form:v,...s,tabIndex:-1,ref:k,onClick:(0,o.f)(i,e=>{_.current&&e.stopPropagation()}),style:{...s.style,...j,position:"absolute",pointerEvents:"none",opacity:0,margin:0,transform:"translateX(-100%)"}})},"CheckboxBubbleInput"));function k(e){return"function"==typeof e}function E(e){return"indeterminate"===e}function j(e){return E(e)?"indeterminate":e?"checked":"unchecked"}c(k,"isFunction"),c(E,"isIndeterminate"),c(j,"getState");var _=e.i(689664),A=e.i(975157);let B=r.forwardRef(({className:e,...r},n)=>(0,t.jsx)(v,{ref:n,className:(0,A.f)("peer h-4 w-4 shrink-0 rounded-sm border border-primary ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground",e),...r,children:(0,t.jsx)(w,{className:(0,A.f)("flex items-center justify-center text-current"),children:(0,t.jsx)(_.f,{className:"h-4 w-4"})})}));B.displayName=v.displayName,e.s(["f",0,B],257428)},912505,e=>{var t=e.i(843476),r=e.i(975157);e.s(["f",0,function({icon:e,title:n,description:i,action:o,className:s}){return(0,t.jsxs)("div",{className:(0,r.f)("flex flex-col items-center justify-center rounded-2xl border border-dashed bg-card/50 px-6 py-14 text-center",s),children:[(0,t.jsx)("div",{className:"mb-4 flex h-14 w-14 items-center justify-center rounded-2xl bg-accent text-accent-foreground",children:(0,t.jsx)(e,{className:"h-7 w-7"})}),(0,t.jsx)("p",{className:"font-medium",children:n}),i&&(0,t.jsx)("p",{className:"mt-1 max-w-sm text-sm text-muted-foreground",children:i}),o&&(0,t.jsx)("div",{className:"mt-5",children:o})]})}])},393842,e=>{var t=e.i(843476),r=e.i(590546),n=e.i(975157);e.s(["f",0,function({title:e,description:i,backHref:o,actions:s,titleAddon:a,className:f}){return(0,t.jsxs)("div",{className:(0,n.f)("flex items-start gap-3",f),children:[o&&(0,t.jsx)(r.f,{fallbackUrl:o,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}),a]}),i&&(0,t.jsx)("p",{className:"text-sm text-muted-foreground sm:text-base",children:i})]}),s&&(0,t.jsx)("div",{className:"flex shrink-0 items-center gap-2",children:s})]})}])},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})]})}])},185592,e=>{var t=e.i(843476),r=e.i(975157);e.s(["f",0,function({options:e,value:n,onChange:i,className:o}){return(0,t.jsx)("div",{className:(0,r.f)("grid gap-1 rounded-xl bg-muted p-1",o),style:{gridTemplateColumns:`repeat(${e.length}, minmax(0, 1fr))`},role:"tablist",children:e.map(({value:e,label:o,icon:s})=>{let a=e===n;return(0,t.jsxs)("button",{type:"button",role:"tab","aria-selected":a,className:(0,r.f)("flex items-center justify-center gap-1.5 rounded-lg px-2 py-2.5 text-sm font-medium transition-all",a?"bg-card text-primary shadow-sm":"text-muted-foreground hover:text-foreground"),onClick:()=>i(e),children:[s&&(0,t.jsx)(s,{className:"h-4 w-4 shrink-0"}),(0,t.jsx)("span",{className:"truncate",children:o})]},e)})})}])},469817,e=>{e.s(["$",0,18,"u",0,5,"A",0,200])},407198,e=>{let t=["题干","选项A","选项B","选项C","选项D","答案","解析","知识点","难度","题型","学科","年级学期","来源","大题","题号"],r=[["下列哪个选项是正确的?","选项一","选项二","选项三","选项四","A","这是解析内容。","知识点一、知识点二","3","单选题","数学","七年级上学期","2025 期中","第一大题","1"],["1+1=____。","","","","","2","基础加法运算。","基础运算","易","填空题","数学","一年级上学期","课堂练习","第一大题","2"]];async function n(){let{default:n}=await e.A(810068),i=[t,...r];return await n(i).toBlob()}e.s(["I",0,t,"j",0,function(){let e=e=>/[",\n\r]/.test(e)?`"${e.replace(/"/g,'""')}"`:e,n=[];for(let i of(n.push(t.map(e).join(",")),r))n.push(i.map(e).join(","));return`\uFEFF${n.join("\r\n")}\r
2
+ `},"n",0,n])},35209,e=>{var t=e.i(271645),r=e.i(111110);e.s(["f",0,function(...e){let{t:n}=(0,r.b)(),i=[n.pageTitle.base,...e.map(e=>"string"==typeof e?e.trim():"").filter(e=>e.length>0)].join("-");(0,t.useEffect)(()=>{document.title=i},[i])}])},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)}])},401280,e=>{let t={single_choice:"single_choice",singlechoice:"single_choice","single choice":"single_choice","single-choice":"single_choice",multiple_choice:"multiple_choice",multiplechoice:"multiple_choice","multiple choice":"multiple_choice","multiple-choice":"multiple_choice",multichoice:"multiple_choice","multi choice":"multiple_choice",true_false:"true_false",truefalse:"true_false","true/false":"true_false","true false":"true_false","true-false":"true_false","true / false":"true_false",fill_blank:"fill_blank",fillblank:"fill_blank","fill in the blank":"fill_blank","fill-in-the-blank":"fill_blank",fillintheblank:"fill_blank",calculation:"calculation",solution:"solution",reading:"reading",cloze:"cloze",writing:"writing",other:"other",选择题:"single_choice",单项选择:"single_choice",单选:"single_choice",单选题:"single_choice",不定项:"multiple_choice",不定项选择:"multiple_choice",多项选择:"multiple_choice",多选:"multiple_choice",多选题:"multiple_choice",判断:"true_false",判断题:"true_false",是非:"true_false",是非题:"true_false",填空:"fill_blank",填空题:"fill_blank",口算:"calculation",计算:"calculation",计算题:"calculation",解答:"solution",解答题:"solution",应用:"solution",应用题:"solution",证明:"solution",证明题:"solution",简答:"solution",简答题:"solution",阅读:"reading",阅读理解:"reading",完形:"cloze",完形填空:"cloze",作文:"writing",写作:"writing",书面表达:"writing",其他:"other"};e.s(["O",0,"__none__","V",0,["single_choice","multiple_choice","true_false","fill_blank","calculation","solution","reading","cloze","writing","other"],"u",0,{single_choice:"Single Choice",multiple_choice:"Multiple Choice",true_false:"True / False",fill_blank:"Fill in the Blank",calculation:"Calculation",solution:"Solution",reading:"Reading Comprehension",cloze:"Cloze",writing:"Writing",other:"Other"},"H",0,{single_choice:"单选题",multiple_choice:"多选题",true_false:"判断题",fill_blank:"填空题",calculation:"计算题",solution:"解答题",reading:"阅读理解",cloze:"完形填空",writing:"写作",other:"其他"},"P",0,function(e){if("string"!=typeof e)return null;let r=e.trim().toLowerCase();return r?t[r]??null:null}])},380935,164549,e=>{var t=e.i(41931);async function r(e){try{return(await t.k.get(`/api/error-items/short/${encodeURIComponent(e)}`)).id}catch{return null}}e.s(["f",0,r],380935);let n=RegExp("^[123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz]{6}$");e.s(["f",0,function(e){return"string"==typeof e&&n.test(e)}],164549)},428602,e=>{e.s(["f",0,function(e){if(e.tags&&e.tags.length>0)return e.tags.map(e=>e.name);if(!e.knowledgePoints)return[];try{let t=JSON.parse(e.knowledgePoints);return Array.isArray(t)?t.filter(e=>"string"==typeof e):[]}catch{return[]}}])},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}])}],467034,(e,t,r)=>{var n={872:function(e,t){"use strict";t.byteLength=function(e){var t=f(e),r=t[0],n=t[1];return(r+n)*3/4-n},t.toByteArray=function(e){var t,r,o=f(e),s=o[0],a=o[1],u=new i((s+a)*3/4-a),l=0,c=a>0?s-4:s;for(r=0;r<c;r+=4)t=n[e.charCodeAt(r)]<<18|n[e.charCodeAt(r+1)]<<12|n[e.charCodeAt(r+2)]<<6|n[e.charCodeAt(r+3)],u[l++]=t>>16&255,u[l++]=t>>8&255,u[l++]=255&t;return 2===a&&(t=n[e.charCodeAt(r)]<<2|n[e.charCodeAt(r+1)]>>4,u[l++]=255&t),1===a&&(t=n[e.charCodeAt(r)]<<10|n[e.charCodeAt(r+1)]<<4|n[e.charCodeAt(r+2)]>>2,u[l++]=t>>8&255,u[l++]=255&t),u},t.fromByteArray=function(e){for(var t,n=e.length,i=n%3,o=[],s=0,a=n-i;s<a;s+=16383)o.push(function(e,t,n){for(var i,o=[],s=t;s<n;s+=3)i=(e[s]<<16&0xff0000)+(e[s+1]<<8&65280)+(255&e[s+2]),o.push(r[i>>18&63]+r[i>>12&63]+r[i>>6&63]+r[63&i]);return o.join("")}(e,s,s+16383>a?a:s+16383));return 1===i?o.push(r[(t=e[n-1])>>2]+r[t<<4&63]+"=="):2===i&&o.push(r[(t=(e[n-2]<<8)+e[n-1])>>10]+r[t>>4&63]+r[t<<2&63]+"="),o.join("")};for(var r=[],n=[],i="u">typeof Uint8Array?Uint8Array:Array,o="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",s=0,a=o.length;s<a;++s)r[s]=o[s],n[o.charCodeAt(s)]=s;function f(e){var t=e.length;if(t%4>0)throw Error("Invalid string. Length must be a multiple of 4");var r=e.indexOf("=");-1===r&&(r=t);var n=r===t?0:4-r%4;return[r,n]}n[45]=62,n[95]=63},230:function(e,t,r){"use strict";var n=r(872),i=r(321),o="function"==typeof Symbol&&"function"==typeof Symbol.for?Symbol.for("nodejs.util.inspect.custom"):null;function s(e){if(e>0x7fffffff)throw RangeError('The value "'+e+'" is invalid for option "size"');var t=new Uint8Array(e);return Object.setPrototypeOf(t,a.prototype),t}function a(e,t,r){if("number"==typeof e){if("string"==typeof t)throw TypeError('The "string" argument must be of type string. Received type number');return l(e)}return f(e,t,r)}function f(e,t,r){if("string"==typeof e){var n=e,i=t;if(("string"!=typeof i||""===i)&&(i="utf8"),!a.isEncoding(i))throw TypeError("Unknown encoding: "+i);var o=0|p(n,i),f=s(o),u=f.write(n,i);return u!==o&&(f=f.slice(0,u)),f}if(ArrayBuffer.isView(e))return c(e);if(null==e)throw TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof e);if(N(e,ArrayBuffer)||e&&N(e.buffer,ArrayBuffer)||"u">typeof SharedArrayBuffer&&(N(e,SharedArrayBuffer)||e&&N(e.buffer,SharedArrayBuffer)))return function(e,t,r){var n;if(t<0||e.byteLength<t)throw RangeError('"offset" is outside of buffer bounds');if(e.byteLength<t+(r||0))throw RangeError('"length" is outside of buffer bounds');return Object.setPrototypeOf(n=void 0===t&&void 0===r?new Uint8Array(e):void 0===r?new Uint8Array(e,t):new Uint8Array(e,t,r),a.prototype),n}(e,t,r);if("number"==typeof e)throw TypeError('The "value" argument must not be of type number. Received type number');var l=e.valueOf&&e.valueOf();if(null!=l&&l!==e)return a.from(l,t,r);var d=function(e){if(a.isBuffer(e)){var t=0|h(e.length),r=s(t);return 0===r.length||e.copy(r,0,0,t),r}return void 0!==e.length?"number"!=typeof e.length||function(e){return e!=e}(e.length)?s(0):c(e):"Buffer"===e.type&&Array.isArray(e.data)?c(e.data):void 0}(e);if(d)return d;if("u">typeof Symbol&&null!=Symbol.toPrimitive&&"function"==typeof e[Symbol.toPrimitive])return a.from(e[Symbol.toPrimitive]("string"),t,r);throw TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof e)}function u(e){if("number"!=typeof e)throw TypeError('"size" argument must be of type number');if(e<0)throw RangeError('The value "'+e+'" is invalid for option "size"')}function l(e){return u(e),s(e<0?0:0|h(e))}function c(e){for(var t=e.length<0?0:0|h(e.length),r=s(t),n=0;n<t;n+=1)r[n]=255&e[n];return r}t.Buffer=a,t.SlowBuffer=function(e){return+e!=e&&(e=0),a.alloc(+e)},t.INSPECT_MAX_BYTES=50,t.kMaxLength=0x7fffffff,a.TYPED_ARRAY_SUPPORT=function(){try{var e=new Uint8Array(1),t={foo:function(){return 42}};return Object.setPrototypeOf(t,Uint8Array.prototype),Object.setPrototypeOf(e,t),42===e.foo()}catch(e){return!1}}(),!a.TYPED_ARRAY_SUPPORT&&"u">typeof console&&"function"==typeof console.error&&console.error("This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support."),Object.defineProperty(a.prototype,"parent",{enumerable:!0,get:function(){if(a.isBuffer(this))return this.buffer}}),Object.defineProperty(a.prototype,"offset",{enumerable:!0,get:function(){if(a.isBuffer(this))return this.byteOffset}}),a.poolSize=8192,a.from=function(e,t,r){return f(e,t,r)},Object.setPrototypeOf(a.prototype,Uint8Array.prototype),Object.setPrototypeOf(a,Uint8Array),a.alloc=function(e,t,r){return(u(e),e<=0)?s(e):void 0!==t?"string"==typeof r?s(e).fill(t,r):s(e).fill(t):s(e)},a.allocUnsafe=function(e){return l(e)},a.allocUnsafeSlow=function(e){return l(e)};function h(e){if(e>=0x7fffffff)throw RangeError("Attempt to allocate Buffer larger than maximum size: 0x7fffffff bytes");return 0|e}function p(e,t){if(a.isBuffer(e))return e.length;if(ArrayBuffer.isView(e)||N(e,ArrayBuffer))return e.byteLength;if("string"!=typeof e)throw TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof e);var r=e.length,n=arguments.length>2&&!0===arguments[2];if(!n&&0===r)return 0;for(var i=!1;;)switch(t){case"ascii":case"latin1":case"binary":return r;case"utf8":case"utf-8":return _(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*r;case"hex":return r>>>1;case"base64":return B(e).length;default:if(i)return n?-1:_(e).length;t=(""+t).toLowerCase(),i=!0}}function d(e,t,r){var i,o,s,a=!1;if((void 0===t||t<0)&&(t=0),t>this.length||((void 0===r||r>this.length)&&(r=this.length),r<=0||(r>>>=0)<=(t>>>=0)))return"";for(e||(e="utf8");;)switch(e){case"hex":return function(e,t,r){var n=e.length;(!t||t<0)&&(t=0),(!r||r<0||r>n)&&(r=n);for(var i="",o=t;o<r;++o)i+=U[e[o]];return i}(this,t,r);case"utf8":case"utf-8":return b(this,t,r);case"ascii":return function(e,t,r){var n="";r=Math.min(e.length,r);for(var i=t;i<r;++i)n+=String.fromCharCode(127&e[i]);return n}(this,t,r);case"latin1":case"binary":return function(e,t,r){var n="";r=Math.min(e.length,r);for(var i=t;i<r;++i)n+=String.fromCharCode(e[i]);return n}(this,t,r);case"base64":return i=this,o=t,s=r,0===o&&s===i.length?n.fromByteArray(i):n.fromByteArray(i.slice(o,s));case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return function(e,t,r){for(var n=e.slice(t,r),i="",o=0;o<n.length;o+=2)i+=String.fromCharCode(n[o]+256*n[o+1]);return i}(this,t,r);default:if(a)throw TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),a=!0}}function g(e,t,r){var n=e[t];e[t]=e[r],e[r]=n}function y(e,t,r,n,i){var o;if(0===e.length)return -1;if("string"==typeof r?(n=r,r=0):r>0x7fffffff?r=0x7fffffff:r<-0x80000000&&(r=-0x80000000),(o=r*=1)!=o&&(r=i?0:e.length-1),r<0&&(r=e.length+r),r>=e.length)if(i)return -1;else r=e.length-1;else if(r<0)if(!i)return -1;else r=0;if("string"==typeof t&&(t=a.from(t,n)),a.isBuffer(t))return 0===t.length?-1:m(e,t,r,n,i);if("number"==typeof t){if(t&=255,"function"==typeof Uint8Array.prototype.indexOf)if(i)return Uint8Array.prototype.indexOf.call(e,t,r);else return Uint8Array.prototype.lastIndexOf.call(e,t,r);return m(e,[t],r,n,i)}throw TypeError("val must be string, number or Buffer")}function m(e,t,r,n,i){var o,s=1,a=e.length,f=t.length;if(void 0!==n&&("ucs2"===(n=String(n).toLowerCase())||"ucs-2"===n||"utf16le"===n||"utf-16le"===n)){if(e.length<2||t.length<2)return -1;s=2,a/=2,f/=2,r/=2}function u(e,t){return 1===s?e[t]:e.readUInt16BE(t*s)}if(i){var l=-1;for(o=r;o<a;o++)if(u(e,o)===u(t,-1===l?0:o-l)){if(-1===l&&(l=o),o-l+1===f)return l*s}else -1!==l&&(o-=o-l),l=-1}else for(r+f>a&&(r=a-f),o=r;o>=0;o--){for(var c=!0,h=0;h<f;h++)if(u(e,o+h)!==u(t,h)){c=!1;break}if(c)return o}return -1}a.isBuffer=function(e){return null!=e&&!0===e._isBuffer&&e!==a.prototype},a.compare=function(e,t){if(N(e,Uint8Array)&&(e=a.from(e,e.offset,e.byteLength)),N(t,Uint8Array)&&(t=a.from(t,t.offset,t.byteLength)),!a.isBuffer(e)||!a.isBuffer(t))throw TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(e===t)return 0;for(var r=e.length,n=t.length,i=0,o=Math.min(r,n);i<o;++i)if(e[i]!==t[i]){r=e[i],n=t[i];break}return r<n?-1:+(n<r)},a.isEncoding=function(e){switch(String(e).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},a.concat=function(e,t){if(!Array.isArray(e))throw TypeError('"list" argument must be an Array of Buffers');if(0===e.length)return a.alloc(0);if(void 0===t)for(r=0,t=0;r<e.length;++r)t+=e[r].length;var r,n=a.allocUnsafe(t),i=0;for(r=0;r<e.length;++r){var o=e[r];if(N(o,Uint8Array)&&(o=a.from(o)),!a.isBuffer(o))throw TypeError('"list" argument must be an Array of Buffers');o.copy(n,i),i+=o.length}return n},a.byteLength=p,a.prototype._isBuffer=!0,a.prototype.swap16=function(){var e=this.length;if(e%2!=0)throw RangeError("Buffer size must be a multiple of 16-bits");for(var t=0;t<e;t+=2)g(this,t,t+1);return this},a.prototype.swap32=function(){var e=this.length;if(e%4!=0)throw RangeError("Buffer size must be a multiple of 32-bits");for(var t=0;t<e;t+=4)g(this,t,t+3),g(this,t+1,t+2);return this},a.prototype.swap64=function(){var e=this.length;if(e%8!=0)throw RangeError("Buffer size must be a multiple of 64-bits");for(var t=0;t<e;t+=8)g(this,t,t+7),g(this,t+1,t+6),g(this,t+2,t+5),g(this,t+3,t+4);return this},a.prototype.toString=function(){var e=this.length;return 0===e?"":0==arguments.length?b(this,0,e):d.apply(this,arguments)},a.prototype.toLocaleString=a.prototype.toString,a.prototype.equals=function(e){if(!a.isBuffer(e))throw TypeError("Argument must be a Buffer");return this===e||0===a.compare(this,e)},a.prototype.inspect=function(){var e="",r=t.INSPECT_MAX_BYTES;return e=this.toString("hex",0,r).replace(/(.{2})/g,"$1 ").trim(),this.length>r&&(e+=" ... "),"<Buffer "+e+">"},o&&(a.prototype[o]=a.prototype.inspect),a.prototype.compare=function(e,t,r,n,i){if(N(e,Uint8Array)&&(e=a.from(e,e.offset,e.byteLength)),!a.isBuffer(e))throw TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof e);if(void 0===t&&(t=0),void 0===r&&(r=e?e.length:0),void 0===n&&(n=0),void 0===i&&(i=this.length),t<0||r>e.length||n<0||i>this.length)throw RangeError("out of range index");if(n>=i&&t>=r)return 0;if(n>=i)return -1;if(t>=r)return 1;if(t>>>=0,r>>>=0,n>>>=0,i>>>=0,this===e)return 0;for(var o=i-n,s=r-t,f=Math.min(o,s),u=this.slice(n,i),l=e.slice(t,r),c=0;c<f;++c)if(u[c]!==l[c]){o=u[c],s=l[c];break}return o<s?-1:+(s<o)},a.prototype.includes=function(e,t,r){return -1!==this.indexOf(e,t,r)},a.prototype.indexOf=function(e,t,r){return y(this,e,t,r,!0)},a.prototype.lastIndexOf=function(e,t,r){return y(this,e,t,r,!1)};function b(e,t,r){r=Math.min(e.length,r);for(var n=[],i=t;i<r;){var o,s,a,f,u=e[i],l=null,c=u>239?4:u>223?3:u>191?2:1;if(i+c<=r)switch(c){case 1:u<128&&(l=u);break;case 2:(192&(o=e[i+1]))==128&&(f=(31&u)<<6|63&o)>127&&(l=f);break;case 3:o=e[i+1],s=e[i+2],(192&o)==128&&(192&s)==128&&(f=(15&u)<<12|(63&o)<<6|63&s)>2047&&(f<55296||f>57343)&&(l=f);break;case 4:o=e[i+1],s=e[i+2],a=e[i+3],(192&o)==128&&(192&s)==128&&(192&a)==128&&(f=(15&u)<<18|(63&o)<<12|(63&s)<<6|63&a)>65535&&f<1114112&&(l=f)}null===l?(l=65533,c=1):l>65535&&(l-=65536,n.push(l>>>10&1023|55296),l=56320|1023&l),n.push(l),i+=c}var h=n,p=h.length;if(p<=4096)return String.fromCharCode.apply(String,h);for(var d="",g=0;g<p;)d+=String.fromCharCode.apply(String,h.slice(g,g+=4096));return d}function v(e,t,r){if(e%1!=0||e<0)throw RangeError("offset is not uint");if(e+t>r)throw RangeError("Trying to access beyond buffer length")}function w(e,t,r,n,i,o){if(!a.isBuffer(e))throw TypeError('"buffer" argument must be a Buffer instance');if(t>i||t<o)throw RangeError('"value" argument is out of bounds');if(r+n>e.length)throw RangeError("Index out of range")}function x(e,t,r,n,i,o){if(r+n>e.length||r<0)throw RangeError("Index out of range")}function k(e,t,r,n,o){return t*=1,r>>>=0,o||x(e,t,r,4,34028234663852886e22,-34028234663852886e22),i.write(e,t,r,n,23,4),r+4}function E(e,t,r,n,o){return t*=1,r>>>=0,o||x(e,t,r,8,17976931348623157e292,-17976931348623157e292),i.write(e,t,r,n,52,8),r+8}a.prototype.write=function(e,t,r,n){if(void 0===t)n="utf8",r=this.length,t=0;else if(void 0===r&&"string"==typeof t)n=t,r=this.length,t=0;else if(isFinite(t))t>>>=0,isFinite(r)?(r>>>=0,void 0===n&&(n="utf8")):(n=r,r=void 0);else throw Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");var i,o,s,a,f,u,l,c,h=this.length-t;if((void 0===r||r>h)&&(r=h),e.length>0&&(r<0||t<0)||t>this.length)throw RangeError("Attempt to write outside buffer bounds");n||(n="utf8");for(var p=!1;;)switch(n){case"hex":return function(e,t,r,n){r=Number(r)||0;var i=e.length-r;n?(n=Number(n))>i&&(n=i):n=i;var o=t.length;n>o/2&&(n=o/2);for(var s=0;s<n;++s){var a,f=parseInt(t.substr(2*s,2),16);if((a=f)!=a)break;e[r+s]=f}return s}(this,e,t,r);case"utf8":case"utf-8":return i=t,o=r,C(_(e,this.length-i),this,i,o);case"ascii":return s=t,a=r,C(A(e),this,s,a);case"latin1":case"binary":return function(e,t,r,n){return C(A(t),e,r,n)}(this,e,t,r);case"base64":return f=t,u=r,C(B(e),this,f,u);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return l=t,c=r,C(function(e,t){for(var r,n,i=[],o=0;o<e.length&&!((t-=2)<0);++o)n=(r=e.charCodeAt(o))>>8,i.push(r%256),i.push(n);return i}(e,this.length-l),this,l,c);default:if(p)throw TypeError("Unknown encoding: "+n);n=(""+n).toLowerCase(),p=!0}},a.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}},a.prototype.slice=function(e,t){var r=this.length;e=~~e,t=void 0===t?r:~~t,e<0?(e+=r)<0&&(e=0):e>r&&(e=r),t<0?(t+=r)<0&&(t=0):t>r&&(t=r),t<e&&(t=e);var n=this.subarray(e,t);return Object.setPrototypeOf(n,a.prototype),n},a.prototype.readUIntLE=function(e,t,r){e>>>=0,t>>>=0,r||v(e,t,this.length);for(var n=this[e],i=1,o=0;++o<t&&(i*=256);)n+=this[e+o]*i;return n},a.prototype.readUIntBE=function(e,t,r){e>>>=0,t>>>=0,r||v(e,t,this.length);for(var n=this[e+--t],i=1;t>0&&(i*=256);)n+=this[e+--t]*i;return n},a.prototype.readUInt8=function(e,t){return e>>>=0,t||v(e,1,this.length),this[e]},a.prototype.readUInt16LE=function(e,t){return e>>>=0,t||v(e,2,this.length),this[e]|this[e+1]<<8},a.prototype.readUInt16BE=function(e,t){return e>>>=0,t||v(e,2,this.length),this[e]<<8|this[e+1]},a.prototype.readUInt32LE=function(e,t){return e>>>=0,t||v(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+0x1000000*this[e+3]},a.prototype.readUInt32BE=function(e,t){return e>>>=0,t||v(e,4,this.length),0x1000000*this[e]+(this[e+1]<<16|this[e+2]<<8|this[e+3])},a.prototype.readIntLE=function(e,t,r){e>>>=0,t>>>=0,r||v(e,t,this.length);for(var n=this[e],i=1,o=0;++o<t&&(i*=256);)n+=this[e+o]*i;return n>=(i*=128)&&(n-=Math.pow(2,8*t)),n},a.prototype.readIntBE=function(e,t,r){e>>>=0,t>>>=0,r||v(e,t,this.length);for(var n=t,i=1,o=this[e+--n];n>0&&(i*=256);)o+=this[e+--n]*i;return o>=(i*=128)&&(o-=Math.pow(2,8*t)),o},a.prototype.readInt8=function(e,t){return(e>>>=0,t||v(e,1,this.length),128&this[e])?-((255-this[e]+1)*1):this[e]},a.prototype.readInt16LE=function(e,t){e>>>=0,t||v(e,2,this.length);var r=this[e]|this[e+1]<<8;return 32768&r?0xffff0000|r:r},a.prototype.readInt16BE=function(e,t){e>>>=0,t||v(e,2,this.length);var r=this[e+1]|this[e]<<8;return 32768&r?0xffff0000|r:r},a.prototype.readInt32LE=function(e,t){return e>>>=0,t||v(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24},a.prototype.readInt32BE=function(e,t){return e>>>=0,t||v(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]},a.prototype.readFloatLE=function(e,t){return e>>>=0,t||v(e,4,this.length),i.read(this,e,!0,23,4)},a.prototype.readFloatBE=function(e,t){return e>>>=0,t||v(e,4,this.length),i.read(this,e,!1,23,4)},a.prototype.readDoubleLE=function(e,t){return e>>>=0,t||v(e,8,this.length),i.read(this,e,!0,52,8)},a.prototype.readDoubleBE=function(e,t){return e>>>=0,t||v(e,8,this.length),i.read(this,e,!1,52,8)},a.prototype.writeUIntLE=function(e,t,r,n){if(e*=1,t>>>=0,r>>>=0,!n){var i=Math.pow(2,8*r)-1;w(this,e,t,r,i,0)}var o=1,s=0;for(this[t]=255&e;++s<r&&(o*=256);)this[t+s]=e/o&255;return t+r},a.prototype.writeUIntBE=function(e,t,r,n){if(e*=1,t>>>=0,r>>>=0,!n){var i=Math.pow(2,8*r)-1;w(this,e,t,r,i,0)}var o=r-1,s=1;for(this[t+o]=255&e;--o>=0&&(s*=256);)this[t+o]=e/s&255;return t+r},a.prototype.writeUInt8=function(e,t,r){return e*=1,t>>>=0,r||w(this,e,t,1,255,0),this[t]=255&e,t+1},a.prototype.writeUInt16LE=function(e,t,r){return e*=1,t>>>=0,r||w(this,e,t,2,65535,0),this[t]=255&e,this[t+1]=e>>>8,t+2},a.prototype.writeUInt16BE=function(e,t,r){return e*=1,t>>>=0,r||w(this,e,t,2,65535,0),this[t]=e>>>8,this[t+1]=255&e,t+2},a.prototype.writeUInt32LE=function(e,t,r){return e*=1,t>>>=0,r||w(this,e,t,4,0xffffffff,0),this[t+3]=e>>>24,this[t+2]=e>>>16,this[t+1]=e>>>8,this[t]=255&e,t+4},a.prototype.writeUInt32BE=function(e,t,r){return e*=1,t>>>=0,r||w(this,e,t,4,0xffffffff,0),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e,t+4},a.prototype.writeIntLE=function(e,t,r,n){if(e*=1,t>>>=0,!n){var i=Math.pow(2,8*r-1);w(this,e,t,r,i-1,-i)}var o=0,s=1,a=0;for(this[t]=255&e;++o<r&&(s*=256);)e<0&&0===a&&0!==this[t+o-1]&&(a=1),this[t+o]=(e/s|0)-a&255;return t+r},a.prototype.writeIntBE=function(e,t,r,n){if(e*=1,t>>>=0,!n){var i=Math.pow(2,8*r-1);w(this,e,t,r,i-1,-i)}var o=r-1,s=1,a=0;for(this[t+o]=255&e;--o>=0&&(s*=256);)e<0&&0===a&&0!==this[t+o+1]&&(a=1),this[t+o]=(e/s|0)-a&255;return t+r},a.prototype.writeInt8=function(e,t,r){return e*=1,t>>>=0,r||w(this,e,t,1,127,-128),e<0&&(e=255+e+1),this[t]=255&e,t+1},a.prototype.writeInt16LE=function(e,t,r){return e*=1,t>>>=0,r||w(this,e,t,2,32767,-32768),this[t]=255&e,this[t+1]=e>>>8,t+2},a.prototype.writeInt16BE=function(e,t,r){return e*=1,t>>>=0,r||w(this,e,t,2,32767,-32768),this[t]=e>>>8,this[t+1]=255&e,t+2},a.prototype.writeInt32LE=function(e,t,r){return e*=1,t>>>=0,r||w(this,e,t,4,0x7fffffff,-0x80000000),this[t]=255&e,this[t+1]=e>>>8,this[t+2]=e>>>16,this[t+3]=e>>>24,t+4},a.prototype.writeInt32BE=function(e,t,r){return e*=1,t>>>=0,r||w(this,e,t,4,0x7fffffff,-0x80000000),e<0&&(e=0xffffffff+e+1),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e,t+4},a.prototype.writeFloatLE=function(e,t,r){return k(this,e,t,!0,r)},a.prototype.writeFloatBE=function(e,t,r){return k(this,e,t,!1,r)},a.prototype.writeDoubleLE=function(e,t,r){return E(this,e,t,!0,r)},a.prototype.writeDoubleBE=function(e,t,r){return E(this,e,t,!1,r)},a.prototype.copy=function(e,t,r,n){if(!a.isBuffer(e))throw TypeError("argument should be a Buffer");if(r||(r=0),n||0===n||(n=this.length),t>=e.length&&(t=e.length),t||(t=0),n>0&&n<r&&(n=r),n===r||0===e.length||0===this.length)return 0;if(t<0)throw RangeError("targetStart out of bounds");if(r<0||r>=this.length)throw RangeError("Index out of range");if(n<0)throw RangeError("sourceEnd out of bounds");n>this.length&&(n=this.length),e.length-t<n-r&&(n=e.length-t+r);var i=n-r;if(this===e&&"function"==typeof Uint8Array.prototype.copyWithin)this.copyWithin(t,r,n);else if(this===e&&r<t&&t<n)for(var o=i-1;o>=0;--o)e[o+t]=this[o+r];else Uint8Array.prototype.set.call(e,this.subarray(r,n),t);return i},a.prototype.fill=function(e,t,r,n){if("string"==typeof e){if("string"==typeof t?(n=t,t=0,r=this.length):"string"==typeof r&&(n=r,r=this.length),void 0!==n&&"string"!=typeof n)throw TypeError("encoding must be a string");if("string"==typeof n&&!a.isEncoding(n))throw TypeError("Unknown encoding: "+n);if(1===e.length){var i,o=e.charCodeAt(0);("utf8"===n&&o<128||"latin1"===n)&&(e=o)}}else"number"==typeof e?e&=255:"boolean"==typeof e&&(e=Number(e));if(t<0||this.length<t||this.length<r)throw RangeError("Out of range index");if(r<=t)return this;if(t>>>=0,r=void 0===r?this.length:r>>>0,e||(e=0),"number"==typeof e)for(i=t;i<r;++i)this[i]=e;else{var s=a.isBuffer(e)?e:a.from(e,n),f=s.length;if(0===f)throw TypeError('The value "'+e+'" is invalid for argument "value"');for(i=0;i<r-t;++i)this[i+t]=s[i%f]}return this};var j=/[^+/0-9A-Za-z-_]/g;function _(e,t){t=t||1/0;for(var r,n=e.length,i=null,o=[],s=0;s<n;++s){if((r=e.charCodeAt(s))>55295&&r<57344){if(!i){if(r>56319||s+1===n){(t-=3)>-1&&o.push(239,191,189);continue}i=r;continue}if(r<56320){(t-=3)>-1&&o.push(239,191,189),i=r;continue}r=(i-55296<<10|r-56320)+65536}else i&&(t-=3)>-1&&o.push(239,191,189);if(i=null,r<128){if((t-=1)<0)break;o.push(r)}else if(r<2048){if((t-=2)<0)break;o.push(r>>6|192,63&r|128)}else if(r<65536){if((t-=3)<0)break;o.push(r>>12|224,r>>6&63|128,63&r|128)}else if(r<1114112){if((t-=4)<0)break;o.push(r>>18|240,r>>12&63|128,r>>6&63|128,63&r|128)}else throw Error("Invalid code point")}return o}function A(e){for(var t=[],r=0;r<e.length;++r)t.push(255&e.charCodeAt(r));return t}function B(e){return n.toByteArray(function(e){if((e=(e=e.split("=")[0]).trim().replace(j,"")).length<2)return"";for(;e.length%4!=0;)e+="=";return e}(e))}function C(e,t,r,n){for(var i=0;i<n&&!(i+r>=t.length)&&!(i>=e.length);++i)t[i+r]=e[i];return i}function N(e,t){return e instanceof t||null!=e&&null!=e.constructor&&null!=e.constructor.name&&e.constructor.name===t.name}var U=function(){for(var e="0123456789abcdef",t=Array(256),r=0;r<16;++r)for(var n=16*r,i=0;i<16;++i)t[n+i]=e[r]+e[i];return t}()},321:function(e,t){t.read=function(e,t,r,n,i){var o,s,a=8*i-n-1,f=(1<<a)-1,u=f>>1,l=-7,c=r?i-1:0,h=r?-1:1,p=e[t+c];for(c+=h,o=p&(1<<-l)-1,p>>=-l,l+=a;l>0;o=256*o+e[t+c],c+=h,l-=8);for(s=o&(1<<-l)-1,o>>=-l,l+=n;l>0;s=256*s+e[t+c],c+=h,l-=8);if(0===o)o=1-u;else{if(o===f)return s?0/0:(p?-1:1)*2e308;s+=Math.pow(2,n),o-=u}return(p?-1:1)*s*Math.pow(2,o-n)},t.write=function(e,t,r,n,i,o){var s,a,f,u=8*o-i-1,l=(1<<u)-1,c=l>>1,h=5960464477539062e-23*(23===i),p=n?0:o-1,d=n?1:-1,g=+(t<0||0===t&&1/t<0);for(isNaN(t=Math.abs(t))||1/0===t?(a=+!!isNaN(t),s=l):(s=Math.floor(Math.log(t)/Math.LN2),t*(f=Math.pow(2,-s))<1&&(s--,f*=2),s+c>=1?t+=h/f:t+=h*Math.pow(2,1-c),t*f>=2&&(s++,f/=2),s+c>=l?(a=0,s=l):s+c>=1?(a=(t*f-1)*Math.pow(2,i),s+=c):(a=t*Math.pow(2,c-1)*Math.pow(2,i),s=0));i>=8;e[r+p]=255&a,p+=d,a/=256,i-=8);for(s=s<<i|a,u+=i;u>0;e[r+p]=255&s,p+=d,s/=256,u-=8);e[r+p-d]|=128*g}}},i={};function o(e){var t=i[e];if(void 0!==t)return t.exports;var r=i[e]={exports:{}},s=!0;try{n[e](r,r.exports,o),s=!1}finally{s&&delete i[e]}return r.exports}o.ab="/ROOT/node_modules/next/dist/compiled/buffer/",t.exports=o(230)}]);
@@ -0,0 +1 @@
1
+ (()=>{"use strict";(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,711241,e=>{var t=e.i(456420);let r={name:"arrow-left",size:24,node:[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]]};r.node;let a=(0,t.f)(r);e.s(["f",0,a],711241)},952801,e=>{var t=e.i(843476),r=e.i(271645),a=e.i(522016),s=e.i(215519),i=e.i(306831),l=e.i(226091),n=e.i(77071),c=e.i(519455),o=e.i(515288),d=e.i(912505),u=e.i(393842),m=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(699375),v=e.i(574041),y=e.i(111110);let k=["generate","original"];function N({value:e,onChange:r}){let{t:a}=(0,y.b)();return(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsx)(b.f,{children:a.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":a.exam.modeLabel,children:k.map(s=>(0,t.jsx)("button",{type:"button","aria-pressed":e===s,onClick:()=>r(s),className:`rounded px-2 py-1.5 text-sm transition-colors ${e===s?"bg-background shadow-sm font-medium":"text-muted-foreground"}`,children:a.exam.modes[s]},s))}),"original"===e&&(0,t.jsx)("p",{className:"text-xs text-muted-foreground",children:a.exam.originalHint})]})}var _=e.i(41931),w=e.i(470279),C=e.i(401280);let S=["unmastered","mastered","all"],E=["least_practiced","random"],R=["easy","medium","hard","harder"];function L(){let{t:e,language:a}=(0,y.b)(),s=(0,x.useRouter)(),[i,l]=(0,r.useState)([]),[n,d]=(0,r.useState)([]),[u,m]=(0,r.useState)([]),[k,L]=(0,r.useState)([]),[T,O]=(0,r.useState)([]),[P,$]=(0,r.useState)("unmastered"),[A,z]=(0,r.useState)("least_practiced"),[F,I]=(0,r.useState)(10),[M,q]=(0,r.useState)("medium"),[D,H]=(0,r.useState)("generate"),[U,B]=(0,r.useState)(""),[V,K]=(0,r.useState)(!1),[X,Q]=(0,r.useState)(!1),[G,W]=(0,r.useState)(null),[Y,J]=(0,r.useState)(null),{groups:Z,loading:ee}=(0,w.f)();(0,r.useEffect)(()=>{_.k.get("/api/notebooks").then(e=>{l(e),1===e.length&&d([e[0].id])}).catch(()=>l([]))},[]);let et=e=>{O(t=>t.includes(e)?t.filter(t=>t!==e):[...t,e])},er=async t=>{if(t.preventDefault(),0===n.length)return void W(e.exam.noNotebook);Q(!0),W(null),J(null);try{let t=await _.k.post("/api/exams",{subjectIds:n,tagNames:u,paperLevelIds:k.length>0?k:void 0,questionTypes:T.length>0?T.map(e=>e===C.O?"none":e):void 0,scope:P,pickRule:A,count:F,difficulty:"original"===D?void 0:M,mode:D,title:U.trim()||void 0,language:a,parallel:V||void 0});t.papers&&t.papers.length>1?J(e.exam.parallelCreated):"PARALLEL_NOT_ENOUGH"===t.warning?J(e.exam.parallelNotEnough):"PARALLEL_B_QUOTA_EXCEEDED"===t.error&&J(e.exam.parallelQuotaExceeded),s.push(`/exams/${t.id}`)}catch(t){W("NO_SOURCE_ITEMS"===t?.data?.message?e.exam.noSource:e.common.messages?.saveFailed||"Failed"),Q(!1)}},ea=e.practice.difficulty;return(0,t.jsxs)(o.N,{children:[(0,t.jsx)(o.Y,{children:(0,t.jsx)(o.v,{className:"text-lg",children:e.exam.createTitle})}),(0,t.jsx)(o.O,{children:(0,t.jsxs)("form",{onSubmit:er,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}),i.length>1&&(0,t.jsx)("button",{type:"button",className:"text-xs text-primary hover:underline",onClick:()=>d(n.length===i.length?[]:i.map(e=>e.id)),children:e.exam.selectAll})]}),(0,t.jsx)("div",{className:"grid grid-cols-2 sm:grid-cols-3 gap-2",children:i.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:n.includes(e.id),onCheckedChange:()=>{var t;return t=e.id,void d(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)(v.f,{value:u,onChange:m,placeholder:e.exam.tagsPlaceholder})]}),!ee&&Z.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:Z.filter(e=>e.isActive).map(e=>(0,t.jsx)("button",{type:"button",onClick:()=>{var t;return t=e.id,void L(e=>e.includes(t)?e.filter(e=>e!==t):[...e,t])},className:`rounded-full border px-3 py-1.5 text-sm transition-colors ${k.includes(e.id)?"border-primary bg-primary text-primary-foreground":"border-input bg-background hover:bg-muted"}`,children:e.name},e.id))})]}),(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsx)(b.f,{children:e.questionType.label}),(0,t.jsxs)("div",{className:"flex flex-wrap gap-2",children:[C.V.map(r=>(0,t.jsx)("button",{type:"button",onClick:()=>et(r),className:`rounded-full border px-3 py-1.5 text-sm transition-colors ${T.includes(r)?"border-primary bg-primary text-primary-foreground":"border-input bg-background hover:bg-muted"}`,children:e.questionType.names[r]||r},r)),(0,t.jsx)("button",{type:"button",onClick:()=>et(C.O),className:`rounded-full border px-3 py-1.5 text-sm transition-colors ${T.includes(C.O)?"border-primary bg-primary text-primary-foreground":"border-input bg-background hover:bg-muted"}`,children:e.questionType.notSet})]}),(0,t.jsx)("p",{className:"text-xs text-muted-foreground",children:e.exam.questionTypesHint})]}),(0,t.jsx)(N,{value:D,onChange:H}),(0,t.jsxs)("div",{className:`grid gap-4 ${"generate"===D?"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:S.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:F,onChange:e=>I(Math.min(50,Math.max(1,parseInt(e.target.value,10)||1)))})]}),"generate"===D&&(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:M,onChange:e=>q(e.target.value),className:"h-9 w-full rounded-md border bg-background px-3 text-sm",children:R.map(e=>(0,t.jsx)("option",{value:e,children:ea[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:E.map(r=>(0,t.jsx)("button",{type:"button",onClick:()=>z(r),className:`rounded px-2 py-1.5 text-sm transition-colors ${A===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[A]})]}),(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsxs)("div",{className:"flex items-center justify-between gap-4",children:[(0,t.jsx)(b.f,{htmlFor:"exam-parallel",children:e.exam.parallelLabel}),(0,t.jsx)(j.f,{id:"exam-parallel",checked:V,onCheckedChange:K})]}),(0,t.jsx)("p",{className:"text-xs text-muted-foreground",children:e.exam.parallelHint})]}),(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:U,maxLength:100,onChange:e=>B(e.target.value)})]}),G&&(0,t.jsx)("p",{className:"text-sm text-destructive",children:G}),Y&&(0,t.jsx)("p",{className:"text-sm text-primary",children:Y}),(0,t.jsxs)(c.f,{type:"submit",disabled:X,className:"w-full sm:w-auto",children:[X?(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"}),X?e.exam.creating:"original"===D?e.exam.createOriginal:e.exam.generate]})]})})]})}var T=e.i(663661),O=e.i(487486),P=e.i(35209);e.s(["default",0,function(){let{timeZone:e}=(0,s.M)(),{t:x}=(0,y.b)();(0,P.f)(x.exam.title);let[f,h]=(0,r.useState)(null),[p,g]=(0,r.useState)(!1);(0,r.useEffect)(()=>{_.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)(u.f,{title:x.exam.title,description:x.exam.subtitle,actions:!p&&(0,t.jsxs)(c.f,{onClick:()=>g(!0),"aria-label":x.exam.create,children:[(0,t.jsx)(n.f,{className:"h-4 w-4"}),(0,t.jsx)("span",{className:"hidden sm:inline",children:x.exam.create})]})}),p&&(0,t.jsx)(L,{}),(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)(m.f,{}):0===f.length?(0,t.jsx)(d.f,{icon:l.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)(a.default,{href:`/exams/${r.id}`,children:(0,t.jsx)(o.N,{className:"h-full rounded-2xl transition-all hover:-translate-y-0.5 hover:border-primary/40 hover:shadow-md",children:(0,t.jsxs)(o.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)(l.f,{className:"h-4 w-4 shrink-0 text-primary"}),r.title]}),(0,t.jsx)(T.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,i.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)(O.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),a=e.i(111110);let s={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:i}){let{t:l}=(0,a.b)(),n=i&&("ready"===e||"partial"===e)?"completed":e;return(0,t.jsx)(r.f,{variant:"outline",className:s[n],children:l.exam.status[n]})}])},574041,e=>{var t=e.i(843476),r=e.i(271645),a=e.i(263676),s=e.i(487486),i=e.i(793479),l=e.i(41931),n=e.i(201276);e.s(["f",0,function({value:e=[],onChange:c,placeholder:o="Enter tags...",className:d="",enterHint:u,subject:m,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),_=(0,r.useCallback)(async t=>{try{let r=new URLSearchParams({q:t});m&&r.append("subject",m),x&&r.append("stage",x);let a=((await l.k.get(`/api/tags/suggestions?${r.toString()}`)).suggestions||[]).filter(t=>!e.includes(t));g(a.slice(0,20)),j(a.length>0),y(0)}catch(e){n.V.error("[TagInput]","Failed to fetch suggestions",{error:e})}},[m,x,e]);(0,r.useEffect)(()=>{f.trim()&&_(f)},[f,_]);let w=t=>{t.trim()&&!e.includes(t.trim())&&(c([...e,t.trim()]),h(""),g([]),j(!1),y(0))},C=t=>{c(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 ${d}`,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)(s.f,{variant:"secondary",className:"flex items-center gap-1 px-2 py-1",children:[e,(0,t.jsx)("button",{type:"button",onClick:()=>C(e),className:"hover:text-destructive ml-1",children:(0,t.jsx)(a.X,{className:"h-3 w-3"})})]},e)),(0,t.jsx)(i.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]?w(p[v]):f.trim()&&w(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&&C(e[e.length-1])},onFocus:()=>{p.length>0&&j(!0)},placeholder:0===e.length?o:"",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:()=>w(e),onMouseEnter:()=>y(r),children:e},e))}),f&&!b&&(0,t.jsx)("div",{className:"text-xs text-muted-foreground mt-1",children:u?`${u} "${f}"`:`Press Enter to create "${f}"`})]})}])},590546,e=>{var t=e.i(843476),r=e.i(618566),a=e.i(519455),s=e.i(711241);e.s(["f",0,function({fallbackUrl:e,className:i}){let l=(0,r.useRouter)();return(0,t.jsx)(a.f,{variant:"ghost",size:"icon",onClick:()=>{l.push(e)},className:i,children:(0,t.jsx)(s.f,{className:"h-5 w-5"})})}])},257428,e=>{var t=e.i(843476),r=e.i(271645),a=e.i(820783),s=e.i(30030),i=e.i(981140),l=e.i(369340),n=e.i(635804),c=e.i(296626),o=e.i(248425),d=Object.defineProperty,u=(e,t)=>d(e,"name",{value:t,configurable:!0}),m="Checkbox",[x,f]=(0,s.f)(m),[h,p]=x(m);function g(e){let{__scopeCheckbox:a,checked:s,children:i,defaultChecked:n,disabled:c,form:o,name:d,onCheckedChange:u,required:x,value:f="on",internal_do_not_use_render:p}=e,[g,b]=(0,l.f)({prop:s,defaultProp:n??!1,onChange:u,caller:m}),[j,v]=r.useState(null),[y,_]=r.useState(null),[w,C]=r.useState(null),S=!j||!!o||!!j.closest("form"),E={checked:g,disabled:c,setChecked:b,control:j,setControl:v,name:d,form:o,value:f,userClick:w,onUserClick:C,required:x,defaultChecked:!N(n)&&n,isFormControl:S,bubbleInput:y,setBubbleInput:_};return(0,t.jsx)(h,{scope:a,...E,children:k(p)?p(E):i})}u(g,"CheckboxProvider");var b=r.forwardRef(u(function({__scopeCheckbox:e,onKeyDown:s,onClick:l,...n},c){let{control:d,value:m,disabled:x,checked:f,required:h,setControl:g,setChecked:b,onUserClick:j,isFormControl:v,bubbleInput:y}=p("CheckboxTrigger",e),k=(0,a.f)(c,g),w=r.useRef(f);return r.useEffect(()=>{let e=d?.form;if(e){let t=u(()=>b(w.current),"reset");return e.addEventListener("reset",t),()=>e.removeEventListener("reset",t)}},[d,b]),(0,t.jsx)(o.V.button,{type:"button",role:"checkbox","aria-checked":N(f)?"mixed":f,"aria-required":h,"data-state":_(f),"data-disabled":x?"":void 0,disabled:x,value:m,...n,ref:k,onKeyDown:(0,i.f)(s,e=>{"Enter"===e.key&&e.preventDefault()}),onClick:(0,i.f)(l,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(u(function(e,r){let{__scopeCheckbox:a,name:s,checked:i,defaultChecked:l,required:n,disabled:c,value:o,onCheckedChange:d,form:u,...m}=e;return(0,t.jsx)(g,{__scopeCheckbox:a,checked:i,defaultChecked:l,disabled:c,required:n,onCheckedChange:d,name:s,form:u,value:o,internal_do_not_use_render:({isFormControl:e})=>(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(b,{...m,ref:r,__scopeCheckbox:a}),e&&(0,t.jsx)(y,{__scopeCheckbox:a})]})})},"Checkbox")),v=r.forwardRef(u(function(e,r){let{__scopeCheckbox:a,forceMount:s,...i}=e,l=p("CheckboxIndicator",a);return(0,t.jsx)(c.f,{present:s||N(l.checked)||!0===l.checked,children:(0,t.jsx)(o.V.span,{"data-state":_(l.checked),"data-disabled":l.disabled?"":void 0,...i,ref:r,style:{pointerEvents:"none",...e.style}})})},"CheckboxIndicator")),y=r.forwardRef(u(function({__scopeCheckbox:e,onClick:s,...l},c){let{control:d,userClick:u,checked:m,defaultChecked:x,required:f,disabled:h,name:g,value:b,form:j,bubbleInput:v,setBubbleInput:y}=p("CheckboxBubbleInput",e),k=(0,a.f)(c,y),_=(0,n.f)(d),w=r.useRef(!1),C=r.useRef(m),S=r.useRef(u),E=r.useRef(null);r.useEffect(()=>{if(!v)return;let e=Object.getOwnPropertyDescriptor(window.HTMLInputElement.prototype,"checked").set;if(!e)return;let t=C.current!==m;C.current=m;let r=null!==u&&u!==S.current;if(S.current=u,r)E.current=t?null:u,t&&(v.indeterminate=N(m),e.call(v,!N(m)&&m)),v.dispatchEvent(new Event("click",{bubbles:!u.hasConsumerStoppedPropagation}));else if(t){let t=E.current;E.current=null;let r=t?.requestedChecked===m;w.current=!0,v.indeterminate=N(m),e.call(v,!N(m)&&m),v.dispatchEvent(new Event("click",{bubbles:!(r&&t.hasConsumerStoppedPropagation)})),w.current=!1}},[v,m,u]);let R=r.useRef(!N(m)&&m);return(0,t.jsx)(o.V.input,{type:"checkbox","aria-hidden":!0,defaultChecked:x??R.current,required:f,disabled:h,name:g,value:b,form:j,...l,tabIndex:-1,ref:k,onClick:(0,i.f)(s,e=>{w.current&&e.stopPropagation()}),style:{...l.style,..._,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 _(e){return N(e)?"indeterminate":e?"checked":"unchecked"}u(k,"isFunction"),u(N,"isIndeterminate"),u(_,"getState");var w=e.i(689664),C=e.i(975157);let S=r.forwardRef(({className:e,...r},a)=>(0,t.jsx)(j,{ref:a,className:(0,C.f)("peer h-4 w-4 shrink-0 rounded-sm border border-primary ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground",e),...r,children:(0,t.jsx)(v,{className:(0,C.f)("flex items-center justify-center text-current"),children:(0,t.jsx)(w.f,{className:"h-4 w-4"})})}));S.displayName=j.displayName,e.s(["f",0,S],257428)},912505,e=>{var t=e.i(843476),r=e.i(975157);e.s(["f",0,function({icon:e,title:a,description:s,action:i,className:l}){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",l),children:[(0,t.jsx)("div",{className:"mb-4 flex h-14 w-14 items-center justify-center rounded-2xl bg-accent text-accent-foreground",children:(0,t.jsx)(e,{className:"h-7 w-7"})}),(0,t.jsx)("p",{className:"font-medium",children:a}),s&&(0,t.jsx)("p",{className:"mt-1 max-w-sm text-sm text-muted-foreground",children:s}),i&&(0,t.jsx)("div",{className:"mt-5",children:i})]})}])},393842,e=>{var t=e.i(843476),r=e.i(590546),a=e.i(975157);e.s(["f",0,function({title:e,description:s,backHref:i,actions:l,titleAddon:n,className:c}){return(0,t.jsxs)("div",{className:(0,a.f)("flex items-start gap-3",c),children:[i&&(0,t.jsx)(r.f,{fallbackUrl:i,className:"-ml-2 shrink-0"}),(0,t.jsxs)("div",{className:"min-w-0 flex-1 space-y-1",children:[(0,t.jsxs)("div",{className:"flex items-center gap-1",children:[(0,t.jsx)("h1",{className:"truncate text-2xl font-bold tracking-tight sm:text-3xl",children:e}),n]}),s&&(0,t.jsx)("p",{className:"text-sm text-muted-foreground sm:text-base",children:s})]}),l&&(0,t.jsx)("div",{className:"flex shrink-0 items-center gap-2",children:l})]})}])},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:a}=(0,r.b)(),s=[a.pageTitle.base,...e.map(e=>"string"==typeof e?e.trim():"").filter(e=>e.length>0)].join("-");(0,t.useEffect)(()=>{document.title=s},[s])}])},401280,e=>{let t={single_choice:"single_choice",singlechoice:"single_choice","single choice":"single_choice","single-choice":"single_choice",multiple_choice:"multiple_choice",multiplechoice:"multiple_choice","multiple choice":"multiple_choice","multiple-choice":"multiple_choice",multichoice:"multiple_choice","multi choice":"multiple_choice",true_false:"true_false",truefalse:"true_false","true/false":"true_false","true false":"true_false","true-false":"true_false","true / false":"true_false",fill_blank:"fill_blank",fillblank:"fill_blank","fill in the blank":"fill_blank","fill-in-the-blank":"fill_blank",fillintheblank:"fill_blank",calculation:"calculation",solution:"solution",reading:"reading",cloze:"cloze",writing:"writing",other:"other",选择题:"single_choice",单项选择:"single_choice",单选:"single_choice",单选题:"single_choice",不定项:"multiple_choice",不定项选择:"multiple_choice",多项选择:"multiple_choice",多选:"multiple_choice",多选题:"multiple_choice",判断:"true_false",判断题:"true_false",是非:"true_false",是非题:"true_false",填空:"fill_blank",填空题:"fill_blank",口算:"calculation",计算:"calculation",计算题:"calculation",解答:"solution",解答题:"solution",应用:"solution",应用题:"solution",证明:"solution",证明题:"solution",简答:"solution",简答题:"solution",阅读:"reading",阅读理解:"reading",完形:"cloze",完形填空:"cloze",作文:"writing",写作:"writing",书面表达:"writing",其他:"other"};e.s(["O",0,"__none__","V",0,["single_choice","multiple_choice","true_false","fill_blank","calculation","solution","reading","cloze","writing","other"],"u",0,{single_choice:"Single Choice",multiple_choice:"Multiple Choice",true_false:"True / False",fill_blank:"Fill in the Blank",calculation:"Calculation",solution:"Solution",reading:"Reading Comprehension",cloze:"Cloze",writing:"Writing",other:"Other"},"H",0,{single_choice:"单选题",multiple_choice:"多选题",true_false:"判断题",fill_blank:"填空题",calculation:"计算题",solution:"解答题",reading:"阅读理解",cloze:"完形填空",writing:"写作",other:"其他"},"P",0,function(e){if("string"!=typeof e)return null;let r=e.trim().toLowerCase();return r?t[r]??null:null}])}])})();