wrong-notebook 2026.10.22 → 2026.10.23

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 (376) hide show
  1. package/.next/BUILD_ID +1 -1
  2. package/.next/app-path-routes-manifest.json +0 -1
  3. package/.next/build-manifest.json +3 -3
  4. package/.next/prerender-manifest.json +3 -3
  5. package/.next/routes-manifest.json +0 -8
  6. package/.next/server/app/_global-error.html +1 -1
  7. package/.next/server/app/_global-error.rsc +1 -1
  8. package/.next/server/app/_global-error.segments/__PAGE__.segment.rsc +1 -1
  9. package/.next/server/app/_global-error.segments/_full.segment.rsc +1 -1
  10. package/.next/server/app/_global-error.segments/_tree.segment.rsc +1 -1
  11. package/.next/server/app/_not-found/page.js.nft.json +1 -1
  12. package/.next/server/app/_not-found/page_client-reference-manifest.js +1 -1
  13. package/.next/server/app/admin/page.js.nft.json +1 -1
  14. package/.next/server/app/admin/page_client-reference-manifest.js +1 -1
  15. package/.next/server/app/admin/user/[id]/page.js.nft.json +1 -1
  16. package/.next/server/app/admin/user/[id]/page_client-reference-manifest.js +1 -1
  17. package/.next/server/app/api/admin/dashboard/route.js +8 -2
  18. package/.next/server/app/api/admin/dashboard/route.js.nft.json +1 -1
  19. package/.next/server/app/api/admin/migrate-tags/route.js +1 -1
  20. package/.next/server/app/api/admin/migrate-tags/route.js.nft.json +1 -1
  21. package/.next/server/app/api/admin/system-reset/route.js +2 -2
  22. package/.next/server/app/api/admin/system-reset/route.js.nft.json +1 -1
  23. package/.next/server/app/api/admin/users/[id]/detail/route.js +9 -2
  24. package/.next/server/app/api/admin/users/[id]/detail/route.js.nft.json +1 -1
  25. package/.next/server/app/api/admin/users/[id]/route.js +1 -1
  26. package/.next/server/app/api/admin/users/[id]/route.js.nft.json +1 -1
  27. package/.next/server/app/api/admin/users/route.js +1 -1
  28. package/.next/server/app/api/admin/users/route.js.nft.json +1 -1
  29. package/.next/server/app/api/ai/models/route.js +5 -5
  30. package/.next/server/app/api/ai/models/route.js.nft.json +1 -1
  31. package/.next/server/app/api/ai/test/route.js +6 -6
  32. package/.next/server/app/api/ai/test/route.js.nft.json +1 -1
  33. package/.next/server/app/api/analytics/route.js +3 -3
  34. package/.next/server/app/api/analytics/route.js.nft.json +1 -1
  35. package/.next/server/app/api/analyze/route.js +7 -7
  36. package/.next/server/app/api/analyze/route.js.nft.json +1 -1
  37. package/.next/server/app/api/auth/[...nextauth]/route.js +1 -1
  38. package/.next/server/app/api/auth/[...nextauth]/route.js.nft.json +1 -1
  39. package/.next/server/app/api/error-items/[id]/delete/route.js +2 -2
  40. package/.next/server/app/api/error-items/[id]/delete/route.js.nft.json +1 -1
  41. package/.next/server/app/api/error-items/[id]/figure/route.js +6 -6
  42. package/.next/server/app/api/error-items/[id]/figure/route.js.nft.json +1 -1
  43. package/.next/server/app/api/error-items/[id]/fix-latex/route.js +7 -7
  44. package/.next/server/app/api/error-items/[id]/fix-latex/route.js.nft.json +1 -1
  45. package/.next/server/app/api/error-items/[id]/geogebra/route.js +7 -7
  46. package/.next/server/app/api/error-items/[id]/geogebra/route.js.nft.json +1 -1
  47. package/.next/server/app/api/error-items/[id]/image/route.js +2 -2
  48. package/.next/server/app/api/error-items/[id]/image/route.js.nft.json +1 -1
  49. package/.next/server/app/api/error-items/[id]/notes/route.js +2 -2
  50. package/.next/server/app/api/error-items/[id]/notes/route.js.nft.json +1 -1
  51. package/.next/server/app/api/error-items/[id]/practice-records/route.js +2 -2
  52. package/.next/server/app/api/error-items/[id]/practice-records/route.js.nft.json +1 -1
  53. package/.next/server/app/api/error-items/[id]/reanswer/route.js +8 -8
  54. package/.next/server/app/api/error-items/[id]/reanswer/route.js.nft.json +1 -1
  55. package/.next/server/app/api/error-items/[id]/retag/route.js +6 -6
  56. package/.next/server/app/api/error-items/[id]/retag/route.js.nft.json +1 -1
  57. package/.next/server/app/api/error-items/[id]/route.js +1 -1
  58. package/.next/server/app/api/error-items/[id]/route.js.nft.json +1 -1
  59. package/.next/server/app/api/error-items/[id]/svg-animation/route.js +8 -8
  60. package/.next/server/app/api/error-items/[id]/svg-animation/route.js.nft.json +1 -1
  61. package/.next/server/app/api/error-items/batch-delete/route.js +2 -2
  62. package/.next/server/app/api/error-items/batch-delete/route.js.nft.json +1 -1
  63. package/.next/server/app/api/error-items/clear/route.js +2 -2
  64. package/.next/server/app/api/error-items/clear/route.js.nft.json +1 -1
  65. package/.next/server/app/api/error-items/list/route.js +4 -4
  66. package/.next/server/app/api/error-items/list/route.js.nft.json +1 -1
  67. package/.next/server/app/api/error-items/route.js +8 -8
  68. package/.next/server/app/api/error-items/route.js.nft.json +1 -1
  69. package/.next/server/app/api/error-items/short/[shortId]/route.js +1 -1
  70. package/.next/server/app/api/error-items/short/[shortId]/route.js.nft.json +1 -1
  71. package/.next/server/app/api/error-items/similarity/route.js +2 -2
  72. package/.next/server/app/api/error-items/similarity/route.js.nft.json +1 -1
  73. package/.next/server/app/api/exams/[id]/questions/[questionId]/regenerate/route.js +7 -7
  74. package/.next/server/app/api/exams/[id]/questions/[questionId]/regenerate/route.js.nft.json +1 -1
  75. package/.next/server/app/api/exams/[id]/results/route.js +6 -6
  76. package/.next/server/app/api/exams/[id]/results/route.js.nft.json +1 -1
  77. package/.next/server/app/api/exams/[id]/retry/route.js +7 -7
  78. package/.next/server/app/api/exams/[id]/retry/route.js.nft.json +1 -1
  79. package/.next/server/app/api/exams/[id]/route.js +7 -7
  80. package/.next/server/app/api/exams/[id]/route.js.nft.json +1 -1
  81. package/.next/server/app/api/exams/route.js +7 -7
  82. package/.next/server/app/api/exams/route.js.nft.json +1 -1
  83. package/.next/server/app/api/export/route.js +2 -2
  84. package/.next/server/app/api/export/route.js.nft.json +1 -1
  85. package/.next/server/app/api/geogebra-analyze/route.js +5 -5
  86. package/.next/server/app/api/geogebra-analyze/route.js.nft.json +1 -1
  87. package/.next/server/app/api/health/route.js.nft.json +1 -1
  88. package/.next/server/app/api/import/route.js +7 -7
  89. package/.next/server/app/api/import/route.js.nft.json +1 -1
  90. package/.next/server/app/api/logs/frontend/route.js +2 -2
  91. package/.next/server/app/api/logs/frontend/route.js.nft.json +1 -1
  92. package/.next/server/app/api/notebooks/[id]/retag/route.js +3 -3
  93. package/.next/server/app/api/notebooks/[id]/retag/route.js.nft.json +1 -1
  94. package/.next/server/app/api/notebooks/[id]/route.js +2 -2
  95. package/.next/server/app/api/notebooks/[id]/route.js.nft.json +1 -1
  96. package/.next/server/app/api/notebooks/route.js +1 -1
  97. package/.next/server/app/api/notebooks/route.js.nft.json +1 -1
  98. package/.next/server/app/api/openclaw/batch-upload/route.js +7 -7
  99. package/.next/server/app/api/openclaw/batch-upload/route.js.nft.json +1 -1
  100. package/.next/server/app/api/practice/generate/route.js +5 -5
  101. package/.next/server/app/api/practice/generate/route.js.nft.json +1 -1
  102. package/.next/server/app/api/practice/record/[id]/route.js +5 -5
  103. package/.next/server/app/api/practice/record/[id]/route.js.nft.json +1 -1
  104. package/.next/server/app/api/practice/record/route.js +7 -7
  105. package/.next/server/app/api/practice/record/route.js.nft.json +1 -1
  106. package/.next/server/app/api/reanswer/route.js +7 -7
  107. package/.next/server/app/api/reanswer/route.js.nft.json +1 -1
  108. package/.next/server/app/api/register/route.js.nft.json +1 -1
  109. package/.next/server/app/api/register/status/route.js.nft.json +1 -1
  110. package/.next/server/app/api/settings/route.js +3 -3
  111. package/.next/server/app/api/settings/route.js.nft.json +1 -1
  112. package/.next/server/app/api/stats/practice/clear/route.js +2 -2
  113. package/.next/server/app/api/stats/practice/clear/route.js.nft.json +1 -1
  114. package/.next/server/app/api/stats/practice/route.js +1 -1
  115. package/.next/server/app/api/stats/practice/route.js.nft.json +1 -1
  116. package/.next/server/app/api/tags/route.js +2 -2
  117. package/.next/server/app/api/tags/route.js.nft.json +1 -1
  118. package/.next/server/app/api/tags/stats/route.js +2 -2
  119. package/.next/server/app/api/tags/stats/route.js.nft.json +1 -1
  120. package/.next/server/app/api/tags/suggestions/route.js +1 -1
  121. package/.next/server/app/api/tags/suggestions/route.js.nft.json +1 -1
  122. package/.next/server/app/api/tasks/route.js +2 -2
  123. package/.next/server/app/api/tasks/route.js.nft.json +1 -1
  124. package/.next/server/app/api/user/route.js +2 -2
  125. package/.next/server/app/api/user/route.js.nft.json +1 -1
  126. package/.next/server/app/api/version/route.js.nft.json +1 -1
  127. package/.next/server/app/error-items/[id]/page.js.nft.json +1 -1
  128. package/.next/server/app/error-items/[id]/page_client-reference-manifest.js +1 -1
  129. package/.next/server/app/exams/[id]/page.js.nft.json +1 -1
  130. package/.next/server/app/exams/[id]/page_client-reference-manifest.js +1 -1
  131. package/.next/server/app/exams/[id]/print/page.js.nft.json +1 -1
  132. package/.next/server/app/exams/[id]/print/page_client-reference-manifest.js +1 -1
  133. package/.next/server/app/exams/page.js.nft.json +1 -1
  134. package/.next/server/app/exams/page_client-reference-manifest.js +1 -1
  135. package/.next/server/app/latex-test/page.js.nft.json +1 -1
  136. package/.next/server/app/latex-test/page_client-reference-manifest.js +1 -1
  137. package/.next/server/app/login/page.js.nft.json +1 -1
  138. package/.next/server/app/login/page_client-reference-manifest.js +1 -1
  139. package/.next/server/app/manifest.webmanifest/route.js.nft.json +1 -1
  140. package/.next/server/app/manifest.webmanifest.body +1 -1
  141. package/.next/server/app/notebooks/[id]/add/page.js.nft.json +1 -1
  142. package/.next/server/app/notebooks/[id]/add/page_client-reference-manifest.js +1 -1
  143. package/.next/server/app/notebooks/[id]/page.js.nft.json +1 -1
  144. package/.next/server/app/notebooks/[id]/page_client-reference-manifest.js +1 -1
  145. package/.next/server/app/notebooks/page.js.nft.json +1 -1
  146. package/.next/server/app/notebooks/page_client-reference-manifest.js +1 -1
  147. package/.next/server/app/page.js.nft.json +1 -1
  148. package/.next/server/app/page_client-reference-manifest.js +1 -1
  149. package/.next/server/app/practice/page.js.nft.json +1 -1
  150. package/.next/server/app/practice/page_client-reference-manifest.js +1 -1
  151. package/.next/server/app/print-preview/page.js.nft.json +1 -1
  152. package/.next/server/app/print-preview/page_client-reference-manifest.js +1 -1
  153. package/.next/server/app/register/page.js.nft.json +1 -1
  154. package/.next/server/app/register/page_client-reference-manifest.js +1 -1
  155. package/.next/server/app/stats/page.js.nft.json +1 -1
  156. package/.next/server/app/stats/page_client-reference-manifest.js +1 -1
  157. package/.next/server/app/tags/page.js.nft.json +1 -1
  158. package/.next/server/app/tags/page_client-reference-manifest.js +1 -1
  159. package/.next/server/app-paths-manifest.json +0 -1
  160. package/.next/server/chunks/{[externals]__1735khz._.js → [externals]__0jzwjtl._.js} +2 -2
  161. package/.next/server/chunks/{[root-of-the-server]__0be5c5r._.js → [root-of-the-server]__0-2l_pu._.js} +1 -1
  162. package/.next/server/chunks/{[root-of-the-server]__02j1w81._.js → [root-of-the-server]__00moo9h._.js} +1 -1
  163. package/.next/server/chunks/{[root-of-the-server]__03nfvnm._.js → [root-of-the-server]__012xcq-._.js} +1 -1
  164. package/.next/server/chunks/[root-of-the-server]__01bzczj._.js +1 -1
  165. package/.next/server/chunks/{[root-of-the-server]__0bqawi0._.js → [root-of-the-server]__02pqrw_._.js} +1 -1
  166. package/.next/server/chunks/{[root-of-the-server]__0nqbham._.js → [root-of-the-server]__033ri9p._.js} +1 -1
  167. package/.next/server/chunks/[root-of-the-server]__04pjde6._.js +3 -0
  168. package/.next/server/chunks/{[root-of-the-server]__1u-1vx4._.js → [root-of-the-server]__064krqp._.js} +2 -2
  169. package/.next/server/chunks/[root-of-the-server]__07iraov._.js +3 -0
  170. package/.next/server/chunks/{[root-of-the-server]__16begv4._.js → [root-of-the-server]__07q7nsp._.js} +2 -2
  171. package/.next/server/chunks/{[root-of-the-server]__0jaawra._.js → [root-of-the-server]__0_unb90._.js} +1 -1
  172. package/.next/server/chunks/{[root-of-the-server]__0gp88gz._.js → [root-of-the-server]__0a1zwxf._.js} +1 -1
  173. package/.next/server/chunks/{[root-of-the-server]__0k-nf6a._.js → [root-of-the-server]__0aefi10._.js} +2 -2
  174. package/.next/server/chunks/[root-of-the-server]__0cfjgye._.js +3 -0
  175. package/.next/server/chunks/{[root-of-the-server]__1hpwwxw._.js → [root-of-the-server]__0d-37yj._.js} +1 -1
  176. package/.next/server/chunks/[root-of-the-server]__0d2kpnm._.js +3 -0
  177. package/.next/server/chunks/{[root-of-the-server]__0k-p1pj._.js → [root-of-the-server]__0dqgi36._.js} +2 -2
  178. package/.next/server/chunks/{[root-of-the-server]__0mqorxb._.js → [root-of-the-server]__0dz5c04._.js} +2 -2
  179. package/.next/server/chunks/{[root-of-the-server]__0vhjihq._.js → [root-of-the-server]__0e_u82_._.js} +2 -2
  180. package/.next/server/chunks/{[root-of-the-server]__0obb4y-._.js → [root-of-the-server]__0f3jyg0._.js} +2 -2
  181. package/.next/server/chunks/{[root-of-the-server]__1413v0e._.js → [root-of-the-server]__0gwwa9b._.js} +1 -1
  182. package/.next/server/chunks/{[root-of-the-server]__0lrdm1u._.js → [root-of-the-server]__0hars8c._.js} +2 -2
  183. package/.next/server/chunks/{[root-of-the-server]__1h09r50._.js → [root-of-the-server]__0iozebm._.js} +2 -2
  184. package/.next/server/chunks/[root-of-the-server]__0k-5uu2._.js +3 -0
  185. package/.next/server/chunks/{[root-of-the-server]__1csfdxc._.js → [root-of-the-server]__0k3mm05._.js} +1 -1
  186. package/.next/server/chunks/[root-of-the-server]__0l-xu_t._.js +3 -0
  187. package/.next/server/chunks/{[root-of-the-server]__0inxsnu._.js → [root-of-the-server]__0lggrcf._.js} +1 -1
  188. package/.next/server/chunks/[root-of-the-server]__0m0eall._.js +3 -0
  189. package/.next/server/chunks/{[root-of-the-server]__06_nln5._.js → [root-of-the-server]__0m37xyb._.js} +2 -2
  190. package/.next/server/chunks/[root-of-the-server]__0m8p-6f._.js +1 -1
  191. package/.next/server/chunks/{[root-of-the-server]__1m4-ab6._.js → [root-of-the-server]__0pa47kn._.js} +1 -1
  192. package/.next/server/chunks/[root-of-the-server]__0r42_o7._.js +3 -0
  193. package/.next/server/chunks/[root-of-the-server]__0rgjh3q._.js +3 -0
  194. package/.next/server/chunks/[root-of-the-server]__0scij0p._.js +3 -0
  195. package/.next/server/chunks/[root-of-the-server]__0sixhu9._.js +3 -0
  196. package/.next/server/chunks/[root-of-the-server]__0sj18kk._.js +3 -0
  197. package/.next/server/chunks/[root-of-the-server]__0sp4_zo._.js +3 -0
  198. package/.next/server/chunks/[root-of-the-server]__0t2o8v-._.js +3 -0
  199. package/.next/server/chunks/{[root-of-the-server]__18zrkky._.js → [root-of-the-server]__0w58v6b._.js} +2 -2
  200. package/.next/server/chunks/[root-of-the-server]__0wp40ty._.js +3 -0
  201. package/.next/server/chunks/{[root-of-the-server]__0lro5a7._.js → [root-of-the-server]__0wsj4a_._.js} +2 -2
  202. package/.next/server/chunks/{[root-of-the-server]__0u58zap._.js → [root-of-the-server]__0wvvsah._.js} +1 -1
  203. package/.next/server/chunks/{[root-of-the-server]__1v6nwhq._.js → [root-of-the-server]__0xg5h56._.js} +2 -2
  204. package/.next/server/chunks/[root-of-the-server]__0zpazf3._.js +3 -0
  205. package/.next/server/chunks/{[root-of-the-server]__06h5afw._.js → [root-of-the-server]__10hs-qn._.js} +1 -1
  206. package/.next/server/chunks/{[root-of-the-server]__1j6mx-v._.js → [root-of-the-server]__119xork._.js} +2 -2
  207. package/.next/server/chunks/[root-of-the-server]__11_-ncy._.js +1 -1
  208. package/.next/server/chunks/[root-of-the-server]__11jhplo._.js +3 -0
  209. package/.next/server/chunks/[root-of-the-server]__122xu-0._.js +5 -5
  210. package/.next/server/chunks/{[root-of-the-server]__0fnyu4s._.js → [root-of-the-server]__15y1l96._.js} +2 -2
  211. package/.next/server/chunks/{[root-of-the-server]__1pplzr1._.js → [root-of-the-server]__16hnc6-._.js} +1 -1
  212. package/.next/server/chunks/[root-of-the-server]__17i9sje._.js +3 -0
  213. package/.next/server/chunks/{[root-of-the-server]__1aaux7e._.js → [root-of-the-server]__19_wn9u._.js} +2 -2
  214. package/.next/server/chunks/{[root-of-the-server]__1cn6rlb._.js → [root-of-the-server]__1_hp3ol._.js} +1 -1
  215. package/.next/server/chunks/[root-of-the-server]__1_ogacf._.js +3 -0
  216. package/.next/server/chunks/{[root-of-the-server]__1nwf3ua._.js → [root-of-the-server]__1a4-26x._.js} +2 -2
  217. package/.next/server/chunks/[root-of-the-server]__1b6i9mu._.js +3 -0
  218. package/.next/server/chunks/[root-of-the-server]__1b_y2wk._.js +3 -0
  219. package/.next/server/chunks/{[root-of-the-server]__1lct0vi._.js → [root-of-the-server]__1bl7t8i._.js} +2 -2
  220. package/.next/server/chunks/{[root-of-the-server]__1kqv61m._.js → [root-of-the-server]__1c0vatt._.js} +1 -1
  221. package/.next/server/chunks/[root-of-the-server]__1c7a0rs._.js +3 -0
  222. package/.next/server/chunks/[root-of-the-server]__1chx4lo._.js +3 -0
  223. package/.next/server/chunks/{[root-of-the-server]__1sdtn83._.js → [root-of-the-server]__1cngnud._.js} +1 -1
  224. package/.next/server/chunks/{[root-of-the-server]__19vj8qy._.js → [root-of-the-server]__1d82zkk._.js} +1 -1
  225. package/.next/server/chunks/[root-of-the-server]__1ezju_2._.js +3 -0
  226. package/.next/server/chunks/[root-of-the-server]__1fc23i5._.js +122 -0
  227. package/.next/server/chunks/[root-of-the-server]__1flnfu4._.js +3 -0
  228. package/.next/server/chunks/[root-of-the-server]__1gya7jq._.js +3 -0
  229. package/.next/server/chunks/[root-of-the-server]__1hng_h2._.js +3 -0
  230. package/.next/server/chunks/{[root-of-the-server]__1rsn804._.js → [root-of-the-server]__1i40psm._.js} +2 -2
  231. package/.next/server/chunks/[root-of-the-server]__1ijkds_._.js +3 -0
  232. package/.next/server/chunks/[root-of-the-server]__1j4v2e3._.js +3 -0
  233. package/.next/server/chunks/[root-of-the-server]__1kpo44g._.js +1 -1
  234. package/.next/server/chunks/{[root-of-the-server]__1oup682._.js → [root-of-the-server]__1lbcdia._.js} +1 -1
  235. package/.next/server/chunks/{[root-of-the-server]__1g1wi9i._.js → [root-of-the-server]__1m86czr._.js} +1 -1
  236. package/.next/server/chunks/{[root-of-the-server]__05s4wut._.js → [root-of-the-server]__1mnpqkx._.js} +1 -1
  237. package/.next/server/chunks/{[root-of-the-server]__1cceu4b._.js → [root-of-the-server]__1n4b6nb._.js} +2 -2
  238. package/.next/server/chunks/{[root-of-the-server]__0bsw5c9._.js → [root-of-the-server]__1nmrlew._.js} +2 -2
  239. package/.next/server/chunks/[root-of-the-server]__1o34kp3._.js +3 -0
  240. package/.next/server/chunks/{[root-of-the-server]__0c59gc3._.js → [root-of-the-server]__1q7yl7l._.js} +1 -1
  241. package/.next/server/chunks/{[root-of-the-server]__1gmc_uw._.js → [root-of-the-server]__1qv60vg._.js} +1 -1
  242. package/.next/server/chunks/{[root-of-the-server]__1mkpya8._.js → [root-of-the-server]__1ry8uat._.js} +2 -2
  243. package/.next/server/chunks/{[root-of-the-server]__1ezwxao._.js → [root-of-the-server]__1s2rww3._.js} +1 -1
  244. package/.next/server/chunks/[root-of-the-server]__1svvf40._.js +3 -0
  245. package/.next/server/chunks/[root-of-the-server]__1tk0-4v._.js +3 -0
  246. package/.next/server/chunks/[root-of-the-server]__1v-71me._.js +3 -0
  247. package/.next/server/chunks/[root-of-the-server]__1vw740y._.js +5 -5
  248. package/.next/server/chunks/[root-of-the-server]__1x_ud_-._.js +3 -0
  249. package/.next/server/chunks/[root-of-the-server]__1yt_xxr._.js +3 -0
  250. package/.next/server/chunks/_008zx49._.js +1 -1
  251. package/.next/server/chunks/_011-ll5._.js +1 -1
  252. package/.next/server/chunks/_0gxi3zr._.js +1 -1
  253. package/.next/server/chunks/_0lz3t4l._.js +12 -12
  254. package/.next/server/chunks/{_1e1h1f1._.js → _0n36ev0._.js} +1 -1
  255. package/.next/server/chunks/_0oc8oe4._.js +3 -0
  256. package/.next/server/chunks/_0rjzgi0._.js +3 -0
  257. package/.next/server/chunks/_10y361h._.js +3 -0
  258. package/.next/server/chunks/_14tz_k9._.js +1 -1
  259. package/.next/server/chunks/{_0c5hvv3._.js → _15neond._.js} +3 -3
  260. package/.next/server/chunks/_16jdov0._.js +1 -1
  261. package/.next/server/chunks/_1_ns7o3._.js +1 -1
  262. package/.next/server/chunks/_1a1aqmi._.js +1 -1
  263. package/.next/server/chunks/_1b7qjlv._.js +1 -1
  264. package/.next/server/chunks/_1m-yyz-._.js +1 -1
  265. package/.next/server/chunks/_1n1xsqj._.js +3 -0
  266. package/.next/server/chunks/_1z_ujac._.js +1 -1
  267. package/.next/server/chunks/{_0frix22._.js → _2194yr7._.js} +3 -3
  268. package/.next/server/chunks/src_0tzpy5j._.js +1 -1
  269. package/.next/server/chunks/src_lib_ai_prompts_ts_0z36zms._.js +12 -11
  270. package/.next/server/chunks/ssr/[root-of-the-server]__00gewu3._.js +1 -1
  271. package/.next/server/chunks/ssr/[root-of-the-server]__03psbtz._.js +3 -0
  272. package/.next/server/chunks/ssr/[root-of-the-server]__0hzktoi._.js +1 -1
  273. package/.next/server/chunks/ssr/[root-of-the-server]__0skyo1a._.js +3 -0
  274. package/.next/server/chunks/ssr/_07ls0n_._.js +1 -1
  275. package/.next/server/chunks/ssr/_0sf1gd9._.js +1 -1
  276. package/.next/server/chunks/ssr/_11ut-6_._.js +3 -0
  277. package/.next/server/chunks/ssr/{_12c20v5._.js → _1aot_70._.js} +1 -1
  278. package/.next/server/chunks/ssr/src_1gayunq._.js +1 -1
  279. package/.next/server/chunks/ssr/src_1o363ao._.js +1 -1
  280. package/.next/server/chunks/ssr/src_app_admin_page_tsx_0ublbd0._.js +1 -1
  281. package/.next/server/chunks/ssr/src_app_error-items_[id]_page_tsx_04xwwdm._.js +1 -1
  282. package/.next/server/chunks/ssr/src_app_notebooks_[id]_page_tsx_08njm-5._.js +1 -1
  283. package/.next/server/chunks/ssr/src_components_providers_tsx_09kw-mv._.js +1 -1
  284. package/.next/server/edge/chunks/node_modules_0g4gi6f._.js +1 -1
  285. package/.next/server/middleware-build-manifest.js +3 -3
  286. package/.next/server/middleware-manifest.json +7 -7
  287. package/.next/server/pages/500.html +1 -1
  288. package/.next/server/server-reference-manifest.js +1 -1
  289. package/.next/server/server-reference-manifest.json +1 -1
  290. package/.next/static/{w6W6dMBYlP4wbCdeRcVhA → Y0pwgmRdVAifh_zukihNt}/_clientMiddlewareManifest.js +2 -2
  291. package/.next/static/chunks/03gmdewlo3s6u.js +1 -0
  292. package/.next/static/chunks/06q8lm6y95ac4.css +1 -0
  293. package/.next/static/chunks/0ij2dqb0qj5ry.js +1 -0
  294. package/.next/static/chunks/{2rmhba08h4qqo.js → 0pwdmc9gw8ben.js} +1 -1
  295. package/.next/static/chunks/{35cov9g4cgt-v.js → 1c92up8k2x0z4.js} +1 -1
  296. package/.next/static/chunks/24dymggis4suf.css +3 -0
  297. package/.next/static/chunks/24jbwfpgmio7x.js +1 -0
  298. package/.next/static/chunks/27fr34_1v7xyh.js +1 -0
  299. package/.next/static/chunks/2eu_bls12m1wj.js +1 -0
  300. package/.next/static/chunks/{2yl8a-gxngbuq.js → 2x8e_fbze06sd.js} +1 -1
  301. package/.next/static/chunks/2z1_5umv36es6.js +191 -0
  302. package/.next/static/chunks/3m4c1r8_2ga_1.js +1 -0
  303. package/.next/static/chunks/{2s07soqug65hc.js → 3whzkc6d8oefw.js} +1 -1
  304. package/LICENSE +22 -0
  305. package/launcher.js +22 -6
  306. package/package.json +3 -2
  307. package/prisma/migrations/20261022000141_add_svg_animation_en/migration.sql +2 -0
  308. package/prisma/schema.prisma +2 -1
  309. package/prisma/seed.db +0 -0
  310. package/public/icons/apple-touch-icon.png +0 -0
  311. package/public/icons/icon-192.png +0 -0
  312. package/public/icons/icon-512.png +0 -0
  313. package/public/icons/icon-maskable-512.png +0 -0
  314. package/public/offline.html +61 -0
  315. package/public/sw.js +84 -0
  316. package/.next/server/app/api/error-items/[id]/mastery/route/app-paths-manifest.json +0 -3
  317. package/.next/server/app/api/error-items/[id]/mastery/route/build-manifest.json +0 -12
  318. package/.next/server/app/api/error-items/[id]/mastery/route/server-reference-manifest.json +0 -4
  319. package/.next/server/app/api/error-items/[id]/mastery/route.js +0 -8
  320. package/.next/server/app/api/error-items/[id]/mastery/route.js.map +0 -5
  321. package/.next/server/app/api/error-items/[id]/mastery/route.js.nft.json +0 -1
  322. package/.next/server/app/api/error-items/[id]/mastery/route_client-reference-manifest.js +0 -3
  323. package/.next/server/chunks/[root-of-the-server]__04tyyvs._.js +0 -3
  324. package/.next/server/chunks/[root-of-the-server]__0cmxmwt._.js +0 -3
  325. package/.next/server/chunks/[root-of-the-server]__0d5dpu4._.js +0 -3
  326. package/.next/server/chunks/[root-of-the-server]__0d9ijed._.js +0 -3
  327. package/.next/server/chunks/[root-of-the-server]__0e22a4y._.js +0 -122
  328. package/.next/server/chunks/[root-of-the-server]__0j5231l._.js +0 -3
  329. package/.next/server/chunks/[root-of-the-server]__0mfjf2y._.js +0 -3
  330. package/.next/server/chunks/[root-of-the-server]__0no6umu._.js +0 -3
  331. package/.next/server/chunks/[root-of-the-server]__0o9gtvd._.js +0 -3
  332. package/.next/server/chunks/[root-of-the-server]__0p3u6_q._.js +0 -3
  333. package/.next/server/chunks/[root-of-the-server]__0rmrkd_._.js +0 -3
  334. package/.next/server/chunks/[root-of-the-server]__0tdibjz._.js +0 -3
  335. package/.next/server/chunks/[root-of-the-server]__0vz88er._.js +0 -3
  336. package/.next/server/chunks/[root-of-the-server]__0wf9znr._.js +0 -3
  337. package/.next/server/chunks/[root-of-the-server]__0yc8r2x._.js +0 -3
  338. package/.next/server/chunks/[root-of-the-server]__0zv7jom._.js +0 -3
  339. package/.next/server/chunks/[root-of-the-server]__11_1z7m._.js +0 -3
  340. package/.next/server/chunks/[root-of-the-server]__11n87go._.js +0 -3
  341. package/.next/server/chunks/[root-of-the-server]__11p4ahb._.js +0 -3
  342. package/.next/server/chunks/[root-of-the-server]__131taws._.js +0 -3
  343. package/.next/server/chunks/[root-of-the-server]__13ebiit._.js +0 -3
  344. package/.next/server/chunks/[root-of-the-server]__14dnbrn._.js +0 -3
  345. package/.next/server/chunks/[root-of-the-server]__14jqm9_._.js +0 -3
  346. package/.next/server/chunks/[root-of-the-server]__152lbaw._.js +0 -3
  347. package/.next/server/chunks/[root-of-the-server]__17duis5._.js +0 -3
  348. package/.next/server/chunks/[root-of-the-server]__17q3k-v._.js +0 -3
  349. package/.next/server/chunks/[root-of-the-server]__184u6de._.js +0 -3
  350. package/.next/server/chunks/[root-of-the-server]__18atlj8._.js +0 -3
  351. package/.next/server/chunks/[root-of-the-server]__18c7l6u._.js +0 -3
  352. package/.next/server/chunks/[root-of-the-server]__1jdi-1f._.js +0 -3
  353. package/.next/server/chunks/[root-of-the-server]__1ju8z29._.js +0 -3
  354. package/.next/server/chunks/[root-of-the-server]__1loecue._.js +0 -3
  355. package/.next/server/chunks/[root-of-the-server]__1p8hw44._.js +0 -3
  356. package/.next/server/chunks/[root-of-the-server]__20465pr._.js +0 -3
  357. package/.next/server/chunks/[root-of-the-server]__207mxv8._.js +0 -3
  358. package/.next/server/chunks/_0_o8yhv._.js +0 -3
  359. package/.next/server/chunks/_0rdo0a4._.js +0 -3
  360. package/.next/server/chunks/_167vv93._.js +0 -3
  361. package/.next/server/chunks/_1flar98._.js +0 -3
  362. package/.next/server/chunks/_next-internal_server_app_api_error-items_[id]_mastery_route_actions_1l5uan6.js +0 -3
  363. package/.next/server/chunks/ssr/[root-of-the-server]__0b8kewv._.js +0 -3
  364. package/.next/server/chunks/ssr/[root-of-the-server]__0icjezr._.js +0 -3
  365. package/.next/server/chunks/ssr/_1gu1rou._.js +0 -3
  366. package/.next/static/chunks/00pn0o7lymln6.js +0 -1
  367. package/.next/static/chunks/02521degnqmf0.js +0 -1
  368. package/.next/static/chunks/130ch9mnvb6mp.css +0 -3
  369. package/.next/static/chunks/17wdtw8hml2n6.js +0 -191
  370. package/.next/static/chunks/2a0kgntckcbvf.js +0 -1
  371. package/.next/static/chunks/2h-exsnhkfnb8.js +0 -1
  372. package/.next/static/chunks/2wnnnmbh85mq_.js +0 -1
  373. package/.next/static/chunks/3c4-ozf1dxam2.css +0 -1
  374. package/.next/static/chunks/3hz1l3qoxv84t.js +0 -1
  375. /package/.next/static/{w6W6dMBYlP4wbCdeRcVhA → Y0pwgmRdVAifh_zukihNt}/_buildManifest.js +0 -0
  376. /package/.next/static/{w6W6dMBYlP4wbCdeRcVhA → Y0pwgmRdVAifh_zukihNt}/_ssgManifest.js +0 -0
