wrong-notebook 2026.11.2-2 → 2026.11.3-1

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 (673) hide show
  1. package/.next/BUILD_ID +1 -1
  2. package/.next/app-path-routes-manifest.json +15 -0
  3. package/.next/build-manifest.json +36 -3
  4. package/.next/prerender-manifest.json +3 -3
  5. package/.next/routes-manifest.json +112 -0
  6. package/.next/server/app/_global-error/page.js.nft.json +1 -1
  7. package/.next/server/app/_global-error/page_client-reference-manifest.js +1 -1
  8. package/.next/server/app/_global-error.html +1 -1
  9. package/.next/server/app/_global-error.rsc +1 -1
  10. package/.next/server/app/_global-error.segments/__PAGE__.segment.rsc +1 -1
  11. package/.next/server/app/_global-error.segments/_full.segment.rsc +1 -1
  12. package/.next/server/app/_global-error.segments/_tree.segment.rsc +1 -1
  13. package/.next/server/app/_not-found/page.js.nft.json +1 -1
  14. package/.next/server/app/_not-found/page_client-reference-manifest.js +1 -1
  15. package/.next/server/app/admin/page.js.nft.json +1 -1
  16. package/.next/server/app/admin/page_client-reference-manifest.js +1 -1
  17. package/.next/server/app/admin/user/[id]/page.js.nft.json +1 -1
  18. package/.next/server/app/admin/user/[id]/page_client-reference-manifest.js +1 -1
  19. package/.next/server/app/api/admin/cnm-tags/route.js +6 -5
  20. package/.next/server/app/api/admin/cnm-tags/route.js.nft.json +1 -1
  21. package/.next/server/app/api/admin/dashboard/route.js +16 -15
  22. package/.next/server/app/api/admin/dashboard/route.js.nft.json +1 -1
  23. package/.next/server/app/api/admin/debug-logs/export/route.js +5 -4
  24. package/.next/server/app/api/admin/debug-logs/export/route.js.nft.json +1 -1
  25. package/.next/server/app/api/admin/debug-logs/route.js +5 -4
  26. package/.next/server/app/api/admin/debug-logs/route.js.nft.json +1 -1
  27. package/.next/server/app/api/admin/migrate-tags/route.js +5 -4
  28. package/.next/server/app/api/admin/migrate-tags/route.js.nft.json +1 -1
  29. package/.next/server/app/api/admin/system-reset/route.js +5 -4
  30. package/.next/server/app/api/admin/system-reset/route.js.nft.json +1 -1
  31. package/.next/server/app/api/admin/users/[id]/detail/route.js +16 -15
  32. package/.next/server/app/api/admin/users/[id]/detail/route.js.nft.json +1 -1
  33. package/.next/server/app/api/admin/users/[id]/route.js +5 -4
  34. package/.next/server/app/api/admin/users/[id]/route.js.nft.json +1 -1
  35. package/.next/server/app/api/admin/users/route.js +5 -4
  36. package/.next/server/app/api/admin/users/route.js.nft.json +1 -1
  37. package/.next/server/app/api/ai/models/route.js +11 -10
  38. package/.next/server/app/api/ai/models/route.js.nft.json +1 -1
  39. package/.next/server/app/api/ai/test/route.js +10 -9
  40. package/.next/server/app/api/ai/test/route.js.nft.json +1 -1
  41. package/.next/server/app/api/analytics/route.js +12 -11
  42. package/.next/server/app/api/analytics/route.js.nft.json +1 -1
  43. package/.next/server/app/api/analyze/route.js +16 -14
  44. package/.next/server/app/api/analyze/route.js.nft.json +1 -1
  45. package/.next/server/app/api/auth/[...nextauth]/route.js +4 -3
  46. package/.next/server/app/api/auth/[...nextauth]/route.js.nft.json +1 -1
  47. package/.next/server/app/api/error-items/[id]/delete/route.js +5 -4
  48. package/.next/server/app/api/error-items/[id]/delete/route.js.nft.json +1 -1
  49. package/.next/server/app/api/error-items/[id]/figure/route.js +14 -13
  50. package/.next/server/app/api/error-items/[id]/figure/route.js.nft.json +1 -1
  51. package/.next/server/app/api/error-items/[id]/fix-latex/route.js +16 -15
  52. package/.next/server/app/api/error-items/[id]/fix-latex/route.js.nft.json +1 -1
  53. package/.next/server/app/api/error-items/[id]/geogebra/route.js +12 -11
  54. package/.next/server/app/api/error-items/[id]/geogebra/route.js.nft.json +1 -1
  55. package/.next/server/app/api/error-items/[id]/image/route.js +4 -3
  56. package/.next/server/app/api/error-items/[id]/image/route.js.nft.json +1 -1
  57. package/.next/server/app/api/error-items/[id]/notes/route.js +5 -4
  58. package/.next/server/app/api/error-items/[id]/notes/route.js.nft.json +1 -1
  59. package/.next/server/app/api/error-items/[id]/practice-records/route.js +4 -3
  60. package/.next/server/app/api/error-items/[id]/practice-records/route.js.nft.json +1 -1
  61. package/.next/server/app/api/error-items/[id]/reanswer/route.js +14 -13
  62. package/.next/server/app/api/error-items/[id]/reanswer/route.js.nft.json +1 -1
  63. package/.next/server/app/api/error-items/[id]/retag/route.js +15 -14
  64. package/.next/server/app/api/error-items/[id]/retag/route.js.nft.json +1 -1
  65. package/.next/server/app/api/error-items/[id]/route.js +6 -5
  66. package/.next/server/app/api/error-items/[id]/route.js.nft.json +1 -1
  67. package/.next/server/app/api/error-items/[id]/svg-animation/narration/route.js +14 -13
  68. package/.next/server/app/api/error-items/[id]/svg-animation/narration/route.js.nft.json +1 -1
  69. package/.next/server/app/api/error-items/[id]/svg-animation/route.js +14 -13
  70. package/.next/server/app/api/error-items/[id]/svg-animation/route.js.nft.json +1 -1
  71. package/.next/server/app/api/error-items/answer-space/route/app-paths-manifest.json +3 -0
  72. package/.next/server/app/api/error-items/answer-space/route/build-manifest.json +12 -0
  73. package/.next/server/app/api/error-items/answer-space/route/server-reference-manifest.json +4 -0
  74. package/.next/server/app/api/error-items/answer-space/route.js +14 -0
  75. package/.next/server/app/api/error-items/answer-space/route.js.map +5 -0
  76. package/.next/server/app/api/error-items/answer-space/route.js.nft.json +1 -0
  77. package/.next/server/app/api/error-items/answer-space/route_client-reference-manifest.js +3 -0
  78. package/.next/server/app/api/error-items/batch-delete/route.js +5 -4
  79. package/.next/server/app/api/error-items/batch-delete/route.js.nft.json +1 -1
  80. package/.next/server/app/api/error-items/clear/route.js +5 -4
  81. package/.next/server/app/api/error-items/clear/route.js.nft.json +1 -1
  82. package/.next/server/app/api/error-items/list/route.js +6 -5
  83. package/.next/server/app/api/error-items/list/route.js.nft.json +1 -1
  84. package/.next/server/app/api/error-items/route.js +20 -18
  85. package/.next/server/app/api/error-items/route.js.nft.json +1 -1
  86. package/.next/server/app/api/error-items/short/[shortId]/route.js +4 -3
  87. package/.next/server/app/api/error-items/short/[shortId]/route.js.nft.json +1 -1
  88. package/.next/server/app/api/error-items/similarity/route.js +6 -5
  89. package/.next/server/app/api/error-items/similarity/route.js.nft.json +1 -1
  90. package/.next/server/app/api/exams/[id]/questions/[questionId]/regenerate/route.js +15 -14
  91. package/.next/server/app/api/exams/[id]/questions/[questionId]/regenerate/route.js.nft.json +1 -1
  92. package/.next/server/app/api/exams/[id]/results/route.js +17 -16
  93. package/.next/server/app/api/exams/[id]/results/route.js.nft.json +1 -1
  94. package/.next/server/app/api/exams/[id]/retry/route.js +16 -15
  95. package/.next/server/app/api/exams/[id]/retry/route.js.nft.json +1 -1
  96. package/.next/server/app/api/exams/[id]/route.js +17 -15
  97. package/.next/server/app/api/exams/[id]/route.js.nft.json +1 -1
  98. package/.next/server/app/api/exams/route.js +17 -16
  99. package/.next/server/app/api/exams/route.js.nft.json +1 -1
  100. package/.next/server/app/api/export/route.js +10 -8
  101. package/.next/server/app/api/export/route.js.nft.json +1 -1
  102. package/.next/server/app/api/geogebra-analyze/route.js +13 -12
  103. package/.next/server/app/api/geogebra-analyze/route.js.nft.json +1 -1
  104. package/.next/server/app/api/health/route.js +3 -2
  105. package/.next/server/app/api/health/route.js.nft.json +1 -1
  106. package/.next/server/app/api/import/route.js +20 -18
  107. package/.next/server/app/api/import/route.js.nft.json +1 -1
  108. package/.next/server/app/api/import-batches/[id]/confirm-all/route/app-paths-manifest.json +3 -0
  109. package/.next/server/app/api/import-batches/[id]/confirm-all/route/build-manifest.json +12 -0
  110. package/.next/server/app/api/import-batches/[id]/confirm-all/route/server-reference-manifest.json +4 -0
  111. package/.next/server/app/api/import-batches/[id]/confirm-all/route.js +34 -0
  112. package/.next/server/app/api/import-batches/[id]/confirm-all/route.js.map +5 -0
  113. package/.next/server/app/api/import-batches/[id]/confirm-all/route.js.nft.json +1 -0
  114. package/.next/server/app/api/import-batches/[id]/confirm-all/route_client-reference-manifest.js +3 -0
  115. package/.next/server/app/api/import-batches/[id]/read/route/app-paths-manifest.json +3 -0
  116. package/.next/server/app/api/import-batches/[id]/read/route/build-manifest.json +12 -0
  117. package/.next/server/app/api/import-batches/[id]/read/route/server-reference-manifest.json +4 -0
  118. package/.next/server/app/api/import-batches/[id]/read/route.js +34 -0
  119. package/.next/server/app/api/import-batches/[id]/read/route.js.map +5 -0
  120. package/.next/server/app/api/import-batches/[id]/read/route.js.nft.json +1 -0
  121. package/.next/server/app/api/import-batches/[id]/read/route_client-reference-manifest.js +3 -0
  122. package/.next/server/app/api/import-batches/[id]/retry/route/app-paths-manifest.json +3 -0
  123. package/.next/server/app/api/import-batches/[id]/retry/route/build-manifest.json +12 -0
  124. package/.next/server/app/api/import-batches/[id]/retry/route/server-reference-manifest.json +4 -0
  125. package/.next/server/app/api/import-batches/[id]/retry/route.js +34 -0
  126. package/.next/server/app/api/import-batches/[id]/retry/route.js.map +5 -0
  127. package/.next/server/app/api/import-batches/[id]/retry/route.js.nft.json +1 -0
  128. package/.next/server/app/api/import-batches/[id]/retry/route_client-reference-manifest.js +3 -0
  129. package/.next/server/app/api/import-batches/[id]/route/app-paths-manifest.json +3 -0
  130. package/.next/server/app/api/import-batches/[id]/route/build-manifest.json +12 -0
  131. package/.next/server/app/api/import-batches/[id]/route/server-reference-manifest.json +4 -0
  132. package/.next/server/app/api/import-batches/[id]/route.js +34 -0
  133. package/.next/server/app/api/import-batches/[id]/route.js.map +5 -0
  134. package/.next/server/app/api/import-batches/[id]/route.js.nft.json +1 -0
  135. package/.next/server/app/api/import-batches/[id]/route_client-reference-manifest.js +3 -0
  136. package/.next/server/app/api/import-batches/[id]/start/route/app-paths-manifest.json +3 -0
  137. package/.next/server/app/api/import-batches/[id]/start/route/build-manifest.json +12 -0
  138. package/.next/server/app/api/import-batches/[id]/start/route/server-reference-manifest.json +4 -0
  139. package/.next/server/app/api/import-batches/[id]/start/route.js +34 -0
  140. package/.next/server/app/api/import-batches/[id]/start/route.js.map +5 -0
  141. package/.next/server/app/api/import-batches/[id]/start/route.js.nft.json +1 -0
  142. package/.next/server/app/api/import-batches/[id]/start/route_client-reference-manifest.js +3 -0
  143. package/.next/server/app/api/import-batches/route/app-paths-manifest.json +3 -0
  144. package/.next/server/app/api/import-batches/route/build-manifest.json +12 -0
  145. package/.next/server/app/api/import-batches/route/server-reference-manifest.json +4 -0
  146. package/.next/server/app/api/import-batches/route.js +34 -0
  147. package/.next/server/app/api/import-batches/route.js.map +5 -0
  148. package/.next/server/app/api/import-batches/route.js.nft.json +1 -0
  149. package/.next/server/app/api/import-batches/route_client-reference-manifest.js +3 -0
  150. package/.next/server/app/api/import-tasks/[id]/confirm/route/app-paths-manifest.json +3 -0
  151. package/.next/server/app/api/import-tasks/[id]/confirm/route/build-manifest.json +12 -0
  152. package/.next/server/app/api/import-tasks/[id]/confirm/route/server-reference-manifest.json +4 -0
  153. package/.next/server/app/api/import-tasks/[id]/confirm/route.js +33 -0
  154. package/.next/server/app/api/import-tasks/[id]/confirm/route.js.map +5 -0
  155. package/.next/server/app/api/import-tasks/[id]/confirm/route.js.nft.json +1 -0
  156. package/.next/server/app/api/import-tasks/[id]/confirm/route_client-reference-manifest.js +3 -0
  157. package/.next/server/app/api/import-tasks/[id]/read/route/app-paths-manifest.json +3 -0
  158. package/.next/server/app/api/import-tasks/[id]/read/route/build-manifest.json +12 -0
  159. package/.next/server/app/api/import-tasks/[id]/read/route/server-reference-manifest.json +4 -0
  160. package/.next/server/app/api/import-tasks/[id]/read/route.js +33 -0
  161. package/.next/server/app/api/import-tasks/[id]/read/route.js.map +5 -0
  162. package/.next/server/app/api/import-tasks/[id]/read/route.js.nft.json +1 -0
  163. package/.next/server/app/api/import-tasks/[id]/read/route_client-reference-manifest.js +3 -0
  164. package/.next/server/app/api/import-tasks/[id]/retry/route/app-paths-manifest.json +3 -0
  165. package/.next/server/app/api/import-tasks/[id]/retry/route/build-manifest.json +12 -0
  166. package/.next/server/app/api/import-tasks/[id]/retry/route/server-reference-manifest.json +4 -0
  167. package/.next/server/app/api/import-tasks/[id]/retry/route.js +33 -0
  168. package/.next/server/app/api/import-tasks/[id]/retry/route.js.map +5 -0
  169. package/.next/server/app/api/import-tasks/[id]/retry/route.js.nft.json +1 -0
  170. package/.next/server/app/api/import-tasks/[id]/retry/route_client-reference-manifest.js +3 -0
  171. package/.next/server/app/api/import-tasks/[id]/route/app-paths-manifest.json +3 -0
  172. package/.next/server/app/api/import-tasks/[id]/route/build-manifest.json +12 -0
  173. package/.next/server/app/api/import-tasks/[id]/route/server-reference-manifest.json +4 -0
  174. package/.next/server/app/api/import-tasks/[id]/route.js +33 -0
  175. package/.next/server/app/api/import-tasks/[id]/route.js.map +5 -0
  176. package/.next/server/app/api/import-tasks/[id]/route.js.nft.json +1 -0
  177. package/.next/server/app/api/import-tasks/[id]/route_client-reference-manifest.js +3 -0
  178. package/.next/server/app/api/import-tasks/route/app-paths-manifest.json +3 -0
  179. package/.next/server/app/api/import-tasks/route/build-manifest.json +12 -0
  180. package/.next/server/app/api/import-tasks/route/server-reference-manifest.json +4 -0
  181. package/.next/server/app/api/import-tasks/route.js +34 -0
  182. package/.next/server/app/api/import-tasks/route.js.map +5 -0
  183. package/.next/server/app/api/import-tasks/route.js.nft.json +1 -0
  184. package/.next/server/app/api/import-tasks/route_client-reference-manifest.js +3 -0
  185. package/.next/server/app/api/initialize/route.js +5 -4
  186. package/.next/server/app/api/initialize/route.js.nft.json +1 -1
  187. package/.next/server/app/api/logs/frontend/route.js +4 -3
  188. package/.next/server/app/api/logs/frontend/route.js.nft.json +1 -1
  189. package/.next/server/app/api/minimax-code/checkin/route.js +6 -5
  190. package/.next/server/app/api/minimax-code/checkin/route.js.nft.json +1 -1
  191. package/.next/server/app/api/minimax-code/login/route.js +5 -4
  192. package/.next/server/app/api/minimax-code/login/route.js.nft.json +1 -1
  193. package/.next/server/app/api/minimax-code/route.js +5 -4
  194. package/.next/server/app/api/minimax-code/route.js.nft.json +1 -1
  195. package/.next/server/app/api/notebooks/[id]/retag/route.js +13 -12
  196. package/.next/server/app/api/notebooks/[id]/retag/route.js.nft.json +1 -1
  197. package/.next/server/app/api/notebooks/[id]/route.js +5 -4
  198. package/.next/server/app/api/notebooks/[id]/route.js.nft.json +1 -1
  199. package/.next/server/app/api/notebooks/route.js +5 -4
  200. package/.next/server/app/api/notebooks/route.js.nft.json +1 -1
  201. package/.next/server/app/api/openclaw/batch-upload/route.js +17 -16
  202. package/.next/server/app/api/openclaw/batch-upload/route.js.nft.json +1 -1
  203. package/.next/server/app/api/paper-groups/[id]/route.js +5 -4
  204. package/.next/server/app/api/paper-groups/[id]/route.js.nft.json +1 -1
  205. package/.next/server/app/api/paper-groups/route.js +6 -5
  206. package/.next/server/app/api/paper-groups/route.js.nft.json +1 -1
  207. package/.next/server/app/api/practice/generate/route.js +14 -13
  208. package/.next/server/app/api/practice/generate/route.js.nft.json +1 -1
  209. package/.next/server/app/api/practice/grade/route.js +13 -12
  210. package/.next/server/app/api/practice/grade/route.js.nft.json +1 -1
  211. package/.next/server/app/api/practice/record/[id]/route.js +11 -10
  212. package/.next/server/app/api/practice/record/[id]/route.js.nft.json +1 -1
  213. package/.next/server/app/api/practice/record/route.js +13 -12
  214. package/.next/server/app/api/practice/record/route.js.nft.json +1 -1
  215. package/.next/server/app/api/reanswer/route.js +15 -14
  216. package/.next/server/app/api/reanswer/route.js.nft.json +1 -1
  217. package/.next/server/app/api/register/route.js +6 -5
  218. package/.next/server/app/api/register/route.js.nft.json +1 -1
  219. package/.next/server/app/api/register/status/route.js +5 -4
  220. package/.next/server/app/api/register/status/route.js.nft.json +1 -1
  221. package/.next/server/app/api/requests/[id]/route.js +6 -5
  222. package/.next/server/app/api/requests/[id]/route.js.nft.json +1 -1
  223. package/.next/server/app/api/review/due/route.js +15 -14
  224. package/.next/server/app/api/review/due/route.js.nft.json +1 -1
  225. package/.next/server/app/api/settings/route.js +9 -8
  226. package/.next/server/app/api/settings/route.js.nft.json +1 -1
  227. package/.next/server/app/api/setup/route.js +6 -5
  228. package/.next/server/app/api/setup/route.js.nft.json +1 -1
  229. package/.next/server/app/api/stats/practice/clear/route.js +5 -4
  230. package/.next/server/app/api/stats/practice/clear/route.js.nft.json +1 -1
  231. package/.next/server/app/api/stats/practice/route.js +5 -4
  232. package/.next/server/app/api/stats/practice/route.js.nft.json +1 -1
  233. package/.next/server/app/api/tags/route.js +4 -3
  234. package/.next/server/app/api/tags/route.js.nft.json +1 -1
  235. package/.next/server/app/api/tags/stats/route.js +5 -4
  236. package/.next/server/app/api/tags/stats/route.js.nft.json +1 -1
  237. package/.next/server/app/api/tags/suggestions/route.js +4 -3
  238. package/.next/server/app/api/tags/suggestions/route.js.nft.json +1 -1
  239. package/.next/server/app/api/tasks/route.js +5 -4
  240. package/.next/server/app/api/tasks/route.js.nft.json +1 -1
  241. package/.next/server/app/api/tts/[id]/route.js +8 -7
  242. package/.next/server/app/api/tts/[id]/route.js.nft.json +1 -1
  243. package/.next/server/app/api/tts/batch/route.js +12 -11
  244. package/.next/server/app/api/tts/batch/route.js.nft.json +1 -1
  245. package/.next/server/app/api/tts/route.js +8 -7
  246. package/.next/server/app/api/tts/route.js.nft.json +1 -1
  247. package/.next/server/app/api/tts/status/route.js +10 -9
  248. package/.next/server/app/api/tts/status/route.js.nft.json +1 -1
  249. package/.next/server/app/api/user/route.js +14 -13
  250. package/.next/server/app/api/user/route.js.nft.json +1 -1
  251. package/.next/server/app/api/version/route.js +3 -2
  252. package/.next/server/app/api/version/route.js.nft.json +1 -1
  253. package/.next/server/app/error-items/[id]/page.js.nft.json +1 -1
  254. package/.next/server/app/error-items/[id]/page_client-reference-manifest.js +1 -1
  255. package/.next/server/app/exams/[id]/page.js.nft.json +1 -1
  256. package/.next/server/app/exams/[id]/page_client-reference-manifest.js +1 -1
  257. package/.next/server/app/exams/[id]/print/page.js.nft.json +1 -1
  258. package/.next/server/app/exams/[id]/print/page_client-reference-manifest.js +1 -1
  259. package/.next/server/app/exams/page.js.nft.json +1 -1
  260. package/.next/server/app/exams/page_client-reference-manifest.js +1 -1
  261. package/.next/server/app/favicon.ico/route.js +3 -2
  262. package/.next/server/app/favicon.ico/route.js.nft.json +1 -1
  263. package/.next/server/app/import-batches/[id]/page/app-paths-manifest.json +3 -0
  264. package/.next/server/app/import-batches/[id]/page/build-manifest.json +22 -0
  265. package/.next/server/app/import-batches/[id]/page/next-font-manifest.json +11 -0
  266. package/.next/server/app/import-batches/[id]/page/react-loadable-manifest.json +1 -0
  267. package/.next/server/app/import-batches/[id]/page/server-reference-manifest.json +4 -0
  268. package/.next/server/app/import-batches/[id]/page.js +14 -0
  269. package/.next/server/app/import-batches/[id]/page.js.map +5 -0
  270. package/.next/server/app/import-batches/[id]/page.js.nft.json +1 -0
  271. package/.next/server/app/import-batches/[id]/page_client-reference-manifest.js +3 -0
  272. package/.next/server/app/import-tasks/[id]/page/app-paths-manifest.json +3 -0
  273. package/.next/server/app/import-tasks/[id]/page/build-manifest.json +22 -0
  274. package/.next/server/app/import-tasks/[id]/page/next-font-manifest.json +11 -0
  275. package/.next/server/app/import-tasks/[id]/page/react-loadable-manifest.json +1 -0
  276. package/.next/server/app/import-tasks/[id]/page/server-reference-manifest.json +4 -0
  277. package/.next/server/app/import-tasks/[id]/page.js +14 -0
  278. package/.next/server/app/import-tasks/[id]/page.js.map +5 -0
  279. package/.next/server/app/import-tasks/[id]/page.js.nft.json +1 -0
  280. package/.next/server/app/import-tasks/[id]/page_client-reference-manifest.js +3 -0
  281. package/.next/server/app/import-tasks/page/app-paths-manifest.json +3 -0
  282. package/.next/server/app/import-tasks/page/build-manifest.json +22 -0
  283. package/.next/server/app/import-tasks/page/next-font-manifest.json +11 -0
  284. package/.next/server/app/import-tasks/page/react-loadable-manifest.json +1 -0
  285. package/.next/server/app/import-tasks/page/server-reference-manifest.json +4 -0
  286. package/.next/server/app/import-tasks/page.js +14 -0
  287. package/.next/server/app/import-tasks/page.js.map +5 -0
  288. package/.next/server/app/import-tasks/page.js.nft.json +1 -0
  289. package/.next/server/app/import-tasks/page_client-reference-manifest.js +3 -0
  290. package/.next/server/app/initialize/page.js.nft.json +1 -1
  291. package/.next/server/app/initialize/page_client-reference-manifest.js +1 -1
  292. package/.next/server/app/login/page.js.nft.json +1 -1
  293. package/.next/server/app/login/page_client-reference-manifest.js +1 -1
  294. package/.next/server/app/manifest.webmanifest/route.js +3 -2
  295. package/.next/server/app/manifest.webmanifest/route.js.nft.json +1 -1
  296. package/.next/server/app/notebooks/[id]/add/page.js.nft.json +1 -1
  297. package/.next/server/app/notebooks/[id]/add/page_client-reference-manifest.js +1 -1
  298. package/.next/server/app/notebooks/[id]/page.js.nft.json +1 -1
  299. package/.next/server/app/notebooks/[id]/page_client-reference-manifest.js +1 -1
  300. package/.next/server/app/notebooks/page.js.nft.json +1 -1
  301. package/.next/server/app/notebooks/page_client-reference-manifest.js +1 -1
  302. package/.next/server/app/page.js.nft.json +1 -1
  303. package/.next/server/app/page_client-reference-manifest.js +1 -1
  304. package/.next/server/app/practice/page.js.nft.json +1 -1
  305. package/.next/server/app/practice/page_client-reference-manifest.js +1 -1
  306. package/.next/server/app/print-preview/page.js.nft.json +1 -1
  307. package/.next/server/app/print-preview/page_client-reference-manifest.js +1 -1
  308. package/.next/server/app/register/page.js.nft.json +1 -1
  309. package/.next/server/app/register/page_client-reference-manifest.js +1 -1
  310. package/.next/server/app/review/page.js.nft.json +1 -1
  311. package/.next/server/app/review/page_client-reference-manifest.js +1 -1
  312. package/.next/server/app/setup/page.js.nft.json +1 -1
  313. package/.next/server/app/setup/page_client-reference-manifest.js +1 -1
  314. package/.next/server/app/stats/page.js.nft.json +1 -1
  315. package/.next/server/app/stats/page_client-reference-manifest.js +1 -1
  316. package/.next/server/app/tags/page.js.nft.json +1 -1
  317. package/.next/server/app/tags/page_client-reference-manifest.js +1 -1
  318. package/.next/server/app-paths-manifest.json +15 -0
  319. package/.next/server/chunks/1oeh_server_app_api_error-items_answer-space_route_actions_02_4xy5gtmofu.js +3 -0
  320. package/.next/server/chunks/1oeh_server_app_api_import-batches_[id]_confirm-all_route_actions_1u0e8at9dph0_.js +3 -0
  321. package/.next/server/chunks/1oeh_server_app_api_import-batches_[id]_read_route_actions_1nrzqz1at4s64.js +3 -0
  322. package/.next/server/chunks/1oeh_server_app_api_import-batches_[id]_retry_route_actions_1u5hn2zjw-sj-.js +3 -0
  323. package/.next/server/chunks/1oeh_server_app_api_import-batches_[id]_start_route_actions_1o5tg4uk8s-ch.js +3 -0
  324. package/.next/server/chunks/1oeh_server_app_api_import-tasks_[id]_confirm_route_actions_0cj5phaug2e76.js +3 -0
  325. package/.next/server/chunks/1oeh_server_app_api_import-tasks_[id]_retry_route_actions_1g7rekf8h4rkk.js +3 -0
  326. package/.next/server/chunks/{[externals]__0c36n-dcv5nqc._.js → [externals]__0fgpzedhhntg9._.js} +1 -1
  327. package/.next/server/chunks/[externals]__14rv088xdnlo4._.js +3 -0
  328. package/.next/server/chunks/{[externals]__1lhov-pp9xqtz._.js → [externals]__1i7c9m3y35e80._.js} +1 -1
  329. package/.next/server/chunks/{[root-of-the-server]__0455yyxule6q_._.js → [root-of-the-server]__0-ipecoww0k_f._.js} +1 -1
  330. package/.next/server/chunks/{[root-of-the-server]__00jyo3io99_dn._.js → [root-of-the-server]__0-rtxg7i50p0s._.js} +2 -2
  331. package/.next/server/chunks/{[root-of-the-server]__0hm2dh8ziz93k._.js → [root-of-the-server]__02oqd6w58wymi._.js} +1 -1
  332. package/.next/server/chunks/[root-of-the-server]__0401xgmcbb_7u._.js +3 -0
  333. package/.next/server/chunks/[root-of-the-server]__04pdmyloqh744._.js +5 -0
  334. package/.next/server/chunks/{[root-of-the-server]__07uf7ctm4sjo4._.js → [root-of-the-server]__04tx90mwz-58t._.js} +1 -1
  335. package/.next/server/chunks/[root-of-the-server]__05615yr7zmo6t._.js +3 -0
  336. package/.next/server/chunks/{[root-of-the-server]__06lmwv-4d1slg._.js → [root-of-the-server]__05iw617rx9m75._.js} +1 -1
  337. package/.next/server/chunks/{[root-of-the-server]__0n0c-mpolar22._.js → [root-of-the-server]__06675jta6pa74._.js} +2 -2
  338. package/.next/server/chunks/[root-of-the-server]__06ocjahusp01i._.js +3 -0
  339. package/.next/server/chunks/{[root-of-the-server]__1m8b6why7f1uj._.js → [root-of-the-server]__06pk7x8wdbyel._.js} +2 -2
  340. package/.next/server/chunks/[root-of-the-server]__08crf3zxl7fnv._.js +3 -0
  341. package/.next/server/chunks/{[root-of-the-server]__0m8bcdajibej0._.js → [root-of-the-server]__092b1e081ocu6._.js} +1 -1
  342. package/.next/server/chunks/{[root-of-the-server]__0vz0xv_w6vbpq._.js → [root-of-the-server]__092h03ec6f_1u._.js} +1 -1
  343. package/.next/server/chunks/{[root-of-the-server]__12fkzjxvspcin._.js → [root-of-the-server]__094fb72-14c6v._.js} +1 -1
  344. package/.next/server/chunks/{[root-of-the-server]__0_ahztuh3lr_n._.js → [root-of-the-server]__0982_75un5k3v._.js} +1 -1
  345. package/.next/server/chunks/{[root-of-the-server]__0sxr-ing62eg7._.js → [root-of-the-server]__09wdoeko-mqnp._.js} +1 -1
  346. package/.next/server/chunks/{[root-of-the-server]__1fj6upsvfxy4r._.js → [root-of-the-server]__0_fisu5brhyk_._.js} +1 -1
  347. package/.next/server/chunks/[root-of-the-server]__0_uvtfu0yr-na._.js +4 -4
  348. package/.next/server/chunks/[root-of-the-server]__0a13lncff9jx-._.js +3 -0
  349. package/.next/server/chunks/[root-of-the-server]__0b1s_-vbl79om._.js +3 -0
  350. package/.next/server/chunks/{[root-of-the-server]__0rnr17a382rjx._.js → [root-of-the-server]__0cu0eqoslaz4-._.js} +2 -2
  351. package/.next/server/chunks/{[root-of-the-server]__0u36j_9ml4et6._.js → [root-of-the-server]__0d_zoa2_linlk._.js} +1 -1
  352. package/.next/server/chunks/{[root-of-the-server]__145w7mwgp8ujm._.js → [root-of-the-server]__0f2xi-1x_bd0j._.js} +2 -2
  353. package/.next/server/chunks/{[root-of-the-server]__18uhupcdidftm._.js → [root-of-the-server]__0fnte1x8xdn5o._.js} +1 -1
  354. package/.next/server/chunks/[root-of-the-server]__0fxqs6p28o57m._.js +3 -0
  355. package/.next/server/chunks/[root-of-the-server]__0h3er81lqy7-3._.js +3 -0
  356. package/.next/server/chunks/{[root-of-the-server]__1f_lrxzw_n-6-._.js → [root-of-the-server]__0ha1sdqrzak3j._.js} +2 -2
  357. package/.next/server/chunks/{[root-of-the-server]__1ptzu7aqoga2n._.js → [root-of-the-server]__0hcbw1sliw973._.js} +2 -2
  358. package/.next/server/chunks/{[root-of-the-server]__00kq2qcxfg-kq._.js → [root-of-the-server]__0impq05z-6_x5._.js} +2 -2
  359. package/.next/server/chunks/{[root-of-the-server]__08t21dbk1cidn._.js → [root-of-the-server]__0jw-1uedp5s7y._.js} +2 -2
  360. package/.next/server/chunks/[root-of-the-server]__0jy5w86h0qg50._.js +3 -0
  361. package/.next/server/chunks/{[root-of-the-server]__18z_cczwqkonn._.js → [root-of-the-server]__0kehix4ojdnhw._.js} +2 -2
  362. package/.next/server/chunks/[root-of-the-server]__0kw7hbup538-8._.js +3 -0
  363. package/.next/server/chunks/{[root-of-the-server]__0xqsrh251_yms._.js → [root-of-the-server]__0l-amyqoswdni._.js} +1 -1
  364. package/.next/server/chunks/{[root-of-the-server]__1v1p83o4ygnyt._.js → [root-of-the-server]__0l__ty_n0br2x._.js} +2 -2
  365. package/.next/server/chunks/[root-of-the-server]__0mhtpz84f1vct._.js +3 -0
  366. package/.next/server/chunks/[root-of-the-server]__0mks6j_xgzj06._.js +3 -0
  367. package/.next/server/chunks/[root-of-the-server]__0nujsu6qbn-8o._.js +4 -4
  368. package/.next/server/chunks/{[root-of-the-server]__0nw6t7u627b2m._.js → [root-of-the-server]__0nv9vais_avpm._.js} +2 -2
  369. package/.next/server/chunks/{[root-of-the-server]__0kmy5264opoz7._.js → [root-of-the-server]__0odw8n6b44k3x._.js} +2 -2
  370. package/.next/server/chunks/[root-of-the-server]__0ol6aiama1k_-._.js +3 -0
  371. package/.next/server/chunks/[root-of-the-server]__0pce90ecznpjr._.js +3 -0
  372. package/.next/server/chunks/[root-of-the-server]__0pgghfs5ue4ff._.js +3 -0
  373. package/.next/server/chunks/{[root-of-the-server]__11ztapi1pi7j-._.js → [root-of-the-server]__0pkist00_xrfj._.js} +1 -1
  374. package/.next/server/chunks/[root-of-the-server]__0q3uk_5f9t6mb._.js +3 -0
  375. package/.next/server/chunks/[root-of-the-server]__0qw6cz355p_eb._.js +3 -0
  376. package/.next/server/chunks/[root-of-the-server]__0rwxa2doabk45._.js +3 -0
  377. package/.next/server/chunks/[root-of-the-server]__0s3z-zsl35ueb._.js +3 -0
  378. package/.next/server/chunks/[root-of-the-server]__0smf8z8cd59g3._.js +3 -0
  379. package/.next/server/chunks/[root-of-the-server]__0sujbuwv8y6bp._.js +3 -0
  380. package/.next/server/chunks/[root-of-the-server]__0tg572v-6f3wo._.js +3 -0
  381. package/.next/server/chunks/[root-of-the-server]__0to77zh5fihef._.js +3 -0
  382. package/.next/server/chunks/[root-of-the-server]__0u04aced_0ug4._.js +3 -0
  383. package/.next/server/chunks/[root-of-the-server]__0ujhtand4ld8w._.js +3 -0
  384. package/.next/server/chunks/[root-of-the-server]__0ultckrjp1h-q._.js +3 -0
  385. package/.next/server/chunks/[root-of-the-server]__0xkb9fyy9z_rr._.js +3 -0
  386. package/.next/server/chunks/[root-of-the-server]__0xqbpgtwhqhpl._.js +3 -0
  387. package/.next/server/chunks/[root-of-the-server]__0xwxn3blv1fe1._.js +3 -0
  388. package/.next/server/chunks/[root-of-the-server]__0y0skjc_7v7cr._.js +3 -0
  389. package/.next/server/chunks/{[root-of-the-server]__0ym21tuxqrmc4._.js → [root-of-the-server]__0y_zzgunl38y2._.js} +2 -2
  390. package/.next/server/chunks/{[root-of-the-server]__1d1gxff_c2o28._.js → [root-of-the-server]__1-0-1pwy7s8ak._.js} +2 -2
  391. package/.next/server/chunks/[root-of-the-server]__1-90b1cy_787j._.js +3 -0
  392. package/.next/server/chunks/{[root-of-the-server]__1oedx4ko_1hl9._.js → [root-of-the-server]__1-z3uulycjf_q._.js} +2 -2
  393. package/.next/server/chunks/[root-of-the-server]__121tnm6bol8ow._.js +3 -0
  394. package/.next/server/chunks/[root-of-the-server]__134n229bo2v1d._.js +3 -0
  395. package/.next/server/chunks/[root-of-the-server]__13_k7w8nrx7ie._.js +1 -1
  396. package/.next/server/chunks/[root-of-the-server]__13ofz2qkhwdmd._.js +3 -0
  397. package/.next/server/chunks/{[root-of-the-server]__0os8s3dtzx4gi._.js → [root-of-the-server]__16p-11g6suxzy._.js} +2 -2
  398. package/.next/server/chunks/[root-of-the-server]__18tzik6wyd5b2._.js +3 -0
  399. package/.next/server/chunks/[root-of-the-server]__19qwvtmhzhh9_._.js +3 -0
  400. package/.next/server/chunks/[root-of-the-server]__1_-sordu1ka96._.js +3 -0
  401. package/.next/server/chunks/[root-of-the-server]__1_2jbd6rjhbu6._.js +3 -0
  402. package/.next/server/chunks/[root-of-the-server]__1_qwjiy9wg14j._.js +3 -0
  403. package/.next/server/chunks/[root-of-the-server]__1al4_7mvxprle._.js +3 -0
  404. package/.next/server/chunks/[root-of-the-server]__1cbejfw8sum3r._.js +3 -0
  405. package/.next/server/chunks/[root-of-the-server]__1cbhqd8d3ozuv._.js +3 -0
  406. package/.next/server/chunks/[root-of-the-server]__1cxpqdzozndhn._.js +3 -0
  407. package/.next/server/chunks/[root-of-the-server]__1dh0adu5iobp3._.js +3 -0
  408. package/.next/server/chunks/{[root-of-the-server]__0btfk_sy3o9wa._.js → [root-of-the-server]__1drs4rr5x286d._.js} +1 -1
  409. package/.next/server/chunks/[root-of-the-server]__1eli1ues3akzx._.js +3 -0
  410. package/.next/server/chunks/[root-of-the-server]__1exbv92f97wbe._.js +3 -0
  411. package/.next/server/chunks/[root-of-the-server]__1fe2v2mv5-rgo._.js +3 -0
  412. package/.next/server/chunks/[root-of-the-server]__1grfx7nsqj28h._.js +3 -0
  413. package/.next/server/chunks/[root-of-the-server]__1h0fzi033rztm._.js +3 -0
  414. package/.next/server/chunks/[root-of-the-server]__1ixotu0p11op8._.js +3 -0
  415. package/.next/server/chunks/[root-of-the-server]__1j0l1jz1c3mpt._.js +3 -0
  416. package/.next/server/chunks/[root-of-the-server]__1jneum6lwgjph._.js +3 -0
  417. package/.next/server/chunks/[root-of-the-server]__1mg_zqw3nheiu._.js +3 -0
  418. package/.next/server/chunks/[root-of-the-server]__1mn422yguinbn._.js +3 -0
  419. package/.next/server/chunks/[root-of-the-server]__1ndg27r3ft7-f._.js +3 -0
  420. package/.next/server/chunks/[root-of-the-server]__1p60tmt2t1ve3._.js +3 -0
  421. package/.next/server/chunks/[root-of-the-server]__1qgitdeliyhex._.js +3 -0
  422. package/.next/server/chunks/[root-of-the-server]__1qxr6vtllrbku._.js +3 -0
  423. package/.next/server/chunks/{[root-of-the-server]__14wezz97rhtz9._.js → [root-of-the-server]__1r7a3lg45ng01._.js} +2 -2
  424. package/.next/server/chunks/[root-of-the-server]__1rcg5kj7i_3lc._.js +3 -0
  425. package/.next/server/chunks/{[root-of-the-server]__1n21o3aq7pxla._.js → [root-of-the-server]__1rh7o4i0_it3x._.js} +2 -2
  426. package/.next/server/chunks/[root-of-the-server]__1rylv89ttw-vw._.js +3 -0
  427. package/.next/server/chunks/{[root-of-the-server]__1o9pbkx7ejxu0._.js → [root-of-the-server]__1s-y00c3-nc_-._.js} +1 -1
  428. package/.next/server/chunks/[root-of-the-server]__1ue577i7esus5._.js +3 -0
  429. package/.next/server/chunks/[root-of-the-server]__1vvqeqc6b1ri5._.js +3 -0
  430. package/.next/server/chunks/[root-of-the-server]__1wp-sh9b360mc._.js +3 -0
  431. package/.next/server/chunks/[root-of-the-server]__1wphfm1f8cos4._.js +3 -0
  432. package/.next/server/chunks/[root-of-the-server]__1xkmo8s1c258u._.js +3 -0
  433. package/.next/server/chunks/{[root-of-the-server]__18nv1yn5xh03v._.js → [root-of-the-server]__1z51x426cuske._.js} +2 -2
  434. package/.next/server/chunks/[root-of-the-server]__1zg0z12pshrxg._.js +3 -0
  435. package/.next/server/chunks/[root-of-the-server]__20vlnu0zllzzp._.js +3 -0
  436. package/.next/server/chunks/_01bayc6kg7upi._.js +3 -0
  437. package/.next/server/chunks/_0431fxnqiloso._.js +1 -1
  438. package/.next/server/chunks/_05ans30vcd4s-._.js +3 -0
  439. package/.next/server/chunks/_0_rhee7wb6tcg._.js +1 -1
  440. package/.next/server/chunks/_0ge95_bkwrkmc._.js +3 -0
  441. package/.next/server/chunks/_0lmh33cdt_1fr._.js +3 -0
  442. package/.next/server/chunks/_0pzdohc1mz5ts._.js +3 -0
  443. package/.next/server/chunks/_0suqhfy3e5sv6._.js +3 -0
  444. package/.next/server/chunks/_0xv7-7d6dyo9-._.js +3 -0
  445. package/.next/server/chunks/{_1wulydy4wg9ow._.js → _0xx4y9tk1qclc._.js} +2 -2
  446. package/.next/server/chunks/_0ymqtnritje40._.js +3 -0
  447. package/.next/server/chunks/_12w5k19rc45j_._.js +1 -1
  448. package/.next/server/chunks/_1647rfjflw_iq._.js +3 -0
  449. package/.next/server/chunks/_1a1udq0c4_6ad._.js +1 -1
  450. package/.next/server/chunks/_1duugm0s3-6nw._.js +3 -0
  451. package/.next/server/chunks/_1e_ts14olqd90._.js +3 -0
  452. package/.next/server/chunks/{_10tpt8iizl4v3._.js → _1fq28h_w2e0th._.js} +7 -4
  453. package/.next/server/chunks/_1gdet1v2zk2gy._.js +3 -0
  454. package/.next/server/chunks/{_1dvka-waihfum._.js → _1gngd154ci72t._.js} +7 -4
  455. package/.next/server/chunks/_1j10upti9l6da._.js +3 -0
  456. package/.next/server/chunks/{_11_p1ahjjply_._.js → _1pvqo-qnv-nqm._.js} +2 -2
  457. package/.next/server/chunks/{_0dicq393_0h3i._.js → _1rreh3rgx8xan._.js} +1 -1
  458. package/.next/server/chunks/_1s5-ldt8xhtpp._.js +1 -1
  459. package/.next/server/chunks/_1s55l1bx-1cxp._.js +3 -0
  460. package/.next/server/chunks/_1srq5kxah38r6._.js +3 -0
  461. package/.next/server/chunks/_1tahh9ric8la3._.js +3 -0
  462. package/.next/server/chunks/_1tvl0cm629nyc._.js +3 -0
  463. package/.next/server/chunks/_1ui0r0p4npnpi._.js +11 -0
  464. package/.next/server/chunks/_next-internal_server_app_api_import-batches_[id]_route_actions_0_mc245t1pbwl.js +3 -0
  465. package/.next/server/chunks/_next-internal_server_app_api_import-batches_route_actions_0pi56cpanyvac.js +3 -0
  466. package/.next/server/chunks/_next-internal_server_app_api_import-tasks_[id]_read_route_actions_116wza5ukp0c2.js +3 -0
  467. package/.next/server/chunks/_next-internal_server_app_api_import-tasks_[id]_route_actions_1fvi-v9pgzuli.js +3 -0
  468. package/.next/server/chunks/_next-internal_server_app_api_import-tasks_route_actions_0d08bh7zurcp_.js +3 -0
  469. package/.next/server/chunks/node_modules_next_dist_0n2og9jackhd2._.js +54 -0
  470. package/.next/server/chunks/src_0bhf345rd7jho._.js +1 -1
  471. package/.next/server/chunks/src_lib_0sbu2x2ff_rnz._.js +3 -0
  472. package/.next/server/chunks/src_lib_10is5pyogge95._.js +1 -1
  473. package/.next/server/chunks/src_lib_1_m3-y2t3e4xi._.js +49 -16
  474. package/.next/server/chunks/src_lib_1qvj-3jt4jbq7._.js +3 -0
  475. package/.next/server/chunks/src_lib_1xdguwkq8k_gz._.js +3 -0
  476. package/.next/server/chunks/src_lib_1zjmo0u3pnxig._.js +3 -0
  477. package/.next/server/chunks/src_lib_constants_pagination_ts_0tz3fg9ib3b-w._.js +1 -1
  478. package/.next/server/chunks/src_lib_import-batches_ts_0aekmggdwo_9-._.js +3 -0
  479. package/.next/server/chunks/src_lib_import-tasks_ts_1f4ejsy00-v1t._.js +3 -0
  480. package/.next/server/chunks/src_lib_question-analysis_ts_15_8r_pxmtd06._.js +3 -0
  481. package/.next/server/chunks/src_lib_tag-hierarchy_ts_1illun--8v3_9._.js +3 -0
  482. package/.next/server/chunks/ssr/{[root-of-the-server]__0_eqpxqkvkrs_._.js → [root-of-the-server]__00_c9kpvx5075._.js} +1 -1
  483. package/.next/server/chunks/ssr/[root-of-the-server]__0_bi5ljcm1i1c._.js +3 -0
  484. package/.next/server/chunks/ssr/[root-of-the-server]__0r_5r-242wwqy._.js +3 -0
  485. package/.next/server/chunks/ssr/{[root-of-the-server]__0d4mrtd9tdni-._.js → [root-of-the-server]__0vgnixmnie9dg._.js} +1 -1
  486. package/.next/server/chunks/ssr/[root-of-the-server]__1l68oxzjvj18_._.js +3 -0
  487. package/.next/server/chunks/ssr/[root-of-the-server]__1mrj6vygoasvv._.js +3 -0
  488. package/.next/server/chunks/ssr/{[root-of-the-server]__1eu3xw3zls5xt._.js → [root-of-the-server]__1o5pa8m50qyqa._.js} +1 -1
  489. package/.next/server/chunks/ssr/[root-of-the-server]__1ynp6nm1gttsf._.js +3 -0
  490. package/.next/server/chunks/ssr/[root-of-the-server]__1zupg0zigit-2._.js +3 -0
  491. package/.next/server/chunks/ssr/[root-of-the-server]__2019hdxvtb4e0._.js +3 -0
  492. package/.next/server/chunks/ssr/_05szyj465au6e._.js +3 -0
  493. package/.next/server/chunks/ssr/_0cmd1ubdlo_by._.js +1 -1
  494. package/.next/server/chunks/ssr/_0f2k-q7kimi4o._.js +3 -0
  495. package/.next/server/chunks/ssr/_0ks-0g-tu__3m._.js +3 -0
  496. package/.next/server/chunks/ssr/_0lzeodofsq9pe._.js +1 -1
  497. package/.next/server/chunks/ssr/_0mvuvawj5-r--._.js +3 -0
  498. package/.next/server/chunks/ssr/_0nt5dm7rmsp4f._.js +3 -0
  499. package/.next/server/chunks/ssr/{_07-atqwd3wqya._.js → _0oslwj90y-3j0._.js} +1 -1
  500. package/.next/server/chunks/ssr/_0ozptnii2nxuw._.js +1 -1
  501. package/.next/server/chunks/ssr/_0s318kewgu2zg._.js +3 -0
  502. package/.next/server/chunks/ssr/_0ueequ0gysrs-._.js +3 -0
  503. package/.next/server/chunks/ssr/_15fdum1ye-k0z._.js +3 -0
  504. package/.next/server/chunks/ssr/_19hxsrrruepym._.js +3 -0
  505. package/.next/server/chunks/ssr/{_1l_v9_8-5wv_d._.js → _1b8cip9y91_br._.js} +1 -1
  506. package/.next/server/chunks/ssr/_1hbrn0tcfh7hd._.js +3 -0
  507. package/.next/server/chunks/ssr/_1j3yr2arbxd6a._.js +3 -0
  508. package/.next/server/chunks/ssr/_1qgg_ll5hkjaf._.js +1 -9
  509. package/.next/server/chunks/ssr/_1ujx-n3muyaxs._.js +32 -0
  510. package/.next/server/chunks/ssr/_1ux6eqqkupo6v._.js +1 -9
  511. package/.next/server/chunks/ssr/_1w1qijzykerpu._.js +3 -0
  512. package/.next/server/chunks/ssr/_next-internal_server_app_import-batches_[id]_page_actions_1hnz0a7dq8meb.js +3 -0
  513. package/.next/server/chunks/ssr/_next-internal_server_app_import-tasks_[id]_page_actions_0ln1lwiey8bbi.js +3 -0
  514. package/.next/server/chunks/ssr/_next-internal_server_app_import-tasks_page_actions_1h7cqbj1cojed.js +3 -0
  515. package/.next/server/chunks/ssr/node_modules_05hncuf8243qe._.js +3 -0
  516. package/.next/server/chunks/ssr/node_modules_0_qoz7biz6-x_._.js +3 -0
  517. package/.next/server/chunks/ssr/node_modules_11z4lth_9u_hn._.js +2 -2
  518. package/.next/server/chunks/ssr/node_modules_17lx40fyvpom3._.js +3 -0
  519. package/.next/server/chunks/ssr/node_modules_@radix-ui_1i8eumxju2gpw._.js +3 -0
  520. package/.next/server/chunks/ssr/node_modules_heic-to_dist_csp_heic-to_1a1i_ppryp81y.js +3 -0
  521. package/.next/server/chunks/ssr/node_modules_heic-to_dist_csp_heic-to_1myi81wrj4gw4.js +3 -0
  522. package/.next/server/chunks/ssr/node_modules_lucide-react_dist_esm_icons_06p81-gtz_2cm._.js +3 -0
  523. package/.next/server/chunks/ssr/node_modules_lucide-react_dist_esm_icons_1bq471wvtkwrl._.js +3 -0
  524. package/.next/server/chunks/ssr/node_modules_lucide-react_dist_esm_icons_pencil-line_mjs_1xkf12pwlzan2._.js +8 -0
  525. package/.next/server/chunks/ssr/node_modules_next_dist_esm_build_templates_app-page_0-4c5fuxx178f.js +3 -0
  526. package/.next/server/chunks/ssr/node_modules_next_dist_esm_build_templates_app-page_0d5g5-w_y282q.js +3 -0
  527. package/.next/server/chunks/ssr/node_modules_next_dist_esm_build_templates_app-page_0pdc0gl8iqtfa.js +3 -0
  528. package/.next/server/chunks/ssr/node_modules_react-image-crop_dist_index_0khmp4mv3j9zr.js +3 -0
  529. package/.next/server/chunks/ssr/node_modules_zod_v4_classic_external_0n-w9zu3b6q41.js +57 -0
  530. package/.next/server/chunks/ssr/src_app_error-items_[id]_page_tsx_04xwwdmyh7_9q._.js +1 -1
  531. package/.next/server/chunks/ssr/src_app_exams_[id]_print_page_tsx_1i-xvhk8ul1l1._.js +6 -6
  532. package/.next/server/chunks/ssr/src_app_import-batches_[id]_page_tsx_0mhg_vriwmkkw._.js +3 -0
  533. package/.next/server/chunks/ssr/src_app_import-tasks_[id]_page_tsx_0_grj11-jdqqc._.js +3 -0
  534. package/.next/server/chunks/ssr/src_app_import-tasks_page_tsx_01983hytm-x08._.js +3 -0
  535. package/.next/server/chunks/ssr/src_app_notebooks_[id]_add_page_tsx_179tow1ql6vc_._.js +1 -1
  536. package/.next/server/chunks/ssr/src_app_page_tsx_1chiuahujsxm1._.js +1 -1
  537. package/.next/server/chunks/ssr/src_app_print-preview_page_tsx_001yt-fzrj7tf._.js +1 -1
  538. package/.next/server/chunks/ssr/src_components_correction-editor_tsx_1p7z02t66tndx._.js +6 -0
  539. package/.next/server/chunks/ssr/src_components_image-cropper_tsx_0pcp8-ifruyx-._.js +3 -0
  540. package/.next/server/chunks/ssr/src_components_import-tasks_import-task-card_tsx_01r47qh8ryspb._.js +3 -0
  541. package/.next/server/chunks/ssr/src_components_print-preview_answer-space-control_tsx_02kuswyxklzp_._.js +1 -31
  542. package/.next/server/chunks/ssr/src_components_providers_tsx_09kw-mv3nb6xs._.js +10 -64
  543. package/.next/server/chunks/ssr/src_lib_question-split_text_ts_0h4uz23xrlybm._.js +6 -0
  544. package/.next/server/middleware-build-manifest.js +36 -3
  545. package/.next/server/next-font-manifest.js +1 -1
  546. package/.next/server/next-font-manifest.json +12 -0
  547. package/.next/server/pages/500.html +1 -1
  548. package/.next/server/preview-props.json +3 -3
  549. package/.next/server/server-reference-manifest.js +1 -1
  550. package/.next/server/server-reference-manifest.json +1 -1
  551. package/.next/static/chunks/02wft51kf3t9f.js +1 -0
  552. package/.next/static/chunks/0_ar7dth9hybc.js +1 -0
  553. package/.next/static/chunks/0p6ox1l56khn2.js +3 -0
  554. package/.next/static/chunks/0t9po-y0g3nwu.js +12 -0
  555. package/.next/static/chunks/0v8w72ij3d-3v.js +1 -0
  556. package/.next/static/chunks/0x9-b30mhne-_.js +1 -0
  557. package/.next/static/chunks/{1g13qcek7-0du.js → 16h0nz5l970cx.js} +1 -1
  558. package/.next/static/chunks/171ff2ttsrlg8.js +1 -0
  559. package/.next/static/chunks/1746y345zti-9.js +33 -0
  560. package/.next/static/chunks/1ar7mttk9ne1t.js +12 -0
  561. package/.next/static/chunks/1upvap68fad8i.js +1 -0
  562. package/.next/static/chunks/21-zw9_-z7wy0.js +1 -0
  563. package/.next/static/chunks/210o9wkszynk8.js +55 -0
  564. package/.next/static/chunks/26_q5epdikurm.js +1 -0
  565. package/.next/static/chunks/289znh7431pug.js +1 -0
  566. package/.next/static/chunks/29hn5lj1csc6m.js +6 -0
  567. package/.next/static/chunks/2hh64gi4pmlk2.js +1 -0
  568. package/.next/static/chunks/2ic9ath-r3jvf.js +193 -0
  569. package/.next/static/chunks/2notwq6aaf_l7.css +3 -0
  570. package/.next/static/chunks/3-se55-6uc0mx.js +2 -0
  571. package/.next/static/chunks/32hs1wu90i-g2.js +9 -0
  572. package/.next/static/chunks/38fux_rbsoiif.js +1 -0
  573. package/.next/static/chunks/38vt_4ntvy02e.js +1 -0
  574. package/.next/static/chunks/3b34ougp2g-5y.js +1 -0
  575. package/.next/static/chunks/3c3cp7uzfhnyr.js +1 -0
  576. package/.next/static/chunks/3gy-_kb72v5lr.js +1 -0
  577. package/.next/static/chunks/3lsj4waqfw7eq.js +1 -0
  578. package/.next/static/chunks/3ucxgsy-rkjn9.js +9 -0
  579. package/.next/static/chunks/3wr-25ch-9chk.js +1 -0
  580. package/.next/static/chunks/4441xuc3i-yb7.js +1 -0
  581. package/package.json +1 -1
  582. package/prisma/migrations/20261102102339_add_custom_answer_space/migration.sql +5 -0
  583. package/prisma/migrations/20261103011313_add_import_tasks/migration.sql +37 -0
  584. package/prisma/migrations/20261103052754_add_import_batches/migration.sql +79 -0
  585. package/prisma/schema.prisma +77 -0
  586. package/prisma/seed.db +0 -0
  587. package/public/third-party-licenses/heic-to/GPL-3.0.txt +674 -0
  588. package/public/third-party-licenses/heic-to/NOTICE.txt +76 -0
  589. package/public/third-party-licenses/heic-to/emscripten-LICENSE.txt +102 -0
  590. package/public/third-party-licenses/heic-to/heic-to-LICENSE.txt +177 -0
  591. package/public/third-party-licenses/heic-to/libde265-1.0.16-COPYING.txt +871 -0
  592. package/public/third-party-licenses/heic-to/libheif-1.23.6-COPYING.txt +871 -0
  593. package/.next/server/chunks/[root-of-the-server]__01nvw5ogtwc0h._.js +0 -3
  594. package/.next/server/chunks/[root-of-the-server]__02dkbynj2vxld._.js +0 -3
  595. package/.next/server/chunks/[root-of-the-server]__05n74a-t4yfhk._.js +0 -3
  596. package/.next/server/chunks/[root-of-the-server]__05u_glm0nzz-u._.js +0 -3
  597. package/.next/server/chunks/[root-of-the-server]__0c2729fcpi3-x._.js +0 -3
  598. package/.next/server/chunks/[root-of-the-server]__0gaai286hkspk._.js +0 -3
  599. package/.next/server/chunks/[root-of-the-server]__0jy-eooky8kei._.js +0 -3
  600. package/.next/server/chunks/[root-of-the-server]__0kljn4jodzvqk._.js +0 -3
  601. package/.next/server/chunks/[root-of-the-server]__0pn5idap1logb._.js +0 -3
  602. package/.next/server/chunks/[root-of-the-server]__0tflqqgyujt1r._.js +0 -3
  603. package/.next/server/chunks/[root-of-the-server]__0z99q93n88cro._.js +0 -3
  604. package/.next/server/chunks/[root-of-the-server]__1-g1cu85bv1bg._.js +0 -3
  605. package/.next/server/chunks/[root-of-the-server]__1-hfmp3groi95._.js +0 -56
  606. package/.next/server/chunks/[root-of-the-server]__10l89psqaisak._.js +0 -3
  607. package/.next/server/chunks/[root-of-the-server]__1236d6g1_51pt._.js +0 -3
  608. package/.next/server/chunks/[root-of-the-server]__12_laap0hyw4p._.js +0 -3
  609. package/.next/server/chunks/[root-of-the-server]__12cpc3g7-oi86._.js +0 -3
  610. package/.next/server/chunks/[root-of-the-server]__13pd8ofsmrv7k._.js +0 -3
  611. package/.next/server/chunks/[root-of-the-server]__13zeb46abilr5._.js +0 -3
  612. package/.next/server/chunks/[root-of-the-server]__142g4s902bza-._.js +0 -3
  613. package/.next/server/chunks/[root-of-the-server]__1460_07yt08m0._.js +0 -3
  614. package/.next/server/chunks/[root-of-the-server]__15mf1z85mft8d._.js +0 -3
  615. package/.next/server/chunks/[root-of-the-server]__15ypu4q7xi8ig._.js +0 -3
  616. package/.next/server/chunks/[root-of-the-server]__1610s5zvyss1k._.js +0 -3
  617. package/.next/server/chunks/[root-of-the-server]__16864lw9bhmwl._.js +0 -3
  618. package/.next/server/chunks/[root-of-the-server]__19a62id_4lwka._.js +0 -3
  619. package/.next/server/chunks/[root-of-the-server]__1b42xh9458czy._.js +0 -3
  620. package/.next/server/chunks/[root-of-the-server]__1dreyiratyfvo._.js +0 -3
  621. package/.next/server/chunks/[root-of-the-server]__1elqmd_7a9bto._.js +0 -3
  622. package/.next/server/chunks/[root-of-the-server]__1gvnk0s0_zrpo._.js +0 -3
  623. package/.next/server/chunks/[root-of-the-server]__1hwftfenrsu3p._.js +0 -3
  624. package/.next/server/chunks/[root-of-the-server]__1lafe11jnkmlv._.js +0 -3
  625. package/.next/server/chunks/[root-of-the-server]__1m1wi2f60x1fk._.js +0 -3
  626. package/.next/server/chunks/[root-of-the-server]__1o-0-f8rlbavp._.js +0 -3
  627. package/.next/server/chunks/[root-of-the-server]__1r7wz_id6mvlj._.js +0 -3
  628. package/.next/server/chunks/[root-of-the-server]__1r_x7moz0opqt._.js +0 -3
  629. package/.next/server/chunks/[root-of-the-server]__1rx3b8m_g_p57._.js +0 -3
  630. package/.next/server/chunks/[root-of-the-server]__1wh65tfd7apxx._.js +0 -3
  631. package/.next/server/chunks/[root-of-the-server]__1wsyku681k2uq._.js +0 -3
  632. package/.next/server/chunks/[root-of-the-server]__1ximu6k5bljjj._.js +0 -3
  633. package/.next/server/chunks/[root-of-the-server]__20jkc-_5uj_zc._.js +0 -3
  634. package/.next/server/chunks/_03udbqs8_z944._.js +0 -3
  635. package/.next/server/chunks/_1_ns7o3cqznv6._.js +0 -3
  636. package/.next/server/chunks/_1rr_juv5pj1at._.js +0 -3
  637. package/.next/server/chunks/_1upqhtax8p96-._.js +0 -3
  638. package/.next/server/chunks/src_lib_question-deduplication_ts_1p1bik-vwl9ue._.js +0 -3
  639. package/.next/server/chunks/ssr/[root-of-the-server]__0mf_ugip8jvfl._.js +0 -3
  640. package/.next/server/chunks/ssr/[root-of-the-server]__1jhmaiw3yp6gx._.js +0 -3
  641. package/.next/server/chunks/ssr/[root-of-the-server]__1x6b2a-bbo2py._.js +0 -3
  642. package/.next/server/chunks/ssr/_02zfjls23g-o4._.js +0 -3
  643. package/.next/server/chunks/ssr/_0j4vduk13imjn._.js +0 -3
  644. package/.next/server/chunks/ssr/_0ltqx22v65imo._.js +0 -32
  645. package/.next/server/chunks/ssr/_0tr-7klbcz1r7._.js +0 -3
  646. package/.next/server/chunks/ssr/_0yrywyu_og4rx._.js +0 -3
  647. package/.next/server/chunks/ssr/_1-i5cy964i_s9._.js +0 -3
  648. package/.next/server/chunks/ssr/_1-z85ugzufqk6._.js +0 -3
  649. package/.next/server/chunks/ssr/_10stgw6io7x93._.js +0 -3
  650. package/.next/server/chunks/ssr/_11xqn1cgzpe6k._.js +0 -3
  651. package/.next/server/chunks/ssr/_1cc3psc9rvrwn._.js +0 -3
  652. package/.next/server/chunks/ssr/_1hp7fzio98dms._.js +0 -3
  653. package/.next/server/chunks/ssr/node_modules_0efju2pv0_0yw._.js +0 -3
  654. package/.next/static/chunks/01lfibj7hk--1.js +0 -1
  655. package/.next/static/chunks/06bfusm1eqhzt.js +0 -4
  656. package/.next/static/chunks/0fu1xttg42yzk.js +0 -1
  657. package/.next/static/chunks/0mp9tvylhyxid.js +0 -1
  658. package/.next/static/chunks/0xuzdy0dn7jkp.js +0 -63
  659. package/.next/static/chunks/1fa2xv93zl8oj.js +0 -1
  660. package/.next/static/chunks/1ou17klnb8gu_.js +0 -1
  661. package/.next/static/chunks/21v7--q2m3c4_.js +0 -1
  662. package/.next/static/chunks/22gdddnfj38h6.js +0 -1
  663. package/.next/static/chunks/2btkflolmab19.css +0 -3
  664. package/.next/static/chunks/2dml0yrklxocr.js +0 -31
  665. package/.next/static/chunks/2hjp9cnvepyzy.js +0 -247
  666. package/.next/static/chunks/2mu8zu6zd59z2.js +0 -1
  667. package/.next/static/chunks/2xibor-sxcc67.js +0 -1
  668. package/.next/static/chunks/3_e_larybjcr5.js +0 -1
  669. package/.next/static/chunks/3au-yz7ullfnr.js +0 -9
  670. package/.next/static/chunks/3zs0fu6zcu0lb.js +0 -1
  671. /package/.next/static/{jqVIU6HRwaZt62YD8QH_p → UGLvq52Fbq8nQxM1BjZlP}/_buildManifest.js +0 -0
  672. /package/.next/static/{jqVIU6HRwaZt62YD8QH_p → UGLvq52Fbq8nQxM1BjZlP}/_clientMiddlewareManifest.js +0 -0
  673. /package/.next/static/{jqVIU6HRwaZt62YD8QH_p → UGLvq52Fbq8nQxM1BjZlP}/_ssgManifest.js +0 -0
@@ -1,247 +0,0 @@
1
- (globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,1661,e=>{"use strict";let t,r,n,i,s,a,o,l,c,d;e.s(["BIGINT_FORMAT_RANGES",()=>tA,"CONSTANT_CATCH",()=>ri,"Class",()=>t9,"NUMBER_FORMAT_RANGES",()=>t$,"aborted",()=>tR,"allowsEval",()=>th,"assert",()=>eY,"assertEqual",()=>eJ,"assertIs",()=>eH,"assertNever",()=>eX,"assertNotEqual",()=>eq,"assignProp",()=>te,"attachSchema",()=>tV,"base64ToUint8Array",()=>tQ,"base64urlToUint8Array",()=>t1,"cached",()=>e4,"captureStackTrace",()=>tf,"cleanEnum",()=>tY,"cleanRegex",()=>e9,"clone",()=>tj,"cloneDef",()=>to,"codePointLength",()=>tq,"constantCatch",()=>rs,"createTransparentProxy",()=>tz,"defineLazy",()=>e8,"defineLazyInternal",()=>rr,"derived",()=>t7,"esc",()=>tu,"escapeRegex",()=>t_,"explicitlyAborted",()=>tM,"extend",()=>tP,"finalizeIssue",()=>tK,"floatSafeRemainder",()=>e5,"getElementAtPath",()=>tl,"getEnumValues",()=>eQ,"getLengthableOrigin",()=>tW,"getParsedType",()=>tx,"getSizableOrigin",()=>tB,"hexToUint8Array",()=>t4,"hide",()=>t8,"installLazyProp",()=>rn,"isObject",()=>tm,"isPlainObject",()=>tg,"issue",()=>tX,"joinValues",()=>e0,"jsonStringifyReplacer",()=>e1,"members",()=>t5,"merge",()=>tD,"mergeDefs",()=>ta,"normalizeParams",()=>tk,"nullish",()=>e3,"numKeys",()=>ty,"objectClone",()=>e7,"omit",()=>tT,"optionalKeys",()=>tS,"own",()=>t6,"parsedType",()=>tH,"partial",()=>tZ,"pick",()=>tO,"prefixIssues",()=>tL,"primitiveTypes",()=>tw,"promiseAllObject",()=>tc,"propertyKeyTypes",()=>tb,"randomString",()=>td,"rawShape",()=>tt,"required",()=>tF,"safeExtend",()=>tI,"shallowClone",()=>tv,"sizeCaps",()=>tG,"slugify",()=>tp,"stringifyPrimitive",()=>tN,"toZod",()=>eW,"uint8ArrayToBase64",()=>t0,"uint8ArrayToBase64url",()=>t2,"uint8ArrayToHex",()=>t3,"unwrapMessage",()=>tU],922143);var u,p,f=e.i(843476),m=e.i(271645),h=e.i(111110),g=e.i(217255),v=e.i(41931),y=e.i(303163),x=e.i(201276);let b=["system","light","dark"],w="system",_="app-theme";function j(e){return"string"==typeof e&&b.includes(e)}let k=(0,m.createContext)({preference:w,theme:"light",setPreference:()=>void 0}),z="(prefers-color-scheme: dark)",N=new Set;function S(e){return N.add(e),window.addEventListener("storage",e),()=>{N.delete(e),window.removeEventListener("storage",e)}}function $(){try{let e=localStorage.getItem(_);return j(e)?e:w}catch{return w}}function A(e){try{localStorage.setItem(_,e)}catch{}N.forEach(e=>e())}function O(e){let t=window.matchMedia(z);return t.addEventListener("change",e),()=>t.removeEventListener("change",e)}let E=()=>window.matchMedia(z).matches;function T({children:e}){let{data:t,status:r}=(0,g.useSession)(),n="authenticated"===r,i=t?.user?.email,s=(0,m.useSyncExternalStore)(S,$,()=>w),a=(0,m.useSyncExternalStore)(O,E,()=>!1),o="system"===s?a?"dark":"light":s;(0,m.useEffect)(()=>{let e=document.documentElement,t=t=>{e.classList.toggle("dark","dark"===t),e.style.colorScheme=t};t(o);let r=()=>t("light"),n=()=>t(o);return window.addEventListener("beforeprint",r),window.addEventListener("afterprint",n),()=>{window.removeEventListener("beforeprint",r),window.removeEventListener("afterprint",n)}},[o]),(0,m.useEffect)(()=>{if(!n||!i)return;let e=!1;return v.k.get("/api/user").then(t=>{!e&&j(t.themePreference)&&t.themePreference!==$()&&A(t.themePreference)}).catch(e=>{x.V.warn("[Theme]","Failed to load theme preference",{error:(0,y.Z)(e)})}),()=>{e=!0}},[n,i]);let l=(0,m.useCallback)(e=>{A(e),n&&v.k.patch("/api/user",{themePreference:e}).catch(e=>{x.V.warn("[Theme]","Failed to save theme preference",{error:(0,y.Z)(e)})})},[n]),c=(0,m.useMemo)(()=>({preference:s,theme:o,setPreference:l}),[s,o,l]);return(0,f.jsx)(k.Provider,{value:c,children:e})}var P=e.i(215519),C=e.i(325164),I=e.i(522016),D=e.i(618566),Z=e.i(749803),F=e.i(856423),R=e.i(975153),M=e.i(226091),L=e.i(367784),U=e.i(456420);let G={name:"circle-plus",size:24,node:[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M8 12h8",key:"1wcyev"}],["path",{d:"M12 8v8",key:"napkw2"}]],aliases:["plus-circle"]};G.node;let V=(0,U.f)(G),K={name:"shield",size:24,node:[["path",{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z",key:"oel41y"}]]};K.node;let B=(0,U.f)(K);var J=e.i(853138);let q={name:"bot",size:24,node:[["path",{d:"M12 8V4H8",key:"hb8ula"}],["rect",{width:"16",height:"12",x:"4",y:"8",rx:"2",key:"enze0r"}],["path",{d:"M2 14h2",key:"vft8re"}],["path",{d:"M20 14h2",key:"4cs60a"}],["path",{d:"M15 13v2",key:"1xurst"}],["path",{d:"M9 13v2",key:"rq6x2g"}]]};q.node;let W=(0,U.f)(q),H={name:"info",size:24,node:[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 16v-4",key:"1dtifu"}],["path",{d:"M12 8h.01",key:"e9boi3"}]]};H.node;let X=(0,U.f)(H);var Y=e.i(999092),Q=e.i(632781);let ee={name:"message-square-text",size:24,node:[["path",{d:"M22 17a2 2 0 0 1-2 2H6.828a2 2 0 0 0-1.414.586l-2.202 2.202A.71.71 0 0 1 2 21.286V5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2z",key:"18887p"}],["path",{d:"M7 11h10",key:"1twpyw"}],["path",{d:"M7 15h6",key:"d9of3u"}],["path",{d:"M7 7h8",key:"af5zfr"}]]};ee.node;let et=(0,U.f)(ee),er={name:"settings",size:24,node:[["path",{d:"M9.671 4.136a2.34 2.34 0 0 1 4.659 0 2.34 2.34 0 0 0 3.319 1.915 2.34 2.34 0 0 1 2.33 4.033 2.34 2.34 0 0 0 0 3.831 2.34 2.34 0 0 1-2.33 4.033 2.34 2.34 0 0 0-3.319 1.915 2.34 2.34 0 0 1-4.659 0 2.34 2.34 0 0 0-3.32-1.915 2.34 2.34 0 0 1-2.33-4.033 2.34 2.34 0 0 0 0-3.831A2.34 2.34 0 0 1 6.35 6.051a2.34 2.34 0 0 0 3.319-1.915",key:"1i5ecw"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]]};er.node;let en=(0,U.f)(er);var ei=e.i(901279),es=e.i(994533),ea=e.i(519455),eo=e.i(776639),el=e.i(677572),ec=e.i(306831),ed=e.i(487486),eu=e.i(699375),ep=e.i(793479),ef=e.i(110204),em=e.i(975157);let eh=m.forwardRef(({className:e,...t},r)=>(0,f.jsx)("div",{className:"relative w-full overflow-auto",children:(0,f.jsx)("table",{ref:r,className:(0,em.f)("w-full caption-bottom text-sm",e),...t})}));eh.displayName="Table";let eg=m.forwardRef(({className:e,...t},r)=>(0,f.jsx)("thead",{ref:r,className:(0,em.f)("[&_tr]:border-b",e),...t}));eg.displayName="TableHeader";let ev=m.forwardRef(({className:e,...t},r)=>(0,f.jsx)("tbody",{ref:r,className:(0,em.f)("[&_tr:last-child]:border-0",e),...t}));ev.displayName="TableBody",(m.forwardRef(({className:e,...t},r)=>(0,f.jsx)("tfoot",{ref:r,className:(0,em.f)("border-t bg-muted/50 font-medium [&>tr]:last:border-b-0",e),...t}))).displayName="TableFooter";let ey=m.forwardRef(({className:e,...t},r)=>(0,f.jsx)("tr",{ref:r,className:(0,em.f)("border-b transition-colors hover:bg-muted/50 data-[state=selected]:bg-muted",e),...t}));ey.displayName="TableRow";let ex=m.forwardRef(({className:e,...t},r)=>(0,f.jsx)("th",{ref:r,className:(0,em.f)("h-12 px-4 text-left align-middle font-medium text-muted-foreground [&:has([role=checkbox])]:pr-0",e),...t}));ex.displayName="TableHead";let eb=m.forwardRef(({className:e,...t},r)=>(0,f.jsx)("td",{ref:r,className:(0,em.f)("p-4 align-middle [&:has([role=checkbox])]:pr-0",e),...t}));eb.displayName="TableCell",(m.forwardRef(({className:e,...t},r)=>(0,f.jsx)("caption",{ref:r,className:(0,em.f)("mt-4 text-sm text-muted-foreground",e),...t}))).displayName="TableCaption";var ew=e.i(759659);let e_={name:"ban",size:24,node:[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M4.929 4.929 19.07 19.071",key:"196cmz"}]]};e_.node;let ej=(0,U.f)(e_);var ek=e.i(548161),ez=e.i(294114);function eN(){var e;let{t}=(0,h.b)(),[r,n]=(0,m.useState)(String(5)),[i,s]=(0,m.useState)(!1),a=(0,m.useCallback)(async()=>{try{let e=await v.k.get("/api/settings");n(String(e.aiConcurrencyLimit??5))}catch(e){x.V.error("[AiConcurrencyLimitSetting]","Failed to fetch config",{error:e})}},[]);(0,m.useEffect)(()=>{a()},[a]);let o=Number(r),l=""!==r.trim()&&"number"==typeof(e=o)&&Number.isInteger(e)&&e>=1&&e<=100,c=async()=>{if(l){s(!0);try{await v.k.post("/api/settings",{aiConcurrencyLimit:o}),ez.c.success(t.admin.aiConcurrencyLimitSaved)}catch(e){x.V.error("[AiConcurrencyLimitSetting]","Failed to update AI concurrency limit",{error:e}),ez.c.error(t.common.error)}finally{s(!1)}}};return(0,f.jsxs)("div",{className:"flex flex-col gap-3 p-4 border rounded-lg bg-muted/30 sm:flex-row sm:items-center sm:justify-between",children:[(0,f.jsxs)("div",{className:"space-y-0.5",children:[(0,f.jsx)(ef.f,{htmlFor:"ai-concurrency-limit",className:"text-base",children:t.admin.aiConcurrencyLimit}),(0,f.jsx)("p",{className:"text-sm text-muted-foreground",children:t.admin.aiConcurrencyLimitDesc})]}),(0,f.jsxs)("div",{className:"flex shrink-0 items-center gap-2",children:[(0,f.jsx)(ep.f,{id:"ai-concurrency-limit",type:"number",min:1,max:100,step:1,inputMode:"numeric",value:r,onChange:e=>n(e.target.value),"aria-invalid":!l,className:"w-24"}),(0,f.jsxs)(ea.f,{size:"sm",onClick:c,disabled:i||!l,children:[i&&(0,f.jsx)(Q.f,{className:"mr-2 h-4 w-4 animate-spin"}),t.common.save]})]})]})}function eS(){let{timeZone:e}=(0,P.M)(),{data:t}=(0,g.useSession)(),{t:r}=(0,h.b)(),[n,i]=(0,m.useState)([]),[s,a]=(0,m.useState)(!0),[o,l]=(0,m.useState)(!1),[c,d]=(0,m.useState)(!1),[u,p]=(0,m.useState)("0"),[b,w]=(0,m.useState)(!1),_=(0,m.useCallback)(async()=>{a(!0);try{let e=await v.k.get("/api/admin/users");i(e)}catch(e){x.V.error("[UserManagement]","Failed to fetch users",{error:e})}finally{a(!1)}},[]),j=(0,m.useCallback)(async()=>{try{let e=await v.k.get("/api/settings");l(!0===e.allowRegistration),p(String(e.aiDailyLimit??0))}catch(e){x.V.error("[UserManagement]","Failed to fetch config",{error:e})}},[]);(0,m.useEffect)(()=>{_(),j()},[_,j]);let k=async e=>{d(!0);try{await v.k.post("/api/settings",{allowRegistration:e}),l(e)}catch(e){x.V.error("[UserManagement]","Failed to update registration setting",{error:e}),ez.c.error(r.common.error)}finally{d(!1)}},z=Number(u),N=""!==u.trim()&&Number.isInteger(z)&&z>=0,S=async()=>{if(N){w(!0);try{await v.k.post("/api/settings",{aiDailyLimit:z}),ez.c.success(r.admin.aiDailyLimitSaved)}catch(e){x.V.error("[UserManagement]","Failed to update AI daily limit",{error:e}),ez.c.error(r.common.error)}finally{w(!1)}}},$=async e=>{let t=e.isActive?r.admin.confirmDisable:r.admin.confirmEnable;if(await (0,ez.u)(t))try{await v.k.patch(`/api/admin/users/${e.id}`,{isActive:!e.isActive}),_()}catch(e){x.V.error("[UserManagement]","Failed to update user status",{error:e}),ez.c.error(r.common.error)}},A=async e=>{if(await (0,ez.u)(r.admin.confirmDelete,{destructive:!0}))try{await v.k.delete(`/api/admin/users/${e.id}`),_()}catch(t){x.V.error("[UserManagement]","Failed to delete user",{error:t});let e=(0,y.d)(t)||r.common.error;ez.c.error(e)}};return s?(0,f.jsx)("div",{className:"flex justify-center py-8",children:(0,f.jsx)(Q.f,{className:"h-8 w-8 animate-spin text-muted-foreground"})}):(0,f.jsxs)("div",{className:"space-y-4",children:[(0,f.jsxs)("div",{className:"flex items-center justify-between p-4 border rounded-lg bg-muted/30",children:[(0,f.jsxs)("div",{className:"space-y-0.5",children:[(0,f.jsx)(ef.f,{className:"text-base",children:r.admin?.allowRegistration||"Allow New Registrations"}),(0,f.jsx)("p",{className:"text-sm text-muted-foreground",children:r.admin?.allowRegistrationDesc||"When disabled, new users cannot register"})]}),(0,f.jsxs)("div",{className:"flex items-center gap-2",children:[c&&(0,f.jsx)(Q.f,{className:"h-4 w-4 animate-spin"}),(0,f.jsx)(eu.f,{checked:o,onCheckedChange:k,disabled:c})]})]}),(0,f.jsxs)("div",{className:"flex flex-col gap-3 p-4 border rounded-lg bg-muted/30 sm:flex-row sm:items-center sm:justify-between",children:[(0,f.jsxs)("div",{className:"space-y-0.5",children:[(0,f.jsx)(ef.f,{htmlFor:"ai-daily-limit",className:"text-base",children:r.admin.aiDailyLimit}),(0,f.jsx)("p",{className:"text-sm text-muted-foreground",children:r.admin.aiDailyLimitDesc})]}),(0,f.jsxs)("div",{className:"flex shrink-0 items-center gap-2",children:[(0,f.jsx)(ep.f,{id:"ai-daily-limit",type:"number",min:0,step:1,inputMode:"numeric",value:u,onChange:e=>p(e.target.value),"aria-invalid":!N,className:"w-24"}),(0,f.jsxs)(ea.f,{size:"sm",onClick:S,disabled:b||!N,children:[b&&(0,f.jsx)(Q.f,{className:"mr-2 h-4 w-4 animate-spin"}),r.common.save]})]})]}),(0,f.jsx)(eN,{}),(0,f.jsx)("div",{className:"sm:hidden space-y-3",children:n.map(n=>(0,f.jsxs)("div",{className:"border rounded-lg p-4 bg-card space-y-3",children:[(0,f.jsxs)("div",{className:"flex justify-between items-start",children:[(0,f.jsxs)("div",{children:[(0,f.jsx)("div",{className:"font-medium",children:n.name||"N/A"}),(0,f.jsx)("div",{className:"text-sm text-muted-foreground",children:n.email})]}),(0,f.jsx)(ed.f,{variant:"admin"===n.role?"default":"secondary",children:"admin"===n.role?r.admin.admin:r.admin.user})]}),(0,f.jsxs)("div",{className:"flex justify-between text-sm",children:[(0,f.jsxs)("div",{className:"text-muted-foreground",children:[r.admin.errors,": ",n._count.errorItems," | ",r.admin.practiceCount,": ",n._count.practiceRecords," | ",r.admin.aiUsageToday,": ",n.aiUsageToday]}),(0,f.jsx)(ed.f,{variant:n.isActive?"default":"destructive",className:"text-xs",children:n.isActive?r.admin.active:r.admin.disabled})]}),(0,f.jsxs)("div",{className:"flex justify-between items-center pt-2 border-t",children:[(0,f.jsx)("div",{className:"text-xs text-muted-foreground",children:(0,ec.r)(n.createdAt,"yyyy-MM-dd",e)}),(0,f.jsxs)("div",{className:"flex gap-2",children:[(0,f.jsx)(ea.f,{variant:"ghost",size:"sm",onClick:()=>$(n),disabled:n.id===t?.user?.id,children:n.isActive?(0,f.jsx)(ej,{className:"h-4 w-4 text-orange-500"}):(0,f.jsx)(ek.f,{className:"h-4 w-4 text-green-500"})}),(0,f.jsx)(ea.f,{variant:"ghost",size:"sm",onClick:()=>A(n),disabled:n.id===t?.user?.id,children:(0,f.jsx)(ew.f,{className:"h-4 w-4 text-destructive"})})]})]})]},n.id))}),(0,f.jsx)("div",{className:"hidden sm:block border rounded-lg overflow-hidden",children:(0,f.jsxs)(eh,{children:[(0,f.jsx)(eg,{children:(0,f.jsxs)(ey,{children:[(0,f.jsx)(ex,{children:r.admin.nameEmail}),(0,f.jsx)(ex,{children:r.admin.role}),(0,f.jsx)(ex,{children:r.admin.stats}),(0,f.jsx)(ex,{children:r.admin.createdAt}),(0,f.jsx)(ex,{children:r.admin.status}),(0,f.jsx)(ex,{className:"text-right",children:r.admin.actions})]})}),(0,f.jsx)(ev,{children:n.map(n=>(0,f.jsxs)(ey,{children:[(0,f.jsxs)(eb,{children:[(0,f.jsx)("div",{className:"font-medium",children:n.name||"N/A"}),(0,f.jsx)("div",{className:"text-sm text-muted-foreground",children:n.email})]}),(0,f.jsx)(eb,{children:(0,f.jsx)(ed.f,{variant:"admin"===n.role?"default":"secondary",children:"admin"===n.role?r.admin.admin:r.admin.user})}),(0,f.jsxs)(eb,{children:[(0,f.jsxs)("div",{className:"text-sm",children:[r.admin.errors,": ",n._count.errorItems]}),(0,f.jsxs)("div",{className:"text-sm",children:[r.admin.practiceCount,": ",n._count.practiceRecords]}),(0,f.jsxs)("div",{className:"text-sm",children:[r.admin.aiUsageToday,": ",n.aiUsageToday]})]}),(0,f.jsx)(eb,{children:(0,ec.r)(n.createdAt,"yyyy-MM-dd",e)}),(0,f.jsx)(eb,{children:(0,f.jsx)(ed.f,{variant:n.isActive?"default":"destructive",children:n.isActive?r.admin.active:r.admin.disabled})}),(0,f.jsxs)(eb,{className:"text-right space-x-2",children:[(0,f.jsx)(ea.f,{variant:"ghost",size:"sm",onClick:()=>$(n),disabled:n.id===t?.user?.id,title:n.isActive?r.admin.disable:r.admin.enable,children:n.isActive?(0,f.jsx)(ej,{className:"h-4 w-4 text-orange-500"}):(0,f.jsx)(ek.f,{className:"h-4 w-4 text-green-500"})}),(0,f.jsx)(ea.f,{variant:"ghost",size:"sm",onClick:()=>A(n),disabled:n.id===t?.user?.id,title:r.admin.delete,children:(0,f.jsx)(ew.f,{className:"h-4 w-4 text-destructive"})})]})]},n.id))})]})})]})}var e$=e.i(482022);let eA={name:"scroll-text",size:24,node:[["path",{d:"M15 12h-5",key:"r7krc0"}],["path",{d:"M15 8h-5",key:"1khuty"}],["path",{d:"M19 17V5a2 2 0 0 0-2-2H4",key:"zz82l3"}],["path",{d:"M8 21h12a2 2 0 0 0 2-2v-1a1 1 0 0 0-1-1H11a1 1 0 0 0-1 1v1a2 2 0 1 1-4 0V5a2 2 0 1 0-4 0v2a1 1 0 0 0 1 1h3",key:"1ph1d7"}]]};eA.node;let eO=(0,U.f)(eA);function eE(e){return(0,f.jsxs)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...e,children:[(0,f.jsx)("path",{d:"M15 22v-4a4.8 4.8 0 0 0-1-3.5c3 0 6-2 6-5.5.08-1.25-.27-2.48-1-3.5.28-1.15.28-2.35 0-3.5 0 0-1 0-3 1.5-2.64-.5-5.36-.5-8 0C6 2 5 2 5 2c-.3 1.15-.3 2.35 0 3.5A5.403 5.403 0 0 0 4 9c0 3.5 3 5.5 6 5.5-.39.49-.68 1.05-.85 1.65-.17.6-.22 1.23-.15 1.85v4"}),(0,f.jsx)("path",{d:"M9 18c-4.51 2-5-2-7-2"})]})}let eT={name:"server",size:24,node:[["rect",{width:"20",height:"8",x:"2",y:"2",rx:"2",ry:"2",key:"ngkwjq"}],["rect",{width:"20",height:"8",x:"2",y:"14",rx:"2",ry:"2",key:"iecqi9"}],["line",{x1:"6",x2:"6.01",y1:"6",y2:"6",key:"16zg32"}],["line",{x1:"6",x2:"6.01",y1:"18",y2:"18",key:"nzw8ys"}]]};eT.node;let eP=(0,U.f)(eT);function eC(){return window.WrongNotebookAndroid??null}let eI=()=>()=>void 0;function eD(){let{t:e}=(0,h.b)(),t=(0,m.useSyncExternalStore)(eI,eC,()=>null);return t?t.isStandalone?.()?(0,f.jsx)("p",{className:"text-center text-sm text-muted-foreground",children:e.settings?.about?.androidStandalone||"Running on this device. Data is stored only on this device."}):(0,f.jsxs)("div",{className:"flex flex-col items-center gap-2 text-sm text-muted-foreground",children:[(0,f.jsxs)("span",{className:"break-all",children:[e.settings?.about?.androidServer||"Server",": ",t.getServerUrl()]}),(0,f.jsxs)(ea.f,{variant:"outline",className:"gap-2",onClick:()=>t.changeServer(),children:[(0,f.jsx)(eP,{className:"h-4 w-4"}),e.settings?.about?.changeServer||"Change server"]})]}):null}var eZ=e.i(637691);function eF(){let{t:e}=(0,h.b)(),[t,r]=(0,m.useState)("");(0,m.useEffect)(()=>{fetch("/api/version").then(e=>e.json()).then(e=>r(e.version)).catch(()=>{})},[]);let n=[{href:eZ.f,icon:eE,label:e.settings?.about?.github||"GitHub Repository"},{href:`${eZ.f}/releases`,icon:eO,label:e.settings?.about?.releaseNotes||"Release Notes"},{href:`${eZ.f}/issues`,icon:et,label:e.settings?.about?.feedback||"Feedback"}];return(0,f.jsxs)("div",{className:"flex flex-col items-center justify-center space-y-6 py-8 text-center bg-muted/30 rounded-lg border",children:[(0,f.jsxs)("div",{className:"space-y-2",children:[(0,f.jsx)("h3",{className:"text-2xl font-bold",children:e.app?.title||"Smart Error Notebook"}),(0,f.jsx)("p",{className:"text-muted-foreground",children:e.settings?.about?.desc||"AI-powered learning assistant"})]}),(0,f.jsxs)("div",{className:"flex items-center space-x-2 text-sm text-muted-foreground border px-4 py-2 rounded-full bg-background",children:[(0,f.jsx)(X,{className:"h-4 w-4"}),(0,f.jsxs)("span",{children:[e.settings?.about?.version||"Version",": v",t||"unknown"]})]}),(0,f.jsx)(eD,{}),(0,f.jsx)("div",{className:"flex flex-col sm:flex-row flex-wrap justify-center gap-4 w-full sm:w-auto px-4 sm:px-0",children:n.map(({href:e,icon:t,label:r})=>(0,f.jsx)(ea.f,{variant:"outline",asChild:!0,className:"gap-2 w-full sm:w-auto",children:(0,f.jsxs)("a",{href:e,target:"_blank",rel:"noopener noreferrer",children:[(0,f.jsx)(t,{className:"h-4 w-4"}),r,(0,f.jsx)(e$.f,{className:"h-3 w-3 ml-1 opacity-50"})]})},e))}),(0,f.jsx)("p",{className:"text-xs text-muted-foreground mt-8",children:e.settings?.about?.copyright||"© 2026 margrop · Based on wttwins/wrong-notebook · MIT License"})]})}var eR=e.i(37038),eM=e.i(967489),eL=e.i(676167);let eU={name:"",email:"",educationStage:"",enrollmentYear:"",currentGrade:"",currentSemester:"",password:""};function eG(){let{t:e}=(0,h.b)(),[t,r]=(0,m.useState)(eU),[n,i]=(0,m.useState)(""),[s,a]=(0,m.useState)(!0),[o,l]=(0,m.useState)(!1),c=(0,m.useCallback)(async()=>{try{let e=await v.k.get("/api/user"),t=e.fixedGradeSemester?(0,eL.p)(e.fixedGradeSemester):null;r({name:e.name||"",email:e.email||"",educationStage:e.educationStage||"",enrollmentYear:e.enrollmentYear||"",currentGrade:t?.grade||"",currentSemester:t?.semester||"",password:""})}catch(e){x.V.error("[AccountSettings]","Failed to fetch profile",{error:e})}finally{a(!1)}},[]);(0,m.useEffect)(()=>{c()},[c]);let d=async()=>{if(t.password&&t.password!==n)return void ez.c.error(e.settings?.messages?.passwordMismatch||"Passwords do not match");l(!0);try{let n={name:t.name,email:t.email,educationStage:t.educationStage};t.enrollmentYear&&(n.enrollmentYear=parseInt(t.enrollmentYear.toString())),t.password&&(n.password=t.password),t.currentGrade&&t.currentSemester?n.fixedGradeSemester=`${t.currentGrade}${t.currentSemester}`:t.currentGrade||(n.fixedGradeSemester=null),await v.k.patch("/api/user",n),ez.c.success(e.settings?.messages?.profileUpdated||"Profile updated"),r(e=>({...e,password:""})),i(""),window.location.reload()}catch(t){x.V.error("[AccountSettings]","Failed to update profile",{error:(0,y.d)(t)??(0,y.Z)(t)}),ez.c.error((0,y.d)(t)||e.settings?.messages?.updateFailed||"Update failed")}finally{l(!1)}};return s?(0,f.jsx)("div",{className:"flex justify-center py-8",children:(0,f.jsx)(Q.f,{className:"h-8 w-8 animate-spin text-muted-foreground"})}):(0,f.jsxs)("div",{className:"space-y-4 border rounded-lg p-4 bg-muted/30",children:[(0,f.jsxs)("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-4",children:[(0,f.jsxs)("div",{className:"space-y-2",children:[(0,f.jsx)(ef.f,{children:e.auth?.name||"Name"}),(0,f.jsx)(ep.f,{value:t.name||"",onChange:e=>r({...t,name:e.target.value})})]}),(0,f.jsxs)("div",{className:"space-y-2",children:[(0,f.jsx)(ef.f,{children:e.auth?.email||"Email"}),(0,f.jsx)(ep.f,{value:t.email||"",onChange:e=>r({...t,email:e.target.value}),type:"email"})]})]}),(0,f.jsxs)("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-4",children:[(0,f.jsxs)("div",{className:"space-y-2",children:[(0,f.jsx)(ef.f,{children:e.auth?.educationStage||"Education Stage"}),(0,f.jsxs)(eM.d,{value:t.educationStage||"",onValueChange:e=>r({...t,educationStage:e,currentGrade:(0,eL.c)(e).includes(t.currentGrade)?t.currentGrade:"",currentSemester:(0,eL.c)(e).includes(t.currentGrade)?t.currentSemester:""}),children:[(0,f.jsx)(eM.P,{children:(0,f.jsx)(eM.U,{placeholder:e.auth?.selectStage||"Select Stage"})}),(0,f.jsxs)(eM.r,{children:[(0,f.jsx)(eM.T,{value:"primary",children:e.auth?.primary||"Primary School"}),(0,f.jsx)(eM.T,{value:"junior_high",children:e.auth?.juniorHigh||"Junior High"}),(0,f.jsx)(eM.T,{value:"senior_high",children:e.auth?.seniorHigh||"Senior High"}),(0,f.jsx)(eM.T,{value:"university",children:e.auth?.university||"University"})]})]})]}),(0,f.jsxs)("div",{className:"space-y-2",children:[(0,f.jsx)(ef.f,{children:e.auth?.enrollmentYear||"Enrollment Year"}),(0,f.jsx)(ep.f,{type:"number",value:t.enrollmentYear||"",onChange:e=>r({...t,enrollmentYear:e.target.value}),placeholder:"YYYY"})]})]}),t.educationStage&&(0,eL.c)(t.educationStage).length>0&&(0,f.jsxs)("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-4",children:[(0,f.jsxs)("div",{className:"space-y-2",children:[(0,f.jsx)(ef.f,{children:e.settings?.account?.currentGrade||"Current Grade & Semester"}),(0,f.jsxs)(eM.d,{value:t.currentGrade||"",onValueChange:e=>r({...t,currentGrade:e,currentSemester:e?t.currentSemester||"上":""}),children:[(0,f.jsx)(eM.P,{children:(0,f.jsx)(eM.U,{placeholder:e.settings?.account?.selectGrade||"Select Grade"})}),(0,f.jsx)(eM.r,{children:(0,eL.c)(t.educationStage).map(e=>(0,f.jsx)(eM.T,{value:e,children:e},e))})]})]}),t.currentGrade&&(0,f.jsxs)("div",{className:"space-y-2",children:[(0,f.jsx)(ef.f,{children:e.settings?.account?.selectSemester||"Select Semester"}),(0,f.jsxs)(eM.d,{value:t.currentSemester||"",onValueChange:e=>r({...t,currentSemester:e}),children:[(0,f.jsx)(eM.P,{children:(0,f.jsx)(eM.U,{placeholder:e.settings?.account?.selectSemester||"Select Semester"})}),(0,f.jsxs)(eM.r,{children:[(0,f.jsx)(eM.T,{value:"上",children:e.settings?.account?.firstSemester||"1st Semester"}),(0,f.jsx)(eM.T,{value:"下",children:e.settings?.account?.secondSemester||"2nd Semester"})]})]})]})]}),t.currentGrade&&t.currentSemester&&(0,f.jsx)("p",{className:"text-xs text-muted-foreground -mt-2",children:e.settings?.account?.gradeAppliedHint||"New questions will default to this grade. You can also configure AI grade recognition in General Settings."}),(0,f.jsxs)("div",{className:"space-y-3 pt-2 border-t",children:[(0,f.jsxs)("div",{className:"space-y-2",children:[(0,f.jsx)(ef.f,{children:e.settings?.account?.changePassword||"Change Password (Leave empty to keep)"}),(0,f.jsx)(eR.f,{value:t.password,onChange:e=>r({...t,password:e.target.value}),placeholder:"******",minLength:6})]}),t.password&&(0,f.jsxs)("div",{className:"space-y-2",children:[(0,f.jsx)(ef.f,{children:e.auth?.confirmPassword||"Confirm Password"}),(0,f.jsx)(eR.f,{value:n,onChange:e=>i(e.target.value),placeholder:"******",minLength:6})]})]}),(0,f.jsxs)(ea.f,{onClick:d,disabled:o,className:"w-full",children:[o&&(0,f.jsx)(Q.f,{className:"mr-2 h-4 w-4 animate-spin"}),e.settings?.account?.update||"Update Profile"]})]})}var eV=e.i(10038);let eK={name:"upload",size:24,node:[["path",{d:"M12 3v12",key:"1x0j5s"}],["path",{d:"m17 8-5-5-5 5",key:"7q97r8"}],["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}]]};eK.node;let eB=(0,U.f)(eK);function eJ(e){return e}function eq(e){return e}function eW(){return e=>e}function eH(e){}function eX(e){throw Error("Unexpected value in exhaustive check")}function eY(e){}function eQ(e){let t=Object.values(e).filter(e=>"number"==typeof e);return Object.entries(e).filter(([e,r])=>-1===t.indexOf(+e)).map(([e,t])=>t)}function e0(e,t="|"){return e.map(e=>tN(e)).join(t)}function e1(e,t){return"bigint"==typeof t?t.toString():t}class e2{constructor(e){this._getter=e,this._value=void 0}get value(){let e=this._getter;return void 0!==e&&(this._value=e(),this._getter=void 0),this._value}}function e4(e){return new e2(e)}function e3(e){return null==e}function e9(e){let t=+!!e.startsWith("^"),r=e.endsWith("$")?e.length-1:e.length;return e.slice(t,r)}function e5(e,t){let r=e/t,n=Math.round(r),i=4*Number.EPSILON*Math.max(Math.abs(r),1);return Math.abs(r-n)<i?0:r-n}let e6=Symbol("evaluating");function e8(e,t,r){let n;Object.defineProperty(e,t,{get(){if(n!==e6)return void 0===n&&(n=e6,n=r()),n},set(r){Object.defineProperty(e,t,{value:r})},configurable:!0})}function e7(e){return Object.create(Object.getPrototypeOf(e),Object.getOwnPropertyDescriptors(e))}function te(e,t,r){Object.defineProperty(e,t,{value:r,writable:!0,enumerable:!0,configurable:!0})}function tt(e){let t=Object.getOwnPropertyDescriptor(e,"shape");return t?.get?t.get.raw:t?.value}function tr(e){return tt(e._zod.def)??e._zod.def.shape}function tn(e,t,r){Object.defineProperty(e,t,{get(){let e=r();return te(this,t,e),e},enumerable:!0,configurable:!0})}function ti(e,t,r){t in e?te(e,t,r):e[t]=r}function ts(e,t,r,n){let i=tr(t);for(let s of r){let r=Object.getOwnPropertyDescriptor(i,s);r.enumerable&&(r.get?tn(e,s,()=>{let e=t._zod.def.shape[s];return n?n(e,s):e}):ti(e,s,n?n(r.value,s):r.value))}}function ta(...e){let t={};for(let r of e)Object.assign(t,Object.getOwnPropertyDescriptors(r));return Object.defineProperties({},t)}function to(e){return ta(e._zod.def)}function tl(e,t){return t?t.reduce((e,t)=>e?.[t],e):e}function tc(e){let t=Object.keys(e);return Promise.all(t.map(t=>e[t])).then(e=>{let r={};for(let n=0;n<t.length;n++)r[t[n]]=e[n];return r})}function td(e=10){let t="abcdefghijklmnopqrstuvwxyz",r="";for(let n=0;n<e;n++)r+=t[Math.floor(Math.random()*t.length)];return r}function tu(e){return JSON.stringify(e)}function tp(e){return e.toLowerCase().trim().replace(/[^\w\s-]/g,"").replace(/[\s_-]+/g,"-").replace(/^-+|-+$/g,"")}let tf="captureStackTrace"in Error?Error.captureStackTrace:(...e)=>{};function tm(e){return"object"==typeof e&&null!==e&&!Array.isArray(e)}let th=e4(()=>{if(ru.jitless||"u">typeof navigator&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{return Function(""),!0}catch(e){return!1}});function tg(e){if(!1===tm(e))return!1;let t=e.constructor;if(void 0===t||"function"!=typeof t)return!0;let r=t.prototype;return!1!==tm(r)&&!1!==Object.prototype.hasOwnProperty.call(r,"isPrototypeOf")}function tv(e){return tg(e)?{...e}:Array.isArray(e)?[...e]:e instanceof Map?new Map(e):e instanceof Set?new Set(e):e}function ty(e){let t=0;for(let r in e)Object.prototype.hasOwnProperty.call(e,r)&&t++;return t}let tx=e=>{let t=typeof e;switch(t){case"undefined":return"undefined";case"string":return"string";case"number":return Number.isNaN(e)?"nan":"number";case"boolean":return"boolean";case"function":return"function";case"bigint":return"bigint";case"symbol":return"symbol";case"object":if(Array.isArray(e))return"array";if(null===e)return"null";if(e.then&&"function"==typeof e.then&&e.catch&&"function"==typeof e.catch)return"promise";if("u">typeof Map&&e instanceof Map)return"map";if("u">typeof Set&&e instanceof Set)return"set";if("u">typeof Date&&e instanceof Date)return"date";if("u">typeof File&&e instanceof File)return"file";return"object";default:throw Error(`Unknown data type: ${t}`)}},tb=new Set(["string","number","symbol"]),tw=new Set(["string","number","bigint","boolean","symbol","undefined"]);function t_(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function tj(e,t,r){let n=new e._zod.constr(t??e._zod.def);return(!t||r?.parent)&&(n._zod.parent=e),n}function tk(e){if(!e)return{};if("string"==typeof e)return{error:()=>e};if(e?.message!==void 0){if(e?.error!==void 0)throw Error("Cannot specify both `message` and `error` params");e.error=e.message}return(delete e.message,"string"==typeof e.error)?{...e,error:()=>e.error}:e}function tz(e){let t;return new Proxy({},{get:(r,n,i)=>(t??(t=e()),Reflect.get(t,n,i)),set:(r,n,i,s)=>(t??(t=e()),Reflect.set(t,n,i,s)),has:(r,n)=>(t??(t=e()),Reflect.has(t,n)),deleteProperty:(r,n)=>(t??(t=e()),Reflect.deleteProperty(t,n)),ownKeys:r=>(t??(t=e()),Reflect.ownKeys(t)),getOwnPropertyDescriptor:(r,n)=>(t??(t=e()),Reflect.getOwnPropertyDescriptor(t,n)),defineProperty:(r,n,i)=>(t??(t=e()),Reflect.defineProperty(t,n,i))})}function tN(e){return"bigint"==typeof e?e.toString()+"n":"string"==typeof e?`"${e}"`:`${e}`}function tS(e){return Object.keys(e).filter(t=>void 0!==e[t]._zod.optin&&"optional"===e[t]._zod.optout)}let t$={safeint:[Number.MIN_SAFE_INTEGER,Number.MAX_SAFE_INTEGER],int32:[-0x80000000,0x7fffffff],uint32:[0,0xffffffff],float32:[-34028234663852886e22,34028234663852886e22],float64:[-Number.MAX_VALUE,Number.MAX_VALUE]},tA={int64:[BigInt("-9223372036854775808"),BigInt("9223372036854775807")],uint64:[BigInt(0),BigInt("18446744073709551615")]};function tO(e,t){let r=e._zod.def,n=r.checks;if(n&&n.length>0)throw Error(".pick() cannot be used on object schemas containing refinements");let i={};return ts(i,e,tE(e,t)),tj(e,ta(r,{shape:i,checks:[]}))}function tE(e,t){let r=tr(e),n=[];for(let e of Reflect.ownKeys(t)){if(!Object.getOwnPropertyDescriptor(r,e)?.enumerable)throw Error(`Unrecognized key: "${String(e)}"`);t[e]&&n.push(e)}return n}function tT(e,t){let r=e._zod.def,n=r.checks;if(n&&n.length>0)throw Error(".omit() cannot be used on object schemas containing refinements");let i=new Set(tE(e,t)),s={};return ts(s,e,Reflect.ownKeys(tr(e)).filter(e=>!i.has(e))),tj(e,ta(r,{shape:s,checks:[]}))}function tP(e,t){if(!tg(t))throw Error("Invalid input to extend: expected a plain object");let r=e._zod.def.checks;if(r&&r.length>0){let r=tr(e);for(let e of Reflect.ownKeys(t))if(void 0!==Object.getOwnPropertyDescriptor(r,e))throw Error("Cannot overwrite keys on object schemas containing refinements. Use `.safeExtend()` instead.")}return tj(e,ta(e._zod.def,{shape:tC(e,t)}))}function tC(e,t){let r={};ts(r,e,Reflect.ownKeys(tr(e)));for(let e of Reflect.ownKeys(t)){let n=Object.getOwnPropertyDescriptor(t,e);n.enumerable&&(n.get?tn(r,e,()=>t[e]):ti(r,e,n.value))}return r}function tI(e,t){if(!tg(t))throw Error("Invalid input to safeExtend: expected a plain object");return tj(e,ta(e._zod.def,{shape:tC(e,t)}))}function tD(e,t){if(!t?._zod?.def)throw Error("Invalid input to merge: expected an object schema. To merge a plain shape, use `.extend()`.");if(e._zod.def.checks?.length)throw Error(".merge() cannot be used on object schemas containing refinements. Use .safeExtend() instead.");let r={};ts(r,e,Reflect.ownKeys(tr(e))),ts(r,t,Reflect.ownKeys(tr(t)));let n=ta(e._zod.def,{shape:r,get catchall(){return t._zod.def.catchall},checks:t._zod.def.checks??[]});return tj(e,n)}function tZ(e,t,r,n="partial"){let i=t._zod.def.checks;if(i&&i.length>0)throw Error(`.${n}() cannot be used on object schemas containing refinements`);let s=r?new Set(tE(t,r)):void 0,a={};return ts(a,t,Reflect.ownKeys(tr(t)),e&&((t,r)=>s&&!s.has(r)?t:new e({type:"optional",innerType:t}))),tj(t,ta(t._zod.def,{shape:a,checks:[]}))}function tF(e,t,r){let n=r?new Set(tE(t,r)):void 0,i={};return ts(i,t,Reflect.ownKeys(tr(t)),(t,r)=>n&&!n.has(r)?t:new e({type:"nonoptional",innerType:t})),tj(t,ta(t._zod.def,{shape:i}))}function tR(e,t=0){if(!0===e.aborted)return!0;for(let r=t;r<e.issues.length;r++)if(e.issues[r]?.continue!==!0)return!0;return!1}function tM(e,t=0){if(!0===e.aborted)return!0;for(let r=t;r<e.issues.length;r++)if(e.issues[r]?.continue===!1)return!0;return!1}function tL(e,t){return t.map(t=>(t.path??(t.path=[]),t.path.unshift(e),t))}function tU(e){return"string"==typeof e?e:e?.message}function tG(e){let t=[];for(let r of e??[]){let e=r._zod.def;if(!/_(length|size)$|_equals$/.test(e.check))break;let n=e.maximum??e.length??e.size;n>=0&&t.push([n,r])}return t}function tV(e,t,r){var n;for(let i=t;i<e.length;i++)(n=e[i]).schema??(n.schema=r)}function tK(e,t,r){let n=e.inst?._zod?.traits;n?.has("$ZodType")&&(n.has("$ZodCheck")?e.schema??(e.schema=e.inst):e.schema=e.inst);let i=e.schema!==e.inst?e.schema?._zod.def?.error:void 0,s=e.message?e.message:tU(e.inst?._zod.def?.error?.(e))??tU(i?.(e))??tU(t?.error?.(e))??tU(r.customError?.(e))??tU(r.localeError?.(e))??"Invalid input",a={};for(let t of Object.keys(e))"inst"!==t&&"schema"!==t&&"continue"!==t&&"input"!==t&&"__proto__"!==t&&(a[t]=e[t]);return a.path??(a.path=[]),a.message=s,t?.reportInput&&(a.input=e.input),a}function tB(e){return e instanceof Set?"set":e instanceof Map?"map":e instanceof File?"file":"unknown"}let tJ=/[\uD800-\uDBFF]/;function tq(e){let t=e.length;if(!tJ.test(e))return t;let r=t;for(let n=0;n<t-1;n++)(64512&e.charCodeAt(n))==55296&&(64512&e.charCodeAt(n+1))==56320&&(r--,n++);return r}function tW(e){return Array.isArray(e)?"array":"string"==typeof e?"string":"unknown"}function tH(e){let t=typeof e;switch(t){case"number":return Number.isNaN(e)?"nan":"number";case"object":if(null===e)return"null";if(Array.isArray(e))return"array";if(e&&Object.getPrototypeOf(e)!==Object.prototype&&"constructor"in e&&e.constructor)return e.constructor.name}return t}function tX(...e){let[t,r,n]=e;return"string"==typeof t?{message:t,code:"custom",input:r,inst:n}:{...t}}function tY(e){return Object.entries(e).filter(([e,t])=>Number.isNaN(Number.parseInt(e,10))).map(e=>e[1])}function tQ(e){let t=atob(e),r=new Uint8Array(t.length);for(let e=0;e<t.length;e++)r[e]=t.charCodeAt(e);return r}function t0(e){let t="";for(let r=0;r<e.length;r++)t+=String.fromCharCode(e[r]);return btoa(t)}function t1(e){let t=e.replace(/-/g,"+").replace(/_/g,"/"),r="=".repeat((4-t.length%4)%4);return tQ(t+r)}function t2(e){return t0(e).replace(/\+/g,"-").replace(/\//g,"_").replace(/=/g,"")}function t4(e){let t=e.replace(/^0x/,"");if(t.length%2!=0)throw Error("Invalid hex string length");let r=new Uint8Array(t.length/2);for(let e=0;e<t.length;e+=2)r[e/2]=Number.parseInt(t.slice(e,e+2),16);return r}function t3(e){return Array.from(e).map(e=>e.toString(16).padStart(2,"0")).join("")}class t9{constructor(...e){}}function t5(e,t){for(let r in t){let n=Object.getOwnPropertyDescriptor(t,r);n.get?Object.defineProperty(e,r,{...n,enumerable:!1}):function(e,t,r){Object.defineProperty(e,t,{configurable:!0,get(){return this==null?r:t6(this,t,r.bind(this))},set(e){t6(this,t,e)}})}(e,r,n.value)}}function t6(e,t,r,n=!0){return Object.defineProperty(e,t,{configurable:!0,writable:!0,enumerable:n,value:r}),r}function t8(e,t,r){return t6(e,t,r,!1)}function t7(e,t){for(let r in e){let n=e[r];Object.defineProperty(t,r,{configurable:!0,enumerable:!0,get(){return t6(this,r,n(this))},set(e){t6(this,r,e)}})}return t}let re=!1,rt={configurable:!0,get(){re=!0}};function rr(e,r,n){let i=Object.getPrototypeOf(e._zod);if(r in i&&t!==e._zod){t=void 0;return}t=e._zod,Object.defineProperty(i,r,{configurable:!0,get(){Object.defineProperty(this,r,rt);let e=re;re=!1;try{let t=n(this);return re?delete this[r]:Object.defineProperty(this,r,{configurable:!0,writable:!0,value:t}),re=re||e,t}catch(t){throw delete this[r],re=re||e,t}},set(e){Object.defineProperty(this,r,{configurable:!0,writable:!0,value:e})}})}function rn(e,t,r,n){let i,s=t in(i=Object.getPrototypeOf(e))?void 0:i;s&&Object.defineProperty(s,t,{configurable:!0,get(){let e={configurable:!0,writable:!0,enumerable:n,value:void 0};return Object.defineProperty(this,t,e),e.value=r(this),Object.defineProperty(this,t,e),e.value},set(e){Object.defineProperty(this,t,{configurable:!0,writable:!0,enumerable:n,value:e})}})}let ri="~constantCatch";function rs(e){let t=()=>e;return t[ri]=!0,t}let ra={value:void 0,enumerable:!1},ro="captureStackTrace"in Error?Error:null;function rl(e,t,r,n){function i(e){this.def=e,this.constr=c,this.traits=new Set}i.prototype={};let s=r&&new WeakSet;function a(n,a){if(n._zod){if(n._zod.traits.has(e))return}else{ra.value=new i(a);try{Object.defineProperty(n,"_zod",ra)}finally{ra.value=void 0}}if(n._zod.traits.add(e),t(n,a),s){let e=Object.getPrototypeOf(n),t=n._zod.constr.prototype,i=e;for(;i&&i!==t;)i=Object.getPrototypeOf(i);let a=i??e;s.has(a)||(s.add(a),t5(a,r))}let o=c.prototype;for(let e in o)Object.prototype.hasOwnProperty.call(o,e)&&(e in n||(n[e]=o[e].bind(n)))}let o=n?.Parent??Object;class l extends o{}function c(e){let t=n?.Parent?function(e){let t=ro;if(t){let r=t.stackTraceLimit;if("number"==typeof r){try{t.stackTraceLimit=0}catch{return ro=null,new e}try{return new e}finally{t.stackTraceLimit=r}}}return new e}(l):this;a(t,e);let r=t._zod.deferred;if(r){for(let e of r)e();t._zod.deferred=void 0}let i=globalThis.__zod_globalConfig?.postProcessor;return i&&i(t),t}return Object.defineProperty(l,"name",{value:e}),Object.defineProperty(c,"init",{value:a}),Object.defineProperty(c,Symbol.hasInstance,{value:t=>!!n?.Parent&&t instanceof n.Parent||t?._zod?.traits?.has(e)}),Object.defineProperty(c,"name",{value:e}),c}class rc extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}}class rd extends Error{constructor(e){super(`Encountered unidirectional transform during encode: ${e}`),this.name="ZodEncodeError"}}(u=globalThis).__zod_globalConfig??(u.__zod_globalConfig={});let ru=globalThis.__zod_globalConfig;function rp(e){return e&&Object.assign(ru,e),ru}class rf extends Error{constructor(){super("Cannot parse a reference cycle that closes through a transform"),this.name="ZodCyclicError"}}let rm="~memo",rh=[];function rg(e){return null!==e&&"object"==typeof e}function rv(e){return e.map(e=>e.path?{...e,path:e.path.slice()}:{...e})}let ry=new WeakMap,rx=[],rb={alloc(e,t,n){let i=r;if(!i)return n;r=void 0;let s={value:n,issues:null};return i.set(t.value,s),rx.push(s),n},guard(e){var t;(t=e._zod).deferred??(t.deferred=[]),e._zod.deferred.push(()=>{let t=e._zod.parse,r=(e,r)=>{var n,i;let s;if("backward"!==r.direction&&(n=r,i=e.value,void 0!==(s=n[rm]?.backEdges)&&rg(i)&&s.has(i)))throw new rf;return t(e,r)};e._zod.parse=r,e._zod.run===t&&(e._zod.run=r)})},attach(e){var t;let n,i,s,a=!1;(t=e._zod).deferred??(t.deferred=[]),e._zod.deferred.push(()=>{let t=e._zod.parse,o=(l,c)=>{let d;if(void 0===n){let r=function e(t,r,n){var i,s;let a=ry.get(t);if(void 0!==a)return 2*!!a;if(r.has(t))return 2;r.add(t);let o=0,l=t=>{if(2!==o&&t?._zod){let i=e(t,r,n);i>o&&(o=i)}},c=e=>{e>o&&(o=e)},d=t._zod.def;switch(d.type){case"object":{let t=tt(d);c(t?((t,i)=>{let s=0;for(let a of Reflect.ownKeys(t)){let o=Object.getOwnPropertyDescriptor(t,a);if(i&&!o.enumerable)continue;let l=o.get?1:o.value?._zod?e(o.value,r,n):0;l>s&&(s=l)}return s})(t,!0):1),l(d.catchall);break}case"array":l(d.element);break;case"tuple":for(let e of d.items)l(e);l(d.rest);break;case"record":case"map":l(d.keyType),l(d.valueType);break;case"set":l(d.valueType);break;case"union":for(let e of d.options)l(e);break;case"intersection":l(d.left),l(d.right);break;case"optional":case"nullable":case"default":case"prefault":case"catch":case"readonly":case"nonoptional":case"promise":case"success":l(d.innerType);break;case"pipe":l(d.in),l(d.out);break;case"function":l(d.input),l(d.output);break;case"lazy":{let i=d._cachedInner??(n?t._zod.innerType:void 0);c(i?e(i,r,!1):1);break}case"template_literal":case"string":case"number":case"int":case"boolean":case"bigint":case"symbol":case"undefined":case"null":case"void":case"never":case"any":case"unknown":case"date":case"nan":case"enum":case"literal":case"file":case"transform":case"custom":break;default:for(let e in d){let t=Object.getOwnPropertyDescriptor(d,e);if(!t||t.get)continue;let r=t.value;if(r&&"object"==typeof r){if(r._zod)l(r);else if(Array.isArray(r))for(let e of r)l(e)}}}return r.delete(t),i=t,1!==(s=o)&&ry.set(i,2===s),s}(e,new Set,!1);if(0===r)return e._zod.parse=t,e._zod.run===o&&(e._zod.run=t),t(l,c);2===r||a?n=!0:a=!0}let u=l.value;if(!rg(u))return t(l,c);let p=c[rm];if(p||(p={buckets:new WeakMap,backEdges:void 0},c[rm]=p),i===c)d=s;else{var f;let t;(t=(f=p).buckets.get(e))||(t=new WeakMap,f.buckets.set(e,t)),d=t,i=c,s=d}let m=d.get(u);if(m)return l.value=m.value,m.issues?m.issues.length&&l.issues.push(...rv(m.issues)):(l.memo=!0,p.backEdges??(p.backEdges=new WeakSet),p.backEdges.add(m.value)),l;r=d;let h=rx.length,g=t(l,c);r=void 0;let v=rx.length>h?rx.pop():void 0;return g instanceof Promise?g.then(e=>(v&&(v.issues=e.issues.length?rv(e.issues):rh),e)):(v&&(v.issues=g.issues.length?rv(g.issues):rh),g)};e._zod.parse=o,e._zod.run===t&&(e._zod.run=o)})}};(p=globalThis).__zod_globalRegistry??(p.__zod_globalRegistry=new class e{constructor(){this._map=new WeakMap,this._idmap=new Map}add(e,...t){let r=t[0];return this._map.set(e,r),r&&"object"==typeof r&&"id"in r&&this._idmap.set(r.id,e),this}clear(){return this._map=new WeakMap,this._idmap=new Map,this}remove(e){let t=this._map.get(e);return t&&"object"==typeof t&&"id"in t&&this._idmap.delete(t.id),this._map.delete(e),this}get(e){let t=e._zod.parent;if(t){let r={...this.get(t)??{}};delete r.id;let n={...r,...this._map.get(e)};return Object.keys(n).length?n:void 0}return this._map.get(e)}has(e){return this._map.has(e)}});let rw=globalThis.__zod_globalRegistry,r_=/^[cC][0-9a-z]{6,}$/,rj=/^[0-9a-z]+$/,rk=/^[0-7][0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{25}$/,rz=/^[0-9a-vA-V]{20}$/,rN=/^[A-Za-z0-9]{27}$/,rS=/^[a-zA-Z0-9_-]{21}$/;function r$(e){return RegExp(`^[a-zA-Z0-9_-]{${e}}$`)}let rA=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,rO=/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$/,rE=e=>e?RegExp(`^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-${e}[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$`):/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$/,rT=rE(4),rP=rE(6),rC=rE(7),rI=/^(?:[A-Za-z0-9_'+\-]+\.)*[A-Za-z0-9_'+\-]*[A-Za-z0-9_+-]@(?:[A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,rD=/^[^\s@"]{1,64}@[^\s@]{1,255}$/u;function rZ(){return RegExp("^(?=[\\s\\S]*[\\p{Extended_Pictographic}\\p{Regional_Indicator}\\u20E3])[\\p{Extended_Pictographic}\\p{Emoji_Component}]+$","u")}let rF=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,rR=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:))$/,rM=e=>{let t=t_(e??":");return RegExp(`^(?:[0-9A-F]{2}${t}){5}[0-9A-F]{2}$|^(?:[0-9a-f]{2}${t}){5}[0-9a-f]{2}$`)},rL=/^((25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/([0-9]|[1-2][0-9]|3[0-2])$/,rU=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,rG=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,rV=/^(?:[A-Za-z0-9_-]{4})*(?:[A-Za-z0-9_-]{2,3})?$/,rK=/^https?$/,rB=/^\+[1-9]\d{6,14}$/,rJ=/^\d(?:[ -]?\d){11,18}$/,rq=/^[A-Z]{2}(?!00|01|99)\d{2}[A-Z0-9]{11,30}$/,rW="(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))",rH=RegExp(`^${rW}$`);function rX(e){let t="(?:[01]\\d|2[0-3]):[0-5]\\d";return"number"==typeof e.precision?-1===e.precision?`${t}`:0===e.precision?`${t}:[0-5]\\d`:`${t}:[0-5]\\d\\.\\d{${e.precision}}`:e.seconds?`${t}:[0-5]\\d(?:\\.\\d+)?`:`${t}(?::[0-5]\\d(?:\\.\\d+)?)?`}function rY(e){return RegExp(`^${rX(e)}$`)}function rQ(e){let t=["Z"];e.offset&&t.push("([+-](?:[01]\\d|2[0-3]):[0-5]\\d)");let r=`${rX({precision:e.precision,seconds:!0})}(?:${t.join("|")})`,n=e.local?`${r}|${rX({precision:e.precision})}`:r;return RegExp(`^${rW}T(?:${n})$`)}let r0=/^[\s\S]{0,}$/,r1=e=>{let t=e?`[\\s\\S]{${e?.minimum??0},${e?.maximum??""}}`:"[\\s\\S]*";return RegExp(`^${t}$`)},r2=/^-?\d+n?$/,r4=/^-?\d+$/,r3=/^-?\d+(?:\.\d+)?$/,r9=/^(?:true|false)$/i,r5=/^null$/i,r6=/^undefined$/i,r8=/^[^A-Z]*$/,r7=/^[^a-z]*$/;function ne(e,t){return RegExp(`^[A-Za-z0-9+/]{${e}}${t}$`)}function nt(e){return RegExp(`^[A-Za-z0-9_-]{${e}}$`)}let nr=ne(22,"=="),nn=nt(22),ni=ne(27,"="),ns=nt(27),na=ne(43,"="),no=nt(43),nl=ne(64,""),nc=nt(64),nd=ne(86,"=="),nu=nt(86);e.s(["anyString",0,r0,"base64",0,rG,"base64url",0,rV,"bigint",0,r2,"boolean",0,r9,"browserEmail",0,/^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/,"cidrv4",0,rL,"cidrv6",0,rU,"creditCard",0,rJ,"cuid",0,r_,"cuid2",0,rj,"currencyCode",0,/^(?:AED|AFN|ALL|AMD|AOA|ARS|AUD|AWG|AZN|BAM|BBD|BDT|BHD|BIF|BMD|BND|BOB|BOV|BRL|BSD|BTN|BWP|BYN|BZD|CAD|CDF|CHE|CHF|CHW|CLF|CLP|CNY|COP|COU|CRC|CUP|CVE|CZK|DJF|DKK|DOP|DZD|EGP|ERN|ETB|EUR|FJD|FKP|GBP|GEL|GHS|GIP|GMD|GNF|GTQ|GYD|HKD|HNL|HTG|HUF|IDR|ILS|INR|IQD|IRR|ISK|JMD|JOD|JPY|KES|KGS|KHR|KMF|KPW|KRW|KWD|KYD|KZT|LAK|LBP|LKR|LRD|LSL|LYD|MAD|MDL|MGA|MKD|MMK|MNT|MOP|MRU|MUR|MVR|MWK|MXN|MXV|MYR|MZN|NAD|NGN|NIO|NOK|NPR|NZD|OMR|PAB|PEN|PGK|PHP|PKR|PLN|PYG|QAR|RON|RSD|RUB|RWF|SAR|SBD|SCR|SDG|SEK|SGD|SHP|SLE|SOS|SRD|SSP|STN|SVC|SYP|SZL|THB|TJS|TMT|TND|TOP|TRY|TTD|TWD|TZS|UAH|UGX|USD|USN|UYI|UYU|UYW|UZS|VED|VES|VND|VUV|WST|XAD|XAF|XAG|XAU|XBA|XBB|XBC|XBD|XCD|XCG|XDR|XOF|XPD|XPF|XPT|XSU|XTS|XUA|XXX|YER|ZAR|ZMW|ZWG)$/,"date",0,rH,"datetime",0,rQ,"domain",0,/^(?=.{1,253}$)([a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?\.)+[a-zA-Z]{2,63}$/,"duration",0,rA,"e164",0,rB,"email",0,rI,"emoji",0,rZ,"extendedDuration",0,/^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/,"guid",0,rO,"hex",0,/^[0-9a-fA-F]*$/,"hostname",0,/^(?=.{1,253}\.?$)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[-0-9a-zA-Z]{0,61}[0-9a-zA-Z])?)*\.?$/,"html5Email",0,/^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/,"httpProtocol",0,rK,"iban",0,rq,"idnEmail",0,rD,"integer",0,r4,"ipv4",0,rF,"ipv6",0,rR,"ksuid",0,rN,"lowercase",0,r8,"mac",0,rM,"md5_base64",0,nr,"md5_base64url",0,nn,"md5_hex",0,/^[0-9a-fA-F]{32}$/,"nanoid",0,rS,"nanoidOfLength",0,r$,"null",0,r5,"number",0,r3,"rfc5322Email",0,/^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/,"sha1_base64",0,ni,"sha1_base64url",0,ns,"sha1_hex",0,/^[0-9a-fA-F]{40}$/,"sha256_base64",0,na,"sha256_base64url",0,no,"sha256_hex",0,/^[0-9a-fA-F]{64}$/,"sha384_base64",0,nl,"sha384_base64url",0,nc,"sha384_hex",0,/^[0-9a-fA-F]{96}$/,"sha512_base64",0,nd,"sha512_base64url",0,nu,"sha512_hex",0,/^[0-9a-fA-F]{128}$/,"string",0,r1,"time",0,rY,"ulid",0,rk,"undefined",0,r6,"unicodeEmail",0,rD,"uppercase",0,r7,"uuid",0,rE,"uuid4",0,rT,"uuid6",0,rP,"uuid7",0,rC,"xid",0,rz],682358);let np=rl("$ZodCheck",(e,t)=>{var r;e._zod??(e._zod={}),e._zod.def=t,(r=e._zod).onattach??(r.onattach=[])}),nf=e=>{let t=e.value;return!e3(t)&&void 0!==t.size},nm=e=>{let t=e.value;return!e3(t)&&void 0!==t.length},nh={number:"number",bigint:"bigint",object:"date"},ng=rl("$ZodCheckLessThan",(e,t)=>{np.init(e,t);let r=nh[typeof t.value];e._zod.check=n=>{(t.inclusive?n.value<=t.value:n.value<t.value)||n.issues.push({origin:nh[typeof n.value]??r,code:"too_big",maximum:"object"==typeof t.value?t.value.getTime():t.value,input:n.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),nv=rl("$ZodCheckGreaterThan",(e,t)=>{np.init(e,t);let r=nh[typeof t.value];e._zod.check=n=>{(t.inclusive?n.value>=t.value:n.value>t.value)||n.issues.push({origin:nh[typeof n.value]??r,code:"too_small",minimum:"object"==typeof t.value?t.value.getTime():t.value,input:n.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),ny=rl("$ZodCheckMultipleOf",(e,t)=>{np.init(e,t),e._zod.check=r=>{if(typeof r.value!=typeof t.value)throw Error("Cannot mix number and bigint in multiple_of check.");("bigint"==typeof r.value?t.value!==BigInt(0)&&r.value%t.value===BigInt(0):0===e5(r.value,t.value))||r.issues.push({origin:typeof r.value,code:"not_multiple_of",divisor:t.value,input:r.value,inst:e,continue:!t.abort})}}),nx=rl("$ZodCheckNumberFormat",(e,t)=>{np.init(e,t),t.format=t.format||"float64";let r=t.format?.includes("int"),n=r?"int":"number",[i,s]=t$[t.format];e._zod.check=a=>{let o=a.value;if(r){if(!Number.isInteger(o))return void a.issues.push({expected:n,format:t.format,code:"invalid_type",continue:!1,input:o,inst:e});if(!Number.isSafeInteger(o))return void(o>0?a.issues.push({input:o,code:"too_big",maximum:Number.MAX_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:n,inclusive:!0,continue:!t.abort}):a.issues.push({input:o,code:"too_small",minimum:Number.MIN_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:n,inclusive:!0,continue:!t.abort}))}o<i&&a.issues.push({origin:"number",input:o,code:"too_small",minimum:i,inclusive:!0,inst:e,continue:!t.abort}),o>s&&a.issues.push({origin:"number",input:o,code:"too_big",maximum:s,inclusive:!0,inst:e,continue:!t.abort})}}),nb=rl("$ZodCheckBigIntFormat",(e,t)=>{np.init(e,t);let[r,n]=tA[t.format];e._zod.check=i=>{let s=i.value;s<r&&i.issues.push({origin:"bigint",input:s,code:"too_small",minimum:r,inclusive:!0,inst:e,continue:!t.abort}),s>n&&i.issues.push({origin:"bigint",input:s,code:"too_big",maximum:n,inclusive:!0,inst:e,continue:!t.abort})}}),nw=rl("$ZodCheckMaxSize",(e,t)=>{var r;np.init(e,t),(r=e._zod.def).when??(r.when=nf),e._zod.check=r=>{let n=r.value;n.size<=t.maximum||r.issues.push({origin:tB(n),code:"too_big",maximum:t.maximum,inclusive:!0,input:n,inst:e,continue:!t.abort})}}),n_=rl("$ZodCheckMinSize",(e,t)=>{var r;np.init(e,t),(r=e._zod.def).when??(r.when=nf),e._zod.check=r=>{let n=r.value;n.size>=t.minimum||r.issues.push({origin:tB(n),code:"too_small",minimum:t.minimum,inclusive:!0,input:n,inst:e,continue:!t.abort})}}),nj=rl("$ZodCheckSizeEquals",(e,t)=>{var r;np.init(e,t),(r=e._zod.def).when??(r.when=nf),e._zod.check=r=>{let n=r.value,i=n.size;if(i===t.size)return;let s=i>t.size;r.issues.push({origin:tB(n),...s?{code:"too_big",maximum:t.size}:{code:"too_small",minimum:t.size},inclusive:!0,exact:!0,input:r.value,inst:e,continue:!t.abort})}}),nk=rl("$ZodCheckMaxLength",(e,t)=>{var r;np.init(e,t),(r=e._zod.def).when??(r.when=nm),e._zod.check=r=>{let n=r.value,i=n.length;if(("string"==typeof n&&i>t.maximum?tq(n):i)<=t.maximum)return;let s=tW(n);r.issues.push({origin:s,code:"too_big",maximum:t.maximum,inclusive:!0,input:n,inst:e,continue:!t.abort})}}),nz=rl("$ZodCheckMinLength",(e,t)=>{var r;np.init(e,t),(r=e._zod.def).when??(r.when=nm),e._zod.check=r=>{let n=r.value,i=n.length;if(("string"==typeof n&&i>=t.minimum&&i<2*t.minimum?tq(n):i)>=t.minimum)return;let s=tW(n);r.issues.push({origin:s,code:"too_small",minimum:t.minimum,inclusive:!0,input:n,inst:e,continue:!t.abort})}}),nN=rl("$ZodCheckLengthEquals",(e,t)=>{var r;np.init(e,t),(r=e._zod.def).when??(r.when=nm),e._zod.check=r=>{let n=r.value,i=n.length,s="string"==typeof n&&i>=t.length&&i<=2*t.length?tq(n):i;if(s===t.length)return;let a=tW(n),o=s>t.length;r.issues.push({origin:a,...o?{code:"too_big",maximum:t.length}:{code:"too_small",minimum:t.length},inclusive:!0,exact:!0,input:r.value,inst:e,continue:!t.abort})}}),nS=rl("$ZodCheckStringFormat",(e,t)=>{var r,n;np.init(e,t),t.pattern?(r=e._zod).check??(r.check=r=>{t.pattern.lastIndex=0,t.pattern.test(r.value)||r.issues.push({origin:"string",code:"invalid_format",format:t.format,input:r.value,...t.pattern?{pattern:t.pattern.toString()}:{},inst:e,continue:!t.abort})}):(n=e._zod).check??(n.check=()=>{})}),n$=rl("$ZodCheckRegex",(e,t)=>{nS.init(e,t),e._zod.check=r=>{t.pattern.lastIndex=0,t.pattern.test(r.value)||r.issues.push({origin:"string",code:"invalid_format",format:"regex",input:r.value,pattern:t.pattern.toString(),inst:e,continue:!t.abort})}}),nA=rl("$ZodCheckLowerCase",(e,t)=>{t.pattern??(t.pattern=r8),nS.init(e,t)}),nO=rl("$ZodCheckUpperCase",(e,t)=>{t.pattern??(t.pattern=r7),nS.init(e,t)}),nE=rl("$ZodCheckIncludes",(e,t)=>{np.init(e,t);let r=t_(t.includes),n=new RegExp("number"==typeof t.position?`^.{${t.position},}${r}`:r);t.pattern=n,e._zod.check=r=>{r.value.includes(t.includes,t.position)||r.issues.push({origin:"string",code:"invalid_format",format:"includes",includes:t.includes,input:r.value,inst:e,continue:!t.abort})}}),nT=rl("$ZodCheckStartsWith",(e,t)=>{np.init(e,t);let r=RegExp(`^${t_(t.prefix)}.*`);t.pattern??(t.pattern=r),e._zod.check=r=>{r.value.startsWith(t.prefix)||r.issues.push({origin:"string",code:"invalid_format",format:"starts_with",prefix:t.prefix,input:r.value,inst:e,continue:!t.abort})}}),nP=rl("$ZodCheckEndsWith",(e,t)=>{np.init(e,t);let r=RegExp(`.*${t_(t.suffix)}$`);t.pattern??(t.pattern=r),e._zod.check=r=>{r.value.endsWith(t.suffix)||r.issues.push({origin:"string",code:"invalid_format",format:"ends_with",suffix:t.suffix,input:r.value,inst:e,continue:!t.abort})}});function nC(e,t,r){e.issues.length&&t.issues.push(...tL(r,e.issues))}(e,t)=>{let r;np.init(e,t),t8(e,Symbol.iterator,function*(){yield e}),e._zod.check=n=>{let i;if(null==n.value)return void n.issues.push({expected:"object",code:"invalid_type",input:n.value,inst:e});r??(r=Reflect.ownKeys(t.shape).map(e=>[e,t.shape[e]]));let s=n.value;for(let[e,t]of r){let r=t._zod.run({value:s[e],issues:[]},{});r instanceof Promise?(i??(i=[]),i.push(r.then(t=>nC(t,n,e)))):nC(r,n,e)}if(i)return Promise.all(i).then(()=>void 0)}},(e,t)=>{np.init(e,t);let r=new Set(t.mime);e._zod.check=n=>{r.has(n.value.type)||n.issues.push({code:"invalid_value",values:t.mime,input:n.value.type,inst:e,continue:!t.abort})}};let nI=rl("$ZodCheckOverwrite",(e,t)=>{np.init(e,t),e._zod.check=e=>{e.value=t.tx(e.value)}});class nD{constructor(e=[],t={}){this.content=[],this.indent=0,this.args=e,this.closed=t}indented(e){this.indent+=1;try{e(this)}finally{this.indent-=1}}write(e){if("function"==typeof e){e(this,{execution:"sync"}),e(this,{execution:"async"});return}let t=e.split("\n").filter(e=>e),r=Math.min(...t.map(e=>e.length-e.trimStart().length));for(let e of t.map(e=>e.slice(r)).map(e=>" ".repeat(2*this.indent)+e))this.content.push(e)}compile(){let e=Function,t=this?.content??[""];return new e(...Object.keys(this.closed),`return function (${this.args.join(", ")}) {
2
- ${t.join("\n")}
3
- };`)(...Object.values(this.closed))}}let nZ={get:function(){let e=this._zod;return e.message??(e.message=JSON.stringify(e.def,e1,2)),e.message},set:function(e){this._zod.message=e},enumerable:!0,configurable:!0},nF={value:void 0,enumerable:!1},nR=new WeakSet([Object.prototype,Error.prototype]),nM=(e,t)=>{e.name="$ZodError",nF.value=t,Object.defineProperty(e,"issues",nF),nF.value=void 0,Object.defineProperty(e,"message",nZ);let r=Object.getPrototypeOf(e);nR.has(r)||(nR.add(r),Object.defineProperty(r,"toString",{configurable:!0,enumerable:!1,get(){let e=()=>this.message;return Object.defineProperty(this,"toString",{value:e,configurable:!0,writable:!0}),e},set(e){Object.defineProperty(this,"toString",{value:e,configurable:!0,writable:!0})}}))},nL=rl("$ZodError",nM),nU=rl("$ZodError",nM,void 0,{Parent:Error});function nG(e,t){return{callee:t?.callee??e,Err:t?.Err}}let nV=e=>{let t=(r,n,i,s)=>{let a=i?{...i,async:!1}:{async:!1},o=r._zod.run({value:n,issues:[]},a);if(o instanceof Promise)throw new rc;if(o.issues.length){let r=new(s?.Err??e)(o.issues.map(e=>tK(e,a,rp())));throw tf(r,s?.callee??t),r}return o.value};return t},nK=nV(nU),nB=e=>{let t=async(r,n,i,s)=>{let a=i?{...i,async:!0}:{async:!0},o=r._zod.run({value:n,issues:[]},a);if(o instanceof Promise&&(o=await o),o.issues.length){let r=new(s?.Err??e)(o.issues.map(e=>tK(e,a,rp())));throw tf(r,s?.callee??t),r}return o.value};return t},nJ=nB(nU),nq=e=>(t,r,n)=>{let i=n?{...n,async:!1}:{async:!1},s=t._zod.run({value:r,issues:[]},i);if(s instanceof Promise)throw new rc;return s.issues.length?nW(e,s.issues,i):{success:!0,data:s.value}};function nW(e,t,r){let n;return{success:!1,get error(){return n||(n=new e(t.map(e=>tK(e,r,rp()))),t=void 0,r=void 0),n},set error(e){n=e,t=void 0,r=void 0}}}let nH=e=>async(t,r,n)=>{let i=n?{...n,async:!0}:{async:!0},s=t._zod.run({value:r,issues:[]},i);return s instanceof Promise&&(s=await s),s.issues.length?nW(e,s.issues,i):{success:!0,data:s.value}},nX=Symbol.for("zod.compile.invalid"),nY=Symbol.for("zod.compile.fallback"),nQ=async(e,t,r)=>{let n=r?{...r,async:!0,abortEarly:!0}:{async:!0,abortEarly:!0},i=e._zod.run({value:t,issues:[]},n);return i instanceof Promise&&(i=await i),0===i.issues.length},n0={major:4,minor:6,patch:7},n1=rl("$ZodType",(e,t)=>{var r;e??(e={}),e._zod.def=t,e._zod.bag=e._zod.bag||{},e._zod.version=n0;let n=e._zod.def.checks,i=e._zod.traits.has("$ZodCheck")?[e,...n??[]]:n?.length?[...n]:[];for(let t of i)for(let r of t._zod.onattach)r(e);if(0===i.length)(r=e._zod).deferred??(r.deferred=[]),e._zod.deferred?.push(()=>{e._zod.run=e._zod.parse});else{let t=(t,r,n)=>{let i;if(t.memo)return t;let s=tR(t);for(let a of r){if(a._zod.def.when){if(tM(t)||!a._zod.def.when(t))continue}else if(s)continue;let r=t.issues.length,o=a._zod.check(t);if(o instanceof Promise&&n?.async===!1)throw new rc;if(i||o instanceof Promise)i=(i??Promise.resolve()).then(async()=>{await o,t.issues.length!==r&&(tV(t.issues,r,e),s||(s=tR(t,r)))});else{if(t.issues.length===r)continue;tV(t.issues,r,e),s||(s=tR(t,r))}}return i?i.then(()=>t):t},r=(r,n,s)=>{if(tR(r))return r.aborted=!0,r;let a=t(n,i,s);if(a instanceof Promise){if(!1===s.async)throw new rc;return a.then(t=>e._zod.parse(t,s))}return e._zod.parse(a,s)};e._zod.run=(n,s)=>{if(s.skipChecks)return e._zod.parse(n,s);if("backward"===s.direction){let t=e._zod.parse({value:n.value,issues:[]},{...s,skipChecks:!0});return t instanceof Promise?t.then(e=>r(e,n,s)):r(t,n,s)}let a=e._zod.parse(n,s);if(a instanceof Promise){if(!1===s.async)throw new rc;return a.then(e=>t(e,i,s))}return t(a,i,s)}}},{get"~standard"(){return t8(this,"~standard",n3(this))},set"~standard"(e){t6(this,"~standard",e)}}),n2=(e,t)=>e.issues.length?{issues:e.issues.map(e=>tK(e,t,rp()))}:{value:e.value};async function n4(e,t){let r={async:!0};return n2(await e._zod.run({value:t,issues:[]},r),r)}function n3(e){return{validate:t=>{let r={async:!1};try{let n=e._zod.run({value:t,issues:[]},r);if(!(n instanceof Promise))return n2(n,r)}catch(e){}return n4(e,t)},vendor:"zod",version:1}}let n9=rl("$ZodString",(e,t)=>{n1.init(e,t),e._zod.pattern=t.pattern??r0,e._zod.parse=(r,n)=>{if(t.coerce)try{r.value=String(r.value)}catch(e){}return"string"==typeof r.value||r.issues.push({expected:"string",code:"invalid_type",input:r.value,inst:e}),r}}),n5=rl("$ZodStringFormat",(e,t)=>{nS.init(e,t),n9.init(e,t)}),n6=rl("$ZodGUID",(e,t)=>{t.pattern??(t.pattern=rO),n5.init(e,t)}),n8=rl("$ZodUUID",(e,t)=>{if(t.version){let e={v1:1,v2:2,v3:3,v4:4,v5:5,v6:6,v7:7,v8:8}[t.version];if(void 0===e)throw Error(`Invalid UUID version: "${t.version}"`);t.pattern??(t.pattern=rE(e))}else t.pattern??(t.pattern=rE());n5.init(e,t)}),n7=rl("$ZodEmail",(e,t)=>{t.pattern??(t.pattern=rI),n5.init(e,t)});function ie(e){try{if("u">typeof URL&&"function"==typeof URL.canParse)return URL.canParse(e);return new URL(e),!0}catch{return!1}}let it=/[\t\n\r]/g;function ir(e){return e.replace(it,"")}let ii=rl("$ZodURL",(e,t)=>{n5.init(e,t),e._zod.check=r=>{try{var n,i;let s=r.value.trim(),a="normalize"in t||"hostname"in t||"protocol"in t?function(e,t){if(!t.normalize&&t.protocol?.source===rK.source&&!/^https?:\/\//i.test(e))return 1;try{if("u">typeof URL){let t=URL;if("function"==typeof t.parse)return t.parse(e)??2}return new URL(e)}catch{return 2}}(s,t):ie(s)||2;if(1===a)return void r.issues.push({code:"invalid_format",format:"url",note:"Invalid URL format",input:r.value,inst:e,continue:!t.abort});if(2===a)return void r.issues.push({code:"invalid_format",format:"url",input:r.value,inst:e,continue:!t.abort});if(!0===a){r.value=ir(s);return}t.hostname&&((n=t.hostname).lastIndex=0,!n.test(a.hostname))&&r.issues.push({code:"invalid_format",format:"url",note:"Invalid hostname",pattern:t.hostname.source,input:r.value,inst:e,continue:!t.abort}),t.protocol&&((i=t.protocol).lastIndex=0,!i.test(a.protocol.endsWith(":")?a.protocol.slice(0,-1):a.protocol))&&r.issues.push({code:"invalid_format",format:"url",note:"Invalid protocol",pattern:t.protocol.source,input:r.value,inst:e,continue:!t.abort}),r.value=t.normalize?a.href:ir(s);return}catch(n){r.issues.push({code:"invalid_format",format:"url",input:r.value,inst:e,continue:!t.abort})}}}),is=rl("$ZodEmoji",(e,t)=>{t.pattern??(t.pattern=rZ()),n5.init(e,t)}),ia=rl("$ZodNanoID",(e,t)=>{if(void 0!==t.length&&(!Number.isInteger(t.length)||t.length<1))throw Error(`Invalid nanoid length: ${t.length}`);t.pattern??(t.pattern=void 0===t.length?rS:r$(t.length)),n5.init(e,t)}),io=rl("$ZodCUID",(e,t)=>{t.pattern??(t.pattern=r_),n5.init(e,t)}),il=rl("$ZodCUID2",(e,t)=>{t.pattern??(t.pattern=rj),n5.init(e,t)}),ic=rl("$ZodULID",(e,t)=>{t.pattern??(t.pattern=rk),n5.init(e,t)}),id=rl("$ZodXID",(e,t)=>{t.pattern??(t.pattern=rz),n5.init(e,t)}),iu=rl("$ZodKSUID",(e,t)=>{t.pattern??(t.pattern=rN),n5.init(e,t)}),ip=rl("$ZodISODateTime",(e,t)=>{t.pattern??(t.pattern=rQ(t)),n5.init(e,t)}),im=rl("$ZodISODate",(e,t)=>{t.pattern??(t.pattern=rH),n5.init(e,t)}),ih=rl("$ZodISOTime",(e,t)=>{t.pattern??(t.pattern=rY(t)),n5.init(e,t)}),ig=rl("$ZodISODuration",(e,t)=>{t.pattern??(t.pattern=rA),n5.init(e,t)}),iv=rl("$ZodIPv4",(e,t)=>{t.pattern??(t.pattern=rF),n5.init(e,t)}),iy=/^[0-9a-fA-F:.]+$/;function ix(e){return!!iy.test(e)&&ie(`http://[${e}]`)}let ib=rl("$ZodIPv6",(e,t)=>{t.pattern??(t.pattern=rR),n5.init(e,t),e._zod.check=r=>{ix(r.value)||r.issues.push({code:"invalid_format",format:"ipv6",input:r.value,inst:e,continue:!t.abort})}}),iw=((e,t)=>{t.pattern??(t.pattern=rM(t.delimiter)),n5.init(e,t)},rl("$ZodCIDRv4",(e,t)=>{t.pattern??(t.pattern=rL),n5.init(e,t)})),i_=rl("$ZodCIDRv6",(e,t)=>{t.pattern??(t.pattern=rU),n5.init(e,t),e._zod.check=r=>{!function(e){let t=e.split("/");if(2!==t.length)return!1;let[r,n]=t;if(!n)return!1;let i=Number(n);return`${i}`===n&&!(i<0)&&!(i>128)&&ix(r)}(r.value)&&r.issues.push({code:"invalid_format",format:"cidrv6",input:r.value,inst:e,continue:!t.abort})}});function ij(e){if(""===e)return!0;if(/\s/.test(e)||e.length%4!=0)return!1;try{return atob(e),!0}catch{return!1}}let ik=/^[0-9a-zA-Z+/]*={0,2}$/,iz=rl("$ZodBase64",(e,t)=>{t.pattern??(t.pattern=ik),n5.init(e,t),e._zod.check=r=>{ij(r.value)||r.issues.push({code:"invalid_format",format:"base64",input:r.value,inst:e,continue:!t.abort})}}),iN=/^[A-Za-z0-9_-]*$/,iS=rl("$ZodBase64URL",(e,t)=>{t.pattern??(t.pattern=iN),n5.init(e,t),e._zod.check=r=>{!function(e){if(!iN.test(e))return!1;let t=e.replace(/[-_]/g,e=>"-"===e?"+":"/");return ij(t.padEnd(4*Math.ceil(t.length/4),"="))}(r.value)&&r.issues.push({code:"invalid_format",format:"base64url",input:r.value,inst:e,continue:!t.abort})}}),i$=rl("$ZodE164",(e,t)=>{t.pattern??(t.pattern=rB),n5.init(e,t)}),iA=/[- ]/g,iO=((e,t)=>{t.pattern??(t.pattern=rJ),n5.init(e,t),e._zod.check=r=>{var n;n=r.value,rJ.test(n)&&function(e){let t=e.length,r=1,n=0;for(;t;){let i=e.charCodeAt(--t)-48;r^=1,n+=r?[0,2,4,6,8,1,3,5,7,9][i]:i}return n%10==0}(n.replace(iA,""))||r.issues.push({code:"invalid_format",format:"credit_card",input:r.value,inst:e,continue:!t.abort})}},rl("$ZodJWT",(e,t)=>{n5.init(e,t),e._zod.check=r=>{!function(e,t=null){try{let r=e.split(".");if(3!==r.length)return!1;let[n]=r;if(!n)return!1;let i=JSON.parse(atob(n));if("typ"in i&&i?.typ!=="JWT"||!i.alg||t&&(!("alg"in i)||i.alg!==t))return!1;return!0}catch{return!1}}(r.value,t.alg)&&r.issues.push({code:"invalid_format",format:"jwt",input:r.value,inst:e,continue:!t.abort})}})),iE=((e,t)=>{n5.init(e,t),e._zod.check=r=>{t.fn(r.value)||r.issues.push({code:"invalid_format",format:t.format,input:r.value,inst:e,continue:!t.abort})}},rl("$ZodNumber",(e,t)=>{n1.init(e,t),e._zod.pattern=r3,e._zod.parse=(r,n)=>{if(t.coerce)try{r.value=Number(r.value)}catch(e){}let i=r.value;if("number"==typeof i&&!Number.isNaN(i)&&Number.isFinite(i))return r;let s="number"==typeof i?Number.isNaN(i)?"NaN":Number.isFinite(i)?void 0:String(i):void 0;return r.issues.push({expected:"number",code:"invalid_type",input:i,inst:e,...s?{received:s}:{}}),r}})),iT=rl("$ZodNumberFormat",(e,t)=>{nx.init(e,t),iE.init(e,t)}),iP=((e,t)=>{n1.init(e,t),e._zod.pattern=r9,e._zod.parse=(r,n)=>{if(t.coerce)try{r.value=!!r.value}catch(e){}let i=r.value;return"boolean"==typeof i||r.issues.push({expected:"boolean",code:"invalid_type",input:i,inst:e}),r}},rl("$ZodBigInt",(e,t)=>{n1.init(e,t),e._zod.pattern=r2,e._zod.parse=(r,n)=>{if(t.coerce)try{r.value=BigInt(r.value)}catch(e){}return"bigint"==typeof r.value||r.issues.push({expected:"bigint",code:"invalid_type",input:r.value,inst:e}),r}})),iC=((e,t)=>{nb.init(e,t),iP.init(e,t)},rl("$ZodUnknown",(e,t)=>{n1.init(e,t),e._zod.parse=e=>e})),iI=rl("$ZodNever",(e,t)=>{n1.init(e,t),e._zod.parse=(t,r)=>(t.issues.push({expected:"never",code:"invalid_type",input:t.value,inst:e}),t)});function iD(e,t){let r=tG(e._zod.def.checks);if(!r.length)return;let n=Math.min(...r.map(e=>e[0])),i=e._zod.parse;e._zod.parse=(r,s)=>{let a=t(r.value);if(a>n&&!s?.skipChecks&&s?.direction!=="backward"){for(let[t,n]of tG(e._zod.def.checks))if(a>t&&n._zod.def.when(r)){let t=r.issues.length;return n._zod.check(r),r.issues[t].continue=!1,tV(r.issues,t,e),r}}return i(r,s)}}(e,t)=>{n1.init(e,t),e._zod.parse=(t,r)=>{let n=t.value;return void 0===n||t.issues.push({expected:"void",code:"invalid_type",input:n,inst:e}),t}},(e,t)=>{n1.init(e,t),e._zod.parse=(r,n)=>{if(t.coerce)try{r.value=new Date(r.value)}catch(e){}let i=r.value,s=i instanceof Date;return s&&!Number.isNaN(i.getTime())||r.issues.push({expected:"date",code:"invalid_type",input:i,...s?{received:"Invalid Date"}:{},inst:e}),r}};let iZ=e=>Array.isArray(e)?e.length:-1,iF=e=>e instanceof Map?e.size:-1,iR=e=>e instanceof Set?e.size:-1;function iM(e,t,r){e.issues.length&&t.issues.push(...tL(r,e.issues)),t.value[r]=e.value}let iL=rl("$ZodArray",(e,t)=>{n1.init(e,t);let r=ru.memoizer;r?.attach(e),e._zod.parse=(n,i)=>{let s=n.value;if(!Array.isArray(s))return n.issues.push({expected:"array",code:"invalid_type",input:s,inst:e}),n;n.value=r?r.alloc(e,n,Array(s.length),i):Array(s.length);let a=[],o=i?.abortEarly;for(let e=0;e<s.length;e++){let r=s[e],l=t.element._zod.run({value:r,issues:[]},i);if(l instanceof Promise)a.push(l.then(t=>iM(t,n,e)));else if(iM(l,n,e),o&&0!==l.issues.length&&tR(l))break}return a.length?Promise.all(a).then(()=>n):n},iD(e,iZ)});function iU(e,t,r,n,i,s){let a=r in n,o="optional"===s;if(a||!o||"optional"!==i){if(e.issues.length){if(void 0!==i&&o&&!a)return;t.issues.push(...tL(r,e.issues))}if(!a&&void 0===i){e.issues.length||t.issues.push({code:"invalid_type",expected:"nonoptional",input:void 0,path:[r]});return}void 0===e.value?(a||"defaulted"===i&&!o)&&(t.value[r]=void 0):t.value[r]=e.value}}let iG=[];function iV(e){let t=Object.keys(e.shape),r=Object.getOwnPropertySymbols(e.shape),n=r.length?r:iG,i=n.length?[...t,...n]:t;for(let t of i)if(!e.shape?.[t]?._zod?.traits?.has("$ZodType"))throw Error(`Invalid element at key "${String(t)}": expected a Zod schema`);let s=tS(e.shape);return{...e,allKeys:i,symbolKeys:n,keySet:new Set(t),numKeys:t.length,optionalKeys:new Set(s)}}function iK(e,t,r,n,i,s,a){let o=[],l=i.keySet,c=i.catchall._zod,d=c.def.type,u=c.optin,p=c.optout,f=0;for(let i in t){if(a&&r.issues.length!==f){if(tR(r,f))break;f=r.issues.length}if(l.has(i))continue;if("__proto__"===i){"never"===d&&o.push(i);continue}if("never"===d){o.push(i);continue}let s=c.run({value:t[i],issues:[]},n);s instanceof Promise?e.push(s.then(e=>iU(e,r,i,t,u,p))):iU(s,r,i,t,u,p)}return(o.length&&r.issues.push({code:"unrecognized_keys",keys:o,input:t,inst:s,continue:!0}),e.length)?Promise.all(e).then(()=>r):r}let iB=rl("$ZodObject",(e,t)=>{let r;n1.init(e,t);let n=Object.getOwnPropertyDescriptor(t,"shape"),i=n?.get?n.get.raw:t.shape??{};if(i){let e=()=>{let r={...i};return Object.defineProperty(t,"shape",{value:r}),e.raw=r,r};e.raw=i,Object.defineProperty(t,"shape",{get:e})}let s=e4(()=>iV(t));rr(e,"propValues",e=>{let t=e.def.shape,r={};for(let e in t){let n=t[e]._zod;if(n.values){for(let t of(Object.prototype.hasOwnProperty.call(r,e)||te(r,e,new Set),n.values))r[e].add(t);void 0!==n.optin&&r[e].add(void 0)}}return r});let a=t.catchall,o=ru.memoizer;o?.attach(e),e._zod.parse=(t,n)=>{r??(r=s.value);let i=t.value;if(!tm(i))return t.issues.push({expected:"object",code:"invalid_type",input:i,inst:e}),t;t.value=o?o.alloc(e,t,{},n):{};let l=[],c=r.shape,d=n?.abortEarly,u=t.issues.length;for(let e of r.allKeys){if(d&&t.issues.length!==u){if(tR(t,u))break;u=t.issues.length}if("__proto__"===e)continue;let r=c[e],s=r._zod.optin,a=r._zod.optout,o=r._zod.run({value:i[e],issues:[]},n);o instanceof Promise?l.push(o.then(r=>iU(r,t,e,i,s,a))):iU(o,t,e,i,s,a)}return a?iK(l,i,t,n,s.value,e,!0===d):l.length?Promise.all(l).then(()=>t):t}}),iJ=rl("$ZodObjectJIT",(e,t)=>{let r,n;iB.init(e,t);let i=e._zod.parse,s=e4(()=>iV(t)),a=ru.memoizer,o=!ru.jitless,l=o&&th.value,c=t.catchall;e._zod.parse=(d,u)=>{n??(n=s.value);let p=d.value;return tm(p)?o&&l&&u?.async===!1&&!0!==u.jitless?(r||(r=(t=>{let r=s.value,n=r.symbolKeys,i=new nD(["payload","ctx"],{shape:t,inst:e,memo:a,syms:n}),o=e=>`shape[${e}]._zod.run({ value: input[${e}], issues: [] }, ctx)`,l=(e,t)=>`
4
- let ${e}_ab = false;
5
- for (let i = 0; i < ${e}.issues.length; i++) {
6
- const iss = ${e}.issues[i];
7
- iss.path = iss.path ? [${t}, ...iss.path] : [${t}];
8
- payload.issues.push(iss);
9
- if (iss.continue !== true) ${e}_ab = true;
10
- }
11
- if (${e}_ab && ctx && ctx.abortEarly) {
12
- payload.value = newResult;
13
- return payload;
14
- }`;i.write("const input = payload.value;");let c=Object.create(null),d=0;for(let e of r.allKeys)c[e]=`key_${d++}`;for(let e of(i.write(a?"const newResult = memo.alloc(inst, payload, {}, ctx);":"const newResult = {};"),r.allKeys)){if("__proto__"===e)continue;let r=c[e],s="symbol"==typeof e?`syms[${n.indexOf(e)}]`:tu(e),a=`${s} in input`,d=t[e],u=d?._zod?.optin,p=void 0!==u,f=d?._zod?.optout==="optional";if(i.write(`const ${r} = ${o(s)};`),p&&f){let e="optional"===u?`${r}_present`:`${r}.value !== undefined || ${r}_present`;i.write(`
15
- const ${r}_present = ${a};
16
- if (!${r}.issues.length || ${r}_present) {
17
- if (${r}.issues.length) {${l(r,s)}
18
- }
19
-
20
- if (${e}) {
21
- newResult[${s}] = ${r}.value;
22
- }
23
- }
24
-
25
- `)}else p?(i.write(`
26
- if (${r}.issues.length) {${l(r,s)}
27
- }
28
- `),"defaulted"===u?i.write(`newResult[${s}] = ${r}.value;`):i.write(`
29
- if (${r}.value !== undefined || ${a}) {
30
- newResult[${s}] = ${r}.value;
31
- }
32
- `)):i.write(`
33
- const ${r}_present = ${a};
34
- if (${r}.issues.length) {${l(r,s)}
35
- }
36
- if (!${r}_present && !${r}.issues.length) {
37
- payload.issues.push({
38
- code: "invalid_type",
39
- expected: "nonoptional",
40
- input: undefined,
41
- path: [${s}]
42
- });
43
- if (ctx && ctx.abortEarly) {
44
- payload.value = newResult;
45
- return payload;
46
- }
47
- }
48
-
49
- if (${r}_present) {
50
- newResult[${s}] = ${r}.value;
51
- }
52
-
53
- `)}return i.write("payload.value = newResult;"),i.write("return payload;"),i.compile()})(t.shape)),d=r(d,u),c)?iK([],p,d,u,n,e,u?.abortEarly===!0):d:i(d,u):(d.issues.push({expected:"object",code:"invalid_type",input:p,inst:e}),d)}});function iq(e,t,r,n){for(let r of e)if(0===r.issues.length)return t.value=r.value,t;let i=e.filter(e=>!tR(e));return 1===i.length?(t.value=i[0].value,i[0]):(t.issues.push({code:"invalid_union",input:t.value,inst:r,errors:e.map(e=>e.issues.map(e=>tK(e,n,rp())))}),t)}let iW=rl("$ZodUnion",(e,t)=>{n1.init(e,t),rr(e,"optin",e=>e.def.options.some(e=>"defaulted"===e._zod.optin)?"defaulted":e.def.options.some(e=>void 0!==e._zod.optin)?"optional":void 0),rr(e,"optout",e=>e.def.options.some(e=>"optional"===e._zod.optout)?"optional":void 0),rr(e,"values",e=>{if(e.def.options.every(e=>e._zod.values))return new Set(e.def.options.flatMap(e=>Array.from(e._zod.values)))}),rr(e,"pattern",e=>{if(e.def.options.every(e=>e._zod.pattern)){let t=e.def.options.map(e=>e._zod.pattern);return RegExp(`^(${t.map(e=>e9(e.source)).join("|")})$`)}});let r=1===t.options.length?t.options[0]._zod.run:null;e._zod.parse=(n,i)=>{if(r)return r(n,i);let s=!1,a=[];for(let e of t.options){let t=e._zod.run({value:n.value,issues:[]},i);if(t instanceof Promise)a.push(t),s=!0;else{if(0===t.issues.length)return t;a.push(t)}}return s?Promise.all(a).then(t=>iq(t,n,e,i)):iq(a,n,e,i)}});function iH(e,t,r,n){let i=[];for(let t=0;t<e.length;t++)0===e[t].issues.length&&i.push(t);return 1===i.length?t.value=e[i[0]].value:0===i.length?t.issues.push({code:"invalid_union",input:t.value,inst:r,errors:e.map(e=>e.issues.map(e=>tK(e,n,rp())))}):t.issues.push({code:"invalid_union",input:t.value,inst:r,errors:[],inclusive:!1,matches:i}),t}(e,t)=>{iW.init(e,t),t.inclusive=!1;let r=1===t.options.length?t.options[0]._zod.run:null;e._zod.parse=(n,i)=>{if(r)return r(n,i);let s=!1,a=[];for(let e of t.options){let t=e._zod.run({value:n.value,issues:[]},i);t instanceof Promise?(a.push(t),s=!0):a.push(t)}return s?Promise.all(a).then(t=>iH(t,n,e,i)):iH(a,n,e,i)}},(e,t)=>{t.inclusive=!1,iW.init(e,t);let r=e._zod.parse;rr(e,"propValues",e=>{let t={},r=0;for(let n of e.def.options){let i=n._zod.propValues;if(!i||0===Object.keys(i).length)throw Error(`Invalid discriminated union option at index "${e.def.options.indexOf(n)}"`);for(let[n,s]of(i[e.def.discriminator]?.has(void 0)&&r++,Object.entries(i)))for(let e of(Object.prototype.hasOwnProperty.call(t,n)||te(t,n,new Set),s))t[n].add(e)}return!e.def.unionFallback&&r>1&&t[e.def.discriminator]?.delete(void 0),t}),t.options.forEach((e,r)=>{let n=tt(e._zod.def);if(n&&!Object.prototype.hasOwnProperty.call(n,t.discriminator))throw Error(`Invalid discriminated union option at index "${r}"`)});let n=e4(()=>(function(e){let t=new Map;for(let r of e.options){let n=r._zod.propValues?.[e.discriminator];if(!n||0===n.size)throw Error(`Invalid discriminated union option at index "${e.options.indexOf(r)}"`);for(let e of n)if(t.has(e)){if(void 0!==e)throw Error(`Duplicate discriminator value "${String(e)}"`);t.set(e,null)}else t.set(e,r)}return t})(t));e._zod.parse=(i,s)=>{let a=i.value;if(!tm(a))return i.issues.push({code:"invalid_type",expected:"object",input:a,inst:e}),i;let o=a?.[t.discriminator],l=n.value.get(o);return l&&(void 0!==o||"backward"!==s.direction)?l._zod.run(i,s):t.unionFallback||"backward"===s.direction?r(i,s):(i.issues.push({code:"invalid_union",errors:[],note:"No matching discriminator",discriminator:t.discriminator,options:Array.from(n.value.keys()).filter(e=>null!==n.value.get(e)),input:a,path:[t.discriminator],inst:e}),i)}};let iX=rl("$ZodIntersection",(e,t)=>{n1.init(e,t),e._zod.parse=(e,r)=>{let n=e.value,i=t.left._zod.run({value:n,issues:[]},r),s=t.right._zod.run({value:n,issues:[]},r);return i instanceof Promise||s instanceof Promise?Promise.all([i,s]).then(([t,r])=>iY(e,t,r)):iY(e,i,s)}});function iY(e,t,r){let n,i=new Map,s=new Map,a=(e,t)=>{let r;if("unrecognized_keys"!==e.code||e.path?.length)if("invalid_key"!==e.code||"record"!==e.origin||e.path?.length!==1)return!1;else{let t=String(e.path[0]);s.has(t)||s.set(t,e),r=[t]}else n??(n=e),r=e.keys;for(let e of r)i.has(e)||i.set(e,{}),i.get(e)[t]=!0;return!0};for(let r of t.issues)a(r,"l")||e.issues.push(r);for(let t of r.issues)a(t,"r")||e.issues.push(t);let o=[...i].filter(([,e])=>e.l&&e.r).map(([e])=>e);if(o.length){let t=n?o.filter(e=>n.keys.includes(e)):[];for(let r of(t.length&&e.issues.push({...n,keys:t}),o))!t.includes(r)&&s.has(r)&&e.issues.push(s.get(r))}let l=function e(t,r){if(t===r||t instanceof Date&&r instanceof Date&&+t==+r)return{valid:!0,data:t};if(tg(t)&&tg(r)){let n=Object.keys(r),i=Object.keys(t).filter(e=>-1!==n.indexOf(e)),s={...t,...r};for(let n of(Object.prototype.hasOwnProperty.call(s,"__proto__")&&delete s.__proto__,i)){if("__proto__"===n)continue;let i=e(t[n],r[n]);if(!i.valid)return{valid:!1,mergeErrorPath:[n,...i.mergeErrorPath]};s[n]=i.data}return{valid:!0,data:s}}if(Array.isArray(t)&&Array.isArray(r)){if(t.length!==r.length)return{valid:!1,mergeErrorPath:[]};let n=[];for(let i=0;i<t.length;i++){let s=e(t[i],r[i]);if(!s.valid)return{valid:!1,mergeErrorPath:[i,...s.mergeErrorPath]};n.push(s.data)}return{valid:!0,data:n}}return{valid:!1,mergeErrorPath:[]}}(t.value,r.value);if(!l.valid){if(tR(e))return e;throw Error(`Unmergable intersection. Error path: ${JSON.stringify(l.mergeErrorPath)}`)}return e.value=l.data,e}let iQ=rl("$ZodTuple",(e,t)=>{n1.init(e,t);let r=t.items,n=ru.memoizer;n?.attach(e),e._zod.parse=(i,s)=>{let a=i.value;if(!Array.isArray(a))return i.issues.push({input:a,inst:e,expected:"tuple",code:"invalid_type"}),i;i.value=n?n.alloc(e,i,[],s):[];let o=[],l=i0(r,"optin"),c=i0(r,"optout");if(!t.rest){if(a.length<l)return i.issues.push({code:"too_small",minimum:l,inclusive:!0,input:a,inst:e,origin:"array"}),i;a.length>r.length&&i.issues.push({code:"too_big",maximum:r.length,inclusive:!0,input:a,inst:e,origin:"array"})}let d=Array(r.length),u=t.rest?s?.abortEarly:void 0,p=!1;for(let e=0;e<r.length;e++){let t=r[e]._zod.run({value:a[e],issues:[]},s);t instanceof Promise?o.push(t.then(t=>{d[e]=t})):(d[e]=t,u&&!p&&t.issues.length&&(p=tR(t)))}if(t.rest&&!p){let e=r.length-1,n=a.slice(r.length),l=i.issues.length;for(let r of n){if(u&&i.issues.length!==l){if(tR(i,l))break;l=i.issues.length}e++;let n=t.rest._zod.run({value:r,issues:[]},s);n instanceof Promise?o.push(n.then(t=>i1(t,i,e))):i1(n,i,e)}}return o.length?Promise.all(o).then(()=>i2(d,i,r,a,c)):i2(d,i,r,a,c)}});function i0(e,t){for(let r=e.length-1;r>=0;r--)if(!("optin"===t?void 0!==e[r]._zod.optin:"optional"===e[r]._zod.optout))return r+1;return 0}function i1(e,t,r){e.issues.length&&t.issues.push(...tL(r,e.issues)),t.value[r]=e.value}function i2(e,t,r,n,i){for(let s=0;s<r.length;s++){let a=e[s],o=s<n.length;if(!o&&s>=i&&"optional"===r[s]._zod.optin){t.value.length=s;break}if(a.issues.length){if(!o&&s>=i){t.value.length=s;break}t.issues.push(...tL(s,a.issues))}t.value[s]=a.value}for(let e=t.value.length-1;e>=n.length;e--)if("optional"===r[e]._zod.optout&&void 0===t.value[e])t.value.length=e;else break;return t}function i4(e,t,r,n,i,s,a){e.issues.length&&(tb.has(typeof n)?r.issues.push(...tL(n,e.issues)):r.issues.push({code:"invalid_key",origin:"map",input:i,inst:s,issues:e.issues.map(e=>tK(e,a,rp()))})),t.issues.length&&(tb.has(typeof n)?r.issues.push(...tL(n,t.issues)):r.issues.push({origin:"map",code:"invalid_element",input:i,inst:s,key:n,issues:t.issues.map(e=>tK(e,a,rp()))})),r.value.set(e.value,t.value)}function i3(e,t){e.issues.length&&t.issues.push(...e.issues),t.value.add(e.value)}(e,t)=>{n1.init(e,t);let r=ru.memoizer;r?.attach(e),e._zod.parse=(n,i)=>{let s=n.value;if(!tg(s))return n.issues.push({expected:"record",code:"invalid_type",input:s,inst:e}),n;let a=[],o=t.keyType._zod.values;if(o&&!t.partial){let l;n.value=r?r.alloc(e,n,{},i):{};let c=new Set;for(let r of o)if("string"==typeof r||"number"==typeof r||"symbol"==typeof r){if(c.add("number"==typeof r?r.toString():r),"__proto__"===r)continue;let o=t.keyType._zod.run({value:r,issues:[]},i);if(o instanceof Promise)throw Error("Async schemas not supported in object keys currently");if(o.issues.length){n.issues.push({code:"invalid_key",origin:"record",issues:o.issues.map(e=>tK(e,i,rp())),input:r,path:[r],inst:e});continue}let l=o.value;if("__proto__"===l)continue;let d=t.valueType._zod.run({value:s[r],issues:[]},i);d instanceof Promise?a.push(d.then(e=>{e.issues.length&&n.issues.push(...tL(r,e.issues)),n.value[l]=e.value})):(d.issues.length&&n.issues.push(...tL(r,d.issues)),n.value[l]=d.value)}for(let e in s)if(!c.has(e))if("loose"===t.mode){if("__proto__"===e)continue;n.value[e]=s[e]}else(l=l??[]).push(e);l&&l.length>0&&n.issues.push({code:"unrecognized_keys",input:s,inst:e,keys:l,continue:!0})}else{let l;for(let c of(n.value=r?r.alloc(e,n,{},i):{},Reflect.ownKeys(s))){if("__proto__"===c||!Object.prototype.propertyIsEnumerable.call(s,c))continue;let r=t.keyType._zod.run({value:c,issues:[]},i);if(r instanceof Promise)throw Error("Async schemas not supported in object keys currently");if("string"==typeof c&&r3.test(c)&&r.issues.length){let e=t.keyType._zod.run({value:Number(c),issues:[]},i);if(e instanceof Promise)throw Error("Async schemas not supported in object keys currently");0===e.issues.length&&(r=e)}if(r.issues.length){"loose"===t.mode?n.value[c]=s[c]:o?(l=l??[]).push(c):n.issues.push({code:"invalid_key",origin:"record",issues:r.issues.map(e=>tK(e,i,rp())),input:c,path:[c],inst:e});continue}let d=r.value;if("__proto__"===d)continue;let u=t.valueType._zod.run({value:s[c],issues:[]},i);u instanceof Promise?a.push(u.then(e=>{e.issues.length&&n.issues.push(...tL(c,e.issues)),n.value[d]=e.value})):(u.issues.length&&n.issues.push(...tL(c,u.issues)),n.value[d]=u.value)}l&&l.length>0&&n.issues.push({code:"unrecognized_keys",input:s,inst:e,keys:l,continue:!0})}return a.length?Promise.all(a).then(()=>n):n}},(e,t)=>{n1.init(e,t);let r=ru.memoizer;r?.attach(e),e._zod.parse=(n,i)=>{let s=n.value;if(!(s instanceof Set))return n.issues.push({input:s,inst:e,expected:"set",code:"invalid_type"}),n;let a=[];n.value=r?r.alloc(e,n,new Set,i):new Set;let o=i?.abortEarly,l=n.issues.length;for(let e of s){if(o&&n.issues.length!==l){if(tR(n,l))break;l=n.issues.length}let r=t.valueType._zod.run({value:e,issues:[]},i);r instanceof Promise?a.push(r.then(e=>i3(e,n))):i3(r,n)}return a.length?Promise.all(a).then(()=>n):n},iD(e,iR)};let i9=rl("$ZodEnum",(e,t)=>{n1.init(e,t);let r=eQ(t.entries),n=new Set(r);e._zod.values=n,rr(e,"pattern",e=>{let t=eQ(e.def.entries).filter(e=>tb.has(typeof e));return new RegExp(t.length?`^(${t.map(e=>t_(e.toString())).join("|")})$`:"^[^\\s\\S]$")}),e._zod.parse=(t,i)=>{let s=t.value;return n.has(s)||t.issues.push({code:"invalid_value",values:r,input:s,inst:e}),t}}),i5=((e,t)=>{n1.init(e,t);let r=new Set(t.values);e._zod.values=r,rr(e,"pattern",e=>{let t=e.def.values;return new RegExp(t.length?`^(${t.map(e=>"string"==typeof e?t_(e):e?t_(e.toString()):String(e)).join("|")})$`:"^[^\\s\\S]$")}),e._zod.parse=(n,i)=>{let s=n.value;return r.has(s)||n.issues.push({code:"invalid_value",values:t.values,input:s,inst:e}),n}},rl("$ZodTransform",(e,t)=>{n1.init(e,t),e._zod.optin="optional",ru.memoizer?.guard(e),e._zod.parse=(r,n)=>{if("backward"===n.direction)throw new rd(e.constructor.name);let i=t.transform(r.value,r);if(n.async)return(i instanceof Promise?i:Promise.resolve(i)).then(e=>(r.value=e,r));if(i instanceof Promise)throw new rc;return r.value=i,r}}));function i6(e,t){return e.value=t.issues.length?void 0:t.value,e}let i8=rl("$ZodOptional",(e,t)=>{n1.init(e,t),rr(e,"optin",e=>"defaulted"===e.def.innerType._zod.optin?"defaulted":"optional"),e._zod.optout="optional",rr(e,"values",e=>{let t=e.def.innerType._zod.values;return t?new Set([...t,void 0]):void 0}),rr(e,"pattern",e=>{let t=e.def.innerType._zod.pattern;return t?RegExp(`^(${e9(t.source)})?$`):void 0}),e._zod.parse=(e,r)=>{if(void 0===e.value){if("defaulted"!==t.innerType._zod.optin)return e;let n=t.innerType._zod.run({value:e.value,issues:[]},r);return n instanceof Promise?n.then(t=>i6(e,t)):i6(e,n)}return t.innerType._zod.run(e,r)}}),i7=rl("$ZodExactOptional",(e,t)=>{i8.init(e,t),rr(e,"values",e=>e.def.innerType._zod.values),rr(e,"pattern",e=>e.def.innerType._zod.pattern),e._zod.parse=(e,r)=>t.innerType._zod.run(e,r)}),se=rl("$ZodNullable",(e,t)=>{n1.init(e,t),rr(e,"optin",e=>e.def.innerType._zod.optin),rr(e,"optout",e=>e.def.innerType._zod.optout),rr(e,"pattern",e=>{let t=e.def.innerType._zod.pattern;return t?RegExp(`^(${e9(t.source)}|null)$`):void 0}),rr(e,"values",e=>e.def.innerType._zod.values?new Set([...e.def.innerType._zod.values,null]):void 0),e._zod.parse=(e,r)=>null===e.value?e:t.innerType._zod.run(e,r)}),st=rl("$ZodDefault",(e,t)=>{n1.init(e,t),e._zod.optin="defaulted",rr(e,"values",e=>e.def.innerType._zod.values),e._zod.parse=(e,r)=>{if("backward"===r.direction)return t.innerType._zod.run(e,r);if(void 0===e.value)return e.value=t.defaultValue,e;let n=t.innerType._zod.run(e,r);return n instanceof Promise?n.then(e=>sr(e,t)):sr(n,t)}});function sr(e,t){return void 0===e.value&&(e.value=t.defaultValue),e}let sn=rl("$ZodPrefault",(e,t)=>{n1.init(e,t),e._zod.optin="defaulted",rr(e,"values",e=>e.def.innerType._zod.values),e._zod.parse=(e,r)=>("backward"===r.direction||void 0===e.value&&(e.value=t.defaultValue),t.innerType._zod.run(e,r))}),si=rl("$ZodNonOptional",(e,t)=>{n1.init(e,t),rr(e,"values",e=>{let t=e.def.innerType._zod.values;return t?new Set([...t].filter(e=>void 0!==e)):void 0}),e._zod.parse=(r,n)=>{let i=t.innerType._zod.run(r,n);return i instanceof Promise?i.then(t=>ss(t,e)):ss(i,e)}});function ss(e,t){return e.issues.length||void 0!==e.value||e.issues.push({code:"invalid_type",expected:"nonoptional",input:e.value,inst:t}),e}function sa(e,t,r,n){return t.issues.length?e.value=r.catchValue({...t,value:e.value,error:{issues:t.issues.map(e=>tK(e,n,rp()))},input:e.value}):(e.value=t.value,t.memo&&(e.memo=!0)),e}(e,t)=>{n1.init(e,t),e._zod.parse=(e,r)=>{if("backward"===r.direction)throw new rd("ZodSuccess");let n=t.innerType._zod.run(e,r);return n instanceof Promise?n.then(t=>(e.value=0===t.issues.length,e)):(e.value=0===n.issues.length,e)}};let so=rl("$ZodCatch",(e,t)=>{n1.init(e,t),rr(e,"optin",e=>"defaulted"===e.def.innerType._zod.optin?"defaulted":"optional"),rr(e,"optout",e=>e.def.innerType._zod.optout),rr(e,"values",e=>e.def.innerType._zod.values),e._zod.parse=(e,r)=>{if("backward"===r.direction)return t.innerType._zod.run(e,r);let n=t.innerType._zod.run({value:e.value,issues:[]},r);return n instanceof Promise?n.then(n=>sa(e,n,t,r)):sa(e,n,t,r)}}),sl=((e,t)=>{n1.init(e,t),e._zod.parse=(t,r)=>("number"==typeof t.value&&Number.isNaN(t.value)||t.issues.push({input:t.value,inst:e,expected:"nan",code:"invalid_type"}),t)},rl("$ZodPipe",(e,t)=>{n1.init(e,t),rr(e,"values",e=>e.def.in._zod.values),rr(e,"optin",e=>e.def.in._zod.optin),rr(e,"optout",e=>e.def.out._zod.optout),rr(e,"propValues",e=>e.def.in._zod.propValues),e._zod.parse=(e,r)=>{if("backward"===r.direction){let n=t.out._zod.run(e,r);return n instanceof Promise?n.then(e=>sc(e,t.in,r)):sc(n,t.in,r)}let n=t.in._zod.run(e,r);return n instanceof Promise?n.then(e=>sc(e,t.out,r)):sc(n,t.out,r)}}));function sc(e,t,r){return e.issues.some(e=>"unrecognized_keys"!==e.code)?(e.aborted=!0,e):t._zod.run({value:e.value,issues:e.issues},r)}function sd(e,t,r){if(e.issues.length)return e.aborted=!0,e;if("forward"===(r.direction||"forward")){let n=t.transform(e.value,e);return n instanceof Promise?n.then(n=>su(e,n,t.out,r)):su(e,n,t.out,r)}{let n=t.reverseTransform(e.value,e);return n instanceof Promise?n.then(n=>su(e,n,t.in,r)):su(e,n,t.in,r)}}function su(e,t,r,n){return e.issues.length?(e.aborted=!0,e):r._zod.run({value:t,issues:e.issues},n)}(e,t)=>{n1.init(e,t),rr(e,"values",e=>e.def.in._zod.values),rr(e,"optin",e=>e.def.in._zod.optin),rr(e,"optout",e=>e.def.out._zod.optout),rr(e,"propValues",e=>e.def.in._zod.propValues),e._zod.parse=(e,r)=>{if("forward"===(r.direction||"forward")){let n=t.in._zod.run(e,r);return n instanceof Promise?n.then(e=>sd(e,t,r)):sd(n,t,r)}{let n=t.out._zod.run(e,r);return n instanceof Promise?n.then(e=>sd(e,t,r)):sd(n,t,r)}}},(e,t)=>{sl.init(e,t)};let sp=rl("$ZodReadonly",(e,t)=>{n1.init(e,t),rr(e,"propValues",e=>e.def.innerType._zod.propValues),rr(e,"values",e=>e.def.innerType._zod.values),rr(e,"optin",e=>e.def.innerType?._zod?.optin),rr(e,"optout",e=>e.def.innerType?._zod?.optout),e._zod.parse=(e,r)=>{if("backward"===r.direction)return t.innerType._zod.run(e,r);let n=t.innerType._zod.run(e,r);return n instanceof Promise?n.then(sf):sf(n)}});function sf(e){return e.memo||(e.value=Object.freeze(e.value)),e}(e,t)=>{n1.init(e,t);let r=[];for(let e of t.parts)if("object"==typeof e&&null!==e){let t=function e(t){let r=t._zod.def,n=t._zod.pattern?.source,i=r.innerType??t._zod.innerType;if(i){let t=i._zod.pattern?.source,r=e(i);return n&&t&&r&&r!==t?n.replace(e9(t),()=>e9(r)):n}if(r.options){let t=r.options.map(e);if(t.every(Boolean))return`^(${t.map(e=>e9(e)).join("|")})$`}return function(e){let t,r,n=e._zod.def,i=n.pattern,s=!!n.format?.includes("int");for(let e of n.checks??[]){let n=e._zod.def;n.pattern&&(i=n.pattern),s||(s=!!n.format?.includes("int"));let a=n.minimum??n.length,o=n.maximum??n.length;void 0!==a&&(void 0===t||a>t)&&(t=a),void 0!==o&&(void 0===r||o<r)&&(r=o)}if(i)return i.source;if(void 0!==t&&void 0!==r&&t>r)return"(?!)";if(void 0!==t||void 0!==r)return r1({minimum:t,maximum:r}).source;let a=e._zod.pattern;return(s&&a===r3?r4:a)?.source}(t)}(e);if(!t)throw Error(`Invalid template literal part, no pattern found: ${[...e._zod.traits].shift()}`);r.push(e9(t))}else if(null===e||tw.has(typeof e))r.push(t_(`${e}`));else throw Error(`Invalid template literal part: ${e}`);e._zod.pattern=RegExp(`^${r.join("")}$`),e._zod.parse=(r,n)=>("string"!=typeof r.value?r.issues.push({input:r.value,inst:e,expected:"string",code:"invalid_type"}):(e._zod.pattern.lastIndex=0,e._zod.pattern.test(r.value)||r.issues.push({input:r.value,inst:e,code:"invalid_format",format:t.format??"template_literal",pattern:e._zod.pattern.source})),r)},(e,t)=>{n1.init(e,t),e8(e._zod,"innerType",()=>(t._cachedInner||(t._cachedInner=t.getter()),t._cachedInner)),rr(e,"pattern",e=>e.innerType?._zod?.pattern),rr(e,"propValues",e=>e.innerType?._zod?.propValues),rr(e,"optin",e=>e.innerType?._zod?.optin??void 0),rr(e,"optout",e=>e.innerType?._zod?.optout??void 0),e._zod.parse=(t,r)=>e._zod.innerType._zod.run(t,r)};let sm=rl("$ZodCustom",(e,t)=>{np.init(e,t),n1.init(e,t),e._zod.parse=(e,t)=>e,e._zod.check=r=>{let n=r.value,i=t.fn(n);if(i instanceof Promise)return i.then(t=>sh(t,r,n,e));sh(i,r,n,e)}});function sh(e,t,r,n){if(!e){let e={code:"custom",input:r,inst:n,path:[...n._zod.def.path??[]],continue:!n._zod.def.abort};n._zod.def.params&&(e.params=n._zod.def.params),t.issues.push(tX(e))}}function sg(e){return e.checks&&(e.checks=[...e.checks]),e}function sv(e,t){return new ng({check:"less_than",...tk(t),value:e,inclusive:!1})}function sy(e,t){return new ng({check:"less_than",...tk(t),value:e,inclusive:!0})}function sx(e,t){return new nv({check:"greater_than",...tk(t),value:e,inclusive:!1})}function sb(e,t){return new nv({check:"greater_than",...tk(t),value:e,inclusive:!0})}function sw(e,t){return new ny({check:"multiple_of",...tk(t),value:e})}function s_(e,t){return new nk({check:"max_length",...tk(t),maximum:e})}function sj(e,t){return new nz({check:"min_length",...tk(t),minimum:e})}function sk(e,t){return new nN({check:"length_equals",...tk(t),length:e})}function sz(e){return new nI({check:"overwrite",tx:e})}e.i(682358);var sN=e.i(922143),sN=sN,sS=sN,s$=sN,sA=sN,sO=sN,sE=sN,sT=sN,sP=sN,sC=sN,sI=sN,sD=sN,sZ=sN,sF=sN,sR=sN,sM=sN,sL=sN,sU=e.i(247167);function sG(e,...t){for(let r of t)for(let t of Reflect.ownKeys(r))Object.prototype.propertyIsEnumerable.call(r,t)&&te(e,t,r[t]);return e}function sV(e){let t=e?.target??"draft-2020-12";return"draft-4"===t&&(t="draft-04"),"draft-7"===t&&(t="draft-07"),{processors:e.processors??{},metadataRegistry:e?.metadata??rw,target:t,unrepresentable:e?.unrepresentable??"throw",override:e?.override??(()=>{}),io:e?.io??"output",counter:0,seen:new Map,sharedDefsExtractedFor:void 0,sharedEmitDoneFor:void 0,cycles:e?.cycles??"ref",reused:e?.reused??"inline",intersections:[],deferred:[],external:e?.external??void 0}}function sK(e,t,r,n,i){let s="function"==typeof t.unrepresentable?t.unrepresentable({zodSchema:e,path:n.path,message:i}):t.unrepresentable;if("any"===s)return!1;if(void 0===s||"throw"===s)throw Error(i);return Object.assign(r,s),!0}function sB(e,t,r={path:[],schemaPath:[]}){var n;let i=e._zod.def,s=t.seen.get(e);if(s)return s.count++,r.schemaPath.includes(e)&&(s.cycle=r.path),s.schema;let a={schema:{},count:1,cycle:void 0,path:r.path};t.seen.set(e,a),t.sharedDefsExtractedFor=void 0,t.sharedEmitDoneFor=void 0;let o=e._zod.toJSONSchema?.();if(o)a.schema=o;else{let n={...r,schemaPath:[...r.schemaPath,e],path:r.path};if(e._zod.processJSONSchema)e._zod.processJSONSchema(t,a.schema,n);else{let r=a.schema,s=t.processors[i.type];if(!s)throw Error(`[toJSONSchema]: Non-representable type encountered: ${i.type}`);s(e,t,r,n)}let s=e._zod.parent;s&&(a.ref||(a.ref=s),sB(s,t,n),t.seen.get(s).isParent=!0)}let l=t.metadataRegistry.get(e);return l&&sG(a.schema,l),"input"===t.io&&function e(t,r){let n=r??{seen:new Set};if(n.seen.has(t))return!1;n.seen.add(t);let i=t._zod.def;if("transform"===i.type)return!0;if("array"===i.type)return e(i.element,n);if("set"===i.type)return e(i.valueType,n);if("lazy"===i.type)return e(i.getter(),n);if("promise"===i.type||"optional"===i.type||"nonoptional"===i.type||"nullable"===i.type||"readonly"===i.type||"default"===i.type||"prefault"===i.type||"catch"===i.type)return e(i.innerType,n);if("intersection"===i.type)return e(i.left,n)||e(i.right,n);if("record"===i.type||"map"===i.type)return e(i.keyType,n)||e(i.valueType,n);if("pipe"===i.type)return!!t._zod.traits.has("$ZodCodec")||e(i.in,n)||e(i.out,n);if("object"===i.type){for(let t in i.shape)if(e(i.shape[t],n))return!0;return!1}if("union"===i.type){for(let t of i.options)if(e(t,n))return!0;return!1}if("tuple"===i.type){for(let t of i.items)if(e(t,n))return!0;if(i.rest&&e(i.rest,n))return!0}return!1}(e)&&(delete a.schema.examples,delete a.schema.default),"input"===t.io&&"_prefault"in a.schema&&((n=a.schema).default??(n.default=a.schema._prefault)),delete a.schema._prefault,t.seen.get(e).schema}function sJ(e){return e.replace(/~/g,"~0").replace(/\//g,"~1")}function sq(e,t){let r=e.seen.get(t);if(!r)throw Error("Unprocessed schema. This is a bug in Zod.");if(e.external&&e.sharedDefsExtractedFor===e.external)return;let n=new Map;for(let t of e.seen.entries()){let r=e.metadataRegistry.get(t[0])?.id;if(r){let e=n.get(r);if(e&&e!==t[0])throw Error(`Duplicate schema id "${r}" detected during JSON Schema conversion. Two different schemas cannot share the same id when converted together.`);n.set(r,t[0])}}let i=t=>{if(t[1].schema.$ref)return;let n=t[1],{ref:i,defId:s}=(t=>{let n="draft-2020-12"===e.target?"$defs":"definitions";if(e.external){let r=e.external.registry.get(t[0])?.id,i=e.external.uri??(e=>e);if(r)return{ref:i(r)};let s=t[1].defId??t[1].schema.id??`schema${e.counter++}`;return t[1].defId=s,{defId:s,ref:`${i("__shared")}#/${n}/${sJ(s)}`}}let i=`#/${n}/`;if(t[1]===r&&!t[1].schema.id)return{ref:"#"};let s=t[1].schema.id??`__schema${e.counter++}`;return{defId:s,ref:i+sJ(s)}})(t);n.def={...n.schema},s&&(n.defId=s);let a=n.schema;for(let e in a)delete a[e];a.$ref=i};if("throw"===e.cycles)for(let t of e.seen.entries()){let e=t[1];if(e.cycle)throw Error(`Cycle detected: #/${e.cycle?.join("/")}/<root>
54
-
55
- Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`)}for(let r of e.seen.entries()){let n=r[1];if(t===r[0]){i(r);continue}if(e.external){let n=e.external.registry.get(r[0])?.id;if(t!==r[0]&&n){i(r);continue}}if(e.metadataRegistry.get(r[0])?.id||n.cycle){i(r);continue}n.count>1&&"ref"===e.reused&&i(r)}e.external&&(e.sharedDefsExtractedFor=e.external)}let sW=new Set(["type","properties","required","additionalProperties"]),sH=["oneOf","anyOf"];function sX(e){let t=e.additionalProperties;return void 0===t||!1===t||"object"!=typeof t||null===t?null:Object.keys(t).length?t:null}function sY(e){let t=[];for(let r of e){if("object"!=typeof r||"object"!==r.type)return null;for(let e in r)if(!sW.has(e))return null;t.push(r)}let r={},n=new Set;for(let e of t){for(let n in e.properties){if(Object.prototype.hasOwnProperty.call(r,n))continue;let e=[];for(let r of t){let t=r.properties?.[n]??sX(r);null!=t&&(e.some(e=>JSON.stringify(e)===JSON.stringify(t))||e.push(t))}te(r,n,1===e.length?e[0]:sY(e)??{allOf:e})}for(let t of e.required??[])n.add(t)}let i={type:"object",properties:r};if(n.size&&(i.required=[...n]),t.every(e=>!1===e.additionalProperties))i.additionalProperties=!1;else{let e=[];for(let r of t){let t=sX(r);t&&!e.some(e=>JSON.stringify(e)===JSON.stringify(t))&&e.push(t)}1===e.length?i.additionalProperties=e[0]:e.length>1&&(i.additionalProperties={allOf:e})}return i}function sQ(e,t){let r=e.seen.get(t);if(!r)throw Error("Unprocessed schema. This is a bug in Zod.");let n=t=>{let r=e.seen.get(t);if(null===r.ref)return;let i=r.def??r.schema,s={...i},a=r.ref;if(r.ref=null,a){n(a);let r=e.seen.get(a),o=r.schema;if(o.$ref&&("draft-07"===e.target||"draft-04"===e.target||"openapi-3.0"===e.target)?(i.allOf=i.allOf??[],i.allOf.push(o)):sG(i,o),sG(i,s),t._zod.parent===a)for(let e in i)"$ref"!==e&&"allOf"!==e&&(e in s||delete i[e]);if(o.$ref&&r.def)for(let e in i)"$ref"!==e&&"allOf"!==e&&e in r.def&&JSON.stringify(i[e])===JSON.stringify(r.def[e])&&delete i[e]}let o=t._zod.parent;if(o&&o!==a){n(o);let t=e.seen.get(o);if(t?.schema.$ref&&(i.$ref=t.schema.$ref,t.def))for(let e in i)"$ref"!==e&&"allOf"!==e&&e in t.def&&JSON.stringify(i[e])===JSON.stringify(t.def[e])&&delete i[e]}e.override({zodSchema:t,jsonSchema:i,path:r.path??[]})};if(!e.external||e.sharedEmitDoneFor!==e.external){for(let t of[...e.seen.entries()].reverse())n(t[0]);if("openapi-3.0"!==e.target)for(let t of e.seen.entries())!function e(t){let r=t.anyOf;if(!Array.isArray(r)||0===r.length||void 0!==t.type)return;let n=[];for(let t of r){if(!t||"object"!=typeof t)return;e(t);let r=Object.keys(t);if(1!==r.length||"type"!==r[0])return;let i=t.type;for(let e of Array.isArray(i)?i:[i]){if("string"!=typeof e)return;n.includes(e)||n.push(e)}}delete t.anyOf,t.type=1===n.length?n[0]:n}(t[1].def??t[1].schema);for(let t of e.deferred)t();if(e.intersections.length){let t=new Map;for(let r of e.seen.values())for(let e of[r.schema,r.def]){let r=e?.allOf;if(!Array.isArray(r))continue;let n=t.get(r);n?n.push(e):t.set(r,[e])}for(let r of e.intersections)for(let e of t.get(r)??[])!function(e){let t=e.allOf;if(!Array.isArray(t)||t.length<2)return;for(let t of sW)if(t in e)return;let r=t.filter(e=>sH.some(t=>Array.isArray(e[t]))),n=null;if(r.length){let e=r[0],i=sH.find(t=>Array.isArray(e[t]));if(1!==Object.keys(e).length)return;let s=t.filter(t=>t!==e),a=e[i].map(e=>sY([...s,e]));if(a.some(e=>!e))return;n={[i]:a}}else n=sY(t);n&&(delete e.allOf,sG(e,n))}(e)}}let i={};if("draft-2020-12"===e.target?i.$schema="https://json-schema.org/draft/2020-12/schema":"draft-07"===e.target?i.$schema="http://json-schema.org/draft-07/schema#":"draft-04"===e.target?i.$schema="http://json-schema.org/draft-04/schema#":e.target,e.external?.uri){let r=e.external.registry.get(t)?.id;if(!r)throw Error("Schema is missing an `id` property");i.$id=e.external.uri(r)}sG(i,r.defId?r.schema:r.def??r.schema);let s=e.metadataRegistry.get(t)?.id;void 0!==s&&i.id===s&&delete i.id;let a=e.external?.defs??{};if(!e.external||e.sharedEmitDoneFor!==e.external)for(let t of e.seen.entries()){let e=t[1];e.def&&e.defId&&(e.def.id===e.defId&&delete e.def.id,te(a,e.defId,e.def))}e.external&&(e.sharedEmitDoneFor=e.external),e.external||Object.keys(a).length>0&&("draft-2020-12"===e.target?i.$defs=a:i.definitions=a);try{let r=JSON.parse(JSON.stringify(i));return Object.defineProperty(r,"~standard",{value:{...t["~standard"],jsonSchema:{input:s0(t,"input",e.processors),output:s0(t,"output",e.processors)}},enumerable:!1,writable:!1}),r}catch(e){throw Error("Error converting schema to JSON.")}}let s0=(e,t,r={})=>n=>{let{libraryOptions:i,target:s}=n??{},a=sV({...i??{},target:s,io:t,processors:r});return sB(e,a),sq(a,e),sQ(a,e)},s1=(e,t,r)=>{(void 0===e[t]||r>e[t])&&(e[t]=r)},s2=(e,t,r)=>{(void 0===e[t]||r<e[t])&&(e[t]=r)},s4=(e,t)=>{s1(e,"minimum",t),s2(e,"maximum",t)},s3=(e,t)=>{e.multipleOf??(e.multipleOf=[]),e.multipleOf.includes(t)||e.multipleOf.push(t)},s9=(e,t)=>{e.patterns??(e.patterns=new Set),e.patterns.add(t)},s5=(e,t)=>{e.mime=e.mime?e.mime.filter(e=>t.includes(e)):[...t]},s6=(e,t)=>{e.format=t,t.includes("int")&&(e.isInt=!0)},s8=(e,t)=>s1(e,"minimum",t.minimum),s7=(e,t)=>s2(e,"maximum",t.maximum),ae=e=>(t,r)=>{s6(t,r.format);let[n,i]=e[r.format];s1(t,"minimum",n),s2(t,"maximum",i)},at={greater_than:(e,t)=>s1(e,t.inclusive?"minimum":"exclusiveMinimum",t.value),less_than:(e,t)=>s2(e,t.inclusive?"maximum":"exclusiveMaximum",t.value),multiple_of:(e,t)=>s3(e,t.value),number_format:ae(t$),bigint_format:ae(tA),min_length:s8,max_length:s7,length_equals:(e,t)=>s4(e,t.length),min_size:s8,max_size:s7,size_equals:(e,t)=>s4(e,t.size),string_format:(e,t)=>{s6(e,t.format),t.pattern&&s9(e,t.pattern),("base64"===t.format||"base64url"===t.format)&&(e.contentEncoding=t.format),(t.local||-1===t.precision)&&(e.laxFormat=!0)},mime_type:(e,t)=>s5(e,t.mime)};function ar(e){let t={},r=e._zod.def;for(let n of e._zod.traits.has("$ZodCheck")?[e,...r.checks??[]]:r.checks??[])at[n._zod.def.check]?.(t,n._zod.def);let n=e._zod.bag;for(let e of(void 0!==n.minimum&&s1(t,"minimum",n.minimum),void 0!==n.exclusiveMinimum&&s1(t,"exclusiveMinimum",n.exclusiveMinimum),void 0!==n.maximum&&s2(t,"maximum",n.maximum),void 0!==n.exclusiveMaximum&&s2(t,"exclusiveMaximum",n.exclusiveMaximum),void 0!==n.multipleOf&&s3(t,n.multipleOf),void 0!==n.format&&(t.format??(t.format=n.format),n.format.includes("int")&&(t.isInt=!0)),n.mime&&s5(t,n.mime),n.patterns??[]))s9(t,e);return t}let an={guid:"uuid",url:"uri",datetime:"date-time",json_string:"json-string",regex:""},ai=new Map([[ik,rG],[iN,rV]]),as=e=>ai.get(e)??e;new WeakMap;let aa=Symbol();function ao(e,t,r,n,i){let s=!1,a=JSON.stringify(e,(e,t)=>"bigint"!=typeof t?t:(s=!0,null));return s?(sK(t,r,n,i,"BigInt defaults cannot be represented in JSON Schema"),aa):JSON.parse(a)}let al=(e,t,r,n)=>{let i=e._zod.def;sB(i.innerType,t,n),t.seen.get(e).ref=i.innerType},ac=new WeakSet([Object.prototype,Error.prototype]);function ad(e,t,r){Object.defineProperty(e,t,{configurable:!0,enumerable:!1,get(){let e=r(this);return Object.defineProperty(this,t,{value:e,configurable:!0,writable:!0}),e},set(e){Object.defineProperty(this,t,{value:e,configurable:!0,writable:!0})}})}let au=rl("ZodError",(e,t)=>{nL.init(e,t),e.name="ZodError";let r=Object.getPrototypeOf(e);ac.has(r)||(ac.add(r),ad(r,"format",e=>t=>(function(e,t=e=>e.message){let r={_errors:[]},n=(e,i=[])=>{for(let s of e.issues)if("invalid_union"===s.code&&s.errors.length)s.errors.map(e=>n({issues:e},[...i,...s.path]));else if("invalid_key"===s.code)n({issues:s.issues},[...i,...s.path]);else if("invalid_element"===s.code)n({issues:s.issues},[...i,...s.path]);else{let e=[...i,...s.path];if(0===e.length)r._errors.push(t(s));else{let n=r,i=0;for(;i<e.length;){let r=e[i],a=i===e.length-1;if("_errors"===r){a&&n._errors.push(t(s)),i++;continue}Object.prototype.hasOwnProperty.call(n,r)||Object.defineProperty(n,r,{value:{_errors:[]},enumerable:!0,writable:!0,configurable:!0});let o=n[r];a&&o._errors.push(t(s)),n=o,i++}}}};return n(e),r})(e,t)),ad(r,"flatten",e=>t=>(function(e,t=e=>e.message){let r={},n=[];for(let a of e.issues)if(a.path.length>0){var i,s;(i=a.path[0],s=()=>[],!Object.prototype.hasOwnProperty.call(r,i)&&("__proto__"===i?Object.defineProperty(r,i,{value:s(),writable:!0,enumerable:!0,configurable:!0}):r[i]=s()),r[i]).push(t(a))}else n.push(t(a));return{formErrors:n,fieldErrors:r}})(e,t)),ad(r,"addIssue",e=>t=>{e.issues.push(t),e.message=JSON.stringify(e.issues,e1,2)}),ad(r,"addIssues",e=>t=>{e.issues.push(...t),e.message=JSON.stringify(e.issues,e1,2)}),Object.defineProperty(r,"isEmpty",{configurable:!0,enumerable:!1,get(){return 0===this.issues.length}}))},void 0,{Parent:Error});e.s(["ZodRealError",0,au],789282);let ap=nV(au),af=nB(au),am=nq(au),ah=nH(au),ag=(n=nV(au),i=(e,t,r,s)=>n(e,t,r?{...r,direction:"backward"}:{direction:"backward"},nG(i,s))),av=(s=nV(au),a=(e,t,r,n)=>s(e,t,r,nG(a,n))),ay=(o=nB(au),l=async(e,t,r,n)=>{let i=r?{...r,direction:"backward"}:{direction:"backward"};return await o(e,t,i,nG(l,n))}),ax=(c=nB(au),d=async(e,t,r,n)=>await c(e,t,r,nG(d,n))),ab=(e,t,r)=>{let n=r?{...r,direction:"backward"}:{direction:"backward"};return nq(au)(e,t,n)},aw=(e,t,r)=>nq(au)(e,t,r),a_=async(e,t,r)=>{let n=r?{...r,direction:"backward"}:{direction:"backward"};return nH(au)(e,t,n)},aj=async(e,t,r)=>nH(au)(e,t,r);function ak(){ru.memoizer||rp({memoizer:rb})}let az=rl("ZodType",(e,t)=>(ru.localeError||rp({localeError:(()=>{let e={string:{unit:"characters",verb:"to have"},file:{unit:"bytes",verb:"to have"},array:{unit:"items",verb:"to have"},set:{unit:"items",verb:"to have"},map:{unit:"entries",verb:"to have"}},t={regex:"input",email:"email address",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO datetime",date:"ISO date",time:"ISO time",duration:"ISO duration",ipv4:"IPv4 address",ipv6:"IPv6 address",mac:"MAC address",cidrv4:"IPv4 range",cidrv6:"IPv6 range",base64:"base64-encoded string",base64url:"base64url-encoded string",json_string:"JSON string",e164:"E.164 number",currency_code:"currency code",credit_card:"credit card number",iban:"IBAN",jwt:"JWT",template_literal:"input"},r={nan:"NaN"};function n(e,t){return"number"!==e||"number"!=typeof t||Number.isFinite(t)?r[e]??e:String(t)}return r=>{switch(r.code){case"invalid_type":{let e=n(r.expected),t=n(tH(r.input),r.input);return`Invalid input: expected ${e}, received ${t}`}case"invalid_value":if(1===r.values.length)return`Invalid input: expected ${tN(r.values[0])}`;return`Invalid option: expected one of ${e0(r.values,"|")}`;case"too_big":{let t=r.exact?"exactly ":r.inclusive?"<=":"<",n=e[r.origin]??null;if(n)return`Too big: expected ${r.origin??"value"} to have ${t}${r.maximum.toString()} ${n.unit??"elements"}`;return`Too big: expected ${r.origin??"value"} to be ${t}${r.maximum.toString()}`}case"too_small":{let t=r.exact?"exactly ":r.inclusive?">=":">",n=e[r.origin]??null;if(n)return`Too small: expected ${r.origin} to have ${t}${r.minimum.toString()} ${n.unit}`;return`Too small: expected ${r.origin} to be ${t}${r.minimum.toString()}`}case"invalid_format":if("starts_with"===r.format)return`Invalid string: must start with "${r.prefix}"`;if("ends_with"===r.format)return`Invalid string: must end with "${r.suffix}"`;if("includes"===r.format)return`Invalid string: must include "${r.includes}"`;if("regex"===r.format)return`Invalid string: must match pattern ${r.pattern}`;return`Invalid ${t[r.format]??r.format}`;case"not_multiple_of":return`Invalid number: must be a multiple of ${r.divisor}`;case"unrecognized_keys":return`Unrecognized key${r.keys.length>1?"s":""}: ${e0(r.keys,", ")}`;case"invalid_key":return`Invalid key in ${r.origin}`;case"invalid_union":if(r.options&&Array.isArray(r.options)&&r.options.length>0){let e=r.options.map(e=>`'${e}'`).join(" | ");return`Invalid discriminator value. Expected ${e}`}if(!1===r.inclusive)return"Invalid input: more than one option matched";return"Invalid input";case"invalid_element":return`Invalid value in ${r.origin}`;default:return"Invalid input"}}})()}),n1.init(e,t),e.def=t,e.type=t.type,e),{check(...e){let t=this.def;return this.clone(sS.mergeDefs(t,{checks:[...t.checks??[],...e.map(e=>"function"==typeof e?{_zod:{check:e,def:{check:"custom"},onattach:[]}}:e)]}),{parent:!0})},with(...e){return this.check(...e)},clone(e,t){return tj(this,e,t)},brand(){return this},register(e,t){return e.add(this,t),this},refine(e,t){return this.check(function(e,t={}){return new og({type:"custom",check:"custom",fn:e,...tk(t)})}(e,t))},superRefine(e,t){return this.check(function(e,t){var r;let n,i;return r=t=>(t.addIssue=e=>{"string"==typeof e?t.issues.push(tX(e,t.value,n._zod.def)):(e.fatal&&(e.continue=!1),e.code??(e.code="custom"),"input"in e||(e.input=t.value),e.inst??(e.inst=n),e.continue??(e.continue=!n._zod.def.abort),t.issues.push(tX(e)))},e(t.value,t)),(i=new np({check:"custom",...tk(t)}))._zod.check=r,n=i}(e,t))},overwrite(e){return this.check(sz(e))},optional(){return os(this)},exactOptional(){var e;return e=this,new oa({type:"optional",innerType:e})},nullable(){return ol(this)},nullish(){return os(ol(this))},nonoptional(e){var t,r;return t=this,r=e,new ou({type:"nonoptional",innerType:t,...sE.normalizeParams(r)})},array(){return a6(this)},or(e){return new oe({type:"union",options:[this,e],...sE.normalizeParams(void 0)})},and(e){var t;return t=this,new ot({type:"intersection",left:t,right:e})},transform(e){return om(this,new on({type:"transform",transform:e}))},default(e){var t,r;return t=this,r=e,new oc({type:"default",innerType:t,get defaultValue(){return"function"==typeof r?r():sL.shallowClone(r)}})},prefault(e){var t,r;return t=this,r=e,new od({type:"prefault",innerType:t,get defaultValue(){return"function"==typeof r?r():sL.shallowClone(r)}})},catch(e){var t,r;return t=this,new op({type:"catch",innerType:t,catchValue:"function"==typeof(r=e)?r:sN.constantCatch(r)})},pipe(e){return om(this,e)},readonly(){var e;return e=this,new oh({type:"readonly",innerType:e})},describe(e){let t=this.clone();return rw.add(t,{description:e}),t},meta(...e){if(0===e.length)return rw.get(this);let t=this.clone();return rw.add(t,e[0]),t},isOptional(){return this.safeParse(void 0).success},isNullable(){return this.safeParse(null).success},apply(e,...t){return 0===t.length?e(this):e(this,...t)},get"~standard"(){return s$.hide(this,"~standard",{...n3(this),jsonSchema:{input:s0(this,"input"),output:s0(this,"output")}})},set"~standard"(e){sA.own(this,"~standard",e)},parse:function e(t,r){return ap(this,t,r,{callee:e})},parseAsync:async function e(t,r){return await af(this,t,r,{callee:e})},safeParse(e,t){return am(this,e,t)},async safeParseAsync(e,t){return ah(this,e,t)},get spa(){return this?.safeParseAsync},set spa(e){sA.own(this,"spa",e)},validate(e,t){let r=this._zod.bag.validator;if(void 0!==r){if(r(e)!==nX)return!0;if(!0===r.definite&&void 0===t)return!1}return function(e,t,r){let n,i=r?{...r,async:!1,abortEarly:!0}:{async:!1,abortEarly:!0},s=e._zod.bag.fallbackRun;if(s?(i[nY]=!0,n=s({value:t,issues:[]},i)):n=e._zod.run({value:t,issues:[]},i),n instanceof Promise)throw new rc;return 0===n.issues.length}(this,e,t)},validateAsync(e,t){return nQ(this,e,t)},encode:function e(t,r){return ag(this,t,r,{callee:e})},decode:function e(t,r){return av(this,t,r,{callee:e})},encodeAsync:async function e(t,r){return await ay(this,t,r,{callee:e})},decodeAsync:async function e(t,r){return await ax(this,t,r,{callee:e})},safeEncode(e,t){return ab(this,e,t)},safeDecode(e,t){return aw(this,e,t)},async safeEncodeAsync(e,t){return a_(this,e,t)},async safeDecodeAsync(e,t){return aj(this,e,t)},toJSONSchema(e){return((e,t={})=>r=>{let n=sV({...r,processors:t});return sB(e,n),sq(n,e),sQ(n,e)})(this,{})(e)},get description(){return rw.get(this)?.description},get _def(){return this._zod.def}}),aN=rl("_ZodString",(e,t)=>{n9.init(e,t),az.init(e,t),e._zod.processJSONSchema=(t,r,n)=>((e,t,r)=>{r.type="string";let{minimum:n,maximum:i,format:s,patterns:a,contentEncoding:o,laxFormat:l}=ar(e);if("number"==typeof n&&(r.minLength=n),"number"==typeof i&&(r.maxLength=i),s&&(r.format=an[s]??s,""===r.format&&delete r.format,("time"===s||l)&&delete r.format),o&&(r.contentEncoding=o),a&&a.size>0){let e=[...a].map(as);1===e.length?r.pattern=e[0].source:e.length>1&&(r.allOf=[...e.map(e=>({..."draft-07"===t.target||"draft-04"===t.target||"openapi-3.0"===t.target?{type:"string"}:{},pattern:e.source}))])}})(e,t,r)},sO.derived({format:e=>ar(e).format??null,minLength:e=>ar(e).minimum??null,maxLength:e=>ar(e).maximum??null},{regex(...e){return this.check(function(e,t){return new n$({check:"string_format",format:"regex",...tk(t),pattern:e})}(...e))},includes(...e){return this.check(function(e,t){return new nE({check:"string_format",format:"includes",...tk(t),includes:e})}(...e))},startsWith(...e){return this.check(function(e,t){return new nT({check:"string_format",format:"starts_with",...tk(t),prefix:e})}(...e))},endsWith(...e){return this.check(function(e,t){return new nP({check:"string_format",format:"ends_with",...tk(t),suffix:e})}(...e))},min(...e){return this.check(sj(...e))},max(...e){return this.check(s_(...e))},length(...e){return this.check(sk(...e))},nonempty(...e){return this.check(sj(1,...e))},lowercase(e){return this.check(new nA({check:"string_format",format:"lowercase",...tk(e)}))},uppercase(e){return this.check(new nO({check:"string_format",format:"uppercase",...tk(e)}))},trim(){return this.check(sz(e=>e.trim()))},normalize(...e){return this.check(function(e){return sz(t=>t.normalize(e))}(...e))},toLowerCase(){return this.check(sz(e=>e.toLowerCase()))},toUpperCase(){return this.check(sz(e=>e.toUpperCase()))},slugify(){return this.check(sz(e=>tp(e)))}})),aS=rl("ZodString",(e,t)=>{n9.init(e,t),aN.init(e,t)},{email(e){return this.check(new aC({type:"string",format:"email",check:"string_format",abort:!1,...tk(e)}))},url(e){return this.check(new aZ({type:"string",format:"url",check:"string_format",abort:!1,...tk(e)}))},jwt(e){return this.check(new aY({type:"string",format:"jwt",check:"string_format",abort:!1,...tk(e)}))},emoji(e){return this.check(new aF({type:"string",format:"emoji",check:"string_format",abort:!1,...tk(e)}))},guid(e){return this.check(new aI({type:"string",format:"guid",check:"string_format",abort:!1,...tk(e)}))},uuid(e){return this.check(new aD({type:"string",format:"uuid",check:"string_format",abort:!1,...tk(e)}))},uuidv4(e){return this.check(new aD({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v4",...tk(e)}))},uuidv6(e){return this.check(new aD({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v6",...tk(e)}))},uuidv7(e){return this.check(new aD({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v7",...tk(e)}))},nanoid(e){return this.check(new aR({type:"string",format:"nanoid",check:"string_format",abort:!1,...tk(e)}))},cuid(e){return this.check(new aM({type:"string",format:"cuid",check:"string_format",abort:!1,...tk(e)}))},cuid2(e){return this.check(new aL({type:"string",format:"cuid2",check:"string_format",abort:!1,...tk(e)}))},ulid(e){return this.check(new aU({type:"string",format:"ulid",check:"string_format",abort:!1,...tk(e)}))},base64(e){return this.check(new aW({type:"string",format:"base64",check:"string_format",abort:!1,...tk(e)}))},base64url(e){return this.check(new aH({type:"string",format:"base64url",check:"string_format",abort:!1,...tk(e)}))},xid(e){return this.check(new aG({type:"string",format:"xid",check:"string_format",abort:!1,...tk(e)}))},ksuid(e){return this.check(new aV({type:"string",format:"ksuid",check:"string_format",abort:!1,...tk(e)}))},ipv4(e){return this.check(new aK({type:"string",format:"ipv4",check:"string_format",abort:!1,...tk(e)}))},ipv6(e){return this.check(new aB({type:"string",format:"ipv6",check:"string_format",abort:!1,...tk(e)}))},cidrv4(e){return this.check(new aJ({type:"string",format:"cidrv4",check:"string_format",abort:!1,...tk(e)}))},cidrv6(e){return this.check(new aq({type:"string",format:"cidrv6",check:"string_format",abort:!1,...tk(e)}))},e164(e){return this.check(new aX({type:"string",format:"e164",check:"string_format",abort:!1,...tk(e)}))},datetime(e){return this.check(new aO({type:"string",format:"datetime",check:"string_format",offset:!1,local:!1,precision:null,...tk(e)}))},date(e){return this.check(new aE({type:"string",format:"date",check:"string_format",...tk(e)}))},time(e){return this.check(new aT({type:"string",format:"time",check:"string_format",precision:null,...tk(e)}))},duration(e){return this.check(new aP({type:"string",format:"duration",check:"string_format",...tk(e)}))}});function a$(e){return new aS(sg({type:"string",...tk(e)}))}let aA=rl("ZodStringFormat",(e,t)=>{n5.init(e,t),aN.init(e,t)}),aO=rl("ZodISODateTime",(e,t)=>{ip.init(e,t),aA.init(e,t)}),aE=rl("ZodISODate",(e,t)=>{im.init(e,t),aA.init(e,t)}),aT=rl("ZodISOTime",(e,t)=>{ih.init(e,t),aA.init(e,t)}),aP=rl("ZodISODuration",(e,t)=>{ig.init(e,t),aA.init(e,t)}),aC=rl("ZodEmail",(e,t)=>{n7.init(e,t),aA.init(e,t)}),aI=rl("ZodGUID",(e,t)=>{n6.init(e,t),aA.init(e,t)}),aD=rl("ZodUUID",(e,t)=>{n8.init(e,t),aA.init(e,t)}),aZ=rl("ZodURL",(e,t)=>{ii.init(e,t),aA.init(e,t)}),aF=rl("ZodEmoji",(e,t)=>{is.init(e,t),aA.init(e,t)}),aR=rl("ZodNanoID",(e,t)=>{ia.init(e,t),aA.init(e,t)}),aM=rl("ZodCUID",(e,t)=>{io.init(e,t),aA.init(e,t)}),aL=rl("ZodCUID2",(e,t)=>{il.init(e,t),aA.init(e,t)}),aU=rl("ZodULID",(e,t)=>{ic.init(e,t),aA.init(e,t)}),aG=rl("ZodXID",(e,t)=>{id.init(e,t),aA.init(e,t)}),aV=rl("ZodKSUID",(e,t)=>{iu.init(e,t),aA.init(e,t)}),aK=rl("ZodIPv4",(e,t)=>{iv.init(e,t),aA.init(e,t)}),aB=rl("ZodIPv6",(e,t)=>{ib.init(e,t),aA.init(e,t)}),aJ=rl("ZodCIDRv4",(e,t)=>{iw.init(e,t),aA.init(e,t)}),aq=rl("ZodCIDRv6",(e,t)=>{i_.init(e,t),aA.init(e,t)}),aW=rl("ZodBase64",(e,t)=>{iz.init(e,t),aA.init(e,t)}),aH=rl("ZodBase64URL",(e,t)=>{iS.init(e,t),aA.init(e,t)}),aX=rl("ZodE164",(e,t)=>{i$.init(e,t),aA.init(e,t)}),aY=rl("ZodJWT",(e,t)=>{iO.init(e,t),aA.init(e,t)}),aQ=rl("ZodNumber",(e,t)=>{iE.init(e,t),az.init(e,t),e._zod.processJSONSchema=(t,r,n)=>((e,t,r,n)=>{let{minimum:i,maximum:s,multipleOf:a,exclusiveMaximum:o,exclusiveMinimum:l,isInt:c}=ar(e);r.type=c?"integer":"number";let d="number"==typeof l&&l>=(i??-1/0),u="number"==typeof o&&o<=(s??1/0),p="draft-04"===t.target||"openapi-3.0"===t.target;if(d?p?(r.minimum=l,r.exclusiveMinimum=!0):r.exclusiveMinimum=l:"number"==typeof i&&(r.minimum=i),u?p?(r.maximum=o,r.exclusiveMaximum=!0):r.exclusiveMaximum=o:"number"==typeof s&&(r.maximum=s),a){let i=new Set;for(let s of a)Number.isFinite(s)&&0!==s?i.add(Math.abs(s)):sK(e,t,r,n,`A multipleOf divisor of ${s} cannot be represented in JSON Schema`);let[s,...o]=i;void 0!==s&&(r.multipleOf=s),o.length&&(r.allOf=[...r.allOf??[],...o.map(e=>({multipleOf:e}))])}})(e,t,r,n),e.isFinite=!0},sO.derived({minValue:e=>{let{minimum:t,exclusiveMinimum:r}=ar(e);return Math.max(t??-1/0,r??-1/0)},maxValue:e=>{let{maximum:t,exclusiveMaximum:r}=ar(e);return Math.min(t??1/0,r??1/0)},isInt:e=>{let{isInt:t,multipleOf:r}=ar(e);return!!t||!!r?.some(Number.isSafeInteger)},format:e=>ar(e).format??null},{gt(e,t){return this.check(sx(e,t))},gte(e,t){return this.check(sb(e,t))},min(e,t){return this.check(sb(e,t))},lt(e,t){return this.check(sv(e,t))},lte(e,t){return this.check(sy(e,t))},max(e,t){return this.check(sy(e,t))},int(e){return this.check(a2(e))},safe(e){return this.check(a2(e))},positive(e){return this.check(sx(0,e))},nonnegative(e){return this.check(sb(0,e))},negative(e){return this.check(sv(0,e))},nonpositive(e){return this.check(sy(0,e))},multipleOf(e,t){return this.check(sw(e,t))},step(e,t){return this.check(sw(e,t))},finite(){return this}}));function a0(e){return new aQ(sg({type:"number",checks:[],...tk(e)}))}let a1=rl("ZodNumberFormat",(e,t)=>{iT.init(e,t),aQ.init(e,t)});function a2(e){return new a1({type:"number",check:"number_format",abort:!1,format:"safeint",...tk(e)})}(e,t)=>{iP.init(e,t),az.init(e,t),e._zod.processJSONSchema=(t,r,n)=>{sK(e,t,r,n,"BigInt cannot be represented in JSON Schema")}};let a4=rl("ZodUnknown",(e,t)=>{iC.init(e,t),az.init(e,t),e._zod.processJSONSchema=(e,t,r)=>void 0});function a3(){return new a4({type:"unknown"})}let a9=rl("ZodNever",(e,t)=>{iI.init(e,t),az.init(e,t),e._zod.processJSONSchema=(e,t,r)=>{t.not={}}}),a5=rl("ZodArray",(e,t)=>{ak(),iL.init(e,t),az.init(e,t),e._zod.processJSONSchema=(t,r,n)=>((e,t,r,n)=>{let i=e._zod.def,{minimum:s,maximum:a}=ar(e);"number"==typeof s&&(r.minItems=s),"number"==typeof a&&(r.maxItems=a),r.type="array",r.items=sB(i.element,t,{...n,path:[...n.path,"items"]})})(e,t,r,n),e.element=t.element},{min(e,t){return this.check(sj(e,t))},nonempty(e){return this.check(sj(1,e))},max(e,t){return this.check(s_(e,t))},length(e,t){return this.check(sk(e,t))},unwrap(){return this.element}});function a6(e,t){return new a5({type:"array",element:e,...tk(t)})}let a8=rl("ZodObject",(e,t)=>{ak(),iJ.init(e,t),az.init(e,t),e._zod.processJSONSchema=(t,r,n)=>((e,t,r,n)=>{let i=e._zod.def,s=i.shape;if(Object.getOwnPropertySymbols(s).length&&sK(e,t,r,n,"Symbol keys cannot be represented in JSON Schema"))return;for(let e in r.type="object",r.properties={},s)te(r.properties,e,sB(s[e],t,{...n,path:[...n.path,"properties",e]}));let a=[];for(let e of Object.keys(s)){let r=i.shape[e];("input"===t.io?void 0===function e(t){let r=t._zod.def;return"pipe"===r.type&&r.in._zod.traits.has("$ZodTransform")?e(r.out):"catch"===r.type?e(r.innerType):t._zod.optin}(r):void 0===r._zod.optout)&&a.push(e)}a.length>0&&(r.required=a),i.catchall?._zod.def.type==="never"?r.additionalProperties=!1:i.catchall?i.catchall&&(r.additionalProperties=sB(i.catchall,t,{...n,path:[...n.path,"additionalProperties"]})):"output"===t.io&&(r.additionalProperties=!1)})(e,t,r,n),sR.installLazyProp(e,"shape",e=>e._zod.def.shape,!1)},{keyof(){var e;return new or({type:"enum",entries:Array.isArray(e=Object.keys(this._zod.def.shape))?Object.fromEntries(e.map(e=>[e,e])):e,...sE.normalizeParams(void 0)})},catchall(e){return this.clone(sS.mergeDefs(this._zod.def,{catchall:e}))},passthrough(){return this.clone(sS.mergeDefs(this._zod.def,{catchall:a3()}))},loose(){return this.clone(sS.mergeDefs(this._zod.def,{catchall:a3()}))},strict(){return this.clone(sS.mergeDefs(this._zod.def,{catchall:new a9({type:"never",...tk(void 0)})}))},strip(){return this.clone(sS.mergeDefs(this._zod.def,{catchall:void 0}))},extend(e){return sT.extend(this,e)},safeExtend(e){return sP.safeExtend(this,e)},merge(e){return sC.merge(this,e)},pick(e){return sI.pick(this,e)},omit(e){return sD.omit(this,e)},partial(...e){return sZ.partial(oi,this,e[0])},exactPartial(...e){return sZ.partial(oa,this,e[0],"exactPartial")},required(...e){return sF.required(ou,this,e[0])}});function a7(e,t){return new a8({type:"object",shape:e??{},...sE.normalizeParams(t)})}let oe=rl("ZodUnion",(e,t)=>{iW.init(e,t),az.init(e,t),e._zod.processJSONSchema=(t,r,n)=>{var i,s,a,o;let l,c,d;return i=e,s=t,a=r,o=n,c=!1===(l=i._zod.def).inclusive,d=l.options.map((e,t)=>sB(e,s,{...o,path:[...o.path,c?"oneOf":"anyOf",t]})),void(c?a.oneOf=d:a.anyOf=d)},e.options=t.options}),ot=rl("ZodIntersection",(e,t)=>{iX.init(e,t),az.init(e,t),e._zod.processJSONSchema=(t,r,n)=>{let i,s,a,o,l;return s=sB((i=e._zod.def).left,t,{...n,path:[...n.path,"allOf",0]}),a=sB(i.right,t,{...n,path:[...n.path,"allOf",1]}),void(r.allOf=l=[...(o=e=>"allOf"in e&&1===Object.keys(e).length)(s)?s.allOf:[s],...o(a)?a.allOf:[a]],t.intersections.push(l))}}),or=rl("ZodEnum",(e,t)=>{i9.init(e,t),az.init(e,t),e._zod.processJSONSchema=(t,r,n)=>((e,t)=>{let r=eQ(e._zod.def.entries);if(0===r.length){t.not={};return}r.every(e=>"number"==typeof e)&&(t.type="number"),r.every(e=>"string"==typeof e)&&(t.type="string"),t.enum=r})(e,r),e.enum=t.entries,e.options=[...e._zod.values];let r=new Set(Object.keys(t.entries));e.extract=(e,n)=>{let i={};for(let n of e)if(r.has(n))i[n]=t.entries[n];else throw Error(`Key ${n} not found in enum`);return new or({...t,checks:[],...sE.normalizeParams(n),entries:i})},e.exclude=(e,n)=>{let i={...t.entries};for(let t of e)if(r.has(t))delete i[t];else throw Error(`Key ${t} not found in enum`);return new or({...t,checks:[],...sE.normalizeParams(n),entries:i})}}),on=rl("ZodTransform",(e,t)=>{ak(),i5.init(e,t),az.init(e,t),e._zod.processJSONSchema=(t,r,n)=>{sK(e,t,r,n,"Transforms cannot be represented in JSON Schema")},e._zod.parse=(r,n)=>{if("backward"===n.direction)throw new rd(e.constructor.name);r.addIssue=n=>{"string"==typeof n?r.issues.push(sM.issue(n,r.value,t)):(n.fatal&&(n.continue=!1),n.code??(n.code="custom"),"input"in n||(n.input=r.value),n.inst??(n.inst=e),r.issues.push(sM.issue(n)))};let i=t.transform(r.value,r);return i instanceof Promise?i.then(e=>(r.value=e,r)):(r.value=i,r)}}),oi=rl("ZodOptional",(e,t)=>{i8.init(e,t),az.init(e,t),e._zod.processJSONSchema=(t,r,n)=>al(e,t,r,n),e.unwrap=()=>e._zod.def.innerType});function os(e){return new oi({type:"optional",innerType:e})}let oa=rl("ZodExactOptional",(e,t)=>{i7.init(e,t),az.init(e,t),e._zod.processJSONSchema=(t,r,n)=>al(e,t,r,n),e.unwrap=()=>e._zod.def.innerType}),oo=rl("ZodNullable",(e,t)=>{se.init(e,t),az.init(e,t),e._zod.processJSONSchema=(t,r,n)=>{let i,s,a;return s=sB((i=e._zod.def).innerType,t,n),a=t.seen.get(e),void("openapi-3.0"===t.target?(a.ref=i.innerType,r.nullable=!0):r.anyOf=[s,{type:"null"}])},e.unwrap=()=>e._zod.def.innerType});function ol(e){return new oo({type:"nullable",innerType:e})}let oc=rl("ZodDefault",(e,t)=>{st.init(e,t),az.init(e,t),e._zod.processJSONSchema=(t,r,n)=>{let i,s;return sB((i=e._zod.def).innerType,t,n),t.seen.get(e).ref=i.innerType,void((s=ao(i.defaultValue,e,t,r,n))!==aa&&(r.default=s))},e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap}),od=rl("ZodPrefault",(e,t)=>{sn.init(e,t),az.init(e,t),e._zod.processJSONSchema=(t,r,n)=>((e,t,r,n)=>{let i=e._zod.def;if(sB(i.innerType,t,n),t.seen.get(e).ref=i.innerType,"input"!==t.io)return;let s=ao(i.defaultValue,e,t,r,n);s!==aa&&(r._prefault=s)})(e,t,r,n),e.unwrap=()=>e._zod.def.innerType}),ou=rl("ZodNonOptional",(e,t)=>{si.init(e,t),az.init(e,t),e._zod.processJSONSchema=(t,r,n)=>{let i;sB((i=e._zod.def).innerType,t,n),t.seen.get(e).ref=i.innerType},e.unwrap=()=>e._zod.def.innerType}),op=rl("ZodCatch",(e,t)=>{so.init(e,t),az.init(e,t),e._zod.processJSONSchema=(t,r,n)=>((e,t,r,n)=>{let i,s=e._zod.def;sB(s.innerType,t,n),t.seen.get(e).ref=s.innerType;try{i=s.catchValue(void 0)}catch{sK(e,t,r,n,"Dynamic catch values are not supported in JSON Schema");return}r.default=i})(e,t,r,n),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap}),of=rl("ZodPipe",(e,t)=>{sl.init(e,t),az.init(e,t),e._zod.processJSONSchema=(t,r,n)=>{let i,s,a;return s=(i=e._zod.def).in._zod.traits.has("$ZodTransform"),void(sB(a="input"===t.io?s?i.out:i.in:i.out,t,n),t.seen.get(e).ref=a)},e.in=t.in,e.out=t.out});function om(e,t){return new of({type:"pipe",in:e,out:t})}let oh=rl("ZodReadonly",(e,t)=>{sp.init(e,t),az.init(e,t),e._zod.processJSONSchema=(t,r,n)=>{let i;sB((i=e._zod.def).innerType,t,n),t.seen.get(e).ref=i.innerType,r.readOnly=!0},e.unwrap=()=>e._zod.def.innerType}),og=rl("ZodCustom",(e,t)=>{sm.init(e,t),az.init(e,t),e._zod.processJSONSchema=(t,r,n)=>{sK(e,t,r,n,"Custom types cannot be represented in JSON Schema")}});e.s(["array",0,a6,"number",0,a0,"object",0,a7,"string",0,a$],362201),e.i(362201),e.s([],430421),e.i(430421),e.i(789282),e.s([],100364),e.i(100364),e.s([],458829),e.i(458829),e.s(["array",0,a6,"number",0,a0,"object",0,a7,"string",0,a$],722219);var ov=e.i(722219),ov=ov,oy=ov,ox=ov,ob=ov;let ow="https://github.com/xiaoyang111222/cn-math-taxonomy",o_="https://raw.githubusercontent.com/xiaoyang111222/cn-math-taxonomy/HEAD/data/topics.json",oj=ov.object({id:oy.string().optional(),name:oy.string().trim().min(1),subject:oy.string().nullish(),grade:ox.number().int(),semester:oy.string().nullish(),chapter:oy.string().nullish()}).passthrough();ob.array(oj).min(1);let ok="/api/admin/cnm-tags";function oz(){let{t:e}=(0,h.b)(),t=e.admin.cnmTags,[r,n]=(0,m.useState)(null),[i,s]=(0,m.useState)(!1),a=(0,m.useRef)(null),o=(0,m.useCallback)(async()=>{try{n(await v.k.get(ok))}catch(e){x.V.warn("[CnmTagImportSettings]","Failed to load status",{error:e})}},[]);(0,m.useEffect)(()=>{o()},[o]);let l=async e=>{if(e){s(!0);try{let r;try{r=JSON.parse(await e.text())}catch{ez.c.error(t.invalidFile);return}let i=await v.k.post(ok,{topics:r},{timeout:3e5});n(i.status),ez.c.success(t.imported.replace("{created}",String(i.result.created)).replace("{skipped}",String(i.result.skipped)))}catch(r){x.V.error("[CnmTagImportSettings]","Import failed",{error:r});let e=r instanceof v.a&&400===r.status;ez.c.error(e?t.invalidFile:t.failed)}finally{s(!1),a.current&&(a.current.value="")}}},c=r?.knowledgePoints??0;return(0,f.jsxs)("div",{className:"space-y-3 rounded-lg border p-4",children:[(0,f.jsxs)("div",{className:"space-y-1",children:[(0,f.jsxs)("p",{className:"flex items-center gap-2 text-sm font-medium",children:[(0,f.jsx)(F.f,{className:"h-4 w-4"}),t.title]}),(0,f.jsx)("p",{className:"text-xs text-muted-foreground",children:t.desc})]}),(0,f.jsxs)("div",{className:"space-y-1 rounded-md bg-muted/50 p-3 text-xs text-muted-foreground",children:[(0,f.jsx)("p",{children:t.downloadHint}),(0,f.jsx)("a",{href:o_,target:"_blank",rel:"noopener noreferrer",className:"block break-all text-primary underline",children:o_}),(0,f.jsxs)("p",{children:[t.sourceLabel," ",(0,f.jsx)("a",{href:ow,target:"_blank",rel:"noopener noreferrer",className:"break-all text-primary underline",children:ow})]})]}),(0,f.jsx)("p",{className:"text-xs text-muted-foreground",children:r?c>0?t.status.replace("{count}",String(c)):t.notImported:""}),(0,f.jsx)("input",{ref:a,type:"file",accept:".json,application/json",className:"hidden",onChange:e=>l(e.target.files?.[0]),disabled:i}),(0,f.jsxs)(ea.f,{variant:"outline",size:"sm",className:"w-full sm:w-auto",onClick:()=>a.current?.click(),disabled:i,children:[i?(0,f.jsx)(Q.f,{className:"mr-2 h-4 w-4 animate-spin"}):(0,f.jsx)(eB,{className:"mr-2 h-4 w-4"}),i?t.importing:t.select]}),(0,f.jsx)("p",{className:"text-xs text-muted-foreground",children:t.note})]})}var oN=e.i(741120);let oS={info:{card:"border-blue-200 dark:border-blue-900 bg-blue-50 dark:bg-blue-950/40",title:"text-blue-900 dark:text-blue-200 font-bold",desc:"text-blue-800 dark:text-blue-200 font-medium",button:"bg-blue-100 dark:bg-blue-900/40 hover:bg-blue-200 dark:hover:bg-blue-900/60 text-blue-900 dark:text-blue-200 border-blue-300 dark:border-blue-800"},danger:{card:"border-red-200 dark:border-red-900 bg-red-50 dark:bg-red-950/40",title:"text-red-700 dark:text-red-300 font-medium",desc:"text-red-600 dark:text-red-400",button:""},critical:{card:"border-red-600/50 bg-red-100/50 dark:bg-red-900/40",title:"text-red-900 dark:text-red-200 font-bold",desc:"text-red-800 dark:text-red-200 font-medium",button:"bg-red-700 hover:bg-red-800"}};function o$({title:e,description:t,tone:r,busy:n,icon:i,onClick:s}){let a=oS[r];return(0,f.jsxs)("div",{className:`p-4 border rounded-lg ${a.card}`,children:[(0,f.jsxs)("div",{className:"flex items-center justify-between",children:[(0,f.jsx)("span",{className:`text-sm flex items-center gap-2 ${a.title}`,children:e}),(0,f.jsx)(ea.f,{variant:"info"===r?"outline":"destructive",size:"sm",onClick:s,disabled:n,className:a.button,children:n?(0,f.jsx)(Q.f,{className:"h-4 w-4 animate-spin"}):i})]}),(0,f.jsx)("p",{className:`text-xs mt-2 ${a.desc}`,children:t})]})}function oA({isAdmin:e}){let{t}=(0,h.b)(),[r,n]=(0,m.useState)(null),i=async(e,t,r,i)=>{n(e);try{ez.c.success(await t()),i&&window.location.reload()}catch(t){x.V.error("[DangerZoneSettings]",`${e} failed`,{error:t}),ez.c.error(r)}finally{n(null)}},s=t.settings?.clearSuccess||"Success",a=t.settings?.clearError||"Failed",o=async()=>{await (0,ez.u)(t.settings?.migrateTagsConfirm||"This will reset system tags. Confirm?",{destructive:!0})&&await i("migrateTags",async()=>{let e=await v.k.post("/api/admin/migrate-tags",{});return`${s}: ${e.count||0} tags migrated.`},t.settings?.clearError||"Failed to migrate tags",!1)},l=async()=>{await (0,ez.u)(t.settings?.clearDataConfirm||"Are you sure?",{destructive:!0})&&await i("clearPractice",async()=>(await v.k.delete("/api/stats/practice/clear"),s),a,!0)},c=async()=>{await (0,ez.u)(t.settings?.clearErrorDataConfirm||"Are you sure?",{destructive:!0})&&await i("clearErrors",async()=>(await v.k.delete("/api/error-items/clear"),s),a,!0)},d=async()=>{if(!await (0,ez.u)(t.settings?.systemResetConfirm||"WARNING: Deleting ALL data. Undoing is impossible. Are you sure?",{destructive:!0}))return;let e=prompt(t.settings?.systemResetPrompt||"Type 'RESET' to confirm system initialization:","");if("RESET"!==e){null!==e&&ez.c.error(t.common?.error||"Confirmation failed");return}await i("systemReset",async()=>(await v.k.post("/api/admin/system-reset",{}),t.settings?.clearSuccess||"Success - System Reset Complete"),t.settings?.clearError||"Failed to reset system",!0)};return(0,f.jsxs)(f.Fragment,{children:[e&&(0,f.jsx)(o$,{tone:"info",title:(0,f.jsxs)(f.Fragment,{children:[(0,f.jsx)(oN.f,{className:"h-4 w-4"}),t.settings?.migrateTags||"Migrate Tags"]}),description:t.settings?.migrateTagsDesc||"Re-populates standard tags from file",busy:"migrateTags"===r,icon:(0,f.jsx)(oN.f,{className:"h-4 w-4"}),onClick:o}),(0,f.jsx)(o$,{tone:"danger",title:t.settings?.clearData||"Clear Practice Data",description:t.settings?.clearDataDesc||"This will permanently delete all practice history. Irreversible.",busy:"clearPractice"===r,icon:(0,f.jsx)(ew.f,{className:"h-4 w-4"}),onClick:l}),(0,f.jsx)(o$,{tone:"danger",title:t.settings?.clearErrorData||"Clear Error Data",description:t.settings?.clearErrorDataDesc||"This will permanently delete all error items. Irreversible.",busy:"clearErrors"===r,icon:(0,f.jsx)(ew.f,{className:"h-4 w-4"}),onClick:c}),e&&(0,f.jsx)(o$,{tone:"critical",title:(0,f.jsxs)(f.Fragment,{children:[(0,f.jsx)(J.f,{className:"h-4 w-4"}),t.settings?.systemReset||"System Initialization"]}),description:t.settings?.systemResetDesc||"Resets the system to factory state. Deletes ALL data.",busy:"systemReset"===r,icon:(0,f.jsx)(ew.f,{className:"h-4 w-4"}),onClick:d})]})}var oO=e.i(551757),oE=e.i(762368);async function oT(e,t){let r=await fetch(e);if(!r.ok)throw Error((await r.json().catch(()=>({}))).message||"Download failed");let n=await r.blob(),i=window.URL.createObjectURL(n),s=document.createElement("a");s.href=i;let a=r.headers.get("Content-Disposition")?.match(/filename="(.+)"/);s.download=a?a[1]:t,document.body.appendChild(s),s.click(),document.body.removeChild(s),window.URL.revokeObjectURL(i)}function oP({isAdmin:e}){let{t}=(0,h.b)(),[r,n]=(0,m.useState)(!1),[i,s]=(0,m.useState)(!1),[a,o]=(0,m.useState)(null),l=async e=>{if(!e||await (0,ez.u)(t.settings?.exportAllConfirm||"Export all users' data? This may take a while.")){n(!0);try{await oT(e?"/api/export?all=true":"/api/export",e?"wrong-notebook-export-all.json":"wrong-notebook-export.json"),ez.c.success(t.settings?.exportSuccess||"Export successful")}catch(r){x.V.error("[DataBackupSettings]",e?"Export all failed":"Export failed",{error:r}),ez.c.error(t.settings?.exportFailed||"Export failed")}finally{n(!1)}}},c=async e=>{if(!a)return;let r=e?t.settings?.importAllConfirm||"Import all users' data? This will restore data for all users from the export file.":t.settings?.importConfirm||"Are you sure you want to import?";if(await (0,ez.u)(r)){s(!0);try{let r=JSON.parse(await a.text()),{stats:n}=await v.k.post(e?"/api/import?all=true":"/api/import",r);ez.c.success((t.settings?.importResultDesc||"Imported {subjects} notebooks, {tags} tags, {items} error items, {schedules} review schedules, {records} practice records, {papers} exam papers and {voices} cloud voice clips.").replace("{subjects}",String(n.subjectsCreated)).replace("{tags}",String(n.tagsCreated)).replace("{items}",String(n.errorItemsCreated)).replace("{schedules}",String(n.reviewSchedulesCreated)).replace("{records}",String(n.practiceRecordsCreated)).replace("{papers}",String(n.examPapersCreated??0)).replace("{voices}",String(n.ttsSpeechesImported??0)).replace("{duplicates}",String(n.duplicateErrorItems??0))),o(null),window.location.reload()}catch(r){x.V.error("[DataBackupSettings]",e?"Import all failed":"Import failed",{error:r}),ez.c.error(t.settings?.importFailed||"Import failed")}finally{s(!1)}}},d=(e,t)=>e?(0,f.jsx)(Q.f,{className:"mr-2 h-4 w-4 animate-spin"}):t;return(0,f.jsxs)("div",{className:"p-4 border border-blue-200 dark:border-blue-900 rounded-lg bg-blue-50 dark:bg-blue-950/40",children:[(0,f.jsx)("h4",{className:"text-sm font-bold text-blue-900 dark:text-blue-200 mb-3",children:t.settings?.dataManagement||"Data Management"}),(0,f.jsxs)("div",{className:"mb-4",children:[(0,f.jsxs)("div",{className:"flex items-center justify-between mb-2",children:[(0,f.jsx)("span",{className:"text-sm text-blue-800 dark:text-blue-200 font-medium",children:t.settings?.exportData||"Export Data"}),(0,f.jsxs)("div",{className:"flex items-center gap-2",children:[(0,f.jsxs)(ea.f,{variant:"outline",size:"sm",onClick:()=>l(!1),disabled:r,className:"bg-blue-100 dark:bg-blue-900/40 hover:bg-blue-200 dark:hover:bg-blue-900/60 text-blue-900 dark:text-blue-200 border-blue-300 dark:border-blue-800",children:[d(r,(0,f.jsx)(oE.f,{className:"mr-2 h-4 w-4"})),t.settings?.exportData||"Export"]}),e&&(0,f.jsxs)(ea.f,{variant:"outline",size:"sm",onClick:()=>l(!0),disabled:r,className:"bg-orange-100 dark:bg-orange-900/40 hover:bg-orange-200 dark:hover:bg-orange-900/60 text-orange-900 dark:text-orange-200 border-orange-300 dark:border-orange-800",children:[d(r,(0,f.jsx)(oE.f,{className:"mr-2 h-4 w-4"})),t.settings?.exportAllData||"Export All"]})]})]}),(0,f.jsx)("p",{className:"text-xs text-blue-700 dark:text-blue-300",children:t.settings?.exportDataDesc||"Export all data as JSON file."})]}),(0,f.jsxs)("div",{children:[(0,f.jsxs)("div",{className:"flex items-center justify-between mb-2",children:[(0,f.jsx)("span",{className:"text-sm text-blue-800 dark:text-blue-200 font-medium",children:t.settings?.importData||"Import Data"}),(0,f.jsxs)("div",{className:"flex items-center gap-2",children:[(0,f.jsx)("input",{type:"file",accept:".json",onChange:e=>o(e.target.files?.[0]??a),className:"hidden",id:"import-file-input",disabled:i}),(0,f.jsxs)(ea.f,{variant:"outline",size:"sm",onClick:()=>document.getElementById("import-file-input")?.click(),disabled:i,className:"bg-blue-100 dark:bg-blue-900/40 hover:bg-blue-200 dark:hover:bg-blue-900/60 text-blue-900 dark:text-blue-200 border-blue-300 dark:border-blue-800",children:[d(i,(0,f.jsx)(eB,{className:"mr-2 h-4 w-4"})),a?.name||t.settings?.selectFile||"Select File"]}),a&&(0,f.jsxs)(ea.f,{variant:"outline",size:"sm",onClick:()=>c(!1),disabled:i,className:"bg-green-100 dark:bg-green-900/40 hover:bg-green-200 dark:hover:bg-green-900/60 text-green-900 dark:text-green-200 border-green-300 dark:border-green-800",children:[d(i,(0,f.jsx)(oO.f,{className:"mr-2 h-4 w-4"})),t.settings?.importData||"Import"]}),a&&e&&(0,f.jsxs)(ea.f,{variant:"outline",size:"sm",onClick:()=>c(!0),disabled:i,className:"bg-orange-100 dark:bg-orange-900/40 hover:bg-orange-200 dark:hover:bg-orange-900/60 text-orange-900 dark:text-orange-200 border-orange-300 dark:border-orange-800",children:[d(i,(0,f.jsx)(oO.f,{className:"mr-2 h-4 w-4"})),t.settings?.importAllData||"Import All"]})]})]}),(0,f.jsx)("p",{className:"text-xs text-blue-700 dark:text-blue-300",children:t.settings?.importDataDesc||"Import data from JSON file. Existing data will be skipped."})]})]})}let oC={name:"bug",size:24,node:[["path",{d:"M12 20v-9",key:"1qisl0"}],["path",{d:"M14 7a4 4 0 0 1 4 4v3a6 6 0 0 1-12 0v-3a4 4 0 0 1 4-4z",key:"uouzyp"}],["path",{d:"M14.12 3.88 16 2",key:"qol33r"}],["path",{d:"M21 21a4 4 0 0 0-3.81-4",key:"1b0z45"}],["path",{d:"M21 5a4 4 0 0 1-3.55 3.97",key:"5cxbf6"}],["path",{d:"M22 13h-4",key:"1jl80f"}],["path",{d:"M3 21a4 4 0 0 1 3.81-4",key:"1fjd4g"}],["path",{d:"M3 5a4 4 0 0 0 3.55 3.97",key:"1d7oge"}],["path",{d:"M6 13H2",key:"82j7cp"}],["path",{d:"m8 2 1.88 1.88",key:"fmnt4t"}],["path",{d:"M9 7.13V6a3 3 0 1 1 6 0v1.13",key:"1vgav8"}]]};oC.node;let oI=(0,U.f)(oC),oD="/api/admin/debug-logs";function oZ(){let{t:e}=(0,h.b)(),{timeZone:t}=(0,P.M)(),r=e.admin.debugLog,[n,i]=(0,m.useState)(null),[s,a]=(0,m.useState)(!1),o=(0,m.useCallback)(async()=>{try{i(await v.k.get(oD))}catch(e){x.V.warn("[DebugLogSettings]","Failed to load debug status",{error:e})}},[]);(0,m.useEffect)(()=>{o()},[o]),(0,m.useEffect)(()=>{if(!n?.enabled)return;let e=setInterval(o,5e3);return()=>clearInterval(e)},[n?.enabled,o]);let l=async(e,t)=>{a(!0);try{await e(),ez.c.success(t)}catch(e){x.V.error("[DebugLogSettings]","Debug log action failed",{error:e}),ez.c.error(r.failed)}finally{a(!1)}},c=e=>e?(0,ec.r)(e,"yyyy-MM-dd HH:mm",t):"",d=n?.enabled?r.enabledHint.replace("{since}",c(n.enabledAt)).replace("{until}",c(n.expiresAt)):r.disabledHint,u=(n?.entryCount??0)>0;return(0,f.jsxs)("div",{className:"space-y-3 rounded-lg border p-4",children:[(0,f.jsxs)("div",{className:"flex items-start justify-between gap-4",children:[(0,f.jsxs)("div",{className:"space-y-1",children:[(0,f.jsxs)(ef.f,{htmlFor:"debug-mode-switch",className:"flex items-center gap-2 font-medium",children:[(0,f.jsx)(oI,{className:"h-4 w-4"}),r.title]}),(0,f.jsx)("p",{className:"text-xs text-muted-foreground",children:r.desc})]}),(0,f.jsxs)("div",{className:"flex shrink-0 items-center gap-2",children:[(0,f.jsx)("span",{className:"text-sm text-muted-foreground",children:r.enable}),(0,f.jsx)(eu.f,{id:"debug-mode-switch",checked:!!n?.enabled,onCheckedChange:e=>l(async()=>{i(await v.k.post(oD,{enabled:e}))},e?r.enabled:r.disabled),disabled:s||!n})]})]}),(0,f.jsxs)("p",{className:`text-xs ${n?.enabled?"text-orange-600":"text-muted-foreground"}`,children:[d,n&&(0,f.jsxs)(f.Fragment,{children:[" ",r.entries.replace("{count}",String(n.entryCount)),n.droppedCount>0&&r.dropped.replace("{count}",String(n.droppedCount))]})]}),(0,f.jsxs)("div",{className:"flex flex-col gap-2 sm:flex-row",children:[(0,f.jsxs)(ea.f,{variant:"outline",size:"sm",onClick:()=>l(async()=>{await oT(`${oD}/export`,"wrong-notebook-debug.json"),await o()},r.exported),disabled:s||!u,className:"sm:flex-1",children:[s?(0,f.jsx)(Q.f,{className:"mr-2 h-4 w-4 animate-spin"}):(0,f.jsx)(oE.f,{className:"mr-2 h-4 w-4"}),r.export]}),(0,f.jsxs)(ea.f,{variant:"outline",size:"sm",onClick:()=>l(async()=>{i(await v.k.delete(oD))},r.cleared),disabled:s||!u,children:[(0,f.jsx)(ew.f,{className:"mr-2 h-4 w-4"}),r.clear]})]}),(0,f.jsx)("p",{className:"text-xs text-muted-foreground",children:r.privacyNote})]})}var oF=e.i(307364);function oR({field:e,label:t,description:r}){let{t:n}=(0,h.b)(),[i,s]=(0,m.useState)(!1),[a,o]=(0,m.useState)(!1),[l,c]=(0,m.useState)(!1),[d,u]=(0,m.useState)(null),p=`preference-${e}`;(0,m.useEffect)(()=>{v.k.get("/api/user").then(t=>s(!!t[e])).catch(()=>void 0).finally(()=>o(!0))},[e]);let g=async t=>{s(t),c(!0);try{await v.k.patch("/api/user",{[e]:t}),u(n.importFlow.preferenceSaved)}catch(r){s(!t),u(n.importFlow.preferenceSaveFailed),x.V.error("[Settings]","Failed to save user preference",{field:e,error:r instanceof Error?r.message:String(r)})}finally{c(!1)}};return(0,f.jsxs)("div",{className:"space-y-2 pt-4 border-t",children:[(0,f.jsxs)("div",{className:"flex items-center justify-between gap-4",children:[(0,f.jsx)(ef.f,{htmlFor:p,children:t}),(0,f.jsx)(eu.f,{id:p,checked:i,onCheckedChange:g,disabled:!a||l})]}),(0,f.jsx)("p",{className:"text-xs text-muted-foreground",children:r}),d&&(0,f.jsx)("p",{className:"text-xs text-muted-foreground",children:d})]})}function oM(){let{t:e}=(0,h.b)();return(0,f.jsx)(oR,{field:"enableGeogebra",label:e.importFlow.enableGeogebra,description:e.importFlow.enableGeogebraDesc})}function oL(){let{t:e}=(0,h.b)();return(0,f.jsx)(oR,{field:"confirmBeforeImport",label:e.importFlow.confirmBeforeImport,description:e.importFlow.confirmBeforeImportDesc})}var oU=e.i(905110);function oG(){let{t:e}=(0,h.b)(),[t,r]=(0,m.useState)(String(oU.z)),[n,i]=(0,m.useState)(null),[s,a]=(0,m.useState)(!0),[o,l]=(0,m.useState)(!1),[c,d]=(0,m.useState)(null),u=Number(t),p=""!==t.trim()&&Number.isInteger(u)&&u>=oU.P&&u<=oU.o,g=(0,m.useCallback)(async()=>{a(!0),d(null);try{let e=(await v.k.get("/api/user")).masteryThreshold??oU.z;r(String(e)),i(e)}catch(t){d(e.mastery.thresholdLoadFailed),x.V.error("[Settings]","加载已掌握阈值失败",{error:t instanceof Error?t.message:String(t)})}finally{a(!1)}},[e.mastery.thresholdLoadFailed]);(0,m.useEffect)(()=>{g()},[g]);let y=async()=>{if(p&&null!==n){l(!0),d(null);try{let t=(await v.k.patch("/api/user",{masteryThreshold:u})).masteryThreshold??u;i(t),r(String(t)),d(e.importFlow.preferenceSaved)}catch(t){d(e.importFlow.preferenceSaveFailed),x.V.error("[Settings]","保存已掌握阈值失败",{error:t instanceof Error?t.message:String(t)})}finally{l(!1)}}};return(0,f.jsxs)("div",{className:"space-y-2 border-t pt-4",children:[(0,f.jsx)(ef.f,{htmlFor:"mastery-threshold",children:e.mastery.thresholdLabel}),(0,f.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[(0,f.jsx)(ep.f,{id:"mastery-threshold",type:"number",min:oU.P,max:oU.o,step:1,value:t,onChange:e=>{r(e.target.value),d(null)},disabled:s||o||null===n,className:"w-28","aria-describedby":"mastery-threshold-hint"}),(0,f.jsx)("span",{"aria-hidden":"true",children:"%"}),(0,f.jsxs)(ea.f,{type:"button",size:"sm",variant:"outline",onClick:y,disabled:s||o||null===n||!p||u===n,children:[(s||o)&&(0,f.jsx)(Q.f,{className:"mr-2 h-4 w-4 animate-spin"}),e.importFlow.saveThreshold]}),!s&&null===n&&(0,f.jsx)(ea.f,{type:"button",size:"sm",variant:"outline",onClick:g,children:e.importFlow.retryLoad})]}),(0,f.jsx)("p",{id:"mastery-threshold-hint",className:"text-xs text-muted-foreground",children:e.mastery.thresholdDescription}),null!==n&&!p&&(0,f.jsx)("p",{className:"text-xs text-destructive",role:"alert",children:e.mastery.thresholdInvalid}),c&&(0,f.jsx)("p",{className:"text-xs text-muted-foreground",role:"status",children:c})]})}var oV=e.i(28342);function oK(){let{t:e}=(0,h.b)(),[t,r]=(0,m.useState)({gradeRecognitionMode:"fixed",fixedGradeSemester:null}),[n,i]=(0,m.useState)(null),[s,a]=(0,m.useState)(!0),[o,l]=(0,m.useState)(!1),[c,d]=(0,m.useState)(null),u=(0,m.useRef)(0),p=(0,m.useCallback)(async()=>{let t=++u.current;a(!0),d(null);try{let e=await v.k.get("/api/user");if(t!==u.current)return;let n={gradeRecognitionMode:e.gradeRecognitionMode??"fixed",fixedGradeSemester:e.fixedGradeSemester??null};r(n),i(n)}catch(r){if(t!==u.current)return;d(e.questionGrade.loadFailed),x.V.error("[QuestionGradeSetting]","加载录入年级规则失败",{error:(0,y.Z)(r)})}finally{t===u.current&&a(!1)}},[e.questionGrade.loadFailed]);(0,m.useEffect)(()=>{p()},[p]);let g=async()=>{l(!0),d(null);try{let n=await v.k.patch("/api/user",t),s={gradeRecognitionMode:n.gradeRecognitionMode??t.gradeRecognitionMode,fixedGradeSemester:n.fixedGradeSemester??null};r(s),i(s),d(e.importFlow.preferenceSaved)}catch(t){d(e.importFlow.preferenceSaveFailed),x.V.error("[QuestionGradeSetting]","保存录入年级规则失败",{error:(0,y.Z)(t)})}finally{l(!1)}},b=s||o||null===n,w=n?.gradeRecognitionMode===t.gradeRecognitionMode&&n?.fixedGradeSemester===t.fixedGradeSemester;return(0,f.jsxs)("div",{className:"space-y-3 border-t pt-4",children:[(0,f.jsxs)("div",{className:"space-y-2",children:[(0,f.jsx)(ef.f,{htmlFor:"question-grade-mode",children:e.questionGrade.label}),(0,f.jsxs)("select",{id:"question-grade-mode",value:t.gradeRecognitionMode,disabled:b,onChange:e=>{r({...t,gradeRecognitionMode:e.target.value}),d(null)},className:"h-10 w-full rounded-md border border-input bg-background px-3 text-sm disabled:opacity-50",children:[(0,f.jsx)("option",{value:"fixed",children:e.questionGrade.fixed}),(0,f.jsx)("option",{value:"ai",children:e.questionGrade.ai})]})]}),"fixed"===t.gradeRecognitionMode&&(0,f.jsxs)("div",{className:"space-y-2",children:[(0,f.jsx)(ef.f,{htmlFor:"question-fixed-grade",children:e.editor.gradeSemester}),(0,f.jsx)(oV.f,{id:"question-fixed-grade",value:t.fixedGradeSemester??"",disabled:b,onChange:e=>{r({...t,fixedGradeSemester:e||null}),d(null)}})]}),(0,f.jsx)("p",{className:"text-xs text-muted-foreground",children:"fixed"===t.gradeRecognitionMode?e.questionGrade.fixedDescription:e.questionGrade.aiDescription}),(0,f.jsx)("p",{className:"text-xs text-muted-foreground",children:e.questionGrade.description}),(0,f.jsxs)(ea.f,{type:"button",variant:"outline",size:"sm",disabled:b||w,onClick:g,children:[(s||o)&&(0,f.jsx)(Q.f,{className:"mr-2 h-4 w-4 animate-spin"}),e.questionGrade.save]}),!s&&null===n&&(0,f.jsx)(ea.f,{type:"button",variant:"outline",size:"sm",onClick:p,children:e.importFlow.retryLoad}),c&&(0,f.jsx)("p",{className:"text-xs text-muted-foreground",role:"status",children:c})]})}function oB(){let{t:e}=(0,h.b)();return(0,f.jsx)(oR,{field:"enableSvgAnimation",label:e.importFlow.enableSvgAnimation,description:e.importFlow.enableSvgAnimationDesc})}function oJ({value:e,onChange:t,disabled:r}){let{t:n}=(0,h.b)();return(0,f.jsxs)("div",{className:"space-y-2 pt-4 border-t",children:[(0,f.jsx)(ef.f,{htmlFor:"app-time-zone",children:n.settings.general.timeZoneLabel}),(0,f.jsx)(ep.f,{id:"app-time-zone",value:e,onChange:e=>t(e.target.value),disabled:r,list:"app-time-zones",placeholder:"Asia/Shanghai"}),(0,f.jsx)("datalist",{id:"app-time-zones",children:["Asia/Shanghai","Asia/Hong_Kong","Asia/Tokyo","Asia/Singapore","Europe/London","America/New_York","America/Los_Angeles","UTC"].map(e=>(0,f.jsx)("option",{value:e},e))}),(0,f.jsx)("p",{className:"text-xs text-muted-foreground",children:n.settings.general.timeZoneDesc})]})}function oq({config:e,setConfig:t,isAdmin:r,disabled:n}){let{t:i,language:s,setLanguage:a}=(0,h.b)(),{timeZone:o}=(0,P.M)(),l=e=>t(t=>({...t,timeouts:{...t.timeouts,analyze:1e3*e}}));return(0,f.jsxs)("div",{className:"space-y-4 border rounded-lg p-4 bg-muted/30",children:[(0,f.jsxs)("div",{className:"space-y-2",children:[(0,f.jsx)(ef.f,{children:i.settings?.language||"Language"}),(0,f.jsxs)(eM.d,{value:s,onValueChange:e=>a(e),children:[(0,f.jsx)(eM.P,{children:(0,f.jsx)(eM.U,{})}),(0,f.jsxs)(eM.r,{children:[(0,f.jsx)(eM.T,{value:"zh",children:"中文 (Chinese)"}),(0,f.jsx)(eM.T,{value:"en",children:"English"})]})]})]}),(0,f.jsx)(oJ,{value:e.timeZone??o,onChange:e=>t(t=>({...t,timeZone:e})),disabled:!r||n}),r&&(0,f.jsxs)("div",{className:"space-y-2 pt-4 border-t",children:[(0,f.jsx)(ef.f,{children:i.settings?.general?.timeoutLabel||"AI Analysis Timeout (Seconds)"}),(0,f.jsx)(ep.f,{type:"number",value:e.timeouts?.analyze?e.timeouts.analyze/1e3:"",onChange:e=>{let t=""===e.target.value?0:parseInt(e.target.value);l(isNaN(t)?0:t)},onBlur:()=>{let t=(e.timeouts?.analyze||0)/1e3,r=Math.min(600,Math.max(120,t));r!==t&&l(r)},min:120,max:600}),(0,f.jsx)("p",{className:"text-xs text-muted-foreground",children:i.settings?.general?.timeoutDesc||"Increase this value if you experience frequent timeouts during AI analysis."})]}),(0,f.jsx)(oL,{}),(0,f.jsx)(oK,{}),(0,f.jsx)(oB,{}),(0,f.jsx)(oM,{}),(0,f.jsx)(oF.f,{}),(0,f.jsx)(oG,{})]})}var oW=e.i(77071),oH=e.i(515288),oX=e.i(664030);function oY(){let{t:e}=(0,h.b)(),{groups:t,loading:r,refetch:n}=(0,oX.f)(),[i,s]=(0,m.useState)(""),[a,o]=(0,m.useState)(!1),l=async()=>{let t=i.trim();if(t){o(!0);try{await v.k.post("/api/paper-groups",{name:t}),s(""),ez.c.success(e.common?.messages?.saveSuccess||"Saved"),n()}catch(t){x.V.error("[PaperGroupSettings]","Failed to add group",{error:t}),ez.c.error(e.common?.messages?.saveFailed||"Failed to save")}finally{o(!1)}}},c=async(t,r)=>{let i=window.prompt(e.settings?.paperGroups?.renamePrompt||"Rename group",r);if(i&&i.trim()!==r)try{await v.k.patch(`/api/paper-groups/${t}`,{name:i.trim()}),ez.c.success(e.common?.messages?.saveSuccess||"Saved"),n()}catch(t){x.V.error("[PaperGroupSettings]","Failed to rename group",{error:t}),ez.c.error(e.common?.messages?.saveFailed||"Failed to save")}},d=async(t,r)=>{try{await v.k.patch(`/api/paper-groups/${t}`,{isActive:!r}),ez.c.success(e.common?.messages?.saveSuccess||"Saved"),n()}catch(t){x.V.error("[PaperGroupSettings]","Failed to toggle group",{error:t}),ez.c.error(e.common?.messages?.saveFailed||"Failed to save")}},u=async(t,r,i)=>{if(i>0){let s=(e.settings?.paperGroups?.deleteConfirmWithItems||'Group "{name}" has {count} questions. Deleting will clear their group assignment. Continue?').replace("{name}",r).replace("{count}",String(i));if(!await (0,ez.u)(s,{destructive:!0}))return;try{await v.k.delete(`/api/paper-groups/${t}?clear=true`),ez.c.success(e.common?.messages?.deleteSuccess||"Deleted"),n()}catch(t){x.V.error("[PaperGroupSettings]","Failed to delete group",{error:t}),ez.c.error(e.common?.messages?.deleteFailed||"Delete failed")}return}let s=(e.settings?.paperGroups?.deleteConfirm||'Delete group "{name}"?').replace("{name}",r);if(await (0,ez.u)(s,{destructive:!0}))try{await v.k.delete(`/api/paper-groups/${t}`),ez.c.success(e.common?.messages?.deleteSuccess||"Deleted"),n()}catch(t){x.V.error("[PaperGroupSettings]","Failed to delete group",{error:t}),ez.c.error(e.common?.messages?.deleteFailed||"Delete failed")}};return r?(0,f.jsx)(oH.N,{children:(0,f.jsx)(oH.O,{className:"py-12 flex items-center justify-center",children:(0,f.jsx)(Q.f,{className:"h-6 w-6 animate-spin text-muted-foreground"})})}):(0,f.jsxs)(oH.N,{children:[(0,f.jsxs)(oH.Y,{children:[(0,f.jsxs)(oH.v,{className:"flex items-center gap-2 text-lg",children:[(0,f.jsx)(M.f,{className:"h-5 w-5"}),e.settings?.paperGroups?.title||"Paper Groups"]}),(0,f.jsx)("p",{className:"text-sm text-muted-foreground",children:e.settings?.paperGroups?.desc||"Customize paper groups like Unit Test, Midterm, Final. Default groups A/B/Other can be renamed but not deleted."})]}),(0,f.jsxs)(oH.O,{className:"space-y-4",children:[(0,f.jsxs)("div",{className:"flex gap-2",children:[(0,f.jsx)(ep.f,{value:i,onChange:e=>s(e.target.value),placeholder:e.settings?.paperGroups?.addPlaceholder||"e.g. Unit Test",onKeyDown:e=>{"Enter"===e.key&&l()}}),(0,f.jsxs)(ea.f,{onClick:l,disabled:a||!i.trim(),children:[a?(0,f.jsx)(Q.f,{className:"h-4 w-4 animate-spin"}):(0,f.jsx)(oW.f,{className:"h-4 w-4 mr-1"}),e.common?.add||"Add"]})]}),(0,f.jsx)("div",{className:"space-y-2",children:t.map(t=>(0,f.jsxs)("div",{className:`flex items-center justify-between rounded-lg border p-3 ${!t.isActive?"opacity-50":""}`,children:[(0,f.jsxs)("div",{className:"flex items-center gap-3",children:[(0,f.jsx)("span",{className:"font-medium",children:t.name}),t.key&&(0,f.jsx)(ed.f,{variant:"secondary",className:"text-xs",children:e.settings?.paperGroups?.systemBadge||"Default"}),!t.isActive&&(0,f.jsx)(ed.f,{variant:"outline",className:"text-xs",children:e.common?.inactive||"Inactive"})]}),(0,f.jsxs)("div",{className:"flex items-center gap-1",children:[(0,f.jsx)(ea.f,{variant:"ghost",size:"sm",onClick:()=>c(t.id,t.name),children:e.common?.rename||"Rename"}),(0,f.jsx)(ea.f,{variant:"ghost",size:"sm",onClick:()=>d(t.id,t.isActive),children:t.isActive?e.common?.deactivate||"Deactivate":e.common?.activate||"Activate"}),!t.key&&(0,f.jsx)(ea.f,{variant:"ghost",size:"sm",className:"text-destructive hover:text-destructive",onClick:()=>u(t.id,t.name,t._count?.errorItems||0),children:(0,f.jsx)(ew.f,{className:"h-4 w-4"})})]})]},t.id))})]})]})}var oQ=e.i(624687);let o0="[REDACTED]",o1=/api[-_]?key|password|passwd|secret|authorization|cookie|credential|private[-_]?key|^(access|refresh|id|auth|api|bearer|session|csrf|setup)?[-_]?token$/i,o2=Symbol.for("wrong-notebook.debug-log");function o4(){let e=globalThis,t=e[o2];return t||(t={enabledAt:null,entries:[],totalSize:0,dropped:0},e[o2]=t),t}function o3(e){let t=e.replace(/data:([\w.+-]+\/[\w.+-]+);base64,[A-Za-z0-9+/=]+/g,(e,t)=>`[data:${t}, ${e.length} chars]`).replace(/(Bearer\s+)[\w\-.~+/]+=*/gi,`$1${o0}`).replace(/\bsk-[A-Za-z0-9_-]{8,}/g,o0).replace(/([?&](?:key|api_key|apikey|token|access_token)=)[^&\s"']+/gi,`$1${o0}`);return t.length>1e4&&(t=`${t.slice(0,1e4)}…[truncated ${t.length-1e4} chars]`),t}function o9(e,t,r,n=new Date){if(function(e=Date.now()){let t=o4();return null!==t.enabledAt&&(!(e-t.enabledAt>=864e5)||(t.enabledAt=null,!1))}(n.getTime()))try{let i={...function e(t,r=0,n=new WeakSet){if(null==t)return t;if("string"==typeof t)return o3(t);if("number"==typeof t||"boolean"==typeof t)return t;if("bigint"==typeof t)return t.toString();if("function"==typeof t||"symbol"==typeof t)return String(t);if(t instanceof Date)return t.toISOString();if(t instanceof Error){let i={name:t.name,message:o3(t.message)};return t.stack&&(i.stack=o3(t.stack)),void 0!==t.code&&(i.code=e(t.code,r+1,n)),void 0!==t.status&&(i.status=e(t.status,r+1,n)),void 0!==t.cause&&r<8&&(i.cause=e(t.cause,r+1,n)),i}if("object"!=typeof t)return String(t);if(n.has(t))return"[Circular]";if(r>=8)return"[Object]";if(n.add(t),Array.isArray(t)){let i=t.slice(0,100).map(t=>e(t,r+1,n));return t.length>100&&i.push(`…[${t.length-100} more items]`),i}return ArrayBuffer.isView(t)||t instanceof ArrayBuffer?`[Binary ${t.byteLength} bytes]`:Object.fromEntries(Object.entries(t).map(([t,i])=>[t,o1.test(t)&&null!=i&&""!==i?o0:e(i,r+1,n)]))}(t),time:n.toISOString(),level:e,msg:o3(r)},s=JSON.stringify(i).length,a=o4();for(a.entries.push({entry:i,size:s}),a.totalSize+=s;a.entries.length>5e3||a.totalSize>0x1400000&&a.entries.length>1;){let e=a.entries.shift();if(!e)break;a.totalSize-=e.size,a.dropped+=1}}catch{}}let o5={trace:10,debug:20,info:30,warn:40,error:50,fatal:60};function o6(e,t={}){let r,n=o5[e],i=(r=sU.default.env.LOG_LEVEL?.toLowerCase())&&void 0!==o5[r]?o5[r]:o5.info;return(r,s)=>{let a,o,l=new Date;if("string"==typeof r?(a={},o=r):(a=r,o=s||""),o9(e,{...t,...a},o,l),!(n<i)){let r=JSON.stringify({level:e,time:l.toISOString(),...t,...a,msg:o});switch(e){case"error":case"fatal":console.error(r);break;case"warn":console.warn(r);break;default:console.log(r)}}}}let o8=function e(t={}){return t.module,{trace:o6("trace",t),debug:o6("debug",t),info:o6("info",t),warn:o6("warn",t),error:o6("error",t),fatal:o6("fatal",t),child:r=>e({...t,...r}),box:(e,r,n="📋")=>{o9("info",{...t,..."string"==typeof r?{content:r}:r},e);{let n="string"==typeof r?{content:r}:r||{};console.log(JSON.stringify({level:"info",time:new Date().toISOString(),...t,title:e,...n,msg:e}));return}},divider:(e="-")=>{}}}({env:"production"});var o7=e.i(113381);o8.child({module:"ai:prompts"});let le=`请参考《高思学校竞赛数学导引》(每讲分兴趣篇、拓展篇、超越篇,题目左侧标 1~5 颗星)的星级标准,结合题目所在年级评定难度:
56
- - 1 星:课本基础题,直接套用概念、公式或简单计算即可(相当于兴趣篇前几题)。
57
- - 2 星:校内拔高题,需要两三步推理或简单综合(相当于兴趣篇后几题)。
58
- - 3 星:常规奥数题,小升初、杯赛常见难度,需要掌握该专题的典型方法(相当于拓展篇)。
59
- - 4 星:较难奥数题,需要构造、分类讨论、转化或多种方法综合(相当于拓展篇末题、超越篇前几题)。
60
- - 5 星:竞赛压轴题,集训队水平,思路巧妙、步骤长(相当于超越篇难题)。
61
- 非数学学科按同样的 1~5 级划分:1 星为基础识记,3 星为综合应用,5 星为竞赛或压轴难度。`,lt=`- 输出一个完整的 <svg> 元素,包含 xmlns="http://www.w3.org/2000/svg" 和 viewBox(建议宽 400~600),不要用 Markdown 代码块包裹。
62
- - 白色背景、黑色线条(stroke="#000",线宽 1.5~2),需要区分的区域可用浅灰填充;不要使用彩色装饰。
63
- - 按原图比例和相对位置绘制,保留原题印刷标注:顶点字母、数字、长度、角度、单位、箭头和虚线等,文字用 <text>(font-size 14~18);必须过滤掉人在图上手写的草稿、演算、思考批注、圈画和涂改痕迹。
64
- - 只使用基本图形元素:line、polyline、polygon、rect、circle、ellipse、path、text、g、defs、marker。
65
- - 严禁使用 <image>、<script>、<foreignObject>、外部链接、外部字体或事件属性。`,lr=String.raw`- 行内公式用 $...$,独立公式用 $$...$$;不要用 \(...\) 或 \[...\],每个 $ 必须成对出现。
66
- - 所有 LaTeX 命令(如 \frac、\sqrt、\times、\angle)都必须写在 $...$ 内,公式外不能出现反斜杠命令。
67
- - 只使用 KaTeX 支持的命令和环境:方程组用 \begin{cases}...\end{cases},多行推导用 \begin{aligned}...\end{aligned}(放在 $$...$$ 中),不要用 align、eqnarray、\newcommand、\usepackage、\label、\tag 等。
68
- - 大括号 {} 必须成对,\left 与 \right 必须成对,\begin{...} 与 \end{...} 必须对应。
69
- - 公式中的中文写在 \text{...} 里,或放到公式外;百分号写成 \%,美元符号写成 \$。
70
- - 反斜杠只写一个(\frac),不要写成 \\frac;换行符 \\ 只能用在 cases、aligned 等环境里。`,ln=`【角色与核心任务 (ROLE AND CORE TASK)】
71
- 你是一位世界顶尖的、经验丰富的、专业的跨学科考试分析专家(Interdisciplinary Exam Analysis Expert)。你的核心任务是极致准确地分析用户提供的考试题目图片,全面理解所有文本、图表和隐含约束,并提供一个完整、高度结构化且专业的解决方案。
72
-
73
- {{language_instruction}}
74
-
75
- 【核心输出要求 (OUTPUT REQUIREMENTS)】
76
- 你的响应输出**必须严格遵循以下自定义标签格式**。**严禁**使用 JSON 或 Markdown 代码块。**严禁**对 LaTeX 公式中的反斜杠进行二次转义(如 "\\\\frac" 是错误的,必须是 "\\frac")。
77
-
78
- 请严格按照以下结构输出内容:
79
-
80
- <subject>
81
- 在此处填写学科,必须是以下之一:"数学", "物理", "化学", "生物", "英语", "语文", "历史", "地理", "政治", "其他"。
82
- </subject>
83
-
84
- <knowledge_points>
85
- 在此处填写知识点,使用逗号分隔,例如:知识点1, 知识点2, 知识点3
86
- </knowledge_points>
87
-
88
- <requires_image>
89
- 判断这道题是否需要依赖图片才能正确解答。如果题目包含几何图形、函数图像、实验装置图、电路图等必须看图才能理解的内容,填写 true;如果只需要文字描述即可理解(如英语题、纯文字数学题),填写 false。
90
- </requires_image>
91
-
92
- <has_figure>
93
- 判断题目本身是否带有配图(几何图形、函数图像、示意图、统计图、实验装置图、电路图等;不含学生的作答痕迹和纯文字表格)。有配图填 true,否则填 false。
94
- </has_figure>
95
-
96
- <figure_svg>
97
- 如果 has_figure 为 true,用 SVG 重新绘制题目配图:
98
- ${lt}
99
- 如果 has_figure 为 false,请留空。
100
- </figure_svg>
101
-
102
- <wrong_answer_text>
103
- 如果图片中包含学生针对本题提交的正式错误答案或正式解题步骤,请按原样摘录;必须过滤掉空白处或题干旁的草稿、竖式演算、试算数字、涂改痕迹、审题圈画以及人的思考过程批注。如果图片中只有草稿/思考痕迹或没有看到正式错误解答,请留空。
104
- </wrong_answer_text>
105
-
106
- <mistake_status>
107
- 填写以下值之一:wrong_attempt(图片中有明确的正式错误答案或正式错误步骤;仅有草稿、涂改或思考批注不算作答)、not_attempted(没有正式错误解答,像是不会做、未作答或仅有草稿/思考痕迹)、unknown(无法判断)。
108
- </mistake_status>
109
-
110
- <difficulty_stars>
111
- 只填写 1 到 5 之间的一个整数,表示题目难度星级。
112
- ${le}
113
- </difficulty_stars>
114
-
115
- <mistake_analysis>
116
- 如果图片中包含学生的正式错误解答,请分析错误可能发生在哪一步、为什么错、导致了什么后果;必须忽略零散草稿和人的思考过程,如果没有正式错误解答,请留空。
117
- </mistake_analysis>
118
-
119
- <question_text>
120
- 在此处填写题目的完整文本。使用 Markdown 格式。所有数学公式使用 LaTeX 符号(行内 $...$,块级 $$...$$)。
121
-
122
- 【题干转录规则】
123
- 1. **逐字照录**:只按图片原题转录题干(含题号、分值和标点),不要改写、概括、增删字词或调整语序;看不清的字用 [?] 标注。
124
- 2. **过滤草稿与思考过程**:必须过滤掉图片中人的手写草稿、竖式演算、试算算式、思考过程批注、审题圈画、涂改痕迹以及学生在横线或括号中填入的答案,严禁将草稿或人的思考过程记录进 question_text。
125
- 3. **填空统一**:所有填空处(含已被学生手写填入答案的横线)统一还原写作 ____(4 个下划线),不论原图横线长短。
126
- 4. **选择题选项另起一行**:如果题目是选择题,题干与选项必须分行,选项必须在题干下方另起新行书写(不要将选项紧接在题干同一行后面)。
127
- 5. **图形描述**:如果题目依赖图形,在题干原文之后空一行,单独写**一段**以「图示:」开头的图形描述;只能使用「图示:」这一种写法(不要写「图示信息」「图示说明」等),描述中不要重复题干已有的文字,且不要包含学生的手写草稿或作答痕迹。题目不依赖图形时不要写图示段落。
128
-
129
- 【表格处理规则】
130
- 如果图片中包含表格,必须完整转录表格内容,遵循以下原则:
131
-
132
- 1. **标准表格**:使用 Markdown 表格语法
133
- | 列标题1 | 列标题2 | 列标题3 |
134
- |---------|---------|---------|
135
- | 数据1 | 数据2 | 数据3 |
136
-
137
- 2. **复杂表格**(合并单元格/多级表头/不规则布局):
138
- - 优先尝试用 Markdown 表格近似表示
139
- - 如果 Markdown 无法准确表达,在表格前用文字说明结构,然后用简化的 Markdown 表格 + 注释
140
- - 示例:
141
- > 注:第1行为主标题,横跨3列;第2-3行为数据行
142
-
143
- | 项目 | 数值A | 数值B |
144
- |------|-------|-------|
145
- | 测试1 | 10 | 20 |
146
- | 测试2 | 15 | 25 |
147
-
148
- 3. **表格完整性要求**:
149
- - 必须转录所有单元格内容(包括空单元格用 - 或空格表示)
150
- - 保留表格标题、单位、注释
151
- - 保留数据的对齐关系和分组信息
152
- - 表格中的数学公式使用 LaTeX 语法
153
-
154
- 4. **表格上下文**:
155
- - 如果表格有标题或编号(如"表1"),保留在表格前
156
- - 如果表格后有注释或说明,保留在表格后
157
- - 保持表格在题目中的位置关系
158
-
159
- 5. **特殊情况处理**:
160
- - 图表混合:如果表格旁边有图形,用文字说明位置关系
161
- - 手写表格:尽力识别手写内容,不确定的用 [?] 标注
162
- - 模糊表格:如果表格不清晰,在表格前注明"(表格内容可能不完整)"
163
- </question_text>
164
-
165
- <answer_text>
166
- 在此处填写正确答案。使用 Markdown 和 LaTeX 符号。如果答案包含表格,遵循上述【表格处理规则】。
167
- </answer_text>
168
-
169
- <analysis>
170
- 在此处填写详细的步骤解析。
171
- * 解析语言遵循字段语言规则。
172
- * **直接使用标准的 LaTeX 符号**(如 $\\frac{1}{2}$),**不要**进行 JSON 转义(不要写成 \\\\frac)。
173
- * 如果解析过程需要表格(如列表对比、分步计算表),遵循上述【表格处理规则】。
174
- </analysis>
175
-
176
- 【知识点标签列表(KNOWLEDGE POINT LIST)】
177
- {{knowledge_points_list}}
178
-
179
- 【标签使用规则 (TAG RULES)】
180
- - 标签必须与题目实际考查的知识点精准匹配。
181
- - 每题最多 5 个标签。
182
-
183
- 【!!! 关键格式与内容约束 (CRITICAL RULES) !!!】
184
- 1. **格式严格**:必须包含输出协议规定的全部 XML 标签,包括 grade_semester 年级标签,不要输出任何“开场白”或“结束语”。
185
- 2. **纯文本**:内容作为纯文本处理,**不要转义反斜杠**。
186
- 3. **内容完整**:如果包含子问题,请在 question_text 中完整列出。
187
- 4. **禁止图片**:严禁包含任何图片链接或 markdown 图片语法。
188
- 5. **LaTeX 规范**:
189
- ${lr}
190
-
191
- {{grade_instruction}}
192
- {{provider_hints}}`,li=`你是一位资深的K12教育题目生成专家,具备跨学科的题目创作能力。你的核心任务是**根据以下原题和知识点,举一反三生成高质量教学题目**,帮助学生巩固知识并拓展解题思路。
193
- ### 角色定义
194
- 1. **学科全能专家**
195
- - 精通K12阶段所有学科(数学/语文/英语/物理/化学/生物/历史/地理/政治)
196
- - 熟悉各年级课程标准与知识点分布
197
- - 能准确识别题目考察的核心能力点(计算/推理/分析/应用/创新)
198
- 2. **题目变异大师**
199
- - 掌握12种变式技法:条件替换/情境迁移/问题转化/数据重构/图形变形/角色反转/跨学科融合/难度阶梯/开放拓展/陷阱设计/逆向思维/生活应用
200
- - 确保变式题目保持原题核心考点,改变题目表现形式
201
- 3. **学情分析师**
202
- - 预判学生易错点(认知盲区/概念混淆/计算失误/审题偏差)
203
- - 在变式题目中针对性强化易错点训练
204
- ### 执行流程
205
- 1. **接收任务**
206
- 原题: "{{original_question}}"
207
- {{language_instruction}}
208
- DIFFICULTY LEVEL: {{difficulty_level}}
209
- {{difficulty_instruction}}
210
- Knowledge Points: {{knowledge_points}}
211
- 2. **解构分析**
212
- - 提取核心考点与能力要求
213
- - 分析题目陷阱与解题路径
214
- 3. **质量管控**
215
- - 确保每道题:
216
- ✓ 覆盖相同核心知识点
217
- ✓ 保持解题逻辑一致性
218
- ✓ 答案唯一且可验证
219
- ✓ 无知识性错误
220
- ### 输出规范
221
- 你的响应输出**必须严格遵循以下自定义标签格式**。**严禁**使用 JSON 或 Markdown 代码块。**严禁**返回 \`\`\`json ... \`\`\`。
222
-
223
- 请严格按照以下结构输出内容(不要包含任何其他文字):
224
-
225
- <question_text>
226
- 在此处填写新生成的填空题或解答题。不要包含题号、分值或选择题选项。
227
- </question_text>
228
-
229
- <answer_text>
230
- 在此处填写新题目的正确答案。
231
- </answer_text>
232
-
233
- <analysis>
234
- 在此处填写新题目的详细解析。
235
- * 解析语言遵循字段语言规则。
236
- * **直接使用标准的 LaTeX 符号**(如 $\\frac{1}{2}$),**不要**进行 JSON 转义。
237
- </analysis>
238
-
239
- {{figure_instruction}}
240
-
241
- ###关键格式与内容约束 (CRITICAL RULES) !!!
242
- 1. **纯文本**:内容作为纯文本处理,**不要转义反斜杠**。
243
- 2. **LaTeX 规范**:
244
- ${lr}
245
-
246
- {{grade_instruction}}
247
- {{provider_hints}}`;o7.I.join("、"),o7.r.join("、");var ls=e.i(395925);function la({name:e,description:t}){return(0,f.jsxs)("div",{className:"flex flex-col sm:flex-row sm:items-start gap-1 sm:gap-2 text-xs py-1",children:[(0,f.jsx)("code",{className:"bg-muted px-1.5 py-0.5 rounded font-mono text-primary shrink-0 w-fit",children:`{{${e}}}`}),(0,f.jsx)("span",{className:"text-muted-foreground",children:t})]})}function lo(){let{t:e}=(0,h.b)();return(0,f.jsxs)("div",{className:"bg-amber-50 dark:bg-amber-950/40 border border-amber-200 dark:border-amber-900 rounded-md p-3 flex items-start gap-3 text-amber-900 dark:text-amber-200 text-sm mb-4",children:[(0,f.jsx)(J.f,{className:"h-5 w-5 shrink-0 text-amber-600"}),(0,f.jsxs)("div",{className:"space-y-1",children:[(0,f.jsx)("p",{className:"font-medium",children:e.settings?.prompts?.caution||"Modify with Caution"}),(0,f.jsx)("p",{className:"text-amber-800/90 dark:text-amber-200 text-xs",children:e.settings?.prompts?.warning||"Variables in {{brackets}} are used to inject dynamic content. Please preserve these variables, otherwise the AI providing may fail to get question context or return invalid formats."})]})]})}function ll({config:e,onUpdate:t}){let{t:r}=(0,h.b)(),n=e.prompts?.analyze||ln,i=e.prompts?.similar||li,s=async e=>{await (0,ez.u)(r.settings?.prompts?.resetConfirm||"Are you sure you want to reset to default?",{destructive:!0})&&t(e,"analyze"===e?ln:li)},a=(e,r)=>{t(e,r)};return(0,f.jsx)("div",{className:"space-y-4 border rounded-lg p-4 bg-muted/30",children:(0,f.jsxs)(el.i,{defaultValue:"analyze",className:"w-full",children:[(0,f.jsxs)(el.U,{className:"grid w-full grid-cols-2",children:[(0,f.jsx)(el.k,{value:"analyze",children:r.settings?.prompts?.analysisTab||"Analysis Prompt"}),(0,f.jsx)(el.k,{value:"similar",children:r.settings?.prompts?.similarTab||"Similar Question Prompt"})]}),(0,f.jsx)(el.S,{value:"analyze",className:"space-y-4 py-4",children:(0,f.jsxs)("div",{className:"space-y-4",children:[(0,f.jsxs)("div",{className:"flex justify-between items-center",children:[(0,f.jsx)(ef.f,{className:"text-base font-semibold",children:r.settings?.prompts?.customAnalysis||"Custom Analysis Template"}),(0,f.jsxs)(ea.f,{variant:"outline",size:"sm",onClick:()=>s("analyze"),children:[(0,f.jsx)(ls.f,{className:"w-4 h-4 mr-2"}),r.settings?.prompts?.reset||"Reset Default"]})]}),(0,f.jsx)(lo,{}),(0,f.jsxs)("div",{className:"space-y-2 border rounded-md p-3 bg-background",children:[(0,f.jsxs)("h4",{className:"text-xs font-medium flex items-center gap-1.5 mb-2",children:[(0,f.jsx)(X,{className:"h-3.5 w-3.5"}),r.settings?.prompts?.variables||"Available Variables"]}),(0,f.jsxs)("div",{className:"space-y-1.5",children:[(0,f.jsx)(la,{name:"language_instruction",description:r.settings?.prompts?.vars?.languageInstruction||"Injects instructions based on target language (e.g., keep English questions in English but analysis in Chinese)."}),(0,f.jsx)(la,{name:"knowledge_points_list",description:r.settings?.prompts?.vars?.knowledgePointsList||"Injects the standard list of knowledge point tags for the specific subject."}),(0,f.jsx)(la,{name:"provider_hints",description:r.settings?.prompts?.vars?.providerHints||"Provider compatibility hints that follow the application output contract."})]})]}),(0,f.jsx)(oQ.f,{value:n,onChange:e=>a("analyze",e.target.value),className:"font-mono text-xs min-h-[400px]",placeholder:ln})]})}),(0,f.jsx)(el.S,{value:"similar",className:"space-y-4 py-4",children:(0,f.jsxs)("div",{className:"space-y-4",children:[(0,f.jsxs)("div",{className:"flex justify-between items-center",children:[(0,f.jsx)(ef.f,{className:"text-base font-semibold",children:r.settings?.prompts?.customSimilar||"Custom Similar Question Template"}),(0,f.jsxs)(ea.f,{variant:"outline",size:"sm",onClick:()=>s("similar"),children:[(0,f.jsx)(ls.f,{className:"w-4 h-4 mr-2"}),r.settings?.prompts?.reset||"Reset Default"]})]}),(0,f.jsx)(lo,{}),(0,f.jsxs)("div",{className:"space-y-2 border rounded-md p-3 bg-background",children:[(0,f.jsxs)("h4",{className:"text-xs font-medium flex items-center gap-1.5 mb-2",children:[(0,f.jsx)(X,{className:"h-3.5 w-3.5"}),r.settings?.prompts?.variables||"Available Variables"]}),(0,f.jsxs)("div",{className:"space-y-1.5",children:[(0,f.jsx)(la,{name:"difficulty_level",description:r.settings?.prompts?.vars?.difficultyLevel||"Target difficulty level."}),(0,f.jsx)(la,{name:"difficulty_instruction",description:r.settings?.prompts?.vars?.difficultyInstruction||"Specific writing instructions for the target difficulty."}),(0,f.jsx)(la,{name:"original_question",description:r.settings?.prompts?.vars?.originalQuestion||"The full text of the original question."}),(0,f.jsx)(la,{name:"knowledge_points",description:r.settings?.prompts?.vars?.knowledgePoints||"List of knowledge points to test."}),(0,f.jsx)(la,{name:"language_instruction",description:r.settings?.prompts?.vars?.languageInstructionShort||"Language formatting instructions."})]})]}),(0,f.jsx)(oQ.f,{value:i,onChange:e=>a("similar",e.target.value),className:"font-mono text-xs min-h-[400px]",placeholder:li})]})})]})})}var lc=e.i(21357),ld=e.i(434901),lu=e.i(753817),lp=e.i(128093),lf=e.i(79058);let lm=["browser","minimax","qwen","glm","stepfun","volcengine","volcengine-agent","openai"];lm.filter(e=>"browser"!==e);let lh={minimax:{model:"speech-2.8-hd",voice:"male-qn-jingying"},qwen:{model:"qwen-audio-3.0-tts-plus",voice:"longanlufeng"},glm:{model:"glm-tts",voice:"xiaochen"},stepfun:{model:"stepaudio-2.5-tts",voice:"qingniandaxuesheng"},volcengine:{model:"seed-tts-2.0",voice:"zh_male_yangguangqingnian_uranus_bigtts"},"volcengine-agent":{model:"seed-tts-2.0",voice:"zh_male_yangguangqingnian_uranus_bigtts"},openai:{model:"gpt-4o-mini-tts",voice:"cedar"}},lg={minimax:{apiKey:"https://platform.minimax.cn/docs/guides/quickstart-preparation",model:"https://platform.minimax.cn/docs/api-reference/speech-t2a-http",voice:"https://platform.minimax.cn/docs/faq/system-voice-id",endpoint:"https://platform.minimax.cn/docs/api-reference/speech-t2a-http"},qwen:{apiKey:"https://help.aliyun.com/zh/model-studio/token-plan-personal-quick-start",model:"https://help.aliyun.com/zh/model-studio/non-realtime-tts-user-guide",voice:"https://help.aliyun.com/zh/model-studio/qwen-audio-tts-voice-list",endpoint:"https://help.aliyun.com/zh/model-studio/non-realtime-tts-user-guide"},glm:{apiKey:"https://docs.bigmodel.cn/cn/guide/start/quick-start",model:"https://docs.bigmodel.cn/api-reference/%E6%A8%A1%E5%9E%8B-api/%E6%96%87%E6%9C%AC%E8%BD%AC%E8%AF%AD%E9%9F%B3",voice:"https://docs.bigmodel.cn/api-reference/%E6%A8%A1%E5%9E%8B-api/%E6%96%87%E6%9C%AC%E8%BD%AC%E8%AF%AD%E9%9F%B3",endpoint:"https://docs.bigmodel.cn/api-reference/%E6%A8%A1%E5%9E%8B-api/%E6%96%87%E6%9C%AC%E8%BD%AC%E8%AF%AD%E9%9F%B3"},stepfun:{apiKey:"https://platform.stepfun.com/docs/zh/step-plan/integrations/audio-api",model:"https://platform.stepfun.com/docs/zh/api-reference/audio/create-audio",voice:"https://platform.stepfun.com/docs/zh/guides/developer/tts",endpoint:"https://platform.stepfun.com/docs/zh/api-reference/audio/create-audio"},volcengine:{apiKey:"https://www.volcengine.com/docs/6561/196768",model:"https://www.volcengine.com/docs/6561/1598757",voice:"https://www.volcengine.com/docs/6561/1257544",endpoint:"https://www.volcengine.com/docs/6561/1598757"},openai:{apiKey:"https://platform.openai.com/docs/quickstart",model:"https://developers.openai.com/api/docs/guides/text-to-speech",voice:"https://developers.openai.com/api/docs/guides/text-to-speech",endpoint:"https://developers.openai.com/api/docs/guides/text-to-speech"},"volcengine-agent":{apiKey:"https://ark.volcengine.com/region:cn-beijing/docs/82379/2160841?lang=zh",model:"https://docs.volcengine.com/docs/ark/agent-plan-personal-voice-model?lang=zh",voice:"https://www.volcengine.com/docs/6561/1257544",endpoint:"https://docs.volcengine.com/docs/ark/agent-plan-personal-voice-model?lang=zh"}},lv={volcengine:"https://docs.volcengine.com/docs/ark/free-inference-quota?lang=zh"};function ly({config:e,setConfig:t,saving:r,onSave:n}){var i;let{t:s,language:a}=(0,h.b)(),o=s.settings.tts,[l,c]=(0,m.useState)(!1),[d,u]=(0,m.useState)(null),p=e.tts?.mode??"browser",g="browser"!==p&&"string"==typeof(i=p)&&lm.includes(i)?p:null,b=g?e.tts?.[g]:void 0,w=(e,r)=>{g&&t(t=>({...t,tts:{...t.tts,[g]:{...t.tts?.[g],[e]:r}}}))},_=!!g&&("volcengine"===g||"openai"===g),j=g?function(e,t){if("openai"===t){let t=e.openai?.instances?.find(t=>t.id===e.openai?.activeInstanceId);return t?{apiKey:t.apiKey,baseUrl:t.baseUrl}:void 0}return e[t]}(e,g):void 0,k=_?b?.apiKey:j?.apiKey,z=async()=>{(0,lf.p)(),c(!0),u(null);try{await n();let{id:e,version:t}=await v.k.post("/api/tts",{text:o.previewText,language:a},{timeout:12e4,recoverable:!0}),r=(0,lf.l)();if(!r)return;r.src=`/api/tts/${e}?v=${t}`,r.playbackRate=1,await r.play()}catch(t){x.V.error("[TtsSettings]","Preview failed",{error:t});let e=(0,y.d)(t);ez.c.error("TTS_NOT_CONFIGURED"===e?o.notConfigured:"TTS_PROVIDER_ERROR"===e?o.providerError:o.previewFailed),u((0,y.L)(t)??null)}finally{c(!1)}};return(0,f.jsxs)("div",{className:"space-y-4 border rounded-lg p-4 bg-muted/30",children:[(0,f.jsxs)("div",{className:"space-y-2",children:[(0,f.jsx)(ef.f,{children:o.title}),(0,f.jsxs)(eM.d,{value:p,onValueChange:e=>t(t=>({...t,tts:{...t.tts,mode:e}})),children:[(0,f.jsx)(eM.P,{children:(0,f.jsx)(eM.U,{})}),(0,f.jsx)(eM.r,{children:lm.map(e=>(0,f.jsx)(eM.T,{value:e,children:o.modes[e]},e))})]}),(0,f.jsx)("p",{className:"text-xs text-muted-foreground",children:g?o.cloudHint:o.browserHint})]}),g&&(0,f.jsxs)("div",{className:"space-y-3 animate-in fade-in slide-in-from-top-2",children:[lv[g]&&(0,f.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:[o.freeTrial," ",(0,f.jsx)("a",{href:lv[g],target:"_blank",rel:"noopener noreferrer",className:"underline",children:o.freeTrialLink})]}),(0,f.jsxs)("div",{className:"space-y-2",children:[(0,f.jsx)(ld.f,{label:"openai"===g?"OpenAI API Key":_?o.speechApiKey:`${(0,lp.z)(g,a)} API Key`,href:lg[g].apiKey,linkText:s.settings.ai.docLinks.apiKey}),(0,f.jsx)(eR.f,{value:k||"",onChange:e=>{var r;return r=e.target.value,void(g&&(_?w("apiKey",r):t(e=>({...e,[g]:{...e[g],apiKey:r}}))))},placeholder:"qwen"===g?"sk-sp-...":_?"":"sk-..."}),(0,f.jsx)("p",{className:"text-xs text-muted-foreground",children:o.apiKeyHint[g]})]}),(0,f.jsxs)("div",{className:"grid gap-3 sm:grid-cols-2",children:[(0,f.jsxs)("div",{className:"space-y-2",children:[(0,f.jsx)(ld.f,{label:o.model,href:lg[g].model,linkText:o.docs}),(0,f.jsx)(ep.f,{value:b?.model||"",onChange:e=>w("model",e.target.value),placeholder:lh[g].model})]}),(0,f.jsxs)("div",{className:"space-y-2",children:[(0,f.jsx)(ld.f,{label:o.voice,href:lg[g].voice,linkText:o.voiceList}),(0,f.jsx)(ep.f,{value:b?.voice||"",onChange:e=>w("voice",e.target.value),placeholder:lh[g].voice})]})]}),(0,f.jsx)("p",{className:"text-xs text-muted-foreground",children:o.voiceHint[g]}),(0,f.jsxs)("div",{className:"space-y-2",children:[(0,f.jsx)(ld.f,{label:o.endpoint,href:lg[g].endpoint,linkText:o.docs}),(0,f.jsx)(ep.f,{value:b?.endpoint||"",onChange:e=>w("endpoint",e.target.value),placeholder:function(e,t){if("volcengine"===e)return"https://openspeech.bytedance.com/api/v3/tts/unidirectional";if("volcengine-agent"===e)return"https://openspeech.bytedance.com/api/v3/plan/tts/unidirectional";if("openai"===e)return`${(t?.baseUrl||"https://api.openai.com/v1").replace(/\/+$/,"")}/audio/speech`;let{baseUrl:r}=(0,lp.k)(e,t);if("minimax"===e)return`${r.replace(/\/+$/,"")}/t2a_v2`;if("glm"===e||"stepfun"===e)return`${r.replace(/\/+$/,"")}/audio/speech`;try{return`${new URL(r).origin}/api/v1/services/audio/tts/SpeechSynthesizer`}catch{return""}}(g,j)}),(0,f.jsx)("p",{className:"text-xs text-muted-foreground",children:o.endpointHint})]})]},g),(0,f.jsxs)("div",{className:"flex flex-col gap-2 sm:flex-row",children:[g&&(0,f.jsxs)(ea.f,{variant:"outline",onClick:z,disabled:r||l,className:"sm:w-auto",children:[l?(0,f.jsx)(Q.f,{className:"mr-2 h-4 w-4 animate-spin"}):(0,f.jsx)(lc.f,{className:"mr-2 h-4 w-4"}),o.preview]}),(0,f.jsxs)(ea.f,{onClick:()=>void n(),disabled:r||l,className:"flex-1",children:[r&&(0,f.jsx)(Q.f,{className:"mr-2 h-4 w-4 animate-spin"}),o.save]})]}),g&&d&&(0,f.jsx)("div",{className:"rounded-md border border-red-200 bg-red-50 p-2 dark:border-red-900 dark:bg-red-950/40",children:(0,f.jsx)(lu.f,{detail:d})})]})}var lx=e.i(835467);function lb({value:e,icon:t,label:r}){return(0,f.jsxs)(el.k,{value:e,className:"px-2 sm:px-3",children:[t,(0,f.jsx)("span",{className:"hidden sm:inline",children:r})]})}function lw(){let{setTimeZone:e}=(0,P.M)(),{data:t}=(0,g.useSession)(),r=t?.user?.role==="admin",{t:n}=(0,h.b)(),i=(0,D.useRouter)(),[s,a]=(0,m.useState)(!1),o=(0,m.useRef)(null),[l,c]=(0,m.useState)(!1),[d,u]=(0,m.useState)(!1),[p,y]=(0,m.useState)({aiProvider:"minimax"}),b=(0,m.useCallback)(async()=>{u(!0);try{y(await v.k.get("/api/settings"))}catch(e){x.V.error("[SettingsDialog]","Failed to fetch settings",{error:e})}finally{u(!1)}},[]);(0,m.useEffect)(()=>{s&&b()},[s,b]);let w=async()=>{let t=(0,lx.f)(p,n);if(t)return void ez.c.error(t);c(!0);try{let t=await v.k.post("/api/settings",p);y(t),e(t.timeZone||ec.J),ez.c.success(n.settings?.messages?.saved||"Settings saved"),o.current?.scrollTo({top:0,behavior:"smooth"})}catch(e){x.V.error("[SettingsDialog]","Failed to save settings",{error:e}),ez.c.error(n.settings?.messages?.saveFailed||"Failed to save")}finally{c(!1)}},_=e=>(0,f.jsxs)(ea.f,{onClick:w,disabled:l,className:"w-full",children:[l&&(0,f.jsx)(Q.f,{className:"mr-2 h-4 w-4 animate-spin"}),e]});return(0,f.jsxs)(eo.N,{open:s,onOpenChange:a,children:[(0,f.jsx)(eo.a,{asChild:!0,children:(0,f.jsxs)(ea.f,{variant:"ghost",size:"icon",className:"rounded-full",children:[(0,f.jsx)(en,{className:"h-5 w-5"}),(0,f.jsx)("span",{className:"sr-only",children:n.settings?.title||"Settings"})]})}),(0,f.jsxs)(eo.d,{ref:o,className:"w-[calc(100vw-2rem)] sm:max-w-[900px] max-h-[85vh] overflow-y-auto",children:[(0,f.jsxs)(eo.s,{children:[(0,f.jsx)(eo.F,{children:n.settings?.title||"Settings"}),(0,f.jsx)(eo.C,{children:n.settings?.desc||"Manage your preferences and data."})]}),(0,f.jsxs)(el.i,{defaultValue:"general",className:"w-full",children:[(0,f.jsxs)(el.U,{className:`grid w-full grid-cols-4 ${r?"sm:grid-cols-7":"sm:grid-cols-4"} gap-1 h-auto`,children:[(0,f.jsx)(lb,{value:"general",icon:(0,f.jsx)(Y.f,{className:"h-4 w-4 sm:mr-2"}),label:n.settings?.tabs?.general||"General"}),(0,f.jsx)(lb,{value:"account",icon:(0,f.jsx)(ei.f,{className:"h-4 w-4 sm:mr-2"}),label:n.settings?.tabs?.account||"Account"}),r&&(0,f.jsxs)(f.Fragment,{children:[(0,f.jsx)(lb,{value:"ai",icon:(0,f.jsx)(W,{className:"h-4 w-4 sm:mr-2"}),label:n.settings?.tabs?.ai||"AI Provider"}),(0,f.jsx)(lb,{value:"prompts",icon:(0,f.jsx)(et,{className:"h-4 w-4 sm:mr-2"}),label:n.settings?.tabs?.prompts||"Prompts"}),(0,f.jsx)(lb,{value:"admin",icon:(0,f.jsx)(B,{className:"h-4 w-4 sm:mr-2"}),label:n.settings?.tabs?.admin||"User Management"})]}),(0,f.jsx)(lb,{value:"danger",icon:(0,f.jsx)(J.f,{className:"h-4 w-4 sm:mr-2"}),label:n.settings?.tabs?.danger||"Danger"}),(0,f.jsx)(lb,{value:"about",icon:(0,f.jsx)(X,{className:"h-4 w-4 sm:mr-2"}),label:n.settings?.tabs?.about||"About"})]}),(0,f.jsxs)(el.S,{value:"general",className:"space-y-4 py-4",children:[(0,f.jsx)(oq,{config:p,setConfig:y,isAdmin:r,disabled:d||l}),(0,f.jsx)(oY,{}),r&&_(n.settings?.save||"Save Settings")]}),(0,f.jsx)(el.S,{value:"account",className:"space-y-4 py-4",children:(0,f.jsx)(eG,{})}),(0,f.jsxs)(el.S,{value:"ai",className:"space-y-4 py-4",children:[(0,f.jsx)(eV.f,{config:p,setConfig:y,loading:d,saving:l,onSave:w}),!d&&(0,f.jsx)(ly,{config:p,setConfig:y,saving:l,onSave:w})]}),(0,f.jsxs)(el.S,{value:"prompts",className:"space-y-4 py-4",children:[(0,f.jsx)(ll,{config:p,onUpdate:(e,t)=>y(r=>({...r,prompts:{...r.prompts,[e]:t}}))}),_(n.settings?.prompts?.save||"Save Prompt Settings")]}),r&&(0,f.jsxs)(el.S,{value:"admin",className:"space-y-4 py-4",children:[(0,f.jsxs)(ea.f,{variant:"outline",className:"w-full justify-start gap-2",onClick:()=>{a(!1),i.push("/admin")},children:[(0,f.jsx)(Z.f,{className:"h-4 w-4"}),n.admin?.dashboard?.title||"Admin Dashboard"]}),(0,f.jsxs)(ea.f,{variant:"outline",className:"w-full justify-start gap-2",onClick:()=>{a(!1),i.push("/setup")},children:[(0,f.jsx)(es.f,{className:"h-4 w-4"}),n.setup.rerun]}),(0,f.jsx)(oZ,{}),(0,f.jsx)(oz,{}),(0,f.jsx)("div",{className:"border-t pt-4",children:(0,f.jsx)(eS,{})})]}),(0,f.jsx)(el.S,{value:"danger",className:"space-y-4 py-4",children:(0,f.jsxs)("div",{className:"space-y-3",children:[(0,f.jsx)(oP,{isAdmin:r}),(0,f.jsx)(oA,{isAdmin:r})]})}),(0,f.jsx)(el.S,{value:"about",className:"space-y-4 py-4",children:(0,f.jsx)(eF,{})})]})]})]})}var l_=e.i(446513);let lj={name:"moon",size:24,node:[["path",{d:"M20.985 12.486a9 9 0 1 1-9.473-9.472c.405-.022.617.46.402.803a6 6 0 0 0 8.268 8.268c.344-.215.825-.004.803.401",key:"kfwtm"}]]};lj.node;let lk=(0,U.f)(lj),lz={name:"sun",size:24,node:[["circle",{cx:"12",cy:"12",r:"4",key:"4exip2"}],["path",{d:"M12 2v2",key:"tus03m"}],["path",{d:"M12 20v2",key:"1lh1kg"}],["path",{d:"m4.93 4.93 1.41 1.41",key:"149t6j"}],["path",{d:"m17.66 17.66 1.41 1.41",key:"ptbguv"}],["path",{d:"M2 12h2",key:"1t8f8n"}],["path",{d:"M20 12h2",key:"1q8mjw"}],["path",{d:"m6.34 17.66-1.41 1.41",key:"1m8zz5"}],["path",{d:"m19.07 4.93-1.41 1.41",key:"1shlcs"}]]};lz.node;let lN=(0,U.f)(lz);var lS=e.i(755146);let l$={system:l_.f,light:lN,dark:lk};function lA(){let{t:e}=(0,h.b)(),{preference:t,setPreference:r}=(0,m.useContext)(k),n=l$[t],i=`${e.theme.toggle}: ${e.theme[t]}`;return(0,f.jsxs)(lS.G,{children:[(0,f.jsx)(lS.X,{asChild:!0,children:(0,f.jsx)(ea.f,{variant:"ghost",size:"icon",className:"rounded-full",title:i,"aria-label":i,children:(0,f.jsx)(n,{className:"h-5 w-5"})})}),(0,f.jsx)(lS.L,{align:"end",children:(0,f.jsx)(lS.O,{value:t,onValueChange:e=>{j(e)&&r(e)},children:b.map(t=>{let r=l$[t];return(0,f.jsxs)(lS.T,{value:t,className:"gap-2",children:[(0,f.jsx)(r,{className:"h-4 w-4"}),e.theme[t]]},t)})})})]})}let lO=[/^\/login/,/^\/register/,/^\/setup/,/^\/print-preview/,/^\/exams\/[^/]+\/print/],lE=[{key:"home",href:"/",icon:V,match:e=>"/"===e},{key:"notebooks",href:"/notebooks",icon:F.f,match:e=>e.startsWith("/notebooks")||e.startsWith("/error-items")||e.startsWith("/practice")},{key:"review",href:"/review",icon:R.f,match:e=>e.startsWith("/review")},{key:"stats",href:"/stats",icon:Z.f,match:e=>e.startsWith("/stats")||e.startsWith("/tags")},{key:"exams",href:"/exams",icon:M.f,match:e=>e.startsWith("/exams")}];function lT({children:e}){var t;let r,n,i=(0,D.usePathname)()||"/",{t:s}=(0,h.b)(),{data:a,status:o}=(0,g.useSession)(),l=a?.user?.role==="admin",c=lO.some(e=>e.test(i));if(t=l&&!c,r=(0,D.useRouter)(),n=(0,m.useRef)(!1),(0,m.useEffect)(()=>{t&&!n.current&&(n.current=!0,v.k.get("/api/setup").then(e=>{e.needsSetup&&r.replace("/setup")}).catch(e=>x.V.warn("[Setup]","Failed to check setup status",{error:e})))},[t,r]),c||"unauthenticated"===o)return(0,f.jsx)(f.Fragment,{children:e});let d=a?.user?.name||a?.user?.email||"";return(0,f.jsxs)("div",{className:"min-h-screen",children:[(0,f.jsx)("header",{className:"sticky top-0 z-40 border-b bg-card/80 backdrop-blur-md supports-[backdrop-filter]:bg-card/70 print:hidden",children:(0,f.jsxs)("div",{className:"mx-auto flex h-14 max-w-6xl items-center gap-3 px-4 md:h-16 md:px-8",children:[(0,f.jsxs)(I.default,{href:"/",className:"flex shrink-0 items-center gap-2",children:[(0,f.jsx)(C.default,{src:"/icons/icon.png",alt:"",width:32,height:32,className:"rounded-lg",priority:!0,unoptimized:!0}),(0,f.jsx)("span",{className:"text-base font-semibold tracking-tight",children:s.pageTitle.base})]}),(0,f.jsx)("nav",{className:"ml-4 hidden items-center gap-1 md:flex",children:lE.map(e=>{let t=e.match(i),r=e.icon;return(0,f.jsxs)(I.default,{href:e.href,className:(0,em.f)("flex items-center gap-1.5 rounded-lg px-3 py-2 text-sm font-medium transition-colors",t?"bg-accent text-accent-foreground":"text-muted-foreground hover:bg-muted hover:text-foreground"),"aria-current":t?"page":void 0,children:[(0,f.jsx)(r,{className:"h-4 w-4"}),s.nav[e.key]]},e.key)})}),(0,f.jsxs)("div",{className:"ml-auto flex items-center gap-1",children:[d&&(0,f.jsxs)("span",{className:"mr-2 hidden max-w-40 items-center gap-2 truncate text-sm text-muted-foreground lg:flex",children:[(0,f.jsx)("span",{className:"flex h-7 w-7 shrink-0 items-center justify-center rounded-full bg-primary/10 text-xs font-semibold text-primary",children:d.slice(0,1).toUpperCase()}),(0,f.jsx)("span",{className:"truncate",children:d})]}),l&&(0,f.jsx)(I.default,{href:"/admin",title:s.nav.admin,children:(0,f.jsxs)(ea.f,{variant:"ghost",size:"icon",className:"rounded-full",children:[(0,f.jsx)(B,{className:"h-5 w-5"}),(0,f.jsx)("span",{className:"sr-only",children:s.nav.admin})]})}),(0,f.jsx)(lA,{}),(0,f.jsx)(lw,{}),(0,f.jsx)(ea.f,{variant:"ghost",size:"icon",className:"rounded-full text-muted-foreground hover:text-destructive",onClick:()=>(0,g.signOut)({callbackUrl:"/login"}),title:s.app.logout,children:(0,f.jsx)(L.f,{className:"h-5 w-5"})})]})]})}),(0,f.jsx)("div",{className:"pb-20 md:pb-0",children:e}),(0,f.jsx)("nav",{className:"pb-safe fixed inset-x-0 bottom-0 z-40 border-t bg-card/90 backdrop-blur-md md:hidden print:hidden",children:(0,f.jsx)("div",{className:"grid h-16 grid-cols-5",children:lE.map(e=>{let t=e.match(i),r=e.icon;return(0,f.jsxs)(I.default,{href:e.href,className:(0,em.f)("flex flex-col items-center justify-center gap-1 text-[11px] font-medium transition-colors",t?"text-primary":"text-muted-foreground"),"aria-current":t?"page":void 0,children:[(0,f.jsx)("span",{className:(0,em.f)("flex h-7 w-12 items-center justify-center rounded-full transition-colors",t&&"bg-accent"),children:(0,f.jsx)(r,{className:"h-5 w-5"})}),s.nav[e.key]]},e.key)})})})]})}let lP={name:"list-todo",size:24,node:[["path",{d:"M13 5h8",key:"a7qcls"}],["path",{d:"M13 12h8",key:"h98zly"}],["path",{d:"M13 19h8",key:"c3s6r1"}],["path",{d:"m3 17 2 2 4-4",key:"1jhpwq"}],["rect",{x:"3",y:"4",width:"6",height:"6",rx:"1",key:"cif1o7"}]]};lP.node;let lC=(0,U.f)(lP);var lI=e.i(583967);let lD=[/^\/login/,/^\/register/,/^\/print-preview/,/^\/exams\/[^/]+\/print/];function lZ(){let{t:e}=(0,h.b)(),{timeZone:t}=(0,P.M)(),{status:r}=(0,g.useSession)(),n=(0,D.usePathname)(),[i,s]=(0,m.useState)(!1),[a,o]=(0,m.useState)([]),[l,c]=(0,m.useState)(()=>Date.now()),d="authenticated"!==r||lD.some(e=>e.test(n||"")),u=(0,m.useCallback)(async()=>{if("u"<typeof document||"hidden"!==document.visibilityState)try{let e=await v.k.get("/api/tasks");o(e.tasks),c(Date.now())}catch{}},[]);if((0,m.useEffect)(()=>{if(d)return;let e=setTimeout(u,0),t=setInterval(u,i?2e3:15e3);return()=>{clearTimeout(e),clearInterval(t)}},[d,i,u]),d)return null;let p=a.filter(e=>"running"===e.status).length,y=a.some(e=>"running"!==e.status),x=async()=>{try{let e=await v.k.delete("/api/tasks");o(e.tasks)}catch{}};return(0,f.jsxs)(f.Fragment,{children:[(0,f.jsxs)(ea.f,{variant:"outline",size:"icon",className:"fixed bottom-20 right-4 z-40 h-11 w-11 rounded-full shadow-lg md:bottom-6 md:right-6 print:hidden",onClick:()=>s(!0),"aria-label":e.backgroundTasks.title,title:e.backgroundTasks.title,children:[p>0?(0,f.jsx)(Q.f,{className:"h-5 w-5 animate-spin"}):(0,f.jsx)(lC,{className:"h-5 w-5"}),p>0&&(0,f.jsx)("span",{className:"absolute -right-1 -top-1 flex h-5 min-w-5 items-center justify-center rounded-full bg-primary px-1 text-xs text-primary-foreground",children:p})]}),(0,f.jsx)(eo.N,{open:i,onOpenChange:s,children:(0,f.jsxs)(eo.d,{className:"max-h-[85vh] overflow-y-auto sm:max-w-lg",children:[(0,f.jsxs)(eo.s,{children:[(0,f.jsx)(eo.F,{children:e.backgroundTasks.title}),(0,f.jsx)(eo.C,{children:e.backgroundTasks.description})]}),0===a.length?(0,f.jsx)("p",{className:"py-6 text-center text-sm text-muted-foreground",children:e.backgroundTasks.empty}):(0,f.jsx)("ul",{className:"space-y-2",children:a.map(r=>{var n,i;let a;return(0,f.jsx)("li",{className:"rounded-md border p-3 text-sm",children:(0,f.jsxs)("div",{className:"flex items-start gap-2",children:["running"===r.status&&(0,f.jsx)(Q.f,{className:"mt-0.5 h-4 w-4 shrink-0 animate-spin text-primary"}),"succeeded"===r.status&&(0,f.jsx)(oO.f,{className:"mt-0.5 h-4 w-4 shrink-0 text-green-600"}),"failed"===r.status&&(0,f.jsx)(lI.f,{className:"mt-0.5 h-4 w-4 shrink-0 text-destructive"}),(0,f.jsxs)("div",{className:"min-w-0 flex-1 space-y-1",children:[(0,f.jsxs)("div",{className:"font-medium",children:[e.backgroundTasks.kinds[r.kind],(0,f.jsxs)("span",{className:"font-normal text-muted-foreground",children:[" · ",e.backgroundTasks.status[r.status]]})]}),r.subject&&(0,f.jsx)("div",{className:"break-words text-muted-foreground",children:r.subject}),r.progress&&r.progress.total>0&&(0,f.jsxs)("div",{className:"space-y-1",children:[(0,f.jsx)("div",{className:"h-1.5 overflow-hidden rounded bg-muted",children:(0,f.jsx)("div",{className:"h-full bg-primary transition-all",style:{width:`${Math.round(r.progress.done/r.progress.total*100)}%`}})}),(0,f.jsxs)("div",{className:"text-xs text-muted-foreground",children:[e.backgroundTasks.progress.replace("{done}",String(r.progress.done)).replace("{total}",String(r.progress.total)),r.progress.failed>0&&` \xb7 ${e.backgroundTasks.failedCount.replace("{count}",String(r.progress.failed))}`]})]}),r.error&&(0,f.jsx)("div",{className:"text-xs text-destructive",children:(t=>{if(!t)return null;let r=e.backgroundTasks.errors[t]??e.errors[t];return"string"==typeof r?r:t})(r.error)}),(0,f.jsxs)("div",{className:"flex flex-wrap items-center gap-x-3 text-xs text-muted-foreground",children:[(0,f.jsx)("span",{children:e.backgroundTasks.startedAt.replace("{time}",(0,ec.r)(r.startedAt,"HH:mm:ss",t))}),(0,f.jsx)("span",{children:e.backgroundTasks.elapsed.replace("{time}",(n=r.startedAt,i=r.finishedAt,a=Math.max(0,Math.round(((i?Date.parse(i):l)-Date.parse(n))/1e3)),`${Math.floor(a/60)}:${String(a%60).padStart(2,"0")}`))}),r.link&&(0,f.jsx)(I.default,{href:r.link,className:"text-primary hover:underline",onClick:()=>s(!1),children:e.backgroundTasks.view})]})]})]})},r.id)})}),(0,f.jsxs)("div",{className:"flex items-center justify-between gap-2 pt-1",children:[(0,f.jsx)("p",{className:"text-xs text-muted-foreground",children:e.backgroundTasks.retentionHint}),y&&(0,f.jsx)(ea.f,{variant:"ghost",size:"sm",onClick:x,children:e.backgroundTasks.clearFinished})]})]})})]})}var lF=e.i(263676);let lR={success:{icon:oO.f,className:"text-success"},error:{icon:lI.f,className:"text-destructive"},warning:{icon:J.f,className:"text-warning"},info:{icon:X,className:"text-primary"}};function lM(){let{t:e}=(0,h.b)(),[t,r]=(0,m.useState)([]),[n,i]=(0,m.useState)(null);return(0,m.useEffect)(()=>(0,ez.M)(e=>{r(e.toasts),i(e.confirm)}),[]),(0,f.jsxs)(f.Fragment,{children:[(0,f.jsx)("div",{className:"pointer-events-none fixed inset-x-0 top-3 z-[100] flex flex-col items-center gap-2 px-4 print:hidden",role:"status","aria-live":"polite",children:t.map(t=>{let{icon:r,className:n}=lR[t.type];return(0,f.jsxs)("div",{className:"pointer-events-auto flex w-full max-w-sm items-start gap-3 rounded-xl border bg-card/95 px-4 py-3 text-sm shadow-lg backdrop-blur animate-in fade-in slide-in-from-top-2 duration-200",children:[(0,f.jsx)(r,{className:(0,em.f)("mt-0.5 h-4 w-4 shrink-0",n)}),(0,f.jsx)("p",{className:"min-w-0 flex-1 whitespace-pre-line break-words leading-relaxed",children:t.message}),(0,f.jsx)("button",{type:"button",className:"shrink-0 rounded p-0.5 text-muted-foreground transition-colors hover:text-foreground",onClick:()=>(0,ez.p)(t.id),"aria-label":e.common.close,children:(0,f.jsx)(lF.X,{className:"h-3.5 w-3.5"})})]},t.id)})}),(0,f.jsx)(eo.N,{open:!!n,onOpenChange:e=>{e||n?.resolve(!1)},children:(0,f.jsxs)(eo.d,{className:"sm:max-w-md",children:[(0,f.jsxs)(eo.s,{children:[(0,f.jsxs)(eo.F,{className:"flex items-center gap-2",children:[n?.destructive&&(0,f.jsx)(J.f,{className:"h-5 w-5 text-destructive"}),n?.title||e.common.confirmTitle]}),(0,f.jsx)(eo.C,{className:"whitespace-pre-line pt-1 text-left leading-relaxed",children:n?.message})]}),(0,f.jsxs)(eo.c,{className:"gap-2",children:[(0,f.jsx)(ea.f,{variant:"outline",onClick:()=>n?.resolve(!1),children:n?.cancelText||e.common.cancel}),(0,f.jsx)(ea.f,{variant:n?.destructive?"destructive":"default",onClick:()=>n?.resolve(!0),autoFocus:!0,children:n?.confirmText||e.common.confirm})]})]})})]})}function lL(){return(0,m.useEffect)(()=>{"serviceWorker"in navigator&&navigator.serviceWorker.register("/sw.js",{scope:"/"}).catch(e=>{x.V.warn("[PWA]","Service worker registration failed",{error:String(e)})})},[]),null}e.s(["Providers",0,function({children:e,timeZone:t}){return(0,m.useEffect)(()=>(0,x.m)(),[]),(0,f.jsx)(g.SessionProvider,{children:(0,f.jsx)(T,{children:(0,f.jsx)(h.w,{children:(0,f.jsxs)(P.n,{initialTimeZone:t,children:[(0,f.jsx)(lT,{children:e}),(0,f.jsx)(lZ,{}),(0,f.jsx)(lM,{}),(0,f.jsx)(lL,{})]})})})})}],1661)}]);