wrong-notebook 2026.11.9-2 → 2026.11.9-4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (172) hide show
  1. package/.next/BUILD_ID +1 -1
  2. package/.next/app-path-routes-manifest.json +1 -0
  3. package/.next/build-manifest.json +3 -3
  4. package/.next/prerender-manifest.json +3 -3
  5. package/.next/routes-manifest.json +6 -0
  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.nft.json +1 -1
  18. package/.next/server/app/api/admin/users/[id]/detail/route.js.nft.json +1 -1
  19. package/.next/server/app/api/ai/models/route.js.nft.json +1 -1
  20. package/.next/server/app/api/ai/test/route.js.nft.json +1 -1
  21. package/.next/server/app/api/analytics/route.js.nft.json +1 -1
  22. package/.next/server/app/api/analyze/route.js.nft.json +1 -1
  23. package/.next/server/app/api/error-items/[id]/figure/route.js.nft.json +1 -1
  24. package/.next/server/app/api/error-items/[id]/fix-latex/route.js.nft.json +1 -1
  25. package/.next/server/app/api/error-items/[id]/geogebra/route.js.nft.json +1 -1
  26. package/.next/server/app/api/error-items/[id]/notes/route.js.nft.json +1 -1
  27. package/.next/server/app/api/error-items/[id]/reanswer/route.js.nft.json +1 -1
  28. package/.next/server/app/api/error-items/[id]/retag/route.js.nft.json +1 -1
  29. package/.next/server/app/api/error-items/[id]/route.js.nft.json +1 -1
  30. package/.next/server/app/api/error-items/[id]/svg-animation/narration/route.js.nft.json +1 -1
  31. package/.next/server/app/api/error-items/[id]/svg-animation/route.js.nft.json +1 -1
  32. package/.next/server/app/api/error-items/batch-delete/route.js.nft.json +1 -1
  33. package/.next/server/app/api/error-items/batch-move/route/app-paths-manifest.json +3 -0
  34. package/.next/server/app/api/error-items/batch-move/route/build-manifest.json +12 -0
  35. package/.next/server/app/api/error-items/batch-move/route/server-reference-manifest.json +4 -0
  36. package/.next/server/app/api/error-items/batch-move/route.js +18 -0
  37. package/.next/server/app/api/error-items/batch-move/route.js.map +5 -0
  38. package/.next/server/app/api/error-items/batch-move/route.js.nft.json +1 -0
  39. package/.next/server/app/api/error-items/batch-move/route_client-reference-manifest.js +3 -0
  40. package/.next/server/app/api/error-items/route.js.nft.json +1 -1
  41. package/.next/server/app/api/exams/[id]/questions/[questionId]/regenerate/route.js.nft.json +1 -1
  42. package/.next/server/app/api/exams/[id]/results/route.js.nft.json +1 -1
  43. package/.next/server/app/api/exams/[id]/retry/route.js.nft.json +1 -1
  44. package/.next/server/app/api/exams/[id]/route.js.nft.json +1 -1
  45. package/.next/server/app/api/exams/route.js.nft.json +1 -1
  46. package/.next/server/app/api/geogebra-analyze/route.js.nft.json +1 -1
  47. package/.next/server/app/api/import/route.js.nft.json +1 -1
  48. package/.next/server/app/api/import-batches/[id]/confirm-all/route.js.nft.json +1 -1
  49. package/.next/server/app/api/import-batches/[id]/fix-text/route.js.nft.json +1 -1
  50. package/.next/server/app/api/import-batches/[id]/read/route.js.nft.json +1 -1
  51. package/.next/server/app/api/import-batches/[id]/retry/route.js.nft.json +1 -1
  52. package/.next/server/app/api/import-batches/[id]/route.js.nft.json +1 -1
  53. package/.next/server/app/api/import-batches/[id]/start/route.js.nft.json +1 -1
  54. package/.next/server/app/api/import-batches/route.js.nft.json +1 -1
  55. package/.next/server/app/api/import-tasks/[id]/confirm/route.js.nft.json +1 -1
  56. package/.next/server/app/api/import-tasks/[id]/read/route.js.nft.json +1 -1
  57. package/.next/server/app/api/import-tasks/[id]/retry/route.js.nft.json +1 -1
  58. package/.next/server/app/api/import-tasks/[id]/route.js.nft.json +1 -1
  59. package/.next/server/app/api/import-tasks/route.js.nft.json +1 -1
  60. package/.next/server/app/api/notebooks/[id]/retag/route.js.nft.json +1 -1
  61. package/.next/server/app/api/openclaw/batch-upload/route.js.nft.json +1 -1
  62. package/.next/server/app/api/practice/generate/route.js.nft.json +1 -1
  63. package/.next/server/app/api/practice/grade/route.js.nft.json +1 -1
  64. package/.next/server/app/api/practice/record/[id]/route.js.nft.json +1 -1
  65. package/.next/server/app/api/practice/record/route.js.nft.json +1 -1
  66. package/.next/server/app/api/reanswer/route.js.nft.json +1 -1
  67. package/.next/server/app/api/review/due/route.js.nft.json +1 -1
  68. package/.next/server/app/api/stats/repeated-mistakes/route.js.nft.json +1 -1
  69. package/.next/server/app/api/stats/weak-tags/route.js.nft.json +1 -1
  70. package/.next/server/app/api/tasks/route.js.nft.json +1 -1
  71. package/.next/server/app/api/tts/batch/route.js.nft.json +1 -1
  72. package/.next/server/app/api/user/route.js.nft.json +1 -1
  73. package/.next/server/app/error-items/[id]/page.js.nft.json +1 -1
  74. package/.next/server/app/error-items/[id]/page_client-reference-manifest.js +1 -1
  75. package/.next/server/app/eula/page.js.nft.json +1 -1
  76. package/.next/server/app/eula/page_client-reference-manifest.js +1 -1
  77. package/.next/server/app/exams/[id]/page.js.nft.json +1 -1
  78. package/.next/server/app/exams/[id]/page_client-reference-manifest.js +1 -1
  79. package/.next/server/app/exams/[id]/print/page.js.nft.json +1 -1
  80. package/.next/server/app/exams/[id]/print/page_client-reference-manifest.js +1 -1
  81. package/.next/server/app/exams/page.js.nft.json +1 -1
  82. package/.next/server/app/exams/page_client-reference-manifest.js +1 -1
  83. package/.next/server/app/import-batches/[id]/page.js.nft.json +1 -1
  84. package/.next/server/app/import-batches/[id]/page_client-reference-manifest.js +1 -1
  85. package/.next/server/app/import-tasks/[id]/page.js.nft.json +1 -1
  86. package/.next/server/app/import-tasks/[id]/page_client-reference-manifest.js +1 -1
  87. package/.next/server/app/import-tasks/page.js.nft.json +1 -1
  88. package/.next/server/app/import-tasks/page_client-reference-manifest.js +1 -1
  89. package/.next/server/app/initialize/page.js.nft.json +1 -1
  90. package/.next/server/app/initialize/page_client-reference-manifest.js +1 -1
  91. package/.next/server/app/login/page.js.nft.json +1 -1
  92. package/.next/server/app/login/page_client-reference-manifest.js +1 -1
  93. package/.next/server/app/notebooks/[id]/add/page.js.nft.json +1 -1
  94. package/.next/server/app/notebooks/[id]/add/page_client-reference-manifest.js +1 -1
  95. package/.next/server/app/notebooks/[id]/page.js.nft.json +1 -1
  96. package/.next/server/app/notebooks/[id]/page_client-reference-manifest.js +1 -1
  97. package/.next/server/app/notebooks/page.js.nft.json +1 -1
  98. package/.next/server/app/notebooks/page_client-reference-manifest.js +1 -1
  99. package/.next/server/app/page.js.nft.json +1 -1
  100. package/.next/server/app/page_client-reference-manifest.js +1 -1
  101. package/.next/server/app/practice/page.js.nft.json +1 -1
  102. package/.next/server/app/practice/page_client-reference-manifest.js +1 -1
  103. package/.next/server/app/print-preview/page.js.nft.json +1 -1
  104. package/.next/server/app/print-preview/page_client-reference-manifest.js +1 -1
  105. package/.next/server/app/register/page.js.nft.json +1 -1
  106. package/.next/server/app/register/page_client-reference-manifest.js +1 -1
  107. package/.next/server/app/review/page.js.nft.json +1 -1
  108. package/.next/server/app/review/page_client-reference-manifest.js +1 -1
  109. package/.next/server/app/setup/page.js.nft.json +1 -1
  110. package/.next/server/app/setup/page_client-reference-manifest.js +1 -1
  111. package/.next/server/app/stats/page.js.nft.json +1 -1
  112. package/.next/server/app/stats/page_client-reference-manifest.js +1 -1
  113. package/.next/server/app/tags/page.js.nft.json +1 -1
  114. package/.next/server/app/tags/page_client-reference-manifest.js +1 -1
  115. package/.next/server/app-paths-manifest.json +1 -0
  116. package/.next/server/chunks/_007ypexktdy5h._.js +3 -0
  117. package/.next/server/chunks/_02qwqg9i39x4_._.js +2 -2
  118. package/.next/server/chunks/_0431fxnqiloso._.js +1 -1
  119. package/.next/server/chunks/_0kreo-8xn80hb._.js +1 -1
  120. package/.next/server/chunks/_0tktp4y6lb9uv._.js +3 -0
  121. package/.next/server/chunks/_12xi_xqvtrn3k._.js +1 -1
  122. package/.next/server/chunks/_1csx8ckltgali._.js +2 -2
  123. package/.next/server/chunks/_1cydcmia78z15._.js +1 -1
  124. package/.next/server/chunks/_1gtuhmdu6udof._.js +2 -2
  125. package/.next/server/chunks/_1yvd01woddaxt._.js +2 -2
  126. package/.next/server/chunks/_next-internal_server_app_api_error-items_batch-move_route_actions_1usg70f6cukl0.js +3 -0
  127. package/.next/server/chunks/src_lib_1_m3-y2t3e4xi._.js +58 -22
  128. package/.next/server/chunks/src_lib_question_question-deduplication_ts_0gumctesi3szc._.js +1 -1
  129. package/.next/server/chunks/src_lib_schemas_error-items_ts_0vdof4417rd3y._.js +1 -1
  130. package/.next/server/chunks/ssr/[root-of-the-server]__0l0hz47yn1ku_._.js +3 -0
  131. package/.next/server/chunks/ssr/_02_avk2sj3zf5._.js +3 -0
  132. package/.next/server/chunks/ssr/_07igsu8xjloky._.js +3 -0
  133. package/.next/server/chunks/ssr/{_0mvuvawj5-r--._.js → _0qiirfq71m0ty._.js} +2 -2
  134. package/.next/server/chunks/ssr/_12x0l20ysatxn._.js +3 -0
  135. package/.next/server/chunks/ssr/{_19hxsrrruepym._.js → _1m7f_7kfoqzo_._.js} +2 -2
  136. package/.next/server/chunks/ssr/_1m8y_pv3jak70._.js +3 -0
  137. package/.next/server/chunks/ssr/{node_modules_16_s8zyr3620u._.js → node_modules_0nslyotwav52f._.js} +1 -1
  138. package/.next/server/chunks/ssr/{_0t-venqf7b-4q._.js → node_modules_lucide-react_dist_esm_icons_0mg8mlclupjv-._.js} +2 -2
  139. package/.next/server/chunks/ssr/node_modules_lucide-react_dist_esm_icons_1qsyz9_vm6jfk._.js +3 -0
  140. package/.next/server/chunks/ssr/src_app_notebooks_[id]_page_tsx_08njm-5-txm8_._.js +1 -1
  141. package/.next/server/chunks/ssr/src_components_providers_tsx_09kw-mv3nb6xs._.js +2 -2
  142. package/.next/server/chunks/ssr/src_contexts_LanguageContext_tsx_0r6xucmeu1k5z._.js +1 -1
  143. package/.next/server/chunks/ssr/src_lib_i18n_en_ts_08zkpwnoqey5s._.js +1 -1
  144. package/.next/server/middleware-build-manifest.js +3 -3
  145. package/.next/server/pages/500.html +1 -1
  146. package/.next/server/preview-props.json +3 -3
  147. package/.next/server/server-reference-manifest.js +1 -1
  148. package/.next/server/server-reference-manifest.json +1 -1
  149. package/.next/static/chunks/{334z2x2rojgkd.js → 032xzuhi_gy7t.js} +1 -1
  150. package/.next/static/chunks/{0_cnc6gz9gqm8.js → 0ocb49htmlhl5.js} +3 -3
  151. package/.next/static/chunks/{0bufg6cl_1x2h.js → 142ggarrxy3ku.js} +1 -1
  152. package/.next/static/chunks/{1ziwji7xw98fj.js → 1_lxyr04qvsxk.js} +1 -1
  153. package/.next/static/chunks/{05f13kdl-5r-c.js → 1ey5h3_143nwz.js} +2 -2
  154. package/.next/static/chunks/1v01oqugf1j5g.js +1 -0
  155. package/.next/static/chunks/2secy011jtksr.js +1 -0
  156. package/.next/static/chunks/{19a04m6wxadzm.js → 321kq8xr7a6_r.js} +1 -1
  157. package/.next/static/chunks/3hft-37m4c_s4.js +1 -0
  158. package/package.json +1 -1
  159. package/prisma/seed.db +0 -0
  160. package/.next/server/chunks/ssr/[root-of-the-server]__0x4us8rfvt68s._.js +0 -3
  161. package/.next/server/chunks/ssr/[root-of-the-server]__124rb-z-nm7o5._.js +0 -3
  162. package/.next/server/chunks/ssr/[root-of-the-server]__1yhcc4i7ps6s5._.js +0 -3
  163. package/.next/server/chunks/ssr/_0ethdphoh7xqp._.js +0 -3
  164. package/.next/server/chunks/ssr/_0qbp5_0h-b69q._.js +0 -3
  165. package/.next/server/chunks/ssr/_1s3gqrczubor-._.js +0 -3
  166. package/.next/server/chunks/ssr/_1wt7hpzajqoju._.js +0 -3
  167. package/.next/static/chunks/11jjfyt0-zwcn.js +0 -1
  168. package/.next/static/chunks/209odxnq_2nok.js +0 -1
  169. package/.next/static/chunks/2hl62fuxy23ky.js +0 -1
  170. /package/.next/static/{I4Rw8GasSc6yR7HSWfSnC → SksTfjOW_RawBbtAQNssc}/_buildManifest.js +0 -0
  171. /package/.next/static/{I4Rw8GasSc6yR7HSWfSnC → SksTfjOW_RawBbtAQNssc}/_clientMiddlewareManifest.js +0 -0
  172. /package/.next/static/{I4Rw8GasSc6yR7HSWfSnC → SksTfjOW_RawBbtAQNssc}/_ssgManifest.js +0 -0
