wrong-notebook 2026.11.4 → 2026.11.5-2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (391) 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.nft.json +1 -1
  17. package/.next/server/app/api/admin/dashboard/route.js +6 -6
  18. package/.next/server/app/api/admin/dashboard/route.js.nft.json +1 -1
  19. package/.next/server/app/api/admin/debug-logs/export/route.js.nft.json +1 -1
  20. package/.next/server/app/api/admin/debug-logs/route.js.nft.json +1 -1
  21. package/.next/server/app/api/admin/migrate-tags/route.js.nft.json +1 -1
  22. package/.next/server/app/api/admin/system-reset/route.js.nft.json +1 -1
  23. package/.next/server/app/api/admin/users/[id]/detail/route.js +6 -6
  24. package/.next/server/app/api/admin/users/[id]/detail/route.js.nft.json +1 -1
  25. package/.next/server/app/api/admin/users/[id]/route.js.nft.json +1 -1
  26. package/.next/server/app/api/admin/users/route.js.nft.json +1 -1
  27. package/.next/server/app/api/ai/models/route.js.nft.json +1 -1
  28. package/.next/server/app/api/ai/test/route.js.nft.json +1 -1
  29. package/.next/server/app/api/analytics/route.js +2 -2
  30. package/.next/server/app/api/analytics/route.js.nft.json +1 -1
  31. package/.next/server/app/api/analyze/route.js +11 -11
  32. package/.next/server/app/api/analyze/route.js.nft.json +1 -1
  33. package/.next/server/app/api/auth/[...nextauth]/route.js.nft.json +1 -1
  34. package/.next/server/app/api/error-items/[id]/delete/route.js.nft.json +1 -1
  35. package/.next/server/app/api/error-items/[id]/figure/route.js +5 -5
  36. package/.next/server/app/api/error-items/[id]/figure/route.js.nft.json +1 -1
  37. package/.next/server/app/api/error-items/[id]/fix-latex/route.js +2 -2
  38. package/.next/server/app/api/error-items/[id]/fix-latex/route.js.nft.json +1 -1
  39. package/.next/server/app/api/error-items/[id]/geogebra/route.js +7 -7
  40. package/.next/server/app/api/error-items/[id]/geogebra/route.js.nft.json +1 -1
  41. package/.next/server/app/api/error-items/[id]/image/route.js.nft.json +1 -1
  42. package/.next/server/app/api/error-items/[id]/notes/route.js.nft.json +1 -1
  43. package/.next/server/app/api/error-items/[id]/practice-records/route.js.nft.json +1 -1
  44. package/.next/server/app/api/error-items/[id]/reanswer/route.js +7 -7
  45. package/.next/server/app/api/error-items/[id]/reanswer/route.js.nft.json +1 -1
  46. package/.next/server/app/api/error-items/[id]/retag/route.js +1 -1
  47. package/.next/server/app/api/error-items/[id]/retag/route.js.nft.json +1 -1
  48. package/.next/server/app/api/error-items/[id]/route.js.nft.json +1 -1
  49. package/.next/server/app/api/error-items/[id]/svg-animation/narration/route.js +12 -12
  50. package/.next/server/app/api/error-items/[id]/svg-animation/narration/route.js.nft.json +1 -1
  51. package/.next/server/app/api/error-items/[id]/svg-animation/route.js +12 -12
  52. package/.next/server/app/api/error-items/[id]/svg-animation/route.js.nft.json +1 -1
  53. package/.next/server/app/api/error-items/answer-space/route.js.nft.json +1 -1
  54. package/.next/server/app/api/error-items/batch-delete/route.js.nft.json +1 -1
  55. package/.next/server/app/api/error-items/clear/route.js.nft.json +1 -1
  56. package/.next/server/app/api/error-items/export-questions/route.js.nft.json +1 -1
  57. package/.next/server/app/api/error-items/list/route.js.nft.json +1 -1
  58. package/.next/server/app/api/error-items/route.js +8 -8
  59. package/.next/server/app/api/error-items/route.js.nft.json +1 -1
  60. package/.next/server/app/api/error-items/short/[shortId]/route.js.nft.json +1 -1
  61. package/.next/server/app/api/error-items/similarity/route.js.nft.json +1 -1
  62. package/.next/server/app/api/exams/[id]/questions/[questionId]/regenerate/route.js +9 -9
  63. package/.next/server/app/api/exams/[id]/questions/[questionId]/regenerate/route.js.nft.json +1 -1
  64. package/.next/server/app/api/exams/[id]/results/route.js +2 -2
  65. package/.next/server/app/api/exams/[id]/results/route.js.nft.json +1 -1
  66. package/.next/server/app/api/exams/[id]/retry/route.js +7 -7
  67. package/.next/server/app/api/exams/[id]/retry/route.js.nft.json +1 -1
  68. package/.next/server/app/api/exams/[id]/route.js +5 -5
  69. package/.next/server/app/api/exams/[id]/route.js.nft.json +1 -1
  70. package/.next/server/app/api/exams/route.js +6 -6
  71. package/.next/server/app/api/exams/route.js.nft.json +1 -1
  72. package/.next/server/app/api/export/route.js.nft.json +1 -1
  73. package/.next/server/app/api/geogebra-analyze/route.js +2 -2
  74. package/.next/server/app/api/geogebra-analyze/route.js.nft.json +1 -1
  75. package/.next/server/app/api/health/route.js.nft.json +1 -1
  76. package/.next/server/app/api/import/route.js +9 -9
  77. package/.next/server/app/api/import/route.js.nft.json +1 -1
  78. package/.next/server/app/api/import-batches/[id]/confirm-all/route.js +17 -17
  79. package/.next/server/app/api/import-batches/[id]/confirm-all/route.js.nft.json +1 -1
  80. package/.next/server/app/api/import-batches/[id]/fix-text/route.js +4 -4
  81. package/.next/server/app/api/import-batches/[id]/fix-text/route.js.nft.json +1 -1
  82. package/.next/server/app/api/import-batches/[id]/read/route.js +16 -16
  83. package/.next/server/app/api/import-batches/[id]/read/route.js.nft.json +1 -1
  84. package/.next/server/app/api/import-batches/[id]/retry/route.js +17 -17
  85. package/.next/server/app/api/import-batches/[id]/retry/route.js.nft.json +1 -1
  86. package/.next/server/app/api/import-batches/[id]/route.js +16 -16
  87. package/.next/server/app/api/import-batches/[id]/route.js.nft.json +1 -1
  88. package/.next/server/app/api/import-batches/[id]/start/route.js +16 -16
  89. package/.next/server/app/api/import-batches/[id]/start/route.js.nft.json +1 -1
  90. package/.next/server/app/api/import-batches/route.js +16 -16
  91. package/.next/server/app/api/import-batches/route.js.nft.json +1 -1
  92. package/.next/server/app/api/import-tasks/[id]/confirm/route.js +19 -19
  93. package/.next/server/app/api/import-tasks/[id]/confirm/route.js.nft.json +1 -1
  94. package/.next/server/app/api/import-tasks/[id]/read/route.js +19 -19
  95. package/.next/server/app/api/import-tasks/[id]/read/route.js.nft.json +1 -1
  96. package/.next/server/app/api/import-tasks/[id]/retry/route.js +19 -19
  97. package/.next/server/app/api/import-tasks/[id]/retry/route.js.nft.json +1 -1
  98. package/.next/server/app/api/import-tasks/[id]/route.js +19 -19
  99. package/.next/server/app/api/import-tasks/[id]/route.js.nft.json +1 -1
  100. package/.next/server/app/api/import-tasks/route.js +16 -16
  101. package/.next/server/app/api/import-tasks/route.js.nft.json +1 -1
  102. package/.next/server/app/api/initialize/route.js.nft.json +1 -1
  103. package/.next/server/app/api/logs/frontend/route.js.nft.json +1 -1
  104. package/.next/server/app/api/minimax-code/checkin/route.js.nft.json +1 -1
  105. package/.next/server/app/api/minimax-code/login/route.js.nft.json +1 -1
  106. package/.next/server/app/api/minimax-code/route.js.nft.json +1 -1
  107. package/.next/server/app/api/notebooks/[id]/retag/route.js +1 -1
  108. package/.next/server/app/api/notebooks/[id]/retag/route.js.nft.json +1 -1
  109. package/.next/server/app/api/notebooks/[id]/route.js.nft.json +1 -1
  110. package/.next/server/app/api/notebooks/route.js.nft.json +1 -1
  111. package/.next/server/app/api/openclaw/batch-upload/route.js +5 -5
  112. package/.next/server/app/api/openclaw/batch-upload/route.js.nft.json +1 -1
  113. package/.next/server/app/api/paper-groups/[id]/route.js.nft.json +1 -1
  114. package/.next/server/app/api/paper-groups/route.js.nft.json +1 -1
  115. package/.next/server/app/api/practice/generate/route.js +6 -6
  116. package/.next/server/app/api/practice/generate/route.js.nft.json +1 -1
  117. package/.next/server/app/api/practice/grade/route.js +5 -5
  118. package/.next/server/app/api/practice/grade/route.js.nft.json +1 -1
  119. package/.next/server/app/api/practice/record/[id]/route.js +5 -5
  120. package/.next/server/app/api/practice/record/[id]/route.js.nft.json +1 -1
  121. package/.next/server/app/api/practice/record/route.js +4 -4
  122. package/.next/server/app/api/practice/record/route.js.nft.json +1 -1
  123. package/.next/server/app/api/reanswer/route.js +3 -3
  124. package/.next/server/app/api/reanswer/route.js.nft.json +1 -1
  125. package/.next/server/app/api/register/route.js.nft.json +1 -1
  126. package/.next/server/app/api/register/status/route.js.nft.json +1 -1
  127. package/.next/server/app/api/requests/[id]/route.js.nft.json +1 -1
  128. package/.next/server/app/api/review/due/route.js +3 -3
  129. package/.next/server/app/api/review/due/route.js.nft.json +1 -1
  130. package/.next/server/app/api/settings/route.js.nft.json +1 -1
  131. package/.next/server/app/api/setup/route.js.nft.json +1 -1
  132. package/.next/server/app/api/stats/activity/route.js.nft.json +1 -1
  133. package/.next/server/app/api/stats/practice/clear/route.js.nft.json +1 -1
  134. package/.next/server/app/api/stats/practice/route.js.nft.json +1 -1
  135. package/.next/server/app/api/stats/repeated-mistakes/route.js +2 -2
  136. package/.next/server/app/api/stats/repeated-mistakes/route.js.nft.json +1 -1
  137. package/.next/server/app/api/stats/weak-tags/route.js +2 -2
  138. package/.next/server/app/api/stats/weak-tags/route.js.nft.json +1 -1
  139. package/.next/server/app/api/tags/route.js.nft.json +1 -1
  140. package/.next/server/app/api/tags/stats/route.js.nft.json +1 -1
  141. package/.next/server/app/api/tags/suggestions/route.js.nft.json +1 -1
  142. package/.next/server/app/api/tasks/route.js.nft.json +1 -1
  143. package/.next/server/app/api/tts/[id]/route.js.nft.json +1 -1
  144. package/.next/server/app/api/tts/batch/route.js.nft.json +1 -1
  145. package/.next/server/app/api/tts/route.js.nft.json +1 -1
  146. package/.next/server/app/api/tts/status/route.js.nft.json +1 -1
  147. package/.next/server/app/api/user/ai-consent/route/app-paths-manifest.json +3 -0
  148. package/.next/server/app/api/user/ai-consent/route/build-manifest.json +12 -0
  149. package/.next/server/app/api/user/ai-consent/route/server-reference-manifest.json +4 -0
  150. package/.next/server/app/api/user/ai-consent/route.js +12 -0
  151. package/.next/server/app/api/user/ai-consent/route.js.map +5 -0
  152. package/.next/server/app/api/user/ai-consent/route.js.nft.json +1 -0
  153. package/.next/server/app/api/user/ai-consent/route_client-reference-manifest.js +3 -0
  154. package/.next/server/app/api/user/route.js +4 -4
  155. package/.next/server/app/api/user/route.js.nft.json +1 -1
  156. package/.next/server/app/error-items/[id]/page.js.nft.json +1 -1
  157. package/.next/server/app/error-items/[id]/page_client-reference-manifest.js +1 -1
  158. package/.next/server/app/exams/[id]/page.js.nft.json +1 -1
  159. package/.next/server/app/exams/[id]/page_client-reference-manifest.js +1 -1
  160. package/.next/server/app/exams/[id]/print/page.js.nft.json +1 -1
  161. package/.next/server/app/exams/[id]/print/page_client-reference-manifest.js +1 -1
  162. package/.next/server/app/exams/page.js.nft.json +1 -1
  163. package/.next/server/app/exams/page_client-reference-manifest.js +1 -1
  164. package/.next/server/app/import-batches/[id]/page.js.nft.json +1 -1
  165. package/.next/server/app/import-batches/[id]/page_client-reference-manifest.js +1 -1
  166. package/.next/server/app/import-tasks/[id]/page.js.nft.json +1 -1
  167. package/.next/server/app/import-tasks/[id]/page_client-reference-manifest.js +1 -1
  168. package/.next/server/app/import-tasks/page.js.nft.json +1 -1
  169. package/.next/server/app/import-tasks/page_client-reference-manifest.js +1 -1
  170. package/.next/server/app/initialize/page.js.nft.json +1 -1
  171. package/.next/server/app/initialize/page_client-reference-manifest.js +1 -1
  172. package/.next/server/app/login/page.js.nft.json +1 -1
  173. package/.next/server/app/login/page_client-reference-manifest.js +1 -1
  174. package/.next/server/app/notebooks/[id]/add/page.js.nft.json +1 -1
  175. package/.next/server/app/notebooks/[id]/add/page_client-reference-manifest.js +1 -1
  176. package/.next/server/app/notebooks/[id]/page.js.nft.json +1 -1
  177. package/.next/server/app/notebooks/[id]/page_client-reference-manifest.js +1 -1
  178. package/.next/server/app/notebooks/page.js.nft.json +1 -1
  179. package/.next/server/app/notebooks/page_client-reference-manifest.js +1 -1
  180. package/.next/server/app/page.js.nft.json +1 -1
  181. package/.next/server/app/page_client-reference-manifest.js +1 -1
  182. package/.next/server/app/practice/page.js.nft.json +1 -1
  183. package/.next/server/app/practice/page_client-reference-manifest.js +1 -1
  184. package/.next/server/app/print-preview/page.js.nft.json +1 -1
  185. package/.next/server/app/print-preview/page_client-reference-manifest.js +1 -1
  186. package/.next/server/app/register/page.js.nft.json +1 -1
  187. package/.next/server/app/register/page_client-reference-manifest.js +1 -1
  188. package/.next/server/app/review/page.js.nft.json +1 -1
  189. package/.next/server/app/review/page_client-reference-manifest.js +1 -1
  190. package/.next/server/app/setup/page.js.nft.json +1 -1
  191. package/.next/server/app/setup/page_client-reference-manifest.js +1 -1
  192. package/.next/server/app/stats/page.js.nft.json +1 -1
  193. package/.next/server/app/stats/page_client-reference-manifest.js +1 -1
  194. package/.next/server/app/tags/page.js.nft.json +1 -1
  195. package/.next/server/app/tags/page_client-reference-manifest.js +1 -1
  196. package/.next/server/app-paths-manifest.json +1 -0
  197. package/.next/server/chunks/[root-of-the-server]__0-d_vh1kcmw7g._.js +1 -1
  198. package/.next/server/chunks/{[root-of-the-server]__025dluj5es8w4._.js → [root-of-the-server]__0-zi_nkxp9dof._.js} +1 -1
  199. package/.next/server/chunks/{[root-of-the-server]__0l8sbsrfjhttk._.js → [root-of-the-server]__02kuxxv4mod1v._.js} +2 -2
  200. package/.next/server/chunks/{[root-of-the-server]__01jxyfokd6l4_._.js → [root-of-the-server]__032tjseth76z3._.js} +1 -1
  201. package/.next/server/chunks/{[root-of-the-server]__00w9qhjl8kvr4._.js → [root-of-the-server]__05wem-_dvlzug._.js} +1 -1
  202. package/.next/server/chunks/{[root-of-the-server]__00w_kxg7h-9_p._.js → [root-of-the-server]__06-v15r8ror-q._.js} +1 -1
  203. package/.next/server/chunks/[root-of-the-server]__06irm2njvcb2a._.js +3 -0
  204. package/.next/server/chunks/{[root-of-the-server]__13a3izu1xb4m4._.js → [root-of-the-server]__07twbtie04xx6._.js} +2 -2
  205. package/.next/server/chunks/{[root-of-the-server]__0-ii_w4q2w_78._.js → [root-of-the-server]__08wrx5aay9znc._.js} +2 -2
  206. package/.next/server/chunks/{[root-of-the-server]__1e7_e83zxstdw._.js → [root-of-the-server]__0_e69dt7jrpui._.js} +2 -2
  207. package/.next/server/chunks/[root-of-the-server]__0_icvdlc-nqy_._.js +3 -0
  208. package/.next/server/chunks/[root-of-the-server]__0aynxvfd9wp_r._.js +3 -0
  209. package/.next/server/chunks/[root-of-the-server]__0dv_e-7ip1wts._.js +3 -0
  210. package/.next/server/chunks/{[root-of-the-server]__02fu_lp66613e._.js → [root-of-the-server]__0eyqs-2hri164._.js} +2 -2
  211. package/.next/server/chunks/{[root-of-the-server]__14gc66h_h3i2i._.js → [root-of-the-server]__0f8kzoc_gaf8y._.js} +2 -2
  212. package/.next/server/chunks/{[root-of-the-server]__163ocf8u6v-xl._.js → [root-of-the-server]__0fembrq8pciz5._.js} +2 -2
  213. package/.next/server/chunks/{[root-of-the-server]__04yihz3dovm0z._.js → [root-of-the-server]__0g0van70ibkrj._.js} +2 -2
  214. package/.next/server/chunks/[root-of-the-server]__0g2s86ce159k0._.js +3 -0
  215. package/.next/server/chunks/{[root-of-the-server]__05a4j8yu5_bg1._.js → [root-of-the-server]__0gankrx12ee4n._.js} +2 -2
  216. package/.next/server/chunks/[root-of-the-server]__0hxujtysw2kwx._.js +3 -0
  217. package/.next/server/chunks/[root-of-the-server]__0ilrqq68_5wg5._.js +3 -0
  218. package/.next/server/chunks/[root-of-the-server]__0ky9-3kyba1lu._.js +3 -0
  219. package/.next/server/chunks/[root-of-the-server]__0lgbdth9-z6qg._.js +1 -1
  220. package/.next/server/chunks/[root-of-the-server]__0lwuci8tnhggb._.js +3 -0
  221. package/.next/server/chunks/[root-of-the-server]__0m4dmn-gj2fnm._.js +3 -0
  222. package/.next/server/chunks/[root-of-the-server]__0ntfbtwf-s7a6._.js +3 -0
  223. package/.next/server/chunks/[root-of-the-server]__0of02idkcau3l._.js +3 -0
  224. package/.next/server/chunks/{[root-of-the-server]__0svpy5s3x369z._.js → [root-of-the-server]__0ohg2cyilt44e._.js} +2 -2
  225. package/.next/server/chunks/[root-of-the-server]__0rsgnrk2qy8wo._.js +3 -0
  226. package/.next/server/chunks/[root-of-the-server]__0si2-m5an9zl7._.js +1 -1
  227. package/.next/server/chunks/[root-of-the-server]__0svdqovwfpro2._.js +1 -1
  228. package/.next/server/chunks/[root-of-the-server]__0v0tr1bn12xyu._.js +3 -0
  229. package/.next/server/chunks/[root-of-the-server]__0vazs1dmyut7b._.js +3 -0
  230. package/.next/server/chunks/{[root-of-the-server]__11wpfrrg965mf._.js → [root-of-the-server]__0w9x80vsjqsbt._.js} +2 -2
  231. package/.next/server/chunks/[root-of-the-server]__0x76w78-o6bfn._.js +3 -0
  232. package/.next/server/chunks/[root-of-the-server]__0xwm-4fhj8j--._.js +3 -0
  233. package/.next/server/chunks/{[root-of-the-server]__0rwoy4jm7s8o7._.js → [root-of-the-server]__13u9cd4f8_gva._.js} +2 -2
  234. package/.next/server/chunks/[root-of-the-server]__16j73gw0vaw81._.js +3 -0
  235. package/.next/server/chunks/[root-of-the-server]__17_lgezg_8k4-._.js +3 -0
  236. package/.next/server/chunks/[root-of-the-server]__17qr9lkc0h9ta._.js +3 -0
  237. package/.next/server/chunks/{[root-of-the-server]__1bw1tevy-ufwx._.js → [root-of-the-server]__18axi_zdc2uzr._.js} +2 -2
  238. package/.next/server/chunks/[root-of-the-server]__19larrqj6rokv._.js +3 -0
  239. package/.next/server/chunks/[root-of-the-server]__1cno0cu053una._.js +3 -0
  240. package/.next/server/chunks/[root-of-the-server]__1cowc49z-6tny._.js +3 -0
  241. package/.next/server/chunks/{[root-of-the-server]__001wdwos9fkgg._.js → [root-of-the-server]__1edbiu94nqqym._.js} +2 -2
  242. package/.next/server/chunks/[root-of-the-server]__1f-ve8idsq57l._.js +1 -1
  243. package/.next/server/chunks/[root-of-the-server]__1f_ztllkdhd1g._.js +3 -0
  244. package/.next/server/chunks/[root-of-the-server]__1g_f4opcfnwwl._.js +3 -0
  245. package/.next/server/chunks/[root-of-the-server]__1iysogl93kyqq._.js +3 -0
  246. package/.next/server/chunks/[root-of-the-server]__1ka1feeszq3gt._.js +3 -0
  247. package/.next/server/chunks/[root-of-the-server]__1ke-yb4v9knf4._.js +3 -0
  248. package/.next/server/chunks/[root-of-the-server]__1kp5acqtrdysf._.js +3 -0
  249. package/.next/server/chunks/[root-of-the-server]__1kxewr0hve3xs._.js +3 -0
  250. package/.next/server/chunks/[root-of-the-server]__1l47_6jece7bq._.js +3 -0
  251. package/.next/server/chunks/{[root-of-the-server]__1gc1jsjtvhvls._.js → [root-of-the-server]__1nb3q3vglx569._.js} +2 -2
  252. package/.next/server/chunks/[root-of-the-server]__1o42aqttqc3b8._.js +3 -0
  253. package/.next/server/chunks/[root-of-the-server]__1pw5kygb6kibs._.js +3 -0
  254. package/.next/server/chunks/[root-of-the-server]__1qy_fxhx5yu1t._.js +3 -0
  255. package/.next/server/chunks/[root-of-the-server]__1sokwptzp3b3m._.js +3 -0
  256. package/.next/server/chunks/{[root-of-the-server]__0cizcawcu31he._.js → [root-of-the-server]__1ve60byz8pq4j._.js} +2 -2
  257. package/.next/server/chunks/{[root-of-the-server]__0fhi9g3nqu6k3._.js → [root-of-the-server]__1vwlmzqz2r0yr._.js} +1 -1
  258. package/.next/server/chunks/{[root-of-the-server]__1pfhgjwnx_--j._.js → [root-of-the-server]__1w_yq12h-kxx0._.js} +2 -2
  259. package/.next/server/chunks/[root-of-the-server]__1x6r0_9_fqoy-._.js +3 -0
  260. package/.next/server/chunks/[root-of-the-server]__1xx-czpwd_ny7._.js +3 -0
  261. package/.next/server/chunks/[root-of-the-server]__1zkrlusy_cbtj._.js +3 -0
  262. package/.next/server/chunks/_011-ll5i30j2e._.js +1 -1
  263. package/.next/server/chunks/_03ovgh1-4xf3f._.js +1 -1
  264. package/.next/server/chunks/_05-ouasholjra._.js +1 -1
  265. package/.next/server/chunks/_06pseal2zu-71._.js +1 -1
  266. package/.next/server/chunks/_08i9pskmlafnp._.js +1 -1
  267. package/.next/server/chunks/_0ahfgpo6w1vyz._.js +3 -0
  268. package/.next/server/chunks/_0d66myj_8567o._.js +1 -1
  269. package/.next/server/chunks/_0h1rbua_hqkox._.js +1 -1
  270. package/.next/server/chunks/_0i58-g30ox5-8._.js +1 -1
  271. package/.next/server/chunks/_0mt2ctbvzfero._.js +1 -1
  272. package/.next/server/chunks/_0r8u30vd4lix4._.js +1 -1
  273. package/.next/server/chunks/_0tl0cy5j96d7h._.js +1 -1
  274. package/.next/server/chunks/_0zs7jfzzshbfq._.js +1 -1
  275. package/.next/server/chunks/_12i51zlq-xxrl._.js +1 -1
  276. package/.next/server/chunks/_18hm5aaxkr500._.js +1 -1
  277. package/.next/server/chunks/_1a1aqmie1d3u_._.js +1 -1
  278. package/.next/server/chunks/_1a1udq0c4_6ad._.js +1 -1
  279. package/.next/server/chunks/_1ad8i3ukisj99._.js +1 -1
  280. package/.next/server/chunks/_1b0269xt-c8f7._.js +1 -1
  281. package/.next/server/chunks/_1cydcmia78z15._.js +1 -1
  282. package/.next/server/chunks/_1hj7iit2u6xez._.js +1 -1
  283. package/.next/server/chunks/_1sp0xk1c5jx5r._.js +1 -1
  284. package/.next/server/chunks/_1zbkha-v5mkk0._.js +1 -1
  285. package/.next/server/chunks/_next-internal_server_app_api_user_ai-consent_route_actions_0g-jtv0cc92di.js +3 -0
  286. package/.next/server/chunks/src_lib_0dxltm34zaclb._.js +1 -1
  287. package/.next/server/chunks/src_lib_0g4wu08m-gibu._.js +1 -1
  288. package/.next/server/chunks/src_lib_0l0j89xrerf8m._.js +1 -1
  289. package/.next/server/chunks/src_lib_0n6nhl7_avcme._.js +1 -1
  290. package/.next/server/chunks/src_lib_0so-2topfosjo._.js +1 -1
  291. package/.next/server/chunks/src_lib_1_p9kz6i8to9n._.js +3 -0
  292. package/.next/server/chunks/src_lib_1t_-lm7x_gu08._.js +3 -0
  293. package/.next/server/chunks/src_lib_import_import-batches_ts_0nq3mn0v5uj28._.js +2 -2
  294. package/.next/server/chunks/src_lib_import_import-tasks_ts_01f-g_upv7llt._.js +1 -1
  295. package/.next/server/chunks/src_lib_mastery_ts_0ybi94uxn8ut6._.js +1 -1
  296. package/.next/server/chunks/src_lib_question_0uw17e6at-i_h._.js +1 -1
  297. package/.next/server/chunks/src_lib_question_question-analysis_ts_1-3x2cfxlr3fs._.js +1 -1
  298. package/.next/server/chunks/src_lib_question_question-deduplication_ts_0gumctesi3szc._.js +1 -1
  299. package/.next/server/chunks/ssr/{[root-of-the-server]__1epxx0lrejssz._.js → [root-of-the-server]__1qkpcqb6ewk9r._.js} +1 -1
  300. package/.next/server/chunks/ssr/_09y2uhjubswp4._.js +1 -1
  301. package/.next/server/chunks/ssr/_0_m51opjnip8x._.js +32 -0
  302. package/.next/server/chunks/ssr/_0cmd1ubdlo_by._.js +1 -1
  303. package/.next/server/chunks/ssr/{_05gdkgyyr0suj._.js → _0fp_p60hb9ex8._.js} +1 -1
  304. package/.next/server/chunks/ssr/_0lzeodofsq9pe._.js +1 -1
  305. package/.next/server/chunks/ssr/_0ozptnii2nxuw._.js +1 -1
  306. package/.next/server/chunks/ssr/{_01zv6gqnnj9oy._.js → _0qs44fqs7b5wd._.js} +1 -1
  307. package/.next/server/chunks/ssr/{node_modules_1yz9gg4275g30._.js → node_modules_0v4btraw_y7x2._.js} +1 -1
  308. package/.next/server/chunks/ssr/{node_modules_1-wb4967v48id._.js → node_modules_1cm5684hz1o51._.js} +1 -1
  309. package/.next/server/chunks/ssr/{node_modules_1we6ggthjslzt._.js → node_modules_1im5by828hg3r._.js} +1 -1
  310. package/.next/server/chunks/ssr/{node_modules_heic-to_dist_csp_heic-to_038nbq-p7grtd.js → node_modules_heic-to_dist_csp_heic-to_064ewwu8t3acv.js} +1 -1
  311. package/.next/server/chunks/ssr/{node_modules_heic-to_dist_csp_heic-to_1b61b0i6philz.js → node_modules_heic-to_dist_csp_heic-to_1xp1ys7qrz7uh.js} +1 -1
  312. package/.next/server/chunks/ssr/src_1rmus42s388dk._.js +1 -1
  313. package/.next/server/chunks/ssr/src_1seqsa8jiwu83._.js +1 -1
  314. package/.next/server/chunks/ssr/src_app_exams_[id]_print_page_tsx_1i-xvhk8ul1l1._.js +2 -2
  315. package/.next/server/chunks/ssr/src_app_print-preview_page_tsx_001yt-fzrj7tf._.js +1 -1
  316. package/.next/server/chunks/ssr/src_components_correction-editor_tsx_1p7z02t66tndx._.js +2 -2
  317. package/.next/server/chunks/ssr/src_components_providers_tsx_09kw-mv3nb6xs._.js +12 -12
  318. package/.next/server/chunks/ssr/src_lib_api-client_ts_04r2_ex-gua5i._.js +1 -1
  319. package/.next/server/chunks/ssr/src_lib_i18n_en_ts_08zkpwnoqey5s._.js +1 -1
  320. package/.next/server/middleware-build-manifest.js +3 -3
  321. package/.next/server/pages/500.html +1 -1
  322. package/.next/static/chunks/{16h0nz5l970cx.js → 08pb1_yl7fhsw.js} +1 -1
  323. package/.next/static/chunks/{1-00icoq9w3_i.js → 0c3tf7izst9o8.js} +1 -1
  324. package/.next/static/chunks/{3ldaxwwj8i1r_.js → 0ddn90rrjkr7y.js} +3 -3
  325. package/.next/static/chunks/185736qwog1ar.js +1 -0
  326. package/.next/static/chunks/{0y9dgn85yuuy5.js → 1bcso9y60vl1j.js} +1 -1
  327. package/.next/static/chunks/1jsd1qdcjh3ht.js +198 -0
  328. package/.next/static/chunks/1nef598mkxf9g.js +1 -0
  329. package/.next/static/chunks/{2r3xwds8ivfso.js → 1ogj95u4nfqgm.js} +5 -5
  330. package/.next/static/chunks/2-m8at3d9m9fl.js +38 -0
  331. package/.next/static/chunks/21jkvmvb2mzaa.js +1 -0
  332. package/.next/static/chunks/32c19i38gl4zx.js +1 -0
  333. package/.next/static/chunks/34r6_zyo8ux86.js +1 -0
  334. package/.next/static/chunks/3_5fscrh8uxav.css +3 -0
  335. package/.next/static/chunks/{2gamhj4j8w-tp.js → 3lvul9moygg-1.js} +4 -4
  336. package/package.json +1 -1
  337. package/prisma/migrations/20261105000000_user_ai_data_consent/migration.sql +2 -0
  338. package/prisma/schema.prisma +1 -0
  339. package/prisma/seed.db +0 -0
  340. package/.next/server/chunks/[root-of-the-server]__07i32k2sv285o._.js +0 -3
  341. package/.next/server/chunks/[root-of-the-server]__0_le78e9b2yno._.js +0 -3
  342. package/.next/server/chunks/[root-of-the-server]__0b8rxaox_x2n1._.js +0 -3
  343. package/.next/server/chunks/[root-of-the-server]__0bvf731upd2_w._.js +0 -3
  344. package/.next/server/chunks/[root-of-the-server]__0eqjbieakyy2g._.js +0 -3
  345. package/.next/server/chunks/[root-of-the-server]__0gk6xz_lxrrer._.js +0 -3
  346. package/.next/server/chunks/[root-of-the-server]__0nin5p-dwlpf9._.js +0 -3
  347. package/.next/server/chunks/[root-of-the-server]__0nye-53zadylr._.js +0 -3
  348. package/.next/server/chunks/[root-of-the-server]__0o9oim91bxvxq._.js +0 -3
  349. package/.next/server/chunks/[root-of-the-server]__0pojh2d6n1kp6._.js +0 -3
  350. package/.next/server/chunks/[root-of-the-server]__0wea836zkhvlj._.js +0 -3
  351. package/.next/server/chunks/[root-of-the-server]__0wex3czgya39o._.js +0 -3
  352. package/.next/server/chunks/[root-of-the-server]__0yq7jm5ja3r6t._.js +0 -3
  353. package/.next/server/chunks/[root-of-the-server]__1-1ld657rjip5._.js +0 -3
  354. package/.next/server/chunks/[root-of-the-server]__11-fk0-4iuf_k._.js +0 -3
  355. package/.next/server/chunks/[root-of-the-server]__11x5u4zg5i2c6._.js +0 -3
  356. package/.next/server/chunks/[root-of-the-server]__12f6t_ozjtn42._.js +0 -3
  357. package/.next/server/chunks/[root-of-the-server]__13cos0n0yw_z6._.js +0 -3
  358. package/.next/server/chunks/[root-of-the-server]__15r55xy6cyrg3._.js +0 -3
  359. package/.next/server/chunks/[root-of-the-server]__16_meybuj-s5w._.js +0 -3
  360. package/.next/server/chunks/[root-of-the-server]__17659spbpgn__._.js +0 -3
  361. package/.next/server/chunks/[root-of-the-server]__1f0zocrmsd5p8._.js +0 -3
  362. package/.next/server/chunks/[root-of-the-server]__1fp6mylnljj_6._.js +0 -3
  363. package/.next/server/chunks/[root-of-the-server]__1gf_vv57qtjh0._.js +0 -3
  364. package/.next/server/chunks/[root-of-the-server]__1hn69stngi4kc._.js +0 -3
  365. package/.next/server/chunks/[root-of-the-server]__1ii155nyrptua._.js +0 -3
  366. package/.next/server/chunks/[root-of-the-server]__1kxecl8v-_px5._.js +0 -3
  367. package/.next/server/chunks/[root-of-the-server]__1l6v9x8xm11pl._.js +0 -3
  368. package/.next/server/chunks/[root-of-the-server]__1r5lj-ffov9r0._.js +0 -3
  369. package/.next/server/chunks/[root-of-the-server]__1uqnotrppylmw._.js +0 -3
  370. package/.next/server/chunks/[root-of-the-server]__1utvl-1o6mb8y._.js +0 -3
  371. package/.next/server/chunks/[root-of-the-server]__1vc89u7_xxhyf._.js +0 -3
  372. package/.next/server/chunks/[root-of-the-server]__1vorkvvfkrr39._.js +0 -3
  373. package/.next/server/chunks/[root-of-the-server]__1x_kq-6h3utmo._.js +0 -3
  374. package/.next/server/chunks/[root-of-the-server]__1x_yvd3pxoee7._.js +0 -3
  375. package/.next/server/chunks/[root-of-the-server]__1y9cx1kv17pl_._.js +0 -3
  376. package/.next/server/chunks/[root-of-the-server]__1z4-5hlzq34fw._.js +0 -3
  377. package/.next/server/chunks/[root-of-the-server]__20vfjg0kexwpn._.js +0 -3
  378. package/.next/server/chunks/src_lib_1-8qgpevmw3ew._.js +0 -3
  379. package/.next/server/chunks/src_lib_1w0niu4i8hnaq._.js +0 -3
  380. package/.next/server/chunks/ssr/_0haie2cnycj6w._.js +0 -32
  381. package/.next/static/chunks/15zro21ycjjle.js +0 -1
  382. package/.next/static/chunks/1vtq_er8xir3c.css +0 -3
  383. package/.next/static/chunks/28qmcol3c39_a.js +0 -198
  384. package/.next/static/chunks/3fj_icg91t5ar.js +0 -38
  385. package/.next/static/chunks/3fyp0ya1q-g_k.js +0 -1
  386. package/.next/static/chunks/3g93k83oklg4_.js +0 -1
  387. package/.next/static/chunks/3u-qpv02dkpmu.js +0 -1
  388. package/.next/static/chunks/3x0gnqbvstc69.js +0 -1
  389. /package/.next/static/{afzFj9VsDFOvE5lff98xs → oMYEAS-Ug2KhwHuve1br9}/_buildManifest.js +0 -0
  390. /package/.next/static/{afzFj9VsDFOvE5lff98xs → oMYEAS-Ug2KhwHuve1br9}/_clientMiddlewareManifest.js +0 -0
  391. /package/.next/static/{afzFj9VsDFOvE5lff98xs → oMYEAS-Ug2KhwHuve1br9}/_ssgManifest.js +0 -0