@@ -188,6 +188,6 @@ ${aB}
188
188
  ${aB}
189
189
 
190
190
  {{grade_instruction}}
191
- {{provider_hints}}`;var aE=a.i(87654);let aF=(0,l.default)("info",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 16v-4",key:"1dtifu"}],["path",{d:"M12 8h.01",key:"e9boi3"}]]);function aG({name:a,description:c}){return(0,b.jsxs)("div",{className:"flex flex-col sm:flex-row sm:items-start gap-1 sm:gap-2 text-xs py-1",children:[(0,b.jsx)("code",{className:"bg-muted px-1.5 py-0.5 rounded font-mono text-primary shrink-0 w-fit",children:`{{${a}}}`}),(0,b.jsx)("span",{className:"text-muted-foreground",children:c})]})}function aH({config:a,onUpdate:d}){let{language:e,t:f}=(0,c.useLanguage)(),[g,h]=(0,q.useState)(""),[i,j]=(0,q.useState)("");(0,q.useEffect)(()=>{h(a.prompts?.analyze||aC),j(a.prompts?.similar||aD)},[a.prompts]);let k=async a=>{if(!await (0,ar.confirmDialog)(f.settings?.prompts?.resetConfirm||"Are you sure you want to reset to default?",{destructive:!0}))return;let b="analyze"===a?aC:aD;"analyze"===a?(h(b),d("analyze",b)):(j(b),d("similar",b))},l=(a,b)=>{"analyze"===a?(h(b),d("analyze",b)):(j(b),d("similar",b))},m=()=>(0,b.jsxs)("div",{className:"bg-amber-50 border border-amber-200 rounded-md p-3 flex items-start gap-3 text-amber-900 text-sm mb-4",children:[(0,b.jsx)(A,{className:"h-5 w-5 shrink-0 text-amber-600"}),(0,b.jsxs)("div",{className:"space-y-1",children:[(0,b.jsx)("p",{className:"font-medium",children:f.settings?.prompts?.caution||"Modify with Caution"}),(0,b.jsx)("p",{className:"text-amber-800/90 text-xs",children:f.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."})]})]});return(0,b.jsx)("div",{className:"space-y-4 border rounded-lg p-4 bg-muted/30",children:(0,b.jsxs)(w.Tabs,{defaultValue:"analyze",className:"w-full",children:[(0,b.jsxs)(w.TabsList,{className:"grid w-full grid-cols-2",children:[(0,b.jsx)(w.TabsTrigger,{value:"analyze",children:f.settings?.prompts?.analysisTab||"Analysis Prompt"}),(0,b.jsx)(w.TabsTrigger,{value:"similar",children:f.settings?.prompts?.similarTab||"Similar Question Prompt"})]}),(0,b.jsx)(w.TabsContent,{value:"analyze",className:"space-y-4 py-4",children:(0,b.jsxs)("div",{className:"space-y-4",children:[(0,b.jsxs)("div",{className:"flex justify-between items-center",children:[(0,b.jsx)(u.Label,{className:"text-base font-semibold",children:f.settings?.prompts?.customAnalysis||"Custom Analysis Template"}),(0,b.jsxs)(r.Button,{variant:"outline",size:"sm",onClick:()=>k("analyze"),children:[(0,b.jsx)(aE.RotateCcw,{className:"w-4 h-4 mr-2"}),f.settings?.prompts?.reset||"Reset Default"]})]}),(0,b.jsx)(m,{}),(0,b.jsxs)("div",{className:"space-y-2 border rounded-md p-3 bg-background",children:[(0,b.jsxs)("h4",{className:"text-xs font-medium flex items-center gap-1.5 mb-2",children:[(0,b.jsx)(aF,{className:"h-3.5 w-3.5"}),f.settings?.prompts?.variables||"Available Variables"]}),(0,b.jsxs)("div",{className:"space-y-1.5",children:[(0,b.jsx)(aG,{name:"language_instruction",description:f.settings?.prompts?.vars?.languageInstruction||"Injects instructions based on target language (e.g., keep English questions in English but analysis in Chinese)."}),(0,b.jsx)(aG,{name:"knowledge_points_list",description:f.settings?.prompts?.vars?.knowledgePointsList||"Injects the standard list of knowledge point tags for the specific subject."}),(0,b.jsx)(aG,{name:"provider_hints",description:f.settings?.prompts?.vars?.providerHints||"System-injected hints (e.g., enforcing JSON format)."})]})]}),(0,b.jsx)(ay.Textarea,{value:g,onChange:a=>l("analyze",a.target.value),className:"font-mono text-xs min-h-[400px]",placeholder:aC})]})}),(0,b.jsx)(w.TabsContent,{value:"similar",className:"space-y-4 py-4",children:(0,b.jsxs)("div",{className:"space-y-4",children:[(0,b.jsxs)("div",{className:"flex justify-between items-center",children:[(0,b.jsx)(u.Label,{className:"text-base font-semibold",children:f.settings?.prompts?.customSimilar||"Custom Similar Question Template"}),(0,b.jsxs)(r.Button,{variant:"outline",size:"sm",onClick:()=>k("similar"),children:[(0,b.jsx)(aE.RotateCcw,{className:"w-4 h-4 mr-2"}),f.settings?.prompts?.reset||"Reset Default"]})]}),(0,b.jsx)(m,{}),(0,b.jsxs)("div",{className:"space-y-2 border rounded-md p-3 bg-background",children:[(0,b.jsxs)("h4",{className:"text-xs font-medium flex items-center gap-1.5 mb-2",children:[(0,b.jsx)(aF,{className:"h-3.5 w-3.5"}),f.settings?.prompts?.variables||"Available Variables"]}),(0,b.jsxs)("div",{className:"space-y-1.5",children:[(0,b.jsx)(aG,{name:"difficulty_level",description:f.settings?.prompts?.vars?.difficultyLevel||"Target difficulty level."}),(0,b.jsx)(aG,{name:"difficulty_instruction",description:f.settings?.prompts?.vars?.difficultyInstruction||"Specific writing instructions for the target difficulty."}),(0,b.jsx)(aG,{name:"original_question",description:f.settings?.prompts?.vars?.originalQuestion||"The full text of the original question."}),(0,b.jsx)(aG,{name:"knowledge_points",description:f.settings?.prompts?.vars?.knowledgePoints||"List of knowledge points to test."}),(0,b.jsx)(aG,{name:"language_instruction",description:f.settings?.prompts?.vars?.languageInstructionShort||"Language formatting instructions."})]})]}),(0,b.jsx)(ay.Textarea,{value:i,onChange:a=>l("similar",a.target.value),className:"font-mono text-xs min-h-[400px]",placeholder:aD})]})})]})})}function aI({field:a,label:d,description:e}){let{t:f}=(0,c.useLanguage)(),[g,h]=(0,q.useState)(!1),[i,j]=(0,q.useState)(!1),[k,l]=(0,q.useState)(!1),[m,n]=(0,q.useState)(null),o=`preference-${a}`;(0,q.useEffect)(()=>{aq.apiClient.get("/api/user").then(b=>h(!!b[a])).catch(()=>void 0).finally(()=>j(!0))},[a]);let p=async b=>{h(b),l(!0);try{await aq.apiClient.patch("/api/user",{[a]:b}),n(f.importFlow.preferenceSaved)}catch(c){h(!b),n(f.importFlow.preferenceSaveFailed),at.frontendLogger.error("[Settings]","Failed to save user preference",{field:a,error:c instanceof Error?c.message:String(c)})}finally{l(!1)}};return(0,b.jsxs)("div",{className:"space-y-2 pt-4 border-t",children:[(0,b.jsxs)("div",{className:"flex items-center justify-between gap-4",children:[(0,b.jsx)(u.Label,{htmlFor:o,children:d}),(0,b.jsx)(ah,{id:o,checked:g,onCheckedChange:p,disabled:!i||k})]}),(0,b.jsx)("p",{className:"text-xs text-muted-foreground",children:e}),m&&(0,b.jsx)("p",{className:"text-xs text-muted-foreground",children:m})]})}function aJ(){let{t:a}=(0,c.useLanguage)();return(0,b.jsx)(aI,{field:"confirmBeforeImport",label:a.importFlow.confirmBeforeImport,description:a.importFlow.confirmBeforeImportDesc})}function aK(){let{t:a}=(0,c.useLanguage)();return(0,b.jsx)(aI,{field:"enableGeogebra",label:a.importFlow.enableGeogebra,description:a.importFlow.enableGeogebraDesc})}function aL(){let{t:a}=(0,c.useLanguage)();return(0,b.jsx)(aI,{field:"enableSvgAnimation",label:a.importFlow.enableSvgAnimation,description:a.importFlow.enableSvgAnimationDesc})}function aM({value:a,onChange:d}){let{t:e}=(0,c.useLanguage)(),[f,g]=(0,q.useState)(!1),h=(b,c)=>d({...a,[b]:c});return(0,b.jsxs)("div",{className:"space-y-3 animate-in fade-in slide-in-from-top-2",children:[(0,b.jsxs)("div",{className:"space-y-2",children:[(0,b.jsx)(u.Label,{children:"API Key"}),(0,b.jsxs)("div",{className:"relative",children:[(0,b.jsx)(t.Input,{type:f?"text":"password",value:a?.apiKey||"",onChange:a=>h("apiKey",a.target.value),placeholder:"sk-ant-...",className:"pr-10"}),(0,b.jsx)(r.Button,{type:"button",variant:"ghost",size:"icon",className:"absolute right-0 top-0 h-full px-3 py-2 hover:bg-transparent",onClick:()=>g(!f),"aria-label":f?"Hide API Key":"Show API Key",children:f?(0,b.jsx)(C.EyeOff,{className:"h-4 w-4 text-muted-foreground"}):(0,b.jsx)(B.Eye,{className:"h-4 w-4 text-muted-foreground"})})]})]}),(0,b.jsxs)("div",{className:"space-y-2",children:[(0,b.jsx)(u.Label,{children:"Base URL (Optional)"}),(0,b.jsx)(t.Input,{value:a?.baseUrl||"",onChange:a=>h("baseUrl",a.target.value),placeholder:"https://api.anthropic.com"}),(0,b.jsx)("p",{className:"text-xs text-muted-foreground",children:e.settings?.ai?.anthropicBaseUrlHint})]}),(0,b.jsx)(ax,{provider:"anthropic",apiKey:a?.apiKey,baseUrl:a?.baseUrl,currentModel:a?.model,onModelChange:a=>h("model",a)})]})}function aN({provider:a,value:d,onChange:e}){let{t:f}=(0,c.useLanguage)(),[g,h]=(0,q.useState)(!1),i=au[a],j=(a,b)=>e({...d,[a]:b});return(0,b.jsxs)("div",{className:"space-y-3 animate-in fade-in slide-in-from-top-2",children:[(0,b.jsxs)("div",{className:"space-y-2",children:[(0,b.jsx)(u.Label,{children:"API Key"}),(0,b.jsxs)("div",{className:"relative",children:[(0,b.jsx)(t.Input,{type:g?"text":"password",value:d?.apiKey||"",onChange:a=>j("apiKey",a.target.value),placeholder:"sk-...",className:"pr-10"}),(0,b.jsx)(r.Button,{type:"button",variant:"ghost",size:"icon",className:"absolute right-0 top-0 h-full px-3 py-2 hover:bg-transparent",onClick:()=>h(!g),"aria-label":g?"Hide API Key":"Show API Key",children:g?(0,b.jsx)(C.EyeOff,{className:"h-4 w-4 text-muted-foreground"}):(0,b.jsx)(B.Eye,{className:"h-4 w-4 text-muted-foreground"})})]}),(0,b.jsxs)("p",{className:"text-xs text-muted-foreground",children:[f.settings?.ai?.vendorApiKeyHint||"Get an API key from the console:"," ",(0,b.jsx)("a",{href:i.consoleUrl,target:"_blank",rel:"noopener noreferrer",className:"underline break-all",children:i.consoleUrl})]})]}),(0,b.jsxs)("div",{className:"space-y-2",children:[(0,b.jsx)(u.Label,{children:"Base URL (Optional)"}),(0,b.jsx)(t.Input,{value:d?.baseUrl||"",onChange:a=>j("baseUrl",a.target.value),placeholder:i.baseUrl}),(0,b.jsx)("p",{className:"text-xs text-muted-foreground",children:f.settings?.ai?.vendorBaseUrlHint})]}),(0,b.jsx)(ax,{provider:a,apiKey:d?.apiKey,baseUrl:d?.baseUrl,currentModel:d?.model||i.model,onModelChange:a=>j("model",a)})]})}var aO=a.i(42027);function aP({value:a,onChange:d,disabled:e}){let{t:f}=(0,c.useLanguage)();return(0,b.jsxs)("div",{className:"space-y-2 pt-4 border-t",children:[(0,b.jsx)(u.Label,{htmlFor:"app-time-zone",children:f.settings.general.timeZoneLabel}),(0,b.jsx)(t.Input,{id:"app-time-zone",value:a,onChange:a=>d(a.target.value),disabled:e,list:"app-time-zones",placeholder:"Asia/Shanghai"}),(0,b.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(a=>(0,b.jsx)("option",{value:a},a))}),(0,b.jsx)("p",{className:"text-xs text-muted-foreground",children:f.settings.general.timeZoneDesc})]})}let aQ=(0,l.default)("message-square-text",[["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"}]]),aR=(0,l.default)("external-link",[["path",{d:"M15 3h6v6",key:"1q9fwt"}],["path",{d:"M10 14 21 3",key:"gplh6r"}],["path",{d:"M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6",key:"a6xqqp"}]]),aS=(0,l.default)("github",[["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",key:"tonef"}],["path",{d:"M9 18c-4.51 2-5-2-7-2",key:"9comsn"}]]),aT=(0,l.default)("scroll-text",[["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"}]]);function aU(){let{timeZone:a,setTimeZone:f}=(0,e.useTimeZone)(),{data:g}=(0,d.useSession)(),j=g?.user?.role==="admin",{t:k,language:l,setLanguage:m}=(0,c.useLanguage)(),[n,p]=(0,q.useState)(!1),O=(0,q.useRef)(null),[P,Q]=(0,q.useState)(!1),[R,S]=(0,q.useState)(!1),[T,U]=(0,q.useState)(!1),[V,W]=(0,q.useState)(!1),[X,Y]=(0,q.useState)(!1),[Z,$]=(0,q.useState)(!1),[_,aa]=(0,q.useState)(""),[ab,ac]=(0,q.useState)(!1),[ad,ae]=(0,q.useState)({aiProvider:"minimax"}),[af,ag]=(0,q.useState)(void 0),[ah,ai]=(0,q.useState)(!1),[aj,ak]=(0,q.useState)(null),[al,am]=(0,q.useState)({name:"",email:"",educationStage:"",enrollmentYear:"",password:""}),[an,ao]=(0,q.useState)(""),[ap,ay]=(0,q.useState)(!1),[az,aA]=(0,q.useState)(!1),[aB,aC]=(0,q.useState)(!1),[aD,aE]=(0,q.useState)(!1),[aG,aI]=(0,q.useState)(!1),[aU,aV]=(0,q.useState)(!1),[aW,aX]=(0,q.useState)(null),[aY,aZ]=(0,q.useState)(""),a$=(0,h.useRouter)();(0,q.useEffect)(()=>{n&&(a_(),a0()),fetch("/api/version").then(a=>a.json()).then(a=>aa(a.version)).catch(()=>{})},[n]);let a_=async()=>{$(!0);try{let a=await aq.apiClient.get("/api/settings");ae(a)}catch(a){at.frontendLogger.error("[SettingsDialog]","Failed to fetch settings",{error:a instanceof Error?a.message:String(a)})}finally{$(!1)}},a0=async()=>{ay(!0);try{let a=await aq.apiClient.get("/api/user");am({name:a.name||"",email:a.email||"",educationStage:a.educationStage||"",enrollmentYear:a.enrollmentYear||"",password:""})}catch(a){at.frontendLogger.error("[SettingsDialog]","Failed to fetch profile",{error:a instanceof Error?a.message:String(a)})}finally{ay(!1)}},a1=async()=>{if(!(0,N.isValidTimeZone)(ad.timeZone??N.DEFAULT_TIME_ZONE))return void ar.toast.error(k.settings.general.invalidTimeZone);let a=(()=>{if("openai"!==ad.aiProvider)return null;for(let a of ad.openai?.instances||[]){if(!a.name?.trim())return k.settings?.ai?.validationNameRequired||"实例名称不能为空";if(!a.apiKey?.trim())return k.settings?.ai?.validationApiKeyRequired||"API Key 不能为空";if(!a.baseUrl?.trim())return k.settings?.ai?.validationBaseUrlRequired||"Base URL 不能为空";if(!a.model?.trim())return k.settings?.ai?.validationModelRequired||"模型名称不能为空"}return null})();if(a)return void ar.toast.error(a);let b="azure"!==ad.aiProvider?null:ad.azure?.endpoint?.trim()?ad.azure?.deploymentName?.trim()?ad.azure?.apiKey?.trim()?null:k.settings?.ai?.validationApiKeyRequired||"API Key is required":k.settings?.ai?.validationAzureDeploymentRequired||"Deployment Name is required":k.settings?.ai?.validationAzureEndpointRequired||"Azure Endpoint is required";if(b)return void ar.toast.error(b);Y(!0);try{let a=await aq.apiClient.post("/api/settings",ad);ae(a),f(a.timeZone||N.DEFAULT_TIME_ZONE),ar.toast.success(k.settings?.messages?.saved||"Settings saved"),O.current?.scrollTo({top:0,behavior:"smooth"})}catch(a){at.frontendLogger.error("[SettingsDialog]","Failed to save settings",{error:a instanceof Error?a.message:String(a)}),ar.toast.error(k.settings?.messages?.saveFailed||"Failed to save")}finally{Y(!1)}},a2=async()=>{aA(!0);try{if(al.password&&al.password!==an){ar.toast.error(k.settings?.messages?.passwordMismatch||"Passwords do not match"),aA(!1);return}let a={name:al.name,email:al.email,educationStage:al.educationStage};al.enrollmentYear&&(a.enrollmentYear=parseInt(al.enrollmentYear.toString())),al.password&&(a.password=al.password),await aq.apiClient.patch("/api/user",a),ar.toast.success(k.settings?.messages?.profileUpdated||"Profile updated"),am(a=>({...a,password:""})),ao(""),aC(!1),aE(!1),window.location.reload()}catch(b){at.frontendLogger.error("[SettingsDialog]","Failed to update profile",{error:b?.data?.message||b?.message||String(b)});let a=b.data?.message||k.settings?.messages?.updateFailed||"Update failed";ar.toast.error(a)}finally{aA(!1)}},a3=async()=>{if(await (0,ar.confirmDialog)(k.settings?.clearDataConfirm||"Are you sure?",{destructive:!0})){Q(!0);try{await aq.apiClient.delete("/api/stats/practice/clear"),ar.toast.success(k.settings?.clearSuccess||"Success"),p(!1),window.location.reload()}catch(a){at.frontendLogger.error("[SettingsDialog]","Failed to clear practice data",{error:a instanceof Error?a.message:String(a)}),ar.toast.error(k.settings?.clearError||"Failed")}finally{Q(!1)}}},a4=async()=>{if(await (0,ar.confirmDialog)(k.settings?.clearErrorDataConfirm||"Are you sure?",{destructive:!0})){S(!0);try{await aq.apiClient.delete("/api/error-items/clear"),ar.toast.success(k.settings?.clearSuccess||"Success"),p(!1),window.location.reload()}catch(a){at.frontendLogger.error("[SettingsDialog]","Failed to clear error data",{error:a instanceof Error?a.message:String(a)}),ar.toast.error(k.settings?.clearError||"Failed")}finally{S(!1)}}},a5=async()=>{if(!await (0,ar.confirmDialog)(k.settings?.systemResetConfirm||"WARNING: Deleting ALL data. Undoing is impossible. Are you sure?",{destructive:!0}))return;let a=prompt(k.settings?.systemResetPrompt||"Type 'RESET' to confirm system initialization:","");if("RESET"!==a){null!==a&&ar.toast.error(k.common?.error||"Confirmation failed");return}U(!0);try{await aq.apiClient.post("/api/admin/system-reset",{}),ar.toast.success(k.settings?.clearSuccess||"Success - System Reset Complete"),p(!1),window.location.reload()}catch(a){at.frontendLogger.error("[SettingsDialog]","System reset failed",{error:a instanceof Error?a.message:String(a)}),ar.toast.error(k.settings?.clearError||"Failed to reset system")}finally{U(!1)}},a6=async()=>{aI(!0);try{let a=await fetch("/api/export");if(!a.ok)throw Error("Export failed");let b=await a.blob(),c=window.URL.createObjectURL(b),d=document.createElement("a");d.href=c;let e=a.headers.get("Content-Disposition"),f=e?.match(/filename="(.+)"/);d.download=f?f[1]:"wrong-notebook-export.json",document.body.appendChild(d),d.click(),document.body.removeChild(d),window.URL.revokeObjectURL(c),ar.toast.success(k.settings?.exportSuccess||"Export successful")}catch(a){at.frontendLogger.error("[SettingsDialog]","Export failed",{error:a instanceof Error?a.message:String(a)}),ar.toast.error(k.settings?.exportFailed||"Export failed")}finally{aI(!1)}},a7=async()=>{if(await (0,ar.confirmDialog)(k.settings?.exportAllConfirm||"Export all users' data? This may take a while.")){aI(!0);try{let a=await fetch("/api/export?all=true");if(!a.ok){let b=await a.json();throw Error(b.message||"Export failed")}let b=await a.blob(),c=window.URL.createObjectURL(b),d=document.createElement("a");d.href=c;let e=a.headers.get("Content-Disposition"),f=e?.match(/filename="(.+)"/);d.download=f?f[1]:"wrong-notebook-export-all.json",document.body.appendChild(d),d.click(),document.body.removeChild(d),window.URL.revokeObjectURL(c),ar.toast.success(k.settings?.exportSuccess||"Export successful")}catch(a){at.frontendLogger.error("[SettingsDialog]","Export all failed",{error:a instanceof Error?a.message:String(a)}),ar.toast.error(k.settings?.exportFailed||"Export failed")}finally{aI(!1)}}},a8=async()=>{if(aW&&await (0,ar.confirmDialog)(k.settings?.importConfirm||"Are you sure you want to import?")){aV(!0);try{let a=await aW.text(),b=JSON.parse(a),c=(await aq.apiClient.post("/api/import",b)).stats;ar.toast.success((k.settings?.importResultDesc||"Imported {subjects} notebooks, {tags} tags, {items} error items, {schedules} review schedules, {records} practice records.").replace("{subjects}",String(c.subjectsCreated)).replace("{tags}",String(c.tagsCreated)).replace("{items}",String(c.errorItemsCreated)).replace("{schedules}",String(c.reviewSchedulesCreated)).replace("{records}",String(c.practiceRecordsCreated)).replace("{duplicates}",String(c.duplicateErrorItems??0))),aX(null),aZ(""),window.location.reload()}catch(a){at.frontendLogger.error("[SettingsDialog]","Import failed",{error:a instanceof Error?a.message:String(a)}),ar.toast.error(k.settings?.importFailed||"Import failed")}finally{aV(!1)}}},a9=async()=>{if(aW&&await (0,ar.confirmDialog)(k.settings?.importAllConfirm||"Import all users' data? This will restore data for all users from the export file.")){aV(!0);try{let a=await aW.text(),b=JSON.parse(a),c=await fetch("/api/import?all=true",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(b)}),d=await c.json();if(d.success){let a=d.stats;ar.toast.success((k.settings?.importResultDesc||"Imported {subjects} notebooks, {tags} tags, {items} error items, {schedules} review schedules, {records} practice records.").replace("{subjects}",String(a.subjectsCreated)).replace("{tags}",String(a.tagsCreated)).replace("{items}",String(a.errorItemsCreated)).replace("{schedules}",String(a.reviewSchedulesCreated)).replace("{records}",String(a.practiceRecordsCreated)).replace("{duplicates}",String(a.duplicateErrorItems??0))),aX(null),aZ(""),window.location.reload()}else throw Error(d.message||"Import failed")}catch(a){at.frontendLogger.error("[SettingsDialog]","Import all failed",{error:a instanceof Error?a.message:String(a)}),ar.toast.error(k.settings?.importFailed||"Import failed")}finally{aV(!1)}}},ba=async()=>{if(await (0,ar.confirmDialog)(k.settings?.migrateTagsConfirm||"This will reset system tags. Confirm?",{destructive:!0})){W(!0);try{let a=await aq.apiClient.post("/api/admin/migrate-tags",{});ar.toast.success(`${k.settings?.clearSuccess||"Success"}: ${a.count||0} tags migrated.`)}catch(a){at.frontendLogger.error("[SettingsDialog]","Tag migration failed",{error:a instanceof Error?a.message:String(a)}),ar.toast.error(k.settings?.clearError||"Failed to migrate tags")}finally{W(!1)}}},bb=(a,b,c)=>{"gemini"===a&&ae(a=>({...a,gemini:{...a.gemini,[b]:c}}))},bc=()=>{let a=ad.openai?.instances||[],b=af||ad.openai?.activeInstanceId;return a.find(a=>a.id===b)},bd=(a,b)=>{let c=ad.openai?.instances||[],d=af||ad.openai?.activeInstanceId,e=c.map(c=>c.id===d?{...c,[a]:b}:c);ae(a=>({...a,openai:{...a.openai,instances:e}}))};(0,q.useEffect)(()=>{ad.openai?.activeInstanceId&&!af&&ag(ad.openai.activeInstanceId)},[ad.openai?.activeInstanceId,af]);let be=async()=>{ai(!0),ak(null);try{let a;if("openai"===ad.aiProvider){let b=bc();if(!b?.apiKey){ak({success:!1,textSupport:!1,visionSupport:!1,textError:k.settings?.ai?.validationApiKeyRequired||"API Key is required"}),ai(!1);return}a={provider:"openai",apiKey:b.apiKey,baseUrl:b.baseUrl,model:b.model,language:l}}else if("gemini"===ad.aiProvider){if(!ad.gemini?.apiKey){ak({success:!1,textSupport:!1,visionSupport:!1,textError:k.settings?.ai?.validationApiKeyRequired||"API Key is required"}),ai(!1);return}a={provider:"gemini",apiKey:ad.gemini.apiKey,baseUrl:ad.gemini.baseUrl,model:ad.gemini.model,language:l}}else if("anthropic"===ad.aiProvider){if(!ad.anthropic?.apiKey){ak({success:!1,textSupport:!1,visionSupport:!1,textError:k.settings?.ai?.validationApiKeyRequired||"API Key is required"}),ai(!1);return}a={provider:"anthropic",apiKey:ad.anthropic.apiKey,baseUrl:ad.anthropic.baseUrl,model:ad.anthropic.model,language:l}}else if(aw(ad.aiProvider)){let b=ad[ad.aiProvider];if(!b?.apiKey){ak({success:!1,textSupport:!1,visionSupport:!1,textError:k.settings?.ai?.validationApiKeyRequired||"API Key is required"}),ai(!1);return}a={provider:ad.aiProvider,apiKey:b.apiKey,baseUrl:b.baseUrl,model:b.model,language:l}}else{if("azure"!==ad.aiProvider)return void ai(!1);if(!ad.azure?.apiKey||!ad.azure?.endpoint||!ad.azure?.deploymentName){ak({success:!1,textSupport:!1,visionSupport:!1,textError:k.settings?.ai?.validationAzureEndpointRequired||"Azure config is incomplete"}),ai(!1);return}a={provider:"azure",apiKey:ad.azure.apiKey,endpoint:ad.azure.endpoint,deploymentName:ad.azure.deploymentName,apiVersion:ad.azure.apiVersion,model:ad.azure.model,language:l}}let b=await aq.apiClient.post("/api/ai/test",a);ak(b)}catch(a){at.frontendLogger.error("[SettingsDialog]","AI connection test failed",{error:a instanceof Error?a.message:String(a)}),ak({success:!1,textSupport:!1,visionSupport:!1,textError:a instanceof Error?a.message:String(a)})}finally{ai(!1)}};return(0,b.jsxs)(s.Dialog,{open:n,onOpenChange:p,children:[(0,b.jsx)(s.DialogTrigger,{asChild:!0,children:(0,b.jsxs)(r.Button,{variant:"ghost",size:"icon",className:"rounded-full",children:[(0,b.jsx)(x,{className:"h-5 w-5"}),(0,b.jsx)("span",{className:"sr-only",children:k.settings?.title||"Settings"})]})}),(0,b.jsxs)(s.DialogContent,{ref:O,className:"w-[calc(100vw-2rem)] sm:max-w-[900px] max-h-[85vh] overflow-y-auto",children:[(0,b.jsxs)(s.DialogHeader,{children:[(0,b.jsx)(s.DialogTitle,{children:k.settings?.title||"Settings"}),(0,b.jsx)(s.DialogDescription,{children:k.settings?.desc||"Manage your preferences and data."})]}),(0,b.jsxs)(w.Tabs,{defaultValue:"general",className:"w-full",children:[(0,b.jsxs)(w.TabsList,{className:`grid w-full grid-cols-4 ${g?.user?.role==="admin"?"sm:grid-cols-7":"sm:grid-cols-4"} gap-1 h-auto`,children:[(0,b.jsxs)(w.TabsTrigger,{value:"general",className:"px-2 sm:px-3",children:[(0,b.jsx)(D.Languages,{className:"h-4 w-4 sm:mr-2"}),(0,b.jsx)("span",{className:"hidden sm:inline",children:k.settings?.tabs?.general||"General"})]}),(0,b.jsxs)(w.TabsTrigger,{value:"account",className:"px-2 sm:px-3",children:[(0,b.jsx)(E.User,{className:"h-4 w-4 sm:mr-2"}),(0,b.jsx)("span",{className:"hidden sm:inline",children:k.settings?.tabs?.account||"Account"})]}),g?.user?.role==="admin"&&(0,b.jsxs)(b.Fragment,{children:[(0,b.jsxs)(w.TabsTrigger,{value:"ai",className:"px-2 sm:px-3",children:[(0,b.jsx)(F,{className:"h-4 w-4 sm:mr-2"}),(0,b.jsx)("span",{className:"hidden sm:inline",children:k.settings?.tabs?.ai||"AI Provider"})]}),(0,b.jsxs)(w.TabsTrigger,{value:"prompts",className:"px-2 sm:px-3",children:[(0,b.jsx)(aQ,{className:"h-4 w-4 sm:mr-2"}),(0,b.jsx)("span",{className:"hidden sm:inline",children:k.settings?.tabs?.prompts||"Prompts"})]}),(0,b.jsxs)(w.TabsTrigger,{value:"admin",className:"px-2 sm:px-3",children:[(0,b.jsx)(o,{className:"h-4 w-4 sm:mr-2"}),(0,b.jsx)("span",{className:"hidden sm:inline",children:k.settings?.tabs?.admin||"User Management"})]})]}),(0,b.jsxs)(w.TabsTrigger,{value:"danger",className:"px-2 sm:px-3",children:[(0,b.jsx)(A,{className:"h-4 w-4 sm:mr-2"}),(0,b.jsx)("span",{className:"hidden sm:inline",children:k.settings?.tabs?.danger||"Danger"})]}),(0,b.jsxs)(w.TabsTrigger,{value:"about",className:"px-2 sm:px-3",children:[(0,b.jsx)(aF,{className:"h-4 w-4 sm:mr-2"}),(0,b.jsx)("span",{className:"hidden sm:inline",children:k.settings?.tabs?.about||"About"})]})]}),(0,b.jsxs)(w.TabsContent,{value:"general",className:"space-y-4 py-4",children:[(0,b.jsxs)("div",{className:"space-y-4 border rounded-lg p-4 bg-muted/30",children:[(0,b.jsxs)("div",{className:"space-y-2",children:[(0,b.jsx)(u.Label,{children:k.settings?.language||"Language"}),(0,b.jsxs)(v.Select,{value:l,onValueChange:a=>m(a),children:[(0,b.jsx)(v.SelectTrigger,{children:(0,b.jsx)(v.SelectValue,{})}),(0,b.jsxs)(v.SelectContent,{children:[(0,b.jsx)(v.SelectItem,{value:"zh",children:"中文 (Chinese)"}),(0,b.jsx)(v.SelectItem,{value:"en",children:"English"})]})]})]}),(0,b.jsx)(aP,{value:ad.timeZone??a,onChange:a=>ae(b=>({...b,timeZone:a})),disabled:!j||Z||X}),j&&(0,b.jsxs)("div",{className:"space-y-2 pt-4 border-t",children:[(0,b.jsx)(u.Label,{children:k.settings?.general?.timeoutLabel||"AI Analysis Timeout (Seconds)"}),(0,b.jsx)(t.Input,{type:"number",value:ad.timeouts?.analyze?ad.timeouts.analyze/1e3:"",onChange:a=>{let b=""===a.target.value?0:parseInt(a.target.value);ae(a=>({...a,timeouts:{...a.timeouts,analyze:isNaN(b)?0:1e3*b}}))},onBlur:()=>{let a=(ad.timeouts?.analyze||0)/1e3,b=a;b<120&&(b=120),b>600&&(b=600),b!==a&&ae(a=>({...a,timeouts:{...a.timeouts,analyze:1e3*b}}))},min:120,max:600}),(0,b.jsx)("p",{className:"text-xs text-muted-foreground",children:k.settings?.general?.timeoutDesc||"Increase this value if you experience frequent timeouts during AI analysis."})]}),(0,b.jsx)(aJ,{}),(0,b.jsx)(aL,{}),(0,b.jsx)(aK,{}),(0,b.jsx)(aO.DuplicateThresholdSetting,{})]}),j&&(0,b.jsxs)(r.Button,{onClick:a1,disabled:X,className:"w-full",children:[X&&(0,b.jsx)(z.Loader2,{className:"mr-2 h-4 w-4 animate-spin"}),k.settings?.save||"Save Settings"]})]}),(0,b.jsx)(w.TabsContent,{value:"account",className:"space-y-4 py-4",children:ap?(0,b.jsx)("div",{className:"flex justify-center py-8",children:(0,b.jsx)(z.Loader2,{className:"h-8 w-8 animate-spin text-muted-foreground"})}):(0,b.jsxs)("div",{className:"space-y-4 border rounded-lg p-4 bg-muted/30",children:[(0,b.jsxs)("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-4",children:[(0,b.jsxs)("div",{className:"space-y-2",children:[(0,b.jsx)(u.Label,{children:k.auth?.name||"Name"}),(0,b.jsx)(t.Input,{value:al.name||"",onChange:a=>am({...al,name:a.target.value})})]}),(0,b.jsxs)("div",{className:"space-y-2",children:[(0,b.jsx)(u.Label,{children:k.auth?.email||"Email"}),(0,b.jsx)(t.Input,{value:al.email||"",onChange:a=>am({...al,email:a.target.value}),type:"email"})]})]}),(0,b.jsxs)("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-4",children:[(0,b.jsxs)("div",{className:"space-y-2",children:[(0,b.jsx)(u.Label,{children:k.auth?.educationStage||"Education Stage"}),(0,b.jsxs)(v.Select,{value:al.educationStage||"",onValueChange:a=>am({...al,educationStage:a}),children:[(0,b.jsx)(v.SelectTrigger,{children:(0,b.jsx)(v.SelectValue,{placeholder:k.auth?.selectStage||"Select Stage"})}),(0,b.jsxs)(v.SelectContent,{children:[(0,b.jsx)(v.SelectItem,{value:"primary",children:k.auth?.primary||"Primary School"}),(0,b.jsx)(v.SelectItem,{value:"junior_high",children:k.auth?.juniorHigh||"Junior High"}),(0,b.jsx)(v.SelectItem,{value:"senior_high",children:k.auth?.seniorHigh||"Senior High"}),(0,b.jsx)(v.SelectItem,{value:"university",children:k.auth?.university||"University"})]})]})]}),(0,b.jsxs)("div",{className:"space-y-2",children:[(0,b.jsx)(u.Label,{children:k.auth?.enrollmentYear||"Enrollment Year"}),(0,b.jsx)(t.Input,{type:"number",value:al.enrollmentYear||"",onChange:a=>am({...al,enrollmentYear:a.target.value}),placeholder:"YYYY"})]})]}),(0,b.jsxs)("div",{className:"space-y-3 pt-2 border-t",children:[(0,b.jsxs)("div",{className:"space-y-2",children:[(0,b.jsx)(u.Label,{children:k.settings?.account?.changePassword||"Change Password (Leave empty to keep)"}),(0,b.jsxs)("div",{className:"relative",children:[(0,b.jsx)(t.Input,{type:aB?"text":"password",value:al.password,onChange:a=>am({...al,password:a.target.value}),placeholder:"******",minLength:6,className:"pr-10"}),(0,b.jsx)(r.Button,{type:"button",variant:"ghost",size:"icon",className:"absolute right-0 top-0 h-full px-3 py-2 hover:bg-transparent",onClick:()=>aC(!aB),tabIndex:-1,children:aB?(0,b.jsx)(C.EyeOff,{className:"h-4 w-4 text-muted-foreground"}):(0,b.jsx)(B.Eye,{className:"h-4 w-4 text-muted-foreground"})})]})]}),al.password&&(0,b.jsxs)("div",{className:"space-y-2",children:[(0,b.jsx)(u.Label,{children:k.auth?.confirmPassword||"Confirm Password"}),(0,b.jsxs)("div",{className:"relative",children:[(0,b.jsx)(t.Input,{type:aD?"text":"password",value:an,onChange:a=>ao(a.target.value),placeholder:"******",minLength:6,className:"pr-10"}),(0,b.jsx)(r.Button,{type:"button",variant:"ghost",size:"icon",className:"absolute right-0 top-0 h-full px-3 py-2 hover:bg-transparent",onClick:()=>aE(!aD),tabIndex:-1,children:aD?(0,b.jsx)(C.EyeOff,{className:"h-4 w-4 text-muted-foreground"}):(0,b.jsx)(B.Eye,{className:"h-4 w-4 text-muted-foreground"})})]})]})]}),(0,b.jsxs)(r.Button,{onClick:a2,disabled:az,className:"w-full",children:[az&&(0,b.jsx)(z.Loader2,{className:"mr-2 h-4 w-4 animate-spin"}),k.settings?.account?.update||"Update Profile"]})]})}),(0,b.jsx)(w.TabsContent,{value:"ai",className:"space-y-4 py-4",children:Z?(0,b.jsx)("div",{className:"flex justify-center py-4",children:(0,b.jsx)(z.Loader2,{className:"h-6 w-6 animate-spin text-muted-foreground"})}):(0,b.jsxs)("div",{className:"space-y-4 border rounded-lg p-4 bg-muted/30",children:[(0,b.jsxs)("div",{className:"space-y-2",children:[(0,b.jsx)(u.Label,{children:k.settings?.tabs?.ai||"AI Provider"}),(0,b.jsxs)(v.Select,{value:ad.aiProvider,onValueChange:a=>ae(b=>({...b,aiProvider:a})),children:[(0,b.jsx)(v.SelectTrigger,{children:(0,b.jsx)(v.SelectValue,{})}),(0,b.jsxs)(v.SelectContent,{children:[av.map(a=>(0,b.jsx)(v.SelectItem,{value:a,children:au[a].name},a)),(0,b.jsx)(v.SelectItem,{value:"anthropic",children:"Anthropic / Compatible"}),(0,b.jsx)(v.SelectItem,{value:"azure",children:"Azure OpenAI"}),(0,b.jsx)(v.SelectItem,{value:"openai",children:"OpenAI / Compatible"}),(0,b.jsx)(v.SelectItem,{value:"gemini",children:"Google Gemini"})]})]})]}),"openai"===ad.aiProvider&&(0,b.jsxs)("div",{className:"space-y-3 animate-in fade-in slide-in-from-top-2",children:[(0,b.jsxs)("div",{className:"space-y-2",children:[(0,b.jsxs)("div",{className:"flex items-center justify-between",children:[(0,b.jsx)(u.Label,{children:k.settings?.ai?.instances||"Instance"}),(0,b.jsxs)(r.Button,{type:"button",variant:"outline",size:"sm",onClick:()=>{let a=ad.openai?.instances||[];if(a.length>=10)return;let b={id:"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,a=>{let b=16*Math.random()|0;return("x"===a?b:3&b|8).toString(16)}),name:`Instance ${a.length+1}`,apiKey:"",baseUrl:"https://api.openai.com/v1",model:"gpt-6.1-sol"};ae(a=>({...a,openai:{instances:[...a.openai?.instances||[],b],activeInstanceId:b.id}})),ag(b.id)},disabled:(ad.openai?.instances?.length||0)>=10,className:"h-7 px-2 text-xs",children:[(0,b.jsx)(H.Plus,{className:"h-3 w-3 mr-1"}),k.settings?.ai?.addInstance||"Add"]})]}),(ad.openai?.instances?.length||0)>0?(0,b.jsxs)("div",{className:"flex gap-2",children:[(0,b.jsxs)(v.Select,{value:af||ad.openai?.activeInstanceId||"",onValueChange:a=>{ag(a),ae(b=>({...b,openai:{...b.openai,activeInstanceId:a}}))},children:[(0,b.jsx)(v.SelectTrigger,{className:"flex-1",children:(0,b.jsx)(v.SelectValue,{placeholder:k.settings?.ai?.selectInstance||"Select Instance"})}),(0,b.jsx)(v.SelectContent,{children:(ad.openai?.instances||[]).map(a=>(0,b.jsx)(v.SelectItem,{value:a.id,children:a.name},a.id))})]}),(ad.openai?.instances?.length||0)>1&&(0,b.jsx)(r.Button,{type:"button",variant:"outline",size:"icon",onClick:async()=>{let a,b,c=af||ad.openai?.activeInstanceId;c&&await (0,ar.confirmDialog)(k.settings?.ai?.confirmDelete||"Delete this instance?",{destructive:!0})&&(b=(a=(ad.openai?.instances||[]).filter(a=>a.id!==c)).length>0?a[0].id:void 0,ae(c=>({...c,openai:{instances:a,activeInstanceId:b}})),ag(b))},className:"h-10 w-10 text-destructive hover:text-destructive",children:(0,b.jsx)(y.Trash2,{className:"h-4 w-4"})})]}):(0,b.jsx)("p",{className:"text-sm text-muted-foreground",children:k.settings?.ai?.noInstances||"No instances configured. Click 'Add' to create one."}),(ad.openai?.instances?.length||0)>=10&&(0,b.jsx)("p",{className:"text-xs text-amber-600",children:k.settings?.ai?.maxInstancesReached||"Maximum instances reached (10)"})]}),bc()&&(0,b.jsxs)("div",{className:"space-y-3 p-3 border rounded-md bg-background",children:[(0,b.jsxs)("div",{className:"space-y-2",children:[(0,b.jsxs)(u.Label,{children:[k.settings?.ai?.instanceName||"Instance Name"," ",(0,b.jsx)("span",{className:"text-destructive",children:"*"})]}),(0,b.jsx)(t.Input,{value:bc()?.name||"",onChange:a=>bd("name",a.target.value),placeholder:"e.g. 智谱 GLM-4V",className:bc()?.name?.trim()?"":"border-destructive"})]}),(0,b.jsxs)("div",{className:"space-y-2",children:[(0,b.jsxs)(u.Label,{children:["API Key ",(0,b.jsx)("span",{className:"text-destructive",children:"*"})]}),(0,b.jsxs)("div",{className:"relative",children:[(0,b.jsx)(t.Input,{type:ab?"text":"password",value:bc()?.apiKey||"",onChange:a=>bd("apiKey",a.target.value),placeholder:"sk-...",className:`pr-10 ${!bc()?.apiKey?.trim()?"border-destructive":""}`}),(0,b.jsx)(r.Button,{type:"button",variant:"ghost",size:"icon",className:"absolute right-0 top-0 h-full px-3 py-2 hover:bg-transparent",onClick:()=>ac(!ab),children:ab?(0,b.jsx)(C.EyeOff,{className:"h-4 w-4 text-muted-foreground"}):(0,b.jsx)(B.Eye,{className:"h-4 w-4 text-muted-foreground"})})]})]}),(0,b.jsxs)("div",{className:"space-y-2 pt-4 border-t",children:[(0,b.jsxs)(u.Label,{children:["Base URL ",(0,b.jsx)("span",{className:"text-destructive",children:"*"})]}),(0,b.jsx)(t.Input,{value:bc()?.baseUrl||"",onChange:a=>bd("baseUrl",a.target.value),placeholder:"https://api.openai.com/v1",className:bc()?.baseUrl?.trim()?"":"border-destructive"})]}),(0,b.jsx)(ax,{provider:"openai",apiKey:bc()?.apiKey,baseUrl:bc()?.baseUrl,currentModel:bc()?.model,onModelChange:a=>bd("model",a)})]})]}),"gemini"===ad.aiProvider&&(0,b.jsxs)("div",{className:"space-y-3 animate-in fade-in slide-in-from-top-2",children:[(0,b.jsxs)("div",{className:"space-y-2",children:[(0,b.jsx)(u.Label,{children:"API Key"}),(0,b.jsxs)("div",{className:"relative",children:[(0,b.jsx)(t.Input,{type:ab?"text":"password",value:ad.gemini?.apiKey||"",onChange:a=>bb("gemini","apiKey",a.target.value),placeholder:"AIza...",className:"pr-10"}),(0,b.jsx)(r.Button,{type:"button",variant:"ghost",size:"icon",className:"absolute right-0 top-0 h-full px-3 py-2 hover:bg-transparent",onClick:()=>ac(!ab),children:ab?(0,b.jsx)(C.EyeOff,{className:"h-4 w-4 text-muted-foreground"}):(0,b.jsx)(B.Eye,{className:"h-4 w-4 text-muted-foreground"})})]})]}),(0,b.jsxs)("div",{className:"space-y-2",children:[(0,b.jsx)(u.Label,{children:"Base URL (Optional)"}),(0,b.jsx)(t.Input,{value:ad.gemini?.baseUrl||"",onChange:a=>bb("gemini","baseUrl",a.target.value),placeholder:"https://generativelanguage.googleapis.com"})]}),(0,b.jsx)(ax,{provider:"gemini",apiKey:ad.gemini?.apiKey,baseUrl:ad.gemini?.baseUrl,currentModel:ad.gemini?.model,onModelChange:a=>bb("gemini","model",a)})]}),"anthropic"===ad.aiProvider&&(0,b.jsx)(aM,{value:ad.anthropic,onChange:a=>ae(b=>({...b,anthropic:a}))}),aw(ad.aiProvider)&&(0,b.jsx)(aN,{provider:ad.aiProvider,value:ad[ad.aiProvider],onChange:a=>ae(b=>({...b,[b.aiProvider]:a}))},ad.aiProvider),"azure"===ad.aiProvider&&(0,b.jsxs)("div",{className:"space-y-3 animate-in fade-in slide-in-from-top-2",children:[(0,b.jsxs)("div",{className:"space-y-2",children:[(0,b.jsxs)(u.Label,{children:[k.settings?.ai?.azureEndpoint||"Azure Endpoint"," ",(0,b.jsx)("span",{className:"text-destructive",children:"*"})]}),(0,b.jsx)(t.Input,{value:ad.azure?.endpoint||"",onChange:a=>ae(b=>({...b,azure:{...b.azure,endpoint:a.target.value}})),placeholder:k.settings?.ai?.azureEndpointPlaceholder||"https://your-resource.openai.azure.com",className:ad.azure?.endpoint?.trim()?"":"border-destructive"})]}),(0,b.jsxs)("div",{className:"space-y-2",children:[(0,b.jsxs)(u.Label,{children:[k.settings?.ai?.azureDeployment||"Deployment Name"," ",(0,b.jsx)("span",{className:"text-destructive",children:"*"})]}),(0,b.jsx)(t.Input,{value:ad.azure?.deploymentName||"",onChange:a=>ae(b=>({...b,azure:{...b.azure,deploymentName:a.target.value}})),placeholder:k.settings?.ai?.azureDeploymentPlaceholder||"gpt-4o-deployment",className:ad.azure?.deploymentName?.trim()?"":"border-destructive"})]}),(0,b.jsxs)("div",{className:"space-y-2",children:[(0,b.jsxs)(u.Label,{children:["API Key ",(0,b.jsx)("span",{className:"text-destructive",children:"*"})]}),(0,b.jsxs)("div",{className:"relative",children:[(0,b.jsx)(t.Input,{type:ab?"text":"password",value:ad.azure?.apiKey||"",onChange:a=>ae(b=>({...b,azure:{...b.azure,apiKey:a.target.value}})),placeholder:"xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",className:`pr-10 ${!ad.azure?.apiKey?.trim()?"border-destructive":""}`}),(0,b.jsx)(r.Button,{type:"button",variant:"ghost",size:"icon",className:"absolute right-0 top-0 h-full px-3 py-2 hover:bg-transparent",onClick:()=>ac(!ab),children:ab?(0,b.jsx)(C.EyeOff,{className:"h-4 w-4 text-muted-foreground"}):(0,b.jsx)(B.Eye,{className:"h-4 w-4 text-muted-foreground"})})]})]}),(0,b.jsxs)("div",{className:"space-y-2",children:[(0,b.jsx)(u.Label,{children:k.settings?.ai?.azureApiVersion||"API Version"}),(0,b.jsx)(t.Input,{value:ad.azure?.apiVersion||"",onChange:a=>ae(b=>({...b,azure:{...b.azure,apiVersion:a.target.value}})),placeholder:k.settings?.ai?.azureApiVersionPlaceholder||"2024-02-15-preview"})]}),(0,b.jsxs)("div",{className:"space-y-2",children:[(0,b.jsx)(u.Label,{children:k.settings?.ai?.azureModel||"Model Display Name"}),(0,b.jsx)(t.Input,{value:ad.azure?.model||"",onChange:a=>ae(b=>({...b,azure:{...b.azure,model:a.target.value}})),placeholder:"gpt-4o"})]})]}),(0,b.jsxs)("div",{className:"space-y-3 pt-3 border-t",children:[(0,b.jsxs)("div",{className:"flex gap-2",children:[(0,b.jsxs)(r.Button,{type:"button",variant:"outline",onClick:be,disabled:ah||X,className:"flex-1",children:[ah?(0,b.jsx)(z.Loader2,{className:"mr-2 h-4 w-4 animate-spin"}):(0,b.jsx)(I,{className:"mr-2 h-4 w-4"}),ah?k.settings?.ai?.testing||"测试中...":k.settings?.ai?.testConnection||"测试连接"]}),(0,b.jsxs)(r.Button,{onClick:a1,disabled:X||ah,className:"flex-1",children:[X&&(0,b.jsx)(z.Loader2,{className:"mr-2 h-4 w-4 animate-spin"}),k.settings?.ai?.save||"Save AI Settings"]})]}),aj&&(0,b.jsxs)("div",{className:`p-3 rounded-md text-sm ${aj.success?"bg-green-50 border border-green-200":"bg-red-50 border border-red-200"}`,children:[(0,b.jsx)("div",{className:"flex items-center gap-2 font-medium mb-2",children:aj.success?(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)(J,{className:"h-4 w-4 text-green-600"}),(0,b.jsx)("span",{className:"text-green-700",children:k.settings?.ai?.testSuccess||"连接成功"}),aj.modelInfo&&(0,b.jsxs)("span",{className:"text-green-600 text-xs",children:["(",aj.modelInfo,")"]})]}):(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)(K.XCircle,{className:"h-4 w-4 text-red-600"}),(0,b.jsx)("span",{className:"text-red-700",children:k.settings?.ai?.testFailed||"连接失败"})]})}),aj.success&&(0,b.jsxs)("div",{className:"space-y-1 text-xs",children:[(0,b.jsxs)("div",{className:"flex items-center gap-2",children:[(0,b.jsxs)("span",{className:"text-muted-foreground",children:[k.settings?.ai?.textSupport||"文本生成",":"]}),(0,b.jsxs)("span",{className:"text-green-600",children:["✓ ",k.settings?.ai?.supported||"支持"]})]}),(0,b.jsxs)("div",{className:"flex items-center gap-2",children:[(0,b.jsxs)("span",{className:"text-muted-foreground",children:[k.settings?.ai?.visionSupport||"图像识别/多模态",":"]}),aj.visionSupport?(0,b.jsxs)("span",{className:"text-green-600",children:["✓ ",k.settings?.ai?.supported||"支持"]}):(0,b.jsxs)("span",{className:"text-amber-600",children:["✗ ",aj.visionError?k.settings?.ai?.errors?.[aj.visionError]||aj.visionError.replace("UNKNOWN:",""):k.settings?.ai?.notSupported||"不支持"]})]}),(0,b.jsx)("p",{className:"text-muted-foreground/60 text-[10px] pl-1",children:"* 由于网络问题,可能测试结果不准确"})]}),!aj.success&&aj.textError&&(0,b.jsx)("p",{className:"text-red-600 text-xs mt-1",children:k.settings?.ai?.errors?.[aj.textError]||aj.textError.replace("UNKNOWN:","")})]})]})]})}),(0,b.jsxs)(w.TabsContent,{value:"prompts",className:"space-y-4 py-4",children:[(0,b.jsx)(aH,{config:ad,onUpdate:(a,b)=>{ae(c=>({...c,prompts:{...c.prompts,[a]:b}}))}}),(0,b.jsxs)(r.Button,{onClick:a1,disabled:X,className:"w-full",children:[X&&(0,b.jsx)(z.Loader2,{className:"mr-2 h-4 w-4 animate-spin"}),k.settings?.prompts?.save||"Save Prompt Settings"]})]}),g?.user?.role==="admin"&&(0,b.jsxs)(w.TabsContent,{value:"admin",className:"space-y-4 py-4",children:[(0,b.jsxs)(r.Button,{variant:"outline",className:"w-full justify-start gap-2",onClick:()=>{p(!1),a$.push("/admin")},children:[(0,b.jsx)(i.BarChart3,{className:"h-4 w-4"}),k.admin?.dashboard?.title||"Admin Dashboard"]}),(0,b.jsx)("div",{className:"border-t pt-4",children:(0,b.jsx)(as,{})})]}),(0,b.jsx)(w.TabsContent,{value:"danger",className:"space-y-4 py-4",children:(0,b.jsxs)("div",{className:"space-y-3",children:[(0,b.jsxs)("div",{className:"p-4 border border-blue-200 rounded-lg bg-blue-50",children:[(0,b.jsx)("h4",{className:"text-sm font-bold text-blue-900 mb-3",children:k.settings?.dataManagement||"Data Management"}),(0,b.jsxs)("div",{className:"mb-4",children:[(0,b.jsxs)("div",{className:"flex items-center justify-between mb-2",children:[(0,b.jsx)("span",{className:"text-sm text-blue-800 font-medium",children:k.settings?.exportData||"Export Data"}),(0,b.jsxs)("div",{className:"flex items-center gap-2",children:[(0,b.jsxs)(r.Button,{variant:"outline",size:"sm",onClick:a6,disabled:aG,className:"bg-blue-100 hover:bg-blue-200 text-blue-900 border-blue-300",children:[aG?(0,b.jsx)(z.Loader2,{className:"mr-2 h-4 w-4 animate-spin"}):(0,b.jsx)(L.Download,{className:"mr-2 h-4 w-4"}),k.settings?.exportData||"Export"]}),g?.user?.role==="admin"&&(0,b.jsxs)(r.Button,{variant:"outline",size:"sm",onClick:a7,disabled:aG,className:"bg-orange-100 hover:bg-orange-200 text-orange-900 border-orange-300",children:[aG?(0,b.jsx)(z.Loader2,{className:"mr-2 h-4 w-4 animate-spin"}):(0,b.jsx)(L.Download,{className:"mr-2 h-4 w-4"}),k.settings?.exportAllData||"Export All"]})]})]}),(0,b.jsx)("p",{className:"text-xs text-blue-700",children:k.settings?.exportDataDesc||"Export all data as JSON file."})]}),(0,b.jsxs)("div",{children:[(0,b.jsxs)("div",{className:"flex items-center justify-between mb-2",children:[(0,b.jsx)("span",{className:"text-sm text-blue-800 font-medium",children:k.settings?.importData||"Import Data"}),(0,b.jsxs)("div",{className:"flex items-center gap-2",children:[(0,b.jsx)("input",{type:"file",accept:".json",onChange:a=>{let b=a.target.files?.[0];b&&(aX(b),aZ(b.name))},className:"hidden",id:"import-file-input",disabled:aU}),(0,b.jsxs)(r.Button,{variant:"outline",size:"sm",onClick:()=>document.getElementById("import-file-input")?.click(),disabled:aU,className:"bg-blue-100 hover:bg-blue-200 text-blue-900 border-blue-300",children:[aU?(0,b.jsx)(z.Loader2,{className:"mr-2 h-4 w-4 animate-spin"}):(0,b.jsx)(M,{className:"mr-2 h-4 w-4"}),aY||k.settings?.selectFile||"Select File"]}),aW&&(0,b.jsxs)(r.Button,{variant:"outline",size:"sm",onClick:a8,disabled:aU,className:"bg-green-100 hover:bg-green-200 text-green-900 border-green-300",children:[aU?(0,b.jsx)(z.Loader2,{className:"mr-2 h-4 w-4 animate-spin"}):(0,b.jsx)(J,{className:"mr-2 h-4 w-4"}),k.settings?.importData||"Import"]}),aW&&g?.user?.role==="admin"&&(0,b.jsxs)(r.Button,{variant:"outline",size:"sm",onClick:a9,disabled:aU,className:"bg-orange-100 hover:bg-orange-200 text-orange-900 border-orange-300",children:[aU?(0,b.jsx)(z.Loader2,{className:"mr-2 h-4 w-4 animate-spin"}):(0,b.jsx)(J,{className:"mr-2 h-4 w-4"}),k.settings?.importAllData||"Import All"]})]})]}),(0,b.jsx)("p",{className:"text-xs text-blue-700",children:k.settings?.importDataDesc||"Import data from JSON file. Existing data will be skipped."})]})]}),g?.user?.role==="admin"&&(0,b.jsxs)("div",{className:"p-4 border border-blue-200 rounded-lg bg-blue-50",children:[(0,b.jsxs)("div",{className:"flex items-center justify-between",children:[(0,b.jsx)("div",{className:"flex flex-col",children:(0,b.jsxs)("span",{className:"text-sm text-blue-900 font-bold flex items-center gap-2",children:[(0,b.jsx)(G.RefreshCw,{className:"h-4 w-4"}),k.settings?.migrateTags||"Migrate Tags"]})}),(0,b.jsx)(r.Button,{variant:"outline",size:"sm",onClick:ba,disabled:V,className:"bg-blue-100 hover:bg-blue-200 text-blue-900 border-blue-300",children:V?(0,b.jsx)(z.Loader2,{className:"h-4 w-4 animate-spin"}):(0,b.jsx)(G.RefreshCw,{className:"h-4 w-4"})})]}),(0,b.jsx)("p",{className:"text-xs text-blue-800 mt-2 font-medium",children:k.settings?.migrateTagsDesc||"Re-populates standard tags from file"})]}),(0,b.jsxs)("div",{className:"p-4 border border-red-200 rounded-lg bg-red-50",children:[(0,b.jsxs)("div",{className:"flex items-center justify-between",children:[(0,b.jsx)("span",{className:"text-sm text-red-700 font-medium",children:k.settings?.clearData||"Clear Practice Data"}),(0,b.jsx)(r.Button,{variant:"destructive",size:"sm",onClick:a3,disabled:P,children:P?(0,b.jsx)(z.Loader2,{className:"h-4 w-4 animate-spin"}):(0,b.jsx)(y.Trash2,{className:"h-4 w-4"})})]}),(0,b.jsx)("p",{className:"text-xs text-red-600 mt-2",children:k.settings?.clearDataDesc||"This will permanently delete all practice history. Irreversible."})]}),(0,b.jsxs)("div",{className:"p-4 border border-red-200 rounded-lg bg-red-50",children:[(0,b.jsxs)("div",{className:"flex items-center justify-between",children:[(0,b.jsx)("span",{className:"text-sm text-red-700 font-medium",children:k.settings?.clearErrorData||"Clear Error Data"}),(0,b.jsx)(r.Button,{variant:"destructive",size:"sm",onClick:a4,disabled:R,children:R?(0,b.jsx)(z.Loader2,{className:"h-4 w-4 animate-spin"}):(0,b.jsx)(y.Trash2,{className:"h-4 w-4"})})]}),(0,b.jsx)("p",{className:"text-xs text-red-600 mt-2",children:k.settings?.clearErrorDataDesc||"This will permanently delete all error items. Irreversible."})]}),g?.user?.role==="admin"&&(0,b.jsx)(b.Fragment,{children:(0,b.jsxs)("div",{className:"p-4 border border-red-600/50 rounded-lg bg-red-100/50",children:[(0,b.jsxs)("div",{className:"flex items-center justify-between",children:[(0,b.jsx)("div",{className:"flex flex-col",children:(0,b.jsxs)("span",{className:"text-sm text-red-900 font-bold flex items-center gap-2",children:[(0,b.jsx)(A,{className:"h-4 w-4"}),k.settings?.systemReset||"System Initialization"]})}),(0,b.jsx)(r.Button,{variant:"destructive",size:"sm",onClick:a5,disabled:T,className:"bg-red-700 hover:bg-red-800",children:T?(0,b.jsx)(z.Loader2,{className:"h-4 w-4 animate-spin"}):(0,b.jsx)(y.Trash2,{className:"h-4 w-4"})})]}),(0,b.jsx)("p",{className:"text-xs text-red-800 mt-2 font-medium",children:k.settings?.systemResetDesc||"Resets the system to factory state. Deletes ALL data."})]})})]})}),(0,b.jsx)(w.TabsContent,{value:"about",className:"space-y-4 py-4",children:(0,b.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,b.jsxs)("div",{className:"space-y-2",children:[(0,b.jsx)("h3",{className:"text-2xl font-bold",children:k.app?.title||"Smart Error Notebook"}),(0,b.jsx)("p",{className:"text-muted-foreground",children:k.settings?.about?.desc||"AI-powered learning assistant"})]}),(0,b.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,b.jsx)(aF,{className:"h-4 w-4"}),(0,b.jsxs)("span",{children:[k.settings?.about?.version||"Version",": v",_||"unknown"]})]}),(0,b.jsxs)("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:[(0,b.jsx)(r.Button,{variant:"outline",asChild:!0,className:"gap-2 w-full sm:w-auto",children:(0,b.jsxs)("a",{href:"https://github.com/wttwins/wrong-notebook",target:"_blank",rel:"noopener noreferrer",children:[(0,b.jsx)(aS,{className:"h-4 w-4"}),k.settings?.about?.github||"GitHub Repository",(0,b.jsx)(aR,{className:"h-3 w-3 ml-1 opacity-50"})]})}),(0,b.jsx)(r.Button,{variant:"outline",asChild:!0,className:"gap-2 w-full sm:w-auto",children:(0,b.jsxs)("a",{href:"https://github.com/wttwins/wrong-notebook/releases",target:"_blank",rel:"noopener noreferrer",children:[(0,b.jsx)(aT,{className:"h-4 w-4"}),k.settings?.about?.releaseNotes||"Release Notes",(0,b.jsx)(aR,{className:"h-3 w-3 ml-1 opacity-50"})]})}),(0,b.jsx)(r.Button,{variant:"outline",asChild:!0,className:"gap-2 w-full sm:w-auto",children:(0,b.jsxs)("a",{href:"https://github.com/wttwins/wrong-notebook/issues",target:"_blank",rel:"noopener noreferrer",children:[(0,b.jsx)(aQ,{className:"h-4 w-4"}),k.settings?.about?.feedback||"Feedback",(0,b.jsx)(aR,{className:"h-3 w-3 ml-1 opacity-50"})]})})]}),(0,b.jsx)("p",{className:"text-xs text-muted-foreground mt-8",children:k.settings?.about?.copyright||"© 2025 Wttwins. All rights reserved."})]})})]})]})]})}let aV=[/^\/login/,/^\/register/,/^\/print-preview/,/^\/exams\/[^/]+\/print/],aW=[{key:"home",href:"/",icon:n,match:a=>"/"===a},{key:"notebooks",href:"/notebooks",icon:j.BookOpen,match:a=>a.startsWith("/notebooks")||a.startsWith("/error-items")||a.startsWith("/practice")},{key:"tags",href:"/tags",icon:p,match:a=>a.startsWith("/tags")},{key:"stats",href:"/stats",icon:i.BarChart3,match:a=>a.startsWith("/stats")},{key:"exams",href:"/exams",icon:k.FileText,match:a=>a.startsWith("/exams")}];function aX({children:a}){let e=(0,h.usePathname)()||"/",{t:i}=(0,c.useLanguage)(),{data:j,status:k}=(0,d.useSession)();if(aV.some(a=>a.test(e))||"unauthenticated"===k)return(0,b.jsx)(b.Fragment,{children:a});let l=j?.user?.role==="admin",n=j?.user?.name||j?.user?.email||"";return(0,b.jsxs)("div",{className:"min-h-screen",children:[(0,b.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,b.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,b.jsxs)(g.default,{href:"/",className:"flex shrink-0 items-center gap-2",children:[(0,b.jsx)(f.default,{src:"/icons/icon.png",alt:"",width:32,height:32,className:"rounded-lg",priority:!0,unoptimized:!0}),(0,b.jsx)("span",{className:"text-base font-semibold tracking-tight",children:i.pageTitle.base})]}),(0,b.jsx)("nav",{className:"ml-4 hidden items-center gap-1 md:flex",children:aW.map(a=>{let c=a.match(e),d=a.icon;return(0,b.jsxs)(g.default,{href:a.href,className:(0,ag.cn)("flex items-center gap-1.5 rounded-lg px-3 py-2 text-sm font-medium transition-colors",c?"bg-accent text-accent-foreground":"text-muted-foreground hover:bg-muted hover:text-foreground"),"aria-current":c?"page":void 0,children:[(0,b.jsx)(d,{className:"h-4 w-4"}),i.nav[a.key]]},a.key)})}),(0,b.jsxs)("div",{className:"ml-auto flex items-center gap-1",children:[n&&(0,b.jsxs)("span",{className:"mr-2 hidden max-w-40 items-center gap-2 truncate text-sm text-muted-foreground lg:flex",children:[(0,b.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:n.slice(0,1).toUpperCase()}),(0,b.jsx)("span",{className:"truncate",children:n})]}),l&&(0,b.jsx)(g.default,{href:"/admin",title:i.nav.admin,children:(0,b.jsxs)(r.Button,{variant:"ghost",size:"icon",className:"rounded-full",children:[(0,b.jsx)(o,{className:"h-5 w-5"}),(0,b.jsx)("span",{className:"sr-only",children:i.nav.admin})]})}),(0,b.jsx)(aU,{}),(0,b.jsx)(r.Button,{variant:"ghost",size:"icon",className:"rounded-full text-muted-foreground hover:text-destructive",onClick:()=>(0,d.signOut)({callbackUrl:"/login"}),title:i.app.logout,children:(0,b.jsx)(m,{className:"h-5 w-5"})})]})]})}),(0,b.jsx)("div",{className:"pb-20 md:pb-0",children:a}),(0,b.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,b.jsx)("div",{className:"grid h-16 grid-cols-5",children:aW.map(a=>{let c=a.match(e),d=a.icon;return(0,b.jsxs)(g.default,{href:a.href,className:(0,ag.cn)("flex flex-col items-center justify-center gap-1 text-[11px] font-medium transition-colors",c?"text-primary":"text-muted-foreground"),"aria-current":c?"page":void 0,children:[(0,b.jsx)("span",{className:(0,ag.cn)("flex h-7 w-12 items-center justify-center rounded-full transition-colors",c&&"bg-accent"),children:(0,b.jsx)(d,{className:"h-5 w-5"})}),i.nav[a.key]]},a.key)})})})]})}let aY=(0,l.default)("list-todo",[["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"}]]),aZ=[/^\/login/,/^\/register/,/^\/print-preview/,/^\/exams\/[^/]+\/print/];function a$(){let{t:a}=(0,c.useLanguage)(),{timeZone:f}=(0,e.useTimeZone)(),{status:i}=(0,d.useSession)(),j=(0,h.usePathname)(),[k,l]=(0,q.useState)(!1),[m,n]=(0,q.useState)([]),[o,p]=(0,q.useState)(()=>Date.now()),t="authenticated"!==i||aZ.some(a=>a.test(j||"")),u=(0,q.useCallback)(async()=>{if("u"<typeof document||"hidden"!==document.visibilityState)try{let a=await aq.apiClient.get("/api/tasks");n(a.tasks),p(Date.now())}catch{}},[]);if((0,q.useEffect)(()=>{if(t)return;let a=setTimeout(u,0),b=setInterval(u,k?2e3:15e3);return()=>{clearTimeout(a),clearInterval(b)}},[t,k,u]),t)return null;let v=m.filter(a=>"running"===a.status).length,w=m.some(a=>"running"!==a.status),x=async()=>{try{let a=await aq.apiClient.delete("/api/tasks");n(a.tasks)}catch{}};return(0,b.jsxs)(b.Fragment,{children:[(0,b.jsxs)(r.Button,{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:()=>l(!0),"aria-label":a.backgroundTasks.title,title:a.backgroundTasks.title,children:[v>0?(0,b.jsx)(z.Loader2,{className:"h-5 w-5 animate-spin"}):(0,b.jsx)(aY,{className:"h-5 w-5"}),v>0&&(0,b.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:v})]}),(0,b.jsx)(s.Dialog,{open:k,onOpenChange:l,children:(0,b.jsxs)(s.DialogContent,{className:"max-h-[85vh] overflow-y-auto sm:max-w-lg",children:[(0,b.jsxs)(s.DialogHeader,{children:[(0,b.jsx)(s.DialogTitle,{children:a.backgroundTasks.title}),(0,b.jsx)(s.DialogDescription,{children:a.backgroundTasks.description})]}),0===m.length?(0,b.jsx)("p",{className:"py-6 text-center text-sm text-muted-foreground",children:a.backgroundTasks.empty}):(0,b.jsx)("ul",{className:"space-y-2",children:m.map(c=>{var d,e;let h;return(0,b.jsx)("li",{className:"rounded-md border p-3 text-sm",children:(0,b.jsxs)("div",{className:"flex items-start gap-2",children:["running"===c.status&&(0,b.jsx)(z.Loader2,{className:"mt-0.5 h-4 w-4 shrink-0 animate-spin text-primary"}),"succeeded"===c.status&&(0,b.jsx)(J,{className:"mt-0.5 h-4 w-4 shrink-0 text-green-600"}),"failed"===c.status&&(0,b.jsx)(K.XCircle,{className:"mt-0.5 h-4 w-4 shrink-0 text-destructive"}),(0,b.jsxs)("div",{className:"min-w-0 flex-1 space-y-1",children:[(0,b.jsxs)("div",{className:"font-medium",children:[a.backgroundTasks.kinds[c.kind],(0,b.jsxs)("span",{className:"font-normal text-muted-foreground",children:[" · ",a.backgroundTasks.status[c.status]]})]}),c.subject&&(0,b.jsx)("div",{className:"break-words text-muted-foreground",children:c.subject}),c.progress&&c.progress.total>0&&(0,b.jsxs)("div",{className:"space-y-1",children:[(0,b.jsx)("div",{className:"h-1.5 overflow-hidden rounded bg-muted",children:(0,b.jsx)("div",{className:"h-full bg-primary transition-all",style:{width:`${Math.round(c.progress.done/c.progress.total*100)}%`}})}),(0,b.jsxs)("div",{className:"text-xs text-muted-foreground",children:[a.backgroundTasks.progress.replace("{done}",String(c.progress.done)).replace("{total}",String(c.progress.total)),c.progress.failed>0&&` \xb7 ${a.backgroundTasks.failedCount.replace("{count}",String(c.progress.failed))}`]})]}),c.error&&(0,b.jsx)("div",{className:"text-xs text-destructive",children:(b=>{if(!b)return null;let c=a.backgroundTasks.errors[b]??a.errors[b];return"string"==typeof c?c:b})(c.error)}),(0,b.jsxs)("div",{className:"flex flex-wrap items-center gap-x-3 text-xs text-muted-foreground",children:[(0,b.jsx)("span",{children:a.backgroundTasks.startedAt.replace("{time}",(0,N.formatDateTime)(c.startedAt,"HH:mm:ss",f))}),(0,b.jsx)("span",{children:a.backgroundTasks.elapsed.replace("{time}",(d=c.startedAt,e=c.finishedAt,h=Math.max(0,Math.round(((e?Date.parse(e):o)-Date.parse(d))/1e3)),`${Math.floor(h/60)}:${String(h%60).padStart(2,"0")}`))}),c.link&&(0,b.jsx)(g.default,{href:c.link,className:"text-primary hover:underline",onClick:()=>l(!1),children:a.backgroundTasks.view})]})]})]})},c.id)})}),(0,b.jsxs)("div",{className:"flex items-center justify-between gap-2 pt-1",children:[(0,b.jsx)("p",{className:"text-xs text-muted-foreground",children:a.backgroundTasks.retentionHint}),w&&(0,b.jsx)(r.Button,{variant:"ghost",size:"sm",onClick:x,children:a.backgroundTasks.clearFinished})]})]})})]})}var a_=a.i(33508);let a0={success:{icon:J,className:"text-success"},error:{icon:K.XCircle,className:"text-destructive"},warning:{icon:A,className:"text-warning"},info:{icon:aF,className:"text-primary"}};function a1(){let{t:a}=(0,c.useLanguage)(),[d,e]=(0,q.useState)([]),[f,g]=(0,q.useState)(null);return(0,q.useEffect)(()=>(0,ar.subscribeFeedback)(a=>{e(a.toasts),g(a.confirm)}),[]),(0,b.jsxs)(b.Fragment,{children:[(0,b.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:d.map(c=>{let{icon:d,className:e}=a0[c.type];return(0,b.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,b.jsx)(d,{className:(0,ag.cn)("mt-0.5 h-4 w-4 shrink-0",e)}),(0,b.jsx)("p",{className:"min-w-0 flex-1 whitespace-pre-line break-words leading-relaxed",children:c.message}),(0,b.jsx)("button",{type:"button",className:"shrink-0 rounded p-0.5 text-muted-foreground transition-colors hover:text-foreground",onClick:()=>(0,ar.dismissToast)(c.id),"aria-label":a.common.close,children:(0,b.jsx)(a_.X,{className:"h-3.5 w-3.5"})})]},c.id)})}),(0,b.jsx)(s.Dialog,{open:!!f,onOpenChange:a=>{a||f?.resolve(!1)},children:(0,b.jsxs)(s.DialogContent,{className:"sm:max-w-md",children:[(0,b.jsxs)(s.DialogHeader,{children:[(0,b.jsxs)(s.DialogTitle,{className:"flex items-center gap-2",children:[f?.destructive&&(0,b.jsx)(A,{className:"h-5 w-5 text-destructive"}),f?.title||a.common.confirmTitle]}),(0,b.jsx)(s.DialogDescription,{className:"whitespace-pre-line pt-1 text-left leading-relaxed",children:f?.message})]}),(0,b.jsxs)(s.DialogFooter,{className:"gap-2",children:[(0,b.jsx)(r.Button,{variant:"outline",onClick:()=>f?.resolve(!1),children:f?.cancelText||a.common.cancel}),(0,b.jsx)(r.Button,{variant:f?.destructive?"destructive":"default",onClick:()=>f?.resolve(!0),autoFocus:!0,children:f?.confirmText||a.common.confirm})]})]})})]})}a.s(["Providers",0,function({children:a,timeZone:f}){return(0,b.jsx)(d.SessionProvider,{children:(0,b.jsx)(c.LanguageProvider,{children:(0,b.jsxs)(e.TimeZoneProvider,{initialTimeZone:f,children:[(0,b.jsx)(aX,{children:a}),(0,b.jsx)(a$,{}),(0,b.jsx)(a1,{})]})})})}],18175)}];
191
+ {{provider_hints}}`;var aE=a.i(87654);let aF=(0,l.default)("info",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 16v-4",key:"1dtifu"}],["path",{d:"M12 8h.01",key:"e9boi3"}]]);function aG({name:a,description:c}){return(0,b.jsxs)("div",{className:"flex flex-col sm:flex-row sm:items-start gap-1 sm:gap-2 text-xs py-1",children:[(0,b.jsx)("code",{className:"bg-muted px-1.5 py-0.5 rounded font-mono text-primary shrink-0 w-fit",children:`{{${a}}}`}),(0,b.jsx)("span",{className:"text-muted-foreground",children:c})]})}function aH({config:a,onUpdate:d}){let{language:e,t:f}=(0,c.useLanguage)(),[g,h]=(0,q.useState)(""),[i,j]=(0,q.useState)("");(0,q.useEffect)(()=>{h(a.prompts?.analyze||aC),j(a.prompts?.similar||aD)},[a.prompts]);let k=async a=>{if(!await (0,ar.confirmDialog)(f.settings?.prompts?.resetConfirm||"Are you sure you want to reset to default?",{destructive:!0}))return;let b="analyze"===a?aC:aD;"analyze"===a?(h(b),d("analyze",b)):(j(b),d("similar",b))},l=(a,b)=>{"analyze"===a?(h(b),d("analyze",b)):(j(b),d("similar",b))},m=()=>(0,b.jsxs)("div",{className:"bg-amber-50 border border-amber-200 rounded-md p-3 flex items-start gap-3 text-amber-900 text-sm mb-4",children:[(0,b.jsx)(A,{className:"h-5 w-5 shrink-0 text-amber-600"}),(0,b.jsxs)("div",{className:"space-y-1",children:[(0,b.jsx)("p",{className:"font-medium",children:f.settings?.prompts?.caution||"Modify with Caution"}),(0,b.jsx)("p",{className:"text-amber-800/90 text-xs",children:f.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."})]})]});return(0,b.jsx)("div",{className:"space-y-4 border rounded-lg p-4 bg-muted/30",children:(0,b.jsxs)(w.Tabs,{defaultValue:"analyze",className:"w-full",children:[(0,b.jsxs)(w.TabsList,{className:"grid w-full grid-cols-2",children:[(0,b.jsx)(w.TabsTrigger,{value:"analyze",children:f.settings?.prompts?.analysisTab||"Analysis Prompt"}),(0,b.jsx)(w.TabsTrigger,{value:"similar",children:f.settings?.prompts?.similarTab||"Similar Question Prompt"})]}),(0,b.jsx)(w.TabsContent,{value:"analyze",className:"space-y-4 py-4",children:(0,b.jsxs)("div",{className:"space-y-4",children:[(0,b.jsxs)("div",{className:"flex justify-between items-center",children:[(0,b.jsx)(u.Label,{className:"text-base font-semibold",children:f.settings?.prompts?.customAnalysis||"Custom Analysis Template"}),(0,b.jsxs)(r.Button,{variant:"outline",size:"sm",onClick:()=>k("analyze"),children:[(0,b.jsx)(aE.RotateCcw,{className:"w-4 h-4 mr-2"}),f.settings?.prompts?.reset||"Reset Default"]})]}),(0,b.jsx)(m,{}),(0,b.jsxs)("div",{className:"space-y-2 border rounded-md p-3 bg-background",children:[(0,b.jsxs)("h4",{className:"text-xs font-medium flex items-center gap-1.5 mb-2",children:[(0,b.jsx)(aF,{className:"h-3.5 w-3.5"}),f.settings?.prompts?.variables||"Available Variables"]}),(0,b.jsxs)("div",{className:"space-y-1.5",children:[(0,b.jsx)(aG,{name:"language_instruction",description:f.settings?.prompts?.vars?.languageInstruction||"Injects instructions based on target language (e.g., keep English questions in English but analysis in Chinese)."}),(0,b.jsx)(aG,{name:"knowledge_points_list",description:f.settings?.prompts?.vars?.knowledgePointsList||"Injects the standard list of knowledge point tags for the specific subject."}),(0,b.jsx)(aG,{name:"provider_hints",description:f.settings?.prompts?.vars?.providerHints||"System-injected hints (e.g., enforcing JSON format)."})]})]}),(0,b.jsx)(ay.Textarea,{value:g,onChange:a=>l("analyze",a.target.value),className:"font-mono text-xs min-h-[400px]",placeholder:aC})]})}),(0,b.jsx)(w.TabsContent,{value:"similar",className:"space-y-4 py-4",children:(0,b.jsxs)("div",{className:"space-y-4",children:[(0,b.jsxs)("div",{className:"flex justify-between items-center",children:[(0,b.jsx)(u.Label,{className:"text-base font-semibold",children:f.settings?.prompts?.customSimilar||"Custom Similar Question Template"}),(0,b.jsxs)(r.Button,{variant:"outline",size:"sm",onClick:()=>k("similar"),children:[(0,b.jsx)(aE.RotateCcw,{className:"w-4 h-4 mr-2"}),f.settings?.prompts?.reset||"Reset Default"]})]}),(0,b.jsx)(m,{}),(0,b.jsxs)("div",{className:"space-y-2 border rounded-md p-3 bg-background",children:[(0,b.jsxs)("h4",{className:"text-xs font-medium flex items-center gap-1.5 mb-2",children:[(0,b.jsx)(aF,{className:"h-3.5 w-3.5"}),f.settings?.prompts?.variables||"Available Variables"]}),(0,b.jsxs)("div",{className:"space-y-1.5",children:[(0,b.jsx)(aG,{name:"difficulty_level",description:f.settings?.prompts?.vars?.difficultyLevel||"Target difficulty level."}),(0,b.jsx)(aG,{name:"difficulty_instruction",description:f.settings?.prompts?.vars?.difficultyInstruction||"Specific writing instructions for the target difficulty."}),(0,b.jsx)(aG,{name:"original_question",description:f.settings?.prompts?.vars?.originalQuestion||"The full text of the original question."}),(0,b.jsx)(aG,{name:"knowledge_points",description:f.settings?.prompts?.vars?.knowledgePoints||"List of knowledge points to test."}),(0,b.jsx)(aG,{name:"language_instruction",description:f.settings?.prompts?.vars?.languageInstructionShort||"Language formatting instructions."})]})]}),(0,b.jsx)(ay.Textarea,{value:i,onChange:a=>l("similar",a.target.value),className:"font-mono text-xs min-h-[400px]",placeholder:aD})]})})]})})}function aI({field:a,label:d,description:e}){let{t:f}=(0,c.useLanguage)(),[g,h]=(0,q.useState)(!1),[i,j]=(0,q.useState)(!1),[k,l]=(0,q.useState)(!1),[m,n]=(0,q.useState)(null),o=`preference-${a}`;(0,q.useEffect)(()=>{aq.apiClient.get("/api/user").then(b=>h(!!b[a])).catch(()=>void 0).finally(()=>j(!0))},[a]);let p=async b=>{h(b),l(!0);try{await aq.apiClient.patch("/api/user",{[a]:b}),n(f.importFlow.preferenceSaved)}catch(c){h(!b),n(f.importFlow.preferenceSaveFailed),at.frontendLogger.error("[Settings]","Failed to save user preference",{field:a,error:c instanceof Error?c.message:String(c)})}finally{l(!1)}};return(0,b.jsxs)("div",{className:"space-y-2 pt-4 border-t",children:[(0,b.jsxs)("div",{className:"flex items-center justify-between gap-4",children:[(0,b.jsx)(u.Label,{htmlFor:o,children:d}),(0,b.jsx)(ah,{id:o,checked:g,onCheckedChange:p,disabled:!i||k})]}),(0,b.jsx)("p",{className:"text-xs text-muted-foreground",children:e}),m&&(0,b.jsx)("p",{className:"text-xs text-muted-foreground",children:m})]})}function aJ(){let{t:a}=(0,c.useLanguage)();return(0,b.jsx)(aI,{field:"confirmBeforeImport",label:a.importFlow.confirmBeforeImport,description:a.importFlow.confirmBeforeImportDesc})}function aK(){let{t:a}=(0,c.useLanguage)();return(0,b.jsx)(aI,{field:"enableGeogebra",label:a.importFlow.enableGeogebra,description:a.importFlow.enableGeogebraDesc})}function aL(){let{t:a}=(0,c.useLanguage)();return(0,b.jsx)(aI,{field:"enableSvgAnimation",label:a.importFlow.enableSvgAnimation,description:a.importFlow.enableSvgAnimationDesc})}function aM({value:a,onChange:d}){let{t:e}=(0,c.useLanguage)(),[f,g]=(0,q.useState)(!1),h=(b,c)=>d({...a,[b]:c});return(0,b.jsxs)("div",{className:"space-y-3 animate-in fade-in slide-in-from-top-2",children:[(0,b.jsxs)("div",{className:"space-y-2",children:[(0,b.jsx)(u.Label,{children:"API Key"}),(0,b.jsxs)("div",{className:"relative",children:[(0,b.jsx)(t.Input,{type:f?"text":"password",value:a?.apiKey||"",onChange:a=>h("apiKey",a.target.value),placeholder:"sk-ant-...",className:"pr-10"}),(0,b.jsx)(r.Button,{type:"button",variant:"ghost",size:"icon",className:"absolute right-0 top-0 h-full px-3 py-2 hover:bg-transparent",onClick:()=>g(!f),"aria-label":f?"Hide API Key":"Show API Key",children:f?(0,b.jsx)(C.EyeOff,{className:"h-4 w-4 text-muted-foreground"}):(0,b.jsx)(B.Eye,{className:"h-4 w-4 text-muted-foreground"})})]})]}),(0,b.jsxs)("div",{className:"space-y-2",children:[(0,b.jsx)(u.Label,{children:"Base URL (Optional)"}),(0,b.jsx)(t.Input,{value:a?.baseUrl||"",onChange:a=>h("baseUrl",a.target.value),placeholder:"https://api.anthropic.com"}),(0,b.jsx)("p",{className:"text-xs text-muted-foreground",children:e.settings?.ai?.anthropicBaseUrlHint})]}),(0,b.jsx)(ax,{provider:"anthropic",apiKey:a?.apiKey,baseUrl:a?.baseUrl,currentModel:a?.model,onModelChange:a=>h("model",a)})]})}function aN({provider:a,value:d,onChange:e}){let{t:f}=(0,c.useLanguage)(),[g,h]=(0,q.useState)(!1),i=au[a],j=(a,b)=>e({...d,[a]:b});return(0,b.jsxs)("div",{className:"space-y-3 animate-in fade-in slide-in-from-top-2",children:[(0,b.jsxs)("div",{className:"space-y-2",children:[(0,b.jsx)(u.Label,{children:"API Key"}),(0,b.jsxs)("div",{className:"relative",children:[(0,b.jsx)(t.Input,{type:g?"text":"password",value:d?.apiKey||"",onChange:a=>j("apiKey",a.target.value),placeholder:"sk-...",className:"pr-10"}),(0,b.jsx)(r.Button,{type:"button",variant:"ghost",size:"icon",className:"absolute right-0 top-0 h-full px-3 py-2 hover:bg-transparent",onClick:()=>h(!g),"aria-label":g?"Hide API Key":"Show API Key",children:g?(0,b.jsx)(C.EyeOff,{className:"h-4 w-4 text-muted-foreground"}):(0,b.jsx)(B.Eye,{className:"h-4 w-4 text-muted-foreground"})})]}),(0,b.jsxs)("p",{className:"text-xs text-muted-foreground",children:[f.settings?.ai?.vendorApiKeyHint||"Get an API key from the console:"," ",(0,b.jsx)("a",{href:i.consoleUrl,target:"_blank",rel:"noopener noreferrer",className:"underline break-all",children:i.consoleUrl})]})]}),(0,b.jsxs)("div",{className:"space-y-2",children:[(0,b.jsx)(u.Label,{children:"Base URL (Optional)"}),(0,b.jsx)(t.Input,{value:d?.baseUrl||"",onChange:a=>j("baseUrl",a.target.value),placeholder:i.baseUrl}),(0,b.jsx)("p",{className:"text-xs text-muted-foreground",children:f.settings?.ai?.vendorBaseUrlHint})]}),(0,b.jsx)(ax,{provider:a,apiKey:d?.apiKey,baseUrl:d?.baseUrl,currentModel:d?.model||i.model,onModelChange:a=>j("model",a)})]})}var aO=a.i(42027);function aP({value:a,onChange:d,disabled:e}){let{t:f}=(0,c.useLanguage)();return(0,b.jsxs)("div",{className:"space-y-2 pt-4 border-t",children:[(0,b.jsx)(u.Label,{htmlFor:"app-time-zone",children:f.settings.general.timeZoneLabel}),(0,b.jsx)(t.Input,{id:"app-time-zone",value:a,onChange:a=>d(a.target.value),disabled:e,list:"app-time-zones",placeholder:"Asia/Shanghai"}),(0,b.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(a=>(0,b.jsx)("option",{value:a},a))}),(0,b.jsx)("p",{className:"text-xs text-muted-foreground",children:f.settings.general.timeZoneDesc})]})}let aQ=(0,l.default)("server",[["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"}]]);function aR(){return null}let aS=()=>()=>void 0;function aT(){let{t:a}=(0,c.useLanguage)(),d=(0,q.useSyncExternalStore)(aS,aR,()=>null);return d?d.isStandalone?.()?(0,b.jsx)("p",{className:"text-center text-sm text-muted-foreground",children:a.settings?.about?.androidStandalone||"Running on this device. Data is stored only on this device."}):(0,b.jsxs)("div",{className:"flex flex-col items-center gap-2 text-sm text-muted-foreground",children:[(0,b.jsxs)("span",{className:"break-all",children:[a.settings?.about?.androidServer||"Server",": ",d.getServerUrl()]}),(0,b.jsxs)(r.Button,{variant:"outline",className:"gap-2",onClick:()=>d.changeServer(),children:[(0,b.jsx)(aQ,{className:"h-4 w-4"}),a.settings?.about?.changeServer||"Change server"]})]}):null}let aU="https://github.com/margrop/wrong-notebook",aV=(0,l.default)("message-square-text",[["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"}]]),aW=(0,l.default)("external-link",[["path",{d:"M15 3h6v6",key:"1q9fwt"}],["path",{d:"M10 14 21 3",key:"gplh6r"}],["path",{d:"M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6",key:"a6xqqp"}]]),aX=(0,l.default)("github",[["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",key:"tonef"}],["path",{d:"M9 18c-4.51 2-5-2-7-2",key:"9comsn"}]]),aY=(0,l.default)("scroll-text",[["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"}]]);function aZ(){let{timeZone:a,setTimeZone:f}=(0,e.useTimeZone)(),{data:g}=(0,d.useSession)(),j=g?.user?.role==="admin",{t:k,language:l,setLanguage:m}=(0,c.useLanguage)(),[n,p]=(0,q.useState)(!1),O=(0,q.useRef)(null),[P,Q]=(0,q.useState)(!1),[R,S]=(0,q.useState)(!1),[T,U]=(0,q.useState)(!1),[V,W]=(0,q.useState)(!1),[X,Y]=(0,q.useState)(!1),[Z,$]=(0,q.useState)(!1),[_,aa]=(0,q.useState)(""),[ab,ac]=(0,q.useState)(!1),[ad,ae]=(0,q.useState)({aiProvider:"minimax"}),[af,ag]=(0,q.useState)(void 0),[ah,ai]=(0,q.useState)(!1),[aj,ak]=(0,q.useState)(null),[al,am]=(0,q.useState)({name:"",email:"",educationStage:"",enrollmentYear:"",password:""}),[an,ao]=(0,q.useState)(""),[ap,ay]=(0,q.useState)(!1),[az,aA]=(0,q.useState)(!1),[aB,aC]=(0,q.useState)(!1),[aD,aE]=(0,q.useState)(!1),[aG,aI]=(0,q.useState)(!1),[aQ,aR]=(0,q.useState)(!1),[aS,aZ]=(0,q.useState)(null),[a$,a_]=(0,q.useState)(""),a0=(0,h.useRouter)();(0,q.useEffect)(()=>{n&&(a1(),a2()),fetch("/api/version").then(a=>a.json()).then(a=>aa(a.version)).catch(()=>{})},[n]);let a1=async()=>{$(!0);try{let a=await aq.apiClient.get("/api/settings");ae(a)}catch(a){at.frontendLogger.error("[SettingsDialog]","Failed to fetch settings",{error:a instanceof Error?a.message:String(a)})}finally{$(!1)}},a2=async()=>{ay(!0);try{let a=await aq.apiClient.get("/api/user");am({name:a.name||"",email:a.email||"",educationStage:a.educationStage||"",enrollmentYear:a.enrollmentYear||"",password:""})}catch(a){at.frontendLogger.error("[SettingsDialog]","Failed to fetch profile",{error:a instanceof Error?a.message:String(a)})}finally{ay(!1)}},a3=async()=>{if(!(0,N.isValidTimeZone)(ad.timeZone??N.DEFAULT_TIME_ZONE))return void ar.toast.error(k.settings.general.invalidTimeZone);let a=(()=>{if("openai"!==ad.aiProvider)return null;for(let a of ad.openai?.instances||[]){if(!a.name?.trim())return k.settings?.ai?.validationNameRequired||"实例名称不能为空";if(!a.apiKey?.trim())return k.settings?.ai?.validationApiKeyRequired||"API Key 不能为空";if(!a.baseUrl?.trim())return k.settings?.ai?.validationBaseUrlRequired||"Base URL 不能为空";if(!a.model?.trim())return k.settings?.ai?.validationModelRequired||"模型名称不能为空"}return null})();if(a)return void ar.toast.error(a);let b="azure"!==ad.aiProvider?null:ad.azure?.endpoint?.trim()?ad.azure?.deploymentName?.trim()?ad.azure?.apiKey?.trim()?null:k.settings?.ai?.validationApiKeyRequired||"API Key is required":k.settings?.ai?.validationAzureDeploymentRequired||"Deployment Name is required":k.settings?.ai?.validationAzureEndpointRequired||"Azure Endpoint is required";if(b)return void ar.toast.error(b);Y(!0);try{let a=await aq.apiClient.post("/api/settings",ad);ae(a),f(a.timeZone||N.DEFAULT_TIME_ZONE),ar.toast.success(k.settings?.messages?.saved||"Settings saved"),O.current?.scrollTo({top:0,behavior:"smooth"})}catch(a){at.frontendLogger.error("[SettingsDialog]","Failed to save settings",{error:a instanceof Error?a.message:String(a)}),ar.toast.error(k.settings?.messages?.saveFailed||"Failed to save")}finally{Y(!1)}},a4=async()=>{aA(!0);try{if(al.password&&al.password!==an){ar.toast.error(k.settings?.messages?.passwordMismatch||"Passwords do not match"),aA(!1);return}let a={name:al.name,email:al.email,educationStage:al.educationStage};al.enrollmentYear&&(a.enrollmentYear=parseInt(al.enrollmentYear.toString())),al.password&&(a.password=al.password),await aq.apiClient.patch("/api/user",a),ar.toast.success(k.settings?.messages?.profileUpdated||"Profile updated"),am(a=>({...a,password:""})),ao(""),aC(!1),aE(!1),window.location.reload()}catch(b){at.frontendLogger.error("[SettingsDialog]","Failed to update profile",{error:b?.data?.message||b?.message||String(b)});let a=b.data?.message||k.settings?.messages?.updateFailed||"Update failed";ar.toast.error(a)}finally{aA(!1)}},a5=async()=>{if(await (0,ar.confirmDialog)(k.settings?.clearDataConfirm||"Are you sure?",{destructive:!0})){Q(!0);try{await aq.apiClient.delete("/api/stats/practice/clear"),ar.toast.success(k.settings?.clearSuccess||"Success"),p(!1),window.location.reload()}catch(a){at.frontendLogger.error("[SettingsDialog]","Failed to clear practice data",{error:a instanceof Error?a.message:String(a)}),ar.toast.error(k.settings?.clearError||"Failed")}finally{Q(!1)}}},a6=async()=>{if(await (0,ar.confirmDialog)(k.settings?.clearErrorDataConfirm||"Are you sure?",{destructive:!0})){S(!0);try{await aq.apiClient.delete("/api/error-items/clear"),ar.toast.success(k.settings?.clearSuccess||"Success"),p(!1),window.location.reload()}catch(a){at.frontendLogger.error("[SettingsDialog]","Failed to clear error data",{error:a instanceof Error?a.message:String(a)}),ar.toast.error(k.settings?.clearError||"Failed")}finally{S(!1)}}},a7=async()=>{if(!await (0,ar.confirmDialog)(k.settings?.systemResetConfirm||"WARNING: Deleting ALL data. Undoing is impossible. Are you sure?",{destructive:!0}))return;let a=prompt(k.settings?.systemResetPrompt||"Type 'RESET' to confirm system initialization:","");if("RESET"!==a){null!==a&&ar.toast.error(k.common?.error||"Confirmation failed");return}U(!0);try{await aq.apiClient.post("/api/admin/system-reset",{}),ar.toast.success(k.settings?.clearSuccess||"Success - System Reset Complete"),p(!1),window.location.reload()}catch(a){at.frontendLogger.error("[SettingsDialog]","System reset failed",{error:a instanceof Error?a.message:String(a)}),ar.toast.error(k.settings?.clearError||"Failed to reset system")}finally{U(!1)}},a8=async()=>{aI(!0);try{let a=await fetch("/api/export");if(!a.ok)throw Error("Export failed");let b=await a.blob(),c=window.URL.createObjectURL(b),d=document.createElement("a");d.href=c;let e=a.headers.get("Content-Disposition"),f=e?.match(/filename="(.+)"/);d.download=f?f[1]:"wrong-notebook-export.json",document.body.appendChild(d),d.click(),document.body.removeChild(d),window.URL.revokeObjectURL(c),ar.toast.success(k.settings?.exportSuccess||"Export successful")}catch(a){at.frontendLogger.error("[SettingsDialog]","Export failed",{error:a instanceof Error?a.message:String(a)}),ar.toast.error(k.settings?.exportFailed||"Export failed")}finally{aI(!1)}},a9=async()=>{if(await (0,ar.confirmDialog)(k.settings?.exportAllConfirm||"Export all users' data? This may take a while.")){aI(!0);try{let a=await fetch("/api/export?all=true");if(!a.ok){let b=await a.json();throw Error(b.message||"Export failed")}let b=await a.blob(),c=window.URL.createObjectURL(b),d=document.createElement("a");d.href=c;let e=a.headers.get("Content-Disposition"),f=e?.match(/filename="(.+)"/);d.download=f?f[1]:"wrong-notebook-export-all.json",document.body.appendChild(d),d.click(),document.body.removeChild(d),window.URL.revokeObjectURL(c),ar.toast.success(k.settings?.exportSuccess||"Export successful")}catch(a){at.frontendLogger.error("[SettingsDialog]","Export all failed",{error:a instanceof Error?a.message:String(a)}),ar.toast.error(k.settings?.exportFailed||"Export failed")}finally{aI(!1)}}},ba=async()=>{if(aS&&await (0,ar.confirmDialog)(k.settings?.importConfirm||"Are you sure you want to import?")){aR(!0);try{let a=await aS.text(),b=JSON.parse(a),c=(await aq.apiClient.post("/api/import",b)).stats;ar.toast.success((k.settings?.importResultDesc||"Imported {subjects} notebooks, {tags} tags, {items} error items, {schedules} review schedules, {records} practice records.").replace("{subjects}",String(c.subjectsCreated)).replace("{tags}",String(c.tagsCreated)).replace("{items}",String(c.errorItemsCreated)).replace("{schedules}",String(c.reviewSchedulesCreated)).replace("{records}",String(c.practiceRecordsCreated)).replace("{duplicates}",String(c.duplicateErrorItems??0))),aZ(null),a_(""),window.location.reload()}catch(a){at.frontendLogger.error("[SettingsDialog]","Import failed",{error:a instanceof Error?a.message:String(a)}),ar.toast.error(k.settings?.importFailed||"Import failed")}finally{aR(!1)}}},bb=async()=>{if(aS&&await (0,ar.confirmDialog)(k.settings?.importAllConfirm||"Import all users' data? This will restore data for all users from the export file.")){aR(!0);try{let a=await aS.text(),b=JSON.parse(a),c=await fetch("/api/import?all=true",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(b)}),d=await c.json();if(d.success){let a=d.stats;ar.toast.success((k.settings?.importResultDesc||"Imported {subjects} notebooks, {tags} tags, {items} error items, {schedules} review schedules, {records} practice records.").replace("{subjects}",String(a.subjectsCreated)).replace("{tags}",String(a.tagsCreated)).replace("{items}",String(a.errorItemsCreated)).replace("{schedules}",String(a.reviewSchedulesCreated)).replace("{records}",String(a.practiceRecordsCreated)).replace("{duplicates}",String(a.duplicateErrorItems??0))),aZ(null),a_(""),window.location.reload()}else throw Error(d.message||"Import failed")}catch(a){at.frontendLogger.error("[SettingsDialog]","Import all failed",{error:a instanceof Error?a.message:String(a)}),ar.toast.error(k.settings?.importFailed||"Import failed")}finally{aR(!1)}}},bc=async()=>{if(await (0,ar.confirmDialog)(k.settings?.migrateTagsConfirm||"This will reset system tags. Confirm?",{destructive:!0})){W(!0);try{let a=await aq.apiClient.post("/api/admin/migrate-tags",{});ar.toast.success(`${k.settings?.clearSuccess||"Success"}: ${a.count||0} tags migrated.`)}catch(a){at.frontendLogger.error("[SettingsDialog]","Tag migration failed",{error:a instanceof Error?a.message:String(a)}),ar.toast.error(k.settings?.clearError||"Failed to migrate tags")}finally{W(!1)}}},bd=(a,b,c)=>{"gemini"===a&&ae(a=>({...a,gemini:{...a.gemini,[b]:c}}))},be=()=>{let a=ad.openai?.instances||[],b=af||ad.openai?.activeInstanceId;return a.find(a=>a.id===b)},bf=(a,b)=>{let c=ad.openai?.instances||[],d=af||ad.openai?.activeInstanceId,e=c.map(c=>c.id===d?{...c,[a]:b}:c);ae(a=>({...a,openai:{...a.openai,instances:e}}))};(0,q.useEffect)(()=>{ad.openai?.activeInstanceId&&!af&&ag(ad.openai.activeInstanceId)},[ad.openai?.activeInstanceId,af]);let bg=async()=>{ai(!0),ak(null);try{let a;if("openai"===ad.aiProvider){let b=be();if(!b?.apiKey){ak({success:!1,textSupport:!1,visionSupport:!1,textError:k.settings?.ai?.validationApiKeyRequired||"API Key is required"}),ai(!1);return}a={provider:"openai",apiKey:b.apiKey,baseUrl:b.baseUrl,model:b.model,language:l}}else if("gemini"===ad.aiProvider){if(!ad.gemini?.apiKey){ak({success:!1,textSupport:!1,visionSupport:!1,textError:k.settings?.ai?.validationApiKeyRequired||"API Key is required"}),ai(!1);return}a={provider:"gemini",apiKey:ad.gemini.apiKey,baseUrl:ad.gemini.baseUrl,model:ad.gemini.model,language:l}}else if("anthropic"===ad.aiProvider){if(!ad.anthropic?.apiKey){ak({success:!1,textSupport:!1,visionSupport:!1,textError:k.settings?.ai?.validationApiKeyRequired||"API Key is required"}),ai(!1);return}a={provider:"anthropic",apiKey:ad.anthropic.apiKey,baseUrl:ad.anthropic.baseUrl,model:ad.anthropic.model,language:l}}else if(aw(ad.aiProvider)){let b=ad[ad.aiProvider];if(!b?.apiKey){ak({success:!1,textSupport:!1,visionSupport:!1,textError:k.settings?.ai?.validationApiKeyRequired||"API Key is required"}),ai(!1);return}a={provider:ad.aiProvider,apiKey:b.apiKey,baseUrl:b.baseUrl,model:b.model,language:l}}else{if("azure"!==ad.aiProvider)return void ai(!1);if(!ad.azure?.apiKey||!ad.azure?.endpoint||!ad.azure?.deploymentName){ak({success:!1,textSupport:!1,visionSupport:!1,textError:k.settings?.ai?.validationAzureEndpointRequired||"Azure config is incomplete"}),ai(!1);return}a={provider:"azure",apiKey:ad.azure.apiKey,endpoint:ad.azure.endpoint,deploymentName:ad.azure.deploymentName,apiVersion:ad.azure.apiVersion,model:ad.azure.model,language:l}}let b=await aq.apiClient.post("/api/ai/test",a);ak(b)}catch(a){at.frontendLogger.error("[SettingsDialog]","AI connection test failed",{error:a instanceof Error?a.message:String(a)}),ak({success:!1,textSupport:!1,visionSupport:!1,textError:a instanceof Error?a.message:String(a)})}finally{ai(!1)}};return(0,b.jsxs)(s.Dialog,{open:n,onOpenChange:p,children:[(0,b.jsx)(s.DialogTrigger,{asChild:!0,children:(0,b.jsxs)(r.Button,{variant:"ghost",size:"icon",className:"rounded-full",children:[(0,b.jsx)(x,{className:"h-5 w-5"}),(0,b.jsx)("span",{className:"sr-only",children:k.settings?.title||"Settings"})]})}),(0,b.jsxs)(s.DialogContent,{ref:O,className:"w-[calc(100vw-2rem)] sm:max-w-[900px] max-h-[85vh] overflow-y-auto",children:[(0,b.jsxs)(s.DialogHeader,{children:[(0,b.jsx)(s.DialogTitle,{children:k.settings?.title||"Settings"}),(0,b.jsx)(s.DialogDescription,{children:k.settings?.desc||"Manage your preferences and data."})]}),(0,b.jsxs)(w.Tabs,{defaultValue:"general",className:"w-full",children:[(0,b.jsxs)(w.TabsList,{className:`grid w-full grid-cols-4 ${g?.user?.role==="admin"?"sm:grid-cols-7":"sm:grid-cols-4"} gap-1 h-auto`,children:[(0,b.jsxs)(w.TabsTrigger,{value:"general",className:"px-2 sm:px-3",children:[(0,b.jsx)(D.Languages,{className:"h-4 w-4 sm:mr-2"}),(0,b.jsx)("span",{className:"hidden sm:inline",children:k.settings?.tabs?.general||"General"})]}),(0,b.jsxs)(w.TabsTrigger,{value:"account",className:"px-2 sm:px-3",children:[(0,b.jsx)(E.User,{className:"h-4 w-4 sm:mr-2"}),(0,b.jsx)("span",{className:"hidden sm:inline",children:k.settings?.tabs?.account||"Account"})]}),g?.user?.role==="admin"&&(0,b.jsxs)(b.Fragment,{children:[(0,b.jsxs)(w.TabsTrigger,{value:"ai",className:"px-2 sm:px-3",children:[(0,b.jsx)(F,{className:"h-4 w-4 sm:mr-2"}),(0,b.jsx)("span",{className:"hidden sm:inline",children:k.settings?.tabs?.ai||"AI Provider"})]}),(0,b.jsxs)(w.TabsTrigger,{value:"prompts",className:"px-2 sm:px-3",children:[(0,b.jsx)(aV,{className:"h-4 w-4 sm:mr-2"}),(0,b.jsx)("span",{className:"hidden sm:inline",children:k.settings?.tabs?.prompts||"Prompts"})]}),(0,b.jsxs)(w.TabsTrigger,{value:"admin",className:"px-2 sm:px-3",children:[(0,b.jsx)(o,{className:"h-4 w-4 sm:mr-2"}),(0,b.jsx)("span",{className:"hidden sm:inline",children:k.settings?.tabs?.admin||"User Management"})]})]}),(0,b.jsxs)(w.TabsTrigger,{value:"danger",className:"px-2 sm:px-3",children:[(0,b.jsx)(A,{className:"h-4 w-4 sm:mr-2"}),(0,b.jsx)("span",{className:"hidden sm:inline",children:k.settings?.tabs?.danger||"Danger"})]}),(0,b.jsxs)(w.TabsTrigger,{value:"about",className:"px-2 sm:px-3",children:[(0,b.jsx)(aF,{className:"h-4 w-4 sm:mr-2"}),(0,b.jsx)("span",{className:"hidden sm:inline",children:k.settings?.tabs?.about||"About"})]})]}),(0,b.jsxs)(w.TabsContent,{value:"general",className:"space-y-4 py-4",children:[(0,b.jsxs)("div",{className:"space-y-4 border rounded-lg p-4 bg-muted/30",children:[(0,b.jsxs)("div",{className:"space-y-2",children:[(0,b.jsx)(u.Label,{children:k.settings?.language||"Language"}),(0,b.jsxs)(v.Select,{value:l,onValueChange:a=>m(a),children:[(0,b.jsx)(v.SelectTrigger,{children:(0,b.jsx)(v.SelectValue,{})}),(0,b.jsxs)(v.SelectContent,{children:[(0,b.jsx)(v.SelectItem,{value:"zh",children:"中文 (Chinese)"}),(0,b.jsx)(v.SelectItem,{value:"en",children:"English"})]})]})]}),(0,b.jsx)(aP,{value:ad.timeZone??a,onChange:a=>ae(b=>({...b,timeZone:a})),disabled:!j||Z||X}),j&&(0,b.jsxs)("div",{className:"space-y-2 pt-4 border-t",children:[(0,b.jsx)(u.Label,{children:k.settings?.general?.timeoutLabel||"AI Analysis Timeout (Seconds)"}),(0,b.jsx)(t.Input,{type:"number",value:ad.timeouts?.analyze?ad.timeouts.analyze/1e3:"",onChange:a=>{let b=""===a.target.value?0:parseInt(a.target.value);ae(a=>({...a,timeouts:{...a.timeouts,analyze:isNaN(b)?0:1e3*b}}))},onBlur:()=>{let a=(ad.timeouts?.analyze||0)/1e3,b=a;b<120&&(b=120),b>600&&(b=600),b!==a&&ae(a=>({...a,timeouts:{...a.timeouts,analyze:1e3*b}}))},min:120,max:600}),(0,b.jsx)("p",{className:"text-xs text-muted-foreground",children:k.settings?.general?.timeoutDesc||"Increase this value if you experience frequent timeouts during AI analysis."})]}),(0,b.jsx)(aJ,{}),(0,b.jsx)(aL,{}),(0,b.jsx)(aK,{}),(0,b.jsx)(aO.DuplicateThresholdSetting,{})]}),j&&(0,b.jsxs)(r.Button,{onClick:a3,disabled:X,className:"w-full",children:[X&&(0,b.jsx)(z.Loader2,{className:"mr-2 h-4 w-4 animate-spin"}),k.settings?.save||"Save Settings"]})]}),(0,b.jsx)(w.TabsContent,{value:"account",className:"space-y-4 py-4",children:ap?(0,b.jsx)("div",{className:"flex justify-center py-8",children:(0,b.jsx)(z.Loader2,{className:"h-8 w-8 animate-spin text-muted-foreground"})}):(0,b.jsxs)("div",{className:"space-y-4 border rounded-lg p-4 bg-muted/30",children:[(0,b.jsxs)("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-4",children:[(0,b.jsxs)("div",{className:"space-y-2",children:[(0,b.jsx)(u.Label,{children:k.auth?.name||"Name"}),(0,b.jsx)(t.Input,{value:al.name||"",onChange:a=>am({...al,name:a.target.value})})]}),(0,b.jsxs)("div",{className:"space-y-2",children:[(0,b.jsx)(u.Label,{children:k.auth?.email||"Email"}),(0,b.jsx)(t.Input,{value:al.email||"",onChange:a=>am({...al,email:a.target.value}),type:"email"})]})]}),(0,b.jsxs)("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-4",children:[(0,b.jsxs)("div",{className:"space-y-2",children:[(0,b.jsx)(u.Label,{children:k.auth?.educationStage||"Education Stage"}),(0,b.jsxs)(v.Select,{value:al.educationStage||"",onValueChange:a=>am({...al,educationStage:a}),children:[(0,b.jsx)(v.SelectTrigger,{children:(0,b.jsx)(v.SelectValue,{placeholder:k.auth?.selectStage||"Select Stage"})}),(0,b.jsxs)(v.SelectContent,{children:[(0,b.jsx)(v.SelectItem,{value:"primary",children:k.auth?.primary||"Primary School"}),(0,b.jsx)(v.SelectItem,{value:"junior_high",children:k.auth?.juniorHigh||"Junior High"}),(0,b.jsx)(v.SelectItem,{value:"senior_high",children:k.auth?.seniorHigh||"Senior High"}),(0,b.jsx)(v.SelectItem,{value:"university",children:k.auth?.university||"University"})]})]})]}),(0,b.jsxs)("div",{className:"space-y-2",children:[(0,b.jsx)(u.Label,{children:k.auth?.enrollmentYear||"Enrollment Year"}),(0,b.jsx)(t.Input,{type:"number",value:al.enrollmentYear||"",onChange:a=>am({...al,enrollmentYear:a.target.value}),placeholder:"YYYY"})]})]}),(0,b.jsxs)("div",{className:"space-y-3 pt-2 border-t",children:[(0,b.jsxs)("div",{className:"space-y-2",children:[(0,b.jsx)(u.Label,{children:k.settings?.account?.changePassword||"Change Password (Leave empty to keep)"}),(0,b.jsxs)("div",{className:"relative",children:[(0,b.jsx)(t.Input,{type:aB?"text":"password",value:al.password,onChange:a=>am({...al,password:a.target.value}),placeholder:"******",minLength:6,className:"pr-10"}),(0,b.jsx)(r.Button,{type:"button",variant:"ghost",size:"icon",className:"absolute right-0 top-0 h-full px-3 py-2 hover:bg-transparent",onClick:()=>aC(!aB),tabIndex:-1,children:aB?(0,b.jsx)(C.EyeOff,{className:"h-4 w-4 text-muted-foreground"}):(0,b.jsx)(B.Eye,{className:"h-4 w-4 text-muted-foreground"})})]})]}),al.password&&(0,b.jsxs)("div",{className:"space-y-2",children:[(0,b.jsx)(u.Label,{children:k.auth?.confirmPassword||"Confirm Password"}),(0,b.jsxs)("div",{className:"relative",children:[(0,b.jsx)(t.Input,{type:aD?"text":"password",value:an,onChange:a=>ao(a.target.value),placeholder:"******",minLength:6,className:"pr-10"}),(0,b.jsx)(r.Button,{type:"button",variant:"ghost",size:"icon",className:"absolute right-0 top-0 h-full px-3 py-2 hover:bg-transparent",onClick:()=>aE(!aD),tabIndex:-1,children:aD?(0,b.jsx)(C.EyeOff,{className:"h-4 w-4 text-muted-foreground"}):(0,b.jsx)(B.Eye,{className:"h-4 w-4 text-muted-foreground"})})]})]})]}),(0,b.jsxs)(r.Button,{onClick:a4,disabled:az,className:"w-full",children:[az&&(0,b.jsx)(z.Loader2,{className:"mr-2 h-4 w-4 animate-spin"}),k.settings?.account?.update||"Update Profile"]})]})}),(0,b.jsx)(w.TabsContent,{value:"ai",className:"space-y-4 py-4",children:Z?(0,b.jsx)("div",{className:"flex justify-center py-4",children:(0,b.jsx)(z.Loader2,{className:"h-6 w-6 animate-spin text-muted-foreground"})}):(0,b.jsxs)("div",{className:"space-y-4 border rounded-lg p-4 bg-muted/30",children:[(0,b.jsxs)("div",{className:"space-y-2",children:[(0,b.jsx)(u.Label,{children:k.settings?.tabs?.ai||"AI Provider"}),(0,b.jsxs)(v.Select,{value:ad.aiProvider,onValueChange:a=>ae(b=>({...b,aiProvider:a})),children:[(0,b.jsx)(v.SelectTrigger,{children:(0,b.jsx)(v.SelectValue,{})}),(0,b.jsxs)(v.SelectContent,{children:[av.map(a=>(0,b.jsx)(v.SelectItem,{value:a,children:au[a].name},a)),(0,b.jsx)(v.SelectItem,{value:"anthropic",children:"Anthropic / Compatible"}),(0,b.jsx)(v.SelectItem,{value:"azure",children:"Azure OpenAI"}),(0,b.jsx)(v.SelectItem,{value:"openai",children:"OpenAI / Compatible"}),(0,b.jsx)(v.SelectItem,{value:"gemini",children:"Google Gemini"})]})]})]}),"openai"===ad.aiProvider&&(0,b.jsxs)("div",{className:"space-y-3 animate-in fade-in slide-in-from-top-2",children:[(0,b.jsxs)("div",{className:"space-y-2",children:[(0,b.jsxs)("div",{className:"flex items-center justify-between",children:[(0,b.jsx)(u.Label,{children:k.settings?.ai?.instances||"Instance"}),(0,b.jsxs)(r.Button,{type:"button",variant:"outline",size:"sm",onClick:()=>{let a=ad.openai?.instances||[];if(a.length>=10)return;let b={id:"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,a=>{let b=16*Math.random()|0;return("x"===a?b:3&b|8).toString(16)}),name:`Instance ${a.length+1}`,apiKey:"",baseUrl:"https://api.openai.com/v1",model:"gpt-6.1-sol"};ae(a=>({...a,openai:{instances:[...a.openai?.instances||[],b],activeInstanceId:b.id}})),ag(b.id)},disabled:(ad.openai?.instances?.length||0)>=10,className:"h-7 px-2 text-xs",children:[(0,b.jsx)(H.Plus,{className:"h-3 w-3 mr-1"}),k.settings?.ai?.addInstance||"Add"]})]}),(ad.openai?.instances?.length||0)>0?(0,b.jsxs)("div",{className:"flex gap-2",children:[(0,b.jsxs)(v.Select,{value:af||ad.openai?.activeInstanceId||"",onValueChange:a=>{ag(a),ae(b=>({...b,openai:{...b.openai,activeInstanceId:a}}))},children:[(0,b.jsx)(v.SelectTrigger,{className:"flex-1",children:(0,b.jsx)(v.SelectValue,{placeholder:k.settings?.ai?.selectInstance||"Select Instance"})}),(0,b.jsx)(v.SelectContent,{children:(ad.openai?.instances||[]).map(a=>(0,b.jsx)(v.SelectItem,{value:a.id,children:a.name},a.id))})]}),(ad.openai?.instances?.length||0)>1&&(0,b.jsx)(r.Button,{type:"button",variant:"outline",size:"icon",onClick:async()=>{let a,b,c=af||ad.openai?.activeInstanceId;c&&await (0,ar.confirmDialog)(k.settings?.ai?.confirmDelete||"Delete this instance?",{destructive:!0})&&(b=(a=(ad.openai?.instances||[]).filter(a=>a.id!==c)).length>0?a[0].id:void 0,ae(c=>({...c,openai:{instances:a,activeInstanceId:b}})),ag(b))},className:"h-10 w-10 text-destructive hover:text-destructive",children:(0,b.jsx)(y.Trash2,{className:"h-4 w-4"})})]}):(0,b.jsx)("p",{className:"text-sm text-muted-foreground",children:k.settings?.ai?.noInstances||"No instances configured. Click 'Add' to create one."}),(ad.openai?.instances?.length||0)>=10&&(0,b.jsx)("p",{className:"text-xs text-amber-600",children:k.settings?.ai?.maxInstancesReached||"Maximum instances reached (10)"})]}),be()&&(0,b.jsxs)("div",{className:"space-y-3 p-3 border rounded-md bg-background",children:[(0,b.jsxs)("div",{className:"space-y-2",children:[(0,b.jsxs)(u.Label,{children:[k.settings?.ai?.instanceName||"Instance Name"," ",(0,b.jsx)("span",{className:"text-destructive",children:"*"})]}),(0,b.jsx)(t.Input,{value:be()?.name||"",onChange:a=>bf("name",a.target.value),placeholder:"e.g. 智谱 GLM-4V",className:be()?.name?.trim()?"":"border-destructive"})]}),(0,b.jsxs)("div",{className:"space-y-2",children:[(0,b.jsxs)(u.Label,{children:["API Key ",(0,b.jsx)("span",{className:"text-destructive",children:"*"})]}),(0,b.jsxs)("div",{className:"relative",children:[(0,b.jsx)(t.Input,{type:ab?"text":"password",value:be()?.apiKey||"",onChange:a=>bf("apiKey",a.target.value),placeholder:"sk-...",className:`pr-10 ${!be()?.apiKey?.trim()?"border-destructive":""}`}),(0,b.jsx)(r.Button,{type:"button",variant:"ghost",size:"icon",className:"absolute right-0 top-0 h-full px-3 py-2 hover:bg-transparent",onClick:()=>ac(!ab),children:ab?(0,b.jsx)(C.EyeOff,{className:"h-4 w-4 text-muted-foreground"}):(0,b.jsx)(B.Eye,{className:"h-4 w-4 text-muted-foreground"})})]})]}),(0,b.jsxs)("div",{className:"space-y-2 pt-4 border-t",children:[(0,b.jsxs)(u.Label,{children:["Base URL ",(0,b.jsx)("span",{className:"text-destructive",children:"*"})]}),(0,b.jsx)(t.Input,{value:be()?.baseUrl||"",onChange:a=>bf("baseUrl",a.target.value),placeholder:"https://api.openai.com/v1",className:be()?.baseUrl?.trim()?"":"border-destructive"})]}),(0,b.jsx)(ax,{provider:"openai",apiKey:be()?.apiKey,baseUrl:be()?.baseUrl,currentModel:be()?.model,onModelChange:a=>bf("model",a)})]})]}),"gemini"===ad.aiProvider&&(0,b.jsxs)("div",{className:"space-y-3 animate-in fade-in slide-in-from-top-2",children:[(0,b.jsxs)("div",{className:"space-y-2",children:[(0,b.jsx)(u.Label,{children:"API Key"}),(0,b.jsxs)("div",{className:"relative",children:[(0,b.jsx)(t.Input,{type:ab?"text":"password",value:ad.gemini?.apiKey||"",onChange:a=>bd("gemini","apiKey",a.target.value),placeholder:"AIza...",className:"pr-10"}),(0,b.jsx)(r.Button,{type:"button",variant:"ghost",size:"icon",className:"absolute right-0 top-0 h-full px-3 py-2 hover:bg-transparent",onClick:()=>ac(!ab),children:ab?(0,b.jsx)(C.EyeOff,{className:"h-4 w-4 text-muted-foreground"}):(0,b.jsx)(B.Eye,{className:"h-4 w-4 text-muted-foreground"})})]})]}),(0,b.jsxs)("div",{className:"space-y-2",children:[(0,b.jsx)(u.Label,{children:"Base URL (Optional)"}),(0,b.jsx)(t.Input,{value:ad.gemini?.baseUrl||"",onChange:a=>bd("gemini","baseUrl",a.target.value),placeholder:"https://generativelanguage.googleapis.com"})]}),(0,b.jsx)(ax,{provider:"gemini",apiKey:ad.gemini?.apiKey,baseUrl:ad.gemini?.baseUrl,currentModel:ad.gemini?.model,onModelChange:a=>bd("gemini","model",a)})]}),"anthropic"===ad.aiProvider&&(0,b.jsx)(aM,{value:ad.anthropic,onChange:a=>ae(b=>({...b,anthropic:a}))}),aw(ad.aiProvider)&&(0,b.jsx)(aN,{provider:ad.aiProvider,value:ad[ad.aiProvider],onChange:a=>ae(b=>({...b,[b.aiProvider]:a}))},ad.aiProvider),"azure"===ad.aiProvider&&(0,b.jsxs)("div",{className:"space-y-3 animate-in fade-in slide-in-from-top-2",children:[(0,b.jsxs)("div",{className:"space-y-2",children:[(0,b.jsxs)(u.Label,{children:[k.settings?.ai?.azureEndpoint||"Azure Endpoint"," ",(0,b.jsx)("span",{className:"text-destructive",children:"*"})]}),(0,b.jsx)(t.Input,{value:ad.azure?.endpoint||"",onChange:a=>ae(b=>({...b,azure:{...b.azure,endpoint:a.target.value}})),placeholder:k.settings?.ai?.azureEndpointPlaceholder||"https://your-resource.openai.azure.com",className:ad.azure?.endpoint?.trim()?"":"border-destructive"})]}),(0,b.jsxs)("div",{className:"space-y-2",children:[(0,b.jsxs)(u.Label,{children:[k.settings?.ai?.azureDeployment||"Deployment Name"," ",(0,b.jsx)("span",{className:"text-destructive",children:"*"})]}),(0,b.jsx)(t.Input,{value:ad.azure?.deploymentName||"",onChange:a=>ae(b=>({...b,azure:{...b.azure,deploymentName:a.target.value}})),placeholder:k.settings?.ai?.azureDeploymentPlaceholder||"gpt-4o-deployment",className:ad.azure?.deploymentName?.trim()?"":"border-destructive"})]}),(0,b.jsxs)("div",{className:"space-y-2",children:[(0,b.jsxs)(u.Label,{children:["API Key ",(0,b.jsx)("span",{className:"text-destructive",children:"*"})]}),(0,b.jsxs)("div",{className:"relative",children:[(0,b.jsx)(t.Input,{type:ab?"text":"password",value:ad.azure?.apiKey||"",onChange:a=>ae(b=>({...b,azure:{...b.azure,apiKey:a.target.value}})),placeholder:"xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",className:`pr-10 ${!ad.azure?.apiKey?.trim()?"border-destructive":""}`}),(0,b.jsx)(r.Button,{type:"button",variant:"ghost",size:"icon",className:"absolute right-0 top-0 h-full px-3 py-2 hover:bg-transparent",onClick:()=>ac(!ab),children:ab?(0,b.jsx)(C.EyeOff,{className:"h-4 w-4 text-muted-foreground"}):(0,b.jsx)(B.Eye,{className:"h-4 w-4 text-muted-foreground"})})]})]}),(0,b.jsxs)("div",{className:"space-y-2",children:[(0,b.jsx)(u.Label,{children:k.settings?.ai?.azureApiVersion||"API Version"}),(0,b.jsx)(t.Input,{value:ad.azure?.apiVersion||"",onChange:a=>ae(b=>({...b,azure:{...b.azure,apiVersion:a.target.value}})),placeholder:k.settings?.ai?.azureApiVersionPlaceholder||"2024-02-15-preview"})]}),(0,b.jsxs)("div",{className:"space-y-2",children:[(0,b.jsx)(u.Label,{children:k.settings?.ai?.azureModel||"Model Display Name"}),(0,b.jsx)(t.Input,{value:ad.azure?.model||"",onChange:a=>ae(b=>({...b,azure:{...b.azure,model:a.target.value}})),placeholder:"gpt-4o"})]})]}),(0,b.jsxs)("div",{className:"space-y-3 pt-3 border-t",children:[(0,b.jsxs)("div",{className:"flex gap-2",children:[(0,b.jsxs)(r.Button,{type:"button",variant:"outline",onClick:bg,disabled:ah||X,className:"flex-1",children:[ah?(0,b.jsx)(z.Loader2,{className:"mr-2 h-4 w-4 animate-spin"}):(0,b.jsx)(I,{className:"mr-2 h-4 w-4"}),ah?k.settings?.ai?.testing||"测试中...":k.settings?.ai?.testConnection||"测试连接"]}),(0,b.jsxs)(r.Button,{onClick:a3,disabled:X||ah,className:"flex-1",children:[X&&(0,b.jsx)(z.Loader2,{className:"mr-2 h-4 w-4 animate-spin"}),k.settings?.ai?.save||"Save AI Settings"]})]}),aj&&(0,b.jsxs)("div",{className:`p-3 rounded-md text-sm ${aj.success?"bg-green-50 border border-green-200":"bg-red-50 border border-red-200"}`,children:[(0,b.jsx)("div",{className:"flex items-center gap-2 font-medium mb-2",children:aj.success?(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)(J,{className:"h-4 w-4 text-green-600"}),(0,b.jsx)("span",{className:"text-green-700",children:k.settings?.ai?.testSuccess||"连接成功"}),aj.modelInfo&&(0,b.jsxs)("span",{className:"text-green-600 text-xs",children:["(",aj.modelInfo,")"]})]}):(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)(K.XCircle,{className:"h-4 w-4 text-red-600"}),(0,b.jsx)("span",{className:"text-red-700",children:k.settings?.ai?.testFailed||"连接失败"})]})}),aj.success&&(0,b.jsxs)("div",{className:"space-y-1 text-xs",children:[(0,b.jsxs)("div",{className:"flex items-center gap-2",children:[(0,b.jsxs)("span",{className:"text-muted-foreground",children:[k.settings?.ai?.textSupport||"文本生成",":"]}),(0,b.jsxs)("span",{className:"text-green-600",children:["✓ ",k.settings?.ai?.supported||"支持"]})]}),(0,b.jsxs)("div",{className:"flex items-center gap-2",children:[(0,b.jsxs)("span",{className:"text-muted-foreground",children:[k.settings?.ai?.visionSupport||"图像识别/多模态",":"]}),aj.visionSupport?(0,b.jsxs)("span",{className:"text-green-600",children:["✓ ",k.settings?.ai?.supported||"支持"]}):(0,b.jsxs)("span",{className:"text-amber-600",children:["✗ ",aj.visionError?k.settings?.ai?.errors?.[aj.visionError]||aj.visionError.replace("UNKNOWN:",""):k.settings?.ai?.notSupported||"不支持"]})]}),(0,b.jsx)("p",{className:"text-muted-foreground/60 text-[10px] pl-1",children:"* 由于网络问题,可能测试结果不准确"})]}),!aj.success&&aj.textError&&(0,b.jsx)("p",{className:"text-red-600 text-xs mt-1",children:k.settings?.ai?.errors?.[aj.textError]||aj.textError.replace("UNKNOWN:","")})]})]})]})}),(0,b.jsxs)(w.TabsContent,{value:"prompts",className:"space-y-4 py-4",children:[(0,b.jsx)(aH,{config:ad,onUpdate:(a,b)=>{ae(c=>({...c,prompts:{...c.prompts,[a]:b}}))}}),(0,b.jsxs)(r.Button,{onClick:a3,disabled:X,className:"w-full",children:[X&&(0,b.jsx)(z.Loader2,{className:"mr-2 h-4 w-4 animate-spin"}),k.settings?.prompts?.save||"Save Prompt Settings"]})]}),g?.user?.role==="admin"&&(0,b.jsxs)(w.TabsContent,{value:"admin",className:"space-y-4 py-4",children:[(0,b.jsxs)(r.Button,{variant:"outline",className:"w-full justify-start gap-2",onClick:()=>{p(!1),a0.push("/admin")},children:[(0,b.jsx)(i.BarChart3,{className:"h-4 w-4"}),k.admin?.dashboard?.title||"Admin Dashboard"]}),(0,b.jsx)("div",{className:"border-t pt-4",children:(0,b.jsx)(as,{})})]}),(0,b.jsx)(w.TabsContent,{value:"danger",className:"space-y-4 py-4",children:(0,b.jsxs)("div",{className:"space-y-3",children:[(0,b.jsxs)("div",{className:"p-4 border border-blue-200 rounded-lg bg-blue-50",children:[(0,b.jsx)("h4",{className:"text-sm font-bold text-blue-900 mb-3",children:k.settings?.dataManagement||"Data Management"}),(0,b.jsxs)("div",{className:"mb-4",children:[(0,b.jsxs)("div",{className:"flex items-center justify-between mb-2",children:[(0,b.jsx)("span",{className:"text-sm text-blue-800 font-medium",children:k.settings?.exportData||"Export Data"}),(0,b.jsxs)("div",{className:"flex items-center gap-2",children:[(0,b.jsxs)(r.Button,{variant:"outline",size:"sm",onClick:a8,disabled:aG,className:"bg-blue-100 hover:bg-blue-200 text-blue-900 border-blue-300",children:[aG?(0,b.jsx)(z.Loader2,{className:"mr-2 h-4 w-4 animate-spin"}):(0,b.jsx)(L.Download,{className:"mr-2 h-4 w-4"}),k.settings?.exportData||"Export"]}),g?.user?.role==="admin"&&(0,b.jsxs)(r.Button,{variant:"outline",size:"sm",onClick:a9,disabled:aG,className:"bg-orange-100 hover:bg-orange-200 text-orange-900 border-orange-300",children:[aG?(0,b.jsx)(z.Loader2,{className:"mr-2 h-4 w-4 animate-spin"}):(0,b.jsx)(L.Download,{className:"mr-2 h-4 w-4"}),k.settings?.exportAllData||"Export All"]})]})]}),(0,b.jsx)("p",{className:"text-xs text-blue-700",children:k.settings?.exportDataDesc||"Export all data as JSON file."})]}),(0,b.jsxs)("div",{children:[(0,b.jsxs)("div",{className:"flex items-center justify-between mb-2",children:[(0,b.jsx)("span",{className:"text-sm text-blue-800 font-medium",children:k.settings?.importData||"Import Data"}),(0,b.jsxs)("div",{className:"flex items-center gap-2",children:[(0,b.jsx)("input",{type:"file",accept:".json",onChange:a=>{let b=a.target.files?.[0];b&&(aZ(b),a_(b.name))},className:"hidden",id:"import-file-input",disabled:aQ}),(0,b.jsxs)(r.Button,{variant:"outline",size:"sm",onClick:()=>document.getElementById("import-file-input")?.click(),disabled:aQ,className:"bg-blue-100 hover:bg-blue-200 text-blue-900 border-blue-300",children:[aQ?(0,b.jsx)(z.Loader2,{className:"mr-2 h-4 w-4 animate-spin"}):(0,b.jsx)(M,{className:"mr-2 h-4 w-4"}),a$||k.settings?.selectFile||"Select File"]}),aS&&(0,b.jsxs)(r.Button,{variant:"outline",size:"sm",onClick:ba,disabled:aQ,className:"bg-green-100 hover:bg-green-200 text-green-900 border-green-300",children:[aQ?(0,b.jsx)(z.Loader2,{className:"mr-2 h-4 w-4 animate-spin"}):(0,b.jsx)(J,{className:"mr-2 h-4 w-4"}),k.settings?.importData||"Import"]}),aS&&g?.user?.role==="admin"&&(0,b.jsxs)(r.Button,{variant:"outline",size:"sm",onClick:bb,disabled:aQ,className:"bg-orange-100 hover:bg-orange-200 text-orange-900 border-orange-300",children:[aQ?(0,b.jsx)(z.Loader2,{className:"mr-2 h-4 w-4 animate-spin"}):(0,b.jsx)(J,{className:"mr-2 h-4 w-4"}),k.settings?.importAllData||"Import All"]})]})]}),(0,b.jsx)("p",{className:"text-xs text-blue-700",children:k.settings?.importDataDesc||"Import data from JSON file. Existing data will be skipped."})]})]}),g?.user?.role==="admin"&&(0,b.jsxs)("div",{className:"p-4 border border-blue-200 rounded-lg bg-blue-50",children:[(0,b.jsxs)("div",{className:"flex items-center justify-between",children:[(0,b.jsx)("div",{className:"flex flex-col",children:(0,b.jsxs)("span",{className:"text-sm text-blue-900 font-bold flex items-center gap-2",children:[(0,b.jsx)(G.RefreshCw,{className:"h-4 w-4"}),k.settings?.migrateTags||"Migrate Tags"]})}),(0,b.jsx)(r.Button,{variant:"outline",size:"sm",onClick:bc,disabled:V,className:"bg-blue-100 hover:bg-blue-200 text-blue-900 border-blue-300",children:V?(0,b.jsx)(z.Loader2,{className:"h-4 w-4 animate-spin"}):(0,b.jsx)(G.RefreshCw,{className:"h-4 w-4"})})]}),(0,b.jsx)("p",{className:"text-xs text-blue-800 mt-2 font-medium",children:k.settings?.migrateTagsDesc||"Re-populates standard tags from file"})]}),(0,b.jsxs)("div",{className:"p-4 border border-red-200 rounded-lg bg-red-50",children:[(0,b.jsxs)("div",{className:"flex items-center justify-between",children:[(0,b.jsx)("span",{className:"text-sm text-red-700 font-medium",children:k.settings?.clearData||"Clear Practice Data"}),(0,b.jsx)(r.Button,{variant:"destructive",size:"sm",onClick:a5,disabled:P,children:P?(0,b.jsx)(z.Loader2,{className:"h-4 w-4 animate-spin"}):(0,b.jsx)(y.Trash2,{className:"h-4 w-4"})})]}),(0,b.jsx)("p",{className:"text-xs text-red-600 mt-2",children:k.settings?.clearDataDesc||"This will permanently delete all practice history. Irreversible."})]}),(0,b.jsxs)("div",{className:"p-4 border border-red-200 rounded-lg bg-red-50",children:[(0,b.jsxs)("div",{className:"flex items-center justify-between",children:[(0,b.jsx)("span",{className:"text-sm text-red-700 font-medium",children:k.settings?.clearErrorData||"Clear Error Data"}),(0,b.jsx)(r.Button,{variant:"destructive",size:"sm",onClick:a6,disabled:R,children:R?(0,b.jsx)(z.Loader2,{className:"h-4 w-4 animate-spin"}):(0,b.jsx)(y.Trash2,{className:"h-4 w-4"})})]}),(0,b.jsx)("p",{className:"text-xs text-red-600 mt-2",children:k.settings?.clearErrorDataDesc||"This will permanently delete all error items. Irreversible."})]}),g?.user?.role==="admin"&&(0,b.jsx)(b.Fragment,{children:(0,b.jsxs)("div",{className:"p-4 border border-red-600/50 rounded-lg bg-red-100/50",children:[(0,b.jsxs)("div",{className:"flex items-center justify-between",children:[(0,b.jsx)("div",{className:"flex flex-col",children:(0,b.jsxs)("span",{className:"text-sm text-red-900 font-bold flex items-center gap-2",children:[(0,b.jsx)(A,{className:"h-4 w-4"}),k.settings?.systemReset||"System Initialization"]})}),(0,b.jsx)(r.Button,{variant:"destructive",size:"sm",onClick:a7,disabled:T,className:"bg-red-700 hover:bg-red-800",children:T?(0,b.jsx)(z.Loader2,{className:"h-4 w-4 animate-spin"}):(0,b.jsx)(y.Trash2,{className:"h-4 w-4"})})]}),(0,b.jsx)("p",{className:"text-xs text-red-800 mt-2 font-medium",children:k.settings?.systemResetDesc||"Resets the system to factory state. Deletes ALL data."})]})})]})}),(0,b.jsx)(w.TabsContent,{value:"about",className:"space-y-4 py-4",children:(0,b.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,b.jsxs)("div",{className:"space-y-2",children:[(0,b.jsx)("h3",{className:"text-2xl font-bold",children:k.app?.title||"Smart Error Notebook"}),(0,b.jsx)("p",{className:"text-muted-foreground",children:k.settings?.about?.desc||"AI-powered learning assistant"})]}),(0,b.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,b.jsx)(aF,{className:"h-4 w-4"}),(0,b.jsxs)("span",{children:[k.settings?.about?.version||"Version",": v",_||"unknown"]})]}),(0,b.jsx)(aT,{}),(0,b.jsxs)("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:[(0,b.jsx)(r.Button,{variant:"outline",asChild:!0,className:"gap-2 w-full sm:w-auto",children:(0,b.jsxs)("a",{href:aU,target:"_blank",rel:"noopener noreferrer",children:[(0,b.jsx)(aX,{className:"h-4 w-4"}),k.settings?.about?.github||"GitHub Repository",(0,b.jsx)(aW,{className:"h-3 w-3 ml-1 opacity-50"})]})}),(0,b.jsx)(r.Button,{variant:"outline",asChild:!0,className:"gap-2 w-full sm:w-auto",children:(0,b.jsxs)("a",{href:`${aU}/releases`,target:"_blank",rel:"noopener noreferrer",children:[(0,b.jsx)(aY,{className:"h-4 w-4"}),k.settings?.about?.releaseNotes||"Release Notes",(0,b.jsx)(aW,{className:"h-3 w-3 ml-1 opacity-50"})]})}),(0,b.jsx)(r.Button,{variant:"outline",asChild:!0,className:"gap-2 w-full sm:w-auto",children:(0,b.jsxs)("a",{href:`${aU}/issues`,target:"_blank",rel:"noopener noreferrer",children:[(0,b.jsx)(aV,{className:"h-4 w-4"}),k.settings?.about?.feedback||"Feedback",(0,b.jsx)(aW,{className:"h-3 w-3 ml-1 opacity-50"})]})})]}),(0,b.jsx)("p",{className:"text-xs text-muted-foreground mt-8",children:k.settings?.about?.copyright||"© 2026 margrop · Based on wttwins/wrong-notebook · MIT License"})]})})]})]})]})}let a$=[/^\/login/,/^\/register/,/^\/print-preview/,/^\/exams\/[^/]+\/print/],a_=[{key:"home",href:"/",icon:n,match:a=>"/"===a},{key:"notebooks",href:"/notebooks",icon:j.BookOpen,match:a=>a.startsWith("/notebooks")||a.startsWith("/error-items")||a.startsWith("/practice")},{key:"tags",href:"/tags",icon:p,match:a=>a.startsWith("/tags")},{key:"stats",href:"/stats",icon:i.BarChart3,match:a=>a.startsWith("/stats")},{key:"exams",href:"/exams",icon:k.FileText,match:a=>a.startsWith("/exams")}];function a0({children:a}){let e=(0,h.usePathname)()||"/",{t:i}=(0,c.useLanguage)(),{data:j,status:k}=(0,d.useSession)();if(a$.some(a=>a.test(e))||"unauthenticated"===k)return(0,b.jsx)(b.Fragment,{children:a});let l=j?.user?.role==="admin",n=j?.user?.name||j?.user?.email||"";return(0,b.jsxs)("div",{className:"min-h-screen",children:[(0,b.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,b.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,b.jsxs)(g.default,{href:"/",className:"flex shrink-0 items-center gap-2",children:[(0,b.jsx)(f.default,{src:"/icons/icon.png",alt:"",width:32,height:32,className:"rounded-lg",priority:!0,unoptimized:!0}),(0,b.jsx)("span",{className:"text-base font-semibold tracking-tight",children:i.pageTitle.base})]}),(0,b.jsx)("nav",{className:"ml-4 hidden items-center gap-1 md:flex",children:a_.map(a=>{let c=a.match(e),d=a.icon;return(0,b.jsxs)(g.default,{href:a.href,className:(0,ag.cn)("flex items-center gap-1.5 rounded-lg px-3 py-2 text-sm font-medium transition-colors",c?"bg-accent text-accent-foreground":"text-muted-foreground hover:bg-muted hover:text-foreground"),"aria-current":c?"page":void 0,children:[(0,b.jsx)(d,{className:"h-4 w-4"}),i.nav[a.key]]},a.key)})}),(0,b.jsxs)("div",{className:"ml-auto flex items-center gap-1",children:[n&&(0,b.jsxs)("span",{className:"mr-2 hidden max-w-40 items-center gap-2 truncate text-sm text-muted-foreground lg:flex",children:[(0,b.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:n.slice(0,1).toUpperCase()}),(0,b.jsx)("span",{className:"truncate",children:n})]}),l&&(0,b.jsx)(g.default,{href:"/admin",title:i.nav.admin,children:(0,b.jsxs)(r.Button,{variant:"ghost",size:"icon",className:"rounded-full",children:[(0,b.jsx)(o,{className:"h-5 w-5"}),(0,b.jsx)("span",{className:"sr-only",children:i.nav.admin})]})}),(0,b.jsx)(aZ,{}),(0,b.jsx)(r.Button,{variant:"ghost",size:"icon",className:"rounded-full text-muted-foreground hover:text-destructive",onClick:()=>(0,d.signOut)({callbackUrl:"/login"}),title:i.app.logout,children:(0,b.jsx)(m,{className:"h-5 w-5"})})]})]})}),(0,b.jsx)("div",{className:"pb-20 md:pb-0",children:a}),(0,b.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,b.jsx)("div",{className:"grid h-16 grid-cols-5",children:a_.map(a=>{let c=a.match(e),d=a.icon;return(0,b.jsxs)(g.default,{href:a.href,className:(0,ag.cn)("flex flex-col items-center justify-center gap-1 text-[11px] font-medium transition-colors",c?"text-primary":"text-muted-foreground"),"aria-current":c?"page":void 0,children:[(0,b.jsx)("span",{className:(0,ag.cn)("flex h-7 w-12 items-center justify-center rounded-full transition-colors",c&&"bg-accent"),children:(0,b.jsx)(d,{className:"h-5 w-5"})}),i.nav[a.key]]},a.key)})})})]})}let a1=(0,l.default)("list-todo",[["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"}]]),a2=[/^\/login/,/^\/register/,/^\/print-preview/,/^\/exams\/[^/]+\/print/];function a3(){let{t:a}=(0,c.useLanguage)(),{timeZone:f}=(0,e.useTimeZone)(),{status:i}=(0,d.useSession)(),j=(0,h.usePathname)(),[k,l]=(0,q.useState)(!1),[m,n]=(0,q.useState)([]),[o,p]=(0,q.useState)(()=>Date.now()),t="authenticated"!==i||a2.some(a=>a.test(j||"")),u=(0,q.useCallback)(async()=>{if("u"<typeof document||"hidden"!==document.visibilityState)try{let a=await aq.apiClient.get("/api/tasks");n(a.tasks),p(Date.now())}catch{}},[]);if((0,q.useEffect)(()=>{if(t)return;let a=setTimeout(u,0),b=setInterval(u,k?2e3:15e3);return()=>{clearTimeout(a),clearInterval(b)}},[t,k,u]),t)return null;let v=m.filter(a=>"running"===a.status).length,w=m.some(a=>"running"!==a.status),x=async()=>{try{let a=await aq.apiClient.delete("/api/tasks");n(a.tasks)}catch{}};return(0,b.jsxs)(b.Fragment,{children:[(0,b.jsxs)(r.Button,{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:()=>l(!0),"aria-label":a.backgroundTasks.title,title:a.backgroundTasks.title,children:[v>0?(0,b.jsx)(z.Loader2,{className:"h-5 w-5 animate-spin"}):(0,b.jsx)(a1,{className:"h-5 w-5"}),v>0&&(0,b.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:v})]}),(0,b.jsx)(s.Dialog,{open:k,onOpenChange:l,children:(0,b.jsxs)(s.DialogContent,{className:"max-h-[85vh] overflow-y-auto sm:max-w-lg",children:[(0,b.jsxs)(s.DialogHeader,{children:[(0,b.jsx)(s.DialogTitle,{children:a.backgroundTasks.title}),(0,b.jsx)(s.DialogDescription,{children:a.backgroundTasks.description})]}),0===m.length?(0,b.jsx)("p",{className:"py-6 text-center text-sm text-muted-foreground",children:a.backgroundTasks.empty}):(0,b.jsx)("ul",{className:"space-y-2",children:m.map(c=>{var d,e;let h;return(0,b.jsx)("li",{className:"rounded-md border p-3 text-sm",children:(0,b.jsxs)("div",{className:"flex items-start gap-2",children:["running"===c.status&&(0,b.jsx)(z.Loader2,{className:"mt-0.5 h-4 w-4 shrink-0 animate-spin text-primary"}),"succeeded"===c.status&&(0,b.jsx)(J,{className:"mt-0.5 h-4 w-4 shrink-0 text-green-600"}),"failed"===c.status&&(0,b.jsx)(K.XCircle,{className:"mt-0.5 h-4 w-4 shrink-0 text-destructive"}),(0,b.jsxs)("div",{className:"min-w-0 flex-1 space-y-1",children:[(0,b.jsxs)("div",{className:"font-medium",children:[a.backgroundTasks.kinds[c.kind],(0,b.jsxs)("span",{className:"font-normal text-muted-foreground",children:[" · ",a.backgroundTasks.status[c.status]]})]}),c.subject&&(0,b.jsx)("div",{className:"break-words text-muted-foreground",children:c.subject}),c.progress&&c.progress.total>0&&(0,b.jsxs)("div",{className:"space-y-1",children:[(0,b.jsx)("div",{className:"h-1.5 overflow-hidden rounded bg-muted",children:(0,b.jsx)("div",{className:"h-full bg-primary transition-all",style:{width:`${Math.round(c.progress.done/c.progress.total*100)}%`}})}),(0,b.jsxs)("div",{className:"text-xs text-muted-foreground",children:[a.backgroundTasks.progress.replace("{done}",String(c.progress.done)).replace("{total}",String(c.progress.total)),c.progress.failed>0&&` \xb7 ${a.backgroundTasks.failedCount.replace("{count}",String(c.progress.failed))}`]})]}),c.error&&(0,b.jsx)("div",{className:"text-xs text-destructive",children:(b=>{if(!b)return null;let c=a.backgroundTasks.errors[b]??a.errors[b];return"string"==typeof c?c:b})(c.error)}),(0,b.jsxs)("div",{className:"flex flex-wrap items-center gap-x-3 text-xs text-muted-foreground",children:[(0,b.jsx)("span",{children:a.backgroundTasks.startedAt.replace("{time}",(0,N.formatDateTime)(c.startedAt,"HH:mm:ss",f))}),(0,b.jsx)("span",{children:a.backgroundTasks.elapsed.replace("{time}",(d=c.startedAt,e=c.finishedAt,h=Math.max(0,Math.round(((e?Date.parse(e):o)-Date.parse(d))/1e3)),`${Math.floor(h/60)}:${String(h%60).padStart(2,"0")}`))}),c.link&&(0,b.jsx)(g.default,{href:c.link,className:"text-primary hover:underline",onClick:()=>l(!1),children:a.backgroundTasks.view})]})]})]})},c.id)})}),(0,b.jsxs)("div",{className:"flex items-center justify-between gap-2 pt-1",children:[(0,b.jsx)("p",{className:"text-xs text-muted-foreground",children:a.backgroundTasks.retentionHint}),w&&(0,b.jsx)(r.Button,{variant:"ghost",size:"sm",onClick:x,children:a.backgroundTasks.clearFinished})]})]})})]})}var a4=a.i(33508);let a5={success:{icon:J,className:"text-success"},error:{icon:K.XCircle,className:"text-destructive"},warning:{icon:A,className:"text-warning"},info:{icon:aF,className:"text-primary"}};function a6(){let{t:a}=(0,c.useLanguage)(),[d,e]=(0,q.useState)([]),[f,g]=(0,q.useState)(null);return(0,q.useEffect)(()=>(0,ar.subscribeFeedback)(a=>{e(a.toasts),g(a.confirm)}),[]),(0,b.jsxs)(b.Fragment,{children:[(0,b.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:d.map(c=>{let{icon:d,className:e}=a5[c.type];return(0,b.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,b.jsx)(d,{className:(0,ag.cn)("mt-0.5 h-4 w-4 shrink-0",e)}),(0,b.jsx)("p",{className:"min-w-0 flex-1 whitespace-pre-line break-words leading-relaxed",children:c.message}),(0,b.jsx)("button",{type:"button",className:"shrink-0 rounded p-0.5 text-muted-foreground transition-colors hover:text-foreground",onClick:()=>(0,ar.dismissToast)(c.id),"aria-label":a.common.close,children:(0,b.jsx)(a4.X,{className:"h-3.5 w-3.5"})})]},c.id)})}),(0,b.jsx)(s.Dialog,{open:!!f,onOpenChange:a=>{a||f?.resolve(!1)},children:(0,b.jsxs)(s.DialogContent,{className:"sm:max-w-md",children:[(0,b.jsxs)(s.DialogHeader,{children:[(0,b.jsxs)(s.DialogTitle,{className:"flex items-center gap-2",children:[f?.destructive&&(0,b.jsx)(A,{className:"h-5 w-5 text-destructive"}),f?.title||a.common.confirmTitle]}),(0,b.jsx)(s.DialogDescription,{className:"whitespace-pre-line pt-1 text-left leading-relaxed",children:f?.message})]}),(0,b.jsxs)(s.DialogFooter,{className:"gap-2",children:[(0,b.jsx)(r.Button,{variant:"outline",onClick:()=>f?.resolve(!1),children:f?.cancelText||a.common.cancel}),(0,b.jsx)(r.Button,{variant:f?.destructive?"destructive":"default",onClick:()=>f?.resolve(!0),autoFocus:!0,children:f?.confirmText||a.common.confirm})]})]})})]})}function a7(){return(0,q.useEffect)(()=>{"serviceWorker"in navigator&&navigator.serviceWorker.register("/sw.js",{scope:"/"}).catch(a=>{at.frontendLogger.warn("[PWA]","Service worker registration failed",{error:String(a)})})},[]),null}a.s(["Providers",0,function({children:a,timeZone:f}){return(0,b.jsx)(d.SessionProvider,{children:(0,b.jsx)(c.LanguageProvider,{children:(0,b.jsxs)(e.TimeZoneProvider,{initialTimeZone:f,children:[(0,b.jsx)(a0,{children:a}),(0,b.jsx)(a3,{}),(0,b.jsx)(a6,{}),(0,b.jsx)(a7,{})]})})})}],18175)}];
192
192
 
193
193
  //# sourceMappingURL=src_components_providers_tsx_09kw-mv._.js.map