@@ -6,4 +6,4 @@
6
6
  Defaulting to \`null\`.`}d(p,"defaultGetValueLabel"),d(v,"getProgressState"),d(y,"isNumber"),d(j,"isValidMaxNumber"),d(b,"isValidValueNumber"),d(w,"getInvalidMaxError"),d(k,"getInvalidValueError");var N=e.i(975157);let S=i.forwardRef(({className:e,value:t,...s},r)=>(0,a.jsx)(g,{ref:r,value:t,className:(0,N.f)("relative h-4 w-full overflow-hidden rounded-full bg-secondary",e),...s,children:(0,a.jsx)(x,{className:"h-full w-full flex-1 bg-primary transition-all",style:{transform:`translateX(-${100-(t||0)}%)`}})}));S.displayName=g.displayName,e.s(["f",0,S],168148)},856522,e=>{var t=e.i(456420);let s={name:"save",size:24,node:[["path",{d:"M15.2 3a2 2 0 0 1 1.4.6l3.8 3.8a2 2 0 0 1 .6 1.4V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2z",key:"1c8476"}],["path",{d:"M17 21v-7a1 1 0 0 0-1-1H8a1 1 0 0 0-1 1v7",key:"1ydtos"}],["path",{d:"M7 3v4a1 1 0 0 0 1 1h7",key:"t51u73"}]]};s.node;let r=(0,t.f)(s);e.s(["f",0,r],856522)},786563,e=>{var t=e.i(456420);let s={name:"star",size:24,node:[["path",{d:"M11.525 2.295a.53.53 0 0 1 .95 0l2.31 4.679a2.123 2.123 0 0 0 1.595 1.16l5.166.756a.53.53 0 0 1 .294.904l-3.736 3.638a2.123 2.123 0 0 0-.611 1.878l.882 5.14a.53.53 0 0 1-.771.56l-4.618-2.428a2.122 2.122 0 0 0-1.973 0L6.396 21.01a.53.53 0 0 1-.77-.56l.881-5.139a2.122 2.122 0 0 0-.611-1.879L2.16 9.795a.53.53 0 0 1 .294-.906l5.165-.755a2.122 2.122 0 0 0 1.597-1.16z",key:"r04s7s"}]]};s.node;let r=(0,t.f)(s);e.s(["f",0,r],786563)},866531,497346,183444,e=>{var t=e.i(843476),s=e.i(271645),r=e.i(632781),a=e.i(741120),i=e.i(856522),n=e.i(314381),l=e.i(3198),o=e.i(519455),d=e.i(111110),c=e.i(41931),u=e.i(294114),m=e.i(201276);function f({data:e,onChange:a}){let{t:i}=(0,d.b)(),[h,g]=(0,s.useState)(!1),[x,p]=(0,s.useState)(null),v=async()=>{if(!e.questionText.trim())return void u.c.warning(i.editor.enterQuestionFirst||"Please enter question text first");if(!e.answerText.trim())return void u.c.warning(i.geogebra.answerRequired);g(!0),p(null);try{let t=await c.k.post("/api/geogebra-analyze",{questionText:e.questionText,answerText:e.answerText,analysis:e.analysis},{timeout:18e4,recoverable:!0});t.suitable&&t.commands&&t.commands.length>0?a({geogebraCommands:JSON.stringify(t.commands)}):p(t.description||i.geogebra.notSuitable)}catch(e){m.V.error("[CorrectionEditor]","GeoGebra analysis failed",{error:e}),p(i.geogebra.analyzeFailed)}finally{g(!1)}};return e.geogebraCommands?(0,t.jsx)(l.f,{commands:e.geogebraCommands,height:350,onRegenerate:v,onDelete:async()=>a({geogebraCommands:void 0})}):e.questionText.trim()&&e.answerText.trim()?(0,t.jsxs)("div",{className:"rounded-lg border border-dashed p-4",children:[(0,t.jsxs)("div",{className:"flex items-center justify-between",children:[(0,t.jsxs)("div",{className:"flex items-center gap-2 text-sm text-muted-foreground",children:[(0,t.jsx)(n.f,{className:"h-4 w-4"}),(0,t.jsx)("span",{children:i.geogebra.title})]}),(0,t.jsx)(o.f,{variant:"outline",size:"sm",onClick:v,disabled:h,children:h?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(r.f,{className:"mr-2 h-4 w-4 animate-spin"}),i.geogebra.analyzing]}):(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(n.f,{className:"mr-2 h-4 w-4"}),i.geogebra.generate]})})]}),x&&(0,t.jsx)("p",{className:"text-xs text-muted-foreground mt-2",children:x}),(0,t.jsx)("p",{className:"text-xs text-muted-foreground mt-2",children:i.geogebra.hint})]}):null}var h=e.i(469937),g=e.i(28342),x=e.i(438465),p=e.i(674166),v=e.i(110204),y=e.i(967489),j=e.i(401280);function b({data:e,paperLevel:s,onChange:r}){let{t:a}=(0,d.b)();return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsx)(v.f,{children:a.editor.selectNotebook||"Select Notebook"}),(0,t.jsx)(x.f,{value:e.subjectId,onChange:e=>r({subjectId:e})})]}),(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsx)(v.f,{children:a.questionType.label||"Question Type"}),(0,t.jsxs)(y.d,{value:e.questionType||"",onValueChange:e=>r({questionType:e===j.O?null:e}),children:[(0,t.jsx)(y.P,{children:(0,t.jsx)(y.U,{placeholder:a.questionType.notSet||"Not set"})}),(0,t.jsxs)(y.r,{children:[(0,t.jsx)(y.T,{value:j.O,children:a.questionType.clear||"Clear"}),j.V.map(e=>(0,t.jsx)(y.T,{value:e,children:a.questionType.names?.[e]||e},e))]})]})]}),(0,t.jsxs)("div",{className:"grid grid-cols-2 gap-4",children:[(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsx)(v.f,{htmlFor:"correction-grade-semester",children:a.editor.gradeSemester||"Grade/Semester"}),(0,t.jsx)(g.f,{id:"correction-grade-semester",value:e.gradeSemester||"",onChange:e=>r({gradeSemester:e})})]}),(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsx)(v.f,{children:a.editor.paperLevel||"Paper Level"}),(0,t.jsx)(p.f,{value:s,onChange:e=>r({paperLevel:e})})]})]}),(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsx)(v.f,{children:a.difficulty.label}),(0,t.jsx)("div",{children:(0,t.jsx)(h.f,{size:"md",value:e.difficultyStars,onChange:e=>r({difficultyStars:e})})})]})]})}var w=e.i(141176),k=e.i(515288);function N({data:e,onChange:s}){let{t:r}=(0,d.b)();return(0,t.jsxs)(k.N,{children:[(0,t.jsx)(k.Y,{children:(0,t.jsx)(k.v,{children:r.editor.mistakeAnalysisTitle||"Mistake Analysis"})}),(0,t.jsxs)(k.O,{className:"space-y-4",children:[(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsx)(v.f,{children:r.editor.mistakeStatus||"Attempt Status"}),(0,t.jsxs)(y.d,{value:e.mistakeStatus||"unknown",onValueChange:e=>s({mistakeStatus:e}),children:[(0,t.jsx)(y.P,{children:(0,t.jsx)(y.U,{})}),(0,t.jsxs)(y.r,{children:[(0,t.jsx)(y.T,{value:"not_attempted",children:r.editor.mistakeStatuses?.notAttempted||"Not attempted"}),(0,t.jsx)(y.T,{value:"wrong_attempt",children:r.editor.mistakeStatuses?.wrongAttempt||"Wrong attempt"}),(0,t.jsx)(y.T,{value:"unknown",children:r.editor.mistakeStatuses?.unknown||"Unknown"})]})]})]}),(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsx)(v.f,{children:r.editor.wrongAnswerText||"Wrong Answer / Work"}),(0,t.jsx)(w.f,{value:e.wrongAnswerText||"",onChange:t=>s({wrongAnswerText:t,mistakeStatus:t.trim()?"wrong_attempt":e.mistakeStatus}),className:"min-h-[100px] font-mono text-sm",placeholder:r.editor.wrongAnswerPlaceholder||"Leave blank if no wrong answer is visible"})]}),(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsx)(v.f,{children:r.editor.mistakeAnalysis||"Mistake Cause Analysis"}),(0,t.jsx)(w.f,{value:e.mistakeAnalysis||"",onChange:e=>s({mistakeAnalysis:e}),className:"min-h-[140px] font-mono text-sm",placeholder:r.editor.mistakeAnalysisPlaceholder||"Explain where and why the mistake happened"})]})]})]})}var S=e.i(511445),_=e.i(149704);function T({title:e,children:s,className:r}){return(0,t.jsxs)(k.N,{children:[(0,t.jsx)(k.Y,{children:(0,t.jsx)(k.v,{children:e})}),(0,t.jsx)(k.O,{className:r,children:s})]})}function A({data:e,children:s}){let{t:r}=(0,d.b)(),a={wrong_attempt:r.editor.mistakeStatuses?.wrongAttempt||"Wrong attempt",not_attempted:r.editor.mistakeStatuses?.notAttempted||"Not attempted",unknown:r.editor.mistakeStatuses?.unknown||"Unknown"};return(0,t.jsxs)("div",{className:"space-y-6",children:[(0,t.jsxs)(T,{title:r.editor.preview?.question||"Question Preview",children:[(0,t.jsx)(S.f,{content:e.questionText}),(0,t.jsx)(_.f,{svg:e.figureSvg})]}),s,(0,t.jsx)(T,{title:r.editor.preview?.answer||"Answer Preview",children:(0,t.jsx)(S.f,{content:e.answerText})}),(0,t.jsx)(T,{title:r.editor.preview?.analysis||"Analysis Preview",children:(0,t.jsx)(S.f,{content:e.analysis})}),(0,t.jsxs)(T,{title:r.editor.preview?.mistakeAnalysis||"Mistake Analysis Preview",className:"space-y-3 text-sm",children:[(0,t.jsxs)("div",{className:"text-muted-foreground",children:[r.editor.mistakeStatus||"Attempt Status",r.common.colon,a[e.mistakeStatus]??a.unknown]}),e.wrongAnswerText&&(0,t.jsxs)("div",{children:[(0,t.jsx)("div",{className:"font-medium mb-1",children:r.editor.wrongAnswerText||"Wrong Answer / Work"}),(0,t.jsx)(S.f,{content:e.wrongAnswerText})]}),e.mistakeAnalysis&&(0,t.jsxs)("div",{children:[(0,t.jsx)("div",{className:"font-medium mb-1",children:r.editor.mistakeAnalysis||"Mistake Cause Analysis"}),(0,t.jsx)(S.f,{content:e.mistakeAnalysis})]})]})]})}var E=e.i(574041),I=e.i(215519),C=e.i(306831);e.i(676167);var R=e.i(597138),z=e.i(991722),V=e.i(470279),O=e.i(303163);e.s(["f",0,function({initialData:e,onSave:n,onCancel:l,imagePreview:h,initialSubjectId:g,aiTimeout:x}){let{timeZone:p}=(0,I.M)(),{t:y,language:j}=(0,d.b)(),S=e=>e.trim()?e:"",[_,T]=(0,s.useState)({...e,answerText:S(e.answerText),analysis:S(e.analysis),wrongAnswerText:e.wrongAnswerText||"",mistakeAnalysis:e.mistakeAnalysis||"",mistakeStatus:e.mistakeStatus||"unknown",subjectId:g,gradeSemester:e.gradeSemester||""}),$=(0,s.useRef)(!1),M=e=>{"gradeSemester"in e&&($.current=!0),T(t=>({...t,...e}))},{groups:L}=(0,V.f)(),P=(()=>{if(_.paperLevel)return _.paperLevel;let e="number"==typeof _.difficultyStars&&_.difficultyStars>=4?"b":"a";return L.find(t=>t.key===e&&t.isActive)?.id||""})(),q=_.paperLevel??P,[G,F]=(0,s.useState)(!1),[U,D]=(0,s.useState)(!1),[H,Q]=(0,s.useState)(!1),[B,W]=(0,s.useState)(void 0),[Z,J]=(0,s.useState)([]);(0,s.useEffect)(()=>{c.k.get("/api/notebooks").then(J).catch(e=>m.V.error("[CorrectionEditor]","Failed to fetch notebooks",{error:e})),c.k.get("/api/user").then(e=>{if(Q(!!e?.enableGeogebra),e){let t=function(e,t=C.J){return"ai"===e.gradeRecognitionMode?null:e.fixedGradeSemester?e.fixedGradeSemester:e.educationStage&&e.enrollmentYear?function(e,t,s=new Date,r="en",a=C.J){let i=(0,C.c)(s,a),n=i.getFullYear(),l=i.getMonth()+1,o=n-t,d="2nd";l>=9?(o+=1,d="1st"):d=l<2?"1st":"2nd";let c="zh"===r,u=c?"1st"===d?"上期":"下期":"1st"===d?"1st Semester":"2nd Semester",m=(c?{primary:["一年级","二年级","三年级","四年级","五年级","六年级"],junior_high:["初一","初二","初三"],senior_high:["高一","高二","高三"],university:["大一","大二","大三","大四"]}:{primary:["Grade 1","Grade 2","Grade 3","Grade 4","Grade 5","Grade 6"],junior_high:["Junior High Grade 1","Junior High Grade 2","Junior High Grade 3"],senior_high:["Senior High Grade 1","Senior High Grade 2","Senior High Grade 3"],university:["Freshman","Sophomore","Junior","Senior"]})[e]||[],f=`${o}`;if(f=o>0&&o<=m.length?m[o-1]:o>m.length?c?"已毕业":"Graduated":c?"学前":"Pre-school",!c)return`${f}, ${u}`;{let e="1st"===d?"上":"下";return`${f}${e}`}}(e.educationStage,e.enrollmentYear,new Date,"zh",t):null}(e,p);T(e=>e.gradeSemester||$.current?e:{...e,gradeSemester:t||""}),W(e.educationStage||void 0)}}).catch(e=>m.V.error("[CorrectionEditor]","Failed to fetch user info for grade calculation",{error:e}))},[j,p]);let K=async()=>{if(!_.questionText.trim())return void u.c.warning(y.editor.enterQuestionFirst||"Please enter question text first");F(!0);try{let e=function({questionText:e,language:t,subject:s,imagePreview:r,gradeSemester:a,subjectId:i}){let n={questionText:e,language:t,subject:s};return r&&(n.imageBase64=r),a&&(n.gradeSemester=a),i&&(n.subjectId=i),n}({questionText:_.questionText,language:j,subject:_.subject,imagePreview:h,gradeSemester:_.gradeSemester??void 0,subjectId:_.subjectId});m.V.info("[Reanswer]",e.imageBase64?"Sending image + text (image available for mistake analysis)":"Sending text only (no image available)",{timeout:x});let t=await c.k.post("/api/reanswer",e,{timeout:x||18e4,recoverable:!0});T(e=>({...e,answerText:t.answerText,analysis:t.analysis,knowledgePoints:t.knowledgePoints,wrongAnswerText:t.wrongAnswerText||"",mistakeAnalysis:t.mistakeAnalysis||"",mistakeStatus:(0,z.x)(t.mistakeStatus,t.wrongAnswerText),difficultyStars:t.difficultyStars??e.difficultyStars,questionType:t.questionType??e.questionType})),u.c.success(y.editor.reanswerSuccess||"✅ Answer and analysis updated!")}catch(r){let e,t,s;m.V.error("[CorrectionEditor]","Reanswer failed",{error:r}),u.c.error((e=(0,O.d)(r)||"",s=(t=y.errors?.reanswer||{}).default||"Reanswer failed",e.includes("AI_AUTH_ERROR")?t.authError||y.errors?.AI_AUTH_ERROR||s:e.includes("AI_CONNECTION_FAILED")?t.connectionFailed||y.errors?.AI_CONNECTION_FAILED||s:e.includes("AI_RESPONSE_ERROR")&&(t.responseError||y.errors?.AI_RESPONSE_ERROR)||s))}finally{F(!1)}},Y=async()=>{if(!_.subjectId)return void u.c.warning(y.editor.messages?.selectNotebook||"Please select a notebook");if(!U){D(!0);try{await n({..._,paperLevel:q,mistakeStatus:(0,z.x)(_.mistakeStatus,_.wrongAnswerText)})}finally{D(!1)}}},X=y.editor.placeholder||"Supports Markdown and LaTeX...",ee=(0,R.f)(Z.find(e=>e.id===_.subjectId)?.name||null)||(0,R.f)(_.subject||null)||void 0;return(0,t.jsxs)("div",{className:"space-y-6",children:[(0,t.jsxs)("div",{className:"flex items-center justify-between",children:[(0,t.jsx)("h2",{className:"text-2xl font-bold",children:y.editor.title}),(0,t.jsxs)("div",{className:"flex gap-2",children:[(0,t.jsx)(o.f,{variant:"outline",onClick:l,children:y.editor.cancel}),(0,t.jsxs)(o.f,{onClick:Y,disabled:U,children:[U?(0,t.jsx)(r.f,{className:"mr-2 h-4 w-4 animate-spin"}):(0,t.jsx)(i.f,{className:"mr-2 h-4 w-4"}),U?y.common?.pleaseWait||"Please wait...":y.editor.save]})]})]}),(0,t.jsxs)("div",{className:"grid gap-6 lg:grid-cols-2",children:[(0,t.jsxs)("div",{className:"space-y-6",children:[h&&(0,t.jsx)(k.N,{children:(0,t.jsx)(k.O,{className:"p-4",children:(0,t.jsx)("img",{src:h,alt:"Original",className:"w-full rounded-md"})})}),(0,t.jsx)(b,{data:_,paperLevel:q,onChange:M}),(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsx)(v.f,{children:y.editor.question}),(0,t.jsx)(w.f,{value:_.questionText,onChange:e=>M({questionText:e}),className:"min-h-[150px] font-mono text-sm",placeholder:X}),(0,t.jsx)(o.f,{variant:"default",size:"sm",onClick:K,disabled:G||!_.questionText.trim(),className:"w-full bg-gradient-to-r from-indigo-600 to-violet-500 hover:from-indigo-700 hover:to-violet-600 text-white font-medium",children:G?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(r.f,{className:"mr-2 h-4 w-4 animate-spin"}),y.editor.reanswering||"AI solving..."]}):(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(a.f,{className:"mr-2 h-4 w-4"}),y.editor.reanswer||"🔄 Reanswer (based on corrected question)"]})}),(0,t.jsx)("p",{className:"text-xs text-muted-foreground",children:y.editor.reanswerHint||"💡 If the question was misrecognized, correct it and click to regenerate answer"})]}),(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsx)(v.f,{children:y.editor.tags}),(0,t.jsx)(E.f,{value:_.knowledgePoints,onChange:e=>M({knowledgePoints:e}),placeholder:y.editor.tagsPlaceholder||"Enter knowledge tags...",enterHint:y.editor.createTagHint,subject:ee,gradeStage:B}),(0,t.jsx)("p",{className:"text-xs text-muted-foreground",children:y.editor.tagsHint||"💡 Tag suggestions will appear as you type"})]}),(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsx)(v.f,{children:y.editor.answer}),(0,t.jsx)(w.f,{value:_.answerText,onChange:e=>M({answerText:e}),className:"min-h-[100px] font-mono text-sm",placeholder:X})]}),(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsx)(v.f,{children:y.editor.analysis}),(0,t.jsx)(w.f,{value:_.analysis,onChange:e=>M({analysis:e}),className:"min-h-[200px] font-mono text-sm",placeholder:X})]}),(0,t.jsx)(N,{data:_,onChange:M})]}),(0,t.jsx)(A,{data:_,children:H&&(0,t.jsx)(f,{data:_,onChange:M})})]})]})}],866531);var $=e.i(853138),M=e.i(263676);e.s(["f",0,function({message:e,onDismiss:s}){let{t:r}=(0,d.b)();return e?(0,t.jsxs)("div",{role:"alert",className:"flex items-start gap-3 rounded-xl border border-destructive/30 bg-destructive/5 p-4 text-sm text-destructive",children:[(0,t.jsx)($.f,{"aria-hidden":"true",className:"mt-0.5 h-4 w-4 shrink-0"}),(0,t.jsx)("p",{className:"min-w-0 flex-1 whitespace-pre-line break-words leading-relaxed",children:e}),(0,t.jsx)("button",{type:"button",onClick:s,"aria-label":r.common.close,className:"shrink-0 rounded p-1 hover:bg-destructive/10",children:(0,t.jsx)(M.X,{"aria-hidden":"true",className:"h-4 w-4"})})]}):null}],497346);var L=e.i(618566),P=e.i(707212);function q(e){return"object"!=typeof e||null===e||Array.isArray(e)?void 0:e}function G(e,t){if("string"!=typeof e||!/^(QUESTION_SAVE_|AI_)[A-Z_]+$/.test(e))return;let s=t.errors[e];return"string"==typeof s?s:void 0}e.s(["f",0,function(e){let{t}=(0,d.b)(),r=(0,L.useRouter)(),[a,i]=(0,s.useState)(null),n=async(s,a,n=!0)=>{i(null);try{let e=await s();return u.c.success(e.duplicate?t.importFlow.duplicate:t.common.messages.saveSuccess),n&&(e.duplicate?r.push(`/error-items/${e.id}`):a&&r.push(`/notebooks/${a}`)),!0}catch(r){m.V.error(e,"Save failed",{errorMessage:(0,O.d)(r)??(0,O.Z)(r)});let s=function(e,t){let s=q(e),r=q(s?.data),a="number"==typeof s?.status?s.status:void 0,i=(0,O.d)(e),n=G(i,t)??G(r?.code,t),l={400:t.errors.QUESTION_SAVE_INVALID_INPUT,401:t.errors.QUESTION_SAVE_UNAUTHORIZED,403:t.errors.QUESTION_SAVE_FORBIDDEN,408:t.errors.QUESTION_SAVE_TIMEOUT,409:t.errors.QUESTION_SAVE_CONFLICT,413:t.errors.QUESTION_SAVE_TOO_LARGE,429:t.errors.QUESTION_SAVE_RATE_LIMITED,502:t.errors.QUESTION_SAVE_SERVER_UNAVAILABLE,503:t.errors.QUESTION_SAVE_SERVER_UNAVAILABLE,504:t.errors.QUESTION_SAVE_TIMEOUT},o=n??(a?l[a]:void 0)??t.errors.QUESTION_SAVE_FAILED;!a&&(e instanceof TypeError||/fetch|network|load failed/i.test((0,O.Z)(e)))&&(o=t.errors.QUESTION_SAVE_NETWORK_ERROR);let d=q(r?.details);if("QUESTION_SAVE_GRADE_FAILED"===i){let e=G(d?.reason,t);e&&(o+=`
7
7
  ${e}`)}return 400===a&&(o+=(function(e,t){if(!Array.isArray(e))return[];let s={questionText:t.editor.question,answerText:t.editor.answer,analysis:t.editor.analysis,wrongAnswerText:t.editor.wrongAnswerText,mistakeAnalysis:t.editor.mistakeAnalysis,knowledgePoints:t.editor.tags,subjectId:t.editor.selectNotebook,gradeSemester:t.editor.gradeSemester,paperLevel:t.editor.paperLevel};return e.slice(0,3).flatMap(e=>{let r=q(e),a=r?.path,i=Array.isArray(a)&&"string"==typeof a[0]?s[a[0]]:void 0;if(!i)return[];let n=r?.maximum,l=t.questionSave.invalidField;return r?.code==="too_big"&&"number"==typeof n&&Number.isSafeInteger(n)&&n>=0&&(l="array"===r.origin?t.questionSave.tooMany:t.questionSave.tooLong),[l.replace("{field}",i).replace("{maximum}",String(n))]})})(r?.details,t).map(e=>`
8
8
  ${e}`).join("")),"string"==typeof d?.databaseCode&&/^P\d{4}$/.test(d.databaseCode)&&(o+=`
9
- ${t.questionSave.databaseCode.replace("{code}",d.databaseCode)}`),a&&(o+=` (HTTP ${a})`),o}(r,t);return i(s),(0,P.t)((0,O.d)(r))||u.c.error(s),!1}};return{saveError:a,setSaveError:i,dismissSaveError:()=>i(null),run:n}}],183444)},469937,e=>{var t=e.i(843476),s=e.i(786563),r=e.i(111110),a=e.i(975157);let i=[1,2,3,4,5];e.s(["f",0,function({value:e,onChange:n,disabled:l,size:o="sm",showUnrated:d=!0,className:c}){let{t:u}=(0,r.b)(),m=e??0,f="sm"===o?"h-3.5 w-3.5":"h-5 w-5",h=m?u.difficulty.starsLabel.replace("{n}",String(m)):u.difficulty.unrated;return n?(0,t.jsxs)("span",{className:(0,a.f)("inline-flex items-center gap-0.5",c),role:"group","aria-label":`${u.difficulty.label}${u.common.colon}${h}`,title:u.difficulty.clearHint,children:[i.map(e=>(0,t.jsx)("button",{type:"button",disabled:l,onClick:()=>n(e===m?null:e),"aria-label":u.difficulty.setStars.replace("{n}",String(e)),"aria-pressed":e<=m,className:"rounded p-0.5 hover:bg-muted disabled:opacity-50 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring",children:(0,t.jsx)(s.f,{className:(0,a.f)(f,e<=m?"fill-amber-400 text-amber-400":"text-muted-foreground/40")})},e)),!m&&d&&(0,t.jsx)("span",{className:"ml-1 text-xs text-muted-foreground",children:u.difficulty.unrated})]}):m?(0,t.jsx)("span",{className:(0,a.f)("inline-flex items-center",c),role:"img","aria-label":`${u.difficulty.label}${u.common.colon}${h}`,title:h,children:i.map(e=>(0,t.jsx)(s.f,{className:(0,a.f)(f,e<=m?"fill-amber-400 text-amber-400":"text-muted-foreground/30"),"aria-hidden":!0},e))}):d?(0,t.jsx)("span",{className:(0,a.f)("text-xs text-muted-foreground",c),children:u.difficulty.unrated}):null}])},731335,532377,339501,e=>{var t=e.i(843476),s=e.i(399847),r=e.i(551757),a=e.i(456420);let i={name:"clock-3",size:24,node:[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 6v6h4",key:"135r8i"}]]};i.node;let n=(0,a.f)(i);var l=e.i(632781),o=e.i(615568),d=e.i(487486),c=e.i(519455),u=e.i(168148),m=e.i(111110),f=e.i(215519),h=e.i(306831);let g=["read","convert","crop","compress","upload"],x=["receive","analyze","save"];function p(e){if(!Number.isFinite(e)||e<0)return"-";if(e<1e3)return`${Math.round(e)}ms`;let t=e/1e3;if(t<60)return`${t.toFixed(+(t<10))}s`;let s=Math.round(t);return`${Math.floor(s/60)}:${String(s%60).padStart(2,"0")}`}var v=e.i(975157);let y={analyzing:50,saving:90},j={analyzing:l.f,saving:l.f,review:o.f,saved:r.f,failed:s.f};e.s(["f",0,function({task:e,now:s,onReview:r,onViewItem:a,onRetry:i,onDiscard:l}){let{t:o}=(0,m.b)(),{timeZone:b}=(0,f.M)(),w=j[e.status],k="analyzing"===e.status||"saving"===e.status,N=o.errors,S=e.error?"string"==typeof N[e.error]?N[e.error]:e.error:null,_=function(e){let t=[];for(let s of g){let r=e?.client?.[s];"number"==typeof r&&t.push({stage:s,ms:r})}for(let s of x){let r=e?.server?.[s];"number"==typeof r&&t.push({stage:s,ms:r})}return t}(e.timings),T=k&&s?s-Date.parse(e.createdAt):null;return(0,t.jsxs)("div",{className:(0,v.f)("space-y-2 rounded-lg border p-3 text-sm",e.unread&&"border-primary/50 bg-primary/5"),"data-testid":"import-task-card","data-status":e.status,children:[(0,t.jsxs)("div",{className:"flex items-start gap-2",children:[(0,t.jsx)(w,{className:(0,v.f)("mt-0.5 h-4 w-4 shrink-0",k&&"animate-spin text-primary","saved"===e.status&&"text-green-600","failed"===e.status&&"text-destructive","review"===e.status&&"text-primary")}),(0,t.jsxs)("div",{className:"min-w-0 flex-1 space-y-1",children:[(0,t.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[(0,t.jsx)("span",{className:"font-medium",children:o.importTasks.status[e.status]}),(0,t.jsx)("span",{className:"text-xs text-muted-foreground",children:o.importTasks.mode[e.mode]}),e.unread&&(0,t.jsx)(d.f,{children:o.importTasks.unread})]}),k&&(0,t.jsx)(u.f,{value:y[e.status],"aria-label":o.importTasks.stageEstimate,"aria-valuetext":o.common.progress.estimated.replace("{percent}",String(y[e.status])),className:"h-1.5"}),e.excerpt&&(0,t.jsx)("p",{className:"break-words text-muted-foreground",children:e.excerpt}),"saved"===e.status&&!e.errorItemId&&(0,t.jsx)("p",{className:"text-xs text-muted-foreground",children:o.importTasks.itemDeleted}),"saved"===e.status&&e.errorItemId&&(0,t.jsx)("p",{className:"text-xs text-green-700 dark:text-green-300",children:e.duplicate?o.importTasks.duplicateSaved:o.importTasks.savedTo.replace("{notebook}",e.notebookName||"-").replace("{id}",e.errorItemShortId||"-")}),S&&(0,t.jsx)("p",{className:"text-xs text-destructive",children:S}),(0,t.jsxs)("div",{className:"flex flex-wrap items-center gap-x-3 gap-y-1 text-xs text-muted-foreground",children:[(0,t.jsxs)("span",{className:"flex items-center gap-1",children:[(0,t.jsx)(n,{className:"h-3 w-3"}),o.importTasks.createdAt.replace("{time}",(0,h.r)(e.createdAt,"MM-dd HH:mm",b))]}),null!==T&&(0,t.jsx)("span",{children:o.importTasks.elapsed.replace("{time}",p(T))}),e.attempts>1&&(0,t.jsx)("span",{children:o.importTasks.attempts.replace("{count}",String(e.attempts))})]}),_.length>0&&(0,t.jsx)("ul",{className:"flex flex-wrap gap-x-3 gap-y-1 text-xs text-muted-foreground tabular-nums","aria-label":"timings",children:_.map(({stage:e,ms:s})=>(0,t.jsxs)("li",{children:[o.importTasks.timings[e]," ",p(s)]},e))})]})]}),(0,t.jsxs)("div",{className:"flex flex-wrap justify-end gap-2",children:["review"===e.status&&r&&(0,t.jsx)(c.f,{size:"sm",onClick:r,children:o.importTasks.continueReview}),"saved"===e.status&&e.errorItemId&&a&&(0,t.jsx)(c.f,{size:"sm",variant:"outline",onClick:a,children:o.importTasks.viewItem}),"failed"===e.status&&i&&(0,t.jsx)(c.f,{size:"sm",onClick:i,children:o.importTasks.retry}),"saving"!==e.status&&"saved"!==e.status&&l&&(0,t.jsx)(c.f,{size:"sm",variant:"ghost",onClick:l,children:o.importTasks.discard})]})]})}],731335);var b=e.i(618566),w=e.i(767077),k=e.i(294114),N=e.i(201276),S=e.i(127175);e.s(["f",0,function(e){let{t}=(0,m.b)(),s=(0,b.useRouter)(),r=e=>{e.unread&&(0,S.N)(e.id).catch(e=>N.V.warn("[ImportTasks]","Mark read failed",{error:e}))};return{openReview:e=>{r(e),s.push(`/import-tasks/${e.id}`)},viewItem:e=>{e.errorItemId&&(r(e),s.push(`/error-items/${e.errorItemId}`))},markRead:r,retry:async s=>{try{await (0,S.R)(s.id),k.c.info(t.importTasks.retried)}catch(e){k.c.error((0,w.f)(e,t))}e?.()},discard:async s=>{if(!await (0,k.u)(t.importTasks.discardConfirm))return!1;let r=!1;try{await (0,S.x)(s.id),k.c.success(t.importTasks.discarded),r=!0}catch(e){k.c.error((0,w.f)(e,t))}return e?.(),r}}}],532377);var _=e.i(271645);e.s(["f",0,function(e,t=1e3){let[s,r]=(0,_.useState)(()=>Date.now());return(0,_.useEffect)(()=>{if(!e)return;let s=setInterval(()=>r(Date.now()),t);return()=>clearInterval(s)},[e,t]),s}],339501)},141176,e=>{var t=e.i(843476),s=e.i(271645),r=e.i(456420);let a={name:"code-xml",size:24,node:[["path",{d:"m18 16 4-4-4-4",key:"1inbqp"}],["path",{d:"m6 8-4 4 4 4",key:"15zrgr"}],["path",{d:"m14.5 4-5 16",key:"e7oirm"}]],aliases:["code-2"]};a.node;let i=(0,r.f)(a);var n=e.i(772382),l=e.i(511445),o=e.i(624687),d=e.i(111110),c=e.i(975157);e.s(["f",0,function({value:e,onChange:r,className:a,...u}){let{t:m}=(0,d.b)(),[f,h]=(0,s.useState)("source"),g=(0,s.useId)(),x=[{mode:"source",label:m.markdownEditor.source,icon:i},{mode:"preview",label:m.markdownEditor.preview,icon:n.f}];return(0,t.jsxs)("div",{className:"space-y-1.5",children:[(0,t.jsx)("div",{role:"tablist","aria-label":m.markdownEditor.modeLabel,className:"flex justify-end",children:(0,t.jsx)("div",{className:"inline-flex rounded-md border bg-muted/40 p-0.5",children:x.map(({mode:e,label:s,icon:r})=>(0,t.jsxs)("button",{type:"button",role:"tab","aria-selected":f===e,"aria-controls":g,onClick:()=>h(e),className:(0,c.f)("flex items-center gap-1 rounded px-2.5 py-1 text-xs transition-colors",f===e?"bg-background font-medium shadow-sm":"text-muted-foreground hover:text-foreground"),children:[(0,t.jsx)(r,{className:"h-3.5 w-3.5"}),s]},e))})}),(0,t.jsx)("div",{id:g,role:"tabpanel",children:"source"===f?(0,t.jsx)(o.f,{value:e,onChange:e=>r(e.target.value),className:a,...u}):(0,t.jsx)("div",{className:"min-h-24 cursor-text rounded-md border bg-muted/20 px-3 py-2",onDoubleClick:()=>h("source"),title:m.markdownEditor.doubleClickToEdit,children:e.trim()?(0,t.jsx)(l.f,{content:e}):(0,t.jsx)("p",{className:"text-sm italic text-muted-foreground",children:m.markdownEditor.empty})})})]})}],141176)},438465,674166,e=>{var t=e.i(843476),s=e.i(271645),r=e.i(967489),a=e.i(856423),i=e.i(41931),n=e.i(201276),l=e.i(111110);e.s(["f",0,function({value:e,onChange:o,className:d}){let[c,u]=(0,s.useState)([]),{t:m}=(0,l.b)();return(0,s.useEffect)(()=>{(async()=>{try{let e=await i.k.get("/api/notebooks");u(e)}catch(e){n.V.error("[NotebookSelector]","Failed to fetch notebooks",{error:e})}})()},[]),(0,t.jsxs)(r.d,{value:e,onValueChange:o,children:[(0,t.jsx)(r.P,{className:d,children:(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)(a.f,{className:"h-4 w-4 text-muted-foreground"}),(0,t.jsx)(r.U,{placeholder:m.notebooks?.selector?.placeholder||"Select Notebook"})]})}),(0,t.jsx)(r.r,{children:0===c.length?(0,t.jsx)("div",{className:"p-2 text-sm text-muted-foreground text-center",children:m.notebooks?.selector?.empty||"No notebooks available"}):c.map(e=>(0,t.jsx)(r.T,{value:e.id,children:e.name},e.id))})]})}],438465);var o=e.i(470279);e.s(["f",0,function({value:e,onChange:s,disabled:a}){let{groups:i,loading:n}=(0,o.f)(),l=i.filter(e=>e.isActive);return(0,t.jsxs)(r.d,{value:e,onValueChange:s,disabled:a||n,children:[(0,t.jsx)(r.P,{children:(0,t.jsx)(r.U,{placeholder:"选择卷别"})}),(0,t.jsx)(r.r,{children:l.map(e=>(0,t.jsx)(r.T,{value:e.id,children:e.name},e.id))})]})}],674166)},149704,e=>{var t=e.i(843476),s=e.i(111110),r=e.i(398019),a=e.i(184110),i=e.i(975157);let n={left:"mr-auto",center:"mx-auto",right:"ml-auto"};e.s(["f",0,function({svg:e,scale:l,align:o,className:d}){let{t:c}=(0,s.b)();if(!e)return null;let u=(0,a.V)(l),m=(0,a.o)(o);return(0,t.jsx)("figure",{className:(0,i.f)("question-figure my-3",d),children:(0,t.jsx)("img",{src:(0,r.d)(e),alt:c.figure.alt,className:(0,i.f)(n[m],"block h-auto max-w-full rounded border bg-white p-2"),style:{..."left"===m?{marginLeft:0,marginRight:"auto"}:"right"===m?{marginLeft:"auto",marginRight:0}:{},maxHeight:360,zoom:u/100,maxWidth:`${Math.min(u,100)}%`}})})}])},574041,e=>{var t=e.i(843476),s=e.i(271645),r=e.i(263676),a=e.i(487486),i=e.i(793479),n=e.i(41931),l=e.i(201276);e.s(["f",0,function({value:e=[],onChange:o,placeholder:d="Enter tags...",className:c="",enterHint:u,subject:m,gradeStage:f}){let[h,g]=(0,s.useState)(""),[x,p]=(0,s.useState)([]),[v,y]=(0,s.useState)(!1),[j,b]=(0,s.useState)(0),w=(0,s.useRef)(null),k=(0,s.useRef)(null),N=(0,s.useCallback)(async t=>{try{let s=new URLSearchParams({q:t});m&&s.append("subject",m),f&&s.append("stage",f);let r=((await n.k.get(`/api/tags/suggestions?${s.toString()}`)).suggestions||[]).filter(t=>!e.includes(t));p(r.slice(0,20)),y(r.length>0),b(0)}catch(e){l.V.error("[TagInput]","Failed to fetch suggestions",{error:e})}},[m,f,e]);(0,s.useEffect)(()=>{h.trim()&&N(h)},[h,N]);let S=t=>{t.trim()&&!e.includes(t.trim())&&(o([...e,t.trim()]),g(""),p([]),y(!1),b(0))},_=t=>{o(e.filter(e=>e!==t))};return(0,s.useEffect)(()=>{let e=e=>{!k.current||k.current.contains(e.target)||w.current?.contains(e.target)||y(!1)};return document.addEventListener("mousedown",e),()=>document.removeEventListener("mousedown",e)},[]),(0,t.jsxs)("div",{className:`relative ${c}`,children:[(0,t.jsxs)("div",{className:"flex flex-wrap gap-2 p-2 border rounded-lg bg-background min-h-[42px]",children:[e.map(e=>(0,t.jsxs)(a.f,{variant:"secondary",className:"flex items-center gap-1 px-2 py-1",children:[e,(0,t.jsx)("button",{type:"button",onClick:()=>_(e),className:"hover:text-destructive ml-1",children:(0,t.jsx)(r.X,{className:"h-3 w-3"})})]},e)),(0,t.jsx)(i.f,{ref:w,type:"text",value:h,onChange:e=>{g(e.target.value),e.target.value.trim()||(p([]),y(!1))},onKeyDown:t=>{"Enter"===t.key?(t.preventDefault(),j>=0&&x[j]?S(x[j]):h.trim()&&S(h)):"ArrowDown"===t.key?(t.preventDefault(),b(e=>Math.min(e+1,x.length-1))):"ArrowUp"===t.key?(t.preventDefault(),b(e=>Math.max(e-1,0))):"Escape"===t.key?(y(!1),b(0)):"Backspace"===t.key&&!h&&e.length>0&&_(e[e.length-1])},onFocus:()=>{x.length>0&&y(!0)},placeholder:0===e.length?d:"",className:"flex-1 min-w-[120px] border-none focus-visible:ring-0 focus-visible:ring-offset-0 h-8 px-0"})]}),v&&x.length>0&&(0,t.jsx)("div",{ref:k,className:"absolute z-50 w-full mt-1 bg-popover border rounded-md shadow-md max-h-48 overflow-y-auto",children:x.map((e,s)=>(0,t.jsx)("div",{className:`px-3 py-2 cursor-pointer hover:bg-accent ${s===j?"bg-accent":""}`,onClick:()=>S(e),onMouseEnter:()=>b(s),children:e},e))}),h&&!v&&(0,t.jsx)("div",{className:"text-xs text-muted-foreground mt-1",children:u?`${u} "${h}"`:`Press Enter to create "${h}"`})]})}])},184110,e=>{let t=["left","center","right"],s="center";function r(e){return"number"==typeof e&&Number.isInteger(e)&&e>=10&&e<=200}e.s(["E",0,s,"n",0,100,"j",0,t,"a",0,200,"_",0,10,"x",0,r,"o",0,function(e){return"string"==typeof e&&t.includes(e)?e:s},"V",0,function(e){return r(e)?e:100}])},398019,e=>{e.s(["K",0,1e5,"d",0,function(e){return`data:image/svg+xml;charset=utf-8,${encodeURIComponent(e)}`}])},767077,e=>{var t=e.i(303163);e.s(["f",0,function(e,s){let r=s.common?.messages?.analysisFailed||"Analysis failed, please try again",a=(0,t.d)(e);if(a){let e=s.errors??{};if(!(a in e))return a;let t=e[a];return"string"==typeof t?t:r}let i=(0,t.Z)(e);if(i.includes("fetch")||i.includes("network"))return s.errors?.AI_CONNECTION_FAILED||"网络连接失败";if("object"==typeof e&&null!==e&&"data"in e&&"string"==typeof e.data){let t="status"in e&&"number"==typeof e.status?e.status:"Error";return`${r} (${t})`}return r}])},991722,e=>{function t(e){return"not_attempted"===e||"wrong_attempt"===e||"unknown"===e?e:"unknown"}e.s(["i",0,function(e,s="zh"){return("en"===s?{not_attempted:"Not attempted",wrong_attempt:"Wrong attempt",unknown:"Unknown"}:{not_attempted:"不会做",wrong_attempt:"做错了",unknown:"未判断"})[t(e)]},"h",0,t,"x",0,function(e,s){return(s||"").trim()?"wrong_attempt":t(e)}])},401280,e=>{let t={single_choice:"single_choice",singlechoice:"single_choice","single choice":"single_choice","single-choice":"single_choice",multiple_choice:"multiple_choice",multiplechoice:"multiple_choice","multiple choice":"multiple_choice","multiple-choice":"multiple_choice",multichoice:"multiple_choice","multi choice":"multiple_choice",true_false:"true_false",truefalse:"true_false","true/false":"true_false","true false":"true_false","true-false":"true_false","true / false":"true_false",fill_blank:"fill_blank",fillblank:"fill_blank","fill in the blank":"fill_blank","fill-in-the-blank":"fill_blank",fillintheblank:"fill_blank",calculation:"calculation",solution:"solution",reading:"reading",cloze:"cloze",writing:"writing",other:"other",选择题:"single_choice",单项选择:"single_choice",单选:"single_choice",单选题:"single_choice",不定项:"multiple_choice",不定项选择:"multiple_choice",多项选择:"multiple_choice",多选:"multiple_choice",多选题:"multiple_choice",判断:"true_false",判断题:"true_false",是非:"true_false",是非题:"true_false",填空:"fill_blank",填空题:"fill_blank",口算:"calculation",计算:"calculation",计算题:"calculation",解答:"solution",解答题:"solution",应用:"solution",应用题:"solution",证明:"solution",证明题:"solution",简答:"solution",简答题:"solution",阅读:"reading",阅读理解:"reading",完形:"cloze",完形填空:"cloze",作文:"writing",写作:"writing",书面表达:"writing",其他:"other"};e.s(["O",0,"__none__","V",0,["single_choice","multiple_choice","true_false","fill_blank","calculation","solution","reading","cloze","writing","other"],"u",0,{single_choice:"Single Choice",multiple_choice:"Multiple Choice",true_false:"True / False",fill_blank:"Fill in the Blank",calculation:"Calculation",solution:"Solution",reading:"Reading Comprehension",cloze:"Cloze",writing:"Writing",other:"Other"},"H",0,{single_choice:"单选题",multiple_choice:"多选题",true_false:"判断题",fill_blank:"填空题",calculation:"计算题",solution:"解答题",reading:"阅读理解",cloze:"完形填空",writing:"写作",other:"其他"},"P",0,function(e){if("string"!=typeof e)return null;let s=e.trim().toLowerCase();return s?t[s]??null:null}])},597138,e=>{e.i(306831),e.s(["f",0,function(e){if(!e)return null;let t=e.toLowerCase();return t.includes("math")||t.includes("数学")?"math":t.includes("physics")||t.includes("物理")?"physics":t.includes("chemistry")||t.includes("化学")?"chemistry":t.includes("biology")||t.includes("生物")?"biology":t.includes("english")||t.includes("英语")?"english":t.includes("chinese")||t.includes("语文")?"chinese":t.includes("history")||t.includes("历史")?"history":t.includes("geography")||t.includes("地理")?"geography":t.includes("politics")||t.includes("政治")?"politics":null}])}])})();
9
+ ${t.questionSave.databaseCode.replace("{code}",d.databaseCode)}`),a&&(o+=` (HTTP ${a})`),o}(r,t);return i(s),(0,P.t)((0,O.d)(r))||u.c.error(s),!1}};return{saveError:a,setSaveError:i,dismissSaveError:()=>i(null),run:n}}],183444)},469937,e=>{var t=e.i(843476),s=e.i(786563),r=e.i(111110),a=e.i(975157);let i=[1,2,3,4,5];e.s(["f",0,function({value:e,onChange:n,disabled:l,size:o="sm",showUnrated:d=!0,className:c}){let{t:u}=(0,r.b)(),m=e??0,f="sm"===o?"h-3.5 w-3.5":"h-5 w-5",h=m?u.difficulty.starsLabel.replace("{n}",String(m)):u.difficulty.unrated;return n?(0,t.jsxs)("span",{className:(0,a.f)("inline-flex items-center gap-0.5",c),role:"group","aria-label":`${u.difficulty.label}${u.common.colon}${h}`,title:u.difficulty.clearHint,children:[i.map(e=>(0,t.jsx)("button",{type:"button",disabled:l,onClick:()=>n(e===m?null:e),"aria-label":u.difficulty.setStars.replace("{n}",String(e)),"aria-pressed":e<=m,className:"rounded p-0.5 hover:bg-muted disabled:opacity-50 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring",children:(0,t.jsx)(s.f,{className:(0,a.f)(f,e<=m?"fill-amber-400 text-amber-400":"text-muted-foreground/40")})},e)),!m&&d&&(0,t.jsx)("span",{className:"ml-1 text-xs text-muted-foreground",children:u.difficulty.unrated})]}):m?(0,t.jsx)("span",{className:(0,a.f)("inline-flex items-center",c),role:"img","aria-label":`${u.difficulty.label}${u.common.colon}${h}`,title:h,children:i.map(e=>(0,t.jsx)(s.f,{className:(0,a.f)(f,e<=m?"fill-amber-400 text-amber-400":"text-muted-foreground/30"),"aria-hidden":!0},e))}):d?(0,t.jsx)("span",{className:(0,a.f)("text-xs text-muted-foreground",c),children:u.difficulty.unrated}):null}])},731335,532377,339501,e=>{var t=e.i(843476),s=e.i(399847),r=e.i(551757),a=e.i(456420);let i={name:"clock-3",size:24,node:[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 6v6h4",key:"135r8i"}]]};i.node;let n=(0,a.f)(i);var l=e.i(632781),o=e.i(615568),d=e.i(487486),c=e.i(519455),u=e.i(168148),m=e.i(111110),f=e.i(215519),h=e.i(306831);let g=["read","convert","crop","compress","upload"],x=["receive","analyze","save"];function p(e){if(!Number.isFinite(e)||e<0)return"-";if(e<1e3)return`${Math.round(e)}ms`;let t=e/1e3;if(t<60)return`${t.toFixed(+(t<10))}s`;let s=Math.round(t);return`${Math.floor(s/60)}:${String(s%60).padStart(2,"0")}`}var v=e.i(975157);let y={analyzing:50,saving:90},j={analyzing:l.f,saving:l.f,review:o.f,saved:r.f,failed:s.f};e.s(["f",0,function({task:e,now:s,onReview:r,onViewItem:a,onRetry:i,onDiscard:l}){let{t:o}=(0,m.b)(),{timeZone:b}=(0,f.M)(),w=j[e.status],k="analyzing"===e.status||"saving"===e.status,N=o.errors,S=e.error?"string"==typeof N[e.error]?N[e.error]:e.error:null,_=function(e){let t=[];for(let s of g){let r=e?.client?.[s];"number"==typeof r&&t.push({stage:s,ms:r})}for(let s of x){let r=e?.server?.[s];"number"==typeof r&&t.push({stage:s,ms:r})}return t}(e.timings),T=k&&s?s-Date.parse(e.createdAt):null;return(0,t.jsxs)("div",{className:(0,v.f)("space-y-2 rounded-lg border p-3 text-sm",e.unread&&"border-primary/50 bg-primary/5"),"data-testid":"import-task-card","data-status":e.status,children:[(0,t.jsxs)("div",{className:"flex items-start gap-2",children:[(0,t.jsx)(w,{className:(0,v.f)("mt-0.5 h-4 w-4 shrink-0",k&&"animate-spin text-primary","saved"===e.status&&"text-green-600","failed"===e.status&&"text-destructive","review"===e.status&&"text-primary")}),(0,t.jsxs)("div",{className:"min-w-0 flex-1 space-y-1",children:[(0,t.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[(0,t.jsx)("span",{className:"font-medium",children:o.importTasks.status[e.status]}),(0,t.jsx)("span",{className:"text-xs text-muted-foreground",children:o.importTasks.mode[e.mode]}),e.unread&&(0,t.jsx)(d.f,{children:o.importTasks.unread})]}),k&&(0,t.jsx)(u.f,{value:y[e.status],"aria-label":o.importTasks.stageEstimate,"aria-valuetext":o.common.progress.estimated.replace("{percent}",String(y[e.status])),className:"h-1.5"}),e.excerpt&&(0,t.jsx)("p",{className:"break-words text-muted-foreground",children:e.excerpt}),"saved"===e.status&&!e.errorItemId&&(0,t.jsx)("p",{className:"text-xs text-muted-foreground",children:o.importTasks.itemDeleted}),"saved"===e.status&&e.errorItemId&&(0,t.jsx)("p",{className:"text-xs text-green-700 dark:text-green-300",children:e.duplicate?o.importTasks.duplicateSaved:o.importTasks.savedTo.replace("{notebook}",e.notebookName||"-").replace("{id}",e.errorItemShortId||"-")}),S&&(0,t.jsx)("p",{className:"text-xs text-destructive",children:S}),(0,t.jsxs)("div",{className:"flex flex-wrap items-center gap-x-3 gap-y-1 text-xs text-muted-foreground",children:[(0,t.jsxs)("span",{className:"flex items-center gap-1",children:[(0,t.jsx)(n,{className:"h-3 w-3"}),o.importTasks.createdAt.replace("{time}",(0,h.r)(e.createdAt,"MM-dd HH:mm",b))]}),null!==T&&(0,t.jsx)("span",{children:o.importTasks.elapsed.replace("{time}",p(T))}),e.attempts>1&&(0,t.jsx)("span",{children:o.importTasks.attempts.replace("{count}",String(e.attempts))})]}),_.length>0&&(0,t.jsx)("ul",{className:"flex flex-wrap gap-x-3 gap-y-1 text-xs text-muted-foreground tabular-nums","aria-label":"timings",children:_.map(({stage:e,ms:s})=>(0,t.jsxs)("li",{children:[o.importTasks.timings[e]," ",p(s)]},e))})]})]}),(0,t.jsxs)("div",{className:"flex flex-wrap justify-end gap-2",children:["review"===e.status&&r&&(0,t.jsx)(c.f,{size:"sm",onClick:r,children:o.importTasks.continueReview}),"saved"===e.status&&e.errorItemId&&a&&(0,t.jsx)(c.f,{size:"sm",variant:"outline",onClick:a,children:o.importTasks.viewItem}),"failed"===e.status&&i&&(0,t.jsx)(c.f,{size:"sm",onClick:i,children:o.importTasks.retry}),"saving"!==e.status&&"saved"!==e.status&&l&&(0,t.jsx)(c.f,{size:"sm",variant:"ghost",onClick:l,children:o.importTasks.discard})]})]})}],731335);var b=e.i(618566),w=e.i(767077),k=e.i(294114),N=e.i(201276),S=e.i(127175);e.s(["f",0,function(e){let{t}=(0,m.b)(),s=(0,b.useRouter)(),r=e=>{e.unread&&(0,S.N)(e.id).catch(e=>N.V.warn("[ImportTasks]","Mark read failed",{error:e}))};return{openReview:e=>{r(e),s.push(`/import-tasks/${e.id}`)},viewItem:e=>{e.errorItemId&&(r(e),s.push(`/error-items/${e.errorItemId}`))},markRead:r,retry:async s=>{try{await (0,S.R)(s.id),k.c.info(t.importTasks.retried)}catch(e){k.c.error((0,w.f)(e,t))}e?.()},discard:async s=>{if(!await (0,k.u)(t.importTasks.discardConfirm))return!1;let r=!1;try{await (0,S.x)(s.id),k.c.success(t.importTasks.discarded),r=!0}catch(e){k.c.error((0,w.f)(e,t))}return e?.(),r}}}],532377);var _=e.i(271645);e.s(["f",0,function(e,t=1e3){let[s,r]=(0,_.useState)(()=>Date.now());return(0,_.useEffect)(()=>{if(!e)return;let s=setInterval(()=>r(Date.now()),t);return()=>clearInterval(s)},[e,t]),s}],339501)},141176,e=>{var t=e.i(843476),s=e.i(271645),r=e.i(456420);let a={name:"code-xml",size:24,node:[["path",{d:"m18 16 4-4-4-4",key:"1inbqp"}],["path",{d:"m6 8-4 4 4 4",key:"15zrgr"}],["path",{d:"m14.5 4-5 16",key:"e7oirm"}]],aliases:["code-2"]};a.node;let i=(0,r.f)(a);var n=e.i(772382),l=e.i(511445),o=e.i(624687),d=e.i(111110),c=e.i(975157);e.s(["f",0,function({value:e,onChange:r,className:a,...u}){let{t:m}=(0,d.b)(),[f,h]=(0,s.useState)("source"),g=(0,s.useId)(),x=[{mode:"source",label:m.markdownEditor.source,icon:i},{mode:"preview",label:m.markdownEditor.preview,icon:n.f}];return(0,t.jsxs)("div",{className:"space-y-1.5",children:[(0,t.jsx)("div",{role:"tablist","aria-label":m.markdownEditor.modeLabel,className:"flex justify-end",children:(0,t.jsx)("div",{className:"inline-flex rounded-md border bg-muted/40 p-0.5",children:x.map(({mode:e,label:s,icon:r})=>(0,t.jsxs)("button",{type:"button",role:"tab","aria-selected":f===e,"aria-controls":g,onClick:()=>h(e),className:(0,c.f)("flex items-center gap-1 rounded px-2.5 py-1 text-xs transition-colors",f===e?"bg-background font-medium shadow-sm":"text-muted-foreground hover:text-foreground"),children:[(0,t.jsx)(r,{className:"h-3.5 w-3.5"}),s]},e))})}),(0,t.jsx)("div",{id:g,role:"tabpanel",children:"source"===f?(0,t.jsx)(o.f,{value:e,onChange:e=>r(e.target.value),className:a,...u}):(0,t.jsx)("div",{className:"min-h-24 cursor-text rounded-md border bg-muted/20 px-3 py-2",onDoubleClick:()=>h("source"),title:m.markdownEditor.doubleClickToEdit,children:e.trim()?(0,t.jsx)(l.f,{content:e}):(0,t.jsx)("p",{className:"text-sm italic text-muted-foreground",children:m.markdownEditor.empty})})})]})}],141176)},438465,e=>{var t=e.i(843476),s=e.i(271645),r=e.i(967489),a=e.i(856423),i=e.i(41931),n=e.i(201276),l=e.i(111110);e.s(["f",0,function({value:e,onChange:o,className:d}){let[c,u]=(0,s.useState)([]),{t:m}=(0,l.b)();return(0,s.useEffect)(()=>{(async()=>{try{let e=await i.k.get("/api/notebooks");u(e)}catch(e){n.V.error("[NotebookSelector]","Failed to fetch notebooks",{error:e})}})()},[]),(0,t.jsxs)(r.d,{value:e,onValueChange:o,children:[(0,t.jsx)(r.P,{className:d,children:(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)(a.f,{className:"h-4 w-4 text-muted-foreground"}),(0,t.jsx)(r.U,{placeholder:m.notebooks?.selector?.placeholder||"Select Notebook"})]})}),(0,t.jsx)(r.r,{children:0===c.length?(0,t.jsx)("div",{className:"p-2 text-sm text-muted-foreground text-center",children:m.notebooks?.selector?.empty||"No notebooks available"}):c.map(e=>(0,t.jsx)(r.T,{value:e.id,children:e.name},e.id))})]})}])},674166,e=>{var t=e.i(843476),s=e.i(967489),r=e.i(470279);e.s(["f",0,function({value:e,onChange:a,disabled:i}){let{groups:n,loading:l}=(0,r.f)(),o=n.filter(e=>e.isActive);return(0,t.jsxs)(s.d,{value:e,onValueChange:a,disabled:i||l,children:[(0,t.jsx)(s.P,{children:(0,t.jsx)(s.U,{placeholder:"选择卷别"})}),(0,t.jsx)(s.r,{children:o.map(e=>(0,t.jsx)(s.T,{value:e.id,children:e.name},e.id))})]})}])},149704,e=>{var t=e.i(843476),s=e.i(111110),r=e.i(398019),a=e.i(184110),i=e.i(975157);let n={left:"mr-auto",center:"mx-auto",right:"ml-auto"};e.s(["f",0,function({svg:e,scale:l,align:o,className:d}){let{t:c}=(0,s.b)();if(!e)return null;let u=(0,a.V)(l),m=(0,a.o)(o);return(0,t.jsx)("figure",{className:(0,i.f)("question-figure my-3",d),children:(0,t.jsx)("img",{src:(0,r.d)(e),alt:c.figure.alt,className:(0,i.f)(n[m],"block h-auto max-w-full rounded border bg-white p-2"),style:{..."left"===m?{marginLeft:0,marginRight:"auto"}:"right"===m?{marginLeft:"auto",marginRight:0}:{},maxHeight:360,zoom:u/100,maxWidth:`${Math.min(u,100)}%`}})})}])},574041,e=>{var t=e.i(843476),s=e.i(271645),r=e.i(263676),a=e.i(487486),i=e.i(793479),n=e.i(41931),l=e.i(201276);e.s(["f",0,function({value:e=[],onChange:o,placeholder:d="Enter tags...",className:c="",enterHint:u,subject:m,gradeStage:f}){let[h,g]=(0,s.useState)(""),[x,p]=(0,s.useState)([]),[v,y]=(0,s.useState)(!1),[j,b]=(0,s.useState)(0),w=(0,s.useRef)(null),k=(0,s.useRef)(null),N=(0,s.useCallback)(async t=>{try{let s=new URLSearchParams({q:t});m&&s.append("subject",m),f&&s.append("stage",f);let r=((await n.k.get(`/api/tags/suggestions?${s.toString()}`)).suggestions||[]).filter(t=>!e.includes(t));p(r.slice(0,20)),y(r.length>0),b(0)}catch(e){l.V.error("[TagInput]","Failed to fetch suggestions",{error:e})}},[m,f,e]);(0,s.useEffect)(()=>{h.trim()&&N(h)},[h,N]);let S=t=>{t.trim()&&!e.includes(t.trim())&&(o([...e,t.trim()]),g(""),p([]),y(!1),b(0))},_=t=>{o(e.filter(e=>e!==t))};return(0,s.useEffect)(()=>{let e=e=>{!k.current||k.current.contains(e.target)||w.current?.contains(e.target)||y(!1)};return document.addEventListener("mousedown",e),()=>document.removeEventListener("mousedown",e)},[]),(0,t.jsxs)("div",{className:`relative ${c}`,children:[(0,t.jsxs)("div",{className:"flex flex-wrap gap-2 p-2 border rounded-lg bg-background min-h-[42px]",children:[e.map(e=>(0,t.jsxs)(a.f,{variant:"secondary",className:"flex items-center gap-1 px-2 py-1",children:[e,(0,t.jsx)("button",{type:"button",onClick:()=>_(e),className:"hover:text-destructive ml-1",children:(0,t.jsx)(r.X,{className:"h-3 w-3"})})]},e)),(0,t.jsx)(i.f,{ref:w,type:"text",value:h,onChange:e=>{g(e.target.value),e.target.value.trim()||(p([]),y(!1))},onKeyDown:t=>{"Enter"===t.key?(t.preventDefault(),j>=0&&x[j]?S(x[j]):h.trim()&&S(h)):"ArrowDown"===t.key?(t.preventDefault(),b(e=>Math.min(e+1,x.length-1))):"ArrowUp"===t.key?(t.preventDefault(),b(e=>Math.max(e-1,0))):"Escape"===t.key?(y(!1),b(0)):"Backspace"===t.key&&!h&&e.length>0&&_(e[e.length-1])},onFocus:()=>{x.length>0&&y(!0)},placeholder:0===e.length?d:"",className:"flex-1 min-w-[120px] border-none focus-visible:ring-0 focus-visible:ring-offset-0 h-8 px-0"})]}),v&&x.length>0&&(0,t.jsx)("div",{ref:k,className:"absolute z-50 w-full mt-1 bg-popover border rounded-md shadow-md max-h-48 overflow-y-auto",children:x.map((e,s)=>(0,t.jsx)("div",{className:`px-3 py-2 cursor-pointer hover:bg-accent ${s===j?"bg-accent":""}`,onClick:()=>S(e),onMouseEnter:()=>b(s),children:e},e))}),h&&!v&&(0,t.jsx)("div",{className:"text-xs text-muted-foreground mt-1",children:u?`${u} "${h}"`:`Press Enter to create "${h}"`})]})}])},184110,e=>{let t=["left","center","right"],s="center";function r(e){return"number"==typeof e&&Number.isInteger(e)&&e>=10&&e<=200}e.s(["E",0,s,"n",0,100,"j",0,t,"a",0,200,"_",0,10,"x",0,r,"o",0,function(e){return"string"==typeof e&&t.includes(e)?e:s},"V",0,function(e){return r(e)?e:100}])},398019,e=>{e.s(["K",0,1e5,"d",0,function(e){return`data:image/svg+xml;charset=utf-8,${encodeURIComponent(e)}`}])},767077,e=>{var t=e.i(303163);e.s(["f",0,function(e,s){let r=s.common?.messages?.analysisFailed||"Analysis failed, please try again",a=(0,t.d)(e);if(a){let e=s.errors??{};if(!(a in e))return a;let t=e[a];return"string"==typeof t?t:r}let i=(0,t.Z)(e);if(i.includes("fetch")||i.includes("network"))return s.errors?.AI_CONNECTION_FAILED||"网络连接失败";if("object"==typeof e&&null!==e&&"data"in e&&"string"==typeof e.data){let t="status"in e&&"number"==typeof e.status?e.status:"Error";return`${r} (${t})`}return r}])},991722,e=>{function t(e){return"not_attempted"===e||"wrong_attempt"===e||"unknown"===e?e:"unknown"}e.s(["i",0,function(e,s="zh"){return("en"===s?{not_attempted:"Not attempted",wrong_attempt:"Wrong attempt",unknown:"Unknown"}:{not_attempted:"不会做",wrong_attempt:"做错了",unknown:"未判断"})[t(e)]},"h",0,t,"x",0,function(e,s){return(s||"").trim()?"wrong_attempt":t(e)}])},401280,e=>{let t={single_choice:"single_choice",singlechoice:"single_choice","single choice":"single_choice","single-choice":"single_choice",multiple_choice:"multiple_choice",multiplechoice:"multiple_choice","multiple choice":"multiple_choice","multiple-choice":"multiple_choice",multichoice:"multiple_choice","multi choice":"multiple_choice",true_false:"true_false",truefalse:"true_false","true/false":"true_false","true false":"true_false","true-false":"true_false","true / false":"true_false",fill_blank:"fill_blank",fillblank:"fill_blank","fill in the blank":"fill_blank","fill-in-the-blank":"fill_blank",fillintheblank:"fill_blank",calculation:"calculation",solution:"solution",reading:"reading",cloze:"cloze",writing:"writing",other:"other",选择题:"single_choice",单项选择:"single_choice",单选:"single_choice",单选题:"single_choice",不定项:"multiple_choice",不定项选择:"multiple_choice",多项选择:"multiple_choice",多选:"multiple_choice",多选题:"multiple_choice",判断:"true_false",判断题:"true_false",是非:"true_false",是非题:"true_false",填空:"fill_blank",填空题:"fill_blank",口算:"calculation",计算:"calculation",计算题:"calculation",解答:"solution",解答题:"solution",应用:"solution",应用题:"solution",证明:"solution",证明题:"solution",简答:"solution",简答题:"solution",阅读:"reading",阅读理解:"reading",完形:"cloze",完形填空:"cloze",作文:"writing",写作:"writing",书面表达:"writing",其他:"other"};e.s(["O",0,"__none__","V",0,["single_choice","multiple_choice","true_false","fill_blank","calculation","solution","reading","cloze","writing","other"],"u",0,{single_choice:"Single Choice",multiple_choice:"Multiple Choice",true_false:"True / False",fill_blank:"Fill in the Blank",calculation:"Calculation",solution:"Solution",reading:"Reading Comprehension",cloze:"Cloze",writing:"Writing",other:"Other"},"H",0,{single_choice:"单选题",multiple_choice:"多选题",true_false:"判断题",fill_blank:"填空题",calculation:"计算题",solution:"解答题",reading:"阅读理解",cloze:"完形填空",writing:"写作",other:"其他"},"P",0,function(e){if("string"!=typeof e)return null;let s=e.trim().toLowerCase();return s?t[s]??null:null}])},597138,e=>{e.i(306831),e.s(["f",0,function(e){if(!e)return null;let t=e.toLowerCase();return t.includes("math")||t.includes("数学")?"math":t.includes("physics")||t.includes("物理")?"physics":t.includes("chemistry")||t.includes("化学")?"chemistry":t.includes("biology")||t.includes("生物")?"biology":t.includes("english")||t.includes("英语")?"english":t.includes("chinese")||t.includes("语文")?"chinese":t.includes("history")||t.includes("历史")?"history":t.includes("geography")||t.includes("地理")?"geography":t.includes("politics")||t.includes("政治")?"politics":null}])}])})();
@@ -6,4 +6,4 @@
6
6
  Defaulting to \`null\`.`}d(p,"defaultGetValueLabel"),d(v,"getProgressState"),d(j,"isNumber"),d(y,"isValidMaxNumber"),d(w,"isValidValueNumber"),d(b,"getInvalidMaxError"),d(N,"getInvalidValueError");var k=e.i(975157);let S=i.forwardRef(({className:e,value:t,...s},r)=>(0,a.jsx)(h,{ref:r,value:t,className:(0,k.f)("relative h-4 w-full overflow-hidden rounded-full bg-secondary",e),...s,children:(0,a.jsx)(g,{className:"h-full w-full flex-1 bg-primary transition-all",style:{transform:`translateX(-${100-(t||0)}%)`}})}));S.displayName=h.displayName,e.s(["f",0,S],168148)},856522,e=>{var t=e.i(456420);let s={name:"save",size:24,node:[["path",{d:"M15.2 3a2 2 0 0 1 1.4.6l3.8 3.8a2 2 0 0 1 .6 1.4V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2z",key:"1c8476"}],["path",{d:"M17 21v-7a1 1 0 0 0-1-1H8a1 1 0 0 0-1 1v7",key:"1ydtos"}],["path",{d:"M7 3v4a1 1 0 0 0 1 1h7",key:"t51u73"}]]};s.node;let r=(0,t.f)(s);e.s(["f",0,r],856522)},786563,e=>{var t=e.i(456420);let s={name:"star",size:24,node:[["path",{d:"M11.525 2.295a.53.53 0 0 1 .95 0l2.31 4.679a2.123 2.123 0 0 0 1.595 1.16l5.166.756a.53.53 0 0 1 .294.904l-3.736 3.638a2.123 2.123 0 0 0-.611 1.878l.882 5.14a.53.53 0 0 1-.771.56l-4.618-2.428a2.122 2.122 0 0 0-1.973 0L6.396 21.01a.53.53 0 0 1-.77-.56l.881-5.139a2.122 2.122 0 0 0-.611-1.879L2.16 9.795a.53.53 0 0 1 .294-.906l5.165-.755a2.122 2.122 0 0 0 1.597-1.16z",key:"r04s7s"}]]};s.node;let r=(0,t.f)(s);e.s(["f",0,r],786563)},866531,497346,183444,e=>{var t=e.i(843476),s=e.i(271645),r=e.i(632781),a=e.i(741120),i=e.i(856522),n=e.i(314381),l=e.i(3198),o=e.i(519455),d=e.i(111110),c=e.i(41931),u=e.i(294114),m=e.i(201276);function f({data:e,onChange:a}){let{t:i}=(0,d.b)(),[x,h]=(0,s.useState)(!1),[g,p]=(0,s.useState)(null),v=async()=>{if(!e.questionText.trim())return void u.c.warning(i.editor.enterQuestionFirst||"Please enter question text first");if(!e.answerText.trim())return void u.c.warning(i.geogebra.answerRequired);h(!0),p(null);try{let t=await c.k.post("/api/geogebra-analyze",{questionText:e.questionText,answerText:e.answerText,analysis:e.analysis},{timeout:18e4,recoverable:!0});t.suitable&&t.commands&&t.commands.length>0?a({geogebraCommands:JSON.stringify(t.commands)}):p(t.description||i.geogebra.notSuitable)}catch(e){m.V.error("[CorrectionEditor]","GeoGebra analysis failed",{error:e}),p(i.geogebra.analyzeFailed)}finally{h(!1)}};return e.geogebraCommands?(0,t.jsx)(l.f,{commands:e.geogebraCommands,height:350,onRegenerate:v,onDelete:async()=>a({geogebraCommands:void 0})}):e.questionText.trim()&&e.answerText.trim()?(0,t.jsxs)("div",{className:"rounded-lg border border-dashed p-4",children:[(0,t.jsxs)("div",{className:"flex items-center justify-between",children:[(0,t.jsxs)("div",{className:"flex items-center gap-2 text-sm text-muted-foreground",children:[(0,t.jsx)(n.f,{className:"h-4 w-4"}),(0,t.jsx)("span",{children:i.geogebra.title})]}),(0,t.jsx)(o.f,{variant:"outline",size:"sm",onClick:v,disabled:x,children:x?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(r.f,{className:"mr-2 h-4 w-4 animate-spin"}),i.geogebra.analyzing]}):(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(n.f,{className:"mr-2 h-4 w-4"}),i.geogebra.generate]})})]}),g&&(0,t.jsx)("p",{className:"text-xs text-muted-foreground mt-2",children:g}),(0,t.jsx)("p",{className:"text-xs text-muted-foreground mt-2",children:i.geogebra.hint})]}):null}var x=e.i(469937),h=e.i(28342),g=e.i(438465),p=e.i(674166),v=e.i(110204),j=e.i(967489),y=e.i(401280);function w({data:e,paperLevel:s,onChange:r}){let{t:a}=(0,d.b)();return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsx)(v.f,{children:a.editor.selectNotebook||"Select Notebook"}),(0,t.jsx)(g.f,{value:e.subjectId,onChange:e=>r({subjectId:e})})]}),(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsx)(v.f,{children:a.questionType.label||"Question Type"}),(0,t.jsxs)(j.d,{value:e.questionType||"",onValueChange:e=>r({questionType:e===y.O?null:e}),children:[(0,t.jsx)(j.P,{children:(0,t.jsx)(j.U,{placeholder:a.questionType.notSet||"Not set"})}),(0,t.jsxs)(j.r,{children:[(0,t.jsx)(j.T,{value:y.O,children:a.questionType.clear||"Clear"}),y.V.map(e=>(0,t.jsx)(j.T,{value:e,children:a.questionType.names?.[e]||e},e))]})]})]}),(0,t.jsxs)("div",{className:"grid grid-cols-2 gap-4",children:[(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsx)(v.f,{htmlFor:"correction-grade-semester",children:a.editor.gradeSemester||"Grade/Semester"}),(0,t.jsx)(h.f,{id:"correction-grade-semester",value:e.gradeSemester||"",onChange:e=>r({gradeSemester:e})})]}),(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsx)(v.f,{children:a.editor.paperLevel||"Paper Level"}),(0,t.jsx)(p.f,{value:s,onChange:e=>r({paperLevel:e})})]})]}),(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsx)(v.f,{children:a.difficulty.label}),(0,t.jsx)("div",{children:(0,t.jsx)(x.f,{size:"md",value:e.difficultyStars,onChange:e=>r({difficultyStars:e})})})]})]})}var b=e.i(141176),N=e.i(515288);function k({data:e,onChange:s}){let{t:r}=(0,d.b)();return(0,t.jsxs)(N.N,{children:[(0,t.jsx)(N.Y,{children:(0,t.jsx)(N.v,{children:r.editor.mistakeAnalysisTitle||"Mistake Analysis"})}),(0,t.jsxs)(N.O,{className:"space-y-4",children:[(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsx)(v.f,{children:r.editor.mistakeStatus||"Attempt Status"}),(0,t.jsxs)(j.d,{value:e.mistakeStatus||"unknown",onValueChange:e=>s({mistakeStatus:e}),children:[(0,t.jsx)(j.P,{children:(0,t.jsx)(j.U,{})}),(0,t.jsxs)(j.r,{children:[(0,t.jsx)(j.T,{value:"not_attempted",children:r.editor.mistakeStatuses?.notAttempted||"Not attempted"}),(0,t.jsx)(j.T,{value:"wrong_attempt",children:r.editor.mistakeStatuses?.wrongAttempt||"Wrong attempt"}),(0,t.jsx)(j.T,{value:"unknown",children:r.editor.mistakeStatuses?.unknown||"Unknown"})]})]})]}),(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsx)(v.f,{children:r.editor.wrongAnswerText||"Wrong Answer / Work"}),(0,t.jsx)(b.f,{value:e.wrongAnswerText||"",onChange:t=>s({wrongAnswerText:t,mistakeStatus:t.trim()?"wrong_attempt":e.mistakeStatus}),className:"min-h-[100px] font-mono text-sm",placeholder:r.editor.wrongAnswerPlaceholder||"Leave blank if no wrong answer is visible"})]}),(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsx)(v.f,{children:r.editor.mistakeAnalysis||"Mistake Cause Analysis"}),(0,t.jsx)(b.f,{value:e.mistakeAnalysis||"",onChange:e=>s({mistakeAnalysis:e}),className:"min-h-[140px] font-mono text-sm",placeholder:r.editor.mistakeAnalysisPlaceholder||"Explain where and why the mistake happened"})]})]})]})}var S=e.i(511445),T=e.i(149704);function A({title:e,children:s,className:r}){return(0,t.jsxs)(N.N,{children:[(0,t.jsx)(N.Y,{children:(0,t.jsx)(N.v,{children:e})}),(0,t.jsx)(N.O,{className:r,children:s})]})}function E({data:e,children:s}){let{t:r}=(0,d.b)(),a={wrong_attempt:r.editor.mistakeStatuses?.wrongAttempt||"Wrong attempt",not_attempted:r.editor.mistakeStatuses?.notAttempted||"Not attempted",unknown:r.editor.mistakeStatuses?.unknown||"Unknown"};return(0,t.jsxs)("div",{className:"space-y-6",children:[(0,t.jsxs)(A,{title:r.editor.preview?.question||"Question Preview",children:[(0,t.jsx)(S.f,{content:e.questionText}),(0,t.jsx)(T.f,{svg:e.figureSvg})]}),s,(0,t.jsx)(A,{title:r.editor.preview?.answer||"Answer Preview",children:(0,t.jsx)(S.f,{content:e.answerText})}),(0,t.jsx)(A,{title:r.editor.preview?.analysis||"Analysis Preview",children:(0,t.jsx)(S.f,{content:e.analysis})}),(0,t.jsxs)(A,{title:r.editor.preview?.mistakeAnalysis||"Mistake Analysis Preview",className:"space-y-3 text-sm",children:[(0,t.jsxs)("div",{className:"text-muted-foreground",children:[r.editor.mistakeStatus||"Attempt Status",r.common.colon,a[e.mistakeStatus]??a.unknown]}),e.wrongAnswerText&&(0,t.jsxs)("div",{children:[(0,t.jsx)("div",{className:"font-medium mb-1",children:r.editor.wrongAnswerText||"Wrong Answer / Work"}),(0,t.jsx)(S.f,{content:e.wrongAnswerText})]}),e.mistakeAnalysis&&(0,t.jsxs)("div",{children:[(0,t.jsx)("div",{className:"font-medium mb-1",children:r.editor.mistakeAnalysis||"Mistake Cause Analysis"}),(0,t.jsx)(S.f,{content:e.mistakeAnalysis})]})]})]})}var I=e.i(574041),C=e.i(215519),_=e.i(306831);e.i(676167);var R=e.i(597138),V=e.i(991722),O=e.i(470279),z=e.i(303163);e.s(["f",0,function({initialData:e,onSave:n,onCancel:l,imagePreview:x,initialSubjectId:h,aiTimeout:g}){let{timeZone:p}=(0,C.M)(),{t:j,language:y}=(0,d.b)(),S=e=>e.trim()?e:"",[T,A]=(0,s.useState)({...e,answerText:S(e.answerText),analysis:S(e.analysis),wrongAnswerText:e.wrongAnswerText||"",mistakeAnalysis:e.mistakeAnalysis||"",mistakeStatus:e.mistakeStatus||"unknown",subjectId:h,gradeSemester:e.gradeSemester||""}),$=(0,s.useRef)(!1),M=e=>{"gradeSemester"in e&&($.current=!0),A(t=>({...t,...e}))},{groups:L}=(0,O.f)(),G=(()=>{if(T.paperLevel)return T.paperLevel;let e="number"==typeof T.difficultyStars&&T.difficultyStars>=4?"b":"a";return L.find(t=>t.key===e&&t.isActive)?.id||""})(),P=T.paperLevel??G,[q,U]=(0,s.useState)(!1),[F,H]=(0,s.useState)(!1),[D,Q]=(0,s.useState)(!1),[B,W]=(0,s.useState)(void 0),[Z,J]=(0,s.useState)([]);(0,s.useEffect)(()=>{c.k.get("/api/notebooks").then(J).catch(e=>m.V.error("[CorrectionEditor]","Failed to fetch notebooks",{error:e})),c.k.get("/api/user").then(e=>{if(Q(!!e?.enableGeogebra),e){let t=function(e,t=_.J){return"ai"===e.gradeRecognitionMode?null:e.fixedGradeSemester?e.fixedGradeSemester:e.educationStage&&e.enrollmentYear?function(e,t,s=new Date,r="en",a=_.J){let i=(0,_.c)(s,a),n=i.getFullYear(),l=i.getMonth()+1,o=n-t,d="2nd";l>=9?(o+=1,d="1st"):d=l<2?"1st":"2nd";let c="zh"===r,u=c?"1st"===d?"上期":"下期":"1st"===d?"1st Semester":"2nd Semester",m=(c?{primary:["一年级","二年级","三年级","四年级","五年级","六年级"],junior_high:["初一","初二","初三"],senior_high:["高一","高二","高三"],university:["大一","大二","大三","大四"]}:{primary:["Grade 1","Grade 2","Grade 3","Grade 4","Grade 5","Grade 6"],junior_high:["Junior High Grade 1","Junior High Grade 2","Junior High Grade 3"],senior_high:["Senior High Grade 1","Senior High Grade 2","Senior High Grade 3"],university:["Freshman","Sophomore","Junior","Senior"]})[e]||[],f=`${o}`;if(f=o>0&&o<=m.length?m[o-1]:o>m.length?c?"已毕业":"Graduated":c?"学前":"Pre-school",!c)return`${f}, ${u}`;{let e="1st"===d?"上":"下";return`${f}${e}`}}(e.educationStage,e.enrollmentYear,new Date,"zh",t):null}(e,p);A(e=>e.gradeSemester||$.current?e:{...e,gradeSemester:t||""}),W(e.educationStage||void 0)}}).catch(e=>m.V.error("[CorrectionEditor]","Failed to fetch user info for grade calculation",{error:e}))},[y,p]);let Y=async()=>{if(!T.questionText.trim())return void u.c.warning(j.editor.enterQuestionFirst||"Please enter question text first");U(!0);try{let e=function({questionText:e,language:t,subject:s,imagePreview:r,gradeSemester:a,subjectId:i}){let n={questionText:e,language:t,subject:s};return r&&(n.imageBase64=r),a&&(n.gradeSemester=a),i&&(n.subjectId=i),n}({questionText:T.questionText,language:y,subject:T.subject,imagePreview:x,gradeSemester:T.gradeSemester??void 0,subjectId:T.subjectId});m.V.info("[Reanswer]",e.imageBase64?"Sending image + text (image available for mistake analysis)":"Sending text only (no image available)",{timeout:g});let t=await c.k.post("/api/reanswer",e,{timeout:g||18e4,recoverable:!0});A(e=>({...e,answerText:t.answerText,analysis:t.analysis,knowledgePoints:t.knowledgePoints,wrongAnswerText:t.wrongAnswerText||"",mistakeAnalysis:t.mistakeAnalysis||"",mistakeStatus:(0,V.x)(t.mistakeStatus,t.wrongAnswerText),difficultyStars:t.difficultyStars??e.difficultyStars,questionType:t.questionType??e.questionType})),u.c.success(j.editor.reanswerSuccess||"✅ Answer and analysis updated!")}catch(r){let e,t,s;m.V.error("[CorrectionEditor]","Reanswer failed",{error:r}),u.c.error((e=(0,z.d)(r)||"",s=(t=j.errors?.reanswer||{}).default||"Reanswer failed",e.includes("AI_AUTH_ERROR")?t.authError||j.errors?.AI_AUTH_ERROR||s:e.includes("AI_CONNECTION_FAILED")?t.connectionFailed||j.errors?.AI_CONNECTION_FAILED||s:e.includes("AI_RESPONSE_ERROR")&&(t.responseError||j.errors?.AI_RESPONSE_ERROR)||s))}finally{U(!1)}},K=async()=>{if(!T.subjectId)return void u.c.warning(j.editor.messages?.selectNotebook||"Please select a notebook");if(!F){H(!0);try{await n({...T,paperLevel:P,mistakeStatus:(0,V.x)(T.mistakeStatus,T.wrongAnswerText)})}finally{H(!1)}}},X=j.editor.placeholder||"Supports Markdown and LaTeX...",ee=(0,R.f)(Z.find(e=>e.id===T.subjectId)?.name||null)||(0,R.f)(T.subject||null)||void 0;return(0,t.jsxs)("div",{className:"space-y-6",children:[(0,t.jsxs)("div",{className:"flex items-center justify-between",children:[(0,t.jsx)("h2",{className:"text-2xl font-bold",children:j.editor.title}),(0,t.jsxs)("div",{className:"flex gap-2",children:[(0,t.jsx)(o.f,{variant:"outline",onClick:l,children:j.editor.cancel}),(0,t.jsxs)(o.f,{onClick:K,disabled:F,children:[F?(0,t.jsx)(r.f,{className:"mr-2 h-4 w-4 animate-spin"}):(0,t.jsx)(i.f,{className:"mr-2 h-4 w-4"}),F?j.common?.pleaseWait||"Please wait...":j.editor.save]})]})]}),(0,t.jsxs)("div",{className:"grid gap-6 lg:grid-cols-2",children:[(0,t.jsxs)("div",{className:"space-y-6",children:[x&&(0,t.jsx)(N.N,{children:(0,t.jsx)(N.O,{className:"p-4",children:(0,t.jsx)("img",{src:x,alt:"Original",className:"w-full rounded-md"})})}),(0,t.jsx)(w,{data:T,paperLevel:P,onChange:M}),(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsx)(v.f,{children:j.editor.question}),(0,t.jsx)(b.f,{value:T.questionText,onChange:e=>M({questionText:e}),className:"min-h-[150px] font-mono text-sm",placeholder:X}),(0,t.jsx)(o.f,{variant:"default",size:"sm",onClick:Y,disabled:q||!T.questionText.trim(),className:"w-full bg-gradient-to-r from-indigo-600 to-violet-500 hover:from-indigo-700 hover:to-violet-600 text-white font-medium",children:q?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(r.f,{className:"mr-2 h-4 w-4 animate-spin"}),j.editor.reanswering||"AI solving..."]}):(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(a.f,{className:"mr-2 h-4 w-4"}),j.editor.reanswer||"🔄 Reanswer (based on corrected question)"]})}),(0,t.jsx)("p",{className:"text-xs text-muted-foreground",children:j.editor.reanswerHint||"💡 If the question was misrecognized, correct it and click to regenerate answer"})]}),(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsx)(v.f,{children:j.editor.tags}),(0,t.jsx)(I.f,{value:T.knowledgePoints,onChange:e=>M({knowledgePoints:e}),placeholder:j.editor.tagsPlaceholder||"Enter knowledge tags...",enterHint:j.editor.createTagHint,subject:ee,gradeStage:B}),(0,t.jsx)("p",{className:"text-xs text-muted-foreground",children:j.editor.tagsHint||"💡 Tag suggestions will appear as you type"})]}),(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsx)(v.f,{children:j.editor.answer}),(0,t.jsx)(b.f,{value:T.answerText,onChange:e=>M({answerText:e}),className:"min-h-[100px] font-mono text-sm",placeholder:X})]}),(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsx)(v.f,{children:j.editor.analysis}),(0,t.jsx)(b.f,{value:T.analysis,onChange:e=>M({analysis:e}),className:"min-h-[200px] font-mono text-sm",placeholder:X})]}),(0,t.jsx)(k,{data:T,onChange:M})]}),(0,t.jsx)(E,{data:T,children:D&&(0,t.jsx)(f,{data:T,onChange:M})})]})]})}],866531);var $=e.i(853138),M=e.i(263676);e.s(["f",0,function({message:e,onDismiss:s}){let{t:r}=(0,d.b)();return e?(0,t.jsxs)("div",{role:"alert",className:"flex items-start gap-3 rounded-xl border border-destructive/30 bg-destructive/5 p-4 text-sm text-destructive",children:[(0,t.jsx)($.f,{"aria-hidden":"true",className:"mt-0.5 h-4 w-4 shrink-0"}),(0,t.jsx)("p",{className:"min-w-0 flex-1 whitespace-pre-line break-words leading-relaxed",children:e}),(0,t.jsx)("button",{type:"button",onClick:s,"aria-label":r.common.close,className:"shrink-0 rounded p-1 hover:bg-destructive/10",children:(0,t.jsx)(M.X,{"aria-hidden":"true",className:"h-4 w-4"})})]}):null}],497346);var L=e.i(618566),G=e.i(707212);function P(e){return"object"!=typeof e||null===e||Array.isArray(e)?void 0:e}function q(e,t){if("string"!=typeof e||!/^(QUESTION_SAVE_|AI_)[A-Z_]+$/.test(e))return;let s=t.errors[e];return"string"==typeof s?s:void 0}e.s(["f",0,function(e){let{t}=(0,d.b)(),r=(0,L.useRouter)(),[a,i]=(0,s.useState)(null),n=async(s,a,n=!0)=>{i(null);try{let e=await s();return u.c.success(e.duplicate?t.importFlow.duplicate:t.common.messages.saveSuccess),n&&(e.duplicate?r.push(`/error-items/${e.id}`):a&&r.push(`/notebooks/${a}`)),!0}catch(r){m.V.error(e,"Save failed",{errorMessage:(0,z.d)(r)??(0,z.Z)(r)});let s=function(e,t){let s=P(e),r=P(s?.data),a="number"==typeof s?.status?s.status:void 0,i=(0,z.d)(e),n=q(i,t)??q(r?.code,t),l={400:t.errors.QUESTION_SAVE_INVALID_INPUT,401:t.errors.QUESTION_SAVE_UNAUTHORIZED,403:t.errors.QUESTION_SAVE_FORBIDDEN,408:t.errors.QUESTION_SAVE_TIMEOUT,409:t.errors.QUESTION_SAVE_CONFLICT,413:t.errors.QUESTION_SAVE_TOO_LARGE,429:t.errors.QUESTION_SAVE_RATE_LIMITED,502:t.errors.QUESTION_SAVE_SERVER_UNAVAILABLE,503:t.errors.QUESTION_SAVE_SERVER_UNAVAILABLE,504:t.errors.QUESTION_SAVE_TIMEOUT},o=n??(a?l[a]:void 0)??t.errors.QUESTION_SAVE_FAILED;!a&&(e instanceof TypeError||/fetch|network|load failed/i.test((0,z.Z)(e)))&&(o=t.errors.QUESTION_SAVE_NETWORK_ERROR);let d=P(r?.details);if("QUESTION_SAVE_GRADE_FAILED"===i){let e=q(d?.reason,t);e&&(o+=`
7
7
  ${e}`)}return 400===a&&(o+=(function(e,t){if(!Array.isArray(e))return[];let s={questionText:t.editor.question,answerText:t.editor.answer,analysis:t.editor.analysis,wrongAnswerText:t.editor.wrongAnswerText,mistakeAnalysis:t.editor.mistakeAnalysis,knowledgePoints:t.editor.tags,subjectId:t.editor.selectNotebook,gradeSemester:t.editor.gradeSemester,paperLevel:t.editor.paperLevel};return e.slice(0,3).flatMap(e=>{let r=P(e),a=r?.path,i=Array.isArray(a)&&"string"==typeof a[0]?s[a[0]]:void 0;if(!i)return[];let n=r?.maximum,l=t.questionSave.invalidField;return r?.code==="too_big"&&"number"==typeof n&&Number.isSafeInteger(n)&&n>=0&&(l="array"===r.origin?t.questionSave.tooMany:t.questionSave.tooLong),[l.replace("{field}",i).replace("{maximum}",String(n))]})})(r?.details,t).map(e=>`
8
8
  ${e}`).join("")),"string"==typeof d?.databaseCode&&/^P\d{4}$/.test(d.databaseCode)&&(o+=`
9
- ${t.questionSave.databaseCode.replace("{code}",d.databaseCode)}`),a&&(o+=` (HTTP ${a})`),o}(r,t);return i(s),(0,G.t)((0,z.d)(r))||u.c.error(s),!1}};return{saveError:a,setSaveError:i,dismissSaveError:()=>i(null),run:n}}],183444)},469937,e=>{var t=e.i(843476),s=e.i(786563),r=e.i(111110),a=e.i(975157);let i=[1,2,3,4,5];e.s(["f",0,function({value:e,onChange:n,disabled:l,size:o="sm",showUnrated:d=!0,className:c}){let{t:u}=(0,r.b)(),m=e??0,f="sm"===o?"h-3.5 w-3.5":"h-5 w-5",x=m?u.difficulty.starsLabel.replace("{n}",String(m)):u.difficulty.unrated;return n?(0,t.jsxs)("span",{className:(0,a.f)("inline-flex items-center gap-0.5",c),role:"group","aria-label":`${u.difficulty.label}${u.common.colon}${x}`,title:u.difficulty.clearHint,children:[i.map(e=>(0,t.jsx)("button",{type:"button",disabled:l,onClick:()=>n(e===m?null:e),"aria-label":u.difficulty.setStars.replace("{n}",String(e)),"aria-pressed":e<=m,className:"rounded p-0.5 hover:bg-muted disabled:opacity-50 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring",children:(0,t.jsx)(s.f,{className:(0,a.f)(f,e<=m?"fill-amber-400 text-amber-400":"text-muted-foreground/40")})},e)),!m&&d&&(0,t.jsx)("span",{className:"ml-1 text-xs text-muted-foreground",children:u.difficulty.unrated})]}):m?(0,t.jsx)("span",{className:(0,a.f)("inline-flex items-center",c),role:"img","aria-label":`${u.difficulty.label}${u.common.colon}${x}`,title:x,children:i.map(e=>(0,t.jsx)(s.f,{className:(0,a.f)(f,e<=m?"fill-amber-400 text-amber-400":"text-muted-foreground/30"),"aria-hidden":!0},e))}):d?(0,t.jsx)("span",{className:(0,a.f)("text-xs text-muted-foreground",c),children:u.difficulty.unrated}):null}])},731335,532377,339501,e=>{var t=e.i(843476),s=e.i(399847),r=e.i(551757),a=e.i(456420);let i={name:"clock-3",size:24,node:[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 6v6h4",key:"135r8i"}]]};i.node;let n=(0,a.f)(i);var l=e.i(632781),o=e.i(615568),d=e.i(487486),c=e.i(519455),u=e.i(168148),m=e.i(111110),f=e.i(215519),x=e.i(306831);let h=["read","convert","crop","compress","upload"],g=["receive","analyze","save"];function p(e){if(!Number.isFinite(e)||e<0)return"-";if(e<1e3)return`${Math.round(e)}ms`;let t=e/1e3;if(t<60)return`${t.toFixed(+(t<10))}s`;let s=Math.round(t);return`${Math.floor(s/60)}:${String(s%60).padStart(2,"0")}`}var v=e.i(975157);let j={analyzing:50,saving:90},y={analyzing:l.f,saving:l.f,review:o.f,saved:r.f,failed:s.f};e.s(["f",0,function({task:e,now:s,onReview:r,onViewItem:a,onRetry:i,onDiscard:l}){let{t:o}=(0,m.b)(),{timeZone:w}=(0,f.M)(),b=y[e.status],N="analyzing"===e.status||"saving"===e.status,k=o.errors,S=e.error?"string"==typeof k[e.error]?k[e.error]:e.error:null,T=function(e){let t=[];for(let s of h){let r=e?.client?.[s];"number"==typeof r&&t.push({stage:s,ms:r})}for(let s of g){let r=e?.server?.[s];"number"==typeof r&&t.push({stage:s,ms:r})}return t}(e.timings),A=N&&s?s-Date.parse(e.createdAt):null;return(0,t.jsxs)("div",{className:(0,v.f)("space-y-2 rounded-lg border p-3 text-sm",e.unread&&"border-primary/50 bg-primary/5"),"data-testid":"import-task-card","data-status":e.status,children:[(0,t.jsxs)("div",{className:"flex items-start gap-2",children:[(0,t.jsx)(b,{className:(0,v.f)("mt-0.5 h-4 w-4 shrink-0",N&&"animate-spin text-primary","saved"===e.status&&"text-green-600","failed"===e.status&&"text-destructive","review"===e.status&&"text-primary")}),(0,t.jsxs)("div",{className:"min-w-0 flex-1 space-y-1",children:[(0,t.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[(0,t.jsx)("span",{className:"font-medium",children:o.importTasks.status[e.status]}),(0,t.jsx)("span",{className:"text-xs text-muted-foreground",children:o.importTasks.mode[e.mode]}),e.unread&&(0,t.jsx)(d.f,{children:o.importTasks.unread})]}),N&&(0,t.jsx)(u.f,{value:j[e.status],"aria-label":o.importTasks.stageEstimate,"aria-valuetext":o.common.progress.estimated.replace("{percent}",String(j[e.status])),className:"h-1.5"}),e.excerpt&&(0,t.jsx)("p",{className:"break-words text-muted-foreground",children:e.excerpt}),"saved"===e.status&&!e.errorItemId&&(0,t.jsx)("p",{className:"text-xs text-muted-foreground",children:o.importTasks.itemDeleted}),"saved"===e.status&&e.errorItemId&&(0,t.jsx)("p",{className:"text-xs text-green-700 dark:text-green-300",children:e.duplicate?o.importTasks.duplicateSaved:o.importTasks.savedTo.replace("{notebook}",e.notebookName||"-").replace("{id}",e.errorItemShortId||"-")}),S&&(0,t.jsx)("p",{className:"text-xs text-destructive",children:S}),(0,t.jsxs)("div",{className:"flex flex-wrap items-center gap-x-3 gap-y-1 text-xs text-muted-foreground",children:[(0,t.jsxs)("span",{className:"flex items-center gap-1",children:[(0,t.jsx)(n,{className:"h-3 w-3"}),o.importTasks.createdAt.replace("{time}",(0,x.r)(e.createdAt,"MM-dd HH:mm",w))]}),null!==A&&(0,t.jsx)("span",{children:o.importTasks.elapsed.replace("{time}",p(A))}),e.attempts>1&&(0,t.jsx)("span",{children:o.importTasks.attempts.replace("{count}",String(e.attempts))})]}),T.length>0&&(0,t.jsx)("ul",{className:"flex flex-wrap gap-x-3 gap-y-1 text-xs text-muted-foreground tabular-nums","aria-label":"timings",children:T.map(({stage:e,ms:s})=>(0,t.jsxs)("li",{children:[o.importTasks.timings[e]," ",p(s)]},e))})]})]}),(0,t.jsxs)("div",{className:"flex flex-wrap justify-end gap-2",children:["review"===e.status&&r&&(0,t.jsx)(c.f,{size:"sm",onClick:r,children:o.importTasks.continueReview}),"saved"===e.status&&e.errorItemId&&a&&(0,t.jsx)(c.f,{size:"sm",variant:"outline",onClick:a,children:o.importTasks.viewItem}),"failed"===e.status&&i&&(0,t.jsx)(c.f,{size:"sm",onClick:i,children:o.importTasks.retry}),"saving"!==e.status&&"saved"!==e.status&&l&&(0,t.jsx)(c.f,{size:"sm",variant:"ghost",onClick:l,children:o.importTasks.discard})]})]})}],731335);var w=e.i(618566),b=e.i(767077),N=e.i(294114),k=e.i(201276),S=e.i(127175);e.s(["f",0,function(e){let{t}=(0,m.b)(),s=(0,w.useRouter)(),r=e=>{e.unread&&(0,S.N)(e.id).catch(e=>k.V.warn("[ImportTasks]","Mark read failed",{error:e}))};return{openReview:e=>{r(e),s.push(`/import-tasks/${e.id}`)},viewItem:e=>{e.errorItemId&&(r(e),s.push(`/error-items/${e.errorItemId}`))},markRead:r,retry:async s=>{try{await (0,S.R)(s.id),N.c.info(t.importTasks.retried)}catch(e){N.c.error((0,b.f)(e,t))}e?.()},discard:async s=>{if(!await (0,N.u)(t.importTasks.discardConfirm))return!1;let r=!1;try{await (0,S.x)(s.id),N.c.success(t.importTasks.discarded),r=!0}catch(e){N.c.error((0,b.f)(e,t))}return e?.(),r}}}],532377);var T=e.i(271645);e.s(["f",0,function(e,t=1e3){let[s,r]=(0,T.useState)(()=>Date.now());return(0,T.useEffect)(()=>{if(!e)return;let s=setInterval(()=>r(Date.now()),t);return()=>clearInterval(s)},[e,t]),s}],339501)},141176,e=>{var t=e.i(843476),s=e.i(271645),r=e.i(456420);let a={name:"code-xml",size:24,node:[["path",{d:"m18 16 4-4-4-4",key:"1inbqp"}],["path",{d:"m6 8-4 4 4 4",key:"15zrgr"}],["path",{d:"m14.5 4-5 16",key:"e7oirm"}]],aliases:["code-2"]};a.node;let i=(0,r.f)(a);var n=e.i(772382),l=e.i(511445),o=e.i(624687),d=e.i(111110),c=e.i(975157);e.s(["f",0,function({value:e,onChange:r,className:a,...u}){let{t:m}=(0,d.b)(),[f,x]=(0,s.useState)("source"),h=(0,s.useId)(),g=[{mode:"source",label:m.markdownEditor.source,icon:i},{mode:"preview",label:m.markdownEditor.preview,icon:n.f}];return(0,t.jsxs)("div",{className:"space-y-1.5",children:[(0,t.jsx)("div",{role:"tablist","aria-label":m.markdownEditor.modeLabel,className:"flex justify-end",children:(0,t.jsx)("div",{className:"inline-flex rounded-md border bg-muted/40 p-0.5",children:g.map(({mode:e,label:s,icon:r})=>(0,t.jsxs)("button",{type:"button",role:"tab","aria-selected":f===e,"aria-controls":h,onClick:()=>x(e),className:(0,c.f)("flex items-center gap-1 rounded px-2.5 py-1 text-xs transition-colors",f===e?"bg-background font-medium shadow-sm":"text-muted-foreground hover:text-foreground"),children:[(0,t.jsx)(r,{className:"h-3.5 w-3.5"}),s]},e))})}),(0,t.jsx)("div",{id:h,role:"tabpanel",children:"source"===f?(0,t.jsx)(o.f,{value:e,onChange:e=>r(e.target.value),className:a,...u}):(0,t.jsx)("div",{className:"min-h-24 cursor-text rounded-md border bg-muted/20 px-3 py-2",onDoubleClick:()=>x("source"),title:m.markdownEditor.doubleClickToEdit,children:e.trim()?(0,t.jsx)(l.f,{content:e}):(0,t.jsx)("p",{className:"text-sm italic text-muted-foreground",children:m.markdownEditor.empty})})})]})}],141176)},438465,674166,e=>{var t=e.i(843476),s=e.i(271645),r=e.i(967489),a=e.i(856423),i=e.i(41931),n=e.i(201276),l=e.i(111110);e.s(["f",0,function({value:e,onChange:o,className:d}){let[c,u]=(0,s.useState)([]),{t:m}=(0,l.b)();return(0,s.useEffect)(()=>{(async()=>{try{let e=await i.k.get("/api/notebooks");u(e)}catch(e){n.V.error("[NotebookSelector]","Failed to fetch notebooks",{error:e})}})()},[]),(0,t.jsxs)(r.d,{value:e,onValueChange:o,children:[(0,t.jsx)(r.P,{className:d,children:(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)(a.f,{className:"h-4 w-4 text-muted-foreground"}),(0,t.jsx)(r.U,{placeholder:m.notebooks?.selector?.placeholder||"Select Notebook"})]})}),(0,t.jsx)(r.r,{children:0===c.length?(0,t.jsx)("div",{className:"p-2 text-sm text-muted-foreground text-center",children:m.notebooks?.selector?.empty||"No notebooks available"}):c.map(e=>(0,t.jsx)(r.T,{value:e.id,children:e.name},e.id))})]})}],438465);var o=e.i(470279);e.s(["f",0,function({value:e,onChange:s,disabled:a}){let{groups:i,loading:n}=(0,o.f)(),l=i.filter(e=>e.isActive);return(0,t.jsxs)(r.d,{value:e,onValueChange:s,disabled:a||n,children:[(0,t.jsx)(r.P,{children:(0,t.jsx)(r.U,{placeholder:"选择卷别"})}),(0,t.jsx)(r.r,{children:l.map(e=>(0,t.jsx)(r.T,{value:e.id,children:e.name},e.id))})]})}],674166)},149704,e=>{var t=e.i(843476),s=e.i(111110),r=e.i(398019),a=e.i(184110),i=e.i(975157);let n={left:"mr-auto",center:"mx-auto",right:"ml-auto"};e.s(["f",0,function({svg:e,scale:l,align:o,className:d}){let{t:c}=(0,s.b)();if(!e)return null;let u=(0,a.V)(l),m=(0,a.o)(o);return(0,t.jsx)("figure",{className:(0,i.f)("question-figure my-3",d),children:(0,t.jsx)("img",{src:(0,r.d)(e),alt:c.figure.alt,className:(0,i.f)(n[m],"block h-auto max-w-full rounded border bg-white p-2"),style:{..."left"===m?{marginLeft:0,marginRight:"auto"}:"right"===m?{marginLeft:"auto",marginRight:0}:{},maxHeight:360,zoom:u/100,maxWidth:`${Math.min(u,100)}%`}})})}])},184110,e=>{let t=["left","center","right"],s="center";function r(e){return"number"==typeof e&&Number.isInteger(e)&&e>=10&&e<=200}e.s(["E",0,s,"n",0,100,"j",0,t,"a",0,200,"_",0,10,"x",0,r,"o",0,function(e){return"string"==typeof e&&t.includes(e)?e:s},"V",0,function(e){return r(e)?e:100}])},398019,e=>{e.s(["K",0,1e5,"d",0,function(e){return`data:image/svg+xml;charset=utf-8,${encodeURIComponent(e)}`}])},767077,e=>{var t=e.i(303163);e.s(["f",0,function(e,s){let r=s.common?.messages?.analysisFailed||"Analysis failed, please try again",a=(0,t.d)(e);if(a){let e=s.errors??{};if(!(a in e))return a;let t=e[a];return"string"==typeof t?t:r}let i=(0,t.Z)(e);if(i.includes("fetch")||i.includes("network"))return s.errors?.AI_CONNECTION_FAILED||"网络连接失败";if("object"==typeof e&&null!==e&&"data"in e&&"string"==typeof e.data){let t="status"in e&&"number"==typeof e.status?e.status:"Error";return`${r} (${t})`}return r}])},991722,e=>{function t(e){return"not_attempted"===e||"wrong_attempt"===e||"unknown"===e?e:"unknown"}e.s(["i",0,function(e,s="zh"){return("en"===s?{not_attempted:"Not attempted",wrong_attempt:"Wrong attempt",unknown:"Unknown"}:{not_attempted:"不会做",wrong_attempt:"做错了",unknown:"未判断"})[t(e)]},"h",0,t,"x",0,function(e,s){return(s||"").trim()?"wrong_attempt":t(e)}])},597138,e=>{e.i(306831),e.s(["f",0,function(e){if(!e)return null;let t=e.toLowerCase();return t.includes("math")||t.includes("数学")?"math":t.includes("physics")||t.includes("物理")?"physics":t.includes("chemistry")||t.includes("化学")?"chemistry":t.includes("biology")||t.includes("生物")?"biology":t.includes("english")||t.includes("英语")?"english":t.includes("chinese")||t.includes("语文")?"chinese":t.includes("history")||t.includes("历史")?"history":t.includes("geography")||t.includes("地理")?"geography":t.includes("politics")||t.includes("政治")?"politics":null}])}])})();
9
+ ${t.questionSave.databaseCode.replace("{code}",d.databaseCode)}`),a&&(o+=` (HTTP ${a})`),o}(r,t);return i(s),(0,G.t)((0,z.d)(r))||u.c.error(s),!1}};return{saveError:a,setSaveError:i,dismissSaveError:()=>i(null),run:n}}],183444)},469937,e=>{var t=e.i(843476),s=e.i(786563),r=e.i(111110),a=e.i(975157);let i=[1,2,3,4,5];e.s(["f",0,function({value:e,onChange:n,disabled:l,size:o="sm",showUnrated:d=!0,className:c}){let{t:u}=(0,r.b)(),m=e??0,f="sm"===o?"h-3.5 w-3.5":"h-5 w-5",x=m?u.difficulty.starsLabel.replace("{n}",String(m)):u.difficulty.unrated;return n?(0,t.jsxs)("span",{className:(0,a.f)("inline-flex items-center gap-0.5",c),role:"group","aria-label":`${u.difficulty.label}${u.common.colon}${x}`,title:u.difficulty.clearHint,children:[i.map(e=>(0,t.jsx)("button",{type:"button",disabled:l,onClick:()=>n(e===m?null:e),"aria-label":u.difficulty.setStars.replace("{n}",String(e)),"aria-pressed":e<=m,className:"rounded p-0.5 hover:bg-muted disabled:opacity-50 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring",children:(0,t.jsx)(s.f,{className:(0,a.f)(f,e<=m?"fill-amber-400 text-amber-400":"text-muted-foreground/40")})},e)),!m&&d&&(0,t.jsx)("span",{className:"ml-1 text-xs text-muted-foreground",children:u.difficulty.unrated})]}):m?(0,t.jsx)("span",{className:(0,a.f)("inline-flex items-center",c),role:"img","aria-label":`${u.difficulty.label}${u.common.colon}${x}`,title:x,children:i.map(e=>(0,t.jsx)(s.f,{className:(0,a.f)(f,e<=m?"fill-amber-400 text-amber-400":"text-muted-foreground/30"),"aria-hidden":!0},e))}):d?(0,t.jsx)("span",{className:(0,a.f)("text-xs text-muted-foreground",c),children:u.difficulty.unrated}):null}])},731335,532377,339501,e=>{var t=e.i(843476),s=e.i(399847),r=e.i(551757),a=e.i(456420);let i={name:"clock-3",size:24,node:[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 6v6h4",key:"135r8i"}]]};i.node;let n=(0,a.f)(i);var l=e.i(632781),o=e.i(615568),d=e.i(487486),c=e.i(519455),u=e.i(168148),m=e.i(111110),f=e.i(215519),x=e.i(306831);let h=["read","convert","crop","compress","upload"],g=["receive","analyze","save"];function p(e){if(!Number.isFinite(e)||e<0)return"-";if(e<1e3)return`${Math.round(e)}ms`;let t=e/1e3;if(t<60)return`${t.toFixed(+(t<10))}s`;let s=Math.round(t);return`${Math.floor(s/60)}:${String(s%60).padStart(2,"0")}`}var v=e.i(975157);let j={analyzing:50,saving:90},y={analyzing:l.f,saving:l.f,review:o.f,saved:r.f,failed:s.f};e.s(["f",0,function({task:e,now:s,onReview:r,onViewItem:a,onRetry:i,onDiscard:l}){let{t:o}=(0,m.b)(),{timeZone:w}=(0,f.M)(),b=y[e.status],N="analyzing"===e.status||"saving"===e.status,k=o.errors,S=e.error?"string"==typeof k[e.error]?k[e.error]:e.error:null,T=function(e){let t=[];for(let s of h){let r=e?.client?.[s];"number"==typeof r&&t.push({stage:s,ms:r})}for(let s of g){let r=e?.server?.[s];"number"==typeof r&&t.push({stage:s,ms:r})}return t}(e.timings),A=N&&s?s-Date.parse(e.createdAt):null;return(0,t.jsxs)("div",{className:(0,v.f)("space-y-2 rounded-lg border p-3 text-sm",e.unread&&"border-primary/50 bg-primary/5"),"data-testid":"import-task-card","data-status":e.status,children:[(0,t.jsxs)("div",{className:"flex items-start gap-2",children:[(0,t.jsx)(b,{className:(0,v.f)("mt-0.5 h-4 w-4 shrink-0",N&&"animate-spin text-primary","saved"===e.status&&"text-green-600","failed"===e.status&&"text-destructive","review"===e.status&&"text-primary")}),(0,t.jsxs)("div",{className:"min-w-0 flex-1 space-y-1",children:[(0,t.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[(0,t.jsx)("span",{className:"font-medium",children:o.importTasks.status[e.status]}),(0,t.jsx)("span",{className:"text-xs text-muted-foreground",children:o.importTasks.mode[e.mode]}),e.unread&&(0,t.jsx)(d.f,{children:o.importTasks.unread})]}),N&&(0,t.jsx)(u.f,{value:j[e.status],"aria-label":o.importTasks.stageEstimate,"aria-valuetext":o.common.progress.estimated.replace("{percent}",String(j[e.status])),className:"h-1.5"}),e.excerpt&&(0,t.jsx)("p",{className:"break-words text-muted-foreground",children:e.excerpt}),"saved"===e.status&&!e.errorItemId&&(0,t.jsx)("p",{className:"text-xs text-muted-foreground",children:o.importTasks.itemDeleted}),"saved"===e.status&&e.errorItemId&&(0,t.jsx)("p",{className:"text-xs text-green-700 dark:text-green-300",children:e.duplicate?o.importTasks.duplicateSaved:o.importTasks.savedTo.replace("{notebook}",e.notebookName||"-").replace("{id}",e.errorItemShortId||"-")}),S&&(0,t.jsx)("p",{className:"text-xs text-destructive",children:S}),(0,t.jsxs)("div",{className:"flex flex-wrap items-center gap-x-3 gap-y-1 text-xs text-muted-foreground",children:[(0,t.jsxs)("span",{className:"flex items-center gap-1",children:[(0,t.jsx)(n,{className:"h-3 w-3"}),o.importTasks.createdAt.replace("{time}",(0,x.r)(e.createdAt,"MM-dd HH:mm",w))]}),null!==A&&(0,t.jsx)("span",{children:o.importTasks.elapsed.replace("{time}",p(A))}),e.attempts>1&&(0,t.jsx)("span",{children:o.importTasks.attempts.replace("{count}",String(e.attempts))})]}),T.length>0&&(0,t.jsx)("ul",{className:"flex flex-wrap gap-x-3 gap-y-1 text-xs text-muted-foreground tabular-nums","aria-label":"timings",children:T.map(({stage:e,ms:s})=>(0,t.jsxs)("li",{children:[o.importTasks.timings[e]," ",p(s)]},e))})]})]}),(0,t.jsxs)("div",{className:"flex flex-wrap justify-end gap-2",children:["review"===e.status&&r&&(0,t.jsx)(c.f,{size:"sm",onClick:r,children:o.importTasks.continueReview}),"saved"===e.status&&e.errorItemId&&a&&(0,t.jsx)(c.f,{size:"sm",variant:"outline",onClick:a,children:o.importTasks.viewItem}),"failed"===e.status&&i&&(0,t.jsx)(c.f,{size:"sm",onClick:i,children:o.importTasks.retry}),"saving"!==e.status&&"saved"!==e.status&&l&&(0,t.jsx)(c.f,{size:"sm",variant:"ghost",onClick:l,children:o.importTasks.discard})]})]})}],731335);var w=e.i(618566),b=e.i(767077),N=e.i(294114),k=e.i(201276),S=e.i(127175);e.s(["f",0,function(e){let{t}=(0,m.b)(),s=(0,w.useRouter)(),r=e=>{e.unread&&(0,S.N)(e.id).catch(e=>k.V.warn("[ImportTasks]","Mark read failed",{error:e}))};return{openReview:e=>{r(e),s.push(`/import-tasks/${e.id}`)},viewItem:e=>{e.errorItemId&&(r(e),s.push(`/error-items/${e.errorItemId}`))},markRead:r,retry:async s=>{try{await (0,S.R)(s.id),N.c.info(t.importTasks.retried)}catch(e){N.c.error((0,b.f)(e,t))}e?.()},discard:async s=>{if(!await (0,N.u)(t.importTasks.discardConfirm))return!1;let r=!1;try{await (0,S.x)(s.id),N.c.success(t.importTasks.discarded),r=!0}catch(e){N.c.error((0,b.f)(e,t))}return e?.(),r}}}],532377);var T=e.i(271645);e.s(["f",0,function(e,t=1e3){let[s,r]=(0,T.useState)(()=>Date.now());return(0,T.useEffect)(()=>{if(!e)return;let s=setInterval(()=>r(Date.now()),t);return()=>clearInterval(s)},[e,t]),s}],339501)},141176,e=>{var t=e.i(843476),s=e.i(271645),r=e.i(456420);let a={name:"code-xml",size:24,node:[["path",{d:"m18 16 4-4-4-4",key:"1inbqp"}],["path",{d:"m6 8-4 4 4 4",key:"15zrgr"}],["path",{d:"m14.5 4-5 16",key:"e7oirm"}]],aliases:["code-2"]};a.node;let i=(0,r.f)(a);var n=e.i(772382),l=e.i(511445),o=e.i(624687),d=e.i(111110),c=e.i(975157);e.s(["f",0,function({value:e,onChange:r,className:a,...u}){let{t:m}=(0,d.b)(),[f,x]=(0,s.useState)("source"),h=(0,s.useId)(),g=[{mode:"source",label:m.markdownEditor.source,icon:i},{mode:"preview",label:m.markdownEditor.preview,icon:n.f}];return(0,t.jsxs)("div",{className:"space-y-1.5",children:[(0,t.jsx)("div",{role:"tablist","aria-label":m.markdownEditor.modeLabel,className:"flex justify-end",children:(0,t.jsx)("div",{className:"inline-flex rounded-md border bg-muted/40 p-0.5",children:g.map(({mode:e,label:s,icon:r})=>(0,t.jsxs)("button",{type:"button",role:"tab","aria-selected":f===e,"aria-controls":h,onClick:()=>x(e),className:(0,c.f)("flex items-center gap-1 rounded px-2.5 py-1 text-xs transition-colors",f===e?"bg-background font-medium shadow-sm":"text-muted-foreground hover:text-foreground"),children:[(0,t.jsx)(r,{className:"h-3.5 w-3.5"}),s]},e))})}),(0,t.jsx)("div",{id:h,role:"tabpanel",children:"source"===f?(0,t.jsx)(o.f,{value:e,onChange:e=>r(e.target.value),className:a,...u}):(0,t.jsx)("div",{className:"min-h-24 cursor-text rounded-md border bg-muted/20 px-3 py-2",onDoubleClick:()=>x("source"),title:m.markdownEditor.doubleClickToEdit,children:e.trim()?(0,t.jsx)(l.f,{content:e}):(0,t.jsx)("p",{className:"text-sm italic text-muted-foreground",children:m.markdownEditor.empty})})})]})}],141176)},438465,e=>{var t=e.i(843476),s=e.i(271645),r=e.i(967489),a=e.i(856423),i=e.i(41931),n=e.i(201276),l=e.i(111110);e.s(["f",0,function({value:e,onChange:o,className:d}){let[c,u]=(0,s.useState)([]),{t:m}=(0,l.b)();return(0,s.useEffect)(()=>{(async()=>{try{let e=await i.k.get("/api/notebooks");u(e)}catch(e){n.V.error("[NotebookSelector]","Failed to fetch notebooks",{error:e})}})()},[]),(0,t.jsxs)(r.d,{value:e,onValueChange:o,children:[(0,t.jsx)(r.P,{className:d,children:(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)(a.f,{className:"h-4 w-4 text-muted-foreground"}),(0,t.jsx)(r.U,{placeholder:m.notebooks?.selector?.placeholder||"Select Notebook"})]})}),(0,t.jsx)(r.r,{children:0===c.length?(0,t.jsx)("div",{className:"p-2 text-sm text-muted-foreground text-center",children:m.notebooks?.selector?.empty||"No notebooks available"}):c.map(e=>(0,t.jsx)(r.T,{value:e.id,children:e.name},e.id))})]})}])},674166,e=>{var t=e.i(843476),s=e.i(967489),r=e.i(470279);e.s(["f",0,function({value:e,onChange:a,disabled:i}){let{groups:n,loading:l}=(0,r.f)(),o=n.filter(e=>e.isActive);return(0,t.jsxs)(s.d,{value:e,onValueChange:a,disabled:i||l,children:[(0,t.jsx)(s.P,{children:(0,t.jsx)(s.U,{placeholder:"选择卷别"})}),(0,t.jsx)(s.r,{children:o.map(e=>(0,t.jsx)(s.T,{value:e.id,children:e.name},e.id))})]})}])},149704,e=>{var t=e.i(843476),s=e.i(111110),r=e.i(398019),a=e.i(184110),i=e.i(975157);let n={left:"mr-auto",center:"mx-auto",right:"ml-auto"};e.s(["f",0,function({svg:e,scale:l,align:o,className:d}){let{t:c}=(0,s.b)();if(!e)return null;let u=(0,a.V)(l),m=(0,a.o)(o);return(0,t.jsx)("figure",{className:(0,i.f)("question-figure my-3",d),children:(0,t.jsx)("img",{src:(0,r.d)(e),alt:c.figure.alt,className:(0,i.f)(n[m],"block h-auto max-w-full rounded border bg-white p-2"),style:{..."left"===m?{marginLeft:0,marginRight:"auto"}:"right"===m?{marginLeft:"auto",marginRight:0}:{},maxHeight:360,zoom:u/100,maxWidth:`${Math.min(u,100)}%`}})})}])},184110,e=>{let t=["left","center","right"],s="center";function r(e){return"number"==typeof e&&Number.isInteger(e)&&e>=10&&e<=200}e.s(["E",0,s,"n",0,100,"j",0,t,"a",0,200,"_",0,10,"x",0,r,"o",0,function(e){return"string"==typeof e&&t.includes(e)?e:s},"V",0,function(e){return r(e)?e:100}])},398019,e=>{e.s(["K",0,1e5,"d",0,function(e){return`data:image/svg+xml;charset=utf-8,${encodeURIComponent(e)}`}])},767077,e=>{var t=e.i(303163);e.s(["f",0,function(e,s){let r=s.common?.messages?.analysisFailed||"Analysis failed, please try again",a=(0,t.d)(e);if(a){let e=s.errors??{};if(!(a in e))return a;let t=e[a];return"string"==typeof t?t:r}let i=(0,t.Z)(e);if(i.includes("fetch")||i.includes("network"))return s.errors?.AI_CONNECTION_FAILED||"网络连接失败";if("object"==typeof e&&null!==e&&"data"in e&&"string"==typeof e.data){let t="status"in e&&"number"==typeof e.status?e.status:"Error";return`${r} (${t})`}return r}])},991722,e=>{function t(e){return"not_attempted"===e||"wrong_attempt"===e||"unknown"===e?e:"unknown"}e.s(["i",0,function(e,s="zh"){return("en"===s?{not_attempted:"Not attempted",wrong_attempt:"Wrong attempt",unknown:"Unknown"}:{not_attempted:"不会做",wrong_attempt:"做错了",unknown:"未判断"})[t(e)]},"h",0,t,"x",0,function(e,s){return(s||"").trim()?"wrong_attempt":t(e)}])},597138,e=>{e.i(306831),e.s(["f",0,function(e){if(!e)return null;let t=e.toLowerCase();return t.includes("math")||t.includes("数学")?"math":t.includes("physics")||t.includes("物理")?"physics":t.includes("chemistry")||t.includes("化学")?"chemistry":t.includes("biology")||t.includes("生物")?"biology":t.includes("english")||t.includes("英语")?"english":t.includes("chinese")||t.includes("语文")?"chinese":t.includes("history")||t.includes("历史")?"history":t.includes("geography")||t.includes("地理")?"geography":t.includes("politics")||t.includes("政治")?"politics":null}])}])})();
@@ -1,2 +1,2 @@
1
- (globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,[711241,t=>{var e=t.i(456420);let r={name:"arrow-left",size:24,node:[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]]};r.node;let n=(0,e.f)(r);t.s(["f",0,n],711241)},474544,t=>{var e=t.i(456420);let r={name:"clock",size:24,node:[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 6v6l4 2",key:"mmk7yg"}]]};r.node;let n=(0,e.f)(r);t.s(["f",0,n],474544)},444594,t=>{var e=t.i(456420);let r={name:"inbox",size:24,node:[["polyline",{points:"22 12 16 12 14 15 10 15 8 12 2 12",key:"o97t9d"}],["path",{d:"M5.45 5.11 2 12v6a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2v-6l-3.45-6.89A2 2 0 0 0 16.76 4H7.24a2 2 0 0 0-1.79 1.11z",key:"oot6mr"}]]};r.node;let n=(0,e.f)(r);t.s(["f",0,n],444594)},218964,t=>{var e=t.i(456420);let r={name:"list-checks",size:24,node:[["path",{d:"M13 5h8",key:"a7qcls"}],["path",{d:"M13 12h8",key:"h98zly"}],["path",{d:"M13 19h8",key:"c3s6r1"}],["path",{d:"m3 17 2 2 4-4",key:"1jhpwq"}],["path",{d:"m3 7 2 2 4-4",key:"1obspn"}]]};r.node;let n=(0,e.f)(r);t.s(["f",0,n],218964)},77043,t=>{var e=t.i(456420);let r={name:"printer",size:24,node:[["path",{d:"M6 18H4a2 2 0 0 1-2-2v-5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2v5a2 2 0 0 1-2 2h-2",key:"143wyd"}],["path",{d:"M6 9V3a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v6",key:"1itne7"}],["rect",{x:"6",y:"14",width:"12",height:"8",rx:"1",key:"1ue0tg"}]]};r.node;let n=(0,e.f)(r);t.s(["f",0,n],77043)},566595,t=>{var e=t.i(456420);let r={name:"search",size:24,node:[["path",{d:"m21 21-4.34-4.34",key:"14j7rj"}],["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}]]};r.node;let n=(0,e.f)(r);t.s(["f",0,n],566595)},786563,t=>{var e=t.i(456420);let r={name:"star",size:24,node:[["path",{d:"M11.525 2.295a.53.53 0 0 1 .95 0l2.31 4.679a2.123 2.123 0 0 0 1.595 1.16l5.166.756a.53.53 0 0 1 .294.904l-3.736 3.638a2.123 2.123 0 0 0-.611 1.878l.882 5.14a.53.53 0 0 1-.771.56l-4.618-2.428a2.122 2.122 0 0 0-1.973 0L6.396 21.01a.53.53 0 0 1-.77-.56l.881-5.139a2.122 2.122 0 0 0-.611-1.879L2.16 9.795a.53.53 0 0 1 .294-.906l5.165-.755a2.122 2.122 0 0 0 1.597-1.16z",key:"r04s7s"}]]};r.node;let n=(0,e.f)(r);t.s(["f",0,n],786563)},469937,t=>{var e=t.i(843476),r=t.i(786563),n=t.i(111110),i=t.i(975157);let o=[1,2,3,4,5];t.s(["f",0,function({value:t,onChange:s,disabled:f,size:a="sm",showUnrated:u=!0,className:l}){let{t:h}=(0,n.b)(),c=t??0,p="sm"===a?"h-3.5 w-3.5":"h-5 w-5",g=c?h.difficulty.starsLabel.replace("{n}",String(c)):h.difficulty.unrated;return s?(0,e.jsxs)("span",{className:(0,i.f)("inline-flex items-center gap-0.5",l),role:"group","aria-label":`${h.difficulty.label}${h.common.colon}${g}`,title:h.difficulty.clearHint,children:[o.map(t=>(0,e.jsx)("button",{type:"button",disabled:f,onClick:()=>s(t===c?null:t),"aria-label":h.difficulty.setStars.replace("{n}",String(t)),"aria-pressed":t<=c,className:"rounded p-0.5 hover:bg-muted disabled:opacity-50 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring",children:(0,e.jsx)(r.f,{className:(0,i.f)(p,t<=c?"fill-amber-400 text-amber-400":"text-muted-foreground/40")})},t)),!c&&u&&(0,e.jsx)("span",{className:"ml-1 text-xs text-muted-foreground",children:h.difficulty.unrated})]}):c?(0,e.jsx)("span",{className:(0,i.f)("inline-flex items-center",l),role:"img","aria-label":`${h.difficulty.label}${h.common.colon}${g}`,title:g,children:o.map(t=>(0,e.jsx)(r.f,{className:(0,i.f)(p,t<=c?"fill-amber-400 text-amber-400":"text-muted-foreground/30"),"aria-hidden":!0},t))}):u?(0,e.jsx)("span",{className:(0,i.f)("text-xs text-muted-foreground",l),children:h.difficulty.unrated}):null}])},846968,t=>{var e=t.i(843476),r=t.i(548161),n=t.i(474544),i=t.i(741120),o=t.i(487486),s=t.i(111110);let f={new:{className:"bg-warning/15 text-amber-700 dark:text-warning",icon:n.f},reviewing:{className:"bg-primary/10 text-primary",icon:i.f},mastered:{className:"bg-success/15 text-success",icon:r.f}};t.s(["o",0,{new:"border-l-warning/70",reviewing:"border-l-primary/60",mastered:"border-l-success/70"},"x",0,function({status:t,className:r=""}){let{t:n}=(0,s.b)(),{className:i,icon:a}=f[t],u="mastered"===t?n.notebook.mastered:"reviewing"===t?n.notebook.reviewing:n.notebook.review;return(0,e.jsx)(o.f,{variant:"secondary",className:`${i} ${r}`,children:(0,e.jsxs)("span",{className:"flex items-center gap-1",children:[(0,e.jsx)(a,{className:"h-3 w-3"})," ",u]})})}])},709830,76824,t=>{var e=t.i(843476),r=t.i(111110),n=t.i(597138);let i=["primary","junior_high","senior_high","university"],o="primary",s=["math","english","chinese","physics","chemistry","biology","history","geography","politics"];function f(t){return"string"==typeof t&&s.includes(t)}function a(t){var e;let r=f(t.subjectKey)?t.subjectKey:(0,n.f)(t.name);return{stage:"string"==typeof(e=t.stage)&&i.includes(e)?t.stage:o,subject:r&&f(r)?r:null}}function u(){let{t}=(0,r.b)();return{stageLabel:e=>({primary:t.auth.primary,junior_high:t.auth.juniorHigh,senior_high:t.auth.seniorHigh,university:t.auth.university})[e],subjectLabel:e=>t.tags.subjects[e]}}t.s(["j",0,o,"c",0,i,"W",0,{primary:["math","english","chinese"],junior_high:s,senior_high:s,university:s},"v",0,a],76824),t.s(["E",0,function({notebook:t,className:r}){let{stageLabel:n,subjectLabel:i}=u(),o=a(t);return(0,e.jsxs)("span",{className:r,children:[n(o.stage),o.subject?` \xb7 ${i(o.subject)}`:""]})},"O",0,u],709830)},590546,t=>{var e=t.i(843476),r=t.i(618566),n=t.i(519455),i=t.i(711241);t.s(["f",0,function({fallbackUrl:t,className:o}){let s=(0,r.useRouter)();return(0,e.jsx)(n.f,{variant:"ghost",size:"icon",onClick:()=>{s.push(t)},className:o,children:(0,e.jsx)(i.f,{className:"h-5 w-5"})})}])},912505,t=>{var e=t.i(843476),r=t.i(975157);t.s(["f",0,function({icon:t,title:n,description:i,action:o,className:s}){return(0,e.jsxs)("div",{className:(0,r.f)("flex flex-col items-center justify-center rounded-2xl border border-dashed bg-card/50 px-6 py-14 text-center",s),children:[(0,e.jsx)("div",{className:"mb-4 flex h-14 w-14 items-center justify-center rounded-2xl bg-accent text-accent-foreground",children:(0,e.jsx)(t,{className:"h-7 w-7"})}),(0,e.jsx)("p",{className:"font-medium",children:n}),i&&(0,e.jsx)("p",{className:"mt-1 max-w-sm text-sm text-muted-foreground",children:i}),o&&(0,e.jsx)("div",{className:"mt-5",children:o})]})}])},393842,t=>{var e=t.i(843476),r=t.i(590546),n=t.i(975157);t.s(["f",0,function({title:t,description:i,backHref:o,actions:s,titleAddon:f,className:a}){return(0,e.jsxs)("div",{className:(0,n.f)("flex items-start gap-3",a),children:[o&&(0,e.jsx)(r.f,{fallbackUrl:o,className:"-ml-2 shrink-0"}),(0,e.jsxs)("div",{className:"min-w-0 flex-1 space-y-1",children:[(0,e.jsxs)("div",{className:"flex items-center gap-1",children:[(0,e.jsx)("h1",{className:"truncate text-2xl font-bold tracking-tight sm:text-3xl",children:t}),f]}),i&&(0,e.jsx)("p",{className:"text-sm text-muted-foreground sm:text-base",children:i})]}),s&&(0,e.jsx)("div",{className:"flex shrink-0 items-center gap-2",children:s})]})}])},86963,t=>{var e=t.i(843476),r=t.i(632781);t.s(["f",0,function({label:t}){return(0,e.jsxs)("div",{className:"flex min-h-[50vh] flex-col items-center justify-center gap-3 text-muted-foreground",children:[(0,e.jsx)(r.f,{className:"h-7 w-7 animate-spin text-primary"}),t&&(0,e.jsx)("p",{className:"text-sm",children:t})]})}])},185592,t=>{var e=t.i(843476),r=t.i(975157);t.s(["f",0,function({options:t,value:n,onChange:i,className:o}){return(0,e.jsx)("div",{className:(0,r.f)("grid gap-1 rounded-xl bg-muted p-1",o),style:{gridTemplateColumns:`repeat(${t.length}, minmax(0, 1fr))`},role:"tablist",children:t.map(({value:t,label:o,icon:s})=>{let f=t===n;return(0,e.jsxs)("button",{type:"button",role:"tab","aria-selected":f,className:(0,r.f)("flex items-center justify-center gap-1.5 rounded-lg px-2 py-2.5 text-sm font-medium transition-all",f?"bg-card text-primary shadow-sm":"text-muted-foreground hover:text-foreground"),onClick:()=>i(t),children:[s&&(0,e.jsx)(s,{className:"h-4 w-4 shrink-0"}),(0,e.jsx)("span",{className:"truncate",children:o})]},t)})})}])},469817,t=>{t.s(["$",0,18,"u",0,5,"A",0,200])},407198,t=>{let e=["题干","选项A","选项B","选项C","选项D","答案","解析","知识点","难度","题型","学科","年级学期","来源","大题","题号"],r=[["下列哪个选项是正确的?","选项一","选项二","选项三","选项四","A","这是解析内容。","知识点一、知识点二","3","单选题","数学","七年级上学期","2025 期中","第一大题","1"],["1+1=____。","","","","","2","基础加法运算。","基础运算","易","填空题","数学","一年级上学期","课堂练习","第一大题","2"]];async function n(){let{default:n}=await t.A(810068),i=[e,...r];return await n(i).toBlob()}t.s(["I",0,e,"j",0,function(){let t=t=>/[",\n\r]/.test(t)?`"${t.replace(/"/g,'""')}"`:t,n=[];for(let i of(n.push(e.map(t).join(",")),r))n.push(i.map(t).join(","));return`\uFEFF${n.join("\r\n")}\r
2
- `},"n",0,n])},35209,t=>{var e=t.i(271645),r=t.i(111110);t.s(["f",0,function(...t){let{t:n}=(0,r.b)(),i=[n.pageTitle.base,...t.map(t=>"string"==typeof t?t.trim():"").filter(t=>t.length>0)].join("-");(0,e.useEffect)(()=>{document.title=i},[i])}])},991722,t=>{function e(t){return"not_attempted"===t||"wrong_attempt"===t||"unknown"===t?t:"unknown"}t.s(["i",0,function(t,r="zh"){return("en"===r?{not_attempted:"Not attempted",wrong_attempt:"Wrong attempt",unknown:"Unknown"}:{not_attempted:"不会做",wrong_attempt:"做错了",unknown:"未判断"})[e(t)]},"h",0,e,"x",0,function(t,r){return(r||"").trim()?"wrong_attempt":e(t)}])},401280,t=>{let e={single_choice:"single_choice",singlechoice:"single_choice","single choice":"single_choice","single-choice":"single_choice",multiple_choice:"multiple_choice",multiplechoice:"multiple_choice","multiple choice":"multiple_choice","multiple-choice":"multiple_choice",multichoice:"multiple_choice","multi choice":"multiple_choice",true_false:"true_false",truefalse:"true_false","true/false":"true_false","true false":"true_false","true-false":"true_false","true / false":"true_false",fill_blank:"fill_blank",fillblank:"fill_blank","fill in the blank":"fill_blank","fill-in-the-blank":"fill_blank",fillintheblank:"fill_blank",calculation:"calculation",solution:"solution",reading:"reading",cloze:"cloze",writing:"writing",other:"other",选择题:"single_choice",单项选择:"single_choice",单选:"single_choice",单选题:"single_choice",不定项:"multiple_choice",不定项选择:"multiple_choice",多项选择:"multiple_choice",多选:"multiple_choice",多选题:"multiple_choice",判断:"true_false",判断题:"true_false",是非:"true_false",是非题:"true_false",填空:"fill_blank",填空题:"fill_blank",口算:"calculation",计算:"calculation",计算题:"calculation",解答:"solution",解答题:"solution",应用:"solution",应用题:"solution",证明:"solution",证明题:"solution",简答:"solution",简答题:"solution",阅读:"reading",阅读理解:"reading",完形:"cloze",完形填空:"cloze",作文:"writing",写作:"writing",书面表达:"writing",其他:"other"};t.s(["O",0,"__none__","V",0,["single_choice","multiple_choice","true_false","fill_blank","calculation","solution","reading","cloze","writing","other"],"u",0,{single_choice:"Single Choice",multiple_choice:"Multiple Choice",true_false:"True / False",fill_blank:"Fill in the Blank",calculation:"Calculation",solution:"Solution",reading:"Reading Comprehension",cloze:"Cloze",writing:"Writing",other:"Other"},"H",0,{single_choice:"单选题",multiple_choice:"多选题",true_false:"判断题",fill_blank:"填空题",calculation:"计算题",solution:"解答题",reading:"阅读理解",cloze:"完形填空",writing:"写作",other:"其他"},"P",0,function(t){if("string"!=typeof t)return null;let r=t.trim().toLowerCase();return r?e[r]??null:null}])},380935,164549,t=>{var e=t.i(41931);async function r(t){try{return(await e.k.get(`/api/error-items/short/${encodeURIComponent(t)}`)).id}catch{return null}}t.s(["f",0,r],380935);let n=RegExp("^[123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz]{6}$");t.s(["f",0,function(t){return"string"==typeof t&&n.test(t)}],164549)},428602,t=>{t.s(["f",0,function(t){if(t.tags&&t.tags.length>0)return t.tags.map(t=>t.name);if(!t.knowledgePoints)return[];try{let e=JSON.parse(t.knowledgePoints);return Array.isArray(e)?e.filter(t=>"string"==typeof t):[]}catch{return[]}}])},597138,t=>{t.i(306831),t.s(["f",0,function(t){if(!t)return null;let e=t.toLowerCase();return e.includes("math")||e.includes("数学")?"math":e.includes("physics")||e.includes("物理")?"physics":e.includes("chemistry")||e.includes("化学")?"chemistry":e.includes("biology")||e.includes("生物")?"biology":e.includes("english")||e.includes("英语")?"english":e.includes("chinese")||e.includes("语文")?"chinese":e.includes("history")||e.includes("历史")?"history":e.includes("geography")||e.includes("地理")?"geography":e.includes("politics")||e.includes("政治")?"politics":null}])}],467034,(t,e,r)=>{var n={872:function(t,e){"use strict";e.byteLength=function(t){var e=a(t),r=e[0],n=e[1];return(r+n)*3/4-n},e.toByteArray=function(t){var e,r,o=a(t),s=o[0],f=o[1],u=new i((s+f)*3/4-f),l=0,h=f>0?s-4:s;for(r=0;r<h;r+=4)e=n[t.charCodeAt(r)]<<18|n[t.charCodeAt(r+1)]<<12|n[t.charCodeAt(r+2)]<<6|n[t.charCodeAt(r+3)],u[l++]=e>>16&255,u[l++]=e>>8&255,u[l++]=255&e;return 2===f&&(e=n[t.charCodeAt(r)]<<2|n[t.charCodeAt(r+1)]>>4,u[l++]=255&e),1===f&&(e=n[t.charCodeAt(r)]<<10|n[t.charCodeAt(r+1)]<<4|n[t.charCodeAt(r+2)]>>2,u[l++]=e>>8&255,u[l++]=255&e),u},e.fromByteArray=function(t){for(var e,n=t.length,i=n%3,o=[],s=0,f=n-i;s<f;s+=16383)o.push(function(t,e,n){for(var i,o=[],s=e;s<n;s+=3)i=(t[s]<<16&0xff0000)+(t[s+1]<<8&65280)+(255&t[s+2]),o.push(r[i>>18&63]+r[i>>12&63]+r[i>>6&63]+r[63&i]);return o.join("")}(t,s,s+16383>f?f:s+16383));return 1===i?o.push(r[(e=t[n-1])>>2]+r[e<<4&63]+"=="):2===i&&o.push(r[(e=(t[n-2]<<8)+t[n-1])>>10]+r[e>>4&63]+r[e<<2&63]+"="),o.join("")};for(var r=[],n=[],i="u">typeof Uint8Array?Uint8Array:Array,o="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",s=0,f=o.length;s<f;++s)r[s]=o[s],n[o.charCodeAt(s)]=s;function a(t){var e=t.length;if(e%4>0)throw Error("Invalid string. Length must be a multiple of 4");var r=t.indexOf("=");-1===r&&(r=e);var n=r===e?0:4-r%4;return[r,n]}n[45]=62,n[95]=63},230:function(t,e,r){"use strict";var n=r(872),i=r(321),o="function"==typeof Symbol&&"function"==typeof Symbol.for?Symbol.for("nodejs.util.inspect.custom"):null;function s(t){if(t>0x7fffffff)throw RangeError('The value "'+t+'" is invalid for option "size"');var e=new Uint8Array(t);return Object.setPrototypeOf(e,f.prototype),e}function f(t,e,r){if("number"==typeof t){if("string"==typeof e)throw TypeError('The "string" argument must be of type string. Received type number');return l(t)}return a(t,e,r)}function a(t,e,r){if("string"==typeof t){var n=t,i=e;if(("string"!=typeof i||""===i)&&(i="utf8"),!f.isEncoding(i))throw TypeError("Unknown encoding: "+i);var o=0|p(n,i),a=s(o),u=a.write(n,i);return u!==o&&(a=a.slice(0,u)),a}if(ArrayBuffer.isView(t))return h(t);if(null==t)throw TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof t);if(N(t,ArrayBuffer)||t&&N(t.buffer,ArrayBuffer)||"u">typeof SharedArrayBuffer&&(N(t,SharedArrayBuffer)||t&&N(t.buffer,SharedArrayBuffer)))return function(t,e,r){var n;if(e<0||t.byteLength<e)throw RangeError('"offset" is outside of buffer bounds');if(t.byteLength<e+(r||0))throw RangeError('"length" is outside of buffer bounds');return Object.setPrototypeOf(n=void 0===e&&void 0===r?new Uint8Array(t):void 0===r?new Uint8Array(t,e):new Uint8Array(t,e,r),f.prototype),n}(t,e,r);if("number"==typeof t)throw TypeError('The "value" argument must not be of type number. Received type number');var l=t.valueOf&&t.valueOf();if(null!=l&&l!==t)return f.from(l,e,r);var g=function(t){if(f.isBuffer(t)){var e=0|c(t.length),r=s(e);return 0===r.length||t.copy(r,0,0,e),r}return void 0!==t.length?"number"!=typeof t.length||function(t){return t!=t}(t.length)?s(0):h(t):"Buffer"===t.type&&Array.isArray(t.data)?h(t.data):void 0}(t);if(g)return g;if("u">typeof Symbol&&null!=Symbol.toPrimitive&&"function"==typeof t[Symbol.toPrimitive])return f.from(t[Symbol.toPrimitive]("string"),e,r);throw TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof t)}function u(t){if("number"!=typeof t)throw TypeError('"size" argument must be of type number');if(t<0)throw RangeError('The value "'+t+'" is invalid for option "size"')}function l(t){return u(t),s(t<0?0:0|c(t))}function h(t){for(var e=t.length<0?0:0|c(t.length),r=s(e),n=0;n<e;n+=1)r[n]=255&t[n];return r}e.Buffer=f,e.SlowBuffer=function(t){return+t!=t&&(t=0),f.alloc(+t)},e.INSPECT_MAX_BYTES=50,e.kMaxLength=0x7fffffff,f.TYPED_ARRAY_SUPPORT=function(){try{var t=new Uint8Array(1),e={foo:function(){return 42}};return Object.setPrototypeOf(e,Uint8Array.prototype),Object.setPrototypeOf(t,e),42===t.foo()}catch(t){return!1}}(),!f.TYPED_ARRAY_SUPPORT&&"u">typeof console&&"function"==typeof console.error&&console.error("This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support."),Object.defineProperty(f.prototype,"parent",{enumerable:!0,get:function(){if(f.isBuffer(this))return this.buffer}}),Object.defineProperty(f.prototype,"offset",{enumerable:!0,get:function(){if(f.isBuffer(this))return this.byteOffset}}),f.poolSize=8192,f.from=function(t,e,r){return a(t,e,r)},Object.setPrototypeOf(f.prototype,Uint8Array.prototype),Object.setPrototypeOf(f,Uint8Array),f.alloc=function(t,e,r){return(u(t),t<=0)?s(t):void 0!==e?"string"==typeof r?s(t).fill(e,r):s(t).fill(e):s(t)},f.allocUnsafe=function(t){return l(t)},f.allocUnsafeSlow=function(t){return l(t)};function c(t){if(t>=0x7fffffff)throw RangeError("Attempt to allocate Buffer larger than maximum size: 0x7fffffff bytes");return 0|t}function p(t,e){if(f.isBuffer(t))return t.length;if(ArrayBuffer.isView(t)||N(t,ArrayBuffer))return t.byteLength;if("string"!=typeof t)throw TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof t);var r=t.length,n=arguments.length>2&&!0===arguments[2];if(!n&&0===r)return 0;for(var i=!1;;)switch(e){case"ascii":case"latin1":case"binary":return r;case"utf8":case"utf-8":return B(t).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*r;case"hex":return r>>>1;case"base64":return j(t).length;default:if(i)return n?-1:B(t).length;e=(""+e).toLowerCase(),i=!0}}function g(t,e,r){var i,o,s,f=!1;if((void 0===e||e<0)&&(e=0),e>this.length||((void 0===r||r>this.length)&&(r=this.length),r<=0||(r>>>=0)<=(e>>>=0)))return"";for(t||(t="utf8");;)switch(t){case"hex":return function(t,e,r){var n=t.length;(!e||e<0)&&(e=0),(!r||r<0||r>n)&&(r=n);for(var i="",o=e;o<r;++o)i+=T[t[o]];return i}(this,e,r);case"utf8":case"utf-8":return b(this,e,r);case"ascii":return function(t,e,r){var n="";r=Math.min(t.length,r);for(var i=e;i<r;++i)n+=String.fromCharCode(127&t[i]);return n}(this,e,r);case"latin1":case"binary":return function(t,e,r){var n="";r=Math.min(t.length,r);for(var i=e;i<r;++i)n+=String.fromCharCode(t[i]);return n}(this,e,r);case"base64":return i=this,o=e,s=r,0===o&&s===i.length?n.fromByteArray(i):n.fromByteArray(i.slice(o,s));case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return function(t,e,r){for(var n=t.slice(e,r),i="",o=0;o<n.length;o+=2)i+=String.fromCharCode(n[o]+256*n[o+1]);return i}(this,e,r);default:if(f)throw TypeError("Unknown encoding: "+t);t=(t+"").toLowerCase(),f=!0}}function y(t,e,r){var n=t[e];t[e]=t[r],t[r]=n}function d(t,e,r,n,i){var o;if(0===t.length)return -1;if("string"==typeof r?(n=r,r=0):r>0x7fffffff?r=0x7fffffff:r<-0x80000000&&(r=-0x80000000),(o=r*=1)!=o&&(r=i?0:t.length-1),r<0&&(r=t.length+r),r>=t.length)if(i)return -1;else r=t.length-1;else if(r<0)if(!i)return -1;else r=0;if("string"==typeof e&&(e=f.from(e,n)),f.isBuffer(e))return 0===e.length?-1:m(t,e,r,n,i);if("number"==typeof e){if(e&=255,"function"==typeof Uint8Array.prototype.indexOf)if(i)return Uint8Array.prototype.indexOf.call(t,e,r);else return Uint8Array.prototype.lastIndexOf.call(t,e,r);return m(t,[e],r,n,i)}throw TypeError("val must be string, number or Buffer")}function m(t,e,r,n,i){var o,s=1,f=t.length,a=e.length;if(void 0!==n&&("ucs2"===(n=String(n).toLowerCase())||"ucs-2"===n||"utf16le"===n||"utf-16le"===n)){if(t.length<2||e.length<2)return -1;s=2,f/=2,a/=2,r/=2}function u(t,e){return 1===s?t[e]:t.readUInt16BE(e*s)}if(i){var l=-1;for(o=r;o<f;o++)if(u(t,o)===u(e,-1===l?0:o-l)){if(-1===l&&(l=o),o-l+1===a)return l*s}else -1!==l&&(o-=o-l),l=-1}else for(r+a>f&&(r=f-a),o=r;o>=0;o--){for(var h=!0,c=0;c<a;c++)if(u(t,o+c)!==u(e,c)){h=!1;break}if(h)return o}return -1}f.isBuffer=function(t){return null!=t&&!0===t._isBuffer&&t!==f.prototype},f.compare=function(t,e){if(N(t,Uint8Array)&&(t=f.from(t,t.offset,t.byteLength)),N(e,Uint8Array)&&(e=f.from(e,e.offset,e.byteLength)),!f.isBuffer(t)||!f.isBuffer(e))throw TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(t===e)return 0;for(var r=t.length,n=e.length,i=0,o=Math.min(r,n);i<o;++i)if(t[i]!==e[i]){r=t[i],n=e[i];break}return r<n?-1:+(n<r)},f.isEncoding=function(t){switch(String(t).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},f.concat=function(t,e){if(!Array.isArray(t))throw TypeError('"list" argument must be an Array of Buffers');if(0===t.length)return f.alloc(0);if(void 0===e)for(r=0,e=0;r<t.length;++r)e+=t[r].length;var r,n=f.allocUnsafe(e),i=0;for(r=0;r<t.length;++r){var o=t[r];if(N(o,Uint8Array)&&(o=f.from(o)),!f.isBuffer(o))throw TypeError('"list" argument must be an Array of Buffers');o.copy(n,i),i+=o.length}return n},f.byteLength=p,f.prototype._isBuffer=!0,f.prototype.swap16=function(){var t=this.length;if(t%2!=0)throw RangeError("Buffer size must be a multiple of 16-bits");for(var e=0;e<t;e+=2)y(this,e,e+1);return this},f.prototype.swap32=function(){var t=this.length;if(t%4!=0)throw RangeError("Buffer size must be a multiple of 32-bits");for(var e=0;e<t;e+=4)y(this,e,e+3),y(this,e+1,e+2);return this},f.prototype.swap64=function(){var t=this.length;if(t%8!=0)throw RangeError("Buffer size must be a multiple of 64-bits");for(var e=0;e<t;e+=8)y(this,e,e+7),y(this,e+1,e+6),y(this,e+2,e+5),y(this,e+3,e+4);return this},f.prototype.toString=function(){var t=this.length;return 0===t?"":0==arguments.length?b(this,0,t):g.apply(this,arguments)},f.prototype.toLocaleString=f.prototype.toString,f.prototype.equals=function(t){if(!f.isBuffer(t))throw TypeError("Argument must be a Buffer");return this===t||0===f.compare(this,t)},f.prototype.inspect=function(){var t="",r=e.INSPECT_MAX_BYTES;return t=this.toString("hex",0,r).replace(/(.{2})/g,"$1 ").trim(),this.length>r&&(t+=" ... "),"<Buffer "+t+">"},o&&(f.prototype[o]=f.prototype.inspect),f.prototype.compare=function(t,e,r,n,i){if(N(t,Uint8Array)&&(t=f.from(t,t.offset,t.byteLength)),!f.isBuffer(t))throw TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof t);if(void 0===e&&(e=0),void 0===r&&(r=t?t.length:0),void 0===n&&(n=0),void 0===i&&(i=this.length),e<0||r>t.length||n<0||i>this.length)throw RangeError("out of range index");if(n>=i&&e>=r)return 0;if(n>=i)return -1;if(e>=r)return 1;if(e>>>=0,r>>>=0,n>>>=0,i>>>=0,this===t)return 0;for(var o=i-n,s=r-e,a=Math.min(o,s),u=this.slice(n,i),l=t.slice(e,r),h=0;h<a;++h)if(u[h]!==l[h]){o=u[h],s=l[h];break}return o<s?-1:+(s<o)},f.prototype.includes=function(t,e,r){return -1!==this.indexOf(t,e,r)},f.prototype.indexOf=function(t,e,r){return d(this,t,e,r,!0)},f.prototype.lastIndexOf=function(t,e,r){return d(this,t,e,r,!1)};function b(t,e,r){r=Math.min(t.length,r);for(var n=[],i=e;i<r;){var o,s,f,a,u=t[i],l=null,h=u>239?4:u>223?3:u>191?2:1;if(i+h<=r)switch(h){case 1:u<128&&(l=u);break;case 2:(192&(o=t[i+1]))==128&&(a=(31&u)<<6|63&o)>127&&(l=a);break;case 3:o=t[i+1],s=t[i+2],(192&o)==128&&(192&s)==128&&(a=(15&u)<<12|(63&o)<<6|63&s)>2047&&(a<55296||a>57343)&&(l=a);break;case 4:o=t[i+1],s=t[i+2],f=t[i+3],(192&o)==128&&(192&s)==128&&(192&f)==128&&(a=(15&u)<<18|(63&o)<<12|(63&s)<<6|63&f)>65535&&a<1114112&&(l=a)}null===l?(l=65533,h=1):l>65535&&(l-=65536,n.push(l>>>10&1023|55296),l=56320|1023&l),n.push(l),i+=h}var c=n,p=c.length;if(p<=4096)return String.fromCharCode.apply(String,c);for(var g="",y=0;y<p;)g+=String.fromCharCode.apply(String,c.slice(y,y+=4096));return g}function v(t,e,r){if(t%1!=0||t<0)throw RangeError("offset is not uint");if(t+e>r)throw RangeError("Trying to access beyond buffer length")}function w(t,e,r,n,i,o){if(!f.isBuffer(t))throw TypeError('"buffer" argument must be a Buffer instance');if(e>i||e<o)throw RangeError('"value" argument is out of bounds');if(r+n>t.length)throw RangeError("Index out of range")}function x(t,e,r,n,i,o){if(r+n>t.length||r<0)throw RangeError("Index out of range")}function E(t,e,r,n,o){return e*=1,r>>>=0,o||x(t,e,r,4,34028234663852886e22,-34028234663852886e22),i.write(t,e,r,n,23,4),r+4}function A(t,e,r,n,o){return e*=1,r>>>=0,o||x(t,e,r,8,17976931348623157e292,-17976931348623157e292),i.write(t,e,r,n,52,8),r+8}f.prototype.write=function(t,e,r,n){if(void 0===e)n="utf8",r=this.length,e=0;else if(void 0===r&&"string"==typeof e)n=e,r=this.length,e=0;else if(isFinite(e))e>>>=0,isFinite(r)?(r>>>=0,void 0===n&&(n="utf8")):(n=r,r=void 0);else throw Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");var i,o,s,f,a,u,l,h,c=this.length-e;if((void 0===r||r>c)&&(r=c),t.length>0&&(r<0||e<0)||e>this.length)throw RangeError("Attempt to write outside buffer bounds");n||(n="utf8");for(var p=!1;;)switch(n){case"hex":return function(t,e,r,n){r=Number(r)||0;var i=t.length-r;n?(n=Number(n))>i&&(n=i):n=i;var o=e.length;n>o/2&&(n=o/2);for(var s=0;s<n;++s){var f,a=parseInt(e.substr(2*s,2),16);if((f=a)!=f)break;t[r+s]=a}return s}(this,t,e,r);case"utf8":case"utf-8":return i=e,o=r,U(B(t,this.length-i),this,i,o);case"ascii":return s=e,f=r,U(k(t),this,s,f);case"latin1":case"binary":return function(t,e,r,n){return U(k(e),t,r,n)}(this,t,e,r);case"base64":return a=e,u=r,U(j(t),this,a,u);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return l=e,h=r,U(function(t,e){for(var r,n,i=[],o=0;o<t.length&&!((e-=2)<0);++o)n=(r=t.charCodeAt(o))>>8,i.push(r%256),i.push(n);return i}(t,this.length-l),this,l,h);default:if(p)throw TypeError("Unknown encoding: "+n);n=(""+n).toLowerCase(),p=!0}},f.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}},f.prototype.slice=function(t,e){var r=this.length;t=~~t,e=void 0===e?r:~~e,t<0?(t+=r)<0&&(t=0):t>r&&(t=r),e<0?(e+=r)<0&&(e=0):e>r&&(e=r),e<t&&(e=t);var n=this.subarray(t,e);return Object.setPrototypeOf(n,f.prototype),n},f.prototype.readUIntLE=function(t,e,r){t>>>=0,e>>>=0,r||v(t,e,this.length);for(var n=this[t],i=1,o=0;++o<e&&(i*=256);)n+=this[t+o]*i;return n},f.prototype.readUIntBE=function(t,e,r){t>>>=0,e>>>=0,r||v(t,e,this.length);for(var n=this[t+--e],i=1;e>0&&(i*=256);)n+=this[t+--e]*i;return n},f.prototype.readUInt8=function(t,e){return t>>>=0,e||v(t,1,this.length),this[t]},f.prototype.readUInt16LE=function(t,e){return t>>>=0,e||v(t,2,this.length),this[t]|this[t+1]<<8},f.prototype.readUInt16BE=function(t,e){return t>>>=0,e||v(t,2,this.length),this[t]<<8|this[t+1]},f.prototype.readUInt32LE=function(t,e){return t>>>=0,e||v(t,4,this.length),(this[t]|this[t+1]<<8|this[t+2]<<16)+0x1000000*this[t+3]},f.prototype.readUInt32BE=function(t,e){return t>>>=0,e||v(t,4,this.length),0x1000000*this[t]+(this[t+1]<<16|this[t+2]<<8|this[t+3])},f.prototype.readIntLE=function(t,e,r){t>>>=0,e>>>=0,r||v(t,e,this.length);for(var n=this[t],i=1,o=0;++o<e&&(i*=256);)n+=this[t+o]*i;return n>=(i*=128)&&(n-=Math.pow(2,8*e)),n},f.prototype.readIntBE=function(t,e,r){t>>>=0,e>>>=0,r||v(t,e,this.length);for(var n=e,i=1,o=this[t+--n];n>0&&(i*=256);)o+=this[t+--n]*i;return o>=(i*=128)&&(o-=Math.pow(2,8*e)),o},f.prototype.readInt8=function(t,e){return(t>>>=0,e||v(t,1,this.length),128&this[t])?-((255-this[t]+1)*1):this[t]},f.prototype.readInt16LE=function(t,e){t>>>=0,e||v(t,2,this.length);var r=this[t]|this[t+1]<<8;return 32768&r?0xffff0000|r:r},f.prototype.readInt16BE=function(t,e){t>>>=0,e||v(t,2,this.length);var r=this[t+1]|this[t]<<8;return 32768&r?0xffff0000|r:r},f.prototype.readInt32LE=function(t,e){return t>>>=0,e||v(t,4,this.length),this[t]|this[t+1]<<8|this[t+2]<<16|this[t+3]<<24},f.prototype.readInt32BE=function(t,e){return t>>>=0,e||v(t,4,this.length),this[t]<<24|this[t+1]<<16|this[t+2]<<8|this[t+3]},f.prototype.readFloatLE=function(t,e){return t>>>=0,e||v(t,4,this.length),i.read(this,t,!0,23,4)},f.prototype.readFloatBE=function(t,e){return t>>>=0,e||v(t,4,this.length),i.read(this,t,!1,23,4)},f.prototype.readDoubleLE=function(t,e){return t>>>=0,e||v(t,8,this.length),i.read(this,t,!0,52,8)},f.prototype.readDoubleBE=function(t,e){return t>>>=0,e||v(t,8,this.length),i.read(this,t,!1,52,8)},f.prototype.writeUIntLE=function(t,e,r,n){if(t*=1,e>>>=0,r>>>=0,!n){var i=Math.pow(2,8*r)-1;w(this,t,e,r,i,0)}var o=1,s=0;for(this[e]=255&t;++s<r&&(o*=256);)this[e+s]=t/o&255;return e+r},f.prototype.writeUIntBE=function(t,e,r,n){if(t*=1,e>>>=0,r>>>=0,!n){var i=Math.pow(2,8*r)-1;w(this,t,e,r,i,0)}var o=r-1,s=1;for(this[e+o]=255&t;--o>=0&&(s*=256);)this[e+o]=t/s&255;return e+r},f.prototype.writeUInt8=function(t,e,r){return t*=1,e>>>=0,r||w(this,t,e,1,255,0),this[e]=255&t,e+1},f.prototype.writeUInt16LE=function(t,e,r){return t*=1,e>>>=0,r||w(this,t,e,2,65535,0),this[e]=255&t,this[e+1]=t>>>8,e+2},f.prototype.writeUInt16BE=function(t,e,r){return t*=1,e>>>=0,r||w(this,t,e,2,65535,0),this[e]=t>>>8,this[e+1]=255&t,e+2},f.prototype.writeUInt32LE=function(t,e,r){return t*=1,e>>>=0,r||w(this,t,e,4,0xffffffff,0),this[e+3]=t>>>24,this[e+2]=t>>>16,this[e+1]=t>>>8,this[e]=255&t,e+4},f.prototype.writeUInt32BE=function(t,e,r){return t*=1,e>>>=0,r||w(this,t,e,4,0xffffffff,0),this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t,e+4},f.prototype.writeIntLE=function(t,e,r,n){if(t*=1,e>>>=0,!n){var i=Math.pow(2,8*r-1);w(this,t,e,r,i-1,-i)}var o=0,s=1,f=0;for(this[e]=255&t;++o<r&&(s*=256);)t<0&&0===f&&0!==this[e+o-1]&&(f=1),this[e+o]=(t/s|0)-f&255;return e+r},f.prototype.writeIntBE=function(t,e,r,n){if(t*=1,e>>>=0,!n){var i=Math.pow(2,8*r-1);w(this,t,e,r,i-1,-i)}var o=r-1,s=1,f=0;for(this[e+o]=255&t;--o>=0&&(s*=256);)t<0&&0===f&&0!==this[e+o+1]&&(f=1),this[e+o]=(t/s|0)-f&255;return e+r},f.prototype.writeInt8=function(t,e,r){return t*=1,e>>>=0,r||w(this,t,e,1,127,-128),t<0&&(t=255+t+1),this[e]=255&t,e+1},f.prototype.writeInt16LE=function(t,e,r){return t*=1,e>>>=0,r||w(this,t,e,2,32767,-32768),this[e]=255&t,this[e+1]=t>>>8,e+2},f.prototype.writeInt16BE=function(t,e,r){return t*=1,e>>>=0,r||w(this,t,e,2,32767,-32768),this[e]=t>>>8,this[e+1]=255&t,e+2},f.prototype.writeInt32LE=function(t,e,r){return t*=1,e>>>=0,r||w(this,t,e,4,0x7fffffff,-0x80000000),this[e]=255&t,this[e+1]=t>>>8,this[e+2]=t>>>16,this[e+3]=t>>>24,e+4},f.prototype.writeInt32BE=function(t,e,r){return t*=1,e>>>=0,r||w(this,t,e,4,0x7fffffff,-0x80000000),t<0&&(t=0xffffffff+t+1),this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t,e+4},f.prototype.writeFloatLE=function(t,e,r){return E(this,t,e,!0,r)},f.prototype.writeFloatBE=function(t,e,r){return E(this,t,e,!1,r)},f.prototype.writeDoubleLE=function(t,e,r){return A(this,t,e,!0,r)},f.prototype.writeDoubleBE=function(t,e,r){return A(this,t,e,!1,r)},f.prototype.copy=function(t,e,r,n){if(!f.isBuffer(t))throw TypeError("argument should be a Buffer");if(r||(r=0),n||0===n||(n=this.length),e>=t.length&&(e=t.length),e||(e=0),n>0&&n<r&&(n=r),n===r||0===t.length||0===this.length)return 0;if(e<0)throw RangeError("targetStart out of bounds");if(r<0||r>=this.length)throw RangeError("Index out of range");if(n<0)throw RangeError("sourceEnd out of bounds");n>this.length&&(n=this.length),t.length-e<n-r&&(n=t.length-e+r);var i=n-r;if(this===t&&"function"==typeof Uint8Array.prototype.copyWithin)this.copyWithin(e,r,n);else if(this===t&&r<e&&e<n)for(var o=i-1;o>=0;--o)t[o+e]=this[o+r];else Uint8Array.prototype.set.call(t,this.subarray(r,n),e);return i},f.prototype.fill=function(t,e,r,n){if("string"==typeof t){if("string"==typeof e?(n=e,e=0,r=this.length):"string"==typeof r&&(n=r,r=this.length),void 0!==n&&"string"!=typeof n)throw TypeError("encoding must be a string");if("string"==typeof n&&!f.isEncoding(n))throw TypeError("Unknown encoding: "+n);if(1===t.length){var i,o=t.charCodeAt(0);("utf8"===n&&o<128||"latin1"===n)&&(t=o)}}else"number"==typeof t?t&=255:"boolean"==typeof t&&(t=Number(t));if(e<0||this.length<e||this.length<r)throw RangeError("Out of range index");if(r<=e)return this;if(e>>>=0,r=void 0===r?this.length:r>>>0,t||(t=0),"number"==typeof t)for(i=e;i<r;++i)this[i]=t;else{var s=f.isBuffer(t)?t:f.from(t,n),a=s.length;if(0===a)throw TypeError('The value "'+t+'" is invalid for argument "value"');for(i=0;i<r-e;++i)this[i+e]=s[i%a]}return this};var _=/[^+/0-9A-Za-z-_]/g;function B(t,e){e=e||1/0;for(var r,n=t.length,i=null,o=[],s=0;s<n;++s){if((r=t.charCodeAt(s))>55295&&r<57344){if(!i){if(r>56319||s+1===n){(e-=3)>-1&&o.push(239,191,189);continue}i=r;continue}if(r<56320){(e-=3)>-1&&o.push(239,191,189),i=r;continue}r=(i-55296<<10|r-56320)+65536}else i&&(e-=3)>-1&&o.push(239,191,189);if(i=null,r<128){if((e-=1)<0)break;o.push(r)}else if(r<2048){if((e-=2)<0)break;o.push(r>>6|192,63&r|128)}else if(r<65536){if((e-=3)<0)break;o.push(r>>12|224,r>>6&63|128,63&r|128)}else if(r<1114112){if((e-=4)<0)break;o.push(r>>18|240,r>>12&63|128,r>>6&63|128,63&r|128)}else throw Error("Invalid code point")}return o}function k(t){for(var e=[],r=0;r<t.length;++r)e.push(255&t.charCodeAt(r));return e}function j(t){return n.toByteArray(function(t){if((t=(t=t.split("=")[0]).trim().replace(_,"")).length<2)return"";for(;t.length%4!=0;)t+="=";return t}(t))}function U(t,e,r,n){for(var i=0;i<n&&!(i+r>=e.length)&&!(i>=t.length);++i)e[i+r]=t[i];return i}function N(t,e){return t instanceof e||null!=t&&null!=t.constructor&&null!=t.constructor.name&&t.constructor.name===e.name}var T=function(){for(var t="0123456789abcdef",e=Array(256),r=0;r<16;++r)for(var n=16*r,i=0;i<16;++i)e[n+i]=t[r]+t[i];return e}()},321:function(t,e){e.read=function(t,e,r,n,i){var o,s,f=8*i-n-1,a=(1<<f)-1,u=a>>1,l=-7,h=r?i-1:0,c=r?-1:1,p=t[e+h];for(h+=c,o=p&(1<<-l)-1,p>>=-l,l+=f;l>0;o=256*o+t[e+h],h+=c,l-=8);for(s=o&(1<<-l)-1,o>>=-l,l+=n;l>0;s=256*s+t[e+h],h+=c,l-=8);if(0===o)o=1-u;else{if(o===a)return s?0/0:(p?-1:1)*2e308;s+=Math.pow(2,n),o-=u}return(p?-1:1)*s*Math.pow(2,o-n)},e.write=function(t,e,r,n,i,o){var s,f,a,u=8*o-i-1,l=(1<<u)-1,h=l>>1,c=5960464477539062e-23*(23===i),p=n?0:o-1,g=n?1:-1,y=+(e<0||0===e&&1/e<0);for(isNaN(e=Math.abs(e))||1/0===e?(f=+!!isNaN(e),s=l):(s=Math.floor(Math.log(e)/Math.LN2),e*(a=Math.pow(2,-s))<1&&(s--,a*=2),s+h>=1?e+=c/a:e+=c*Math.pow(2,1-h),e*a>=2&&(s++,a/=2),s+h>=l?(f=0,s=l):s+h>=1?(f=(e*a-1)*Math.pow(2,i),s+=h):(f=e*Math.pow(2,h-1)*Math.pow(2,i),s=0));i>=8;t[r+p]=255&f,p+=g,f/=256,i-=8);for(s=s<<i|f,u+=i;u>0;t[r+p]=255&s,p+=g,s/=256,u-=8);t[r+p-g]|=128*y}}},i={};function o(t){var e=i[t];if(void 0!==e)return e.exports;var r=i[t]={exports:{}},s=!0;try{n[t](r,r.exports,o),s=!1}finally{s&&delete i[t]}return r.exports}o.ab="/ROOT/node_modules/next/dist/compiled/buffer/",e.exports=o(230)}]);
1
+ (globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,[711241,t=>{var e=t.i(456420);let r={name:"arrow-left",size:24,node:[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]]};r.node;let n=(0,e.f)(r);t.s(["f",0,n],711241)},474544,t=>{var e=t.i(456420);let r={name:"clock",size:24,node:[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 6v6l4 2",key:"mmk7yg"}]]};r.node;let n=(0,e.f)(r);t.s(["f",0,n],474544)},444594,t=>{var e=t.i(456420);let r={name:"inbox",size:24,node:[["polyline",{points:"22 12 16 12 14 15 10 15 8 12 2 12",key:"o97t9d"}],["path",{d:"M5.45 5.11 2 12v6a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2v-6l-3.45-6.89A2 2 0 0 0 16.76 4H7.24a2 2 0 0 0-1.79 1.11z",key:"oot6mr"}]]};r.node;let n=(0,e.f)(r);t.s(["f",0,n],444594)},218964,t=>{var e=t.i(456420);let r={name:"list-checks",size:24,node:[["path",{d:"M13 5h8",key:"a7qcls"}],["path",{d:"M13 12h8",key:"h98zly"}],["path",{d:"M13 19h8",key:"c3s6r1"}],["path",{d:"m3 17 2 2 4-4",key:"1jhpwq"}],["path",{d:"m3 7 2 2 4-4",key:"1obspn"}]]};r.node;let n=(0,e.f)(r);t.s(["f",0,n],218964)},77043,t=>{var e=t.i(456420);let r={name:"printer",size:24,node:[["path",{d:"M6 18H4a2 2 0 0 1-2-2v-5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2v5a2 2 0 0 1-2 2h-2",key:"143wyd"}],["path",{d:"M6 9V3a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v6",key:"1itne7"}],["rect",{x:"6",y:"14",width:"12",height:"8",rx:"1",key:"1ue0tg"}]]};r.node;let n=(0,e.f)(r);t.s(["f",0,n],77043)},566595,t=>{var e=t.i(456420);let r={name:"search",size:24,node:[["path",{d:"m21 21-4.34-4.34",key:"14j7rj"}],["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}]]};r.node;let n=(0,e.f)(r);t.s(["f",0,n],566595)},786563,t=>{var e=t.i(456420);let r={name:"star",size:24,node:[["path",{d:"M11.525 2.295a.53.53 0 0 1 .95 0l2.31 4.679a2.123 2.123 0 0 0 1.595 1.16l5.166.756a.53.53 0 0 1 .294.904l-3.736 3.638a2.123 2.123 0 0 0-.611 1.878l.882 5.14a.53.53 0 0 1-.771.56l-4.618-2.428a2.122 2.122 0 0 0-1.973 0L6.396 21.01a.53.53 0 0 1-.77-.56l.881-5.139a2.122 2.122 0 0 0-.611-1.879L2.16 9.795a.53.53 0 0 1 .294-.906l5.165-.755a2.122 2.122 0 0 0 1.597-1.16z",key:"r04s7s"}]]};r.node;let n=(0,e.f)(r);t.s(["f",0,n],786563)},469937,t=>{var e=t.i(843476),r=t.i(786563),n=t.i(111110),i=t.i(975157);let o=[1,2,3,4,5];t.s(["f",0,function({value:t,onChange:s,disabled:f,size:a="sm",showUnrated:u=!0,className:l}){let{t:h}=(0,n.b)(),c=t??0,p="sm"===a?"h-3.5 w-3.5":"h-5 w-5",g=c?h.difficulty.starsLabel.replace("{n}",String(c)):h.difficulty.unrated;return s?(0,e.jsxs)("span",{className:(0,i.f)("inline-flex items-center gap-0.5",l),role:"group","aria-label":`${h.difficulty.label}${h.common.colon}${g}`,title:h.difficulty.clearHint,children:[o.map(t=>(0,e.jsx)("button",{type:"button",disabled:f,onClick:()=>s(t===c?null:t),"aria-label":h.difficulty.setStars.replace("{n}",String(t)),"aria-pressed":t<=c,className:"rounded p-0.5 hover:bg-muted disabled:opacity-50 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring",children:(0,e.jsx)(r.f,{className:(0,i.f)(p,t<=c?"fill-amber-400 text-amber-400":"text-muted-foreground/40")})},t)),!c&&u&&(0,e.jsx)("span",{className:"ml-1 text-xs text-muted-foreground",children:h.difficulty.unrated})]}):c?(0,e.jsx)("span",{className:(0,i.f)("inline-flex items-center",l),role:"img","aria-label":`${h.difficulty.label}${h.common.colon}${g}`,title:g,children:o.map(t=>(0,e.jsx)(r.f,{className:(0,i.f)(p,t<=c?"fill-amber-400 text-amber-400":"text-muted-foreground/30"),"aria-hidden":!0},t))}):u?(0,e.jsx)("span",{className:(0,i.f)("text-xs text-muted-foreground",l),children:h.difficulty.unrated}):null}])},846968,t=>{var e=t.i(843476),r=t.i(548161),n=t.i(474544),i=t.i(741120),o=t.i(487486),s=t.i(111110);let f={new:{className:"bg-warning/15 text-amber-700 dark:text-warning",icon:n.f},reviewing:{className:"bg-primary/10 text-primary",icon:i.f},mastered:{className:"bg-success/15 text-success",icon:r.f}};t.s(["o",0,{new:"border-l-warning/70",reviewing:"border-l-primary/60",mastered:"border-l-success/70"},"x",0,function({status:t,className:r=""}){let{t:n}=(0,s.b)(),{className:i,icon:a}=f[t],u="mastered"===t?n.notebook.mastered:"reviewing"===t?n.notebook.reviewing:n.notebook.review;return(0,e.jsx)(o.f,{variant:"secondary",className:`${i} ${r}`,children:(0,e.jsxs)("span",{className:"flex items-center gap-1",children:[(0,e.jsx)(a,{className:"h-3 w-3"})," ",u]})})}])},709830,76824,t=>{var e=t.i(843476),r=t.i(111110),n=t.i(597138);let i=["primary","junior_high","senior_high","university"],o="primary",s=["math","english","chinese","physics","chemistry","biology","history","geography","politics"];function f(t){return"string"==typeof t&&s.includes(t)}function a(t){var e;let r=f(t.subjectKey)?t.subjectKey:(0,n.f)(t.name);return{stage:"string"==typeof(e=t.stage)&&i.includes(e)?t.stage:o,subject:r&&f(r)?r:null}}function u(){let{t}=(0,r.b)();return{stageLabel:e=>({primary:t.auth.primary,junior_high:t.auth.juniorHigh,senior_high:t.auth.seniorHigh,university:t.auth.university})[e],subjectLabel:e=>t.tags.subjects[e]}}t.s(["j",0,o,"c",0,i,"W",0,{primary:["math","english","chinese"],junior_high:s,senior_high:s,university:s},"v",0,a],76824),t.s(["E",0,function({notebook:t,className:r}){let{stageLabel:n,subjectLabel:i}=u(),o=a(t);return(0,e.jsxs)("span",{className:r,children:[n(o.stage),o.subject?` \xb7 ${i(o.subject)}`:""]})},"O",0,u],709830)},438465,t=>{var e=t.i(843476),r=t.i(271645),n=t.i(967489),i=t.i(856423),o=t.i(41931),s=t.i(201276),f=t.i(111110);t.s(["f",0,function({value:t,onChange:a,className:u}){let[l,h]=(0,r.useState)([]),{t:c}=(0,f.b)();return(0,r.useEffect)(()=>{(async()=>{try{let t=await o.k.get("/api/notebooks");h(t)}catch(t){s.V.error("[NotebookSelector]","Failed to fetch notebooks",{error:t})}})()},[]),(0,e.jsxs)(n.d,{value:t,onValueChange:a,children:[(0,e.jsx)(n.P,{className:u,children:(0,e.jsxs)("div",{className:"flex items-center gap-2",children:[(0,e.jsx)(i.f,{className:"h-4 w-4 text-muted-foreground"}),(0,e.jsx)(n.U,{placeholder:c.notebooks?.selector?.placeholder||"Select Notebook"})]})}),(0,e.jsx)(n.r,{children:0===l.length?(0,e.jsx)("div",{className:"p-2 text-sm text-muted-foreground text-center",children:c.notebooks?.selector?.empty||"No notebooks available"}):l.map(t=>(0,e.jsx)(n.T,{value:t.id,children:t.name},t.id))})]})}])},590546,t=>{var e=t.i(843476),r=t.i(618566),n=t.i(519455),i=t.i(711241);t.s(["f",0,function({fallbackUrl:t,className:o}){let s=(0,r.useRouter)();return(0,e.jsx)(n.f,{variant:"ghost",size:"icon",onClick:()=>{s.push(t)},className:o,children:(0,e.jsx)(i.f,{className:"h-5 w-5"})})}])},912505,t=>{var e=t.i(843476),r=t.i(975157);t.s(["f",0,function({icon:t,title:n,description:i,action:o,className:s}){return(0,e.jsxs)("div",{className:(0,r.f)("flex flex-col items-center justify-center rounded-2xl border border-dashed bg-card/50 px-6 py-14 text-center",s),children:[(0,e.jsx)("div",{className:"mb-4 flex h-14 w-14 items-center justify-center rounded-2xl bg-accent text-accent-foreground",children:(0,e.jsx)(t,{className:"h-7 w-7"})}),(0,e.jsx)("p",{className:"font-medium",children:n}),i&&(0,e.jsx)("p",{className:"mt-1 max-w-sm text-sm text-muted-foreground",children:i}),o&&(0,e.jsx)("div",{className:"mt-5",children:o})]})}])},393842,t=>{var e=t.i(843476),r=t.i(590546),n=t.i(975157);t.s(["f",0,function({title:t,description:i,backHref:o,actions:s,titleAddon:f,className:a}){return(0,e.jsxs)("div",{className:(0,n.f)("flex items-start gap-3",a),children:[o&&(0,e.jsx)(r.f,{fallbackUrl:o,className:"-ml-2 shrink-0"}),(0,e.jsxs)("div",{className:"min-w-0 flex-1 space-y-1",children:[(0,e.jsxs)("div",{className:"flex items-center gap-1",children:[(0,e.jsx)("h1",{className:"truncate text-2xl font-bold tracking-tight sm:text-3xl",children:t}),f]}),i&&(0,e.jsx)("p",{className:"text-sm text-muted-foreground sm:text-base",children:i})]}),s&&(0,e.jsx)("div",{className:"flex shrink-0 items-center gap-2",children:s})]})}])},86963,t=>{var e=t.i(843476),r=t.i(632781);t.s(["f",0,function({label:t}){return(0,e.jsxs)("div",{className:"flex min-h-[50vh] flex-col items-center justify-center gap-3 text-muted-foreground",children:[(0,e.jsx)(r.f,{className:"h-7 w-7 animate-spin text-primary"}),t&&(0,e.jsx)("p",{className:"text-sm",children:t})]})}])},185592,t=>{var e=t.i(843476),r=t.i(975157);t.s(["f",0,function({options:t,value:n,onChange:i,className:o}){return(0,e.jsx)("div",{className:(0,r.f)("grid gap-1 rounded-xl bg-muted p-1",o),style:{gridTemplateColumns:`repeat(${t.length}, minmax(0, 1fr))`},role:"tablist",children:t.map(({value:t,label:o,icon:s})=>{let f=t===n;return(0,e.jsxs)("button",{type:"button",role:"tab","aria-selected":f,className:(0,r.f)("flex items-center justify-center gap-1.5 rounded-lg px-2 py-2.5 text-sm font-medium transition-all",f?"bg-card text-primary shadow-sm":"text-muted-foreground hover:text-foreground"),onClick:()=>i(t),children:[s&&(0,e.jsx)(s,{className:"h-4 w-4 shrink-0"}),(0,e.jsx)("span",{className:"truncate",children:o})]},t)})})}])},469817,t=>{t.s(["$",0,18,"u",0,5,"A",0,200])},407198,t=>{let e=["题干","选项A","选项B","选项C","选项D","答案","解析","知识点","难度","题型","学科","年级学期","来源","大题","题号"],r=[["下列哪个选项是正确的?","选项一","选项二","选项三","选项四","A","这是解析内容。","知识点一、知识点二","3","单选题","数学","七年级上学期","2025 期中","第一大题","1"],["1+1=____。","","","","","2","基础加法运算。","基础运算","易","填空题","数学","一年级上学期","课堂练习","第一大题","2"]];async function n(){let{default:n}=await t.A(810068),i=[e,...r];return await n(i).toBlob()}t.s(["I",0,e,"j",0,function(){let t=t=>/[",\n\r]/.test(t)?`"${t.replace(/"/g,'""')}"`:t,n=[];for(let i of(n.push(e.map(t).join(",")),r))n.push(i.map(t).join(","));return`\uFEFF${n.join("\r\n")}\r
2
+ `},"n",0,n])},35209,t=>{var e=t.i(271645),r=t.i(111110);t.s(["f",0,function(...t){let{t:n}=(0,r.b)(),i=[n.pageTitle.base,...t.map(t=>"string"==typeof t?t.trim():"").filter(t=>t.length>0)].join("-");(0,e.useEffect)(()=>{document.title=i},[i])}])},991722,t=>{function e(t){return"not_attempted"===t||"wrong_attempt"===t||"unknown"===t?t:"unknown"}t.s(["i",0,function(t,r="zh"){return("en"===r?{not_attempted:"Not attempted",wrong_attempt:"Wrong attempt",unknown:"Unknown"}:{not_attempted:"不会做",wrong_attempt:"做错了",unknown:"未判断"})[e(t)]},"h",0,e,"x",0,function(t,r){return(r||"").trim()?"wrong_attempt":e(t)}])},401280,t=>{let e={single_choice:"single_choice",singlechoice:"single_choice","single choice":"single_choice","single-choice":"single_choice",multiple_choice:"multiple_choice",multiplechoice:"multiple_choice","multiple choice":"multiple_choice","multiple-choice":"multiple_choice",multichoice:"multiple_choice","multi choice":"multiple_choice",true_false:"true_false",truefalse:"true_false","true/false":"true_false","true false":"true_false","true-false":"true_false","true / false":"true_false",fill_blank:"fill_blank",fillblank:"fill_blank","fill in the blank":"fill_blank","fill-in-the-blank":"fill_blank",fillintheblank:"fill_blank",calculation:"calculation",solution:"solution",reading:"reading",cloze:"cloze",writing:"writing",other:"other",选择题:"single_choice",单项选择:"single_choice",单选:"single_choice",单选题:"single_choice",不定项:"multiple_choice",不定项选择:"multiple_choice",多项选择:"multiple_choice",多选:"multiple_choice",多选题:"multiple_choice",判断:"true_false",判断题:"true_false",是非:"true_false",是非题:"true_false",填空:"fill_blank",填空题:"fill_blank",口算:"calculation",计算:"calculation",计算题:"calculation",解答:"solution",解答题:"solution",应用:"solution",应用题:"solution",证明:"solution",证明题:"solution",简答:"solution",简答题:"solution",阅读:"reading",阅读理解:"reading",完形:"cloze",完形填空:"cloze",作文:"writing",写作:"writing",书面表达:"writing",其他:"other"};t.s(["O",0,"__none__","V",0,["single_choice","multiple_choice","true_false","fill_blank","calculation","solution","reading","cloze","writing","other"],"u",0,{single_choice:"Single Choice",multiple_choice:"Multiple Choice",true_false:"True / False",fill_blank:"Fill in the Blank",calculation:"Calculation",solution:"Solution",reading:"Reading Comprehension",cloze:"Cloze",writing:"Writing",other:"Other"},"H",0,{single_choice:"单选题",multiple_choice:"多选题",true_false:"判断题",fill_blank:"填空题",calculation:"计算题",solution:"解答题",reading:"阅读理解",cloze:"完形填空",writing:"写作",other:"其他"},"P",0,function(t){if("string"!=typeof t)return null;let r=t.trim().toLowerCase();return r?e[r]??null:null}])},380935,164549,t=>{var e=t.i(41931);async function r(t){try{return(await e.k.get(`/api/error-items/short/${encodeURIComponent(t)}`)).id}catch{return null}}t.s(["f",0,r],380935);let n=RegExp("^[123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz]{6}$");t.s(["f",0,function(t){return"string"==typeof t&&n.test(t)}],164549)},428602,t=>{t.s(["f",0,function(t){if(t.tags&&t.tags.length>0)return t.tags.map(t=>t.name);if(!t.knowledgePoints)return[];try{let e=JSON.parse(t.knowledgePoints);return Array.isArray(e)?e.filter(t=>"string"==typeof t):[]}catch{return[]}}])},597138,t=>{t.i(306831),t.s(["f",0,function(t){if(!t)return null;let e=t.toLowerCase();return e.includes("math")||e.includes("数学")?"math":e.includes("physics")||e.includes("物理")?"physics":e.includes("chemistry")||e.includes("化学")?"chemistry":e.includes("biology")||e.includes("生物")?"biology":e.includes("english")||e.includes("英语")?"english":e.includes("chinese")||e.includes("语文")?"chinese":e.includes("history")||e.includes("历史")?"history":e.includes("geography")||e.includes("地理")?"geography":e.includes("politics")||e.includes("政治")?"politics":null}])}],467034,(t,e,r)=>{var n={872:function(t,e){"use strict";e.byteLength=function(t){var e=a(t),r=e[0],n=e[1];return(r+n)*3/4-n},e.toByteArray=function(t){var e,r,o=a(t),s=o[0],f=o[1],u=new i((s+f)*3/4-f),l=0,h=f>0?s-4:s;for(r=0;r<h;r+=4)e=n[t.charCodeAt(r)]<<18|n[t.charCodeAt(r+1)]<<12|n[t.charCodeAt(r+2)]<<6|n[t.charCodeAt(r+3)],u[l++]=e>>16&255,u[l++]=e>>8&255,u[l++]=255&e;return 2===f&&(e=n[t.charCodeAt(r)]<<2|n[t.charCodeAt(r+1)]>>4,u[l++]=255&e),1===f&&(e=n[t.charCodeAt(r)]<<10|n[t.charCodeAt(r+1)]<<4|n[t.charCodeAt(r+2)]>>2,u[l++]=e>>8&255,u[l++]=255&e),u},e.fromByteArray=function(t){for(var e,n=t.length,i=n%3,o=[],s=0,f=n-i;s<f;s+=16383)o.push(function(t,e,n){for(var i,o=[],s=e;s<n;s+=3)i=(t[s]<<16&0xff0000)+(t[s+1]<<8&65280)+(255&t[s+2]),o.push(r[i>>18&63]+r[i>>12&63]+r[i>>6&63]+r[63&i]);return o.join("")}(t,s,s+16383>f?f:s+16383));return 1===i?o.push(r[(e=t[n-1])>>2]+r[e<<4&63]+"=="):2===i&&o.push(r[(e=(t[n-2]<<8)+t[n-1])>>10]+r[e>>4&63]+r[e<<2&63]+"="),o.join("")};for(var r=[],n=[],i="u">typeof Uint8Array?Uint8Array:Array,o="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",s=0,f=o.length;s<f;++s)r[s]=o[s],n[o.charCodeAt(s)]=s;function a(t){var e=t.length;if(e%4>0)throw Error("Invalid string. Length must be a multiple of 4");var r=t.indexOf("=");-1===r&&(r=e);var n=r===e?0:4-r%4;return[r,n]}n[45]=62,n[95]=63},230:function(t,e,r){"use strict";var n=r(872),i=r(321),o="function"==typeof Symbol&&"function"==typeof Symbol.for?Symbol.for("nodejs.util.inspect.custom"):null;function s(t){if(t>0x7fffffff)throw RangeError('The value "'+t+'" is invalid for option "size"');var e=new Uint8Array(t);return Object.setPrototypeOf(e,f.prototype),e}function f(t,e,r){if("number"==typeof t){if("string"==typeof e)throw TypeError('The "string" argument must be of type string. Received type number');return l(t)}return a(t,e,r)}function a(t,e,r){if("string"==typeof t){var n=t,i=e;if(("string"!=typeof i||""===i)&&(i="utf8"),!f.isEncoding(i))throw TypeError("Unknown encoding: "+i);var o=0|p(n,i),a=s(o),u=a.write(n,i);return u!==o&&(a=a.slice(0,u)),a}if(ArrayBuffer.isView(t))return h(t);if(null==t)throw TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof t);if(U(t,ArrayBuffer)||t&&U(t.buffer,ArrayBuffer)||"u">typeof SharedArrayBuffer&&(U(t,SharedArrayBuffer)||t&&U(t.buffer,SharedArrayBuffer)))return function(t,e,r){var n;if(e<0||t.byteLength<e)throw RangeError('"offset" is outside of buffer bounds');if(t.byteLength<e+(r||0))throw RangeError('"length" is outside of buffer bounds');return Object.setPrototypeOf(n=void 0===e&&void 0===r?new Uint8Array(t):void 0===r?new Uint8Array(t,e):new Uint8Array(t,e,r),f.prototype),n}(t,e,r);if("number"==typeof t)throw TypeError('The "value" argument must not be of type number. Received type number');var l=t.valueOf&&t.valueOf();if(null!=l&&l!==t)return f.from(l,e,r);var g=function(t){if(f.isBuffer(t)){var e=0|c(t.length),r=s(e);return 0===r.length||t.copy(r,0,0,e),r}return void 0!==t.length?"number"!=typeof t.length||function(t){return t!=t}(t.length)?s(0):h(t):"Buffer"===t.type&&Array.isArray(t.data)?h(t.data):void 0}(t);if(g)return g;if("u">typeof Symbol&&null!=Symbol.toPrimitive&&"function"==typeof t[Symbol.toPrimitive])return f.from(t[Symbol.toPrimitive]("string"),e,r);throw TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof t)}function u(t){if("number"!=typeof t)throw TypeError('"size" argument must be of type number');if(t<0)throw RangeError('The value "'+t+'" is invalid for option "size"')}function l(t){return u(t),s(t<0?0:0|c(t))}function h(t){for(var e=t.length<0?0:0|c(t.length),r=s(e),n=0;n<e;n+=1)r[n]=255&t[n];return r}e.Buffer=f,e.SlowBuffer=function(t){return+t!=t&&(t=0),f.alloc(+t)},e.INSPECT_MAX_BYTES=50,e.kMaxLength=0x7fffffff,f.TYPED_ARRAY_SUPPORT=function(){try{var t=new Uint8Array(1),e={foo:function(){return 42}};return Object.setPrototypeOf(e,Uint8Array.prototype),Object.setPrototypeOf(t,e),42===t.foo()}catch(t){return!1}}(),!f.TYPED_ARRAY_SUPPORT&&"u">typeof console&&"function"==typeof console.error&&console.error("This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support."),Object.defineProperty(f.prototype,"parent",{enumerable:!0,get:function(){if(f.isBuffer(this))return this.buffer}}),Object.defineProperty(f.prototype,"offset",{enumerable:!0,get:function(){if(f.isBuffer(this))return this.byteOffset}}),f.poolSize=8192,f.from=function(t,e,r){return a(t,e,r)},Object.setPrototypeOf(f.prototype,Uint8Array.prototype),Object.setPrototypeOf(f,Uint8Array),f.alloc=function(t,e,r){return(u(t),t<=0)?s(t):void 0!==e?"string"==typeof r?s(t).fill(e,r):s(t).fill(e):s(t)},f.allocUnsafe=function(t){return l(t)},f.allocUnsafeSlow=function(t){return l(t)};function c(t){if(t>=0x7fffffff)throw RangeError("Attempt to allocate Buffer larger than maximum size: 0x7fffffff bytes");return 0|t}function p(t,e){if(f.isBuffer(t))return t.length;if(ArrayBuffer.isView(t)||U(t,ArrayBuffer))return t.byteLength;if("string"!=typeof t)throw TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof t);var r=t.length,n=arguments.length>2&&!0===arguments[2];if(!n&&0===r)return 0;for(var i=!1;;)switch(e){case"ascii":case"latin1":case"binary":return r;case"utf8":case"utf-8":return k(t).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*r;case"hex":return r>>>1;case"base64":return B(t).length;default:if(i)return n?-1:k(t).length;e=(""+e).toLowerCase(),i=!0}}function g(t,e,r){var i,o,s,f=!1;if((void 0===e||e<0)&&(e=0),e>this.length||((void 0===r||r>this.length)&&(r=this.length),r<=0||(r>>>=0)<=(e>>>=0)))return"";for(t||(t="utf8");;)switch(t){case"hex":return function(t,e,r){var n=t.length;(!e||e<0)&&(e=0),(!r||r<0||r>n)&&(r=n);for(var i="",o=e;o<r;++o)i+=T[t[o]];return i}(this,e,r);case"utf8":case"utf-8":return b(this,e,r);case"ascii":return function(t,e,r){var n="";r=Math.min(t.length,r);for(var i=e;i<r;++i)n+=String.fromCharCode(127&t[i]);return n}(this,e,r);case"latin1":case"binary":return function(t,e,r){var n="";r=Math.min(t.length,r);for(var i=e;i<r;++i)n+=String.fromCharCode(t[i]);return n}(this,e,r);case"base64":return i=this,o=e,s=r,0===o&&s===i.length?n.fromByteArray(i):n.fromByteArray(i.slice(o,s));case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return function(t,e,r){for(var n=t.slice(e,r),i="",o=0;o<n.length;o+=2)i+=String.fromCharCode(n[o]+256*n[o+1]);return i}(this,e,r);default:if(f)throw TypeError("Unknown encoding: "+t);t=(t+"").toLowerCase(),f=!0}}function y(t,e,r){var n=t[e];t[e]=t[r],t[r]=n}function d(t,e,r,n,i){var o;if(0===t.length)return -1;if("string"==typeof r?(n=r,r=0):r>0x7fffffff?r=0x7fffffff:r<-0x80000000&&(r=-0x80000000),(o=r*=1)!=o&&(r=i?0:t.length-1),r<0&&(r=t.length+r),r>=t.length)if(i)return -1;else r=t.length-1;else if(r<0)if(!i)return -1;else r=0;if("string"==typeof e&&(e=f.from(e,n)),f.isBuffer(e))return 0===e.length?-1:m(t,e,r,n,i);if("number"==typeof e){if(e&=255,"function"==typeof Uint8Array.prototype.indexOf)if(i)return Uint8Array.prototype.indexOf.call(t,e,r);else return Uint8Array.prototype.lastIndexOf.call(t,e,r);return m(t,[e],r,n,i)}throw TypeError("val must be string, number or Buffer")}function m(t,e,r,n,i){var o,s=1,f=t.length,a=e.length;if(void 0!==n&&("ucs2"===(n=String(n).toLowerCase())||"ucs-2"===n||"utf16le"===n||"utf-16le"===n)){if(t.length<2||e.length<2)return -1;s=2,f/=2,a/=2,r/=2}function u(t,e){return 1===s?t[e]:t.readUInt16BE(e*s)}if(i){var l=-1;for(o=r;o<f;o++)if(u(t,o)===u(e,-1===l?0:o-l)){if(-1===l&&(l=o),o-l+1===a)return l*s}else -1!==l&&(o-=o-l),l=-1}else for(r+a>f&&(r=f-a),o=r;o>=0;o--){for(var h=!0,c=0;c<a;c++)if(u(t,o+c)!==u(e,c)){h=!1;break}if(h)return o}return -1}f.isBuffer=function(t){return null!=t&&!0===t._isBuffer&&t!==f.prototype},f.compare=function(t,e){if(U(t,Uint8Array)&&(t=f.from(t,t.offset,t.byteLength)),U(e,Uint8Array)&&(e=f.from(e,e.offset,e.byteLength)),!f.isBuffer(t)||!f.isBuffer(e))throw TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(t===e)return 0;for(var r=t.length,n=e.length,i=0,o=Math.min(r,n);i<o;++i)if(t[i]!==e[i]){r=t[i],n=e[i];break}return r<n?-1:+(n<r)},f.isEncoding=function(t){switch(String(t).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},f.concat=function(t,e){if(!Array.isArray(t))throw TypeError('"list" argument must be an Array of Buffers');if(0===t.length)return f.alloc(0);if(void 0===e)for(r=0,e=0;r<t.length;++r)e+=t[r].length;var r,n=f.allocUnsafe(e),i=0;for(r=0;r<t.length;++r){var o=t[r];if(U(o,Uint8Array)&&(o=f.from(o)),!f.isBuffer(o))throw TypeError('"list" argument must be an Array of Buffers');o.copy(n,i),i+=o.length}return n},f.byteLength=p,f.prototype._isBuffer=!0,f.prototype.swap16=function(){var t=this.length;if(t%2!=0)throw RangeError("Buffer size must be a multiple of 16-bits");for(var e=0;e<t;e+=2)y(this,e,e+1);return this},f.prototype.swap32=function(){var t=this.length;if(t%4!=0)throw RangeError("Buffer size must be a multiple of 32-bits");for(var e=0;e<t;e+=4)y(this,e,e+3),y(this,e+1,e+2);return this},f.prototype.swap64=function(){var t=this.length;if(t%8!=0)throw RangeError("Buffer size must be a multiple of 64-bits");for(var e=0;e<t;e+=8)y(this,e,e+7),y(this,e+1,e+6),y(this,e+2,e+5),y(this,e+3,e+4);return this},f.prototype.toString=function(){var t=this.length;return 0===t?"":0==arguments.length?b(this,0,t):g.apply(this,arguments)},f.prototype.toLocaleString=f.prototype.toString,f.prototype.equals=function(t){if(!f.isBuffer(t))throw TypeError("Argument must be a Buffer");return this===t||0===f.compare(this,t)},f.prototype.inspect=function(){var t="",r=e.INSPECT_MAX_BYTES;return t=this.toString("hex",0,r).replace(/(.{2})/g,"$1 ").trim(),this.length>r&&(t+=" ... "),"<Buffer "+t+">"},o&&(f.prototype[o]=f.prototype.inspect),f.prototype.compare=function(t,e,r,n,i){if(U(t,Uint8Array)&&(t=f.from(t,t.offset,t.byteLength)),!f.isBuffer(t))throw TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof t);if(void 0===e&&(e=0),void 0===r&&(r=t?t.length:0),void 0===n&&(n=0),void 0===i&&(i=this.length),e<0||r>t.length||n<0||i>this.length)throw RangeError("out of range index");if(n>=i&&e>=r)return 0;if(n>=i)return -1;if(e>=r)return 1;if(e>>>=0,r>>>=0,n>>>=0,i>>>=0,this===t)return 0;for(var o=i-n,s=r-e,a=Math.min(o,s),u=this.slice(n,i),l=t.slice(e,r),h=0;h<a;++h)if(u[h]!==l[h]){o=u[h],s=l[h];break}return o<s?-1:+(s<o)},f.prototype.includes=function(t,e,r){return -1!==this.indexOf(t,e,r)},f.prototype.indexOf=function(t,e,r){return d(this,t,e,r,!0)},f.prototype.lastIndexOf=function(t,e,r){return d(this,t,e,r,!1)};function b(t,e,r){r=Math.min(t.length,r);for(var n=[],i=e;i<r;){var o,s,f,a,u=t[i],l=null,h=u>239?4:u>223?3:u>191?2:1;if(i+h<=r)switch(h){case 1:u<128&&(l=u);break;case 2:(192&(o=t[i+1]))==128&&(a=(31&u)<<6|63&o)>127&&(l=a);break;case 3:o=t[i+1],s=t[i+2],(192&o)==128&&(192&s)==128&&(a=(15&u)<<12|(63&o)<<6|63&s)>2047&&(a<55296||a>57343)&&(l=a);break;case 4:o=t[i+1],s=t[i+2],f=t[i+3],(192&o)==128&&(192&s)==128&&(192&f)==128&&(a=(15&u)<<18|(63&o)<<12|(63&s)<<6|63&f)>65535&&a<1114112&&(l=a)}null===l?(l=65533,h=1):l>65535&&(l-=65536,n.push(l>>>10&1023|55296),l=56320|1023&l),n.push(l),i+=h}var c=n,p=c.length;if(p<=4096)return String.fromCharCode.apply(String,c);for(var g="",y=0;y<p;)g+=String.fromCharCode.apply(String,c.slice(y,y+=4096));return g}function v(t,e,r){if(t%1!=0||t<0)throw RangeError("offset is not uint");if(t+e>r)throw RangeError("Trying to access beyond buffer length")}function w(t,e,r,n,i,o){if(!f.isBuffer(t))throw TypeError('"buffer" argument must be a Buffer instance');if(e>i||e<o)throw RangeError('"value" argument is out of bounds');if(r+n>t.length)throw RangeError("Index out of range")}function x(t,e,r,n,i,o){if(r+n>t.length||r<0)throw RangeError("Index out of range")}function E(t,e,r,n,o){return e*=1,r>>>=0,o||x(t,e,r,4,34028234663852886e22,-34028234663852886e22),i.write(t,e,r,n,23,4),r+4}function A(t,e,r,n,o){return e*=1,r>>>=0,o||x(t,e,r,8,17976931348623157e292,-17976931348623157e292),i.write(t,e,r,n,52,8),r+8}f.prototype.write=function(t,e,r,n){if(void 0===e)n="utf8",r=this.length,e=0;else if(void 0===r&&"string"==typeof e)n=e,r=this.length,e=0;else if(isFinite(e))e>>>=0,isFinite(r)?(r>>>=0,void 0===n&&(n="utf8")):(n=r,r=void 0);else throw Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");var i,o,s,f,a,u,l,h,c=this.length-e;if((void 0===r||r>c)&&(r=c),t.length>0&&(r<0||e<0)||e>this.length)throw RangeError("Attempt to write outside buffer bounds");n||(n="utf8");for(var p=!1;;)switch(n){case"hex":return function(t,e,r,n){r=Number(r)||0;var i=t.length-r;n?(n=Number(n))>i&&(n=i):n=i;var o=e.length;n>o/2&&(n=o/2);for(var s=0;s<n;++s){var f,a=parseInt(e.substr(2*s,2),16);if((f=a)!=f)break;t[r+s]=a}return s}(this,t,e,r);case"utf8":case"utf-8":return i=e,o=r,N(k(t,this.length-i),this,i,o);case"ascii":return s=e,f=r,N(j(t),this,s,f);case"latin1":case"binary":return function(t,e,r,n){return N(j(e),t,r,n)}(this,t,e,r);case"base64":return a=e,u=r,N(B(t),this,a,u);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return l=e,h=r,N(function(t,e){for(var r,n,i=[],o=0;o<t.length&&!((e-=2)<0);++o)n=(r=t.charCodeAt(o))>>8,i.push(r%256),i.push(n);return i}(t,this.length-l),this,l,h);default:if(p)throw TypeError("Unknown encoding: "+n);n=(""+n).toLowerCase(),p=!0}},f.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}},f.prototype.slice=function(t,e){var r=this.length;t=~~t,e=void 0===e?r:~~e,t<0?(t+=r)<0&&(t=0):t>r&&(t=r),e<0?(e+=r)<0&&(e=0):e>r&&(e=r),e<t&&(e=t);var n=this.subarray(t,e);return Object.setPrototypeOf(n,f.prototype),n},f.prototype.readUIntLE=function(t,e,r){t>>>=0,e>>>=0,r||v(t,e,this.length);for(var n=this[t],i=1,o=0;++o<e&&(i*=256);)n+=this[t+o]*i;return n},f.prototype.readUIntBE=function(t,e,r){t>>>=0,e>>>=0,r||v(t,e,this.length);for(var n=this[t+--e],i=1;e>0&&(i*=256);)n+=this[t+--e]*i;return n},f.prototype.readUInt8=function(t,e){return t>>>=0,e||v(t,1,this.length),this[t]},f.prototype.readUInt16LE=function(t,e){return t>>>=0,e||v(t,2,this.length),this[t]|this[t+1]<<8},f.prototype.readUInt16BE=function(t,e){return t>>>=0,e||v(t,2,this.length),this[t]<<8|this[t+1]},f.prototype.readUInt32LE=function(t,e){return t>>>=0,e||v(t,4,this.length),(this[t]|this[t+1]<<8|this[t+2]<<16)+0x1000000*this[t+3]},f.prototype.readUInt32BE=function(t,e){return t>>>=0,e||v(t,4,this.length),0x1000000*this[t]+(this[t+1]<<16|this[t+2]<<8|this[t+3])},f.prototype.readIntLE=function(t,e,r){t>>>=0,e>>>=0,r||v(t,e,this.length);for(var n=this[t],i=1,o=0;++o<e&&(i*=256);)n+=this[t+o]*i;return n>=(i*=128)&&(n-=Math.pow(2,8*e)),n},f.prototype.readIntBE=function(t,e,r){t>>>=0,e>>>=0,r||v(t,e,this.length);for(var n=e,i=1,o=this[t+--n];n>0&&(i*=256);)o+=this[t+--n]*i;return o>=(i*=128)&&(o-=Math.pow(2,8*e)),o},f.prototype.readInt8=function(t,e){return(t>>>=0,e||v(t,1,this.length),128&this[t])?-((255-this[t]+1)*1):this[t]},f.prototype.readInt16LE=function(t,e){t>>>=0,e||v(t,2,this.length);var r=this[t]|this[t+1]<<8;return 32768&r?0xffff0000|r:r},f.prototype.readInt16BE=function(t,e){t>>>=0,e||v(t,2,this.length);var r=this[t+1]|this[t]<<8;return 32768&r?0xffff0000|r:r},f.prototype.readInt32LE=function(t,e){return t>>>=0,e||v(t,4,this.length),this[t]|this[t+1]<<8|this[t+2]<<16|this[t+3]<<24},f.prototype.readInt32BE=function(t,e){return t>>>=0,e||v(t,4,this.length),this[t]<<24|this[t+1]<<16|this[t+2]<<8|this[t+3]},f.prototype.readFloatLE=function(t,e){return t>>>=0,e||v(t,4,this.length),i.read(this,t,!0,23,4)},f.prototype.readFloatBE=function(t,e){return t>>>=0,e||v(t,4,this.length),i.read(this,t,!1,23,4)},f.prototype.readDoubleLE=function(t,e){return t>>>=0,e||v(t,8,this.length),i.read(this,t,!0,52,8)},f.prototype.readDoubleBE=function(t,e){return t>>>=0,e||v(t,8,this.length),i.read(this,t,!1,52,8)},f.prototype.writeUIntLE=function(t,e,r,n){if(t*=1,e>>>=0,r>>>=0,!n){var i=Math.pow(2,8*r)-1;w(this,t,e,r,i,0)}var o=1,s=0;for(this[e]=255&t;++s<r&&(o*=256);)this[e+s]=t/o&255;return e+r},f.prototype.writeUIntBE=function(t,e,r,n){if(t*=1,e>>>=0,r>>>=0,!n){var i=Math.pow(2,8*r)-1;w(this,t,e,r,i,0)}var o=r-1,s=1;for(this[e+o]=255&t;--o>=0&&(s*=256);)this[e+o]=t/s&255;return e+r},f.prototype.writeUInt8=function(t,e,r){return t*=1,e>>>=0,r||w(this,t,e,1,255,0),this[e]=255&t,e+1},f.prototype.writeUInt16LE=function(t,e,r){return t*=1,e>>>=0,r||w(this,t,e,2,65535,0),this[e]=255&t,this[e+1]=t>>>8,e+2},f.prototype.writeUInt16BE=function(t,e,r){return t*=1,e>>>=0,r||w(this,t,e,2,65535,0),this[e]=t>>>8,this[e+1]=255&t,e+2},f.prototype.writeUInt32LE=function(t,e,r){return t*=1,e>>>=0,r||w(this,t,e,4,0xffffffff,0),this[e+3]=t>>>24,this[e+2]=t>>>16,this[e+1]=t>>>8,this[e]=255&t,e+4},f.prototype.writeUInt32BE=function(t,e,r){return t*=1,e>>>=0,r||w(this,t,e,4,0xffffffff,0),this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t,e+4},f.prototype.writeIntLE=function(t,e,r,n){if(t*=1,e>>>=0,!n){var i=Math.pow(2,8*r-1);w(this,t,e,r,i-1,-i)}var o=0,s=1,f=0;for(this[e]=255&t;++o<r&&(s*=256);)t<0&&0===f&&0!==this[e+o-1]&&(f=1),this[e+o]=(t/s|0)-f&255;return e+r},f.prototype.writeIntBE=function(t,e,r,n){if(t*=1,e>>>=0,!n){var i=Math.pow(2,8*r-1);w(this,t,e,r,i-1,-i)}var o=r-1,s=1,f=0;for(this[e+o]=255&t;--o>=0&&(s*=256);)t<0&&0===f&&0!==this[e+o+1]&&(f=1),this[e+o]=(t/s|0)-f&255;return e+r},f.prototype.writeInt8=function(t,e,r){return t*=1,e>>>=0,r||w(this,t,e,1,127,-128),t<0&&(t=255+t+1),this[e]=255&t,e+1},f.prototype.writeInt16LE=function(t,e,r){return t*=1,e>>>=0,r||w(this,t,e,2,32767,-32768),this[e]=255&t,this[e+1]=t>>>8,e+2},f.prototype.writeInt16BE=function(t,e,r){return t*=1,e>>>=0,r||w(this,t,e,2,32767,-32768),this[e]=t>>>8,this[e+1]=255&t,e+2},f.prototype.writeInt32LE=function(t,e,r){return t*=1,e>>>=0,r||w(this,t,e,4,0x7fffffff,-0x80000000),this[e]=255&t,this[e+1]=t>>>8,this[e+2]=t>>>16,this[e+3]=t>>>24,e+4},f.prototype.writeInt32BE=function(t,e,r){return t*=1,e>>>=0,r||w(this,t,e,4,0x7fffffff,-0x80000000),t<0&&(t=0xffffffff+t+1),this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t,e+4},f.prototype.writeFloatLE=function(t,e,r){return E(this,t,e,!0,r)},f.prototype.writeFloatBE=function(t,e,r){return E(this,t,e,!1,r)},f.prototype.writeDoubleLE=function(t,e,r){return A(this,t,e,!0,r)},f.prototype.writeDoubleBE=function(t,e,r){return A(this,t,e,!1,r)},f.prototype.copy=function(t,e,r,n){if(!f.isBuffer(t))throw TypeError("argument should be a Buffer");if(r||(r=0),n||0===n||(n=this.length),e>=t.length&&(e=t.length),e||(e=0),n>0&&n<r&&(n=r),n===r||0===t.length||0===this.length)return 0;if(e<0)throw RangeError("targetStart out of bounds");if(r<0||r>=this.length)throw RangeError("Index out of range");if(n<0)throw RangeError("sourceEnd out of bounds");n>this.length&&(n=this.length),t.length-e<n-r&&(n=t.length-e+r);var i=n-r;if(this===t&&"function"==typeof Uint8Array.prototype.copyWithin)this.copyWithin(e,r,n);else if(this===t&&r<e&&e<n)for(var o=i-1;o>=0;--o)t[o+e]=this[o+r];else Uint8Array.prototype.set.call(t,this.subarray(r,n),e);return i},f.prototype.fill=function(t,e,r,n){if("string"==typeof t){if("string"==typeof e?(n=e,e=0,r=this.length):"string"==typeof r&&(n=r,r=this.length),void 0!==n&&"string"!=typeof n)throw TypeError("encoding must be a string");if("string"==typeof n&&!f.isEncoding(n))throw TypeError("Unknown encoding: "+n);if(1===t.length){var i,o=t.charCodeAt(0);("utf8"===n&&o<128||"latin1"===n)&&(t=o)}}else"number"==typeof t?t&=255:"boolean"==typeof t&&(t=Number(t));if(e<0||this.length<e||this.length<r)throw RangeError("Out of range index");if(r<=e)return this;if(e>>>=0,r=void 0===r?this.length:r>>>0,t||(t=0),"number"==typeof t)for(i=e;i<r;++i)this[i]=t;else{var s=f.isBuffer(t)?t:f.from(t,n),a=s.length;if(0===a)throw TypeError('The value "'+t+'" is invalid for argument "value"');for(i=0;i<r-e;++i)this[i+e]=s[i%a]}return this};var _=/[^+/0-9A-Za-z-_]/g;function k(t,e){e=e||1/0;for(var r,n=t.length,i=null,o=[],s=0;s<n;++s){if((r=t.charCodeAt(s))>55295&&r<57344){if(!i){if(r>56319||s+1===n){(e-=3)>-1&&o.push(239,191,189);continue}i=r;continue}if(r<56320){(e-=3)>-1&&o.push(239,191,189),i=r;continue}r=(i-55296<<10|r-56320)+65536}else i&&(e-=3)>-1&&o.push(239,191,189);if(i=null,r<128){if((e-=1)<0)break;o.push(r)}else if(r<2048){if((e-=2)<0)break;o.push(r>>6|192,63&r|128)}else if(r<65536){if((e-=3)<0)break;o.push(r>>12|224,r>>6&63|128,63&r|128)}else if(r<1114112){if((e-=4)<0)break;o.push(r>>18|240,r>>12&63|128,r>>6&63|128,63&r|128)}else throw Error("Invalid code point")}return o}function j(t){for(var e=[],r=0;r<t.length;++r)e.push(255&t.charCodeAt(r));return e}function B(t){return n.toByteArray(function(t){if((t=(t=t.split("=")[0]).trim().replace(_,"")).length<2)return"";for(;t.length%4!=0;)t+="=";return t}(t))}function N(t,e,r,n){for(var i=0;i<n&&!(i+r>=e.length)&&!(i>=t.length);++i)e[i+r]=t[i];return i}function U(t,e){return t instanceof e||null!=t&&null!=t.constructor&&null!=t.constructor.name&&t.constructor.name===e.name}var T=function(){for(var t="0123456789abcdef",e=Array(256),r=0;r<16;++r)for(var n=16*r,i=0;i<16;++i)e[n+i]=t[r]+t[i];return e}()},321:function(t,e){e.read=function(t,e,r,n,i){var o,s,f=8*i-n-1,a=(1<<f)-1,u=a>>1,l=-7,h=r?i-1:0,c=r?-1:1,p=t[e+h];for(h+=c,o=p&(1<<-l)-1,p>>=-l,l+=f;l>0;o=256*o+t[e+h],h+=c,l-=8);for(s=o&(1<<-l)-1,o>>=-l,l+=n;l>0;s=256*s+t[e+h],h+=c,l-=8);if(0===o)o=1-u;else{if(o===a)return s?0/0:(p?-1:1)*2e308;s+=Math.pow(2,n),o-=u}return(p?-1:1)*s*Math.pow(2,o-n)},e.write=function(t,e,r,n,i,o){var s,f,a,u=8*o-i-1,l=(1<<u)-1,h=l>>1,c=5960464477539062e-23*(23===i),p=n?0:o-1,g=n?1:-1,y=+(e<0||0===e&&1/e<0);for(isNaN(e=Math.abs(e))||1/0===e?(f=+!!isNaN(e),s=l):(s=Math.floor(Math.log(e)/Math.LN2),e*(a=Math.pow(2,-s))<1&&(s--,a*=2),s+h>=1?e+=c/a:e+=c*Math.pow(2,1-h),e*a>=2&&(s++,a/=2),s+h>=l?(f=0,s=l):s+h>=1?(f=(e*a-1)*Math.pow(2,i),s+=h):(f=e*Math.pow(2,h-1)*Math.pow(2,i),s=0));i>=8;t[r+p]=255&f,p+=g,f/=256,i-=8);for(s=s<<i|f,u+=i;u>0;t[r+p]=255&s,p+=g,s/=256,u-=8);t[r+p-g]|=128*y}}},i={};function o(t){var e=i[t];if(void 0!==e)return e.exports;var r=i[t]={exports:{}},s=!0;try{n[t](r,r.exports,o),s=!1}finally{s&&delete i[t]}return r.exports}o.ab="/ROOT/node_modules/next/dist/compiled/buffer/",e.exports=o(230)}]);