@@ -0,0 +1,38 @@
1
+ (()=>{"use strict";(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,711241,e=>{var t=e.i(456420);let n={name:"arrow-left",size:24,node:[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]]};n.node;let a=(0,t.f)(n);e.s(["f",0,a],711241)},77043,e=>{var t=e.i(456420);let n={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"}]]};n.node;let a=(0,t.f)(n);e.s(["f",0,a],77043)},580685,e=>{var t=e.i(843476),n=e.i(271645),a=e.i(618566),i=e.i(762368),l=e.i(77043),s=e.i(519455),r=e.i(257428),c=e.i(967489),o=e.i(590546),u=e.i(339023),m=e.i(111110),d=e.i(35209),f=e.i(41931);let x=`
2
+ .exam-sheet { max-width: 210mm; margin: 0 auto; padding: 16px; color: #111; background: #fff; color-scheme: light; font-family: -apple-system, "PingFang SC", "Microsoft YaHei", sans-serif; line-height: 1.6; }
3
+ .exam-sheet h1 { text-align: center; font-size: 22px; margin: 0 0 8px; }
4
+ .exam-sheet .exam-full-score { text-align: center; font-size: 14px; margin: 0 0 8px; }
5
+ .exam-sheet .exam-meta { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px 32px; font-size: 14px; margin-bottom: 20px; }
6
+ .exam-sheet .exam-meta span { min-width: 120px; }
7
+ .exam-sheet .exam-question { break-inside: avoid; page-break-inside: avoid; padding: 12px 0; border-bottom: 1px dashed #ccc; }
8
+ .exam-sheet .exam-question-head { display: flex; justify-content: space-between; gap: 12px; font-weight: 600; }
9
+ .exam-sheet .exam-source { font-family: ui-monospace, Menlo, monospace; font-weight: 400; font-size: 12px; color: #666; white-space: nowrap; }
10
+ .exam-sheet .exam-answer-space { min-height: 0; }
11
+ .exam-sheet .exam-answer-key { break-before: page; page-break-before: always; padding-top: 8px; }
12
+ .exam-sheet .exam-answer-key h2 { text-align: center; font-size: 18px; margin: 0 0 12px; }
13
+ .exam-sheet .exam-label { font-weight: 600; color: #444; }
14
+ /* 按题型分大题的标题行:加粗、上下边框,黑白打印醒目 */
15
+ .exam-sheet .exam-section-head { break-after: avoid; page-break-after: avoid; display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 12px; margin: 16px 0 4px; padding: 6px 0; border-top: 2px solid #111; border-bottom: 1px solid #111; }
16
+ .exam-sheet .exam-section-head h2 { font-size: 16px; margin: 0; }
17
+ .exam-sheet .exam-section-summary { font-size: 13px; color: #333; }
18
+ .exam-sheet .markdown-content p { margin: 4px 0; }
19
+ .exam-sheet .markdown-content img { max-width: 100%; }
20
+ .exam-sheet .question-figure { margin: 8px 0; break-inside: avoid; page-break-inside: avoid; }
21
+ .exam-sheet .question-figure img { display: block; margin: 0 auto; max-width: 100%; max-height: 360px; background: #fff; }
22
+ .exam-sheet .markdown-content table { border-collapse: collapse; }
23
+ .exam-sheet .markdown-content td, .exam-sheet .markdown-content th { border: 1px solid #999; padding: 2px 6px; }
24
+ @media print { .exam-sheet { padding: 0; max-width: none; } .exam-sheet .figure-scale-editor-controls, .exam-sheet .answer-space-controls { display: none; } @page { size: A4; margin: 15mm; } }
25
+ `;function h(e){return e.replace(/[&<>"']/g,e=>({"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"})[e])}var p=e.i(122330),g=e.i(442861),b=e.i(520732),j=e.i(511445),v=e.i(84583),w=e.i(920808),y=e.i(763896),k=e.i(336653);function S({question:e,displayNumber:n,scoreUnit:a,answerSpace:i,customSpaces:l,uniformPreview:s,onSaveFigureScale:r,onChangeCustomSpace:c}){let o,{t:u}=(0,m.b)();return(0,t.jsxs)("section",{className:"exam-question",children:[(0,t.jsxs)("div",{className:"exam-question-head",children:[(0,t.jsxs)("span",{children:[n,".","number"==typeof e.score&&`(${(0,y.s)(e.score)} ${a})`]}),(0,t.jsxs)("span",{className:"exam-source",children:[u.exam.sourceLabel,": ",e.sourceShortId]})]}),(0,t.jsx)(w.f,{content:e.questionText}),(0,t.jsx)(b.f,{svg:e.figureSvg,scale:e.figureScale,align:e.figureAlign,previewScaleOverride:s.scale,previewAlignOverride:s.align,onSave:(t,n)=>r(e.id,t,n)},`${e.id}-${e.figureScale??100}-${e.figureAlign??"center"}`),(o=(0,p.z)(i,e.questionText,l[e.id]),(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("div",{className:"exam-answer-space",style:{minHeight:`${o}px`}}),(0,t.jsx)(v.f,{effectivePx:o,isCustom:"number"==typeof l[e.id],onChange:t=>c(e.id,t),onReset:()=>c(e.id,null)})]}))]})}function _({section:e}){let{t:n}=(0,m.b)(),a=null!==e.scoreTotal?n.exam.sectionSummaryScored.replace("{count}",String(e.count)).replace("{total}",String(e.scoreTotal)):n.exam.sectionSummary.replace("{count}",String(e.count));return(0,t.jsxs)("div",{className:"exam-section-head",children:[(0,t.jsx)("h2",{children:e.title}),(0,t.jsxs)("span",{className:"exam-section-summary",children:[a,null!==e.scoreTotal&&e.unscored>0&&(0,t.jsxs)("span",{children:["(",n.exam.sectionSummaryUnscored.replace("{count}",String(e.unscored)),")"]})]})]})}let N=(0,n.forwardRef)(function({paper:e,includeAnswers:n,answerSpace:a,customSpaces:i,uniformPreview:l,onSaveFigureScale:s,onChangeCustomSpace:r},c){let{t:o,language:u}=(0,m.b)(),d=e.questions.filter(e=>"ready"===e.status&&e.questionText),f=(0,y.n)(d.map(e=>e.score??null)).total,x="en"===u?"pts":"分",h=e.groupByType?(0,k.f)(d,u):null,p=(e,n)=>(0,t.jsx)(S,{question:e,displayNumber:n,scoreUnit:x,answerSpace:a,customSpaces:i,uniformPreview:l,onSaveFigureScale:s,onChangeCustomSpace:r},e.id),g=e=>e.map(e=>(0,t.jsxs)("div",{className:"exam-question",children:[(0,t.jsxs)("div",{className:"exam-question-head",children:[(0,t.jsxs)("span",{children:[e.displayNumber,"."]}),(0,t.jsxs)("span",{className:"exam-source",children:[o.exam.sourceLabel,": ",e.question.sourceShortId]})]}),e.question.answerText&&(0,t.jsxs)("div",{children:[(0,t.jsxs)("span",{className:"exam-label",children:[o.exam.answerLabel,o.common.colon]}),(0,t.jsx)(j.f,{content:e.question.answerText})]}),e.question.analysis&&(0,t.jsxs)("div",{children:[(0,t.jsxs)("span",{className:"exam-label",children:[o.exam.analysisLabel,o.common.colon]}),(0,t.jsx)(j.f,{content:e.question.analysis})]})]},e.question.id));return(0,t.jsxs)("div",{ref:c,className:"exam-sheet",children:[(0,t.jsx)("h1",{children:e.title}),null!==f&&(0,t.jsx)("p",{className:"exam-full-score",children:o.exam.fullScore.replace("{total}",(0,y.s)(f))}),(0,t.jsxs)("div",{className:"exam-meta",children:[(0,t.jsxs)("span",{children:[o.exam.nameLine,o.common.colon,"________"]}),(0,t.jsxs)("span",{children:[o.exam.dateLine,o.common.colon,"________"]}),(0,t.jsxs)("span",{children:[o.exam.scoreLine,o.common.colon,"________"]})]}),h?h.map(e=>(0,t.jsxs)("div",{children:[(0,t.jsx)(_,{section:e}),e.items.map(e=>p(e.question,e.displayNumber))]},e.title)):d.map((e,t)=>p(e,t+1)),n&&(0,t.jsxs)("section",{className:"exam-answer-key",children:[(0,t.jsx)("h2",{children:o.exam.answerKey}),h?h.map(e=>(0,t.jsxs)("div",{children:[(0,t.jsx)(_,{section:e}),g(e.items)]},e.title)):g(d.map((e,t)=>({question:e,displayNumber:t+1})))]})]})}),C=[];e.s(["default",0,function(){let e=(0,a.useParams)(),{t:b,language:j}=(0,m.b)(),[v,w]=(0,n.useState)(null);(0,d.f)(b.exam.title,v?.title,b.pageTitle.examPrint);let[y,k]=(0,n.useState)(!0),[S,_]=(0,n.useState)(p.q),[I,z]=(0,n.useState)({scale:null,align:null}),q=(0,n.useRef)(null),A=v?.id,T=(0,n.useCallback)(async e=>{if(A){if(e.length>1&&e.every(e=>null===e.answerSpacePx))return void await f.k.patch(`/api/exams/${A}`,{answerSpacePx:null});await Promise.all(e.map(({id:e,answerSpacePx:t})=>f.k.patch(`/api/exams/${A}`,{questionId:e,answerSpacePx:t})))}},[A]),{customSpaces:$,setSpace:R,resetAll:F,saveFailed:P}=(0,g.f)(v?.questions??C,T);if((0,n.useEffect)(()=>{let e=null;try{e=localStorage.getItem(p.p)}catch{}(0,p.I)(e)&&_(e)},[]),(0,n.useEffect)(()=>{f.k.get(`/api/exams/${e.id}`).then(w).catch(()=>w(null))},[e.id]),!v)return(0,t.jsx)("div",{className:"p-8 text-center",children:b.common.loading});let V=v.questions.filter(e=>"ready"===e.status&&e.questionText&&!!e.figureSvg),E=v.questions.filter(e=>"ready"===e.status&&e.questionText).length,M=async(e,t,n)=>{await f.k.patch(`/api/exams/${v.id}`,{questionId:e,figureScale:t,figureAlign:n}),w(a=>a?{...a,questions:a.questions.map(a=>a.id===e?{...a,figureScale:t,figureAlign:n}:a)}:a)},L=async e=>{await f.k.patch(`/api/exams/${v.id}`,e),w(t=>t?{...t,questions:t.questions.map(t=>({...t,...e}))}:t)};return(0,t.jsxs)("main",{className:"min-h-screen bg-white",children:[(0,t.jsx)("style",{children:x}),(0,t.jsx)("div",{className:"print:hidden sticky top-0 z-10 border-b bg-background p-3 shadow-sm",children:(0,t.jsxs)("div",{className:"max-w-4xl mx-auto flex flex-wrap items-center gap-3",children:[(0,t.jsx)(o.f,{fallbackUrl:`/exams/${v.id}`}),(0,t.jsx)("span",{className:"font-semibold",children:b.exam.printTitle}),(0,t.jsxs)("label",{className:"flex items-center gap-2 text-sm",children:[(0,t.jsx)(r.f,{checked:y,onCheckedChange:e=>k(!0===e)}),b.exam.includeAnswers]}),(0,t.jsxs)("div",{className:"flex items-center gap-2 text-sm",children:[(0,t.jsx)("span",{className:"shrink-0",children:b.exam.answerSpace}),(0,t.jsxs)(c.d,{value:S,onValueChange:e=>{if((0,p.I)(e)){_(e);try{localStorage.setItem(p.p,e)}catch{}}},children:[(0,t.jsx)(c.P,{className:"h-8 w-40",children:(0,t.jsx)(c.U,{})}),(0,t.jsxs)(c.r,{children:[(0,t.jsx)(c.T,{value:"auto",children:b.exam.answerSpaceAuto}),(0,t.jsx)(c.T,{value:"none",children:b.exam.answerSpaceNone}),(0,t.jsx)(c.T,{value:"small",children:b.exam.answerSpaceSmall}),(0,t.jsx)(c.T,{value:"medium",children:b.exam.answerSpaceMedium}),(0,t.jsx)(c.T,{value:"large",children:b.exam.answerSpaceLarge})]})]}),Object.keys($).length>0&&(0,t.jsx)(s.f,{type:"button",variant:"ghost",size:"sm",onClick:F,children:b.exam.resetAllQuestionAnswerSpaces})]}),(0,t.jsxs)("div",{className:"flex flex-wrap gap-2 sm:ml-auto",children:[(0,t.jsxs)(s.f,{variant:"outline",size:"sm",onClick:()=>{var e;if(!q.current)return;let t=q.current.cloneNode(!0);t.querySelectorAll(".figure-scale-editor-controls, .answer-space-controls, .print\\:hidden").forEach(e=>e.remove());let n=function(e,t,n="zh-CN"){return`<!doctype html>
26
+ <html lang="${h(n)}">
27
+ <head>
28
+ <meta charset="utf-8">
29
+ <meta name="viewport" content="width=device-width, initial-scale=1">
30
+ <title>${h(e)}</title>
31
+ <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/katex@0.19.1/dist/katex.min.css">
32
+ <style>body { margin: 0; background: #fff; }${x}</style>
33
+ </head>
34
+ <body>
35
+ ${t}
36
+ </body>
37
+ </html>
38
+ `}(v.title,t.outerHTML,"en"===j?"en":"zh-CN"),a=URL.createObjectURL(new Blob([n],{type:"text/html;charset=utf-8"})),i=document.createElement("a");i.href=a,e=v.title,i.download=`${e.replace(/[\\/:*?"<>|\s]+/g,"_").slice(0,80)||"exam"}.html`,i.click(),URL.revokeObjectURL(a)},children:[(0,t.jsx)(i.f,{className:"mr-2 h-4 w-4"}),b.exam.downloadHtml]}),(0,t.jsxs)(s.f,{size:"sm",onClick:()=>window.print(),children:[(0,t.jsx)(l.f,{className:"mr-2 h-4 w-4"}),b.exam.printNow]})]}),"auto"===S&&(0,t.jsx)("p",{className:"w-full text-xs text-muted-foreground",children:b.exam.answerSpaceAutoHint}),P&&(0,t.jsx)("p",{className:"w-full text-xs text-destructive",children:b.exam.answerSpaceSaveFailed}),E<v.questions.length&&(0,t.jsx)("p",{className:"w-full text-xs text-muted-foreground",children:b.exam.notReadyHint}),V.length>0&&(0,t.jsx)(u.f,{scales:V.map(e=>e.figureScale),aligns:V.map(e=>e.figureAlign),onPreviewChange:z,onSave:L})]})}),(0,t.jsx)(N,{ref:q,paper:v,includeAnswers:y,answerSpace:S,customSpaces:$,uniformPreview:I,onSaveFigureScale:M,onChangeCustomSpace:R})]})}],580685)},520732,e=>{var t=e.i(843476),n=e.i(271645),a=e.i(149704),i=e.i(519455),l=e.i(793479),s=e.i(111110),r=e.i(294114),c=e.i(184110),o=e.i(201276);e.s(["f",0,function({svg:e,scale:u,align:m,previewScaleOverride:d,previewAlignOverride:f,onSave:x}){let{t:h}=(0,s.b)(),p=(0,n.useId)(),g=(0,c.V)(u),b=(0,c.o)(m),[j,v]=(0,n.useState)(null),[w,y]=(0,n.useState)(null),[k,S]=(0,n.useState)(!1),_=j??String(g),N=""!==_.trim()&&(0,c.x)(Number(_)),C=N?Number(_):g,I=w??b,z=d??C,q=f??I,A=null!==j&&(!N||Number(_)!==g)||null!==w&&w!==b;if(!e)return null;let T=async e=>{if(e.preventDefault(),N&&A&&!k){S(!0);try{await x(C,I),v(null),y(null),r.c.success(h.common.messages.saveSuccess)}catch(e){o.V.error("[FigureScale]","保存配图比例失败",{error:e}),r.c.error(h.common.messages.saveFailed)}finally{S(!1)}}};return(0,t.jsxs)("div",{children:[(0,t.jsx)(a.f,{svg:e,scale:z,align:q}),(0,t.jsxs)("form",{onSubmit:T,className:"figure-scale-editor-controls space-y-2 rounded-md border p-3 print:hidden",children:[(0,t.jsxs)("div",{className:"flex flex-wrap items-center gap-2 text-sm",children:[(0,t.jsx)("label",{htmlFor:p,children:h.figure.scale}),(0,t.jsx)(l.f,{id:p,type:"number",min:c._,max:c.a,step:1,value:_,disabled:k,"aria-describedby":`${p}-hint`,"aria-invalid":!N,onChange:e=>v(e.target.value),className:"h-8 w-20"}),(0,t.jsx)("span",{children:"%"}),(0,t.jsx)(i.f,{type:"button",variant:"outline",size:"sm",disabled:k||N&&C===c.n,onClick:()=>v(String(c.n)),children:h.figure.resetScale}),(0,t.jsxs)("div",{role:"group","aria-label":h.figure.align,className:"inline-flex items-center gap-1",children:[(0,t.jsx)("span",{className:"text-muted-foreground",children:h.figure.align}),c.j.map(e=>(0,t.jsx)(i.f,{type:"button",variant:I===e?"default":"outline",size:"sm",disabled:k,"aria-pressed":I===e,onClick:()=>y(e===b?null:e),children:h.figure.aligns[e]},e))]}),(0,t.jsx)(i.f,{type:"submit",size:"sm",disabled:k||!A||!N,children:k?h.common.progress.saving:h.common.save}),A&&(0,t.jsx)(i.f,{type:"button",variant:"ghost",size:"sm",disabled:k,onClick:()=>{v(null),y(null)},children:h.common.cancel})]}),(0,t.jsx)("input",{type:"range",min:c._,max:c.a,step:1,value:C,disabled:k,"aria-label":h.figure.scaleSlider,"aria-describedby":`${p}-hint`,onChange:e=>v(e.target.value),className:"block h-6 w-full max-w-sm accent-primary"}),(0,t.jsx)("p",{id:`${p}-hint`,className:"text-xs text-muted-foreground",children:h.figure.scaleHint})]})]})}])},339023,763896,336653,e=>{var t=e.i(843476),n=e.i(271645),a=e.i(519455),i=e.i(793479),l=e.i(111110),s=e.i(294114),r=e.i(184110),c=e.i(201276);function o(e){let t=0,n=0;for(let a of e)"number"==typeof a&&Number.isFinite(a)&&(t+=1,n+=a);return{scored:t,unscored:e.length-t,total:t>0?Math.round(10*n)/10:null}}e.s(["f",0,function({scales:e,aligns:o,onPreviewChange:u,onSave:m}){let{t:d}=(0,l.b)(),f=(0,n.useId)(),x=e.map(r.V),h=new Set(x).size<=1,p=x[0]??r.n,g=(o??e.map(()=>r.E)).map(r.o),b=new Set(g).size<=1,j=g[0]??r.E,[v,w]=(0,n.useState)(null),[y,k]=(0,n.useState)(null),[S,_]=(0,n.useState)(!1);if(0===e.length)return null;let N=v??String(p),C=""!==N.trim()&&(0,r.x)(Number(N)),I=C?Number(N):p,z=y??j,q=null!==v||null!==y,A=null!==v?!C||!h||Number(N)!==p:!q&&!h,T=null!==y?!b||y!==j:!q&&!b,$=A||T,R=(e,t)=>{let n=null!==e&&""!==e.trim()&&(0,r.x)(Number(e))?Number(e):null;u?.({scale:n,align:t})},F=e=>{w(e),R(e,y)},P=async e=>{if(e.preventDefault(),C&&$&&!S){_(!0);try{let e={};null===v&&(q||h)||(e.figureScale=I),null===y&&(q||b)||(e.figureAlign=z),await m(e),w(null),k(null),u?.({scale:null,align:null}),s.c.success(d.common.messages.saveSuccess)}catch(e){c.V.error("[ExamFigureScale]","统一保存试卷配图设置失败",{error:e}),s.c.error(d.common.messages.saveFailed)}finally{_(!1)}}};return(0,t.jsxs)("form",{onSubmit:P,className:"figure-scale-editor-controls w-full space-y-2 rounded-md border bg-background p-3 print:hidden",children:[(0,t.jsxs)("div",{className:"flex flex-wrap items-center gap-2 text-sm",children:[(0,t.jsx)("label",{htmlFor:f,className:"font-medium",children:d.exam.uniformFigureScale}),(0,t.jsx)(i.f,{id:f,type:"number",min:r._,max:r.a,step:1,value:N,disabled:S,"aria-describedby":`${f}-hint`,"aria-invalid":!C,onChange:e=>F(e.target.value),className:"h-8 w-20"}),(0,t.jsx)("span",{children:"%"}),(0,t.jsx)(a.f,{type:"button",variant:"outline",size:"sm",disabled:S||h&&C&&I===r.n,onClick:()=>F(String(r.n)),children:d.figure.resetScale}),(0,t.jsxs)("div",{role:"group","aria-label":d.exam.uniformFigureAlign,className:"inline-flex items-center gap-1",children:[(0,t.jsx)("span",{className:"text-muted-foreground",children:d.exam.uniformFigureAlign}),r.j.map(e=>(0,t.jsx)(a.f,{type:"button",variant:z===e&&(null!==y||b)?"default":"outline",size:"sm",disabled:S,"aria-pressed":z===e&&(null!==y||b),onClick:()=>{var t;k(t=b&&e===j?null:e),R(v,t)},children:d.figure.aligns[e]},e))]}),(0,t.jsx)(a.f,{type:"submit",size:"sm",disabled:S||!$||!C,children:S?d.common.progress.saving:d.common.save}),q&&(0,t.jsx)(a.f,{type:"button",variant:"ghost",size:"sm",disabled:S,onClick:()=>{w(null),k(null),u?.({scale:null,align:null})},children:d.common.cancel})]}),(0,t.jsx)("input",{type:"range",min:r._,max:r.a,step:1,value:I,disabled:S,"aria-label":d.exam.uniformFigureScaleSlider,"aria-describedby":`${f}-hint`,onChange:e=>F(e.target.value),className:"block h-6 w-full max-w-sm accent-primary"}),(0,t.jsx)("p",{id:`${f}-hint`,className:"text-xs text-muted-foreground",children:d.exam.uniformFigureScaleHint})]})}],339023),e.s(["D",0,1e3,"s",0,function(e){return Number.isInteger(e)?String(e):e.toFixed(1)},"H",0,function(e){return null===e||"number"!=typeof e||!Number.isFinite(e)||e<.001||e>1e3||Math.abs(10*e-Math.round(10*e))>1e-6?null:Math.round(10*e)/10},"n",0,o],763896);var u=e.i(401280);let m=["一","二","三","四","五","六","七","八","九","十","十一","十二","十三","十四","十五","十六","十七","十八","十九","二十"],d=["I","II","III","IV","V","VI","VII","VIII","IX","X","XI","XII","XIII","XIV","XV","XVI","XVII","XVIII","XIX","XX"];e.s(["f",0,function(e,t){let n=new Map;for(let e of u.V)n.set(e,[]);for(let t of[...e].sort((e,t)=>e.order-t.order))n.get(function(e){let t=e.questionType??e.errorItemQuestionType??null;return u.V.includes(t??"")?t:"other"}(t)).push(t);let a=[],i=1,l=0;for(let e of u.V){let s=n.get(e);if(0===s.length)continue;let r=o(s.map(e=>e.score??null));a.push({type:"other"===e?null:e,title:function(e,t,n){let a="zh"===n?u.H[e]:u.u[e];return"zh"===n?`${m[t]}、${a}`:`Part ${d[t]}. ${a}`}(e,l,t),items:s.map(e=>({question:e,displayNumber:i++})),count:s.length,scoreTotal:r.total,unscored:r.unscored}),l+=1}return a}],336653)},84583,920808,e=>{var t=e.i(843476),n=e.i(519455),a=e.i(111110),i=e.i(122330);e.s(["f",0,function({effectivePx:e,isCustom:l,onChange:s,onReset:r}){let{t:c}=(0,a.b)(),o=(0,i.O)(e);return(0,t.jsxs)("div",{className:"answer-space-controls print:hidden flex flex-wrap items-center gap-2 text-xs text-muted-foreground mt-2 pt-1",children:[(0,t.jsxs)("span",{children:[c.exam.questionAnswerSpace,": ",o,"px"]}),(0,t.jsx)(n.f,{type:"button",variant:"outline",size:"sm",className:"h-6 px-2 text-xs","aria-label":c.exam.decreaseAnswerSpace,disabled:o<=i.r,onClick:()=>s((0,i.O)(o-i.W)),children:"-"}),(0,t.jsx)("input",{type:"range",min:i.r,max:i.R,step:10,value:o,"aria-label":c.exam.questionAnswerSpaceSlider,onChange:e=>s((0,i.O)(Number(e.target.value))),className:"w-24 sm:w-32 accent-primary"}),(0,t.jsx)(n.f,{type:"button",variant:"outline",size:"sm",className:"h-6 px-2 text-xs","aria-label":c.exam.increaseAnswerSpace,disabled:o>=i.R,onClick:()=>s((0,i.O)(o+i.W)),children:"+"}),l&&(0,t.jsx)(n.f,{type:"button",variant:"ghost",size:"sm",className:"h-6 px-2 text-xs",onClick:r,children:c.exam.resetQuestionAnswerSpace})]})}],84583);var l=e.i(271645),s=e.i(511445),r=e.i(369939);let c=["A","B","C","D"];function o(e){return RegExp(`^(?:${e}\\s*[..::、]|[((]${e}[))])`)}function u(e){let t=e.replace(/\$+/g,"").replace(/\\[a-zA-Z]+/g,"").replace(/[{}^_\\]/g,""),n=0;for(let e of t)n+=e.codePointAt(0)>=11904?2:1;return n}let m={4:"grid-cols-2 sm:grid-cols-4 print:grid-cols-4",2:"grid-cols-1 sm:grid-cols-2 print:grid-cols-2",1:"grid-cols-1"};e.s(["f",0,function({content:e}){let n=(0,l.useMemo)(()=>(function(e){if(!e)return null;let{masked:t,segments:n}=(0,r.F)(e.replace(/\\n/g,"\n")),a=(0,r.n)(t,"\n").split("\n"),i=a.findIndex(e=>o("A").test(e.trim()));if(i<0)return null;let l=[],s=0,m=i;for(let e=i;e<a.length&&s<c.length;e+=1){let t=a[e].trim();if(!t)continue;if(!o(c[s]).test(t))break;let n=function(e,t){let n=[],a=e,i=t;for(;i<c.length;){var l;let e=a.match(o(c[i]))[0];a=a.slice(e.length);let t=i+1<c.length?a.match((l=c[i+1],RegExp(`\\s(?:${l}\\s*[..::、]|[((]${l}[))])`))):null,s=t?.index??a.length;if(n.push({label:e.trim(),content:a.slice(0,s).trim()}),i+=1,!t)break;a=a.slice(s).trimStart()}return{options:n,next:i}}(t,s);l.push(...n.options),s=n.next,m=e+1}if(l.length<3||m-i<2)return null;let d=a.slice(m).join("\n").trim();if(s<c.length&&d)return null;let f=e=>(0,r.i)(e,n),x=l.map(e=>({label:e.label,content:f(e.content)}));return{stem:f(a.slice(0,i).join("\n").trim()),options:x,after:f(d),columns:function(e){if(e.some(({content:e})=>/!\[|\|/.test(e)))return 1;let t=Math.max(...e.map(({label:e,content:t})=>u(e)+1+u(t)));return t<=14?4:t<=34?2:1}(x)}})(e),[e]);return n?(0,t.jsxs)(t.Fragment,{children:[n.stem&&(0,t.jsx)(s.f,{content:n.stem}),(0,t.jsx)("div",{className:`choice-options mb-3 grid gap-x-6 gap-y-1 ${m[n.columns]}`,children:n.options.map(e=>(0,t.jsxs)("div",{className:"flex min-w-0 items-baseline gap-1.5",children:[(0,t.jsx)("span",{className:"shrink-0",children:e.label}),(0,t.jsx)(s.f,{content:e.content,className:"flex-1 [&_p]:mb-0"})]},e.label))}),n.after&&(0,t.jsx)(s.f,{content:n.after})]}):(0,t.jsx)(s.f,{content:e})}],920808)},149704,e=>{var t=e.i(843476),n=e.i(111110),a=e.i(398019),i=e.i(184110),l=e.i(975157);let s={left:"mr-auto",center:"mx-auto",right:"ml-auto"};e.s(["f",0,function({svg:e,scale:r,align:c,className:o}){let{t:u}=(0,n.b)();if(!e)return null;let m=(0,i.V)(r),d=(0,i.o)(c);return(0,t.jsx)("figure",{className:(0,l.f)("question-figure my-3",o),children:(0,t.jsx)("img",{src:(0,a.d)(e),alt:u.figure.alt,className:(0,l.f)(s[d],"block h-auto max-w-full rounded border bg-white p-2"),style:{..."left"===d?{marginLeft:0,marginRight:"auto"}:"right"===d?{marginLeft:"auto",marginRight:0}:{},maxHeight:360,zoom:m/100,maxWidth:`${Math.min(m,100)}%`}})})}])},590546,e=>{var t=e.i(843476),n=e.i(618566),a=e.i(519455),i=e.i(711241);e.s(["f",0,function({fallbackUrl:e,className:l}){let s=(0,n.useRouter)();return(0,t.jsx)(a.f,{variant:"ghost",size:"icon",onClick:()=>{s.push(e)},className:l,children:(0,t.jsx)(i.f,{className:"h-5 w-5"})})}])},257428,e=>{var t=e.i(843476),n=e.i(271645),a=e.i(820783),i=e.i(30030),l=e.i(981140),s=e.i(369340),r=e.i(635804),c=e.i(296626),o=e.i(248425),u=Object.defineProperty,m=(e,t)=>u(e,"name",{value:t,configurable:!0}),d="Checkbox",[f,x]=(0,i.f)(d),[h,p]=f(d);function g(e){let{__scopeCheckbox:a,checked:i,children:l,defaultChecked:r,disabled:c,form:o,name:u,onCheckedChange:m,required:f,value:x="on",internal_do_not_use_render:p}=e,[g,b]=(0,s.f)({prop:i,defaultProp:r??!1,onChange:m,caller:d}),[j,v]=n.useState(null),[w,S]=n.useState(null),[_,N]=n.useState(null),C=!j||!!o||!!j.closest("form"),I={checked:g,disabled:c,setChecked:b,control:j,setControl:v,name:u,form:o,value:x,userClick:_,onUserClick:N,required:f,defaultChecked:!k(r)&&r,isFormControl:C,bubbleInput:w,setBubbleInput:S};return(0,t.jsx)(h,{scope:a,...I,children:y(p)?p(I):l})}m(g,"CheckboxProvider");var b=n.forwardRef(m(function({__scopeCheckbox:e,onKeyDown:i,onClick:s,...r},c){let{control:u,value:d,disabled:f,checked:x,required:h,setControl:g,setChecked:b,onUserClick:j,isFormControl:v,bubbleInput:w}=p("CheckboxTrigger",e),y=(0,a.f)(c,g),_=n.useRef(x);return n.useEffect(()=>{let e=u?.form;if(e){let t=m(()=>b(_.current),"reset");return e.addEventListener("reset",t),()=>e.removeEventListener("reset",t)}},[u,b]),(0,t.jsx)(o.V.button,{type:"button",role:"checkbox","aria-checked":k(x)?"mixed":x,"aria-required":h,"data-state":S(x),"data-disabled":f?"":void 0,disabled:f,value:d,...r,ref:y,onKeyDown:(0,l.f)(i,e=>{"Enter"===e.key&&e.preventDefault()}),onClick:(0,l.f)(s,e=>{let t=e.isPropagationStopped();j({requestedChecked:!!k(x)||!x,hasConsumerStoppedPropagation:t}),b(e=>!!k(e)||!e),w&&v&&!t&&e.stopPropagation()})})},"CheckboxTrigger")),j=n.forwardRef(m(function(e,n){let{__scopeCheckbox:a,name:i,checked:l,defaultChecked:s,required:r,disabled:c,value:o,onCheckedChange:u,form:m,...d}=e;return(0,t.jsx)(g,{__scopeCheckbox:a,checked:l,defaultChecked:s,disabled:c,required:r,onCheckedChange:u,name:i,form:m,value:o,internal_do_not_use_render:({isFormControl:e})=>(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(b,{...d,ref:n,__scopeCheckbox:a}),e&&(0,t.jsx)(w,{__scopeCheckbox:a})]})})},"Checkbox")),v=n.forwardRef(m(function(e,n){let{__scopeCheckbox:a,forceMount:i,...l}=e,s=p("CheckboxIndicator",a);return(0,t.jsx)(c.f,{present:i||k(s.checked)||!0===s.checked,children:(0,t.jsx)(o.V.span,{"data-state":S(s.checked),"data-disabled":s.disabled?"":void 0,...l,ref:n,style:{pointerEvents:"none",...e.style}})})},"CheckboxIndicator")),w=n.forwardRef(m(function({__scopeCheckbox:e,onClick:i,...s},c){let{control:u,userClick:m,checked:d,defaultChecked:f,required:x,disabled:h,name:g,value:b,form:j,bubbleInput:v,setBubbleInput:w}=p("CheckboxBubbleInput",e),y=(0,a.f)(c,w),S=(0,r.f)(u),_=n.useRef(!1),N=n.useRef(d),C=n.useRef(m),I=n.useRef(null);n.useEffect(()=>{if(!v)return;let e=Object.getOwnPropertyDescriptor(window.HTMLInputElement.prototype,"checked").set;if(!e)return;let t=N.current!==d;N.current=d;let n=null!==m&&m!==C.current;if(C.current=m,n)I.current=t?null:m,t&&(v.indeterminate=k(d),e.call(v,!k(d)&&d)),v.dispatchEvent(new Event("click",{bubbles:!m.hasConsumerStoppedPropagation}));else if(t){let t=I.current;I.current=null;let n=t?.requestedChecked===d;_.current=!0,v.indeterminate=k(d),e.call(v,!k(d)&&d),v.dispatchEvent(new Event("click",{bubbles:!(n&&t.hasConsumerStoppedPropagation)})),_.current=!1}},[v,d,m]);let z=n.useRef(!k(d)&&d);return(0,t.jsx)(o.V.input,{type:"checkbox","aria-hidden":!0,defaultChecked:f??z.current,required:x,disabled:h,name:g,value:b,form:j,...s,tabIndex:-1,ref:y,onClick:(0,l.f)(i,e=>{_.current&&e.stopPropagation()}),style:{...s.style,...S,position:"absolute",pointerEvents:"none",opacity:0,margin:0,transform:"translateX(-100%)"}})},"CheckboxBubbleInput"));function y(e){return"function"==typeof e}function k(e){return"indeterminate"===e}function S(e){return k(e)?"indeterminate":e?"checked":"unchecked"}m(y,"isFunction"),m(k,"isIndeterminate"),m(S,"getState");var _=e.i(689664),N=e.i(975157);let C=n.forwardRef(({className:e,...n},a)=>(0,t.jsx)(j,{ref:a,className:(0,N.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),...n,children:(0,t.jsx)(v,{className:(0,N.f)("flex items-center justify-center text-current"),children:(0,t.jsx)(_.f,{className:"h-4 w-4"})})}));C.displayName=j.displayName,e.s(["f",0,C],257428)},122330,e=>{let t=["auto","none","small","medium","large"],n={none:0,small:60,medium:120,large:240},a={choice:12,judgment:12,fill:16,solution:240};function i(e){return Number.isFinite(e)?Math.min(600,Math.max(0,Math.round(e))):0}let l=/(?:(?:^|[\s*+\-))::。??;;,,_])([A-D])\s*[..::]|(?:^|\s{2,}|[))::。??])([A-D])\s*、|[((]([A-D])[))])/gm,s=/判断(?:下列|以下|正误|对错|题)|对的(?:打|画)|错的(?:打|画)|true\s*(?:or|\/)\s*false/i,r=/_{2,}|(?:\\_){2,}|\\underline|\\rule\b|\\hspace\b|(\s*)|【\s*】|\[\s+\]|(?<![A-Za-z0-9_])\(\s*\)|[==]\s*[。??]?\s*$|填空/,c=/求证|证明[::,,]|写出(?:解题|计算|推导|推理)?过程|解答下列|试说明理由|请说明理由/,o=/(\s*(\d{1,2})\s*)/g,u=/(?:^|[\n。;;::??!!]\s*)\(\s*(\d{1,2})\s*\)/g;function m(e){let t=new Set;for(let n of e.matchAll(o))t.add(n[1]);for(let n of e.matchAll(u))t.add(n[1]);return Math.max(1,t.size)}e.s(["p",0,"exam-print-answer-space","W",0,20,"q",0,"auto","R",0,600,"r",0,0,"O",0,i,"I",0,function(e){return"string"==typeof e&&t.includes(e)},"T",0,function(e){return"number"!=typeof e||!Number.isInteger(e)||e<0||e>600?null:e},"z",0,function(e,t,o){let u;if("number"==typeof o&&Number.isFinite(o))return i(o);if("auto"!==e)return n[e];let d=(u=new Set(Array.from(t.matchAll(l),e=>e[1]??e[2]??e[3]))).has("A")&&u.has("B")&&u.has("C")?"choice":s.test(t)?"judgment":m(t)>1||c.test(t)?"solution":r.test(t)?"fill":"solution";if("solution"!==d)return a[d];let f=(m(t)-1)*120;return Math.min(560,a.solution+f)}])},184110,e=>{let t=["left","center","right"],n="center";function a(e){return"number"==typeof e&&Number.isInteger(e)&&e>=10&&e<=200}e.s(["E",0,n,"n",0,100,"j",0,t,"a",0,200,"_",0,10,"x",0,a,"o",0,function(e){return"string"==typeof e&&t.includes(e)?e:n},"V",0,function(e){return a(e)?e:100}])},398019,e=>{e.s(["K",0,1e5,"d",0,function(e){return`data:image/svg+xml;charset=utf-8,${encodeURIComponent(e)}`}])},442861,e=>{var t=e.i(271645),n=e.i(122330),a=e.i(201276);e.s(["f",0,function(e,i){let[l,s]=(0,t.useState)({}),[r,c]=(0,t.useState)(!1),o=(0,t.useRef)(new Map),u=(0,t.useRef)(null),m=(0,t.useRef)(i);(0,t.useEffect)(()=>{m.current=i},[i]);let d=(0,t.useMemo)(()=>{let t={};for(let a of e){let e=a.id in l?l[a.id]:(0,n.T)(a.answerSpacePx);"number"==typeof e&&(t[a.id]=e)}return t},[e,l]),f=(0,t.useCallback)(()=>{if(u.current&&(clearTimeout(u.current),u.current=null),0===o.current.size)return;let e=Array.from(o.current,([e,t])=>({id:e,answerSpacePx:t}));o.current.clear(),m.current(e).then(()=>c(!1)).catch(e=>{c(!0),a.V.error("[AnswerSpace]","Failed to save answer space",{error:e})})},[]);(0,t.useEffect)(()=>f,[f]);let x=(0,t.useCallback)((e,t)=>{if(0!==e.length){for(let{id:t,answerSpacePx:n}of(s(t=>{let n={...t};for(let{id:t,answerSpacePx:a}of e)n[t]=a;return n}),e))o.current.set(t,n);if(t)return void f();u.current&&clearTimeout(u.current),u.current=setTimeout(f,600)}},[f]),h=(0,t.useCallback)((e,t)=>{x([{id:e,answerSpacePx:t}],null===t)},[x]),p=(0,t.useCallback)(()=>{x(Object.keys(d).map(e=>({id:e,answerSpacePx:null})),!0)},[d,x]);return{customSpaces:d,setSpace:h,resetAll:p,saveFailed:r}}])},35209,e=>{var t=e.i(271645),n=e.i(111110);e.s(["f",0,function(...e){let{t:a}=(0,n.b)(),i=[a.pageTitle.base,...e.map(e=>"string"==typeof e?e.trim():"").filter(e=>e.length>0)].join("-");(0,t.useEffect)(()=>{document.title=i},[i])}])},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 n=e.trim().toLowerCase();return n?t[n]??null:null}])}])})();
@@ -0,0 +1 @@
1
+ (()=>{"use strict";(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,981140,e=>{var t=Object.defineProperty,n=(e,n)=>t(e,"name",{value:n,configurable:!0}),r=!!("u">typeof window&&window.document&&window.document.createElement);function o(e,t,{checkForDefaultPrevented:r=!0}={}){return n(function(n){if(e?.(n),!1===r||!n||!n.defaultPrevented)return t?.(n)},"handleEvent")}function i(e){if(!r)throw Error("Cannot access document outside of the DOM");return e?.ownerDocument??document}function a(e){return"IFRAME"===e.tagName}n(o,"composeEventHandlers"),n(function(e){if(!r)throw Error("Cannot access window outside of the DOM");return e?.ownerDocument?.defaultView??window},"getOwnerWindow"),n(i,"getOwnerDocument"),n(function e(t,n=!1){let{activeElement:r}=i(t);if(!r?.nodeName)return null;if(a(r)&&r.contentDocument)return e(r.contentDocument.body,n);if(n){let e=r.getAttribute("aria-activedescendant");if(e){let t=i(r).getElementById(e);if(t)return t}}return r},"getActiveElement"),n(a,"isFrame"),e.s(["f",0,o])},705844,e=>{e.s(["f",0,!1])},30030,e=>{var t=e.i(271645),n=e.i(843476),r=Object.defineProperty,o=(e,t)=>r(e,"name",{value:t,configurable:!0});function i(e,r=[]){let s=[];function l(r,i){let a=t.createContext(i);a.displayName=r+"Context";let l=s.length;s=[...s,i];let c=o(r=>{let{scope:o,children:i,...s}=r,c=o?.[e]?.[l]||a,u=t.useMemo(()=>s,Object.values(s));return(0,n.jsx)(c.Provider,{value:u,children:i})},"Provider");function u(n,o,s={}){let{optional:c=!1}=s,d=o?.[e]?.[l]||a,f=t.useContext(d);if(f)return f;if(void 0!==i)return i;if(!c)throw Error(`\`${n}\` must be used within \`${r}\``)}return c.displayName=r+"Provider",o(u,"useContext"),[c,u]}o(l,"createContext");let c=o(()=>{let n=s.map(e=>t.createContext(e));return o(function(r){let o=r?.[e]||n;return t.useMemo(()=>({[`__scope${e}`]:{...r,[e]:o}}),[r,o])},"useScope")},"createScope");return c.scopeName=e,[l,a(c,...r)]}function a(...e){let n=e[0];if(1===e.length)return n;let r=o(()=>{let r=e.map(e=>({useScope:e(),scopeName:e.scopeName}));return o(function(e){let o=r.reduce((t,{useScope:n,scopeName:r})=>{let o=n(e)[`__scope${r}`];return{...t,...o}},{});return t.useMemo(()=>({[`__scope${n.scopeName}`]:o}),[o])},"useComposedScopes")},"createScope");return r.scopeName=n.scopeName,r}o(function(e,r){let i=t.createContext(r);i.displayName=e+"Context";let a=o(e=>{let{children:r,...o}=e,a=t.useMemo(()=>o,Object.values(o));return(0,n.jsx)(i.Provider,{value:a,children:r})},"Provider");function s(n,o={}){let{optional:a=!1}=o,l=t.useContext(i);if(l)return l;if(void 0!==r)return r;if(!a)throw Error(`\`${n}\` must be used within \`${e}\``)}return a.displayName=e+"Provider",o(s,"useContext"),[a,s]},"createContext"),o(i,"createContextScope"),o(a,"composeContextScopes"),e.s(["f",0,i])},296626,e=>{var t=e.i(271645),n=e.i(934620),r=Object.defineProperty,o=(e,t)=>r(e,"name",{value:t,configurable:!0});function i(e,n){return t.useReducer((e,t)=>n[e][t]??e,e)}o(i,"useStateMachine");var a=o(e=>{let{present:n,children:r}=e,o=s(n),i="function"==typeof r?r({present:o.isPresent}):t.Children.only(r),a=c(o.ref,d(i));return"function"==typeof r||o.isPresent?t.cloneElement(i,{ref:a}):null},"Presence");function s(e){let[r,a]=t.useState(),s=t.useRef(null),l=t.useRef(e),c=t.useRef("none"),d=t.useRef(void 0),[f,m]=i(e?"mounted":"unmounted",{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return t.useEffect(()=>{"mounted"===f?(c.current=d.current??u(s.current),d.current=void 0):c.current="none"},[f]),(0,n.f)(()=>{let t=s.current,n=l.current;if(n!==e){let r=c.current,o=u(t);e?(d.current=o,m("MOUNT")):"none"===o||t?.display==="none"?m("UNMOUNT"):n&&r!==o?m("ANIMATION_OUT"):m("UNMOUNT"),l.current=e}},[e,m]),(0,n.f)(()=>{if(r){let e,t=r.ownerDocument.defaultView??window,n=o(n=>{let o=u(s.current).includes(CSS.escape(n.animationName));if(n.target===r&&o&&(m("ANIMATION_END"),!l.current)){let n=r.style.animationFillMode;r.style.animationFillMode="forwards",e=t.setTimeout(()=>{"forwards"===r.style.animationFillMode&&(r.style.animationFillMode=n)})}},"handleAnimationEnd"),i=o(e=>{e.target===r&&(c.current=u(s.current))},"handleAnimationStart");return r.addEventListener("animationstart",i),r.addEventListener("animationcancel",n),r.addEventListener("animationend",n),()=>{t.clearTimeout(e),r.removeEventListener("animationstart",i),r.removeEventListener("animationcancel",n),r.removeEventListener("animationend",n)}}m("ANIMATION_END")},[r,m]),{isPresent:["mounted","unmountSuspended"].includes(f),ref:t.useCallback(e=>{if(e){let t=getComputedStyle(e);s.current=t,d.current=u(t)}else s.current=null;a(e)},[])}}function l(e,t){if("function"==typeof e)return e(t);null!=e&&(e.current=t)}function c(...e){let n=t.useRef(e);return n.current=e,t.useCallback(e=>{let t=n.current,r=!1,o=t.map(t=>{let n=l(t,e);return r||"function"!=typeof n||(r=!0),n});if(r)return()=>{for(let e=0;e<o.length;e++){let n=o[e];"function"==typeof n?n():l(t[e],null)}}},[])}function u(e){return e?.animationName||"none"}function d(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(n=(t=Object.getOwnPropertyDescriptor(e,"ref")?.get)&&"isReactWarning"in t&&t.isReactWarning)?e.props.ref:e.props.ref||e.ref}o(s,"usePresence"),o(l,"setRef"),o(c,"useStableComposedRefs"),o(u,"getAnimationName"),o(d,"getElementRef"),e.s(["f",0,a])},248425,e=>{var t=e.i(271645),n=e.i(174080),r=e.i(991918),o=e.i(843476),i=Object.defineProperty,a=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"].reduce((e,n)=>{let i=(0,r.B)(`Primitive.${n}`),a=t.forwardRef((e,t)=>{let{asChild:r,...a}=e;return"u">typeof window&&(window[Symbol.for("radix-ui")]=!0),(0,o.jsx)(r?i:n,{...a,ref:t})});return a.displayName=`Primitive.${n}`,{...e,[n]:a}},{});function s(e,t){e&&n.flushSync(()=>e.dispatchEvent(t))}i(s,"name",{value:"dispatchDiscreteCustomEvent",configurable:!0}),e.s(["V",0,a,"u",0,s])},369340,e=>{var t=e.i(271645),n=e.i(705844),r=e.i(934620),o=Object.defineProperty,i=t[" useEffectEvent ".trim().toString()],a=t[" useInsertionEffect ".trim().toString()];function s(e){if("function"==typeof i)return i(e);let n=t.useRef(()=>{throw Error("Cannot call an event handler while rendering.")});return"function"==typeof a?a(()=>{n.current=e}):(0,r.f)(()=>{n.current=e}),t.useMemo(()=>(...e)=>n.current?.(...e),[])}o(s,"name",{value:"useEffectEvent",configurable:!0});var l=Object.defineProperty,c=(e,t)=>l(e,"name",{value:t,configurable:!0}),u=t[" useInsertionEffect ".trim().toString()]||r.f;function d({prop:e,defaultProp:r,onChange:o=c(()=>{},"onChange"),caller:i}){let[a,s,l]=f({defaultProp:r,onChange:o}),u=void 0!==e,p=u?e:a;if(n.f){let n=t.useRef(void 0!==e);t.useEffect(()=>{let e=n.current;if(e!==u){let t=u?"controlled":"uncontrolled";console.warn(`${i} is changing from ${e?"controlled":"uncontrolled"} to ${t}. Components should not switch from controlled to uncontrolled (or vice versa). Decide between using a controlled or uncontrolled value for the lifetime of the component.`)}n.current=u},[u,i])}return[p,t.useCallback(t=>{if(u){let n=m(t)?t(e):t;n!==e&&l.current?.(n)}else s(t)},[u,e,s,l])]}function f({defaultProp:e,onChange:n}){let[r,o]=t.useState(e),i=t.useRef(r),a=t.useRef(n);return u(()=>{a.current=n},[n]),t.useEffect(()=>{i.current!==r&&(a.current?.(r),i.current=r)},[r,i]),[r,o,a]}function m(e){return"function"==typeof e}c(d,"useControllableState"),c(f,"useUncontrolledState"),c(m,"isFunction");var p=Symbol("RADIX:SYNC_STATE");c(function(e,r,o,i){let{prop:a,defaultProp:l,onChange:c,caller:u}=r,d=void 0!==a,f=s(c);if(n.f){let e=t.useRef(void 0!==a);t.useEffect(()=>{let t=e.current;if(t!==d){let e=d?"controlled":"uncontrolled";console.warn(`${u} is changing from ${t?"controlled":"uncontrolled"} to ${e}. Components should not switch from controlled to uncontrolled (or vice versa). Decide between using a controlled or uncontrolled value for the lifetime of the component.`)}e.current=d},[d,u])}let m=[{...o,state:l}];i&&m.push(i);let[h,v]=t.useReducer((t,n)=>{if(n.type===p)return{...t,state:n.state};let r=e(t,n);return d&&!Object.is(r.state,t.state)&&f(r.state),r},...m),g=h.state,w=t.useRef(g);t.useEffect(()=>{w.current!==g&&(w.current=g,d||f(g))},[g,w,d]);let b=t.useMemo(()=>void 0!==a?{...h,state:a}:h,[h,a]);return t.useEffect(()=>{d&&!Object.is(a,h.state)&&v({type:p,state:a})},[a,h.state,d]),[b,v]},"useControllableStateReducer"),e.s(["f",0,d],369340)},934620,e=>{var t=e.i(271645),n=globalThis?.document?t.useLayoutEffect:()=>{};e.s(["f",0,n])},635804,e=>{var t=e.i(271645),n=e.i(934620);function r(e){let[r,o]=t.useState(void 0);return(0,n.f)(()=>{if(e){o({width:e.offsetWidth,height:e.offsetHeight});let t=0,n=new ResizeObserver(n=>{if(!Array.isArray(n)||!n.length)return;let r=n[0];window.cancelAnimationFrame(t),t=window.requestAnimationFrame(()=>{let t,n;if("borderBoxSize"in r){let e=r.borderBoxSize,o=Array.isArray(e)?e[0]:e;t=o.inlineSize,n=o.blockSize}else t=e.offsetWidth,n=e.offsetHeight;o({width:t,height:n})})});return n.observe(e,{box:"border-box"}),()=>{window.cancelAnimationFrame(t),n.unobserve(e)}}o(void 0)},[e]),r}(0,Object.defineProperty)(r,"name",{value:"useSize",configurable:!0}),e.s(["f",0,r])},856423,e=>{var t=e.i(456420);let n={name:"book-open",size:24,node:[["path",{d:"M12 5v16",key:"1f6ucr"}],["path",{d:"M20.001 19A2 2 0 0022 17V5a2 2 0 00-1.999-2L16 3.002A5 5 0 0012 5a5 5 0 00-4-2H4a2 2 0 00-2 2v12a2 2 0 001.999 2H8a5 5 0 014 2 5 5 0 014-2z",key:"1fyvmf"}]]};n.node;let r=(0,t.f)(n);e.s(["f",0,r],856423)},689664,e=>{var t=e.i(456420);let n={name:"check",size:24,node:[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]]};n.node;let r=(0,t.f)(n);e.s(["f",0,r],689664)},716327,456539,e=>{var t=e.i(456420);let n={name:"chevron-down",size:24,node:[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]]};n.node;let r=(0,t.f)(n);e.s(["f",0,r],716327);let o={name:"chevron-up",size:24,node:[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]]};o.node;let i=(0,t.f)(o);e.s(["f",0,i],456539)},551757,e=>{var t=e.i(456420);let n={name:"circle-check",size:24,node:[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m16 9-5.5 5.5L8 12",key:"xofnsj"}]],aliases:["check-circle-2"]};n.node;let r=(0,t.f)(n);e.s(["f",0,r],551757)},772382,e=>{var t=e.i(456420);let n={name:"eye",size:24,node:[["path",{d:"M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0",key:"1nclc0"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]]};n.node;let r=(0,t.f)(n);e.s(["f",0,r],772382)},632781,e=>{var t=e.i(456420);let n={name:"loader-circle",size:24,node:[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]],aliases:["loader-2"]};n.node;let r=(0,t.f)(n);e.s(["f",0,r],632781)},395925,e=>{var t=e.i(456420);let n={name:"rotate-ccw",size:24,node:[["path",{d:"M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8",key:"1357e3"}],["path",{d:"M3 3v5h5",key:"1xhq8a"}]]};n.node;let r=(0,t.f)(n);e.s(["f",0,r],395925)},759659,e=>{var t=e.i(456420);let n={name:"trash",size:24,node:[["path",{d:"M10 11v6",key:"nco0om"}],["path",{d:"M14 11v6",key:"outv1u"}],["path",{d:"M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6",key:"miytrc"}],["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2",key:"e791ji"}]],aliases:["trash-2"]};n.node;let r=(0,t.f)(n);e.s(["f",0,r],759659)},853138,e=>{var t=e.i(456420);let n={name:"triangle-alert",size:24,node:[["path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3",key:"wmoenq"}],["path",{d:"M12 9v4",key:"juzpu7"}],["path",{d:"M12 17h.01",key:"p32p05"}]],aliases:["alert-triangle"]};n.node;let r=(0,t.f)(n);e.s(["f",0,r],853138)},28342,676167,e=>{var t=e.i(843476),n=e.i(111110);let r=["一年级","二年级","三年级","四年级","五年级","六年级","初一","初二","初三","高一","高二","高三","大一","大二","大三","大四"],o=r.flatMap(e=>[`${e}上`,`${e}下`]),i={primary:{start:0,end:6},junior_high:{start:6,end:9},senior_high:{start:9,end:12},university:{start:12,end:16}};e.s(["T",0,r,"H",0,o,"c",0,function(e){let t=i[e];return t?r.slice(t.start,t.end):[]},"p",0,function(e){return e.endsWith("上")?{grade:e.slice(0,-1),semester:"上"}:e.endsWith("下")?{grade:e.slice(0,-1),semester:"下"}:null}],676167),e.s(["f",0,function({id:e,value:i,onChange:a,disabled:s}){let{t:l}=(0,n.b)();return(0,t.jsxs)("select",{id:e,value:i,onChange:e=>a(e.target.value),disabled:s,"aria-label":l.editor.gradeSemester,className:"h-10 w-full min-w-0 rounded-md border border-input bg-background px-3 text-sm disabled:opacity-50",children:[(0,t.jsx)("option",{value:"",children:l.common.notSet}),i&&!o.includes(i)&&(0,t.jsx)("option",{value:i,children:i}),r.flatMap((e,n)=>["上","下"].map((r,o)=>(0,t.jsxs)("option",{value:`${e}${r}`,children:[l.gradeSelection.names[n]," · ",0===o?l.gradeSelection.firstSemester:l.gradeSelection.secondSemester]},`${e}${r}`)))]})}],28342)},487486,e=>{var t=e.i(843476),n=e.i(991918),r=e.i(225913),o=e.i(975157);let i=(0,r.f)("inline-flex items-center justify-center rounded-full border px-2 py-0.5 text-xs font-medium w-fit whitespace-nowrap shrink-0 [&>svg]:size-3 gap-1 [&>svg]:pointer-events-none focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive transition-[color,box-shadow] overflow-hidden",{variants:{variant:{default:"border-transparent bg-primary text-primary-foreground [a&]:hover:bg-primary/90",secondary:"border-transparent bg-secondary text-secondary-foreground [a&]:hover:bg-secondary/90",destructive:"border-transparent bg-destructive text-white [a&]:hover:bg-destructive/90 focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40 dark:bg-destructive/60",outline:"text-foreground [a&]:hover:bg-accent [a&]:hover:text-accent-foreground"}},defaultVariants:{variant:"default"}});e.s(["f",0,function({className:e,variant:r,asChild:a=!1,...s}){let l=a?n.M:"span";return(0,t.jsx)(l,{"data-slot":"badge",className:(0,o.f)(i({variant:r}),e),...s})}])},793479,e=>{var t=e.i(843476),n=e.i(975157);e.s(["f",0,function({className:e,type:r,...o}){return(0,t.jsx)("input",{type:r,"data-slot":"input",className:(0,n.f)("file:text-foreground placeholder:text-muted-foreground selection:bg-primary selection:text-primary-foreground dark:bg-input/30 border-input h-9 w-full min-w-0 rounded-md border bg-transparent px-3 py-1 text-base shadow-xs transition-[color,box-shadow] outline-none file:inline-flex file:h-7 file:border-0 file:bg-transparent file:text-sm file:font-medium disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50 md:text-sm","focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px]","aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive",e),...o})}])},624687,e=>{var t=e.i(843476),n=e.i(975157);e.s(["f",0,function({className:e,...r}){return(0,t.jsx)("textarea",{"data-slot":"textarea",className:(0,n.f)("border-input placeholder:text-muted-foreground focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive dark:bg-input/30 flex field-sizing-content min-h-16 w-full rounded-md border bg-transparent px-3 py-2 text-base shadow-xs transition-[color,box-shadow] outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50 md:text-sm",e),...r})}])},215519,e=>{var t=e.i(843476),n=e.i(271645),r=e.i(306831);let o=(0,n.createContext)({timeZone:r.J,setTimeZone:()=>void 0});e.s(["n",0,function({children:e,initialTimeZone:i=r.J}){let[a,s]=(0,n.useState)(i);return(0,t.jsx)(o.Provider,{value:{timeZone:a,setTimeZone:s},children:e})},"M",0,function(){return(0,n.useContext)(o)}])},707212,e=>{e.s(["f",0,{zh:"今天的 AI 使用次数已达上限,请明天再试,或请管理员调整额度。",en:"You have used up today's AI allowance. Try again tomorrow or ask an administrator to raise the limit."}])},41931,294114,128093,923512,e=>{let t={success:2500,info:3500,warning:4500,error:5e3},n={toasts:[],confirm:null},r=1,o=new Set;function i(e){n=e,o.forEach(e=>e(n))}function a(e){i({...n,toasts:n.toasts.filter(t=>t.id!==e)})}function s(e,o){let s="string"==typeof o?o:String(o??"");if(!s)return;let l=r++;i({...n,toasts:[...n.toasts.slice(-3),{id:l,type:e,message:s}]}),setTimeout(()=>a(l),t[e])}let l={success:e=>s("success",e),error:e=>s("error",e),info:e=>s("info",e),warning:e=>s("warning",e)};e.s(["u",0,function(e,t={}){return 0===o.size?Promise.resolve("function"==typeof window.confirm&&window.confirm(e)):(n.confirm?.resolve(!1),new Promise(o=>{let a=r++;i({...n,confirm:{...t,id:a,message:e,resolve:e=>{n.confirm?.id===a&&i({...n,confirm:null}),o(e)}}})}))},"p",0,a,"M",0,function(e){return o.add(e),e(n),()=>{o.delete(e)}},"c",0,l],294114);var c=e.i(707212);let u={minimax:{name:"MiniMax",nameEn:"MiniMax",baseUrl:"https://api.minimax.cn/v1",model:"MiniMax-M3.1-Flash",envPrefix:"MINIMAX",consoleUrl:"https://platform.minimax.cn",docs:{cn:"https://platform.minimax.cn/docs/api-reference/api-overview",intl:"https://platform.minimax.io/docs/api-reference/api-overview",apiKey:"https://platform.minimax.cn/docs/guides/quickstart-preparation",models:"https://platform.minimax.cn/docs/guides/models-intro"}},glm:{name:"智谱 GLM",nameEn:"Zhipu GLM",baseUrl:"https://open.bigmodel.cn/api/paas/v4",model:"glm-5.3-flash",envPrefix:"GLM",consoleUrl:"https://open.bigmodel.cn",docs:{cn:"https://docs.bigmodel.cn/cn/guide/start/quick-start",intl:"https://docs.z.ai/guides/overview/quick-start",apiKey:"https://docs.bigmodel.cn/cn/guide/start/quick-start",models:"https://docs.bigmodel.cn/cn/guide/start/model-overview"}},deepseek:{name:"DeepSeek",nameEn:"DeepSeek",baseUrl:"https://api.deepseek.com",model:"deepseek-v4-flash",envPrefix:"DEEPSEEK",consoleUrl:"https://platform.deepseek.com",docs:{cn:"https://api-docs.deepseek.com/zh-cn/",apiKey:"https://api-docs.deepseek.com/zh-cn/",models:"https://api-docs.deepseek.com/zh-cn/quick_start/pricing"}},kimi:{name:"Kimi",nameEn:"Kimi",baseUrl:"https://api.moonshot.cn/v1",model:"kimi-k3.1-pro",envPrefix:"KIMI",consoleUrl:"https://platform.kimi.com",docs:{cn:"https://platform.moonshot.cn/docs/introduction",intl:"https://platform.moonshot.ai/docs/introduction",apiKey:"https://platform.moonshot.cn/docs/introduction",models:"https://platform.moonshot.cn/docs/pricing/chat"}},qwen:{name:"千问 Qwen",nameEn:"Qwen",baseUrl:"https://token-plan.cn-beijing.maas.aliyuncs.com/compatible-mode/v1",model:"qwen3.8-max",envPrefix:"QWEN",consoleUrl:"https://bailian.console.aliyun.com",docs:{cn:"https://help.aliyun.com/zh/model-studio/token-plan-personal-quick-start",intl:"https://www.alibabacloud.com/help/en/model-studio/token-plan-personal-quick-start",apiKey:"https://help.aliyun.com/zh/model-studio/token-plan-personal-quick-start",models:"https://help.aliyun.com/zh/model-studio/models"}},stepfun:{name:"阶跃星辰 StepFun",nameEn:"StepFun",baseUrl:"https://api.stepfun.com/step_plan/v1",model:"step-5-preview",envPrefix:"STEPFUN",consoleUrl:"https://platform.stepfun.com",docs:{cn:"https://platform.stepfun.com/docs/zh/guides/developer/openai",intl:"https://platform.stepfun.ai/docs/en/guides/developer/openai",apiKey:"https://platform.stepfun.com/docs/zh/guides/developer/openai",models:"https://platform.stepfun.com/docs/zh/guides/models/list"}},volcengine:{name:"火山引擎 豆包",nameEn:"Volcengine Doubao",baseUrl:"https://ark.cn-beijing.volces.com/api/v3",model:"doubao-seed-evolving",envPrefix:"VOLCENGINE",consoleUrl:"https://console.volcengine.com/ark",docs:{cn:"https://www.volcengine.com/docs/82379/1330626",intl:"https://docs.byteplus.com/en/docs/ModelArk/1330626",apiKey:"https://www.volcengine.com/docs/82379/1541594",models:"https://www.volcengine.com/docs/82379/1330310"}},"volcengine-agent":{name:"火山引擎 Agent Plan",nameEn:"Volcengine Agent Plan",baseUrl:"https://ark.cn-beijing.volces.com/api/plan/v3",model:"doubao-seed-evolving",envPrefix:"VOLCENGINE_AGENT",consoleUrl:"https://console.volcengine.com/ark",docs:{cn:"https://ark.volcengine.com/region:cn-beijing/docs/82379/2160841?lang=zh",apiKey:"https://ark.volcengine.com/region:cn-beijing/docs/82379/2160841?lang=zh",models:"https://www.volcengine.com/docs/82379/2366394"}},"volcengine-coding":{name:"火山引擎 Coding Plan",nameEn:"Volcengine Coding Plan",baseUrl:"https://ark.cn-beijing.volces.com/api/coding/v3",model:"doubao-seed-evolving",envPrefix:"VOLCENGINE_CODING",consoleUrl:"https://console.volcengine.com/ark",docs:{cn:"https://www.volcengine.com/docs/82379/1928261",apiKey:"https://www.volcengine.com/docs/82379/1928261",models:"https://www.volcengine.com/docs/82379/1928261"}},"volcengine-free":{name:"火山引擎(免费试用)",nameEn:"Volcengine (free trial)",baseUrl:"https://ark.cn-beijing.volces.com/api/v3",model:"doubao-seed-evolving",envPrefix:"VOLCENGINE_FREE",consoleUrl:"https://console.volcengine.com/ark",docs:{cn:"https://www.volcengine.com/docs/82379/1399514",apiKey:"https://www.volcengine.com/docs/82379/1541594",models:"https://www.volcengine.com/docs/82379/1330310"}}},d=Object.keys(u);e.s(["$",0,u,"U",0,d,"z",0,function(e,t){let n=u[e];return"zh"===t?n.name:n.nameEn},"j",0,function(e){return"string"==typeof e&&Object.prototype.hasOwnProperty.call(u,e)},"k",0,function(e,t){let n=u[e];return{apiKey:t?.apiKey||"",baseUrl:t?.baseUrl||n.baseUrl,model:t?.model||n.model}}],128093);let f=new Set;function m(e){f.forEach(t=>t(e))}function p(e){return"object"==typeof e&&null!==e&&"code"in e&&"AI_CONSENT_REQUIRED"===e.code}let h={gemini:{zh:"Google Gemini",en:"Google Gemini"},openai:{zh:"OpenAI 或管理员填写的兼容接口",en:"OpenAI or an OpenAI-compatible endpoint set by the administrator"},azure:{zh:"Microsoft Azure OpenAI",en:"Microsoft Azure OpenAI"},anthropic:{zh:"Anthropic Claude",en:"Anthropic Claude"},"minimax-code":{zh:"MiniMax",en:"MiniMax"}};e.s(["K",0,function(e,t){if(!e)return null;let n=h[e];if(n)return n[t];if(!(e in u))return null;let r=u[e];return"en"===t?r.nameEn:r.name},"O",0,p,"L",0,function(e){return"en"===e?"https://wrong-notebook.margrop.net/en/privacy/":"https://wrong-notebook.margrop.net/privacy/"},"u",0,m,"y",0,function(e){return f.add(e),()=>{f.delete(e)}}],923512);class v extends Error{status;statusText;data;constructor(e,t,n){super(`API Error: ${e} ${t}`),this.status=e,this.statusText=t,this.data=n,this.name="ApiError"}}function g(e){if("object"!=typeof e||null===e||!("code"in e)||"AI_DAILY_LIMIT_EXCEEDED"!==e.code)return;let t="zh";try{"en"===localStorage.getItem("app-language")&&(t="en")}catch{}l.warning(c.f[t])}function w(){let e=new Uint8Array(16);return crypto.getRandomValues(e),Array.from(e,e=>e.toString(16).padStart(2,"0")).join("")}let b=e=>new Promise(t=>setTimeout(t,e));async function y(e,t,n){let r=Date.now();for(;Date.now()<t;){let t=null;try{t=await E(`/api/requests/${e}`,{method:"GET",timeout:15e3})}catch(e){if(e instanceof v&&404===e.status&&Date.now()-r>6e3)throw n}if(t?.state==="done"){if(t.status>=200&&t.status<300)return t.body??{};throw 429===t.status&&g(t.body),403===t.status&&p(t.body)&&m("blocked"),new v(t.status,"",t.body)}await b(3e3)}throw new v(408,"Request Timeout",{message:"AI_TIMEOUT_ERROR"})}async function E(e,t={}){let{params:n,headers:r,timeout:o=6e4,recoverable:i,requestId:a,...s}=t,l=i?a??w():null,c=Date.now(),u=e;if(n){let e=new URLSearchParams(n);u+=`?${e.toString()}`}let d=new AbortController,f=setTimeout(()=>d.abort(),o);try{let e=await fetch(u,{headers:{"Content-Type":"application/json",...l?{"X-Request-Id":l}:{},...r},signal:d.signal,...s});if(clearTimeout(f),!e.ok){let t,n=await e.text();try{t=JSON.parse(n)}catch{t=n}throw 429===e.status&&g(t),403===e.status&&p(t)&&m("blocked"),new v(e.status,e.statusText,t)}if(204===e.status)return{};try{return await e.json()}catch{return{}}}catch(e){if(clearTimeout(f),e instanceof Error&&"AbortError"===e.name)throw new v(408,"Request Timeout",{message:"AI_TIMEOUT_ERROR"});if(l&&e instanceof TypeError)return y(l,c+o,e);throw e}}e.s(["a",0,v,"k",0,{get:(e,t)=>E(e,{...t,method:"GET"}),post:(e,t,n)=>E(e,{...n,method:"POST",body:JSON.stringify(t)}),put:(e,t,n)=>E(e,{...n,method:"PUT",body:JSON.stringify(t)}),patch:(e,t,n)=>E(e,{...n,method:"PATCH",body:JSON.stringify(t)}),delete:(e,t)=>E(e,{...t,method:"DELETE"})},"j",0,w,"u",0,y],41931)},303163,e=>{e.s(["L",0,function(e){if("object"!=typeof e||null===e||!("data"in e))return;let{data:t}=e;if("object"==typeof t&&null!==t&&"details"in t)return"string"==typeof t.details&&t.details?t.details:void 0},"d",0,function(e){if("object"!=typeof e||null===e||!("data"in e))return;let{data:t}=e;if("object"==typeof t&&null!==t&&"message"in t)return"string"==typeof t.message?t.message:void 0},"Z",0,function(e){return e instanceof Error?e.message:String(e)}])},113381,e=>{var t=e.i(303163);let n=["Line","Segment","Ray","Point","Circle","Ellipse","Hyperbola","Parabola","Polygon","Intersect","Midpoint","PerpendicularLine","Angle","Text","Slider","Locus","Reflect","Translate","Rotate","Vector","UnitVector","OrthogonalVector","Distance","Length","Area","Tangent","Arc","CircularArc","Semicircle","Sequence","Element","If","Sum","Integral","Derivative","Root","Extremum","sin","cos","tan","asin","acos","atan","sqrt","abs","exp","ln","log","floor","ceil","round","min","max"],r=["setCoordSystem","setAxesVisible","setGridVisible","setColor","setLineThickness","setLineStyle","setPointSize","setPointStyle","setLabelVisible","setCaption","setVisible","setFilling","setValue","setFixed","setBackgroundColor"],o=new Map(r.map(e=>[e.toLowerCase(),e])),i=new Set(n.map(e=>e.toLowerCase())),a=/(?:java|vb)script\s*:|[\u0000-\u0008\u000b\u000c\u000e-\u001f]/i;function s(e){if(a.test(e)||/<\s*\/?\s*(?:script|iframe|img|svg|object|embed|html)\b/i.test(e))return!0;for(let t of e.matchAll(/"(?:\\.|[^"\\])*"|'(?:\\.|[^'\\])*'/g))try{let e=c(t[0]);if("string"==typeof e&&(/<\s*\/?\s*[a-z!][^>]*>/i.test(e)||a.test(e)))return!0;if(t[0].startsWith('"'))try{let e=JSON.parse(t[0]);if("string"==typeof e&&(/<\s*\/?\s*[a-z!][^>]*>/i.test(e)||/(?:java|vb)script\s*:/i.test(e)))return!0}catch{}}catch{return!0}return!1}function l(e){if(!e.trim())return[];let t=[],n="",r=!1,o=0,i=0;for(let a=0;a<e.length;a++){let s=e[a];if(n)r?r=!1:"\\"===s?r=!0:s===n&&(n="");else if('"'===s||"'"===s)n=s;else if("["===s)o++;else if("]"===s){if(--o<0)throw Error("参数括号不匹配")}else","===s&&0===o&&(t.push(e.slice(i,a).trim()),i=a+1)}if(n||o||r)throw Error("参数未闭合");return t.push(e.slice(i).trim()),t}function c(e){if(/^[+-]?(?:\d+\.?\d*|\.\d+)(?:e[+-]?\d+)?$/i.test(e)){let t=Number(e);if(Number.isFinite(t))return t}if("true"===e||"false"===e)return"true"===e;if(e.startsWith("[")&&e.endsWith("]"))return l(e.slice(1,-1)).map(c);let t=e[0];if(('"'===t||"'"===t)&&e.endsWith(t)){let n=e.slice(1,-1),r="";for(let e=0;e<n.length;e++){if(n[e]===t)throw Error("字符串包含未转义引号");if("\\"!==n[e])r+=n[e];else{let o=n[++e];if(void 0===o)throw Error("字符串转义未闭合");r+="\\"===o||o===t?o:"\\"+o}}return r}if(/^[\p{L}_][\p{L}\p{N}_]*$/u.test(e))return e;throw Error("API 参数必须是字面值")}e.s(["r",0,r,"I",0,n,"i",0,function(e){if(!e?.trim())return[];let t=e.trim();if(t.startsWith("["))try{let e=JSON.parse(t);if(Array.isArray(e))return e.filter(e=>"string"==typeof e&&!!e.trim())}catch{}return t.split("\n").map(e=>e.trim()).filter(e=>e&&!e.startsWith("//"))},"L",0,function(e,n){let r=[],a=new Set;for(let u of n)try{if(s(u))throw Error("命令包含不允许的脚本或标记");if(function(e){let t=e.trim().match(/^(\w+)\s*\(/)?.[1].toLowerCase();return!!t&&o.has(t)}(u)){let t=function(e){let t=e.trim().match(/^(\w+)\s*\(([\s\S]*)\)$/);if(!t)return null;let n=o.get(t[1].toLowerCase());if(!n)return null;try{let e=l(t[2]).map(c);return{m:n,a:e}}catch{return null}}(u),n=t?e[t.m]:void 0;if(!t||"function"!=typeof n)throw Error("API 方法或参数无效");n.apply(e,t.a)}else{if(!function(e,t=new Set){if(!e.trim()||s(e)||/[;`\r\n]/.test(e))return!1;let n=e.replace(/"(?:\\.|[^"\\])*"|'(?:\\.|[^'\\])*'/g,"");if(/["']/.test(n)||/(?:https?:|\b(?:ggbApplet|window|document)\b)/i.test(n)||/\b(?:Execute|RunClickScript|RunUpdateScript|JavaScript|eval|Function|Open|PlaySound|ReadText)\b/i.test(n))return!1;let r=n.match(/^\s*([\p{L}_][\p{L}\p{N}_]*)\s*\([^)]*\)\s*=/u)?.[1];for(let e of n.matchAll(/([\p{L}_][\p{L}\p{N}_]*)\s*[(\[]/gu)){let n=e[1];if(!i.has(n.toLowerCase())&&n!==r&&!t.has(n))return!1}return!0}(u,a))throw Error("指令不在允许范围内");if(!e.evalCommand(u.trim()))throw Error("GeoGebra 未能执行该命令");let t=u.match(/^\s*([\p{L}_][\p{L}\p{N}_]*)\s*\([^)]*\)\s*=/u)?.[1];t&&a.add(t)}}catch(e){r.push({command:u,message:(0,t.Z)(e)})}return r}])},901219,e=>{var t=e.i(271645),n=e.i(127175);e.s(["a",0,function(e,r){var o;let[i,a]=(0,t.useState)(null),[s,l]=(0,t.useState)(!1),c=(0,t.useRef)(e),u=(0,t.useRef)(r);(0,t.useEffect)(()=>{c.current=e,u.current=r},[e,r]);let d=(0,t.useCallback)(async()=>{let e=c.current;if(e&&("u"<typeof document||"hidden"!==document.visibilityState))try{let t=await (0,n.h)(e);c.current===e&&(a(t),l(!1),u.current?.(t))}catch(t){t?.status===404&&c.current===e&&l(!0)}},[]);(0,t.useEffect)(()=>{if(!e)return;let t=setTimeout(d,0),r=(0,n.E)(d);return()=>{clearTimeout(t),r()}},[e,d]);let f="analyzing"===(o=i?.status)||"saving"===o;return(0,t.useEffect)(()=>{if(!e||!f)return;let t=setInterval(d,2500);return()=>clearInterval(t)},[e,f,d]),{task:i&&i.id===e?i:null,notFound:s,refresh:d,setTask:a}},"b",0,function(e=!0){let[r,o]=(0,t.useState)(null),[i,a]=(0,t.useState)(!1),s=(0,t.useCallback)(async()=>{if("u"<typeof document||"hidden"!==document.visibilityState)try{o(await (0,n.B)()),a(!1)}catch{a(!0)}},[]);(0,t.useEffect)(()=>{if(!e)return;let t=setTimeout(s,0),r=(0,n.E)(s);return window.addEventListener(n.y,s),()=>{clearTimeout(t),r(),window.removeEventListener(n.y,s)}},[e,s]);let l=(r?.activeCount??0)>0;return(0,t.useEffect)(()=>{if(!e)return;let t=setInterval(s,l?2500:3e4);return()=>clearInterval(t)},[e,l,s]),{data:r,error:i,refresh:s}}])},470279,e=>{var t=e.i(271645),n=e.i(41931),r=e.i(201276);let o=null,i=0,a=new Set;e.s(["f",0,function(){let[e,s]=(0,t.useState)(o??[]),[l,c]=(0,t.useState)(!o),[u,d]=(0,t.useState)(null),f=(0,t.useCallback)(async(e=!1)=>{let t=Date.now();if(!e&&o&&t-i<3e4){s(o),c(!1);return}try{c(!0);let e=await n.k.get("/api/paper-groups");o=e,i=t,a.forEach(t=>t(e)),d(null)}catch(e){r.V.error("[usePaperGroups]","Failed to fetch paper groups",{error:e}),d("Failed to load paper groups")}finally{c(!1)}},[]);return(0,t.useEffect)(()=>(a.add(s),f(),()=>{a.delete(s)}),[f]),{groups:e,loading:l,error:u,refetch:(0,t.useCallback)(()=>(o=null,i=0,f(!0)),[f])}}])},127175,e=>{var t=e.i(41931);let n="wrong-notebook:import-tasks-changed";function r(){window.dispatchEvent(new Event(n))}function o(){let e=new Uint8Array(16);return crypto.getRandomValues(e),Array.from(e,e=>e.toString(16).padStart(2,"0")).join("")}async function i(e,n=o()){let a;for(let o=0;o<3;o++)try{let{task:o}=await t.k.post("/api/import-tasks",{...e,clientRequestId:n,subjectId:e.subjectId||void 0,targetSubjectId:e.targetSubjectId||void 0,paperLevel:e.paperLevel||void 0},{timeout:12e4});return r(),o}catch(e){if(a=e,!function(e){let t=e?.status;return void 0===t||408===t||502===t||503===t||504===t}(e)||2===o)break;await new Promise(e=>setTimeout(e,1e3*(o+1)))}throw a}async function a(e,n={}){let r=n.image?"?include=image":"",{task:o}=await t.k.get(`/api/import-tasks/${encodeURIComponent(e)}${r}`);return o}async function s(e,n){let o=await t.k.post(`/api/import-tasks/${encodeURIComponent(e)}/confirm`,n);return r(),o}async function l(e){let{task:n}=await t.k.post(`/api/import-tasks/${encodeURIComponent(e)}/retry`,{});return r(),n}async function c(e){await t.k.post(`/api/import-tasks/${encodeURIComponent(e)}/read`,{}),r()}async function u(e){await t.k.delete(`/api/import-tasks/${encodeURIComponent(e)}`),r()}e.s(["y",0,n,"I",0,s,"S",0,i,"x",0,u,"h",0,a,"B",0,function(){return t.k.get("/api/import-tasks")},"N",0,c,"c",0,o,"P",0,r,"E",0,function(e){let t=()=>{"visible"===document.visibilityState&&e()},n=t=>{t.persisted&&e()};return document.addEventListener("visibilitychange",t),window.addEventListener("focus",e),window.addEventListener("pageshow",n),window.addEventListener("online",e),()=>{document.removeEventListener("visibilitychange",t),window.removeEventListener("focus",e),window.removeEventListener("pageshow",n),window.removeEventListener("online",e)}},"R",0,l])}])})();
@@ -0,0 +1 @@
1
+ (()=>{"use strict";(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,367784,e=>{var i=e.i(456420);let s={name:"log-out",size:24,node:[["path",{d:"m16 17 5-5-5-5",key:"1bji2h"}],["path",{d:"M21 12H9",key:"dn1m92"}],["path",{d:"M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4",key:"1uf3rs"}]]};s.node;let a=(0,i.f)(s);e.s(["f",0,a],367784)},713452,753817,e=>{var i=e.i(843476),s=e.i(271645),a=e.i(551757),t=e.i(632781),n=e.i(583967),r=e.i(456420);let l={name:"zap",size:24,node:[["path",{d:"M15.914 4a1.5 1.5 0 00-2.474-1.561l-9 9A1.5 1.5 0 005.5 14h4.002a.5.5 0 01.471.666L8.086 20a1.5 1.5 0 002.475 1.56l9-9A1.5 1.5 0 0018.5 10h-3.997a.5.5 0 01-.472-.667z",key:"1v7up4"}]]};l.node;let o=(0,r.f)(l);var d=e.i(519455),c=e.i(111110);function m({detail:e}){let{t:s}=(0,c.b)();return e?(0,i.jsxs)("p",{className:"mt-1 rounded bg-background/60 px-2 py-1 font-mono text-[11px] leading-relaxed text-red-700 dark:text-red-300 break-all select-text",children:[(0,i.jsx)("span",{className:"font-sans text-muted-foreground",children:s.settings.ai.providerErrorDetail}),e]}):null}e.s(["f",0,m],753817);var x=e.i(128093),p=e.i(41931),u=e.i(303163),h=e.i(201276);e.s(["f",0,function({config:e,saving:r,saveButton:l}){let{t:f,language:g}=(0,c.b)(),[j,v]=(0,s.useState)(!1),[y,N]=(0,s.useState)(null),b=e=>f.settings?.ai?.errors?.[e]||e.replace("UNKNOWN:",""),k=async()=>{let i=function(e,i){let s=e.aiProvider;if("openai"===s){let a=e.openai?.instances?.find(i=>i.id===e.openai?.activeInstanceId);return a?.apiKey?{ok:!0,body:{provider:s,apiKey:a.apiKey,baseUrl:a.baseUrl,model:a.model,language:i}}:{ok:!1,error:"API_KEY_REQUIRED"}}if("azure"===s){let a=e.azure;return a?.apiKey&&a.endpoint&&a.deploymentName?{ok:!0,body:{provider:s,apiKey:a.apiKey,endpoint:a.endpoint,deploymentName:a.deploymentName,apiVersion:a.apiVersion,model:a.model,language:i}}:{ok:!1,error:"AZURE_CONFIG_INCOMPLETE"}}if("minimax-code"===s)return{ok:!0,body:{provider:s,model:e.minimaxCode?.model,language:i}};if("gemini"===s||"anthropic"===s||(0,x.j)(s)){let a=e[s];return a?.apiKey?{ok:!0,body:{provider:s,apiKey:a.apiKey,baseUrl:a.baseUrl,model:a.model,language:i}}:{ok:!1,error:"API_KEY_REQUIRED"}}return{ok:!1,error:"UNSUPPORTED_PROVIDER"}}(e,g);if(!i.ok){if("UNSUPPORTED_PROVIDER"===i.error)return;N({success:!1,textSupport:!1,visionSupport:!1,textError:"AZURE_CONFIG_INCOMPLETE"===i.error?f.settings?.ai?.validationAzureEndpointRequired||"Azure config is incomplete":f.settings?.ai?.validationApiKeyRequired||"API Key is required"});return}v(!0),N(null);try{N(await p.k.post("/api/ai/test",i.body))}catch(e){h.V.error("[AiConnectionTest]","AI connection test failed",{error:e}),N({success:!1,textSupport:!1,visionSupport:!1,textError:(0,u.Z)(e)})}finally{v(!1)}};return(0,i.jsxs)("div",{className:"space-y-3 pt-3 border-t",children:[(0,i.jsxs)("div",{className:"flex gap-2",children:[(0,i.jsxs)(d.f,{type:"button",variant:"outline",onClick:k,disabled:j||r,className:"flex-1",children:[j?(0,i.jsx)(t.f,{className:"mr-2 h-4 w-4 animate-spin"}):(0,i.jsx)(o,{className:"mr-2 h-4 w-4"}),j?f.settings?.ai?.testing||"Testing...":f.settings?.ai?.testConnection||"Test Connection"]}),l]}),y&&(0,i.jsxs)("div",{className:`p-3 rounded-md text-sm ${y.success?"bg-green-50 dark:bg-green-950/40 border border-green-200 dark:border-green-900":"bg-red-50 dark:bg-red-950/40 border border-red-200 dark:border-red-900"}`,children:[(0,i.jsx)("div",{className:"flex items-center gap-2 font-medium mb-2",children:y.success?(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(a.f,{className:"h-4 w-4 text-green-600"}),(0,i.jsx)("span",{className:"text-green-700 dark:text-green-300",children:f.settings?.ai?.testSuccess||"Connection Successful"}),y.modelInfo&&(0,i.jsxs)("span",{className:"text-green-600 text-xs",children:["(",y.modelInfo,")"]})]}):(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(n.f,{className:"h-4 w-4 text-red-600"}),(0,i.jsx)("span",{className:"text-red-700 dark:text-red-300",children:f.settings?.ai?.testFailed||"Connection Failed"})]})}),y.success&&(0,i.jsxs)("div",{className:"space-y-1 text-xs",children:[(0,i.jsxs)("div",{className:"flex items-center gap-2",children:[(0,i.jsxs)("span",{className:"text-muted-foreground",children:[f.settings?.ai?.textSupport||"Text Generation",":"]}),(0,i.jsxs)("span",{className:"text-green-600",children:["✓ ",f.settings?.ai?.supported||"Supported"]})]}),(0,i.jsxs)("div",{className:"flex items-center gap-2",children:[(0,i.jsxs)("span",{className:"text-muted-foreground",children:[f.settings?.ai?.visionSupport||"Vision/Multimodal",":"]}),y.visionSupport?(0,i.jsxs)("span",{className:"text-green-600",children:["✓ ",f.settings?.ai?.supported||"Supported"]}):(0,i.jsxs)("span",{className:"text-amber-600",children:["✗ ",y.visionError?b(y.visionError):f.settings?.ai?.notSupported||"Not Supported"]})]}),!y.visionSupport&&(0,i.jsx)(m,{detail:y.visionErrorDetail}),(0,i.jsx)("p",{className:"text-muted-foreground/60 text-[10px] pl-1",children:f.settings?.ai?.testNetworkNote})]}),!y.success&&y.textError&&(0,i.jsx)("p",{className:"text-red-600 text-xs mt-1",children:b(y.textError)}),!y.success&&(0,i.jsx)(m,{detail:y.textErrorDetail})]})]})}],713452)},10038,835467,e=>{var i=e.i(843476),s=e.i(632781),a=e.i(519455),t=e.i(110204),n=e.i(967489),r=e.i(713452),l=e.i(459649),o=e.i(118585),d=e.i(75977),c=e.i(482022),m=e.i(97923),x=e.i(367784),p=e.i(741120),u=e.i(487486),h=e.i(793479),f=e.i(975153),g=e.i(699375),j=e.i(111110),v=e.i(215519),y=e.i(306831);function N({checkin:e,autoCheckin:n,onAutoCheckinChange:r,busy:l,onCheckin:o}){let d,{t:c}=(0,j.b)(),{timeZone:m}=(0,v.M)(),x=c.settings?.ai?.minimaxCode,{today:p,last:h}=e,b=h&&"failed"!==h.status?h:null,k=!!(p?.checkedToday||b),C=String(b?.points??(p?p.points+p.bonusPoints:0)),w=String(b?.streakDays??p?.streakDays??0);return d=b?.trigger==="auto"&&"checked-in"===b.status?(x?.checkinAuto||"Checked in automatically today at {time} (+{points} credits, day {days} in a row)").replace("{time}",(0,y.r)(b.at,"HH:mm",m)).replace("{points}",C).replace("{days}",w):k?(x?.checkinDone||"Checked in today (+{points} credits, day {days} in a row)").replace("{points}",C).replace("{days}",w):h?.status==="failed"?(x?.checkinFailed||"Check-in failed: {error}").replace("{error}",h.error||""):e.autoCheckin?x?.checkinWillAuto||"Not checked in yet today. The app will check in automatically within the hour.":x?.checkinNotYet||"Not checked in yet today",(0,i.jsxs)("div",{className:"space-y-3 border-t pt-3",children:[(0,i.jsxs)("div",{className:"flex flex-wrap items-center justify-between gap-2 text-sm",children:[(0,i.jsxs)("div",{className:"flex min-w-0 items-center gap-2",children:[(0,i.jsx)("span",{className:"text-muted-foreground",children:x?.checkinToday||"Today's check-in"}),(0,i.jsxs)(u.f,{variant:k?"default":h?.status==="failed"?"destructive":"secondary",children:[(0,i.jsx)(f.f,{className:"mr-1 h-3 w-3"}),k?x?.checkinSuccess||"Checked in":x?.checkinNotYet||"Not yet"]})]}),!k&&(0,i.jsxs)(a.f,{size:"sm",variant:"outline",onClick:o,disabled:l,children:[l&&(0,i.jsx)(s.f,{className:"mr-2 h-4 w-4 animate-spin"}),x?.checkinNow||"Check in now"]})]}),(0,i.jsx)("p",{className:"text-xs text-muted-foreground break-words",children:d}),(0,i.jsxs)("div",{className:"flex items-start justify-between gap-3",children:[(0,i.jsxs)("div",{className:"space-y-1",children:[(0,i.jsx)(t.f,{htmlFor:"minimax-code-auto-checkin",children:x?.autoCheckin||"Daily auto check-in"}),(0,i.jsx)("p",{className:"text-xs text-muted-foreground",children:x?.autoCheckinHint})]}),(0,i.jsx)(g.f,{id:"minimax-code-auto-checkin",checked:n,onCheckedChange:r})]})]})}let b=["MiniMax-M3.1-Flash","MiniMax-M3","MiniMax-M2.7-highspeed","MiniMax-M2.7"];var k=e.i(271645),C=e.i(41931),w=e.i(303163),K=e.i(294114),S=e.i(201276);function M({value:e,onChange:n}){let{t:r}=(0,j.b)(),l=r.settings?.ai?.minimaxCode,{status:o,loading:d,pending:f,busy:g,refresh:v,login:y,logout:U,checkin:I}=function(){let{t:e}=(0,j.b)(),i=e.settings?.ai?.minimaxCode,[s,a]=(0,k.useState)(null),[t,n]=(0,k.useState)(!0),[r,l]=(0,k.useState)(null),[o,d]=(0,k.useState)(!1),c=(0,k.useRef)(null),m=(0,k.useCallback)(async()=>{n(!0);try{let e=await C.k.get("/api/minimax-code");a(e),e.pendingLogin&&l(e.pendingLogin)}catch(e){S.V.error("[MiniMaxCode]","Failed to load status",{error:e})}finally{n(!1)}},[]);(0,k.useEffect)(()=>{m()},[m]),(0,k.useEffect)(()=>{if(!r)return;let e=!1,s=async()=>{try{let a=await C.k.get("/api/minimax-code/login");if(e)return;if("pending"===a.status){c.current=setTimeout(s,r.intervalMs);return}l(null),"ok"===a.status?K.c.success(i?.loginSuccess||"Signed in"):"expired"===a.status?K.c.error(i?.loginExpired||"Authorization timed out"):"denied"===a.status&&K.c.error(i?.loginDenied||"Authorization declined"),m()}catch(s){if(e)return;l(null),K.c.error(`${i?.loginFailed||"Sign-in failed"}: ${(0,w.Z)(s)}`)}};return c.current=setTimeout(s,r.intervalMs),()=>{e=!0,c.current&&clearTimeout(c.current)}},[r,m,i]);let x=async()=>{d(!0);try{await C.k.delete("/api/minimax-code"),l(null),await m()}catch(e){K.c.error((0,w.Z)(e))}finally{d(!1)}},p=async()=>{d(!0);try{let e=await C.k.post("/api/minimax-code/checkin",{});"failed"===e.status?K.c.error((i?.checkinFailed||"Check-in failed: {error}").replace("{error}",e.error||"")):K.c.success(i?.checkinSuccess||"Checked in"),await m()}catch(e){K.c.error((0,w.Z)(e))}finally{d(!1)}};return{status:s,loading:t,pending:r,busy:o,refresh:m,login:async()=>{d(!0);try{let e=await C.k.post("/api/minimax-code/login",{});l(e),window.open(e.url,"_blank","noopener,noreferrer")}catch(e){K.c.error(`${i?.loginFailed||"Sign-in failed"}: ${(0,w.Z)(e)}`)}finally{d(!1)}},logout:x,checkin:p}}(),A=o?.login??"none",P=o?.account,z=o?.credits,E={none:l?.statusNone||"Not signed in",active:l?.statusActive||"Signed in",expired:l?.statusExpired||"Login expired"}[A];return(0,i.jsxs)("div",{className:"space-y-3 animate-in fade-in slide-in-from-top-2",children:[(0,i.jsx)("p",{className:"text-xs text-muted-foreground",children:l?.intro}),(0,i.jsxs)("section",{className:"space-y-3 rounded-md border bg-background p-3","aria-label":l?.title||"MiniMax Code account",children:[(0,i.jsxs)("div",{className:"flex items-center justify-between gap-2",children:[(0,i.jsx)("h4",{className:"text-sm font-medium",children:l?.title||"MiniMax Code account"}),(0,i.jsx)(a.f,{variant:"ghost",size:"sm",onClick:()=>void v(),disabled:d,"aria-label":l?.refresh||"Refresh",children:(0,i.jsx)(p.f,{className:`h-4 w-4 ${d?"animate-spin":""}`})})]}),(0,i.jsxs)("dl",{className:"grid grid-cols-[auto_1fr] gap-x-4 gap-y-2 text-sm",children:[(0,i.jsx)("dt",{className:"text-muted-foreground",children:l?.loginStatus||"Login status"}),(0,i.jsxs)("dd",{className:"flex min-w-0 flex-wrap items-center gap-2",children:[(0,i.jsx)(u.f,{variant:"active"===A?"default":"expired"===A?"destructive":"secondary",children:E}),P&&(0,i.jsx)("span",{className:"truncate text-muted-foreground",children:P.name||P.email||P.userId})]}),"active"===A&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)("dt",{className:"text-muted-foreground",children:l?.credits||"Remaining credits"}),(0,i.jsx)("dd",{children:z?(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)("span",{className:"font-medium tabular-nums",children:z.total}),(0,i.jsx)("span",{className:"ml-2 text-xs text-muted-foreground",children:(l?.creditsDetail||"Free {free} · Purchased {purchased}").replace("{free}",String(z.free)).replace("{purchased}",String(z.purchased))})]}):(0,i.jsx)("span",{className:"text-muted-foreground",children:l?.creditsUnavailable||"Unavailable"})})]})]}),"active"===A&&o&&(0,i.jsx)(N,{checkin:o.checkin,autoCheckin:e?.autoCheckin!==!1,onAutoCheckinChange:i=>n({...e,autoCheckin:i}),busy:g,onCheckin:()=>void I()}),f?(0,i.jsxs)("div",{className:"space-y-1 rounded-md bg-muted/50 p-3 text-sm",children:[(0,i.jsxs)("p",{className:"flex items-center gap-2",children:[(0,i.jsx)(s.f,{className:"h-4 w-4 animate-spin"}),l?.waiting]}),f.userCode&&(0,i.jsxs)("p",{children:[l?.userCode||"Verification code",": ",(0,i.jsx)("span",{className:"font-mono font-medium",children:f.userCode})]}),(0,i.jsxs)("a",{href:f.url,target:"_blank",rel:"noopener noreferrer",className:"inline-flex items-center gap-1 underline",children:[l?.openLink||"Open the authorization page"," ",(0,i.jsx)(c.f,{className:"h-3 w-3"})]})]}):(0,i.jsxs)("div",{className:"flex flex-wrap gap-2",children:[(0,i.jsxs)(a.f,{size:"sm",onClick:()=>void y(),disabled:g,children:[g?(0,i.jsx)(s.f,{className:"mr-2 h-4 w-4 animate-spin"}):(0,i.jsx)(m.f,{className:"mr-2 h-4 w-4"}),"none"===A?l?.login||"Sign in with browser":l?.relogin||"Sign in again"]}),"none"!==A&&(0,i.jsxs)(a.f,{size:"sm",variant:"outline",onClick:()=>void U(),disabled:g,children:[(0,i.jsx)(x.f,{className:"mr-2 h-4 w-4"}),l?.logout||"Sign out"]})]})]}),(0,i.jsxs)("div",{className:"space-y-2",children:[(0,i.jsx)(t.f,{htmlFor:"minimax-code-model",children:l?.model||"Model"}),(0,i.jsx)(h.f,{id:"minimax-code-model",list:"minimax-code-models",value:e?.model||"",onChange:i=>n({...e,model:i.target.value}),placeholder:"MiniMax-M3.1-Flash"}),(0,i.jsx)("datalist",{id:"minimax-code-models",children:b.map(e=>(0,i.jsx)("option",{value:e},e))}),(0,i.jsx)("p",{className:"text-xs text-muted-foreground",children:l?.modelHint})]}),(0,i.jsx)("p",{className:"text-xs text-muted-foreground",children:l?.risk})]})}var U=e.i(77071),I=e.i(759659),A=e.i(464034),P=e.i(434901),z=e.i(37038),E=e.i(62189);function T({value:e,onChange:s}){let{t:r}=(0,j.b)(),l=(0,E.f)("openai"),o=e?.instances||[],d=e?.activeInstanceId,c=o.find(e=>e.id===d),m=(i,a)=>{s({...e,instances:o.map(e=>e.id===d?{...e,[i]:a}:e)})},x=async()=>{if(!d||!await (0,K.u)(r.settings?.ai?.confirmDelete||"Delete this instance?",{destructive:!0}))return;let e=o.filter(e=>e.id!==d);s({instances:e,activeInstanceId:e[0]?.id})};return(0,i.jsxs)("div",{className:"space-y-3 animate-in fade-in slide-in-from-top-2",children:[(0,i.jsxs)("div",{className:"space-y-2",children:[(0,i.jsxs)("div",{className:"flex items-center justify-between",children:[(0,i.jsx)(t.f,{children:r.settings?.ai?.instances||"Instance"}),(0,i.jsxs)(a.f,{type:"button",variant:"outline",size:"sm",onClick:()=>{if(o.length>=10)return;let e={id:"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,e=>{let i=16*Math.random()|0;return("x"===e?i:3&i|8).toString(16)}),name:`Instance ${o.length+1}`,apiKey:"",baseUrl:"https://api.openai.com/v1",model:"gpt-6.1-sol"};s({instances:[...o,e],activeInstanceId:e.id})},disabled:o.length>=10,className:"h-7 px-2 text-xs",children:[(0,i.jsx)(U.f,{className:"h-3 w-3 mr-1"}),r.settings?.ai?.addInstance||"Add"]})]}),o.length>0?(0,i.jsxs)("div",{className:"flex gap-2",children:[(0,i.jsxs)(n.d,{value:d||"",onValueChange:i=>s({...e,activeInstanceId:i}),children:[(0,i.jsx)(n.P,{className:"flex-1",children:(0,i.jsx)(n.U,{placeholder:r.settings?.ai?.selectInstance||"Select Instance"})}),(0,i.jsx)(n.r,{children:o.map(e=>(0,i.jsx)(n.T,{value:e.id,children:e.name},e.id))})]}),o.length>1&&(0,i.jsx)(a.f,{type:"button",variant:"outline",size:"icon",onClick:x,className:"h-10 w-10 text-destructive hover:text-destructive",children:(0,i.jsx)(I.f,{className:"h-4 w-4"})})]}):(0,i.jsx)("p",{className:"text-sm text-muted-foreground",children:r.settings?.ai?.noInstances||"No instances configured. Click 'Add' to create one."}),o.length>=10&&(0,i.jsx)("p",{className:"text-xs text-amber-600",children:r.settings?.ai?.maxInstancesReached||"Maximum instances reached (10)"})]}),c&&(0,i.jsxs)("div",{className:"space-y-3 p-3 border rounded-md bg-background",children:[(0,i.jsxs)("div",{className:"space-y-2",children:[(0,i.jsxs)(t.f,{children:[r.settings?.ai?.instanceName||"Instance Name"," ",(0,i.jsx)("span",{className:"text-destructive",children:"*"})]}),(0,i.jsx)(h.f,{value:c.name||"",onChange:e=>m("name",e.target.value),placeholder:"e.g. GLM-4V",className:c.name?.trim()?"":"border-destructive"})]}),(0,i.jsxs)("div",{className:"space-y-2",children:[(0,i.jsx)(P.f,{label:(0,i.jsxs)(i.Fragment,{children:["API Key ",(0,i.jsx)("span",{className:"text-destructive",children:"*"})]}),href:l?.apiKey,linkText:r.settings.ai.docLinks.apiKey}),(0,i.jsx)(z.f,{value:c.apiKey||"",onChange:e=>m("apiKey",e.target.value),placeholder:"sk-...",className:c.apiKey?.trim()?"":"border-destructive"})]}),(0,i.jsxs)("div",{className:"space-y-2 pt-4 border-t",children:[(0,i.jsxs)(t.f,{children:["Base URL ",(0,i.jsx)("span",{className:"text-destructive",children:"*"})]}),(0,i.jsx)(h.f,{value:c.baseUrl||"",onChange:e=>m("baseUrl",e.target.value),placeholder:"https://api.openai.com/v1",className:c.baseUrl?.trim()?"":"border-destructive"})]}),(0,i.jsx)(A.f,{provider:"openai",apiKey:c.apiKey,baseUrl:c.baseUrl,currentModel:c.model,onModelChange:e=>m("model",e),docsHref:l?.models})]})]})}function R({provider:e}){let{t:s}=(0,j.b)(),a=s.settings.ai.providerDocs,t=(0,E.f)(e);if(!t)return null;let n=[t.cn&&{href:t.cn,label:t.intl?a.cn:a.official},t.intl&&{href:t.intl,label:t.cn?a.intl:a.official}].filter(e=>!!e);return(0,i.jsxs)("p",{className:"flex flex-wrap items-center gap-x-3 gap-y-1 text-xs text-muted-foreground",children:[(0,i.jsx)("span",{children:a.title}),n.map(e=>(0,i.jsxs)("a",{href:e.href,target:"_blank",rel:"noopener noreferrer",className:"inline-flex items-center gap-1 underline",children:[e.label,(0,i.jsx)(c.f,{className:"h-3 w-3"})]},e.href))]})}var F=e.i(128093);function D({provider:e,value:s,onChange:a}){let{t:n}=(0,j.b)(),r=F.$[e],l=(e,i)=>a({...s,[e]:i}),o={qwen:n.settings?.ai?.qwenBaseUrlHint,stepfun:n.settings?.ai?.stepfunBaseUrlHint,volcengine:n.settings?.ai?.volcengineBaseUrlHint,"volcengine-agent":n.settings?.ai?.volcengineAgentBaseUrlHint,"volcengine-coding":n.settings?.ai?.volcengineCodingBaseUrlHint};return(0,i.jsxs)("div",{className:"space-y-3 animate-in fade-in slide-in-from-top-2",children:["volcengine-free"===e&&(0,i.jsxs)("div",{className:"rounded-md border border-green-200 bg-green-50 p-3 text-xs text-green-800 dark:border-green-900 dark:bg-green-950/40 dark:text-green-300",children:[(0,i.jsx)("p",{className:"font-medium",children:n.settings.ai.volcengineFree.title}),(0,i.jsx)("p",{className:"mt-1",children:n.settings.ai.volcengineFree.body})]}),(0,i.jsxs)("div",{className:"space-y-2",children:[(0,i.jsx)(P.f,{label:"API Key",href:r.docs.apiKey,linkText:n.settings.ai.docLinks.apiKey}),(0,i.jsx)(z.f,{value:s?.apiKey||"",onChange:e=>l("apiKey",e.target.value),placeholder:"sk-..."}),(0,i.jsxs)("p",{className:"text-xs text-muted-foreground",children:[n.settings?.ai?.vendorApiKeyHint||"Get an API key from the console:"," ",(0,i.jsx)("a",{href:r.consoleUrl,target:"_blank",rel:"noopener noreferrer",className:"underline break-all",children:r.consoleUrl})]})]}),(0,i.jsxs)("div",{className:"space-y-2",children:[(0,i.jsx)(t.f,{children:"Base URL (Optional)"}),(0,i.jsx)(h.f,{value:s?.baseUrl||"",onChange:e=>l("baseUrl",e.target.value),placeholder:r.baseUrl}),(0,i.jsx)("p",{className:"text-xs text-muted-foreground",children:o[e]??n.settings?.ai?.vendorBaseUrlHint})]}),(0,i.jsx)(A.f,{provider:e,apiKey:s?.apiKey,baseUrl:s?.baseUrl,currentModel:s?.model||r.model,onModelChange:e=>l("model",e),docsHref:r.docs.models})]})}e.s(["f",0,function({config:e,setConfig:c,loading:m,saving:x,onSave:p}){let{t:u,language:h}=(0,j.b)();return m?(0,i.jsx)("div",{className:"flex justify-center py-4",children:(0,i.jsx)(s.f,{className:"h-6 w-6 animate-spin text-muted-foreground"})}):(0,i.jsxs)("div",{className:"space-y-4 border rounded-lg p-4 bg-muted/30",children:[(0,i.jsxs)("div",{className:"space-y-2",children:[(0,i.jsx)(t.f,{children:u.settings?.tabs?.ai||"AI Provider"}),(0,i.jsxs)(n.d,{value:e.aiProvider,onValueChange:e=>c(i=>({...i,aiProvider:e})),children:[(0,i.jsx)(n.P,{children:(0,i.jsx)(n.U,{})}),(0,i.jsxs)(n.r,{children:[(0,i.jsx)(n.T,{value:"minimax",children:(0,F.z)("minimax",h)}),(0,i.jsx)(n.T,{value:"minimax-code",children:"MiniMax Code OAuth"}),F.U.filter(e=>"minimax"!==e).map(e=>(0,i.jsx)(n.T,{value:e,children:(0,F.z)(e,h)},e)),(0,i.jsx)(n.T,{value:"anthropic",children:"Anthropic / Compatible"}),(0,i.jsx)(n.T,{value:"azure",children:"Azure OpenAI"}),(0,i.jsx)(n.T,{value:"openai",children:"OpenAI / Compatible"}),(0,i.jsx)(n.T,{value:"gemini",children:"Google Gemini"})]})]}),(0,i.jsx)(R,{provider:e.aiProvider})]}),"openai"===e.aiProvider&&(0,i.jsx)(T,{value:e.openai,onChange:e=>c(i=>({...i,openai:e}))}),"gemini"===e.aiProvider&&(0,i.jsx)(d.f,{value:e.gemini,onChange:e=>c(i=>({...i,gemini:e}))}),"minimax-code"===e.aiProvider&&(0,i.jsx)(M,{value:e.minimaxCode,onChange:e=>c(i=>({...i,minimaxCode:e}))}),"anthropic"===e.aiProvider&&(0,i.jsx)(l.f,{value:e.anthropic,onChange:e=>c(i=>({...i,anthropic:e}))}),(0,F.j)(e.aiProvider)&&(0,i.jsx)(D,{provider:e.aiProvider,value:e[e.aiProvider],onChange:e=>c(i=>({...i,[i.aiProvider]:e}))},e.aiProvider),"azure"===e.aiProvider&&(0,i.jsx)(o.f,{value:e.azure,onChange:e=>c(i=>({...i,azure:e}))}),(0,i.jsx)(r.f,{config:e,saving:x,saveButton:(0,i.jsxs)(a.f,{onClick:p,disabled:x,className:"flex-1",children:[x&&(0,i.jsx)(s.f,{className:"mr-2 h-4 w-4 animate-spin"}),u.settings?.ai?.save||"Save AI Settings"]})})]})}],10038),e.s(["f",0,function(e,i){if(!(0,y.L)(e.timeZone??y.J))return i.settings.general.invalidTimeZone;if("openai"===e.aiProvider)for(let s of e.openai?.instances||[]){if(!s.name?.trim())return i.settings?.ai?.validationNameRequired||"Instance name is required";if(!s.apiKey?.trim())return i.settings?.ai?.validationApiKeyRequired||"API Key is required";if(!s.baseUrl?.trim())return i.settings?.ai?.validationBaseUrlRequired||"Base URL is required";if(!s.model?.trim())return i.settings?.ai?.validationModelRequired||"Model name is required"}if("azure"===e.aiProvider){if(!e.azure?.endpoint?.trim())return i.settings?.ai?.validationAzureEndpointRequired||"Azure Endpoint is required";if(!e.azure?.deploymentName?.trim())return i.settings?.ai?.validationAzureDeploymentRequired||"Deployment Name is required";if(!e.azure?.apiKey?.trim())return i.settings?.ai?.validationApiKeyRequired||"API Key is required"}return null}],835467)},459649,464034,434901,62189,118585,75977,97923,e=>{var i=e.i(843476),s=e.i(793479),a=e.i(37038),t=e.i(110204),n=e.i(271645),r=e.i(519455),l=e.i(967489),o=e.i(482022),d=e.i(741120),c=e.i(632781),m=e.i(41931),x=e.i(111110),p=e.i(128093),u=e.i(201276);function h({provider:e,apiKey:a,baseUrl:f,currentModel:g,onModelChange:j,docsHref:v}){let{t:y}=(0,x.b)(),[N,b]=(0,n.useState)([]),[k,C]=(0,n.useState)(!1),[w,K]=(0,n.useState)(null),[S,M]=(0,n.useState)(g||""),[U,I]=(0,n.useState)(!1),[A,P]=(0,n.useState)(g);g!==A&&(P(g),M(g||""));let z=async()=>{if(!a)return void K(y.modelSelector?.enterApiKeyFirst||"Please enter API Key first");C(!0),K(null);try{let i=await m.k.post("/api/ai/models",{provider:e,apiKey:a,...f&&{baseUrl:f}});if("error"in i&&"string"==typeof i.error){K(i.error),I(!0),b([]);return}b(i.models),0===i.models.length&&(K(y.modelSelector?.noVisionModel||"No vision model found, please enter manually"),I(!0))}catch(i){u.V.error("[ModelSelector]","Failed to fetch models",{error:i});let e=i instanceof Error&&i.message||y.modelSelector?.fetchFailed||"Failed to fetch models";K(e+(y.modelSelector?.enterManually||", please enter manually")),I(!0)}finally{C(!1)}};return(0,i.jsxs)("div",{className:"space-y-2",children:[(0,i.jsxs)("div",{className:"flex items-center gap-2",children:[(0,i.jsx)(t.f,{className:"flex-1",children:y.modelSelector?.modelName||"Model Name"}),v&&(0,i.jsxs)("a",{href:v,target:"_blank",rel:"noopener noreferrer",className:"inline-flex shrink-0 items-center gap-1 text-xs text-muted-foreground underline",children:[y.settings.ai.docLinks.models,(0,i.jsx)(o.f,{className:"h-3 w-3"})]}),(0,i.jsx)(r.f,{type:"button",variant:"outline",size:"sm",onClick:z,disabled:k||!a,children:k?(0,i.jsx)(c.f,{className:"h-3 w-3 animate-spin"}):(0,i.jsx)(d.f,{className:"h-3 w-3"})})]}),w&&(0,i.jsx)("p",{className:"text-xs text-yellow-600",children:w}),U||0===N.length?(0,i.jsxs)("div",{className:"space-y-2",children:[(0,i.jsx)(s.f,{value:S,onChange:e=>{var i;M(i=e.target.value),j(i)},placeholder:(0,p.j)(e)?p.$[e].model:"openai"===e?"gpt-6.1-sol":"gemini-1.5-flash"}),N.length>0&&(0,i.jsx)(r.f,{type:"button",variant:"link",size:"sm",className:"h-auto p-0 text-xs",onClick:()=>I(!1),children:y.modelSelector?.selectFromList||"Select from List"})]}):(0,i.jsx)("div",{className:"space-y-2",children:(0,i.jsxs)(l.d,{value:g,onValueChange:e=>{"_custom"===e?I(!0):(I(!1),M(e),j(e))},children:[(0,i.jsx)(l.P,{children:(0,i.jsx)(l.U,{placeholder:y.modelSelector?.selectModel||"Select Model"})}),(0,i.jsxs)(l.r,{children:[N.map(e=>(0,i.jsxs)(l.T,{value:e.id,children:[e.name,e.owned_by&&` (${e.owned_by})`]},e.id)),(0,i.jsx)(l.T,{value:"_custom",children:y.modelSelector?.customInput||"Custom Input..."})]})]})})]})}function f({label:e,href:s,linkText:a}){return s?(0,i.jsxs)("div",{className:"flex items-center justify-between gap-2",children:[(0,i.jsx)(t.f,{children:e}),(0,i.jsxs)("a",{href:s,target:"_blank",rel:"noopener noreferrer",className:"inline-flex shrink-0 items-center gap-1 text-xs text-muted-foreground underline",children:[a,(0,i.jsx)(o.f,{className:"h-3 w-3"})]})]}):(0,i.jsx)(t.f,{children:e})}e.s(["f",0,h],464034),e.s(["f",0,f],434901);let g={openai:{intl:"https://platform.openai.com/docs/api-reference",apiKey:"https://platform.openai.com/docs/quickstart",models:"https://platform.openai.com/docs/models"},anthropic:{intl:"https://docs.anthropic.com/en/api/overview",apiKey:"https://docs.anthropic.com/en/api/getting-started",models:"https://docs.anthropic.com/en/docs/about-claude/models/overview"},azure:{intl:"https://learn.microsoft.com/azure/ai-foundry/openai/reference",apiKey:"https://learn.microsoft.com/azure/ai-foundry/openai/how-to/create-resource",models:"https://learn.microsoft.com/azure/ai-foundry/openai/concepts/models"},gemini:{intl:"https://ai.google.dev/gemini-api/docs",apiKey:"https://ai.google.dev/gemini-api/docs/api-key",models:"https://ai.google.dev/gemini-api/docs/models"}};function j(e){return(0,p.j)(e)?p.$[e].docs:g[e]??null}e.s(["f",0,j],62189),e.s(["f",0,function({value:e,onChange:n}){let{t:r}=(0,x.b)(),l=j("anthropic"),o=(i,s)=>n({...e,[i]:s});return(0,i.jsxs)("div",{className:"space-y-3 animate-in fade-in slide-in-from-top-2",children:[(0,i.jsxs)("div",{className:"space-y-2",children:[(0,i.jsx)(f,{label:"API Key",href:l?.apiKey,linkText:r.settings.ai.docLinks.apiKey}),(0,i.jsx)(a.f,{value:e?.apiKey||"",onChange:e=>o("apiKey",e.target.value),placeholder:"sk-ant-..."})]}),(0,i.jsxs)("div",{className:"space-y-2",children:[(0,i.jsx)(t.f,{children:"Base URL (Optional)"}),(0,i.jsx)(s.f,{value:e?.baseUrl||"",onChange:e=>o("baseUrl",e.target.value),placeholder:"https://api.anthropic.com"}),(0,i.jsx)("p",{className:"text-xs text-muted-foreground",children:r.settings?.ai?.anthropicBaseUrlHint})]}),(0,i.jsx)(h,{provider:"anthropic",apiKey:e?.apiKey,baseUrl:e?.baseUrl,currentModel:e?.model,onModelChange:e=>o("model",e),docsHref:l?.models})]})}],459649),e.s(["f",0,function({value:e,onChange:n}){let{t:r}=(0,x.b)(),l=j("azure"),o=(i,s)=>n({...e,[i]:s}),d=e=>e?.trim()?"":"border-destructive";return(0,i.jsxs)("div",{className:"space-y-3 animate-in fade-in slide-in-from-top-2",children:[(0,i.jsxs)("div",{className:"space-y-2",children:[(0,i.jsxs)(t.f,{children:[r.settings?.ai?.azureEndpoint||"Azure Endpoint"," ",(0,i.jsx)("span",{className:"text-destructive",children:"*"})]}),(0,i.jsx)(s.f,{value:e?.endpoint||"",onChange:e=>o("endpoint",e.target.value),placeholder:r.settings?.ai?.azureEndpointPlaceholder||"https://your-resource.openai.azure.com",className:d(e?.endpoint)})]}),(0,i.jsxs)("div",{className:"space-y-2",children:[(0,i.jsx)(f,{label:(0,i.jsxs)(i.Fragment,{children:[r.settings?.ai?.azureDeployment||"Deployment Name"," ",(0,i.jsx)("span",{className:"text-destructive",children:"*"})]}),href:l?.models,linkText:r.settings.ai.docLinks.models}),(0,i.jsx)(s.f,{value:e?.deploymentName||"",onChange:e=>o("deploymentName",e.target.value),placeholder:r.settings?.ai?.azureDeploymentPlaceholder||"gpt-4o-deployment",className:d(e?.deploymentName)})]}),(0,i.jsxs)("div",{className:"space-y-2",children:[(0,i.jsx)(f,{label:(0,i.jsxs)(i.Fragment,{children:["API Key ",(0,i.jsx)("span",{className:"text-destructive",children:"*"})]}),href:l?.apiKey,linkText:r.settings.ai.docLinks.apiKey}),(0,i.jsx)(a.f,{value:e?.apiKey||"",onChange:e=>o("apiKey",e.target.value),placeholder:"xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",className:d(e?.apiKey)})]}),(0,i.jsxs)("div",{className:"space-y-2",children:[(0,i.jsx)(t.f,{children:r.settings?.ai?.azureApiVersion||"API Version"}),(0,i.jsx)(s.f,{value:e?.apiVersion||"",onChange:e=>o("apiVersion",e.target.value),placeholder:r.settings?.ai?.azureApiVersionPlaceholder||"2024-02-15-preview"})]}),(0,i.jsxs)("div",{className:"space-y-2",children:[(0,i.jsx)(t.f,{children:r.settings?.ai?.azureModel||"Model Display Name"}),(0,i.jsx)(s.f,{value:e?.model||"",onChange:e=>o("model",e.target.value),placeholder:"gpt-4o"})]})]})}],118585),e.s(["f",0,function({value:e,onChange:n}){let{t:r}=(0,x.b)(),l=j("gemini"),o=(i,s)=>n({...e,[i]:s});return(0,i.jsxs)("div",{className:"space-y-3 animate-in fade-in slide-in-from-top-2",children:[(0,i.jsxs)("div",{className:"space-y-2",children:[(0,i.jsx)(f,{label:"API Key",href:l?.apiKey,linkText:r.settings.ai.docLinks.apiKey}),(0,i.jsx)(a.f,{value:e?.apiKey||"",onChange:e=>o("apiKey",e.target.value),placeholder:"AIza..."})]}),(0,i.jsxs)("div",{className:"space-y-2",children:[(0,i.jsx)(t.f,{children:"Base URL (Optional)"}),(0,i.jsx)(s.f,{value:e?.baseUrl||"",onChange:e=>o("baseUrl",e.target.value),placeholder:"https://generativelanguage.googleapis.com"})]}),(0,i.jsx)(h,{provider:"gemini",apiKey:e?.apiKey,baseUrl:e?.baseUrl,currentModel:e?.model,onModelChange:e=>o("model",e),docsHref:l?.models})]})}],75977);var v=e.i(456420);let y={name:"log-in",size:24,node:[["path",{d:"m10 17 5-5-5-5",key:"1bsop3"}],["path",{d:"M15 12H3",key:"6jk70r"}],["path",{d:"M15 3h4a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2h-4",key:"u53s6r"}]]};y.node;let N=(0,v.f)(y);e.s(["f",0,N],97923)},37038,e=>{var i=e.i(843476),s=e.i(271645),a=e.i(772382),t=e.i(580860),n=e.i(519455),r=e.i(793479),l=e.i(111110),o=e.i(975157);e.s(["f",0,function({className:e,...d}){let{t:c}=(0,l.b)(),[m,x]=(0,s.useState)(!1);return(0,i.jsxs)("div",{className:"relative",children:[(0,i.jsx)(r.f,{type:m?"text":"password",className:(0,o.f)("pr-10",e),...d}),(0,i.jsx)(n.f,{type:"button",variant:"ghost",size:"icon",className:"absolute right-0 top-0 h-full px-3 py-2 hover:bg-transparent",onClick:()=>x(!m),"aria-label":m?c.common.hidePassword:c.common.showPassword,tabIndex:-1,children:m?(0,i.jsx)(t.f,{className:"h-4 w-4 text-muted-foreground"}):(0,i.jsx)(a.f,{className:"h-4 w-4 text-muted-foreground"})})]})}])}])})();
@@ -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 s={name:"arrow-left",size:24,node:[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]]};s.node;let n=(0,t.f)(s);e.s(["f",0,n],711241)},566595,e=>{var t=e.i(456420);let s={name:"search",size:24,node:[["path",{d:"m21 21-4.34-4.34",key:"14j7rj"}],["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}]]};s.node;let n=(0,t.f)(s);e.s(["f",0,n],566595)},666944,e=>{var t=e.i(843476),s=e.i(271645),n=e.i(618566),r=e.i(519455),a=e.i(590546),i=e.i(716327),l=e.i(456539),o=e.i(566595),c=e.i(793479),m=e.i(111110);function u(e){if(e.tags&&e.tags.length>0)return e.tags.map(e=>e.name);try{let t=JSON.parse(e.knowledgePoints||"[]");return Array.isArray(t)?t.filter(e=>"string"==typeof e):[]}catch{return[]}}async function d(e){let t=[];for(let s=1;;s+=1){let n=await e(s);if(t.push(...n.items),0===n.items.length||s>=n.totalPages)return t}}function p({items:e,selectedIds:n,selectedCount:a,printNumbers:d,onToggle:x,onSelectionChange:h}){let{t:g}=(0,m.b)(),[f,w]=(0,s.useState)(e.length<=20),[v,b]=(0,s.useState)(""),j=(0,s.useMemo)(()=>e.filter(e=>{let t;return!(t=v.trim().toLowerCase())||[e.questionText??"",e.shortId??"",...u(e)].some(e=>e.toLowerCase().includes(t))}),[e,v]),y=v.trim().length>0,S=e=>h(function(e,t,s){let n=new Set(e);for(let r of t)"select"!==s&&("invert"!==s||e.has(r))?n.delete(r):n.add(r);return n}(n,j.map(e=>e.id),e));return(0,t.jsxs)("div",{className:"rounded-md border bg-muted/20 p-3 space-y-2",children:[(0,t.jsxs)("div",{className:"flex flex-wrap items-center justify-between gap-2",children:[(0,t.jsxs)("button",{type:"button",className:"flex items-center gap-1 text-sm font-medium hover:text-primary","aria-expanded":f,onClick:()=>w(e=>!e),children:[f?(0,t.jsx)(l.f,{className:"h-4 w-4"}):(0,t.jsx)(i.f,{className:"h-4 w-4"}),g.printPreview.selectItems," (",a,"/",e.length,")"]}),(0,t.jsxs)("div",{className:"flex flex-wrap gap-2",children:[(0,t.jsx)(r.f,{variant:"outline",size:"sm",onClick:()=>S("select"),children:y?g.printPreview.selectFiltered:g.printPreview.selectAll}),(0,t.jsx)(r.f,{variant:"outline",size:"sm",onClick:()=>S("clear"),children:y?g.printPreview.clearFiltered:g.printPreview.clearSelection}),(0,t.jsx)(r.f,{variant:"outline",size:"sm",onClick:()=>S("invert"),children:g.printPreview.invertSelection})]})]}),f&&(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)("div",{className:"relative",children:[(0,t.jsx)(o.f,{className:"absolute left-2 top-1/2 h-4 w-4 -translate-y-1/2 text-muted-foreground"}),(0,t.jsx)(c.f,{type:"search",value:v,onChange:e=>b(e.target.value),placeholder:g.printPreview.searchPlaceholder,"aria-label":g.printPreview.searchPlaceholder,className:"h-8 pl-8 text-sm"})]}),(0,t.jsxs)("div",{className:"grid gap-2 sm:grid-cols-2 lg:grid-cols-3 max-h-[40vh] overflow-y-auto pr-1",children:[j.map(e=>{let s=d.get(e.id);return(0,t.jsxs)("label",{className:"flex items-start gap-2 rounded border bg-background p-2 text-xs cursor-pointer hover:border-primary/50",children:[(0,t.jsx)("input",{type:"checkbox",checked:n.has(e.id),onChange:()=>x(e.id),className:"mt-0.5 rounded border-gray-300 text-primary focus:ring-primary"}),(0,t.jsxs)("span",{className:"line-clamp-2",children:[void 0!==s&&(0,t.jsxs)("span",{className:"font-semibold",children:[g.printPreview.questionNumber.replace("{num}",String(s)),g.common.colon]}),e.shortId&&(0,t.jsxs)("span",{className:"font-mono text-muted-foreground",children:[e.shortId," "]}),e.questionText]})]},e.id)}),0===j.length&&(0,t.jsx)("p",{className:"col-span-full py-2 text-center text-xs text-muted-foreground",children:g.printPreview.noSearchResult})]})]})]})}var x=e.i(122330);function h({checked:e,onChange:s,label:n}){return(0,t.jsxs)("label",{className:"flex items-center gap-1.5 text-xs sm:text-sm cursor-pointer whitespace-nowrap hover:text-primary transition-colors",children:[(0,t.jsx)("input",{type:"checkbox",checked:e,onChange:e=>s(e.target.checked),className:"rounded border-gray-300 text-primary focus:ring-primary w-3.5 h-3.5 sm:w-4 sm:h-4"}),n]})}function g({options:e,onChange:s,hasCustomSpaces:n,onResetCustomSpaces:a}){let{t:i}=(0,m.b)(),l=e.answerSpace??"auto";return(0,t.jsxs)("div",{className:"flex flex-wrap items-center justify-center gap-2 sm:gap-4",children:[(0,t.jsxs)("div",{className:"flex items-center gap-2 text-sm bg-muted/50 px-2 sm:px-3 py-1 rounded-md",children:[(0,t.jsxs)("span",{className:"whitespace-nowrap text-xs sm:text-sm",children:[i.printPreview?.imageScale||"Image Scale",": ",e.imageScale,"%"]}),(0,t.jsx)("input",{type:"range",min:"30",max:"100",value:e.imageScale,onChange:e=>s({imageScale:Number(e.target.value)}),className:"w-16 sm:w-20 accent-primary"})]}),(0,t.jsxs)("div",{className:"flex items-center gap-2 text-xs sm:text-sm bg-muted/50 px-2 sm:px-3 py-1 rounded-md",children:[(0,t.jsxs)("label",{htmlFor:"print-preview-answer-space",className:"whitespace-nowrap",children:[i.exam.answerSpace,":"]}),(0,t.jsxs)("select",{id:"print-preview-answer-space",value:l,onChange:e=>{(0,x.I)(e.target.value)&&s({answerSpace:e.target.value})},className:"bg-background border rounded px-2 py-0.5 text-xs sm:text-sm",children:[(0,t.jsx)("option",{value:"auto",children:i.exam.answerSpaceAuto}),(0,t.jsx)("option",{value:"none",children:i.exam.answerSpaceNone}),(0,t.jsx)("option",{value:"small",children:i.exam.answerSpaceSmall}),(0,t.jsx)("option",{value:"medium",children:i.exam.answerSpaceMedium}),(0,t.jsx)("option",{value:"large",children:i.exam.answerSpaceLarge})]}),n&&a&&(0,t.jsx)(r.f,{type:"button",variant:"ghost",size:"sm",className:"h-6 px-2 text-xs",onClick:a,children:i.exam.resetAllQuestionAnswerSpaces})]}),(0,t.jsxs)("div",{className:"flex flex-wrap gap-x-3 gap-y-1 sm:gap-4",children:[(0,t.jsx)(h,{checked:e.showQuestionText,onChange:e=>s({showQuestionText:e}),label:i.printPreview?.showQuestionText||"Question Text"}),(0,t.jsx)(h,{checked:e.showAnswers,onChange:e=>s({showAnswers:e}),label:i.printPreview?.showAnswers||"Show Answers"}),(0,t.jsx)(h,{checked:e.showAnalysis,onChange:e=>s({showAnalysis:e}),label:i.printPreview?.showAnalysis||"Show Analysis"}),(0,t.jsx)(h,{checked:e.showTags,onChange:e=>s({showTags:e}),label:i.printPreview?.showTags||"Show Tags"})]})]})}var f=e.i(263676),w=e.i(511445),v=e.i(84583),b=e.i(920808),j=e.i(149704);let y=(0,s.memo)(function({item:e,index:s,options:n,reserveAnswerSpace:r,customAnswerSpacePx:a,onCustomAnswerSpaceChange:i,paperGroupName:l,onRemove:o}){let{t:c}=(0,m.b)(),d=u(e),p=r?(0,x.z)(n.answerSpace??"auto",e.questionText||"",a):0;return(0,t.jsxs)("div",{className:`mb-4 border-b last:border-b-0 print:break-inside-avoid [content-visibility:auto] [contain-intrinsic-size:auto_480px] print:[content-visibility:visible] ${r?"pb-4":"pb-6"}`,children:[(0,t.jsxs)("div",{className:"mb-4 flex flex-wrap items-center gap-x-4 gap-y-2 leading-7",children:[(0,t.jsx)("span",{className:"text-lg font-bold",children:c.printPreview?.questionNumber?.replace("{num}",String(s+1))||`Question ${s+1}`}),e.shortId&&(0,t.jsx)("span",{className:"font-mono text-sm text-muted-foreground whitespace-nowrap",children:c.printPreview.source.replace("{id}",e.shortId)}),e.subject&&(0,t.jsx)("span",{className:"text-sm text-muted-foreground",children:e.subject.name}),e.gradeSemester&&(0,t.jsx)("span",{className:"text-sm text-muted-foreground",children:e.gradeSemester}),l&&(0,t.jsxs)("span",{className:"text-sm text-muted-foreground",children:[c.printPreview?.paperLevel||"Paper Level",": ",l]}),n.showTags&&d.length>0&&(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)("span",{className:"font-semibold",children:[c.printPreview?.knowledgePoints||"Knowledge Points",":"]}),d.map((e,s)=>(0,t.jsx)("span",{className:"px-2 py-1 bg-muted rounded text-sm",children:e},`${e}-${s}`))]}),o&&(0,t.jsxs)("button",{type:"button",className:"print:hidden ml-auto flex items-center gap-1 rounded px-2 py-1 text-xs text-muted-foreground hover:bg-muted hover:text-destructive",onClick:()=>o(e.id),children:[(0,t.jsx)(f.X,{className:"h-3.5 w-3.5"}),c.printPreview.removeFromPrint]})]}),n.showQuestionText&&e.questionText?(0,t.jsxs)("div",{className:"mb-4",children:[(0,t.jsx)(b.f,{content:e.questionText}),(0,t.jsx)(j.f,{svg:e.figureSvg,scale:e.figureScale,align:e.figureAlign})]}):e.originalImageUrl&&(0,t.jsx)("div",{className:"mb-4",children:(0,t.jsx)("img",{src:e.originalImageUrl,alt:c.detail?.originalProblem||"Question Image",loading:"lazy",decoding:"async",className:"h-auto border rounded",style:{maxWidth:`${n.imageScale}%`}})}),n.showAnswers&&e.answerText&&(0,t.jsxs)("div",{className:"mb-4",children:[(0,t.jsxs)("h3",{className:"font-semibold mb-2",children:[c.printPreview?.referenceAnswer||"Reference Answer",":"]}),(0,t.jsx)(w.f,{content:e.answerText})]}),n.showAnalysis&&e.analysis&&(0,t.jsxs)("div",{className:"mb-4",children:[(0,t.jsxs)("h3",{className:"font-semibold mb-2",children:[c.printPreview?.analysis||"Analysis",":"]}),(0,t.jsx)(w.f,{content:e.analysis})]}),r&&(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("div",{className:"print-answer-space",style:{minHeight:`${p}px`}}),i&&(0,t.jsx)(v.f,{effectivePx:p,isCustom:"number"==typeof a,onChange:t=>i(e.id,t),onReset:()=>i(e.id,null)})]})]})});var S=e.i(41931),N=e.i(35209),P=e.i(442861),A=e.i(469817),k=e.i(201276);async function C(e,{timeoutMs:t=3e4,onProgress:s}={}){let n,r=Array.from(e.querySelectorAll("img")),a=0;s?.(a,r.length);let i=Promise.all(r.map(async e=>{e.loading="eager",await (e.complete?Promise.resolve():new Promise(t=>{e.addEventListener("load",()=>t(),{once:!0}),e.addEventListener("error",()=>t(),{once:!0})})),a+=1,s?.(a,r.length)})),l=new Promise(e=>{n=setTimeout(e,t)});await Promise.race([i,l]),clearTimeout(n)}let T="print-preview-options",z={showQuestionText:!1,showAnswers:!1,showAnalysis:!1,showTags:!1,imageScale:70,answerSpace:"auto"},I=["showQuestionText","showAnswers","showAnalysis","showTags"];var M=e.i(470279);async function R(e){for(let t of function(e,t){let s=[];for(let n=0;n<e.length;n+=t)s.push(e.slice(n,n+t));return s}(e,A.A))await S.k.put("/api/error-items/answer-space",{items:t})}function $(){var e,i,l,o,c,u;let h=(0,n.useSearchParams)(),{t:f}=(0,m.b)(),[w,v]=(0,s.useState)([]);(0,N.f)(f.printPreview.title);let[b,j]=(0,s.useState)(!0),[$,F]=(0,s.useState)(z);(0,s.useEffect)(()=>{F(function(){try{return function(e){let t,s={...z};if(!e)return s;try{t=JSON.parse(e)}catch{return s}if(!t||"object"!=typeof t)return s;let n=t;for(let e of I)"boolean"==typeof n[e]&&(s[e]=n[e]);return"number"==typeof n.imageScale&&Number.isFinite(n.imageScale)&&(s.imageScale=Math.min(100,Math.max(30,Math.round(n.imageScale)))),(0,x.I)(n.answerSpace)&&(s.answerSpace=n.answerSpace),s}(localStorage.getItem(T))}catch{return{...z}}}())},[]);let[L,q]=(0,s.useState)(new Set),{customSpaces:O,setSpace:Q,resetAll:E,saveFailed:_}=(0,P.f)(w,R),U=(0,s.useCallback)(async()=>{try{let e=await d(e=>{let t=new URLSearchParams(h.toString());return t.set("page",String(e)),t.set("pageSize",String(A.A)),t.set("view","print"),S.k.get(`/api/error-items/list?${t.toString()}`)});v(e),q(new Set(e.map(e=>e.id)))}catch(e){k.V.error("[PrintPreview]","Failed to fetch items",{error:e})}finally{j(!1)}},[h]);(0,s.useEffect)(()=>{U()},[U]);let B=(0,s.useRef)(null),[D,W]=(0,s.useState)(null),K=async()=>{B.current&&await C(B.current,{onProgress:(e,t)=>W({loaded:e,total:t})}),W(null),window.print()},{groups:V}=(0,M.f)(),H=(0,s.useMemo)(()=>new Map(V.map(e=>[e.id,e.name])),[V]),J=(0,s.useMemo)(()=>w.filter(e=>L.has(e.id)),[w,L]),Z=(0,s.useMemo)(()=>new Map(J.map((e,t)=>[e.id,t+1])),[J]),G=(e=$.showAnswers,i=$.showAnalysis,!e&&!i),X=(l=w.length,(o=J.length)===l?String(l):`${o}/${l}`),Y=(c=w.length,u=J.length,0===c?"noItems":0===u?"noSelection":null),ee=(0,s.useCallback)(e=>{q(t=>{let s=new Set(t);return s.has(e)?s.delete(e):s.add(e),s})},[]),et=(0,s.useCallback)(e=>{q(t=>{let s=new Set(t);return s.delete(e),s})},[]);return b?(0,t.jsx)("div",{className:"min-h-screen flex items-center justify-center",children:(0,t.jsx)("p",{className:"text-muted-foreground",children:f.common.loading})}):(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("div",{className:"print:hidden sticky top-0 z-10 bg-background border-b p-3 sm:p-4 shadow-sm",children:(0,t.jsxs)("div",{className:"max-w-6xl mx-auto space-y-3",children:[(0,t.jsxs)("div",{className:"flex items-center gap-3",children:[(0,t.jsx)(a.f,{fallbackUrl:"/notebooks"}),(0,t.jsxs)("h1",{className:"text-lg sm:text-xl font-bold flex-1",children:[f.printPreview?.title||"Print Preview"," (",X," ",f.notebooks?.items||"items",")"]}),(0,t.jsx)(r.f,{onClick:K,size:"sm",className:"whitespace-nowrap",disabled:0===J.length||null!==D,children:D?f.printPreview.loadingImages.replace("{loaded}",String(D.loaded)).replace("{total}",String(D.total)):f.printPreview?.printButton||"Print / Save PDF"})]}),(0,t.jsx)(g,{options:$,onChange:e=>F(t=>{let s={...t,...e};try{localStorage.setItem(T,JSON.stringify(s))}catch{}return s}),hasCustomSpaces:Object.keys(O).length>0,onResetCustomSpaces:E}),_&&(0,t.jsx)("p",{className:"text-xs text-destructive",children:f.exam.answerSpaceSaveFailed})]})}),(0,t.jsx)("div",{className:"print:hidden border-b p-3 sm:p-4",children:(0,t.jsx)("div",{className:"max-w-6xl mx-auto",children:(0,t.jsx)(p,{items:w,selectedIds:L,selectedCount:J.length,printNumbers:Z,onToggle:ee,onSelectionChange:q})})}),(0,t.jsxs)("div",{ref:B,className:"max-w-4xl mx-auto p-8 print:p-0",children:[J.map((e,s)=>(0,t.jsx)(y,{item:e,index:s,options:$,reserveAnswerSpace:G,customAnswerSpacePx:O[e.id],onCustomAnswerSpaceChange:Q,paperGroupName:e.paperLevel?H.get(e.paperLevel)??e.paperLevel:null,onRemove:et},e.id)),Y&&(0,t.jsx)("div",{className:"text-center py-12 text-muted-foreground",children:"noSelection"===Y?f.printPreview?.noSelection||"No items selected":f.printPreview?.noItems||"No matching error items"})]})]})}e.s(["default",0,function(){let{t:e}=(0,m.b)();return(0,t.jsx)(s.Suspense,{fallback:(0,t.jsx)("div",{className:"min-h-screen flex items-center justify-center",children:e.common.loading}),children:(0,t.jsx)($,{})})}],666944)},84583,920808,e=>{var t=e.i(843476),s=e.i(519455),n=e.i(111110),r=e.i(122330);e.s(["f",0,function({effectivePx:e,isCustom:a,onChange:i,onReset:l}){let{t:o}=(0,n.b)(),c=(0,r.O)(e);return(0,t.jsxs)("div",{className:"answer-space-controls print:hidden flex flex-wrap items-center gap-2 text-xs text-muted-foreground mt-2 pt-1",children:[(0,t.jsxs)("span",{children:[o.exam.questionAnswerSpace,": ",c,"px"]}),(0,t.jsx)(s.f,{type:"button",variant:"outline",size:"sm",className:"h-6 px-2 text-xs","aria-label":o.exam.decreaseAnswerSpace,disabled:c<=r.r,onClick:()=>i((0,r.O)(c-r.W)),children:"-"}),(0,t.jsx)("input",{type:"range",min:r.r,max:r.R,step:10,value:c,"aria-label":o.exam.questionAnswerSpaceSlider,onChange:e=>i((0,r.O)(Number(e.target.value))),className:"w-24 sm:w-32 accent-primary"}),(0,t.jsx)(s.f,{type:"button",variant:"outline",size:"sm",className:"h-6 px-2 text-xs","aria-label":o.exam.increaseAnswerSpace,disabled:c>=r.R,onClick:()=>i((0,r.O)(c+r.W)),children:"+"}),a&&(0,t.jsx)(s.f,{type:"button",variant:"ghost",size:"sm",className:"h-6 px-2 text-xs",onClick:l,children:o.exam.resetQuestionAnswerSpace})]})}],84583);var a=e.i(271645),i=e.i(511445),l=e.i(369939);let o=["A","B","C","D"];function c(e){return RegExp(`^(?:${e}\\s*[..::、]|[((]${e}[))])`)}function m(e){let t=e.replace(/\$+/g,"").replace(/\\[a-zA-Z]+/g,"").replace(/[{}^_\\]/g,""),s=0;for(let e of t)s+=e.codePointAt(0)>=11904?2:1;return s}let u={4:"grid-cols-2 sm:grid-cols-4 print:grid-cols-4",2:"grid-cols-1 sm:grid-cols-2 print:grid-cols-2",1:"grid-cols-1"};e.s(["f",0,function({content:e}){let s=(0,a.useMemo)(()=>(function(e){if(!e)return null;let{masked:t,segments:s}=(0,l.F)(e.replace(/\\n/g,"\n")),n=(0,l.n)(t,"\n").split("\n"),r=n.findIndex(e=>c("A").test(e.trim()));if(r<0)return null;let a=[],i=0,u=r;for(let e=r;e<n.length&&i<o.length;e+=1){let t=n[e].trim();if(!t)continue;if(!c(o[i]).test(t))break;let s=function(e,t){let s=[],n=e,r=t;for(;r<o.length;){var a;let e=n.match(c(o[r]))[0];n=n.slice(e.length);let t=r+1<o.length?n.match((a=o[r+1],RegExp(`\\s(?:${a}\\s*[..::、]|[((]${a}[))])`))):null,i=t?.index??n.length;if(s.push({label:e.trim(),content:n.slice(0,i).trim()}),r+=1,!t)break;n=n.slice(i).trimStart()}return{options:s,next:r}}(t,i);a.push(...s.options),i=s.next,u=e+1}if(a.length<3||u-r<2)return null;let d=n.slice(u).join("\n").trim();if(i<o.length&&d)return null;let p=e=>(0,l.i)(e,s),x=a.map(e=>({label:e.label,content:p(e.content)}));return{stem:p(n.slice(0,r).join("\n").trim()),options:x,after:p(d),columns:function(e){if(e.some(({content:e})=>/!\[|\|/.test(e)))return 1;let t=Math.max(...e.map(({label:e,content:t})=>m(e)+1+m(t)));return t<=14?4:t<=34?2:1}(x)}})(e),[e]);return s?(0,t.jsxs)(t.Fragment,{children:[s.stem&&(0,t.jsx)(i.f,{content:s.stem}),(0,t.jsx)("div",{className:`choice-options mb-3 grid gap-x-6 gap-y-1 ${u[s.columns]}`,children:s.options.map(e=>(0,t.jsxs)("div",{className:"flex min-w-0 items-baseline gap-1.5",children:[(0,t.jsx)("span",{className:"shrink-0",children:e.label}),(0,t.jsx)(i.f,{content:e.content,className:"flex-1 [&_p]:mb-0"})]},e.label))}),s.after&&(0,t.jsx)(i.f,{content:s.after})]}):(0,t.jsx)(i.f,{content:e})}],920808)},149704,e=>{var t=e.i(843476),s=e.i(111110),n=e.i(398019),r=e.i(184110),a=e.i(975157);let i={left:"mr-auto",center:"mx-auto",right:"ml-auto"};e.s(["f",0,function({svg:e,scale:l,align:o,className:c}){let{t:m}=(0,s.b)();if(!e)return null;let u=(0,r.V)(l),d=(0,r.o)(o);return(0,t.jsx)("figure",{className:(0,a.f)("question-figure my-3",c),children:(0,t.jsx)("img",{src:(0,n.d)(e),alt:m.figure.alt,className:(0,a.f)(i[d],"block h-auto max-w-full rounded border bg-white p-2"),style:{..."left"===d?{marginLeft:0,marginRight:"auto"}:"right"===d?{marginLeft:"auto",marginRight:0}:{},maxHeight:360,zoom:u/100,maxWidth:`${Math.min(u,100)}%`}})})}])},590546,e=>{var t=e.i(843476),s=e.i(618566),n=e.i(519455),r=e.i(711241);e.s(["f",0,function({fallbackUrl:e,className:a}){let i=(0,s.useRouter)();return(0,t.jsx)(n.f,{variant:"ghost",size:"icon",onClick:()=>{i.push(e)},className:a,children:(0,t.jsx)(r.f,{className:"h-5 w-5"})})}])},469817,e=>{e.s(["$",0,18,"u",0,5,"A",0,200])},122330,e=>{let t=["auto","none","small","medium","large"],s={none:0,small:60,medium:120,large:240},n={choice:12,judgment:12,fill:16,solution:240};function r(e){return Number.isFinite(e)?Math.min(600,Math.max(0,Math.round(e))):0}let a=/(?:(?:^|[\s*+\-))::。??;;,,_])([A-D])\s*[..::]|(?:^|\s{2,}|[))::。??])([A-D])\s*、|[((]([A-D])[))])/gm,i=/判断(?:下列|以下|正误|对错|题)|对的(?:打|画)|错的(?:打|画)|true\s*(?:or|\/)\s*false/i,l=/_{2,}|(?:\\_){2,}|\\underline|\\rule\b|\\hspace\b|(\s*)|【\s*】|\[\s+\]|(?<![A-Za-z0-9_])\(\s*\)|[==]\s*[。??]?\s*$|填空/,o=/求证|证明[::,,]|写出(?:解题|计算|推导|推理)?过程|解答下列|试说明理由|请说明理由/,c=/(\s*(\d{1,2})\s*)/g,m=/(?:^|[\n。;;::??!!]\s*)\(\s*(\d{1,2})\s*\)/g;function u(e){let t=new Set;for(let s of e.matchAll(c))t.add(s[1]);for(let s of e.matchAll(m))t.add(s[1]);return Math.max(1,t.size)}e.s(["p",0,"exam-print-answer-space","W",0,20,"q",0,"auto","R",0,600,"r",0,0,"O",0,r,"I",0,function(e){return"string"==typeof e&&t.includes(e)},"T",0,function(e){return"number"!=typeof e||!Number.isInteger(e)||e<0||e>600?null:e},"z",0,function(e,t,c){let m;if("number"==typeof c&&Number.isFinite(c))return r(c);if("auto"!==e)return s[e];let d=(m=new Set(Array.from(t.matchAll(a),e=>e[1]??e[2]??e[3]))).has("A")&&m.has("B")&&m.has("C")?"choice":i.test(t)?"judgment":u(t)>1||o.test(t)?"solution":l.test(t)?"fill":"solution";if("solution"!==d)return n[d];let p=(u(t)-1)*120;return Math.min(560,n.solution+p)}])},184110,e=>{let t=["left","center","right"],s="center";function n(e){return"number"==typeof e&&Number.isInteger(e)&&e>=10&&e<=200}e.s(["E",0,s,"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:s},"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)}`}])},442861,e=>{var t=e.i(271645),s=e.i(122330),n=e.i(201276);e.s(["f",0,function(e,r){let[a,i]=(0,t.useState)({}),[l,o]=(0,t.useState)(!1),c=(0,t.useRef)(new Map),m=(0,t.useRef)(null),u=(0,t.useRef)(r);(0,t.useEffect)(()=>{u.current=r},[r]);let d=(0,t.useMemo)(()=>{let t={};for(let n of e){let e=n.id in a?a[n.id]:(0,s.T)(n.answerSpacePx);"number"==typeof e&&(t[n.id]=e)}return t},[e,a]),p=(0,t.useCallback)(()=>{if(m.current&&(clearTimeout(m.current),m.current=null),0===c.current.size)return;let e=Array.from(c.current,([e,t])=>({id:e,answerSpacePx:t}));c.current.clear(),u.current(e).then(()=>o(!1)).catch(e=>{o(!0),n.V.error("[AnswerSpace]","Failed to save answer space",{error:e})})},[]);(0,t.useEffect)(()=>p,[p]);let x=(0,t.useCallback)((e,t)=>{if(0!==e.length){for(let{id:t,answerSpacePx:s}of(i(t=>{let s={...t};for(let{id:t,answerSpacePx:n}of e)s[t]=n;return s}),e))c.current.set(t,s);if(t)return void p();m.current&&clearTimeout(m.current),m.current=setTimeout(p,600)}},[p]),h=(0,t.useCallback)((e,t)=>{x([{id:e,answerSpacePx:t}],null===t)},[x]),g=(0,t.useCallback)(()=>{x(Object.keys(d).map(e=>({id:e,answerSpacePx:null})),!0)},[d,x]);return{customSpaces:d,setSpace:h,resetAll:g,saveFailed:l}}])},35209,e=>{var t=e.i(271645),s=e.i(111110);e.s(["f",0,function(...e){let{t:n}=(0,s.b)(),r=[n.pageTitle.base,...e.map(e=>"string"==typeof e?e.trim():"").filter(e=>e.length>0)].join("-");(0,t.useEffect)(()=>{document.title=r},[r])}])}])})();