agim-cli 1.5.0 → 1.5.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (344) hide show
  1. package/CHANGELOG.md +22 -0
  2. package/README.md +39 -3
  3. package/README.zh-CN.md +42 -7
  4. package/dist/cli-ui/cmd-handlers.d.ts +22 -1
  5. package/dist/cli-ui/cmd-handlers.d.ts.map +1 -1
  6. package/dist/cli-ui/cmd-handlers.js +304 -40
  7. package/dist/cli-ui/cmd-handlers.js.map +1 -1
  8. package/dist/cli-ui/config-wizard.d.ts +13 -1
  9. package/dist/cli-ui/config-wizard.d.ts.map +1 -1
  10. package/dist/cli-ui/config-wizard.js +93 -21
  11. package/dist/cli-ui/config-wizard.js.map +1 -1
  12. package/dist/cli-ui/doctor.d.ts +15 -0
  13. package/dist/cli-ui/doctor.d.ts.map +1 -0
  14. package/dist/cli-ui/doctor.js +151 -0
  15. package/dist/cli-ui/doctor.js.map +1 -0
  16. package/dist/cli-ui/entry-menu.d.ts +6 -0
  17. package/dist/cli-ui/entry-menu.d.ts.map +1 -1
  18. package/dist/cli-ui/entry-menu.js +67 -30
  19. package/dist/cli-ui/entry-menu.js.map +1 -1
  20. package/dist/cli-ui/i18n.d.ts +15 -6
  21. package/dist/cli-ui/i18n.d.ts.map +1 -1
  22. package/dist/cli-ui/i18n.js +30 -12
  23. package/dist/cli-ui/i18n.js.map +1 -1
  24. package/dist/cli-ui/quickstart.d.ts +3 -0
  25. package/dist/cli-ui/quickstart.d.ts.map +1 -0
  26. package/dist/cli-ui/quickstart.js +108 -0
  27. package/dist/cli-ui/quickstart.js.map +1 -0
  28. package/dist/cli-ui/readiness.d.ts +10 -0
  29. package/dist/cli-ui/readiness.d.ts.map +1 -0
  30. package/dist/cli-ui/readiness.js +75 -0
  31. package/dist/cli-ui/readiness.js.map +1 -0
  32. package/dist/cli-ui/service.d.ts +23 -0
  33. package/dist/cli-ui/service.d.ts.map +1 -1
  34. package/dist/cli-ui/service.js +114 -5
  35. package/dist/cli-ui/service.js.map +1 -1
  36. package/dist/cli.js +99 -396
  37. package/dist/cli.js.map +1 -1
  38. package/dist/core/acp-server.d.ts.map +1 -1
  39. package/dist/core/acp-server.js +16 -2
  40. package/dist/core/acp-server.js.map +1 -1
  41. package/dist/core/agent-cwd.d.ts +8 -0
  42. package/dist/core/agent-cwd.d.ts.map +1 -1
  43. package/dist/core/agent-cwd.js +57 -7
  44. package/dist/core/agent-cwd.js.map +1 -1
  45. package/dist/core/commands/builtin.d.ts.map +1 -1
  46. package/dist/core/commands/builtin.js +12 -2
  47. package/dist/core/commands/builtin.js.map +1 -1
  48. package/dist/core/commands/model.d.ts.map +1 -1
  49. package/dist/core/commands/model.js +31 -2
  50. package/dist/core/commands/model.js.map +1 -1
  51. package/dist/core/llm/anthropic-provider.js +2 -1
  52. package/dist/core/llm/anthropic-provider.js.map +1 -1
  53. package/dist/core/llm/openai-compat-provider.js +3 -2
  54. package/dist/core/llm/openai-compat-provider.js.map +1 -1
  55. package/dist/core/llm/provider-base.d.ts +4 -4
  56. package/dist/core/llm/provider-base.d.ts.map +1 -1
  57. package/dist/core/llm/provider-base.js +1 -1
  58. package/dist/core/llm/provider-base.js.map +1 -1
  59. package/dist/plugins/agents/native/index.d.ts +1 -0
  60. package/dist/plugins/agents/native/index.d.ts.map +1 -1
  61. package/dist/plugins/agents/native/index.js +14 -0
  62. package/dist/plugins/agents/native/index.js.map +1 -1
  63. package/dist/plugins/agents/pi-native/factory.d.ts.map +1 -1
  64. package/dist/plugins/agents/pi-native/factory.js +19 -3
  65. package/dist/plugins/agents/pi-native/factory.js.map +1 -1
  66. package/dist/plugins/agents/pi-native/index.d.ts +11 -0
  67. package/dist/plugins/agents/pi-native/index.d.ts.map +1 -1
  68. package/dist/plugins/agents/pi-native/index.js +56 -2
  69. package/dist/plugins/agents/pi-native/index.js.map +1 -1
  70. package/dist/plugins/agents/pi-native/provider-resolver.d.ts +2 -0
  71. package/dist/plugins/agents/pi-native/provider-resolver.d.ts.map +1 -1
  72. package/dist/plugins/agents/pi-native/provider-resolver.js +9 -1
  73. package/dist/plugins/agents/pi-native/provider-resolver.js.map +1 -1
  74. package/dist/web/public/assets/a2a-CTsDMefo.js +7 -0
  75. package/dist/web/public/assets/a2a-CTsDMefo.js.map +1 -0
  76. package/dist/web/public/assets/{activity-BAgb2WZC.js → activity-ul8Os7Pz.js} +2 -2
  77. package/dist/web/public/assets/{activity-BAgb2WZC.js.map → activity-ul8Os7Pz.js.map} +1 -1
  78. package/dist/web/public/assets/{admins-CZYANmhn.js → admins-ByMAuquy.js} +3 -3
  79. package/dist/web/public/assets/{admins-CZYANmhn.js.map → admins-ByMAuquy.js.map} +1 -1
  80. package/dist/web/public/assets/agents-Ds1zyxBj.js +2 -0
  81. package/dist/web/public/assets/{agents-BXThDW6f.js.map → agents-Ds1zyxBj.js.map} +1 -1
  82. package/dist/web/public/assets/{approvals-ByPXIYVl.js → approvals-DOWlWI7Z.js} +3 -3
  83. package/dist/web/public/assets/{approvals-ByPXIYVl.js.map → approvals-DOWlWI7Z.js.map} +1 -1
  84. package/dist/web/public/assets/{arrow-down-B8DkdbEY.js → arrow-down-7i0xwCI2.js} +2 -2
  85. package/dist/web/public/assets/{arrow-down-B8DkdbEY.js.map → arrow-down-7i0xwCI2.js.map} +1 -1
  86. package/dist/web/public/assets/arrow-right-A889Wof8.js +7 -0
  87. package/dist/web/public/assets/arrow-right-A889Wof8.js.map +1 -0
  88. package/dist/web/public/assets/{arrow-up-i_dEdXkz.js → arrow-up-Dm0U4-6U.js} +2 -2
  89. package/dist/web/public/assets/{arrow-up-i_dEdXkz.js.map → arrow-up-Dm0U4-6U.js.map} +1 -1
  90. package/dist/web/public/assets/{asks-yD_inOnM.js → asks-DGuBsrJ7.js} +3 -3
  91. package/dist/web/public/assets/{asks-yD_inOnM.js.map → asks-DGuBsrJ7.js.map} +1 -1
  92. package/dist/web/public/assets/{audit-teCIRtgN.js → audit-BRXsplJ2.js} +2 -2
  93. package/dist/web/public/assets/{audit-teCIRtgN.js.map → audit-BRXsplJ2.js.map} +1 -1
  94. package/dist/web/public/assets/{bell-CeWDMs8_.js → bell-B-UdeJsp.js} +2 -2
  95. package/dist/web/public/assets/{bell-CeWDMs8_.js.map → bell-B-UdeJsp.js.map} +1 -1
  96. package/dist/web/public/assets/bgjobs-CcRiffyJ.js +2 -0
  97. package/dist/web/public/assets/bgjobs-CcRiffyJ.js.map +1 -0
  98. package/dist/web/public/assets/book-open-CSCq5cjL.js +7 -0
  99. package/dist/web/public/assets/book-open-CSCq5cjL.js.map +1 -0
  100. package/dist/web/public/assets/{brain-BQqv0Zhc.js → brain-Dl4DF5kX.js} +2 -2
  101. package/dist/web/public/assets/{brain-BQqv0Zhc.js.map → brain-Dl4DF5kX.js.map} +1 -1
  102. package/dist/web/public/assets/{briefcase-DUXbR4xs.js → briefcase-CeKUkFSq.js} +2 -2
  103. package/dist/web/public/assets/{briefcase-DUXbR4xs.js.map → briefcase-CeKUkFSq.js.map} +1 -1
  104. package/dist/web/public/assets/chat-rLJMdJBk.js +12 -0
  105. package/dist/web/public/assets/chat-rLJMdJBk.js.map +1 -0
  106. package/dist/web/public/assets/{chevron-left-RC6mMSiX.js → chevron-left-01fAFVpo.js} +2 -2
  107. package/dist/web/public/assets/{chevron-left-RC6mMSiX.js.map → chevron-left-01fAFVpo.js.map} +1 -1
  108. package/dist/web/public/assets/{chevron-right-DrkYVi19.js → chevron-right-CFRb-SM_.js} +3 -3
  109. package/dist/web/public/assets/{chevron-right-DrkYVi19.js.map → chevron-right-CFRb-SM_.js.map} +1 -1
  110. package/dist/web/public/assets/{circle-check-big-BC8ntMsz.js → circle-check-big-DBg2BD6o.js} +2 -2
  111. package/dist/web/public/assets/{circle-check-big-BC8ntMsz.js.map → circle-check-big-DBg2BD6o.js.map} +1 -1
  112. package/dist/web/public/assets/{circle-x-DHK7ypFY.js → circle-x-CqFMzO-x.js} +2 -2
  113. package/dist/web/public/assets/{circle-x-DHK7ypFY.js.map → circle-x-CqFMzO-x.js.map} +1 -1
  114. package/dist/web/public/assets/clipboard-list-lnqdk2_J.js +7 -0
  115. package/dist/web/public/assets/clipboard-list-lnqdk2_J.js.map +1 -0
  116. package/dist/web/public/assets/{clock-DXHhWqJH.js → clock-4hd1joQe.js} +3 -3
  117. package/dist/web/public/assets/{clock-DXHhWqJH.js.map → clock-4hd1joQe.js.map} +1 -1
  118. package/dist/web/public/assets/confirm-dialog-BDb0NLny.js +2 -0
  119. package/dist/web/public/assets/{confirm-dialog-gPKJnvEW.js.map → confirm-dialog-BDb0NLny.js.map} +1 -1
  120. package/dist/web/public/assets/{copy-DtQxgcR0.js → copy-CD4A7VD8.js} +3 -3
  121. package/dist/web/public/assets/{copy-DtQxgcR0.js.map → copy-CD4A7VD8.js.map} +1 -1
  122. package/dist/web/public/assets/dashboard-CG3WiG7h.js +2 -0
  123. package/dist/web/public/assets/dashboard-CG3WiG7h.js.map +1 -0
  124. package/dist/web/public/assets/{data-table-DOKUic1J.js → data-table-BkUshOZz.js} +2 -2
  125. package/dist/web/public/assets/{data-table-DOKUic1J.js.map → data-table-BkUshOZz.js.map} +1 -1
  126. package/dist/web/public/assets/database-lQzk64rV.js +7 -0
  127. package/dist/web/public/assets/database-lQzk64rV.js.map +1 -0
  128. package/dist/web/public/assets/{distill-p6P7-1UR.js → distill-CPurVW3v.js} +3 -3
  129. package/dist/web/public/assets/{distill-p6P7-1UR.js.map → distill-CPurVW3v.js.map} +1 -1
  130. package/dist/web/public/assets/{download-CqNiIHa8.js → download-CVZnHcwj.js} +2 -2
  131. package/dist/web/public/assets/{download-CqNiIHa8.js.map → download-CVZnHcwj.js.map} +1 -1
  132. package/dist/web/public/assets/dropdown-menu-BNH5SrVb.js +7 -0
  133. package/dist/web/public/assets/dropdown-menu-BNH5SrVb.js.map +1 -0
  134. package/dist/web/public/assets/{email-DwbfTUlV.js → email-YlI4MWLp.js} +3 -3
  135. package/dist/web/public/assets/{email-DwbfTUlV.js.map → email-YlI4MWLp.js.map} +1 -1
  136. package/dist/web/public/assets/{empty-state-CTwOQemt.js → empty-state-CuiqdZiB.js} +2 -2
  137. package/dist/web/public/assets/{empty-state-CTwOQemt.js.map → empty-state-CuiqdZiB.js.map} +1 -1
  138. package/dist/web/public/assets/{external-link-BY7Ye8yi.js → external-link-1WPpVvdu.js} +2 -2
  139. package/dist/web/public/assets/{external-link-BY7Ye8yi.js.map → external-link-1WPpVvdu.js.map} +1 -1
  140. package/dist/web/public/assets/{eye-6RUADoDS.js → eye-BfPyNFzk.js} +2 -2
  141. package/dist/web/public/assets/{eye-6RUADoDS.js.map → eye-BfPyNFzk.js.map} +1 -1
  142. package/dist/web/public/assets/{facts-DXE0aJmb.js → facts-xT_24pH8.js} +2 -2
  143. package/dist/web/public/assets/{facts-DXE0aJmb.js.map → facts-xT_24pH8.js.map} +1 -1
  144. package/dist/web/public/assets/file-text-BxfdLM0-.js +7 -0
  145. package/dist/web/public/assets/file-text-BxfdLM0-.js.map +1 -0
  146. package/dist/web/public/assets/{goals-C1LCm3qL.js → goals-C8ZQfbhj.js} +3 -3
  147. package/dist/web/public/assets/{goals-C1LCm3qL.js.map → goals-C8ZQfbhj.js.map} +1 -1
  148. package/dist/web/public/assets/health-A2StNEfn.js +2 -0
  149. package/dist/web/public/assets/{health-wqCp-K_o.js.map → health-A2StNEfn.js.map} +1 -1
  150. package/dist/web/public/assets/{heart-pulse-DfqI4GF7.js → heart-pulse-DXlE9oic.js} +2 -2
  151. package/dist/web/public/assets/{heart-pulse-DfqI4GF7.js.map → heart-pulse-DXlE9oic.js.map} +1 -1
  152. package/dist/web/public/assets/{heartbeat-Bumv4XtQ.js → heartbeat-ClO5gJrj.js} +3 -3
  153. package/dist/web/public/assets/{heartbeat-Bumv4XtQ.js.map → heartbeat-ClO5gJrj.js.map} +1 -1
  154. package/dist/web/public/assets/hot-bfTA-V_z.js +7 -0
  155. package/dist/web/public/assets/{hot-B-CMjQIr.js.map → hot-bfTA-V_z.js.map} +1 -1
  156. package/dist/web/public/assets/index-Bi2qWb-u.css +1 -0
  157. package/dist/web/public/assets/index-DCfdN5R7.js +244 -0
  158. package/dist/web/public/assets/index-DCfdN5R7.js.map +1 -0
  159. package/dist/web/public/assets/{injection-Dn_XqgLG.js → injection-omvCR6-p.js} +2 -2
  160. package/dist/web/public/assets/{injection-Dn_XqgLG.js.map → injection-omvCR6-p.js.map} +1 -1
  161. package/dist/web/public/assets/{installed-Cet-1M2Q.js → installed-DL6r3ktm.js} +4 -9
  162. package/dist/web/public/assets/installed-DL6r3ktm.js.map +1 -0
  163. package/dist/web/public/assets/jobs-Biy5lYd4.js +2 -0
  164. package/dist/web/public/assets/jobs-Biy5lYd4.js.map +1 -0
  165. package/dist/web/public/assets/layout-BLm6NJ3V.js +2 -0
  166. package/dist/web/public/assets/layout-BLm6NJ3V.js.map +1 -0
  167. package/dist/web/public/assets/layout-BTKafRVZ.js +2 -0
  168. package/dist/web/public/assets/layout-BTKafRVZ.js.map +1 -0
  169. package/dist/web/public/assets/layout-Bm-2s2fp.js +2 -0
  170. package/dist/web/public/assets/layout-Bm-2s2fp.js.map +1 -0
  171. package/dist/web/public/assets/layout-DsZ8eR4i.js +2 -0
  172. package/dist/web/public/assets/layout-DsZ8eR4i.js.map +1 -0
  173. package/dist/web/public/assets/{layout-D_3ZcVG7.js → layout-sxvovjEH.js} +2 -2
  174. package/dist/web/public/assets/{layout-D_3ZcVG7.js.map → layout-sxvovjEH.js.map} +1 -1
  175. package/dist/web/public/assets/llm-JjZDbBvJ.js +37 -0
  176. package/dist/web/public/assets/llm-JjZDbBvJ.js.map +1 -0
  177. package/dist/web/public/assets/loader-circle-DDdmcH0k.js +7 -0
  178. package/dist/web/public/assets/{loader-circle-DgdBWYl0.js.map → loader-circle-DDdmcH0k.js.map} +1 -1
  179. package/dist/web/public/assets/{map-pin-3QS1A0-I.js → map-pin-C_jAxukI.js} +2 -2
  180. package/dist/web/public/assets/{map-pin-3QS1A0-I.js.map → map-pin-C_jAxukI.js.map} +1 -1
  181. package/dist/web/public/assets/{mcp-DwKZULET.js → mcp-vKajK1F8.js} +3 -3
  182. package/dist/web/public/assets/{mcp-DwKZULET.js.map → mcp-vKajK1F8.js.map} +1 -1
  183. package/dist/web/public/assets/memos-DAt4k3DO.js +7 -0
  184. package/dist/web/public/assets/memos-DAt4k3DO.js.map +1 -0
  185. package/dist/web/public/assets/messengers-GYVTFlAj.js +2 -0
  186. package/dist/web/public/assets/messengers-GYVTFlAj.js.map +1 -0
  187. package/dist/web/public/assets/{mobile-Bq0FH9JV.js → mobile-VUyTo40E.js} +3 -3
  188. package/dist/web/public/assets/{mobile-Bq0FH9JV.js.map → mobile-VUyTo40E.js.map} +1 -1
  189. package/dist/web/public/assets/{network--s113Jkm.js → network-BUeWK3bs.js} +2 -2
  190. package/dist/web/public/assets/{network--s113Jkm.js.map → network-BUeWK3bs.js.map} +1 -1
  191. package/dist/web/public/assets/outbox-CEE0rwN3.js +2 -0
  192. package/dist/web/public/assets/outbox-CEE0rwN3.js.map +1 -0
  193. package/dist/web/public/assets/overview-BSOZ5gTD.js +12 -0
  194. package/dist/web/public/assets/overview-BSOZ5gTD.js.map +1 -0
  195. package/dist/web/public/assets/overview-COop5K2Y.js +12 -0
  196. package/dist/web/public/assets/overview-COop5K2Y.js.map +1 -0
  197. package/dist/web/public/assets/overview-DeH5ud6d.js +2 -0
  198. package/dist/web/public/assets/overview-DeH5ud6d.js.map +1 -0
  199. package/dist/web/public/assets/{pagination-DkdCTctJ.js → pagination-BBicLzXP.js} +3 -3
  200. package/dist/web/public/assets/{pagination-DkdCTctJ.js.map → pagination-BBicLzXP.js.map} +1 -1
  201. package/dist/web/public/assets/persona-CElXQZ4p.js +2 -0
  202. package/dist/web/public/assets/{persona-BvtcZh6G.js.map → persona-CElXQZ4p.js.map} +1 -1
  203. package/dist/web/public/assets/{plans-i3a6lrqF.js → plans-Bo5LlLeH.js} +3 -8
  204. package/dist/web/public/assets/plans-Bo5LlLeH.js.map +1 -0
  205. package/dist/web/public/assets/{play-CPoE_JnS.js → play-DX5wp4WH.js} +2 -2
  206. package/dist/web/public/assets/{play-CPoE_JnS.js.map → play-DX5wp4WH.js.map} +1 -1
  207. package/dist/web/public/assets/{plus-CfzKV_0u.js → plus-DH4J_YhN.js} +2 -2
  208. package/dist/web/public/assets/{plus-CfzKV_0u.js.map → plus-DH4J_YhN.js.map} +1 -1
  209. package/dist/web/public/assets/policy-BrgOuDt_.js +2 -0
  210. package/dist/web/public/assets/{policy-Cm88P8LO.js.map → policy-BrgOuDt_.js.map} +1 -1
  211. package/dist/web/public/assets/{qr-code-DMkV8nv2.js → qr-code-YrEuhMPC.js} +2 -2
  212. package/dist/web/public/assets/{qr-code-DMkV8nv2.js.map → qr-code-YrEuhMPC.js.map} +1 -1
  213. package/dist/web/public/assets/{refresh-ccw-nBMm5Xal.js → refresh-ccw-DlAd-eTQ.js} +2 -2
  214. package/dist/web/public/assets/{refresh-ccw-nBMm5Xal.js.map → refresh-ccw-DlAd-eTQ.js.map} +1 -1
  215. package/dist/web/public/assets/{reminders-DjEujanC.js → reminders-DBEE0zXG.js} +3 -3
  216. package/dist/web/public/assets/{reminders-DjEujanC.js.map → reminders-DBEE0zXG.js.map} +1 -1
  217. package/dist/web/public/assets/{save-DbrrCFDM.js → save-BDOtZrfp.js} +2 -2
  218. package/dist/web/public/assets/{save-DbrrCFDM.js.map → save-BDOtZrfp.js.map} +1 -1
  219. package/dist/web/public/assets/schedules-DAyhVI8-.js +2 -0
  220. package/dist/web/public/assets/schedules-DAyhVI8-.js.map +1 -0
  221. package/dist/web/public/assets/{search-5q3dkINm.js → search-55mtgHrB.js} +3 -3
  222. package/dist/web/public/assets/{search-5q3dkINm.js.map → search-55mtgHrB.js.map} +1 -1
  223. package/dist/web/public/assets/{search-DbE4VEm9.js → search-CAICU3aU.js} +2 -2
  224. package/dist/web/public/assets/{search-DbE4VEm9.js.map → search-CAICU3aU.js.map} +1 -1
  225. package/dist/web/public/assets/security-CbP4QgVp.js +2 -0
  226. package/dist/web/public/assets/security-CbP4QgVp.js.map +1 -0
  227. package/dist/web/public/assets/server-Dg4e8pvm.js +7 -0
  228. package/dist/web/public/assets/server-Dg4e8pvm.js.map +1 -0
  229. package/dist/web/public/assets/service-gWZa3sup.js +7 -0
  230. package/dist/web/public/assets/service-gWZa3sup.js.map +1 -0
  231. package/dist/web/public/assets/{shield-alert-WOa69jy3.js → shield-alert-DOKK9EnJ.js} +2 -2
  232. package/dist/web/public/assets/{shield-alert-WOa69jy3.js.map → shield-alert-DOKK9EnJ.js.map} +1 -1
  233. package/dist/web/public/assets/sparkles-G0QIs9nP.js +7 -0
  234. package/dist/web/public/assets/sparkles-G0QIs9nP.js.map +1 -0
  235. package/dist/web/public/assets/start-D-abhl3q.js +2 -0
  236. package/dist/web/public/assets/start-D-abhl3q.js.map +1 -0
  237. package/dist/web/public/assets/{status-badge-D5xhwquL.js → status-badge-CyLdpsXq.js} +2 -2
  238. package/dist/web/public/assets/{status-badge-D5xhwquL.js.map → status-badge-CyLdpsXq.js.map} +1 -1
  239. package/dist/web/public/assets/{subtasks-DMRyk6YS.js → subtasks-BnEjSGUR.js} +3 -3
  240. package/dist/web/public/assets/{subtasks-DMRyk6YS.js.map → subtasks-BnEjSGUR.js.map} +1 -1
  241. package/dist/web/public/assets/{table-Dx65w6V0.js → table-sCMZBe_Z.js} +2 -2
  242. package/dist/web/public/assets/{table-Dx65w6V0.js.map → table-sCMZBe_Z.js.map} +1 -1
  243. package/dist/web/public/assets/terminal-_pXeEjXG.js +7 -0
  244. package/dist/web/public/assets/terminal-_pXeEjXG.js.map +1 -0
  245. package/dist/web/public/assets/{topn-L7Juczp3.js → topn-D1B-gS1M.js} +3 -3
  246. package/dist/web/public/assets/{topn-L7Juczp3.js.map → topn-D1B-gS1M.js.map} +1 -1
  247. package/dist/web/public/assets/{trash-2-7xrfqd-v.js → trash-2-D2x2UPuZ.js} +2 -2
  248. package/dist/web/public/assets/{trash-2-7xrfqd-v.js.map → trash-2-D2x2UPuZ.js.map} +1 -1
  249. package/dist/web/public/assets/use-a2a-C98e2Via.js +2 -0
  250. package/dist/web/public/assets/use-a2a-C98e2Via.js.map +1 -0
  251. package/dist/web/public/assets/{use-agim-skills-pFjfgqMF.js → use-agim-skills-BbuJP3NT.js} +2 -2
  252. package/dist/web/public/assets/{use-agim-skills-pFjfgqMF.js.map → use-agim-skills-BbuJP3NT.js.map} +1 -1
  253. package/dist/web/public/assets/use-background-tasks-CwFmOokw.js +2 -0
  254. package/dist/web/public/assets/{use-background-tasks-D1--hHjp.js.map → use-background-tasks-CwFmOokw.js.map} +1 -1
  255. package/dist/web/public/assets/use-jobs-BJjeJ5lh.js +2 -0
  256. package/dist/web/public/assets/use-jobs-BJjeJ5lh.js.map +1 -0
  257. package/dist/web/public/assets/use-memory-CXDwKCco.js +2 -0
  258. package/dist/web/public/assets/{use-memory-Bz1Zao7g.js.map → use-memory-CXDwKCco.js.map} +1 -1
  259. package/dist/web/public/assets/use-observability-CY5ZUPrC.js +2 -0
  260. package/dist/web/public/assets/{use-observability-DtqSWVjM.js.map → use-observability-CY5ZUPrC.js.map} +1 -1
  261. package/dist/web/public/assets/use-outbox-DT_XWB_7.js +7 -0
  262. package/dist/web/public/assets/use-outbox-DT_XWB_7.js.map +1 -0
  263. package/dist/web/public/assets/use-schedules-D4W8fMwo.js +7 -0
  264. package/dist/web/public/assets/use-schedules-D4W8fMwo.js.map +1 -0
  265. package/dist/web/public/assets/use-settings-DGIjmUX0.js +2 -0
  266. package/dist/web/public/assets/use-settings-DGIjmUX0.js.map +1 -0
  267. package/dist/web/public/assets/use-skills-D2bMM580.js +7 -0
  268. package/dist/web/public/assets/use-skills-D2bMM580.js.map +1 -0
  269. package/dist/web/public/assets/use-vector-BYOFwjU0.js +2 -0
  270. package/dist/web/public/assets/use-vector-BYOFwjU0.js.map +1 -0
  271. package/dist/web/public/assets/use-workspace-CuytyHwb.js +2 -0
  272. package/dist/web/public/assets/{use-workspace-CConjEx0.js.map → use-workspace-CuytyHwb.js.map} +1 -1
  273. package/dist/web/public/assets/vector-CL8ezpSR.js +2 -0
  274. package/dist/web/public/assets/vector-CL8ezpSR.js.map +1 -0
  275. package/dist/web/public/assets/viewer-CD0iEfPU.js +7 -0
  276. package/dist/web/public/assets/viewer-CD0iEfPU.js.map +1 -0
  277. package/dist/web/public/assets/workspace-BA1_hso3.js +17 -0
  278. package/dist/web/public/assets/workspace-BA1_hso3.js.map +1 -0
  279. package/dist/web/public/assets/workspaces-DyGLJUgB.js +7 -0
  280. package/dist/web/public/assets/workspaces-DyGLJUgB.js.map +1 -0
  281. package/dist/web/public/index.html +2 -2
  282. package/dist/web/server.d.ts +0 -3
  283. package/dist/web/server.d.ts.map +1 -1
  284. package/dist/web/server.js +138 -3
  285. package/dist/web/server.js.map +1 -1
  286. package/package.json +1 -1
  287. package/dist/web/public/assets/a2a-D7MoJ1iT.js +0 -7
  288. package/dist/web/public/assets/a2a-D7MoJ1iT.js.map +0 -1
  289. package/dist/web/public/assets/agents-BXThDW6f.js +0 -7
  290. package/dist/web/public/assets/bgjobs-Rc05aEy9.js +0 -7
  291. package/dist/web/public/assets/bgjobs-Rc05aEy9.js.map +0 -1
  292. package/dist/web/public/assets/chat-DQpQLW9j.js +0 -17
  293. package/dist/web/public/assets/chat-DQpQLW9j.js.map +0 -1
  294. package/dist/web/public/assets/circle-check-DZnkaUdk.js +0 -7
  295. package/dist/web/public/assets/circle-check-DZnkaUdk.js.map +0 -1
  296. package/dist/web/public/assets/confirm-dialog-gPKJnvEW.js +0 -2
  297. package/dist/web/public/assets/health-wqCp-K_o.js +0 -2
  298. package/dist/web/public/assets/hot-B-CMjQIr.js +0 -12
  299. package/dist/web/public/assets/index-DHh1LYlA.js +0 -209
  300. package/dist/web/public/assets/index-DHh1LYlA.js.map +0 -1
  301. package/dist/web/public/assets/index-DknVjPYB.css +0 -1
  302. package/dist/web/public/assets/installed-Cet-1M2Q.js.map +0 -1
  303. package/dist/web/public/assets/jobs-CfEzOOAC.js +0 -2
  304. package/dist/web/public/assets/jobs-CfEzOOAC.js.map +0 -1
  305. package/dist/web/public/assets/layout-BX43KyXM.js +0 -2
  306. package/dist/web/public/assets/layout-BX43KyXM.js.map +0 -1
  307. package/dist/web/public/assets/layout-BcYZlaqf.js +0 -2
  308. package/dist/web/public/assets/layout-BcYZlaqf.js.map +0 -1
  309. package/dist/web/public/assets/layout-Cb7looUv.js +0 -2
  310. package/dist/web/public/assets/layout-Cb7looUv.js.map +0 -1
  311. package/dist/web/public/assets/layout-D7xH78OU.js +0 -2
  312. package/dist/web/public/assets/layout-D7xH78OU.js.map +0 -1
  313. package/dist/web/public/assets/llm-BZ9qqp-D.js +0 -27
  314. package/dist/web/public/assets/llm-BZ9qqp-D.js.map +0 -1
  315. package/dist/web/public/assets/loader-circle-DgdBWYl0.js +0 -7
  316. package/dist/web/public/assets/memos-BBtqFcoH.js +0 -12
  317. package/dist/web/public/assets/memos-BBtqFcoH.js.map +0 -1
  318. package/dist/web/public/assets/messengers-i7WvNT3o.js +0 -2
  319. package/dist/web/public/assets/messengers-i7WvNT3o.js.map +0 -1
  320. package/dist/web/public/assets/outbox-BbfC5kuG.js +0 -7
  321. package/dist/web/public/assets/outbox-BbfC5kuG.js.map +0 -1
  322. package/dist/web/public/assets/persona-BvtcZh6G.js +0 -2
  323. package/dist/web/public/assets/plans-i3a6lrqF.js.map +0 -1
  324. package/dist/web/public/assets/policy-Cm88P8LO.js +0 -2
  325. package/dist/web/public/assets/schedules-DzwDWykc.js +0 -7
  326. package/dist/web/public/assets/schedules-DzwDWykc.js.map +0 -1
  327. package/dist/web/public/assets/security-BIcnUrAs.js +0 -2
  328. package/dist/web/public/assets/security-BIcnUrAs.js.map +0 -1
  329. package/dist/web/public/assets/service-CnorFHzZ.js +0 -7
  330. package/dist/web/public/assets/service-CnorFHzZ.js.map +0 -1
  331. package/dist/web/public/assets/use-background-tasks-D1--hHjp.js +0 -2
  332. package/dist/web/public/assets/use-memory-Bz1Zao7g.js +0 -2
  333. package/dist/web/public/assets/use-observability-DtqSWVjM.js +0 -2
  334. package/dist/web/public/assets/use-settings-DKbDqCEJ.js +0 -2
  335. package/dist/web/public/assets/use-settings-DKbDqCEJ.js.map +0 -1
  336. package/dist/web/public/assets/use-workspace-CConjEx0.js +0 -2
  337. package/dist/web/public/assets/vector-D8sEa2W-.js +0 -2
  338. package/dist/web/public/assets/vector-D8sEa2W-.js.map +0 -1
  339. package/dist/web/public/assets/viewer-aSIjAKVA.js +0 -12
  340. package/dist/web/public/assets/viewer-aSIjAKVA.js.map +0 -1
  341. package/dist/web/public/assets/workspace-BqwWoinI.js +0 -17
  342. package/dist/web/public/assets/workspace-BqwWoinI.js.map +0 -1
  343. package/dist/web/public/assets/workspaces-ChsJcrav.js +0 -7
  344. package/dist/web/public/assets/workspaces-ChsJcrav.js.map +0 -1
@@ -0,0 +1,244 @@
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/browser-ponyfill-DBWdeCTC.js","assets/react-DlP5eolq.js","assets/dashboard-CG3WiG7h.js","assets/use-settings-DGIjmUX0.js","assets/use-workspace-CuytyHwb.js","assets/database-lQzk64rV.js","assets/server-Dg4e8pvm.js","assets/clipboard-list-lnqdk2_J.js","assets/refresh-ccw-DlAd-eTQ.js","assets/arrow-right-A889Wof8.js","assets/loader-circle-DDdmcH0k.js","assets/layout-DsZ8eR4i.js","assets/overview-COop5K2Y.js","assets/use-a2a-C98e2Via.js","assets/use-background-tasks-CwFmOokw.js","assets/use-jobs-BJjeJ5lh.js","assets/use-outbox-DT_XWB_7.js","assets/use-schedules-D4W8fMwo.js","assets/jobs-Biy5lYd4.js","assets/data-table-BkUshOZz.js","assets/table-sCMZBe_Z.js","assets/empty-state-CuiqdZiB.js","assets/arrow-up-Dm0U4-6U.js","assets/arrow-down-7i0xwCI2.js","assets/status-badge-CyLdpsXq.js","assets/pagination-BBicLzXP.js","assets/chevron-left-01fAFVpo.js","assets/chevron-right-CFRb-SM_.js","assets/confirm-dialog-BDb0NLny.js","assets/use-event-stream-I1lMFEfh.js","assets/circle-x-CqFMzO-x.js","assets/briefcase-CeKUkFSq.js","assets/subtasks-BnEjSGUR.js","assets/bgjobs-CcRiffyJ.js","assets/terminal-_pXeEjXG.js","assets/schedules-DAyhVI8-.js","assets/outbox-CEE0rwN3.js","assets/a2a-CTsDMefo.js","assets/heartbeat-ClO5gJrj.js","assets/heart-pulse-DXlE9oic.js","assets/play-DX5wp4WH.js","assets/goals-C8ZQfbhj.js","assets/asks-DGuBsrJ7.js","assets/plans-Bo5LlLeH.js","assets/clock-4hd1joQe.js","assets/approvals-DOWlWI7Z.js","assets/reminders-DBEE0zXG.js","assets/bell-B-UdeJsp.js","assets/memos-DAt4k3DO.js","assets/dropdown-menu-BNH5SrVb.js","assets/trash-2-D2x2UPuZ.js","assets/search-CAICU3aU.js","assets/map-pin-C_jAxukI.js","assets/layout-Bm-2s2fp.js","assets/use-memory-CXDwKCco.js","assets/overview-DeH5ud6d.js","assets/use-vector-BYOFwjU0.js","assets/brain-Dl4DF5kX.js","assets/sparkles-G0QIs9nP.js","assets/file-text-BxfdLM0-.js","assets/facts-xT_24pH8.js","assets/persona-CElXQZ4p.js","assets/circle-check-big-DBg2BD6o.js","assets/distill-CPurVW3v.js","assets/save-BDOtZrfp.js","assets/vector-CL8ezpSR.js","assets/eye-BfPyNFzk.js","assets/download-CVZnHcwj.js","assets/workspace-BA1_hso3.js","assets/book-open-CSCq5cjL.js","assets/layout-sxvovjEH.js","assets/health-A2StNEfn.js","assets/use-observability-CY5ZUPrC.js","assets/activity-ul8Os7Pz.js","assets/topn-D1B-gS1M.js","assets/audit-BRXsplJ2.js","assets/layout-BTKafRVZ.js","assets/start-D-abhl3q.js","assets/messengers-GYVTFlAj.js","assets/qr-code-YrEuhMPC.js","assets/email-YlI4MWLp.js","assets/viewer-CD0iEfPU.js","assets/external-link-1WPpVvdu.js","assets/agents-Ds1zyxBj.js","assets/network-BUeWK3bs.js","assets/plus-DH4J_YhN.js","assets/policy-BrgOuDt_.js","assets/security-CbP4QgVp.js","assets/shield-alert-DOKK9EnJ.js","assets/service-gWZa3sup.js","assets/copy-CD4A7VD8.js","assets/admins-ByMAuquy.js","assets/workspaces-DyGLJUgB.js","assets/llm-JjZDbBvJ.js","assets/mcp-vKajK1F8.js","assets/search-55mtgHrB.js","assets/mobile-VUyTo40E.js","assets/layout-BLm6NJ3V.js","assets/overview-BSOZ5gTD.js","assets/use-agim-skills-BbuJP3NT.js","assets/use-skills-D2bMM580.js","assets/installed-DL6r3ktm.js","assets/hot-bfTA-V_z.js","assets/injection-omvCR6-p.js","assets/chat-rLJMdJBk.js"])))=>i.map(i=>d[i]);
2
+ import{r as y,a as Tr,R as Ir,b as Cm,c as K,v as Em,d as Zi,g as Sd}from"./react-DlP5eolq.js";(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const i of document.querySelectorAll('link[rel="modulepreload"]'))r(i);new MutationObserver(i=>{for(const o of i)if(o.type==="childList")for(const a of o.addedNodes)a.tagName==="LINK"&&a.rel==="modulepreload"&&r(a)}).observe(document,{childList:!0,subtree:!0});function n(i){const o={};return i.integrity&&(o.integrity=i.integrity),i.referrerPolicy&&(o.referrerPolicy=i.referrerPolicy),i.crossOrigin==="use-credentials"?o.credentials="include":i.crossOrigin==="anonymous"?o.credentials="omit":o.credentials="same-origin",o}function r(i){if(i.ep)return;i.ep=!0;const o=n(i);fetch(i.href,o)}})();var Ad={exports:{}},Co={};/**
3
+ * @license React
4
+ * react-jsx-runtime.production.min.js
5
+ *
6
+ * Copyright (c) Facebook, Inc. and its affiliates.
7
+ *
8
+ * This source code is licensed under the MIT license found in the
9
+ * LICENSE file in the root directory of this source tree.
10
+ */var Rm=y,Pm=Symbol.for("react.element"),Tm=Symbol.for("react.fragment"),Im=Object.prototype.hasOwnProperty,Lm=Rm.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,Om={key:!0,ref:!0,__self:!0,__source:!0};function Cd(e,t,n){var r,i={},o=null,a=null;n!==void 0&&(o=""+n),t.key!==void 0&&(o=""+t.key),t.ref!==void 0&&(a=t.ref);for(r in t)Im.call(t,r)&&!Om.hasOwnProperty(r)&&(i[r]=t[r]);if(e&&e.defaultProps)for(r in t=e.defaultProps,t)i[r]===void 0&&(i[r]=t[r]);return{$$typeof:Pm,type:e,key:o,ref:a,props:i,_owner:Lm.current}}Co.Fragment=Tm;Co.jsx=Cd;Co.jsxs=Cd;Ad.exports=Co;var g=Ad.exports,La={},Ll=Tr;La.createRoot=Ll.createRoot,La.hydrateRoot=Ll.hydrateRoot;const Dm="modulepreload",Nm=function(e){return"/"+e},Ol={},se=function(t,n,r){let i=Promise.resolve();if(n&&n.length>0){document.getElementsByTagName("link");const a=document.querySelector("meta[property=csp-nonce]"),s=a?.nonce||a?.getAttribute("nonce");i=Promise.allSettled(n.map(l=>{if(l=Nm(l),l in Ol)return;Ol[l]=!0;const c=l.endsWith(".css"),u=c?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${l}"]${u}`))return;const d=document.createElement("link");if(d.rel=c?"stylesheet":Dm,c||(d.as="script"),d.crossOrigin="",d.href=l,s&&d.setAttribute("nonce",s),document.head.appendChild(d),c)return new Promise((h,f)=>{d.addEventListener("load",h),d.addEventListener("error",()=>f(new Error(`Unable to preload CSS for ${l}`)))})}))}function o(a){const s=new Event("vite:preloadError",{cancelable:!0});if(s.payload=a,window.dispatchEvent(s),!s.defaultPrevented)throw a}return i.then(a=>{for(const s of a||[])s.status==="rejected"&&o(s.reason);return t().catch(o)})};/**
11
+ * @remix-run/router v1.23.3
12
+ *
13
+ * Copyright (c) Remix Software Inc.
14
+ *
15
+ * This source code is licensed under the MIT license found in the
16
+ * LICENSE.md file in the root directory of this source tree.
17
+ *
18
+ * @license MIT
19
+ */function Be(){return Be=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Be.apply(null,arguments)}var Je;(function(e){e.Pop="POP",e.Push="PUSH",e.Replace="REPLACE"})(Je||(Je={}));const Dl="popstate";function Mm(e){e===void 0&&(e={});function t(r,i){let{pathname:o,search:a,hash:s}=r.location;return si("",{pathname:o,search:a,hash:s},i.state&&i.state.usr||null,i.state&&i.state.key||"default")}function n(r,i){return typeof i=="string"?i:Yn(i)}return jm(t,n,null,e)}function we(e,t){if(e===!1||e===null||typeof e>"u")throw new Error(t)}function Qn(e,t){if(!e){typeof console<"u"&&console.warn(t);try{throw new Error(t)}catch{}}}function _m(){return Math.random().toString(36).substr(2,8)}function Nl(e,t){return{usr:e.state,key:e.key,idx:t}}function si(e,t,n,r){return n===void 0&&(n=null),Be({pathname:typeof e=="string"?e:e.pathname,search:"",hash:""},typeof t=="string"?En(t):t,{state:n,key:t&&t.key||r||_m()})}function Yn(e){let{pathname:t="/",search:n="",hash:r=""}=e;return n&&n!=="?"&&(t+=n.charAt(0)==="?"?n:"?"+n),r&&r!=="#"&&(t+=r.charAt(0)==="#"?r:"#"+r),t}function En(e){let t={};if(e){let n=e.indexOf("#");n>=0&&(t.hash=e.substr(n),e=e.substr(0,n));let r=e.indexOf("?");r>=0&&(t.search=e.substr(r),e=e.substr(0,r)),e&&(t.pathname=e)}return t}function jm(e,t,n,r){r===void 0&&(r={});let{window:i=document.defaultView,v5Compat:o=!1}=r,a=i.history,s=Je.Pop,l=null,c=u();c==null&&(c=0,a.replaceState(Be({},a.state,{idx:c}),""));function u(){return(a.state||{idx:null}).idx}function d(){s=Je.Pop;let b=u(),v=b==null?null:b-c;c=b,l&&l({action:s,location:p.location,delta:v})}function h(b,v){s=Je.Push;let x=si(p.location,b,v);c=u()+1;let w=Nl(x,c),E=p.createHref(x);try{a.pushState(w,"",E)}catch(T){if(T instanceof DOMException&&T.name==="DataCloneError")throw T;i.location.assign(E)}o&&l&&l({action:s,location:p.location,delta:1})}function f(b,v){s=Je.Replace;let x=si(p.location,b,v);c=u();let w=Nl(x,c),E=p.createHref(x);a.replaceState(w,"",E),o&&l&&l({action:s,location:p.location,delta:0})}function m(b){let v=i.location.origin!=="null"?i.location.origin:i.location.href,x=typeof b=="string"?b:Yn(b);return x=x.replace(/ $/,"%20"),we(v,"No window.location.(origin|href) available to create URL for href: "+x),new URL(x,v)}let p={get action(){return s},get location(){return e(i,a)},listen(b){if(l)throw new Error("A history only accepts one active listener");return i.addEventListener(Dl,d),l=b,()=>{i.removeEventListener(Dl,d),l=null}},createHref(b){return t(i,b)},createURL:m,encodeLocation(b){let v=m(b);return{pathname:v.pathname,search:v.search,hash:v.hash}},push:h,replace:f,go(b){return a.go(b)}};return p}var Ne;(function(e){e.data="data",e.deferred="deferred",e.redirect="redirect",e.error="error"})(Ne||(Ne={}));const Fm=new Set(["lazy","caseSensitive","path","id","index","children"]);function Hm(e){return e.index===!0}function eo(e,t,n,r){return n===void 0&&(n=[]),r===void 0&&(r={}),e.map((i,o)=>{let a=[...n,String(o)],s=typeof i.id=="string"?i.id:a.join("-");if(we(i.index!==!0||!i.children,"Cannot specify children on an index route"),we(!r[s],'Found a route id collision on id "'+s+`". Route id's must be globally unique within Data Router usages`),Hm(i)){let l=Be({},i,t(i),{id:s});return r[s]=l,l}else{let l=Be({},i,t(i),{id:s,children:void 0});return r[s]=l,i.children&&(l.children=eo(i.children,t,a,r)),l}})}function Bn(e,t,n){return n===void 0&&(n="/"),Ki(e,t,n,!1)}function Ki(e,t,n,r){let i=typeof t=="string"?En(t):t,o=rn(i.pathname||"/",n);if(o==null)return null;let a=Ed(e);Bm(a);let s=null,l=Jm(o);for(let c=0;s==null&&c<a.length;++c)s=Ym(a[c],l,r);return s}function Um(e,t){let{route:n,pathname:r,params:i}=e;return{id:n.id,pathname:r,params:i,data:t[n.id],handle:n.handle}}function Ed(e,t,n,r){t===void 0&&(t=[]),n===void 0&&(n=[]),r===void 0&&(r="");let i=(o,a,s)=>{let l={relativePath:s===void 0?o.path||"":s,caseSensitive:o.caseSensitive===!0,childrenIndex:a,route:o};l.relativePath.startsWith("/")&&(we(l.relativePath.startsWith(r),'Absolute route path "'+l.relativePath+'" nested under path '+('"'+r+'" is not valid. An absolute child route path ')+"must start with the combined path of all its parent routes."),l.relativePath=l.relativePath.slice(r.length));let c=nn([r,l.relativePath]),u=n.concat(l);o.children&&o.children.length>0&&(we(o.index!==!0,"Index routes must not have child routes. Please remove "+('all child routes from route path "'+c+'".')),Ed(o.children,t,u,c)),!(o.path==null&&!o.index)&&t.push({path:c,score:Gm(c,o.index),routesMeta:u})};return e.forEach((o,a)=>{var s;if(o.path===""||!((s=o.path)!=null&&s.includes("?")))i(o,a);else for(let l of Rd(o.path))i(o,a,l)}),t}function Rd(e){let t=e.split("/");if(t.length===0)return[];let[n,...r]=t,i=n.endsWith("?"),o=n.replace(/\?$/,"");if(r.length===0)return i?[o,""]:[o];let a=Rd(r.join("/")),s=[];return s.push(...a.map(l=>l===""?o:[o,l].join("/"))),i&&s.push(...a),s.map(l=>e.startsWith("/")&&l===""?"/":l)}function Bm(e){e.sort((t,n)=>t.score!==n.score?n.score-t.score:Qm(t.routesMeta.map(r=>r.childrenIndex),n.routesMeta.map(r=>r.childrenIndex)))}const zm=/^:[\w-]+$/,$m=3,Vm=2,Wm=1,Km=10,qm=-2,Ml=e=>e==="*";function Gm(e,t){let n=e.split("/"),r=n.length;return n.some(Ml)&&(r+=qm),t&&(r+=Vm),n.filter(i=>!Ml(i)).reduce((i,o)=>i+(zm.test(o)?$m:o===""?Wm:Km),r)}function Qm(e,t){return e.length===t.length&&e.slice(0,-1).every((r,i)=>r===t[i])?e[e.length-1]-t[t.length-1]:0}function Ym(e,t,n){n===void 0&&(n=!1);let{routesMeta:r}=e,i={},o="/",a=[];for(let s=0;s<r.length;++s){let l=r[s],c=s===r.length-1,u=o==="/"?t:t.slice(o.length)||"/",d=to({path:l.relativePath,caseSensitive:l.caseSensitive,end:c},u),h=l.route;if(!d&&c&&n&&!r[r.length-1].route.index&&(d=to({path:l.relativePath,caseSensitive:l.caseSensitive,end:!1},u)),!d)return null;Object.assign(i,d.params),a.push({params:i,pathname:nn([o,d.pathname]),pathnameBase:ng(nn([o,d.pathnameBase])),route:h}),d.pathnameBase!=="/"&&(o=nn([o,d.pathnameBase]))}return a}function to(e,t){typeof e=="string"&&(e={path:e,caseSensitive:!1,end:!0});let[n,r]=Xm(e.path,e.caseSensitive,e.end),i=t.match(n);if(!i)return null;let o=i[0],a=o.replace(/(.)\/+$/,"$1"),s=i.slice(1);return{params:r.reduce((c,u,d)=>{let{paramName:h,isOptional:f}=u;if(h==="*"){let p=s[d]||"";a=o.slice(0,o.length-p.length).replace(/(.)\/+$/,"$1")}const m=s[d];return f&&!m?c[h]=void 0:c[h]=(m||"").replace(/%2F/g,"/"),c},{}),pathname:o,pathnameBase:a,pattern:e}}function Xm(e,t,n){t===void 0&&(t=!1),n===void 0&&(n=!0),Qn(e==="*"||!e.endsWith("*")||e.endsWith("/*"),'Route path "'+e+'" will be treated as if it were '+('"'+e.replace(/\*$/,"/*")+'" because the `*` character must ')+"always follow a `/` in the pattern. To get rid of this warning, "+('please change the route path to "'+e.replace(/\*$/,"/*")+'".'));let r=[],i="^"+e.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(a,s,l)=>(r.push({paramName:s,isOptional:l!=null}),l?"/?([^\\/]+)?":"/([^\\/]+)"));return e.endsWith("*")?(r.push({paramName:"*"}),i+=e==="*"||e==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):n?i+="\\/*$":e!==""&&e!=="/"&&(i+="(?:(?=\\/|$))"),[new RegExp(i,t?void 0:"i"),r]}function Jm(e){try{return e.split("/").map(t=>decodeURIComponent(t).replace(/\//g,"%2F")).join("/")}catch(t){return Qn(!1,'The URL path "'+e+'" could not be decoded because it is is a malformed URL segment. This is probably due to a bad percent '+("encoding ("+t+").")),e}}function rn(e,t){if(t==="/")return e;if(!e.toLowerCase().startsWith(t.toLowerCase()))return null;let n=t.endsWith("/")?t.length-1:t.length,r=e.charAt(n);return r&&r!=="/"?null:e.slice(n)||"/"}const Zm=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,eg=e=>Zm.test(e);function tg(e,t){t===void 0&&(t="/");let{pathname:n,search:r="",hash:i=""}=typeof e=="string"?En(e):e,o;if(n)if(eg(n))o=n;else{if(n.includes("//")){let a=n;n=Ss(n),Qn(!1,"Pathnames cannot have embedded double slashes - normalizing "+(a+" -> "+n))}n.startsWith("/")?o=_l(n.substring(1),"/"):o=_l(n,t)}else o=t;return{pathname:o,search:rg(r),hash:ig(i)}}function _l(e,t){let n=t.replace(/\/+$/,"").split("/");return e.split("/").forEach(i=>{i===".."?n.length>1&&n.pop():i!=="."&&n.push(i)}),n.length>1?n.join("/"):"/"}function ea(e,t,n,r){return"Cannot include a '"+e+"' character in a manually specified "+("`to."+t+"` field ["+JSON.stringify(r)+"]. Please separate it out to the ")+("`to."+n+"` field. Alternatively you may provide the full path as ")+'a string in <Link to="..."> and the router will parse it for you.'}function Pd(e){return e.filter((t,n)=>n===0||t.route.path&&t.route.path.length>0)}function Eo(e,t){let n=Pd(e);return t?n.map((r,i)=>i===n.length-1?r.pathname:r.pathnameBase):n.map(r=>r.pathnameBase)}function Ro(e,t,n,r){r===void 0&&(r=!1);let i;typeof e=="string"?i=En(e):(i=Be({},e),we(!i.pathname||!i.pathname.includes("?"),ea("?","pathname","search",i)),we(!i.pathname||!i.pathname.includes("#"),ea("#","pathname","hash",i)),we(!i.search||!i.search.includes("#"),ea("#","search","hash",i)));let o=e===""||i.pathname==="",a=o?"/":i.pathname,s;if(a==null)s=n;else{let d=t.length-1;if(!r&&a.startsWith("..")){let h=a.split("/");for(;h[0]==="..";)h.shift(),d-=1;i.pathname=h.join("/")}s=d>=0?t[d]:"/"}let l=tg(i,s),c=a&&a!=="/"&&a.endsWith("/"),u=(o||a===".")&&n.endsWith("/");return!l.pathname.endsWith("/")&&(c||u)&&(l.pathname+="/"),l}const Ss=e=>e.replace(/\/\/+/g,"/"),nn=e=>Ss(e.join("/")),ng=e=>e.replace(/\/+$/,"").replace(/^\/*/,"/"),rg=e=>!e||e==="?"?"":e.startsWith("?")?e:"?"+e,ig=e=>!e||e==="#"?"":e.startsWith("#")?e:"#"+e;class no{constructor(t,n,r,i){i===void 0&&(i=!1),this.status=t,this.statusText=n||"",this.internal=i,r instanceof Error?(this.data=r.toString(),this.error=r):this.data=r}}function li(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.internal=="boolean"&&"data"in e}const Td=["post","put","patch","delete"],og=new Set(Td),ag=["get",...Td],sg=new Set(ag),lg=new Set([301,302,303,307,308]),cg=new Set([307,308]),ta={state:"idle",location:void 0,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0},ug={state:"idle",data:void 0,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0},Vr={state:"unblocked",proceed:void 0,reset:void 0,location:void 0},As=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,dg=e=>({hasErrorBoundary:!!e.hasErrorBoundary}),Id="remix-router-transitions";function fg(e){const t=e.window?e.window:typeof window<"u"?window:void 0,n=typeof t<"u"&&typeof t.document<"u"&&typeof t.document.createElement<"u",r=!n;we(e.routes.length>0,"You must provide a non-empty routes array to createRouter");let i;if(e.mapRouteProperties)i=e.mapRouteProperties;else if(e.detectErrorBoundary){let P=e.detectErrorBoundary;i=I=>({hasErrorBoundary:P(I)})}else i=dg;let o={},a=eo(e.routes,i,void 0,o),s,l=e.basename||"/",c=e.dataStrategy||gg,u=e.patchRoutesOnNavigation,d=Be({v7_fetcherPersist:!1,v7_normalizeFormMethod:!1,v7_partialHydration:!1,v7_prependBasename:!1,v7_relativeSplatPath:!1,v7_skipActionErrorRevalidation:!1},e.future),h=null,f=new Set,m=null,p=null,b=null,v=e.hydrationData!=null,x=Bn(a,e.history.location,l),w=!1,E=null;if(x==null&&!u){let P=gt(404,{pathname:e.history.location.pathname}),{matches:I,route:N}=ql(a);x=I,E={[N.id]:P}}x&&!e.hydrationData&&De(x,a,e.history.location.pathname).active&&(x=null);let T;if(x)if(x.some(P=>P.route.lazy))T=!1;else if(!x.some(P=>P.route.loader))T=!0;else if(d.v7_partialHydration){let P=e.hydrationData?e.hydrationData.loaderData:null,I=e.hydrationData?e.hydrationData.errors:null;if(I){let N=x.findIndex(j=>I[j.route.id]!==void 0);T=x.slice(0,N+1).every(j=>!Da(j.route,P,I))}else T=x.every(N=>!Da(N.route,P,I))}else T=e.hydrationData!=null;else if(T=!1,x=[],d.v7_partialHydration){let P=De(null,a,e.history.location.pathname);P.active&&P.matches&&(w=!0,x=P.matches)}let S,k={historyAction:e.history.action,location:e.history.location,matches:x,initialized:T,navigation:ta,restoreScrollPosition:e.hydrationData!=null?!1:null,preventScrollReset:!1,revalidation:"idle",loaderData:e.hydrationData&&e.hydrationData.loaderData||{},actionData:e.hydrationData&&e.hydrationData.actionData||null,errors:e.hydrationData&&e.hydrationData.errors||E,fetchers:new Map,blockers:new Map},O=Je.Pop,_=!1,R,D=!1,L=new Map,z=null,H=!1,V=!1,Q=[],Y=new Set,W=new Map,F=0,A=-1,ie=new Map,Z=new Set,C=new Map,ae=new Map,pe=new Set,ve=new Map,q=new Map,me;function Te(){if(h=e.history.listen(P=>{let{action:I,location:N,delta:j}=P;if(me){me(),me=void 0;return}Qn(q.size===0||j!=null,"You are trying to use a blocker on a POP navigation to a location that was not created by @remix-run/router. This will fail silently in production. This can happen if you are navigating outside the router via `window.history.pushState`/`window.location.hash` instead of using router navigation APIs. This can also happen if you are using createHashRouter and the user manually changes the URL.");let G=Hr({currentLocation:k.location,nextLocation:N,historyAction:I});if(G&&j!=null){let re=new Promise(ce=>{me=ce});e.history.go(j*-1),Mn(G,{state:"blocked",location:N,proceed(){Mn(G,{state:"proceeding",proceed:void 0,reset:void 0,location:N}),re.then(()=>e.history.go(j))},reset(){let ce=new Map(k.blockers);ce.set(G,Vr),he({blockers:ce})}});return}return at(I,N)}),n){Ig(t,L);let P=()=>Lg(t,L);t.addEventListener("pagehide",P),z=()=>t.removeEventListener("pagehide",P)}return k.initialized||at(Je.Pop,k.location,{initialHydration:!0}),S}function xe(){h&&h(),z&&z(),f.clear(),R&&R.abort(),k.fetchers.forEach((P,I)=>nt(I)),k.blockers.forEach((P,I)=>pt(I))}function Se(P){return f.add(P),()=>f.delete(P)}function he(P,I){I===void 0&&(I={}),k=Be({},k,P);let N=[],j=[];d.v7_fetcherPersist&&k.fetchers.forEach((G,re)=>{G.state==="idle"&&(pe.has(re)?j.push(re):N.push(re))}),pe.forEach(G=>{!k.fetchers.has(G)&&!W.has(G)&&j.push(G)}),[...f].forEach(G=>G(k,{deletedFetchers:j,viewTransitionOpts:I.viewTransitionOpts,flushSync:I.flushSync===!0})),d.v7_fetcherPersist?(N.forEach(G=>k.fetchers.delete(G)),j.forEach(G=>nt(G))):j.forEach(G=>pe.delete(G))}function Ge(P,I,N){var j,G;let{flushSync:re}=N===void 0?{}:N,ce=k.actionData!=null&&k.navigation.formMethod!=null&&Dt(k.navigation.formMethod)&&k.navigation.state==="loading"&&((j=P.state)==null?void 0:j._isRedirect)!==!0,J;I.actionData?Object.keys(I.actionData).length>0?J=I.actionData:J=null:ce?J=k.actionData:J=null;let ee=I.loaderData?Wl(k.loaderData,I.loaderData,I.matches||[],I.errors):k.loaderData,X=k.blockers;X.size>0&&(X=new Map(X),X.forEach((Ee,st)=>X.set(st,Vr)));let te=_===!0||k.navigation.formMethod!=null&&Dt(k.navigation.formMethod)&&((G=P.state)==null?void 0:G._isRedirect)!==!0;s&&(a=s,s=void 0),H||O===Je.Pop||(O===Je.Push?e.history.push(P,P.state):O===Je.Replace&&e.history.replace(P,P.state));let ge;if(O===Je.Pop){let Ee=L.get(k.location.pathname);Ee&&Ee.has(P.pathname)?ge={currentLocation:k.location,nextLocation:P}:L.has(P.pathname)&&(ge={currentLocation:P,nextLocation:k.location})}else if(D){let Ee=L.get(k.location.pathname);Ee?Ee.add(P.pathname):(Ee=new Set([P.pathname]),L.set(k.location.pathname,Ee)),ge={currentLocation:k.location,nextLocation:P}}he(Be({},I,{actionData:J,loaderData:ee,historyAction:O,location:P,initialized:!0,navigation:ta,revalidation:"idle",restoreScrollPosition:Ie(P,I.matches||k.matches),preventScrollReset:te,blockers:X}),{viewTransitionOpts:ge,flushSync:re===!0}),O=Je.Pop,_=!1,D=!1,H=!1,V=!1,Q=[]}async function Ze(P,I){if(typeof P=="number"){e.history.go(P);return}let N=Oa(k.location,k.matches,l,d.v7_prependBasename,P,d.v7_relativeSplatPath,I?.fromRouteId,I?.relative),{path:j,submission:G,error:re}=jl(d.v7_normalizeFormMethod,!1,N,I),ce=k.location,J=si(k.location,j,I&&I.state);J=Be({},J,e.history.encodeLocation(J));let ee=I&&I.replace!=null?I.replace:void 0,X=Je.Push;ee===!0?X=Je.Replace:ee===!1||G!=null&&Dt(G.formMethod)&&G.formAction===k.location.pathname+k.location.search&&(X=Je.Replace);let te=I&&"preventScrollReset"in I?I.preventScrollReset===!0:void 0,ge=(I&&I.flushSync)===!0,Ee=Hr({currentLocation:ce,nextLocation:J,historyAction:X});if(Ee){Mn(Ee,{state:"blocked",location:J,proceed(){Mn(Ee,{state:"proceeding",proceed:void 0,reset:void 0,location:J}),Ze(P,I)},reset(){let st=new Map(k.blockers);st.set(Ee,Vr),he({blockers:st})}});return}return await at(X,J,{submission:G,pendingError:re,preventScrollReset:te,replace:I&&I.replace,enableViewTransition:I&&I.viewTransition,flushSync:ge})}function Ft(){if(B(),he({revalidation:"loading"}),k.navigation.state!=="submitting"){if(k.navigation.state==="idle"){at(k.historyAction,k.location,{startUninterruptedRevalidation:!0});return}at(O||k.historyAction,k.navigation.location,{overrideNavigation:k.navigation,enableViewTransition:D===!0})}}async function at(P,I,N){R&&R.abort(),R=null,O=P,H=(N&&N.startUninterruptedRevalidation)===!0,ue(k.location,k.matches),_=(N&&N.preventScrollReset)===!0,D=(N&&N.enableViewTransition)===!0;let j=s||a,G=N&&N.overrideNavigation,re=N!=null&&N.initialHydration&&k.matches&&k.matches.length>0&&!w?k.matches:Bn(j,I,l),ce=(N&&N.flushSync)===!0;if(re&&k.initialized&&!V&&kg(k.location,I)&&!(N&&N.submission&&Dt(N.submission.formMethod))){Ge(I,{matches:re},{flushSync:ce});return}let J=De(re,j,I.pathname);if(J.active&&J.matches&&(re=J.matches),!re){let{error:Fe,notFoundMatches:Le,route:We}=Ur(I.pathname);Ge(I,{matches:Le,loaderData:{},errors:{[We.id]:Fe}},{flushSync:ce});return}R=new AbortController;let ee=lr(e.history,I,R.signal,N&&N.submission),X;if(N&&N.pendingError)X=[zn(re).route.id,{type:Ne.error,error:N.pendingError}];else if(N&&N.submission&&Dt(N.submission.formMethod)){let Fe=await Ht(ee,I,N.submission,re,J.active,{replace:N.replace,flushSync:ce});if(Fe.shortCircuited)return;if(Fe.pendingActionResult){let[Le,We]=Fe.pendingActionResult;if(wt(We)&&li(We.error)&&We.error.status===404){R=null,Ge(I,{matches:Fe.matches,loaderData:{},errors:{[Le]:We.error}});return}}re=Fe.matches||re,X=Fe.pendingActionResult,G=na(I,N.submission),ce=!1,J.active=!1,ee=lr(e.history,ee.url,ee.signal)}let{shortCircuited:te,matches:ge,loaderData:Ee,errors:st}=await On(ee,I,re,J.active,G,N&&N.submission,N&&N.fetcherSubmission,N&&N.replace,N&&N.initialHydration===!0,ce,X);te||(R=null,Ge(I,Be({matches:ge||re},Kl(X),{loaderData:Ee,errors:st})))}async function Ht(P,I,N,j,G,re){re===void 0&&(re={}),B();let ce=Pg(I,N);if(he({navigation:ce},{flushSync:re.flushSync===!0}),G){let X=await lt(j,I.pathname,P.signal);if(X.type==="aborted")return{shortCircuited:!0};if(X.type==="error"){let te=zn(X.partialMatches).route.id;return{matches:X.partialMatches,pendingActionResult:[te,{type:Ne.error,error:X.error}]}}else if(X.matches)j=X.matches;else{let{notFoundMatches:te,error:ge,route:Ee}=Ur(I.pathname);return{matches:te,pendingActionResult:[Ee.id,{type:Ne.error,error:ge}]}}}let J,ee=ei(j,I);if(!ee.route.action&&!ee.route.lazy)J={type:Ne.error,error:gt(405,{method:P.method,pathname:I.pathname,routeId:ee.route.id})};else if(J=(await Zt("action",k,P,[ee],j,null))[ee.route.id],P.signal.aborted)return{shortCircuited:!0};if(Wn(J)){let X;return re&&re.replace!=null?X=re.replace:X=zl(J.response.headers.get("Location"),new URL(P.url),l,e.history)===k.location.pathname+k.location.search,await Tt(P,J,!0,{submission:N,replace:X}),{shortCircuited:!0}}if(vn(J))throw gt(400,{type:"defer-action"});if(wt(J)){let X=zn(j,ee.route.id);return(re&&re.replace)!==!0&&(O=Je.Push),{matches:j,pendingActionResult:[X.route.id,J]}}return{matches:j,pendingActionResult:[ee.route.id,J]}}async function On(P,I,N,j,G,re,ce,J,ee,X,te){let ge=G||na(I,re),Ee=re||ce||Ql(ge),st=!H&&(!d.v7_partialHydration||!ee);if(j){if(st){let Ke=Dn(te);he(Be({navigation:ge},Ke!==void 0?{actionData:Ke}:{}),{flushSync:X})}let Pe=await lt(N,I.pathname,P.signal);if(Pe.type==="aborted")return{shortCircuited:!0};if(Pe.type==="error"){let Ke=zn(Pe.partialMatches).route.id;return{matches:Pe.partialMatches,loaderData:{},errors:{[Ke]:Pe.error}}}else if(Pe.matches)N=Pe.matches;else{let{error:Ke,notFoundMatches:ar,route:$r}=Ur(I.pathname);return{matches:ar,loaderData:{},errors:{[$r.id]:Ke}}}}let Fe=s||a,[Le,We]=Hl(e.history,k,N,Ee,I,d.v7_partialHydration&&ee===!0,d.v7_skipActionErrorRevalidation,V,Q,Y,pe,C,Z,Fe,l,te);if(_n(Pe=>!(N&&N.some(Ke=>Ke.route.id===Pe))||Le&&Le.some(Ke=>Ke.route.id===Pe)),A=++F,Le.length===0&&We.length===0){let Pe=It();return Ge(I,Be({matches:N,loaderData:{},errors:te&&wt(te[1])?{[te[0]]:te[1].error}:null},Kl(te),Pe?{fetchers:new Map(k.fetchers)}:{}),{flushSync:X}),{shortCircuited:!0}}if(st){let Pe={};if(!j){Pe.navigation=ge;let Ke=Dn(te);Ke!==void 0&&(Pe.actionData=Ke)}We.length>0&&(Pe.fetchers=Nn(We)),he(Pe,{flushSync:X})}We.forEach(Pe=>{Ve(Pe.key),Pe.controller&&W.set(Pe.key,Pe.controller)});let or=()=>We.forEach(Pe=>Ve(Pe.key));R&&R.signal.addEventListener("abort",or);let{loaderResults:Br,fetcherResults:en}=await M(k,N,Le,We,P);if(P.signal.aborted)return{shortCircuited:!0};R&&R.signal.removeEventListener("abort",or),We.forEach(Pe=>W.delete(Pe.key));let $t=Pi(Br);if($t)return await Tt(P,$t.result,!0,{replace:J}),{shortCircuited:!0};if($t=Pi(en),$t)return Z.add($t.key),await Tt(P,$t.result,!0,{replace:J}),{shortCircuited:!0};let{loaderData:Zo,errors:zr}=Vl(k,N,Br,te,We,en,ve);ve.forEach((Pe,Ke)=>{Pe.subscribe(ar=>{(ar||Pe.done)&&ve.delete(Ke)})}),d.v7_partialHydration&&ee&&k.errors&&(zr=Be({},k.errors,zr));let jn=It(),Ei=ze(A),Ri=jn||Ei||We.length>0;return Be({matches:N,loaderData:Zo,errors:zr},Ri?{fetchers:new Map(k.fetchers)}:{})}function Dn(P){if(P&&!wt(P[1]))return{[P[0]]:P[1].data};if(k.actionData)return Object.keys(k.actionData).length===0?null:k.actionData}function Nn(P){return P.forEach(I=>{let N=k.fetchers.get(I.key),j=Wr(void 0,N?N.data:void 0);k.fetchers.set(I.key,j)}),new Map(k.fetchers)}function Jt(P,I,N,j){if(r)throw new Error("router.fetch() was called during the server render, but it shouldn't be. You are likely calling a useFetcher() method in the body of your component. Try moving it to a useEffect or a callback.");Ve(P);let G=(j&&j.flushSync)===!0,re=s||a,ce=Oa(k.location,k.matches,l,d.v7_prependBasename,N,d.v7_relativeSplatPath,I,j?.relative),J=Bn(re,ce,l),ee=De(J,re,ce);if(ee.active&&ee.matches&&(J=ee.matches),!J){le(P,I,gt(404,{pathname:ce}),{flushSync:G});return}let{path:X,submission:te,error:ge}=jl(d.v7_normalizeFormMethod,!0,ce,j);if(ge){le(P,I,ge,{flushSync:G});return}let Ee=ei(J,X),st=(j&&j.preventScrollReset)===!0;if(te&&Dt(te.formMethod)){ir(P,I,X,Ee,J,ee.active,G,st,te);return}C.set(P,{routeId:I,path:X}),Pt(P,I,X,Ee,J,ee.active,G,st,te)}async function ir(P,I,N,j,G,re,ce,J,ee){B(),C.delete(P);function X(Ye){if(!Ye.route.action&&!Ye.route.lazy){let sr=gt(405,{method:ee.formMethod,pathname:N,routeId:I});return le(P,I,sr,{flushSync:ce}),!0}return!1}if(!re&&X(j))return;let te=k.fetchers.get(P);ne(P,Tg(ee,te),{flushSync:ce});let ge=new AbortController,Ee=lr(e.history,N,ge.signal,ee);if(re){let Ye=await lt(G,new URL(Ee.url).pathname,Ee.signal,P);if(Ye.type==="aborted")return;if(Ye.type==="error"){le(P,I,Ye.error,{flushSync:ce});return}else if(Ye.matches){if(G=Ye.matches,j=ei(G,N),X(j))return}else{le(P,I,gt(404,{pathname:N}),{flushSync:ce});return}}W.set(P,ge);let st=F,Le=(await Zt("action",k,Ee,[j],G,P))[j.route.id];if(Ee.signal.aborted){W.get(P)===ge&&W.delete(P);return}if(d.v7_fetcherPersist&&pe.has(P)){if(Wn(Le)||wt(Le)){ne(P,mn(void 0));return}}else{if(Wn(Le))if(W.delete(P),A>st){ne(P,mn(void 0));return}else return Z.add(P),ne(P,Wr(ee)),Tt(Ee,Le,!1,{fetcherSubmission:ee,preventScrollReset:J});if(wt(Le)){le(P,I,Le.error);return}}if(vn(Le))throw gt(400,{type:"defer-action"});let We=k.navigation.location||k.location,or=lr(e.history,We,ge.signal),Br=s||a,en=k.navigation.state!=="idle"?Bn(Br,k.navigation.location,l):k.matches;we(en,"Didn't find any matches after fetcher action");let $t=++F;ie.set(P,$t);let Zo=Wr(ee,Le.data);k.fetchers.set(P,Zo);let[zr,jn]=Hl(e.history,k,en,ee,We,!1,d.v7_skipActionErrorRevalidation,V,Q,Y,pe,C,Z,Br,l,[j.route.id,Le]);jn.filter(Ye=>Ye.key!==P).forEach(Ye=>{let sr=Ye.key,Il=k.fetchers.get(sr),Am=Wr(void 0,Il?Il.data:void 0);k.fetchers.set(sr,Am),Ve(sr),Ye.controller&&W.set(sr,Ye.controller)}),he({fetchers:new Map(k.fetchers)});let Ei=()=>jn.forEach(Ye=>Ve(Ye.key));ge.signal.addEventListener("abort",Ei);let{loaderResults:Ri,fetcherResults:Pe}=await M(k,en,zr,jn,or);if(ge.signal.aborted)return;ge.signal.removeEventListener("abort",Ei),ie.delete(P),W.delete(P),jn.forEach(Ye=>W.delete(Ye.key));let Ke=Pi(Ri);if(Ke)return Tt(or,Ke.result,!1,{preventScrollReset:J});if(Ke=Pi(Pe),Ke)return Z.add(Ke.key),Tt(or,Ke.result,!1,{preventScrollReset:J});let{loaderData:ar,errors:$r}=Vl(k,en,Ri,void 0,jn,Pe,ve);if(k.fetchers.has(P)){let Ye=mn(Le.data);k.fetchers.set(P,Ye)}ze($t),k.navigation.state==="loading"&&$t>A?(we(O,"Expected pending action"),R&&R.abort(),Ge(k.navigation.location,{matches:en,loaderData:ar,errors:$r,fetchers:new Map(k.fetchers)})):(he({errors:$r,loaderData:Wl(k.loaderData,ar,en,$r),fetchers:new Map(k.fetchers)}),V=!1)}async function Pt(P,I,N,j,G,re,ce,J,ee){let X=k.fetchers.get(P);ne(P,Wr(ee,X?X.data:void 0),{flushSync:ce});let te=new AbortController,ge=lr(e.history,N,te.signal);if(re){let Le=await lt(G,new URL(ge.url).pathname,ge.signal,P);if(Le.type==="aborted")return;if(Le.type==="error"){le(P,I,Le.error,{flushSync:ce});return}else if(Le.matches)G=Le.matches,j=ei(G,N);else{le(P,I,gt(404,{pathname:N}),{flushSync:ce});return}}W.set(P,te);let Ee=F,Fe=(await Zt("loader",k,ge,[j],G,P))[j.route.id];if(vn(Fe)&&(Fe=await Cs(Fe,ge.signal,!0)||Fe),W.get(P)===te&&W.delete(P),!ge.signal.aborted){if(pe.has(P)){ne(P,mn(void 0));return}if(Wn(Fe))if(A>Ee){ne(P,mn(void 0));return}else{Z.add(P),await Tt(ge,Fe,!1,{preventScrollReset:J});return}if(wt(Fe)){le(P,I,Fe.error);return}we(!vn(Fe),"Unhandled fetcher deferred data"),ne(P,mn(Fe.data))}}async function Tt(P,I,N,j){let{submission:G,fetcherSubmission:re,preventScrollReset:ce,replace:J}=j===void 0?{}:j;I.response.headers.has("X-Remix-Revalidate")&&(V=!0);let ee=I.response.headers.get("Location");we(ee,"Expected a Location header on the redirect Response"),ee=zl(ee,new URL(P.url),l,e.history);let X=si(k.location,ee,{_isRedirect:!0});if(n){let Le=!1;if(I.response.headers.has("X-Remix-Reload-Document"))Le=!0;else if(As.test(ee)){const We=e.history.createURL(ee);Le=We.origin!==t.location.origin||rn(We.pathname,l)==null}if(Le){J?t.location.replace(ee):t.location.assign(ee);return}}R=null;let te=J===!0||I.response.headers.has("X-Remix-Replace")?Je.Replace:Je.Push,{formMethod:ge,formAction:Ee,formEncType:st}=k.navigation;!G&&!re&&ge&&Ee&&st&&(G=Ql(k.navigation));let Fe=G||re;if(cg.has(I.response.status)&&Fe&&Dt(Fe.formMethod))await at(te,X,{submission:Be({},Fe,{formAction:ee}),preventScrollReset:ce||_,enableViewTransition:N?D:void 0});else{let Le=na(X,G);await at(te,X,{overrideNavigation:Le,fetcherSubmission:re,preventScrollReset:ce||_,enableViewTransition:N?D:void 0})}}async function Zt(P,I,N,j,G,re){let ce,J={};try{ce=await yg(c,P,I,N,j,G,re,o,i)}catch(ee){return j.forEach(X=>{J[X.route.id]={type:Ne.error,error:ee}}),J}for(let[ee,X]of Object.entries(ce))if(Sg(X)){let te=X.result;J[ee]={type:Ne.redirect,response:xg(te,N,ee,G,l,d.v7_relativeSplatPath)}}else J[ee]=await vg(X);return J}async function M(P,I,N,j,G){let re=P.matches,ce=Zt("loader",P,G,N,I,null),J=Promise.all(j.map(async te=>{if(te.matches&&te.match&&te.controller){let Ee=(await Zt("loader",P,lr(e.history,te.path,te.controller.signal),[te.match],te.matches,te.key))[te.match.route.id];return{[te.key]:Ee}}else return Promise.resolve({[te.key]:{type:Ne.error,error:gt(404,{pathname:te.path})}})})),ee=await ce,X=(await J).reduce((te,ge)=>Object.assign(te,ge),{});return await Promise.all([Eg(I,ee,G.signal,re,P.loaderData),Rg(I,X,j)]),{loaderResults:ee,fetcherResults:X}}function B(){V=!0,Q.push(..._n()),C.forEach((P,I)=>{W.has(I)&&Y.add(I),Ve(I)})}function ne(P,I,N){N===void 0&&(N={}),k.fetchers.set(P,I),he({fetchers:new Map(k.fetchers)},{flushSync:(N&&N.flushSync)===!0})}function le(P,I,N,j){j===void 0&&(j={});let G=zn(k.matches,I);nt(P),he({errors:{[G.route.id]:N},fetchers:new Map(k.fetchers)},{flushSync:(j&&j.flushSync)===!0})}function Ce(P){return ae.set(P,(ae.get(P)||0)+1),pe.has(P)&&pe.delete(P),k.fetchers.get(P)||ug}function nt(P){let I=k.fetchers.get(P);W.has(P)&&!(I&&I.state==="loading"&&ie.has(P))&&Ve(P),C.delete(P),ie.delete(P),Z.delete(P),d.v7_fetcherPersist&&pe.delete(P),Y.delete(P),k.fetchers.delete(P)}function Et(P){let I=(ae.get(P)||0)-1;I<=0?(ae.delete(P),pe.add(P),d.v7_fetcherPersist||nt(P)):ae.set(P,I),he({fetchers:new Map(k.fetchers)})}function Ve(P){let I=W.get(P);I&&(I.abort(),W.delete(P))}function dt(P){for(let I of P){let N=Ce(I),j=mn(N.data);k.fetchers.set(I,j)}}function It(){let P=[],I=!1;for(let N of Z){let j=k.fetchers.get(N);we(j,"Expected fetcher: "+N),j.state==="loading"&&(Z.delete(N),P.push(N),I=!0)}return dt(P),I}function ze(P){let I=[];for(let[N,j]of ie)if(j<P){let G=k.fetchers.get(N);we(G,"Expected fetcher: "+N),G.state==="loading"&&(Ve(N),ie.delete(N),I.push(N))}return dt(I),I.length>0}function Ut(P,I){let N=k.blockers.get(P)||Vr;return q.get(P)!==I&&q.set(P,I),N}function pt(P){k.blockers.delete(P),q.delete(P)}function Mn(P,I){let N=k.blockers.get(P)||Vr;we(N.state==="unblocked"&&I.state==="blocked"||N.state==="blocked"&&I.state==="blocked"||N.state==="blocked"&&I.state==="proceeding"||N.state==="blocked"&&I.state==="unblocked"||N.state==="proceeding"&&I.state==="unblocked","Invalid blocker state transition: "+N.state+" -> "+I.state);let j=new Map(k.blockers);j.set(P,I),he({blockers:j})}function Hr(P){let{currentLocation:I,nextLocation:N,historyAction:j}=P;if(q.size===0)return;q.size>1&&Qn(!1,"A router only supports one blocker at a time");let G=Array.from(q.entries()),[re,ce]=G[G.length-1],J=k.blockers.get(re);if(!(J&&J.state==="proceeding")&&ce({currentLocation:I,nextLocation:N,historyAction:j}))return re}function Ur(P){let I=gt(404,{pathname:P}),N=s||a,{matches:j,route:G}=ql(N);return _n(),{notFoundMatches:j,route:G,error:I}}function _n(P){let I=[];return ve.forEach((N,j)=>{(!P||P(j))&&(N.cancel(),I.push(j),ve.delete(j))}),I}function Bt(P,I,N){if(m=P,b=I,p=N||null,!v&&k.navigation===ta){v=!0;let j=Ie(k.location,k.matches);j!=null&&he({restoreScrollPosition:j})}return()=>{m=null,b=null,p=null}}function Ci(P,I){return p&&p(P,I.map(j=>Um(j,k.loaderData)))||P.key}function ue(P,I){if(m&&b){let N=Ci(P,I);m[N]=b()}}function Ie(P,I){if(m){let N=Ci(P,I),j=m[N];if(typeof j=="number")return j}return null}function De(P,I,N){if(u)if(P){if(Object.keys(P[0].params).length>0)return{active:!0,matches:Ki(I,N,l,!0)}}else return{active:!0,matches:Ki(I,N,l,!0)||[]};return{active:!1,matches:null}}async function lt(P,I,N,j){if(!u)return{type:"success",matches:P};let G=P;for(;;){let re=s==null,ce=s||a,J=o;try{await u({signal:N,path:I,matches:G,fetcherKey:j,patch:(te,ge)=>{N.aborted||Bl(te,ge,ce,J,i)}})}catch(te){return{type:"error",error:te,partialMatches:G}}finally{re&&!N.aborted&&(a=[...a])}if(N.aborted)return{type:"aborted"};let ee=Bn(ce,I,l);if(ee)return{type:"success",matches:ee};let X=Ki(ce,I,l,!0);if(!X||G.length===X.length&&G.every((te,ge)=>te.route.id===X[ge].route.id))return{type:"success",matches:null};G=X}}function vt(P){o={},s=eo(P,i,void 0,o)}function zt(P,I){let N=s==null;Bl(P,I,s||a,o,i),N&&(a=[...a],he({}))}return S={get basename(){return l},get future(){return d},get state(){return k},get routes(){return a},get window(){return t},initialize:Te,subscribe:Se,enableScrollRestoration:Bt,navigate:Ze,fetch:Jt,revalidate:Ft,createHref:P=>e.history.createHref(P),encodeLocation:P=>e.history.encodeLocation(P),getFetcher:Ce,deleteFetcher:Et,dispose:xe,getBlocker:Ut,deleteBlocker:pt,patchRoutes:zt,_internalFetchControllers:W,_internalActiveDeferreds:ve,_internalSetRoutes:vt},S}function hg(e){return e!=null&&("formData"in e&&e.formData!=null||"body"in e&&e.body!==void 0)}function Oa(e,t,n,r,i,o,a,s){let l,c;if(a){l=[];for(let d of t)if(l.push(d),d.route.id===a){c=d;break}}else l=t,c=t[t.length-1];let u=Ro(i||".",Eo(l,o),rn(e.pathname,n)||e.pathname,s==="path");if(i==null&&(u.search=e.search,u.hash=e.hash),(i==null||i===""||i===".")&&c){let d=Es(u.search);if(c.route.index&&!d)u.search=u.search?u.search.replace(/^\?/,"?index&"):"?index";else if(!c.route.index&&d){let h=new URLSearchParams(u.search),f=h.getAll("index");h.delete("index"),f.filter(p=>p).forEach(p=>h.append("index",p));let m=h.toString();u.search=m?"?"+m:""}}return r&&n!=="/"&&(u.pathname=u.pathname==="/"?n:nn([n,u.pathname])),Yn(u)}function jl(e,t,n,r){if(!r||!hg(r))return{path:n};if(r.formMethod&&!Cg(r.formMethod))return{path:n,error:gt(405,{method:r.formMethod})};let i=()=>({path:n,error:gt(400,{type:"invalid-body"})}),o=r.formMethod||"get",a=e?o.toUpperCase():o.toLowerCase(),s=Dd(n);if(r.body!==void 0){if(r.formEncType==="text/plain"){if(!Dt(a))return i();let h=typeof r.body=="string"?r.body:r.body instanceof FormData||r.body instanceof URLSearchParams?Array.from(r.body.entries()).reduce((f,m)=>{let[p,b]=m;return""+f+p+"="+b+`
20
+ `},""):String(r.body);return{path:n,submission:{formMethod:a,formAction:s,formEncType:r.formEncType,formData:void 0,json:void 0,text:h}}}else if(r.formEncType==="application/json"){if(!Dt(a))return i();try{let h=typeof r.body=="string"?JSON.parse(r.body):r.body;return{path:n,submission:{formMethod:a,formAction:s,formEncType:r.formEncType,formData:void 0,json:h,text:void 0}}}catch{return i()}}}we(typeof FormData=="function","FormData is not available in this environment");let l,c;if(r.formData)l=Na(r.formData),c=r.formData;else if(r.body instanceof FormData)l=Na(r.body),c=r.body;else if(r.body instanceof URLSearchParams)l=r.body,c=$l(l);else if(r.body==null)l=new URLSearchParams,c=new FormData;else try{l=new URLSearchParams(r.body),c=$l(l)}catch{return i()}let u={formMethod:a,formAction:s,formEncType:r&&r.formEncType||"application/x-www-form-urlencoded",formData:c,json:void 0,text:void 0};if(Dt(u.formMethod))return{path:n,submission:u};let d=En(n);return t&&d.search&&Es(d.search)&&l.append("index",""),d.search="?"+l,{path:Yn(d),submission:u}}function Fl(e,t,n){n===void 0&&(n=!1);let r=e.findIndex(i=>i.route.id===t);return r>=0?e.slice(0,n?r+1:r):e}function Hl(e,t,n,r,i,o,a,s,l,c,u,d,h,f,m,p){let b=p?wt(p[1])?p[1].error:p[1].data:void 0,v=e.createURL(t.location),x=e.createURL(i),w=n;o&&t.errors?w=Fl(n,Object.keys(t.errors)[0],!0):p&&wt(p[1])&&(w=Fl(n,p[0]));let E=p?p[1].statusCode:void 0,T=a&&E&&E>=400,S=w.filter((O,_)=>{let{route:R}=O;if(R.lazy)return!0;if(R.loader==null)return!1;if(o)return Da(R,t.loaderData,t.errors);if(pg(t.loaderData,t.matches[_],O)||l.some(z=>z===O.route.id))return!0;let D=t.matches[_],L=O;return Ul(O,Be({currentUrl:v,currentParams:D.params,nextUrl:x,nextParams:L.params},r,{actionResult:b,actionStatus:E,defaultShouldRevalidate:T?!1:s||v.pathname+v.search===x.pathname+x.search||v.search!==x.search||Ld(D,L)}))}),k=[];return d.forEach((O,_)=>{if(o||!n.some(H=>H.route.id===O.routeId)||u.has(_))return;let R=Bn(f,O.path,m);if(!R){k.push({key:_,routeId:O.routeId,path:O.path,matches:null,match:null,controller:null});return}let D=t.fetchers.get(_),L=ei(R,O.path),z=!1;h.has(_)?z=!1:c.has(_)?(c.delete(_),z=!0):D&&D.state!=="idle"&&D.data===void 0?z=s:z=Ul(L,Be({currentUrl:v,currentParams:t.matches[t.matches.length-1].params,nextUrl:x,nextParams:n[n.length-1].params},r,{actionResult:b,actionStatus:E,defaultShouldRevalidate:T?!1:s})),z&&k.push({key:_,routeId:O.routeId,path:O.path,matches:R,match:L,controller:new AbortController})}),[S,k]}function Da(e,t,n){if(e.lazy)return!0;if(!e.loader)return!1;let r=t!=null&&t[e.id]!==void 0,i=n!=null&&n[e.id]!==void 0;return!r&&i?!1:typeof e.loader=="function"&&e.loader.hydrate===!0?!0:!r&&!i}function pg(e,t,n){let r=!t||n.route.id!==t.route.id,i=e[n.route.id]===void 0;return r||i}function Ld(e,t){let n=e.route.path;return e.pathname!==t.pathname||n!=null&&n.endsWith("*")&&e.params["*"]!==t.params["*"]}function Ul(e,t){if(e.route.shouldRevalidate){let n=e.route.shouldRevalidate(t);if(typeof n=="boolean")return n}return t.defaultShouldRevalidate}function Bl(e,t,n,r,i){var o;let a;if(e){let c=r[e];we(c,"No route found to patch children into: routeId = "+e),c.children||(c.children=[]),a=c.children}else a=n;let s=t.filter(c=>!a.some(u=>Od(c,u))),l=eo(s,i,[e||"_","patch",String(((o=a)==null?void 0:o.length)||"0")],r);a.push(...l)}function Od(e,t){return"id"in e&&"id"in t&&e.id===t.id?!0:e.index===t.index&&e.path===t.path&&e.caseSensitive===t.caseSensitive?(!e.children||e.children.length===0)&&(!t.children||t.children.length===0)?!0:e.children.every((n,r)=>{var i;return(i=t.children)==null?void 0:i.some(o=>Od(n,o))}):!1}async function mg(e,t,n){if(!e.lazy)return;let r=await e.lazy();if(!e.lazy)return;let i=n[e.id];we(i,"No route found in manifest");let o={};for(let a in r){let l=i[a]!==void 0&&a!=="hasErrorBoundary";Qn(!l,'Route "'+i.id+'" has a static property "'+a+'" defined but its lazy function is also returning a value for this property. '+('The lazy route property "'+a+'" will be ignored.')),!l&&!Fm.has(a)&&(o[a]=r[a])}Object.assign(i,o),Object.assign(i,Be({},t(i),{lazy:void 0}))}async function gg(e){let{matches:t}=e,n=t.filter(i=>i.shouldLoad);return(await Promise.all(n.map(i=>i.resolve()))).reduce((i,o,a)=>Object.assign(i,{[n[a].route.id]:o}),{})}async function yg(e,t,n,r,i,o,a,s,l,c){let u=o.map(f=>f.route.lazy?mg(f.route,l,s):void 0),d=o.map((f,m)=>{let p=u[m],b=i.some(x=>x.route.id===f.route.id);return Be({},f,{shouldLoad:b,resolve:async x=>(x&&r.method==="GET"&&(f.route.lazy||f.route.loader)&&(b=!0),b?bg(t,r,f,p,x,c):Promise.resolve({type:Ne.data,result:void 0}))})}),h=await e({matches:d,request:r,params:o[0].params,fetcherKey:a,context:c});try{await Promise.all(u)}catch{}return h}async function bg(e,t,n,r,i,o){let a,s,l=c=>{let u,d=new Promise((m,p)=>u=p);s=()=>u(),t.signal.addEventListener("abort",s);let h=m=>typeof c!="function"?Promise.reject(new Error("You cannot call the handler for a route which defines a boolean "+('"'+e+'" [routeId: '+n.route.id+"]"))):c({request:t,params:n.params,context:o},...m!==void 0?[m]:[]),f=(async()=>{try{return{type:"data",result:await(i?i(p=>h(p)):h())}}catch(m){return{type:"error",result:m}}})();return Promise.race([f,d])};try{let c=n.route[e];if(r)if(c){let u,[d]=await Promise.all([l(c).catch(h=>{u=h}),r]);if(u!==void 0)throw u;a=d}else if(await r,c=n.route[e],c)a=await l(c);else if(e==="action"){let u=new URL(t.url),d=u.pathname+u.search;throw gt(405,{method:t.method,pathname:d,routeId:n.route.id})}else return{type:Ne.data,result:void 0};else if(c)a=await l(c);else{let u=new URL(t.url),d=u.pathname+u.search;throw gt(404,{pathname:d})}we(a.result!==void 0,"You defined "+(e==="action"?"an action":"a loader")+" for route "+('"'+n.route.id+"\" but didn't return anything from your `"+e+"` ")+"function. Please return a value or `null`.")}catch(c){return{type:Ne.error,result:c}}finally{s&&t.signal.removeEventListener("abort",s)}return a}async function vg(e){let{result:t,type:n}=e;if(Nd(t)){let d;try{let h=t.headers.get("Content-Type");h&&/\bapplication\/json\b/.test(h)?t.body==null?d=null:d=await t.json():d=await t.text()}catch(h){return{type:Ne.error,error:h}}return n===Ne.error?{type:Ne.error,error:new no(t.status,t.statusText,d),statusCode:t.status,headers:t.headers}:{type:Ne.data,data:d,statusCode:t.status,headers:t.headers}}if(n===Ne.error){if(Gl(t)){var r,i;if(t.data instanceof Error){var o,a;return{type:Ne.error,error:t.data,statusCode:(o=t.init)==null?void 0:o.status,headers:(a=t.init)!=null&&a.headers?new Headers(t.init.headers):void 0}}return{type:Ne.error,error:new no(((r=t.init)==null?void 0:r.status)||500,void 0,t.data),statusCode:li(t)?t.status:void 0,headers:(i=t.init)!=null&&i.headers?new Headers(t.init.headers):void 0}}return{type:Ne.error,error:t,statusCode:li(t)?t.status:void 0}}if(Ag(t)){var s,l;return{type:Ne.deferred,deferredData:t,statusCode:(s=t.init)==null?void 0:s.status,headers:((l=t.init)==null?void 0:l.headers)&&new Headers(t.init.headers)}}if(Gl(t)){var c,u;return{type:Ne.data,data:t.data,statusCode:(c=t.init)==null?void 0:c.status,headers:(u=t.init)!=null&&u.headers?new Headers(t.init.headers):void 0}}return{type:Ne.data,data:t}}function xg(e,t,n,r,i,o){let a=e.headers.get("Location");if(we(a,"Redirects returned/thrown from loaders/actions must have a Location header"),!As.test(a)){let s=r.slice(0,r.findIndex(l=>l.route.id===n)+1);a=Oa(new URL(t.url),s,i,!0,a,o),e.headers.set("Location",a)}return e}function zl(e,t,n,r){let i=["about:","blob:","chrome:","chrome-untrusted:","content:","data:","devtools:","file:","filesystem:","javascript:"];if(As.test(e)){let o=e,a=o.startsWith("//")?new URL(t.protocol+o):new URL(o);if(i.includes(a.protocol))throw new Error("Invalid redirect location");let s=rn(a.pathname,n)!=null;if(a.origin===t.origin&&s)return Ss(a.pathname)+a.search+a.hash}try{let o=r.createURL(e);if(i.includes(o.protocol))throw new Error("Invalid redirect location")}catch{}return e}function lr(e,t,n,r){let i=e.createURL(Dd(t)).toString(),o={signal:n};if(r&&Dt(r.formMethod)){let{formMethod:a,formEncType:s}=r;o.method=a.toUpperCase(),s==="application/json"?(o.headers=new Headers({"Content-Type":s}),o.body=JSON.stringify(r.json)):s==="text/plain"?o.body=r.text:s==="application/x-www-form-urlencoded"&&r.formData?o.body=Na(r.formData):o.body=r.formData}return new Request(i,o)}function Na(e){let t=new URLSearchParams;for(let[n,r]of e.entries())t.append(n,typeof r=="string"?r:r.name);return t}function $l(e){let t=new FormData;for(let[n,r]of e.entries())t.append(n,r);return t}function wg(e,t,n,r,i){let o={},a=null,s,l=!1,c={},u=n&&wt(n[1])?n[1].error:void 0;return e.forEach(d=>{if(!(d.route.id in t))return;let h=d.route.id,f=t[h];if(we(!Wn(f),"Cannot handle redirect results in processLoaderData"),wt(f)){let m=f.error;u!==void 0&&(m=u,u=void 0),a=a||{};{let p=zn(e,h);a[p.route.id]==null&&(a[p.route.id]=m)}o[h]=void 0,l||(l=!0,s=li(f.error)?f.error.status:500),f.headers&&(c[h]=f.headers)}else vn(f)?(r.set(h,f.deferredData),o[h]=f.deferredData.data,f.statusCode!=null&&f.statusCode!==200&&!l&&(s=f.statusCode),f.headers&&(c[h]=f.headers)):(o[h]=f.data,f.statusCode&&f.statusCode!==200&&!l&&(s=f.statusCode),f.headers&&(c[h]=f.headers))}),u!==void 0&&n&&(a={[n[0]]:u},o[n[0]]=void 0),{loaderData:o,errors:a,statusCode:s||200,loaderHeaders:c}}function Vl(e,t,n,r,i,o,a){let{loaderData:s,errors:l}=wg(t,n,r,a);return i.forEach(c=>{let{key:u,match:d,controller:h}=c,f=o[u];if(we(f,"Did not find corresponding fetcher result"),!(h&&h.signal.aborted))if(wt(f)){let m=zn(e.matches,d?.route.id);l&&l[m.route.id]||(l=Be({},l,{[m.route.id]:f.error})),e.fetchers.delete(u)}else if(Wn(f))we(!1,"Unhandled fetcher revalidation redirect");else if(vn(f))we(!1,"Unhandled fetcher deferred data");else{let m=mn(f.data);e.fetchers.set(u,m)}}),{loaderData:s,errors:l}}function Wl(e,t,n,r){let i=Be({},t);for(let o of n){let a=o.route.id;if(t.hasOwnProperty(a)?t[a]!==void 0&&(i[a]=t[a]):e[a]!==void 0&&o.route.loader&&(i[a]=e[a]),r&&r.hasOwnProperty(a))break}return i}function Kl(e){return e?wt(e[1])?{actionData:{}}:{actionData:{[e[0]]:e[1].data}}:{}}function zn(e,t){return(t?e.slice(0,e.findIndex(r=>r.route.id===t)+1):[...e]).reverse().find(r=>r.route.hasErrorBoundary===!0)||e[0]}function ql(e){let t=e.length===1?e[0]:e.find(n=>n.index||!n.path||n.path==="/")||{id:"__shim-error-route__"};return{matches:[{params:{},pathname:"",pathnameBase:"",route:t}],route:t}}function gt(e,t){let{pathname:n,routeId:r,method:i,type:o,message:a}=t===void 0?{}:t,s="Unknown Server Error",l="Unknown @remix-run/router error";return e===400?(s="Bad Request",i&&n&&r?l="You made a "+i+' request to "'+n+'" but '+('did not provide a `loader` for route "'+r+'", ')+"so there is no way to handle the request.":o==="defer-action"?l="defer() is not supported in actions":o==="invalid-body"&&(l="Unable to encode submission body")):e===403?(s="Forbidden",l='Route "'+r+'" does not match URL "'+n+'"'):e===404?(s="Not Found",l='No route matches URL "'+n+'"'):e===405&&(s="Method Not Allowed",i&&n&&r?l="You made a "+i.toUpperCase()+' request to "'+n+'" but '+('did not provide an `action` for route "'+r+'", ')+"so there is no way to handle the request.":i&&(l='Invalid request method "'+i.toUpperCase()+'"')),new no(e||500,s,new Error(l),!0)}function Pi(e){let t=Object.entries(e);for(let n=t.length-1;n>=0;n--){let[r,i]=t[n];if(Wn(i))return{key:r,result:i}}}function Dd(e){let t=typeof e=="string"?En(e):e;return Yn(Be({},t,{hash:""}))}function kg(e,t){return e.pathname!==t.pathname||e.search!==t.search?!1:e.hash===""?t.hash!=="":e.hash===t.hash?!0:t.hash!==""}function Sg(e){return Nd(e.result)&&lg.has(e.result.status)}function vn(e){return e.type===Ne.deferred}function wt(e){return e.type===Ne.error}function Wn(e){return(e&&e.type)===Ne.redirect}function Gl(e){return typeof e=="object"&&e!=null&&"type"in e&&"data"in e&&"init"in e&&e.type==="DataWithResponseInit"}function Ag(e){let t=e;return t&&typeof t=="object"&&typeof t.data=="object"&&typeof t.subscribe=="function"&&typeof t.cancel=="function"&&typeof t.resolveData=="function"}function Nd(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.headers=="object"&&typeof e.body<"u"}function Cg(e){return sg.has(e.toLowerCase())}function Dt(e){return og.has(e.toLowerCase())}async function Eg(e,t,n,r,i){let o=Object.entries(t);for(let a=0;a<o.length;a++){let[s,l]=o[a],c=e.find(h=>h?.route.id===s);if(!c)continue;let u=r.find(h=>h.route.id===c.route.id),d=u!=null&&!Ld(u,c)&&(i&&i[c.route.id])!==void 0;vn(l)&&d&&await Cs(l,n,!1).then(h=>{h&&(t[s]=h)})}}async function Rg(e,t,n){for(let r=0;r<n.length;r++){let{key:i,routeId:o,controller:a}=n[r],s=t[i];e.find(c=>c?.route.id===o)&&vn(s)&&(we(a,"Expected an AbortController for revalidating fetcher deferred result"),await Cs(s,a.signal,!0).then(c=>{c&&(t[i]=c)}))}}async function Cs(e,t,n){if(n===void 0&&(n=!1),!await e.deferredData.resolveData(t)){if(n)try{return{type:Ne.data,data:e.deferredData.unwrappedData}}catch(i){return{type:Ne.error,error:i}}return{type:Ne.data,data:e.deferredData.data}}}function Es(e){return new URLSearchParams(e).getAll("index").some(t=>t==="")}function ei(e,t){let n=typeof t=="string"?En(t).search:t.search;if(e[e.length-1].route.index&&Es(n||""))return e[e.length-1];let r=Pd(e);return r[r.length-1]}function Ql(e){let{formMethod:t,formAction:n,formEncType:r,text:i,formData:o,json:a}=e;if(!(!t||!n||!r)){if(i!=null)return{formMethod:t,formAction:n,formEncType:r,formData:void 0,json:void 0,text:i};if(o!=null)return{formMethod:t,formAction:n,formEncType:r,formData:o,json:void 0,text:void 0};if(a!==void 0)return{formMethod:t,formAction:n,formEncType:r,formData:void 0,json:a,text:void 0}}}function na(e,t){return t?{state:"loading",location:e,formMethod:t.formMethod,formAction:t.formAction,formEncType:t.formEncType,formData:t.formData,json:t.json,text:t.text}:{state:"loading",location:e,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0}}function Pg(e,t){return{state:"submitting",location:e,formMethod:t.formMethod,formAction:t.formAction,formEncType:t.formEncType,formData:t.formData,json:t.json,text:t.text}}function Wr(e,t){return e?{state:"loading",formMethod:e.formMethod,formAction:e.formAction,formEncType:e.formEncType,formData:e.formData,json:e.json,text:e.text,data:t}:{state:"loading",formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0,data:t}}function Tg(e,t){return{state:"submitting",formMethod:e.formMethod,formAction:e.formAction,formEncType:e.formEncType,formData:e.formData,json:e.json,text:e.text,data:t?t.data:void 0}}function mn(e){return{state:"idle",formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0,data:e}}function Ig(e,t){try{let n=e.sessionStorage.getItem(Id);if(n){let r=JSON.parse(n);for(let[i,o]of Object.entries(r||{}))o&&Array.isArray(o)&&t.set(i,new Set(o||[]))}}catch{}}function Lg(e,t){if(t.size>0){let n={};for(let[r,i]of t)n[r]=[...i];try{e.sessionStorage.setItem(Id,JSON.stringify(n))}catch(r){Qn(!1,"Failed to save applied view transitions in sessionStorage ("+r+").")}}}/**
21
+ * React Router v6.30.4
22
+ *
23
+ * Copyright (c) Remix Software Inc.
24
+ *
25
+ * This source code is licensed under the MIT license found in the
26
+ * LICENSE.md file in the root directory of this source tree.
27
+ *
28
+ * @license MIT
29
+ */function ro(){return ro=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},ro.apply(null,arguments)}const vi=y.createContext(null),Rs=y.createContext(null),sn=y.createContext(null),Ps=y.createContext(null),ln=y.createContext({outlet:null,matches:[],isDataRoute:!1}),Md=y.createContext(null);function Og(e,t){let{relative:n}=t===void 0?{}:t;Lr()||we(!1);let{basename:r,navigator:i}=y.useContext(sn),{hash:o,pathname:a,search:s}=To(e,{relative:n}),l=a;return r!=="/"&&(l=a==="/"?r:nn([r,a])),i.createHref({pathname:l,search:s,hash:o})}function Lr(){return y.useContext(Ps)!=null}function cn(){return Lr()||we(!1),y.useContext(Ps).location}function _d(e){y.useContext(sn).static||y.useLayoutEffect(e)}function Po(){let{isDataRoute:e}=y.useContext(ln);return e?Kg():Dg()}function Dg(){Lr()||we(!1);let e=y.useContext(vi),{basename:t,future:n,navigator:r}=y.useContext(sn),{matches:i}=y.useContext(ln),{pathname:o}=cn(),a=JSON.stringify(Eo(i,n.v7_relativeSplatPath)),s=y.useRef(!1);return _d(()=>{s.current=!0}),y.useCallback(function(c,u){if(u===void 0&&(u={}),!s.current)return;if(typeof c=="number"){r.go(c);return}let d=Ro(c,JSON.parse(a),o,u.relative==="path");e==null&&t!=="/"&&(d.pathname=d.pathname==="/"?t:nn([t,d.pathname])),(u.replace?r.replace:r.push)(d,u.state,u)},[t,r,a,o,e])}const Ng=y.createContext(null);function Mg(e){let t=y.useContext(ln).outlet;return t&&y.createElement(Ng.Provider,{value:e},t)}function To(e,t){let{relative:n}=t===void 0?{}:t,{future:r}=y.useContext(sn),{matches:i}=y.useContext(ln),{pathname:o}=cn(),a=JSON.stringify(Eo(i,r.v7_relativeSplatPath));return y.useMemo(()=>Ro(e,JSON.parse(a),o,n==="path"),[e,a,o,n])}function _g(e,t,n,r){Lr()||we(!1);let{navigator:i}=y.useContext(sn),{matches:o}=y.useContext(ln),a=o[o.length-1],s=a?a.params:{};a&&a.pathname;let l=a?a.pathnameBase:"/";a&&a.route;let c=cn(),u;u=c;let d=u.pathname||"/",h=d;if(l!=="/"){let p=l.replace(/^\//,"").split("/");h="/"+d.replace(/^\//,"").split("/").slice(p.length).join("/")}let f=Bn(e,{pathname:h});return Bg(f&&f.map(p=>Object.assign({},p,{params:Object.assign({},s,p.params),pathname:nn([l,i.encodeLocation?i.encodeLocation(p.pathname).pathname:p.pathname]),pathnameBase:p.pathnameBase==="/"?l:nn([l,i.encodeLocation?i.encodeLocation(p.pathnameBase).pathname:p.pathnameBase])})),o,n,r)}function jg(){let e=Wg(),t=li(e)?e.status+" "+e.statusText:e instanceof Error?e.message:JSON.stringify(e),n=e instanceof Error?e.stack:null,i={padding:"0.5rem",backgroundColor:"rgba(200,200,200, 0.5)"};return y.createElement(y.Fragment,null,y.createElement("h2",null,"Unexpected Application Error!"),y.createElement("h3",{style:{fontStyle:"italic"}},t),n?y.createElement("pre",{style:i},n):null,null)}const Fg=y.createElement(jg,null);class Hg extends y.Component{constructor(t){super(t),this.state={location:t.location,revalidation:t.revalidation,error:t.error}}static getDerivedStateFromError(t){return{error:t}}static getDerivedStateFromProps(t,n){return n.location!==t.location||n.revalidation!=="idle"&&t.revalidation==="idle"?{error:t.error,location:t.location,revalidation:t.revalidation}:{error:t.error!==void 0?t.error:n.error,location:n.location,revalidation:t.revalidation||n.revalidation}}componentDidCatch(t,n){console.error("React Router caught the following error during render",t,n)}render(){return this.state.error!==void 0?y.createElement(ln.Provider,{value:this.props.routeContext},y.createElement(Md.Provider,{value:this.state.error,children:this.props.component})):this.props.children}}function Ug(e){let{routeContext:t,match:n,children:r}=e,i=y.useContext(vi);return i&&i.static&&i.staticContext&&(n.route.errorElement||n.route.ErrorBoundary)&&(i.staticContext._deepestRenderedBoundaryId=n.route.id),y.createElement(ln.Provider,{value:t},r)}function Bg(e,t,n,r){var i;if(t===void 0&&(t=[]),n===void 0&&(n=null),r===void 0&&(r=null),e==null){var o;if(!n)return null;if(n.errors)e=n.matches;else if((o=r)!=null&&o.v7_partialHydration&&t.length===0&&!n.initialized&&n.matches.length>0)e=n.matches;else return null}let a=e,s=(i=n)==null?void 0:i.errors;if(s!=null){let u=a.findIndex(d=>d.route.id&&s?.[d.route.id]!==void 0);u>=0||we(!1),a=a.slice(0,Math.min(a.length,u+1))}let l=!1,c=-1;if(n&&r&&r.v7_partialHydration)for(let u=0;u<a.length;u++){let d=a[u];if((d.route.HydrateFallback||d.route.hydrateFallbackElement)&&(c=u),d.route.id){let{loaderData:h,errors:f}=n,m=d.route.loader&&h[d.route.id]===void 0&&(!f||f[d.route.id]===void 0);if(d.route.lazy||m){l=!0,c>=0?a=a.slice(0,c+1):a=[a[0]];break}}}return a.reduceRight((u,d,h)=>{let f,m=!1,p=null,b=null;n&&(f=s&&d.route.id?s[d.route.id]:void 0,p=d.route.errorElement||Fg,l&&(c<0&&h===0?(qg("route-fallback"),m=!0,b=null):c===h&&(m=!0,b=d.route.hydrateFallbackElement||null)));let v=t.concat(a.slice(0,h+1)),x=()=>{let w;return f?w=p:m?w=b:d.route.Component?w=y.createElement(d.route.Component,null):d.route.element?w=d.route.element:w=u,y.createElement(Ug,{match:d,routeContext:{outlet:u,matches:v,isDataRoute:n!=null},children:w})};return n&&(d.route.ErrorBoundary||d.route.errorElement||h===0)?y.createElement(Hg,{location:n.location,revalidation:n.revalidation,component:p,error:f,children:x(),routeContext:{outlet:null,matches:v,isDataRoute:!0}}):x()},null)}var jd=function(e){return e.UseBlocker="useBlocker",e.UseRevalidator="useRevalidator",e.UseNavigateStable="useNavigate",e}(jd||{}),Fd=function(e){return e.UseBlocker="useBlocker",e.UseLoaderData="useLoaderData",e.UseActionData="useActionData",e.UseRouteError="useRouteError",e.UseNavigation="useNavigation",e.UseRouteLoaderData="useRouteLoaderData",e.UseMatches="useMatches",e.UseRevalidator="useRevalidator",e.UseNavigateStable="useNavigate",e.UseRouteId="useRouteId",e}(Fd||{});function zg(e){let t=y.useContext(vi);return t||we(!1),t}function $g(e){let t=y.useContext(Rs);return t||we(!1),t}function Vg(e){let t=y.useContext(ln);return t||we(!1),t}function Hd(e){let t=Vg(),n=t.matches[t.matches.length-1];return n.route.id||we(!1),n.route.id}function Wg(){var e;let t=y.useContext(Md),n=$g(),r=Hd();return t!==void 0?t:(e=n.errors)==null?void 0:e[r]}function Kg(){let{router:e}=zg(jd.UseNavigateStable),t=Hd(Fd.UseNavigateStable),n=y.useRef(!1);return _d(()=>{n.current=!0}),y.useCallback(function(i,o){o===void 0&&(o={}),n.current&&(typeof i=="number"?e.navigate(i):e.navigate(i,ro({fromRouteId:t},o)))},[e,t])}const Yl={};function qg(e,t,n){Yl[e]||(Yl[e]=!0)}function Gg(e,t){e?.v7_startTransition,e?.v7_relativeSplatPath===void 0&&(!t||t.v7_relativeSplatPath),t&&(t.v7_fetcherPersist,t.v7_normalizeFormMethod,t.v7_partialHydration,t.v7_skipActionErrorRevalidation)}function gn(e){let{to:t,replace:n,state:r,relative:i}=e;Lr()||we(!1);let{future:o,static:a}=y.useContext(sn),{matches:s}=y.useContext(ln),{pathname:l}=cn(),c=Po(),u=Ro(t,Eo(s,o.v7_relativeSplatPath),l,i==="path"),d=JSON.stringify(u);return y.useEffect(()=>c(JSON.parse(d),{replace:n,state:r,relative:i}),[c,d,i,n,r]),null}function c_(e){return Mg(e.context)}function Qg(e){let{basename:t="/",children:n=null,location:r,navigationType:i=Je.Pop,navigator:o,static:a=!1,future:s}=e;Lr()&&we(!1);let l=t.replace(/^\/*/,"/"),c=y.useMemo(()=>({basename:l,navigator:o,static:a,future:ro({v7_relativeSplatPath:!1},s)}),[l,s,o,a]);typeof r=="string"&&(r=En(r));let{pathname:u="/",search:d="",hash:h="",state:f=null,key:m="default"}=r,p=y.useMemo(()=>{let b=rn(u,l);return b==null?null:{location:{pathname:b,search:d,hash:h,state:f,key:m},navigationType:i}},[l,u,d,h,f,m,i]);return p==null?null:y.createElement(sn.Provider,{value:c},y.createElement(Ps.Provider,{children:n,value:p}))}new Promise(()=>{});function Yg(e){let t={hasErrorBoundary:e.ErrorBoundary!=null||e.errorElement!=null};return e.Component&&Object.assign(t,{element:y.createElement(e.Component),Component:void 0}),e.HydrateFallback&&Object.assign(t,{hydrateFallbackElement:y.createElement(e.HydrateFallback),HydrateFallback:void 0}),e.ErrorBoundary&&Object.assign(t,{errorElement:y.createElement(e.ErrorBoundary),ErrorBoundary:void 0}),t}/**
30
+ * React Router DOM v6.30.4
31
+ *
32
+ * Copyright (c) Remix Software Inc.
33
+ *
34
+ * This source code is licensed under the MIT license found in the
35
+ * LICENSE.md file in the root directory of this source tree.
36
+ *
37
+ * @license MIT
38
+ */function kr(){return kr=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},kr.apply(null,arguments)}function Ud(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}function Xg(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}function Jg(e,t){return e.button===0&&(!t||t==="_self")&&!Xg(e)}function Ma(e){return e===void 0&&(e=""),new URLSearchParams(typeof e=="string"||Array.isArray(e)||e instanceof URLSearchParams?e:Object.keys(e).reduce((t,n)=>{let r=e[n];return t.concat(Array.isArray(r)?r.map(i=>[n,i]):[[n,r]])},[]))}function Zg(e,t){let n=Ma(e);return t&&t.forEach((r,i)=>{n.has(i)||t.getAll(i).forEach(o=>{n.append(i,o)})}),n}const ey=["onClick","relative","reloadDocument","replace","state","target","to","preventScrollReset","viewTransition"],ty=["aria-current","caseSensitive","className","end","style","to","viewTransition","children"],ny="6";try{window.__reactRouterVersion=ny}catch{}function ry(e,t){return fg({basename:void 0,future:kr({},void 0,{v7_prependBasename:!0}),history:Mm({window:void 0}),hydrationData:iy(),routes:e,mapRouteProperties:Yg,dataStrategy:void 0,patchRoutesOnNavigation:void 0,window:void 0}).initialize()}function iy(){var e;let t=(e=window)==null?void 0:e.__staticRouterHydrationData;return t&&t.errors&&(t=kr({},t,{errors:oy(t.errors)})),t}function oy(e){if(!e)return null;let t=Object.entries(e),n={};for(let[r,i]of t)if(i&&i.__type==="RouteErrorResponse")n[r]=new no(i.status,i.statusText,i.data,i.internal===!0);else if(i&&i.__type==="Error"){if(i.__subType){let o=window[i.__subType];if(typeof o=="function")try{let a=new o(i.message);a.stack="",n[r]=a}catch{}}if(n[r]==null){let o=new Error(i.message);o.stack="",n[r]=o}}else n[r]=i;return n}const Bd=y.createContext({isTransitioning:!1}),ay=y.createContext(new Map),sy="startTransition",Xl=Ir[sy],ly="flushSync",Jl=Cm[ly];function cy(e){Xl?Xl(e):e()}function Kr(e){Jl?Jl(e):e()}class uy{constructor(){this.status="pending",this.promise=new Promise((t,n)=>{this.resolve=r=>{this.status==="pending"&&(this.status="resolved",t(r))},this.reject=r=>{this.status==="pending"&&(this.status="rejected",n(r))}})}}function dy(e){let{fallbackElement:t,router:n,future:r}=e,[i,o]=y.useState(n.state),[a,s]=y.useState(),[l,c]=y.useState({isTransitioning:!1}),[u,d]=y.useState(),[h,f]=y.useState(),[m,p]=y.useState(),b=y.useRef(new Map),{v7_startTransition:v}=r||{},x=y.useCallback(O=>{v?cy(O):O()},[v]),w=y.useCallback((O,_)=>{let{deletedFetchers:R,flushSync:D,viewTransitionOpts:L}=_;O.fetchers.forEach((H,V)=>{H.data!==void 0&&b.current.set(V,H.data)}),R.forEach(H=>b.current.delete(H));let z=n.window==null||n.window.document==null||typeof n.window.document.startViewTransition!="function";if(!L||z){D?Kr(()=>o(O)):x(()=>o(O));return}if(D){Kr(()=>{h&&(u&&u.resolve(),h.skipTransition()),c({isTransitioning:!0,flushSync:!0,currentLocation:L.currentLocation,nextLocation:L.nextLocation})});let H=n.window.document.startViewTransition(()=>{Kr(()=>o(O))});H.finished.finally(()=>{Kr(()=>{d(void 0),f(void 0),s(void 0),c({isTransitioning:!1})})}),Kr(()=>f(H));return}h?(u&&u.resolve(),h.skipTransition(),p({state:O,currentLocation:L.currentLocation,nextLocation:L.nextLocation})):(s(O),c({isTransitioning:!0,flushSync:!1,currentLocation:L.currentLocation,nextLocation:L.nextLocation}))},[n.window,h,u,b,x]);y.useLayoutEffect(()=>n.subscribe(w),[n,w]),y.useEffect(()=>{l.isTransitioning&&!l.flushSync&&d(new uy)},[l]),y.useEffect(()=>{if(u&&a&&n.window){let O=a,_=u.promise,R=n.window.document.startViewTransition(async()=>{x(()=>o(O)),await _});R.finished.finally(()=>{d(void 0),f(void 0),s(void 0),c({isTransitioning:!1})}),f(R)}},[x,a,u,n.window]),y.useEffect(()=>{u&&a&&i.location.key===a.location.key&&u.resolve()},[u,h,i.location,a]),y.useEffect(()=>{!l.isTransitioning&&m&&(s(m.state),c({isTransitioning:!0,flushSync:!1,currentLocation:m.currentLocation,nextLocation:m.nextLocation}),p(void 0))},[l.isTransitioning,m]),y.useEffect(()=>{},[]);let E=y.useMemo(()=>({createHref:n.createHref,encodeLocation:n.encodeLocation,go:O=>n.navigate(O),push:(O,_,R)=>n.navigate(O,{state:_,preventScrollReset:R?.preventScrollReset}),replace:(O,_,R)=>n.navigate(O,{replace:!0,state:_,preventScrollReset:R?.preventScrollReset})}),[n]),T=n.basename||"/",S=y.useMemo(()=>({router:n,navigator:E,static:!1,basename:T}),[n,E,T]),k=y.useMemo(()=>({v7_relativeSplatPath:n.future.v7_relativeSplatPath}),[n.future.v7_relativeSplatPath]);return y.useEffect(()=>Gg(r,n.future),[r,n.future]),y.createElement(y.Fragment,null,y.createElement(vi.Provider,{value:S},y.createElement(Rs.Provider,{value:i},y.createElement(ay.Provider,{value:b.current},y.createElement(Bd.Provider,{value:l},y.createElement(Qg,{basename:T,location:i.location,navigationType:i.historyAction,navigator:E,future:k},i.initialized||n.future.v7_partialHydration?y.createElement(fy,{routes:n.routes,future:n.future,state:i}):t))))),null)}const fy=y.memo(hy);function hy(e){let{routes:t,future:n,state:r}=e;return _g(t,void 0,r,n)}const py=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",my=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,ci=y.forwardRef(function(t,n){let{onClick:r,relative:i,reloadDocument:o,replace:a,state:s,target:l,to:c,preventScrollReset:u,viewTransition:d}=t,h=Ud(t,ey),{basename:f}=y.useContext(sn),m,p=!1;if(typeof c=="string"&&my.test(c)&&(m=c,py))try{let w=new URL(window.location.href),E=c.startsWith("//")?new URL(w.protocol+c):new URL(c),T=rn(E.pathname,f);E.origin===w.origin&&T!=null?c=T+E.search+E.hash:p=!0}catch{}let b=Og(c,{relative:i}),v=yy(c,{replace:a,state:s,target:l,preventScrollReset:u,relative:i,viewTransition:d});function x(w){r&&r(w),w.defaultPrevented||v(w)}return y.createElement("a",kr({},h,{href:m||b,onClick:p||o?r:x,ref:n,target:l}))}),Zl=y.forwardRef(function(t,n){let{"aria-current":r="page",caseSensitive:i=!1,className:o="",end:a=!1,style:s,to:l,viewTransition:c,children:u}=t,d=Ud(t,ty),h=To(l,{relative:d.relative}),f=cn(),m=y.useContext(Rs),{navigator:p,basename:b}=y.useContext(sn),v=m!=null&&by(h)&&c===!0,x=p.encodeLocation?p.encodeLocation(h).pathname:h.pathname,w=f.pathname,E=m&&m.navigation&&m.navigation.location?m.navigation.location.pathname:null;i||(w=w.toLowerCase(),E=E?E.toLowerCase():null,x=x.toLowerCase()),E&&b&&(E=rn(E,b)||E);const T=x!=="/"&&x.endsWith("/")?x.length-1:x.length;let S=w===x||!a&&w.startsWith(x)&&w.charAt(T)==="/",k=E!=null&&(E===x||!a&&E.startsWith(x)&&E.charAt(x.length)==="/"),O={isActive:S,isPending:k,isTransitioning:v},_=S?r:void 0,R;typeof o=="function"?R=o(O):R=[o,S?"active":null,k?"pending":null,v?"transitioning":null].filter(Boolean).join(" ");let D=typeof s=="function"?s(O):s;return y.createElement(ci,kr({},d,{"aria-current":_,className:R,ref:n,style:D,to:l,viewTransition:c}),typeof u=="function"?u(O):u)});var _a;(function(e){e.UseScrollRestoration="useScrollRestoration",e.UseSubmit="useSubmit",e.UseSubmitFetcher="useSubmitFetcher",e.UseFetcher="useFetcher",e.useViewTransitionState="useViewTransitionState"})(_a||(_a={}));var ec;(function(e){e.UseFetcher="useFetcher",e.UseFetchers="useFetchers",e.UseScrollRestoration="useScrollRestoration"})(ec||(ec={}));function gy(e){let t=y.useContext(vi);return t||we(!1),t}function yy(e,t){let{target:n,replace:r,state:i,preventScrollReset:o,relative:a,viewTransition:s}=t===void 0?{}:t,l=Po(),c=cn(),u=To(e,{relative:a});return y.useCallback(d=>{if(Jg(d,n)){d.preventDefault();let h=r!==void 0?r:Yn(c)===Yn(u);l(e,{replace:h,state:i,preventScrollReset:o,relative:a,viewTransition:s})}},[c,l,u,r,i,n,e,o,a,s])}function zd(e){let t=y.useRef(Ma(e)),n=y.useRef(!1),r=cn(),i=y.useMemo(()=>Zg(r.search,n.current?null:t.current),[r.search]),o=Po(),a=y.useCallback((s,l)=>{const c=Ma(typeof s=="function"?s(i):s);n.current=!0,o("?"+c,l)},[o,i]);return[i,a]}function by(e,t){t===void 0&&(t={});let n=y.useContext(Bd);n==null&&we(!1);let{basename:r}=gy(_a.useViewTransitionState),i=To(e,{relative:t.relative});if(!n.isTransitioning)return!1;let o=rn(n.currentLocation.pathname,r)||n.currentLocation.pathname,a=rn(n.nextLocation.pathname,r)||n.nextLocation.pathname;return to(i.pathname,a)!=null||to(i.pathname,o)!=null}const tc=e=>{let t;const n=new Set,r=(c,u)=>{const d=typeof c=="function"?c(t):c;if(!Object.is(d,t)){const h=t;t=u??(typeof d!="object"||d===null)?d:Object.assign({},t,d),n.forEach(f=>f(t,h))}},i=()=>t,s={setState:r,getState:i,getInitialState:()=>l,subscribe:c=>(n.add(c),()=>n.delete(c))},l=t=e(r,i,s);return s},vy=e=>e?tc(e):tc,xy=e=>e;function wy(e,t=xy){const n=K.useSyncExternalStore(e.subscribe,K.useCallback(()=>t(e.getState()),[e,t]),K.useCallback(()=>t(e.getInitialState()),[e,t]));return K.useDebugValue(n),n}const nc=e=>{const t=vy(e),n=r=>wy(t,r);return Object.assign(n,t),n},$d=e=>e?nc(e):nc,io="agim_token";function ky(){try{return localStorage.getItem(io)}catch{return null}}function rc(e){try{e?localStorage.setItem(io,e):localStorage.removeItem(io)}catch{}}const ic=ky(),Ts=$d(e=>({token:ic,signedIn:!!ic,setToken:t=>{rc(t),e({token:t,signedIn:!!t})},clear:()=>{rc(null),e({token:null,signedIn:!1})}}));function Sy(){function e(t){if(t.key!==io)return;const n=t.newValue;Ts.setState({token:n,signedIn:!!n})}return window.addEventListener("storage",e),()=>window.removeEventListener("storage",e)}function Vd({children:e}){const t=Ts(r=>r.signedIn),n=cn();if(!t){const r=encodeURIComponent(n.pathname+n.search);return g.jsx(gn,{to:`/login?next=${r}`,replace:!0})}return g.jsx(g.Fragment,{children:e})}const Ay=(e,t,n,r)=>{const i=[n,{code:t,...r||{}}];if(e?.services?.logger?.forward)return e.services.logger.forward(i,"warn","react-i18next::",!0);qn(i[0])&&(i[0]=`react-i18next:: ${i[0]}`),e?.services?.logger?.warn?e.services.logger.warn(...i):console?.warn&&console.warn(...i)},oc={},ja=(e,t,n,r)=>{qn(n)&&oc[n]||(qn(n)&&(oc[n]=new Date),Ay(e,t,n,r))},Wd=(e,t)=>()=>{if(e.isInitialized)t();else{const n=()=>{setTimeout(()=>{e.off("initialized",n)},0),t()};e.on("initialized",n)}},Fa=(e,t,n)=>{e.loadNamespaces(t,Wd(e,n))},ac=(e,t,n,r)=>{if(qn(n)&&(n=[n]),e.options.preload&&e.options.preload.indexOf(t)>-1)return Fa(e,n,r);n.forEach(i=>{e.options.ns.indexOf(i)<0&&e.options.ns.push(i)}),e.loadLanguages(t,Wd(e,r))},Cy=(e,t,n={})=>!t.languages||!t.languages.length?(ja(t,"NO_LANGUAGES","i18n.languages were undefined or empty",{languages:t.languages}),!0):t.hasLoadedNamespace(e,{lng:n.lng,precheck:(r,i)=>{if(n.bindI18n&&n.bindI18n.indexOf("languageChanging")>-1&&r.services.backendConnector.backend&&r.isLanguageChangingTo&&!i(r.isLanguageChangingTo,e))return!1}}),qn=e=>typeof e=="string",Ey=e=>typeof e=="object"&&e!==null,Ry=/&(?:amp|#38|lt|#60|gt|#62|apos|#39|quot|#34|nbsp|#160|copy|#169|reg|#174|hellip|#8230|#x2F|#47);/g,Py={"&amp;":"&","&#38;":"&","&lt;":"<","&#60;":"<","&gt;":">","&#62;":">","&apos;":"'","&#39;":"'","&quot;":'"',"&#34;":'"',"&nbsp;":" ","&#160;":" ","&copy;":"©","&#169;":"©","&reg;":"®","&#174;":"®","&hellip;":"…","&#8230;":"…","&#x2F;":"/","&#47;":"/"},Ty=e=>Py[e],Iy=e=>e.replace(Ry,Ty);let Ha={bindI18n:"languageChanged",bindI18nStore:"",transEmptyNodeValue:"",transSupportBasicHtmlNodes:!0,transWrapTextNodes:"",transKeepBasicHtmlNodesFor:["br","strong","i","p"],useSuspense:!0,unescape:Iy};const Ly=(e={})=>{Ha={...Ha,...e}},Oy=()=>Ha;let Kd;const Dy=e=>{Kd=e},Ny=()=>Kd,My={type:"3rdParty",init(e){Ly(e.options.react),Dy(e)}},_y=y.createContext();class jy{constructor(){this.usedNamespaces={}}addUsedNamespaces(t){t.forEach(n=>{this.usedNamespaces[n]||(this.usedNamespaces[n]=!0)})}getUsedNamespaces(){return Object.keys(this.usedNamespaces)}}const Fy=(e,t)=>{const n=y.useRef();return y.useEffect(()=>{n.current=e},[e,t]),n.current},qd=(e,t,n,r)=>e.getFixedT(t,n,r),Hy=(e,t,n,r)=>y.useCallback(qd(e,t,n,r),[e,t,n,r]),ot=(e,t={})=>{const{i18n:n}=t,{i18n:r,defaultNS:i}=y.useContext(_y)||{},o=n||r||Ny();if(o&&!o.reportNamespaces&&(o.reportNamespaces=new jy),!o){ja(o,"NO_I18NEXT_INSTANCE","useTranslation: You will need to pass in an i18next instance by using initReactI18next");const E=(S,k)=>qn(k)?k:Ey(k)&&qn(k.defaultValue)?k.defaultValue:Array.isArray(S)?S[S.length-1]:S,T=[E,{},!1];return T.t=E,T.i18n={},T.ready=!1,T}o.options.react?.wait&&ja(o,"DEPRECATED_OPTION","useTranslation: It seems you are still using the old wait option, you may migrate to the new useSuspense behaviour.");const a={...Oy(),...o.options.react,...t},{useSuspense:s,keyPrefix:l}=a;let c=e||i||o.options?.defaultNS;c=qn(c)?[c]:c||["translation"],o.reportNamespaces.addUsedNamespaces?.(c);const u=(o.isInitialized||o.initializedStoreOnce)&&c.every(E=>Cy(E,o,a)),d=Hy(o,t.lng||null,a.nsMode==="fallback"?c:c[0],l),h=()=>d,f=()=>qd(o,t.lng||null,a.nsMode==="fallback"?c:c[0],l),[m,p]=y.useState(h);let b=c.join();t.lng&&(b=`${t.lng}${b}`);const v=Fy(b),x=y.useRef(!0);y.useEffect(()=>{const{bindI18n:E,bindI18nStore:T}=a;x.current=!0,!u&&!s&&(t.lng?ac(o,t.lng,c,()=>{x.current&&p(f)}):Fa(o,c,()=>{x.current&&p(f)})),u&&v&&v!==b&&x.current&&p(f);const S=()=>{x.current&&p(f)};return E&&o?.on(E,S),T&&o?.store.on(T,S),()=>{x.current=!1,o&&E&&E?.split(" ").forEach(k=>o.off(k,S)),T&&o&&T.split(" ").forEach(k=>o.store.off(k,S))}},[o,b]),y.useEffect(()=>{x.current&&u&&p(h)},[o,l,u]);const w=[m,o,u];if(w.t=m,w.i18n=o,w.ready=u,u||!u&&!s)return w;throw new Promise(E=>{t.lng?ac(o,t.lng,c,()=>E()):Fa(o,c,()=>E())})};/**
39
+ * @license lucide-react v0.469.0 - ISC
40
+ *
41
+ * This source code is licensed under the ISC license.
42
+ * See the LICENSE file in the root directory of this source tree.
43
+ */const Uy=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),Gd=(...e)=>e.filter((t,n,r)=>!!t&&t.trim()!==""&&r.indexOf(t)===n).join(" ").trim();/**
44
+ * @license lucide-react v0.469.0 - ISC
45
+ *
46
+ * This source code is licensed under the ISC license.
47
+ * See the LICENSE file in the root directory of this source tree.
48
+ */var By={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};/**
49
+ * @license lucide-react v0.469.0 - ISC
50
+ *
51
+ * This source code is licensed under the ISC license.
52
+ * See the LICENSE file in the root directory of this source tree.
53
+ */const zy=y.forwardRef(({color:e="currentColor",size:t=24,strokeWidth:n=2,absoluteStrokeWidth:r,className:i="",children:o,iconNode:a,...s},l)=>y.createElement("svg",{ref:l,...By,width:t,height:t,stroke:e,strokeWidth:r?Number(n)*24/Number(t):n,className:Gd("lucide",i),...s},[...a.map(([c,u])=>y.createElement(c,u)),...Array.isArray(o)?o:[o]]));/**
54
+ * @license lucide-react v0.469.0 - ISC
55
+ *
56
+ * This source code is licensed under the ISC license.
57
+ * See the LICENSE file in the root directory of this source tree.
58
+ */const Qe=(e,t)=>{const n=y.forwardRef(({className:r,...i},o)=>y.createElement(zy,{ref:o,iconNode:t,className:Gd(`lucide-${Uy(e)}`,r),...i}));return n.displayName=`${e}`,n};/**
59
+ * @license lucide-react v0.469.0 - ISC
60
+ *
61
+ * This source code is licensed under the ISC license.
62
+ * See the LICENSE file in the root directory of this source tree.
63
+ */const $y=Qe("Bot",[["path",{d:"M12 8V4H8",key:"hb8ula"}],["rect",{width:"16",height:"12",x:"4",y:"8",rx:"2",key:"enze0r"}],["path",{d:"M2 14h2",key:"vft8re"}],["path",{d:"M20 14h2",key:"4cs60a"}],["path",{d:"M15 13v2",key:"1xurst"}],["path",{d:"M9 13v2",key:"rq6x2g"}]]);/**
64
+ * @license lucide-react v0.469.0 - ISC
65
+ *
66
+ * This source code is licensed under the ISC license.
67
+ * See the LICENSE file in the root directory of this source tree.
68
+ */const Vy=Qe("Check",[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]]);/**
69
+ * @license lucide-react v0.469.0 - ISC
70
+ *
71
+ * This source code is licensed under the ISC license.
72
+ * See the LICENSE file in the root directory of this source tree.
73
+ */const Qd=Qe("ChevronDown",[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]]);/**
74
+ * @license lucide-react v0.469.0 - ISC
75
+ *
76
+ * This source code is licensed under the ISC license.
77
+ * See the LICENSE file in the root directory of this source tree.
78
+ */const Wy=Qe("ChevronUp",[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]]);/**
79
+ * @license lucide-react v0.469.0 - ISC
80
+ *
81
+ * This source code is licensed under the ISC license.
82
+ * See the LICENSE file in the root directory of this source tree.
83
+ */const Ky=Qe("CircleAlert",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["line",{x1:"12",x2:"12",y1:"8",y2:"12",key:"1pkeuh"}],["line",{x1:"12",x2:"12.01",y1:"16",y2:"16",key:"4dfq90"}]]);/**
84
+ * @license lucide-react v0.469.0 - ISC
85
+ *
86
+ * This source code is licensed under the ISC license.
87
+ * See the LICENSE file in the root directory of this source tree.
88
+ */const qy=Qe("CircleCheck",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]]);/**
89
+ * @license lucide-react v0.469.0 - ISC
90
+ *
91
+ * This source code is licensed under the ISC license.
92
+ * See the LICENSE file in the root directory of this source tree.
93
+ */const Gy=Qe("FileQuestion",[["path",{d:"M12 17h.01",key:"p32p05"}],["path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7z",key:"1mlx9k"}],["path",{d:"M9.1 9a3 3 0 0 1 5.82 1c0 2-3 3-3 3",key:"mhlwft"}]]);/**
94
+ * @license lucide-react v0.469.0 - ISC
95
+ *
96
+ * This source code is licensed under the ISC license.
97
+ * See the LICENSE file in the root directory of this source tree.
98
+ */const Qy=Qe("House",[["path",{d:"M15 21v-8a1 1 0 0 0-1-1h-4a1 1 0 0 0-1 1v8",key:"5wwlr5"}],["path",{d:"M3 10a2 2 0 0 1 .709-1.528l7-5.999a2 2 0 0 1 2.582 0l7 5.999A2 2 0 0 1 21 10v9a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z",key:"1d0kgt"}]]);/**
99
+ * @license lucide-react v0.469.0 - ISC
100
+ *
101
+ * This source code is licensed under the ISC license.
102
+ * See the LICENSE file in the root directory of this source tree.
103
+ */const Yy=Qe("Laptop",[["path",{d:"M20 16V7a2 2 0 0 0-2-2H6a2 2 0 0 0-2 2v9m16 0H4m16 0 1.28 2.55a1 1 0 0 1-.9 1.45H3.62a1 1 0 0 1-.9-1.45L4 16",key:"tarvll"}]]);/**
104
+ * @license lucide-react v0.469.0 - ISC
105
+ *
106
+ * This source code is licensed under the ISC license.
107
+ * See the LICENSE file in the root directory of this source tree.
108
+ */const Xy=Qe("ListChecks",[["path",{d:"m3 17 2 2 4-4",key:"1jhpwq"}],["path",{d:"m3 7 2 2 4-4",key:"1obspn"}],["path",{d:"M13 6h8",key:"15sg57"}],["path",{d:"M13 12h8",key:"h98zly"}],["path",{d:"M13 18h8",key:"oe0vm4"}]]);/**
109
+ * @license lucide-react v0.469.0 - ISC
110
+ *
111
+ * This source code is licensed under the ISC license.
112
+ * See the LICENSE file in the root directory of this source tree.
113
+ */const Jy=Qe("MessageSquarePlus",[["path",{d:"M21 15a2 2 0 0 1-2 2H7l-4 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2z",key:"1lielz"}],["path",{d:"M12 7v6",key:"lw1j43"}],["path",{d:"M9 10h6",key:"9gxzsh"}]]);/**
114
+ * @license lucide-react v0.469.0 - ISC
115
+ *
116
+ * This source code is licensed under the ISC license.
117
+ * See the LICENSE file in the root directory of this source tree.
118
+ */const Zy=Qe("MessageSquare",[["path",{d:"M21 15a2 2 0 0 1-2 2H7l-4 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2z",key:"1lielz"}]]);/**
119
+ * @license lucide-react v0.469.0 - ISC
120
+ *
121
+ * This source code is licensed under the ISC license.
122
+ * See the LICENSE file in the root directory of this source tree.
123
+ */const eb=Qe("Moon",[["path",{d:"M12 3a6 6 0 0 0 9 9 9 9 0 1 1-9-9Z",key:"a7tn18"}]]);/**
124
+ * @license lucide-react v0.469.0 - ISC
125
+ *
126
+ * This source code is licensed under the ISC license.
127
+ * See the LICENSE file in the root directory of this source tree.
128
+ */const sc=Qe("Plug",[["path",{d:"M12 22v-5",key:"1ega77"}],["path",{d:"M9 8V2",key:"14iosj"}],["path",{d:"M15 8V2",key:"18g5xt"}],["path",{d:"M18 8v5a4 4 0 0 1-4 4h-4a4 4 0 0 1-4-4V8Z",key:"osxo6l"}]]);/**
129
+ * @license lucide-react v0.469.0 - ISC
130
+ *
131
+ * This source code is licensed under the ISC license.
132
+ * See the LICENSE file in the root directory of this source tree.
133
+ */const tb=Qe("RotateCcw",[["path",{d:"M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8",key:"1357e3"}],["path",{d:"M3 3v5h5",key:"1xhq8a"}]]);/**
134
+ * @license lucide-react v0.469.0 - ISC
135
+ *
136
+ * This source code is licensed under the ISC license.
137
+ * See the LICENSE file in the root directory of this source tree.
138
+ */const Ua=Qe("Send",[["path",{d:"M14.536 21.686a.5.5 0 0 0 .937-.024l6.5-19a.496.496 0 0 0-.635-.635l-19 6.5a.5.5 0 0 0-.024.937l7.93 3.18a2 2 0 0 1 1.112 1.11z",key:"1ffxy3"}],["path",{d:"m21.854 2.147-10.94 10.939",key:"12cjpa"}]]);/**
139
+ * @license lucide-react v0.469.0 - ISC
140
+ *
141
+ * This source code is licensed under the ISC license.
142
+ * See the LICENSE file in the root directory of this source tree.
143
+ */const nb=Qe("Settings",[["path",{d:"M12.22 2h-.44a2 2 0 0 0-2 2v.18a2 2 0 0 1-1 1.73l-.43.25a2 2 0 0 1-2 0l-.15-.08a2 2 0 0 0-2.73.73l-.22.38a2 2 0 0 0 .73 2.73l.15.1a2 2 0 0 1 1 1.72v.51a2 2 0 0 1-1 1.74l-.15.09a2 2 0 0 0-.73 2.73l.22.38a2 2 0 0 0 2.73.73l.15-.08a2 2 0 0 1 2 0l.43.25a2 2 0 0 1 1 1.73V20a2 2 0 0 0 2 2h.44a2 2 0 0 0 2-2v-.18a2 2 0 0 1 1-1.73l.43-.25a2 2 0 0 1 2 0l.15.08a2 2 0 0 0 2.73-.73l.22-.39a2 2 0 0 0-.73-2.73l-.15-.08a2 2 0 0 1-1-1.74v-.5a2 2 0 0 1 1-1.74l.15-.09a2 2 0 0 0 .73-2.73l-.22-.38a2 2 0 0 0-2.73-.73l-.15.08a2 2 0 0 1-2 0l-.43-.25a2 2 0 0 1-1-1.73V4a2 2 0 0 0-2-2z",key:"1qme2f"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]]);/**
144
+ * @license lucide-react v0.469.0 - ISC
145
+ *
146
+ * This source code is licensed under the ISC license.
147
+ * See the LICENSE file in the root directory of this source tree.
148
+ */const rb=Qe("ShieldCheck",[["path",{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z",key:"oel41y"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]]);/**
149
+ * @license lucide-react v0.469.0 - ISC
150
+ *
151
+ * This source code is licensed under the ISC license.
152
+ * See the LICENSE file in the root directory of this source tree.
153
+ */const ib=Qe("SunMedium",[["circle",{cx:"12",cy:"12",r:"4",key:"4exip2"}],["path",{d:"M12 3v1",key:"1asbbs"}],["path",{d:"M12 20v1",key:"1wcdkc"}],["path",{d:"M3 12h1",key:"lp3yf2"}],["path",{d:"M20 12h1",key:"1vloll"}],["path",{d:"m18.364 5.636-.707.707",key:"1hakh0"}],["path",{d:"m6.343 17.657-.707.707",key:"18m9nf"}],["path",{d:"m5.636 5.636.707.707",key:"1xv1c5"}],["path",{d:"m17.657 17.657.707.707",key:"vl76zb"}]]);/**
154
+ * @license lucide-react v0.469.0 - ISC
155
+ *
156
+ * This source code is licensed under the ISC license.
157
+ * See the LICENSE file in the root directory of this source tree.
158
+ */const ob=Qe("TriangleAlert",[["path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3",key:"wmoenq"}],["path",{d:"M12 9v4",key:"juzpu7"}],["path",{d:"M12 17h.01",key:"p32p05"}]]);/**
159
+ * @license lucide-react v0.469.0 - ISC
160
+ *
161
+ * This source code is licensed under the ISC license.
162
+ * See the LICENSE file in the root directory of this source tree.
163
+ */const ab=Qe("X",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]);function lc(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function sb(...e){return t=>{let n=!1;const r=e.map(i=>{const o=lc(i,t);return!n&&typeof o=="function"&&(n=!0),o});if(n)return()=>{for(let i=0;i<r.length;i++){const o=r[i];typeof o=="function"?o():lc(e[i],null)}}}}function $e(...e){return y.useCallback(sb(...e),e)}function Sr(e){const t=y.forwardRef((n,r)=>{let{children:i,...o}=n,a=null,s=!1;const l=[];cc(i)&&typeof Ti=="function"&&(i=Ti(i._payload)),y.Children.forEach(i,h=>{if(hb(h)){s=!0;const f=h;let m="child"in f.props?f.props.child:f.props.children;cc(m)&&typeof Ti=="function"&&(m=Ti(m._payload)),a=ub(f,m),l.push(a?.props?.children)}else l.push(h)}),a?a=y.cloneElement(a,void 0,l):!s&&y.Children.count(i)===1&&y.isValidElement(i)&&(a=i);const c=a?fb(a):void 0,u=$e(r,c);if(!a){if(i||i===0)throw new Error(s?yb(e):gb(e));return i}const d=db(o,a.props??{});return a.type!==y.Fragment&&(d.ref=r?u:c),y.cloneElement(a,d)});return t.displayName=`${e}.Slot`,t}var lb=Sr("Slot"),Yd=Symbol.for("radix.slottable");function cb(e){const t=n=>"child"in n?n.children(n.child):n.children;return t.displayName=`${e}.Slottable`,t.__radixId=Yd,t}var ub=(e,t)=>{if("child"in e.props){const n=e.props.child;return y.isValidElement(n)?y.cloneElement(n,void 0,e.props.children(n.props.children)):null}return y.isValidElement(t)?t:null};function db(e,t){const n={...t};for(const r in t){const i=e[r],o=t[r];/^on[A-Z]/.test(r)?i&&o?n[r]=(...s)=>{const l=o(...s);return i(...s),l}:i&&(n[r]=i):r==="style"?n[r]={...i,...o}:r==="className"&&(n[r]=[i,o].filter(Boolean).join(" "))}return{...e,...n}}function fb(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}function hb(e){return y.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===Yd}var pb=Symbol.for("react.lazy");function cc(e){return e!=null&&typeof e=="object"&&"$$typeof"in e&&e.$$typeof===pb&&"_payload"in e&&mb(e._payload)}function mb(e){return typeof e=="object"&&e!==null&&"then"in e}var gb=e=>`${e} failed to slot onto its children. Expected a single React element child or \`Slottable\`.`,yb=e=>`${e} failed to slot onto its \`Slottable\`. Expected \`Slottable\` to receive a single React element child.`,Ti=Ir[" use ".trim().toString()];function Xd(e){var t,n,r="";if(typeof e=="string"||typeof e=="number")r+=e;else if(typeof e=="object")if(Array.isArray(e)){var i=e.length;for(t=0;t<i;t++)e[t]&&(n=Xd(e[t]))&&(r&&(r+=" "),r+=n)}else for(n in e)e[n]&&(r&&(r+=" "),r+=n);return r}function Jd(){for(var e,t,n=0,r="",i=arguments.length;n<i;n++)(e=arguments[n])&&(t=Xd(e))&&(r&&(r+=" "),r+=t);return r}const uc=e=>typeof e=="boolean"?`${e}`:e===0?"0":e,dc=Jd,Is=(e,t)=>n=>{var r;if(t?.variants==null)return dc(e,n?.class,n?.className);const{variants:i,defaultVariants:o}=t,a=Object.keys(i).map(c=>{const u=n?.[c],d=o?.[c];if(u===null)return null;const h=uc(u)||uc(d);return i[c][h]}),s=n&&Object.entries(n).reduce((c,u)=>{let[d,h]=u;return h===void 0||(c[d]=h),c},{}),l=t==null||(r=t.compoundVariants)===null||r===void 0?void 0:r.reduce((c,u)=>{let{class:d,className:h,...f}=u;return Object.entries(f).every(m=>{let[p,b]=m;return Array.isArray(b)?b.includes({...o,...s}[p]):{...o,...s}[p]===b})?[...c,d,h]:c},[]);return dc(e,a,l,n?.class,n?.className)},Ls="-",bb=e=>{const t=xb(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:r}=e;return{getClassGroupId:a=>{const s=a.split(Ls);return s[0]===""&&s.length!==1&&s.shift(),Zd(s,t)||vb(a)},getConflictingClassGroupIds:(a,s)=>{const l=n[a]||[];return s&&r[a]?[...l,...r[a]]:l}}},Zd=(e,t)=>{if(e.length===0)return t.classGroupId;const n=e[0],r=t.nextPart.get(n),i=r?Zd(e.slice(1),r):void 0;if(i)return i;if(t.validators.length===0)return;const o=e.join(Ls);return t.validators.find(({validator:a})=>a(o))?.classGroupId},fc=/^\[(.+)\]$/,vb=e=>{if(fc.test(e)){const t=fc.exec(e)[1],n=t?.substring(0,t.indexOf(":"));if(n)return"arbitrary.."+n}},xb=e=>{const{theme:t,prefix:n}=e,r={nextPart:new Map,validators:[]};return kb(Object.entries(e.classGroups),n).forEach(([o,a])=>{Ba(a,r,o,t)}),r},Ba=(e,t,n,r)=>{e.forEach(i=>{if(typeof i=="string"){const o=i===""?t:hc(t,i);o.classGroupId=n;return}if(typeof i=="function"){if(wb(i)){Ba(i(r),t,n,r);return}t.validators.push({validator:i,classGroupId:n});return}Object.entries(i).forEach(([o,a])=>{Ba(a,hc(t,o),n,r)})})},hc=(e,t)=>{let n=e;return t.split(Ls).forEach(r=>{n.nextPart.has(r)||n.nextPart.set(r,{nextPart:new Map,validators:[]}),n=n.nextPart.get(r)}),n},wb=e=>e.isThemeGetter,kb=(e,t)=>t?e.map(([n,r])=>{const i=r.map(o=>typeof o=="string"?t+o:typeof o=="object"?Object.fromEntries(Object.entries(o).map(([a,s])=>[t+a,s])):o);return[n,i]}):e,Sb=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,n=new Map,r=new Map;const i=(o,a)=>{n.set(o,a),t++,t>e&&(t=0,r=n,n=new Map)};return{get(o){let a=n.get(o);if(a!==void 0)return a;if((a=r.get(o))!==void 0)return i(o,a),a},set(o,a){n.has(o)?n.set(o,a):i(o,a)}}},ef="!",Ab=e=>{const{separator:t,experimentalParseClassName:n}=e,r=t.length===1,i=t[0],o=t.length,a=s=>{const l=[];let c=0,u=0,d;for(let b=0;b<s.length;b++){let v=s[b];if(c===0){if(v===i&&(r||s.slice(b,b+o)===t)){l.push(s.slice(u,b)),u=b+o;continue}if(v==="/"){d=b;continue}}v==="["?c++:v==="]"&&c--}const h=l.length===0?s:s.substring(u),f=h.startsWith(ef),m=f?h.substring(1):h,p=d&&d>u?d-u:void 0;return{modifiers:l,hasImportantModifier:f,baseClassName:m,maybePostfixModifierPosition:p}};return n?s=>n({className:s,parseClassName:a}):a},Cb=e=>{if(e.length<=1)return e;const t=[];let n=[];return e.forEach(r=>{r[0]==="["?(t.push(...n.sort(),r),n=[]):n.push(r)}),t.push(...n.sort()),t},Eb=e=>({cache:Sb(e.cacheSize),parseClassName:Ab(e),...bb(e)}),Rb=/\s+/,Pb=(e,t)=>{const{parseClassName:n,getClassGroupId:r,getConflictingClassGroupIds:i}=t,o=[],a=e.trim().split(Rb);let s="";for(let l=a.length-1;l>=0;l-=1){const c=a[l],{modifiers:u,hasImportantModifier:d,baseClassName:h,maybePostfixModifierPosition:f}=n(c);let m=!!f,p=r(m?h.substring(0,f):h);if(!p){if(!m){s=c+(s.length>0?" "+s:s);continue}if(p=r(h),!p){s=c+(s.length>0?" "+s:s);continue}m=!1}const b=Cb(u).join(":"),v=d?b+ef:b,x=v+p;if(o.includes(x))continue;o.push(x);const w=i(p,m);for(let E=0;E<w.length;++E){const T=w[E];o.push(v+T)}s=c+(s.length>0?" "+s:s)}return s};function Tb(){let e=0,t,n,r="";for(;e<arguments.length;)(t=arguments[e++])&&(n=tf(t))&&(r&&(r+=" "),r+=n);return r}const tf=e=>{if(typeof e=="string")return e;let t,n="";for(let r=0;r<e.length;r++)e[r]&&(t=tf(e[r]))&&(n&&(n+=" "),n+=t);return n};function Ib(e,...t){let n,r,i,o=a;function a(l){const c=t.reduce((u,d)=>d(u),e());return n=Eb(c),r=n.cache.get,i=n.cache.set,o=s,s(l)}function s(l){const c=r(l);if(c)return c;const u=Pb(l,n);return i(l,u),u}return function(){return o(Tb.apply(null,arguments))}}const He=e=>{const t=n=>n[e]||[];return t.isThemeGetter=!0,t},nf=/^\[(?:([a-z-]+):)?(.+)\]$/i,Lb=/^\d+\/\d+$/,Ob=new Set(["px","full","screen"]),Db=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,Nb=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,Mb=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,_b=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,jb=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,tn=e=>br(e)||Ob.has(e)||Lb.test(e),fn=e=>Or(e,"length",Wb),br=e=>!!e&&!Number.isNaN(Number(e)),ra=e=>Or(e,"number",br),qr=e=>!!e&&Number.isInteger(Number(e)),Fb=e=>e.endsWith("%")&&br(e.slice(0,-1)),ye=e=>nf.test(e),hn=e=>Db.test(e),Hb=new Set(["length","size","percentage"]),Ub=e=>Or(e,Hb,rf),Bb=e=>Or(e,"position",rf),zb=new Set(["image","url"]),$b=e=>Or(e,zb,qb),Vb=e=>Or(e,"",Kb),Gr=()=>!0,Or=(e,t,n)=>{const r=nf.exec(e);return r?r[1]?typeof t=="string"?r[1]===t:t.has(r[1]):n(r[2]):!1},Wb=e=>Nb.test(e)&&!Mb.test(e),rf=()=>!1,Kb=e=>_b.test(e),qb=e=>jb.test(e),Gb=()=>{const e=He("colors"),t=He("spacing"),n=He("blur"),r=He("brightness"),i=He("borderColor"),o=He("borderRadius"),a=He("borderSpacing"),s=He("borderWidth"),l=He("contrast"),c=He("grayscale"),u=He("hueRotate"),d=He("invert"),h=He("gap"),f=He("gradientColorStops"),m=He("gradientColorStopPositions"),p=He("inset"),b=He("margin"),v=He("opacity"),x=He("padding"),w=He("saturate"),E=He("scale"),T=He("sepia"),S=He("skew"),k=He("space"),O=He("translate"),_=()=>["auto","contain","none"],R=()=>["auto","hidden","clip","visible","scroll"],D=()=>["auto",ye,t],L=()=>[ye,t],z=()=>["",tn,fn],H=()=>["auto",br,ye],V=()=>["bottom","center","left","left-bottom","left-top","right","right-bottom","right-top","top"],Q=()=>["solid","dashed","dotted","double","none"],Y=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],W=()=>["start","end","center","between","around","evenly","stretch"],F=()=>["","0",ye],A=()=>["auto","avoid","all","avoid-page","page","left","right","column"],ie=()=>[br,ye];return{cacheSize:500,separator:":",theme:{colors:[Gr],spacing:[tn,fn],blur:["none","",hn,ye],brightness:ie(),borderColor:[e],borderRadius:["none","","full",hn,ye],borderSpacing:L(),borderWidth:z(),contrast:ie(),grayscale:F(),hueRotate:ie(),invert:F(),gap:L(),gradientColorStops:[e],gradientColorStopPositions:[Fb,fn],inset:D(),margin:D(),opacity:ie(),padding:L(),saturate:ie(),scale:ie(),sepia:F(),skew:ie(),space:L(),translate:L()},classGroups:{aspect:[{aspect:["auto","square","video",ye]}],container:["container"],columns:[{columns:[hn]}],"break-after":[{"break-after":A()}],"break-before":[{"break-before":A()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:[...V(),ye]}],overflow:[{overflow:R()}],"overflow-x":[{"overflow-x":R()}],"overflow-y":[{"overflow-y":R()}],overscroll:[{overscroll:_()}],"overscroll-x":[{"overscroll-x":_()}],"overscroll-y":[{"overscroll-y":_()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:[p]}],"inset-x":[{"inset-x":[p]}],"inset-y":[{"inset-y":[p]}],start:[{start:[p]}],end:[{end:[p]}],top:[{top:[p]}],right:[{right:[p]}],bottom:[{bottom:[p]}],left:[{left:[p]}],visibility:["visible","invisible","collapse"],z:[{z:["auto",qr,ye]}],basis:[{basis:D()}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["wrap","wrap-reverse","nowrap"]}],flex:[{flex:["1","auto","initial","none",ye]}],grow:[{grow:F()}],shrink:[{shrink:F()}],order:[{order:["first","last","none",qr,ye]}],"grid-cols":[{"grid-cols":[Gr]}],"col-start-end":[{col:["auto",{span:["full",qr,ye]},ye]}],"col-start":[{"col-start":H()}],"col-end":[{"col-end":H()}],"grid-rows":[{"grid-rows":[Gr]}],"row-start-end":[{row:["auto",{span:[qr,ye]},ye]}],"row-start":[{"row-start":H()}],"row-end":[{"row-end":H()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":["auto","min","max","fr",ye]}],"auto-rows":[{"auto-rows":["auto","min","max","fr",ye]}],gap:[{gap:[h]}],"gap-x":[{"gap-x":[h]}],"gap-y":[{"gap-y":[h]}],"justify-content":[{justify:["normal",...W()]}],"justify-items":[{"justify-items":["start","end","center","stretch"]}],"justify-self":[{"justify-self":["auto","start","end","center","stretch"]}],"align-content":[{content:["normal",...W(),"baseline"]}],"align-items":[{items:["start","end","center","baseline","stretch"]}],"align-self":[{self:["auto","start","end","center","stretch","baseline"]}],"place-content":[{"place-content":[...W(),"baseline"]}],"place-items":[{"place-items":["start","end","center","baseline","stretch"]}],"place-self":[{"place-self":["auto","start","end","center","stretch"]}],p:[{p:[x]}],px:[{px:[x]}],py:[{py:[x]}],ps:[{ps:[x]}],pe:[{pe:[x]}],pt:[{pt:[x]}],pr:[{pr:[x]}],pb:[{pb:[x]}],pl:[{pl:[x]}],m:[{m:[b]}],mx:[{mx:[b]}],my:[{my:[b]}],ms:[{ms:[b]}],me:[{me:[b]}],mt:[{mt:[b]}],mr:[{mr:[b]}],mb:[{mb:[b]}],ml:[{ml:[b]}],"space-x":[{"space-x":[k]}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":[k]}],"space-y-reverse":["space-y-reverse"],w:[{w:["auto","min","max","fit","svw","lvw","dvw",ye,t]}],"min-w":[{"min-w":[ye,t,"min","max","fit"]}],"max-w":[{"max-w":[ye,t,"none","full","min","max","fit","prose",{screen:[hn]},hn]}],h:[{h:[ye,t,"auto","min","max","fit","svh","lvh","dvh"]}],"min-h":[{"min-h":[ye,t,"min","max","fit","svh","lvh","dvh"]}],"max-h":[{"max-h":[ye,t,"min","max","fit","svh","lvh","dvh"]}],size:[{size:[ye,t,"auto","min","max","fit"]}],"font-size":[{text:["base",hn,fn]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:["thin","extralight","light","normal","medium","semibold","bold","extrabold","black",ra]}],"font-family":[{font:[Gr]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractions"],tracking:[{tracking:["tighter","tight","normal","wide","wider","widest",ye]}],"line-clamp":[{"line-clamp":["none",br,ra]}],leading:[{leading:["none","tight","snug","normal","relaxed","loose",tn,ye]}],"list-image":[{"list-image":["none",ye]}],"list-style-type":[{list:["none","disc","decimal",ye]}],"list-style-position":[{list:["inside","outside"]}],"placeholder-color":[{placeholder:[e]}],"placeholder-opacity":[{"placeholder-opacity":[v]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"text-color":[{text:[e]}],"text-opacity":[{"text-opacity":[v]}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...Q(),"wavy"]}],"text-decoration-thickness":[{decoration:["auto","from-font",tn,fn]}],"underline-offset":[{"underline-offset":["auto",tn,ye]}],"text-decoration-color":[{decoration:[e]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:L()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",ye]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",ye]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-opacity":[{"bg-opacity":[v]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:[...V(),Bb]}],"bg-repeat":[{bg:["no-repeat",{repeat:["","x","y","round","space"]}]}],"bg-size":[{bg:["auto","cover","contain",Ub]}],"bg-image":[{bg:["none",{"gradient-to":["t","tr","r","br","b","bl","l","tl"]},$b]}],"bg-color":[{bg:[e]}],"gradient-from-pos":[{from:[m]}],"gradient-via-pos":[{via:[m]}],"gradient-to-pos":[{to:[m]}],"gradient-from":[{from:[f]}],"gradient-via":[{via:[f]}],"gradient-to":[{to:[f]}],rounded:[{rounded:[o]}],"rounded-s":[{"rounded-s":[o]}],"rounded-e":[{"rounded-e":[o]}],"rounded-t":[{"rounded-t":[o]}],"rounded-r":[{"rounded-r":[o]}],"rounded-b":[{"rounded-b":[o]}],"rounded-l":[{"rounded-l":[o]}],"rounded-ss":[{"rounded-ss":[o]}],"rounded-se":[{"rounded-se":[o]}],"rounded-ee":[{"rounded-ee":[o]}],"rounded-es":[{"rounded-es":[o]}],"rounded-tl":[{"rounded-tl":[o]}],"rounded-tr":[{"rounded-tr":[o]}],"rounded-br":[{"rounded-br":[o]}],"rounded-bl":[{"rounded-bl":[o]}],"border-w":[{border:[s]}],"border-w-x":[{"border-x":[s]}],"border-w-y":[{"border-y":[s]}],"border-w-s":[{"border-s":[s]}],"border-w-e":[{"border-e":[s]}],"border-w-t":[{"border-t":[s]}],"border-w-r":[{"border-r":[s]}],"border-w-b":[{"border-b":[s]}],"border-w-l":[{"border-l":[s]}],"border-opacity":[{"border-opacity":[v]}],"border-style":[{border:[...Q(),"hidden"]}],"divide-x":[{"divide-x":[s]}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":[s]}],"divide-y-reverse":["divide-y-reverse"],"divide-opacity":[{"divide-opacity":[v]}],"divide-style":[{divide:Q()}],"border-color":[{border:[i]}],"border-color-x":[{"border-x":[i]}],"border-color-y":[{"border-y":[i]}],"border-color-s":[{"border-s":[i]}],"border-color-e":[{"border-e":[i]}],"border-color-t":[{"border-t":[i]}],"border-color-r":[{"border-r":[i]}],"border-color-b":[{"border-b":[i]}],"border-color-l":[{"border-l":[i]}],"divide-color":[{divide:[i]}],"outline-style":[{outline:["",...Q()]}],"outline-offset":[{"outline-offset":[tn,ye]}],"outline-w":[{outline:[tn,fn]}],"outline-color":[{outline:[e]}],"ring-w":[{ring:z()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:[e]}],"ring-opacity":[{"ring-opacity":[v]}],"ring-offset-w":[{"ring-offset":[tn,fn]}],"ring-offset-color":[{"ring-offset":[e]}],shadow:[{shadow:["","inner","none",hn,Vb]}],"shadow-color":[{shadow:[Gr]}],opacity:[{opacity:[v]}],"mix-blend":[{"mix-blend":[...Y(),"plus-lighter","plus-darker"]}],"bg-blend":[{"bg-blend":Y()}],filter:[{filter:["","none"]}],blur:[{blur:[n]}],brightness:[{brightness:[r]}],contrast:[{contrast:[l]}],"drop-shadow":[{"drop-shadow":["","none",hn,ye]}],grayscale:[{grayscale:[c]}],"hue-rotate":[{"hue-rotate":[u]}],invert:[{invert:[d]}],saturate:[{saturate:[w]}],sepia:[{sepia:[T]}],"backdrop-filter":[{"backdrop-filter":["","none"]}],"backdrop-blur":[{"backdrop-blur":[n]}],"backdrop-brightness":[{"backdrop-brightness":[r]}],"backdrop-contrast":[{"backdrop-contrast":[l]}],"backdrop-grayscale":[{"backdrop-grayscale":[c]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[u]}],"backdrop-invert":[{"backdrop-invert":[d]}],"backdrop-opacity":[{"backdrop-opacity":[v]}],"backdrop-saturate":[{"backdrop-saturate":[w]}],"backdrop-sepia":[{"backdrop-sepia":[T]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":[a]}],"border-spacing-x":[{"border-spacing-x":[a]}],"border-spacing-y":[{"border-spacing-y":[a]}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["none","all","","colors","opacity","shadow","transform",ye]}],duration:[{duration:ie()}],ease:[{ease:["linear","in","out","in-out",ye]}],delay:[{delay:ie()}],animate:[{animate:["none","spin","ping","pulse","bounce",ye]}],transform:[{transform:["","gpu","none"]}],scale:[{scale:[E]}],"scale-x":[{"scale-x":[E]}],"scale-y":[{"scale-y":[E]}],rotate:[{rotate:[qr,ye]}],"translate-x":[{"translate-x":[O]}],"translate-y":[{"translate-y":[O]}],"skew-x":[{"skew-x":[S]}],"skew-y":[{"skew-y":[S]}],"transform-origin":[{origin:["center","top","top-right","right","bottom-right","bottom","bottom-left","left","top-left",ye]}],accent:[{accent:["auto",e]}],appearance:[{appearance:["none","auto"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",ye]}],"caret-color":[{caret:[e]}],"pointer-events":[{"pointer-events":["none","auto"]}],resize:[{resize:["none","y","x",""]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":L()}],"scroll-mx":[{"scroll-mx":L()}],"scroll-my":[{"scroll-my":L()}],"scroll-ms":[{"scroll-ms":L()}],"scroll-me":[{"scroll-me":L()}],"scroll-mt":[{"scroll-mt":L()}],"scroll-mr":[{"scroll-mr":L()}],"scroll-mb":[{"scroll-mb":L()}],"scroll-ml":[{"scroll-ml":L()}],"scroll-p":[{"scroll-p":L()}],"scroll-px":[{"scroll-px":L()}],"scroll-py":[{"scroll-py":L()}],"scroll-ps":[{"scroll-ps":L()}],"scroll-pe":[{"scroll-pe":L()}],"scroll-pt":[{"scroll-pt":L()}],"scroll-pr":[{"scroll-pr":L()}],"scroll-pb":[{"scroll-pb":L()}],"scroll-pl":[{"scroll-pl":L()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",ye]}],fill:[{fill:[e,"none"]}],"stroke-w":[{stroke:[tn,fn,ra]}],stroke:[{stroke:[e,"none"]}],sr:["sr-only","not-sr-only"],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-s","border-w-e","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-s","border-color-e","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]}}},Qb=Ib(Gb);function be(...e){return Qb(Jd(e))}const Yb=Is(["inline-flex items-center justify-center gap-2","whitespace-nowrap rounded-md text-sm font-medium","transition-colors","focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent focus-visible:ring-offset-2 focus-visible:ring-offset-bg","disabled:pointer-events-none disabled:opacity-55","[&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0"].join(" "),{variants:{variant:{default:"bg-accent text-accent-fg hover:bg-accent-hover",secondary:"bg-surface-2 text-text hover:bg-surface-hover border border-border",outline:"bg-surface text-text border border-border hover:bg-surface-hover hover:border-border-strong",ghost:"bg-transparent text-text-dim hover:bg-surface-hover hover:text-text",destructive:"bg-surface text-danger border border-danger hover:bg-danger hover:text-white",link:"bg-transparent text-accent underline-offset-4 hover:underline px-0 h-auto"},size:{default:"h-8 px-3 py-1 text-sm",sm:"h-7 px-2.5 py-1 text-xs",lg:"h-9 px-5",icon:"h-8 w-8"}},defaultVariants:{variant:"default",size:"default"}}),qe=y.forwardRef(({className:e,variant:t,size:n,asChild:r=!1,...i},o)=>{const a=r?lb:"button";return g.jsx(a,{className:be(Yb({variant:t,size:n,className:e})),ref:o,...i})});qe.displayName="Button";class Xb extends y.Component{state={error:null,info:null};static getDerivedStateFromError(t){return{error:t}}componentDidCatch(t,n){this.setState({info:n})}handleReset=()=>{this.setState({error:null,info:null})};render(){return this.state.error?g.jsx(Jb,{error:this.state.error,info:this.state.info,onReset:this.handleReset}):this.props.children}}function Jb({error:e,info:t,onReset:n}){const{t:r}=ot("common"),i=typeof import.meta<"u"&&!1;return g.jsx("div",{className:"grid min-h-dvh place-items-center bg-bg px-4 py-8",children:g.jsxs("div",{className:"flex flex-col items-center gap-4 text-center max-w-xl",children:[g.jsx("div",{className:"flex h-12 w-12 items-center justify-center rounded-full bg-danger-bg text-danger",children:g.jsx(ob,{className:"h-6 w-6"})}),g.jsx("h1",{className:"text-xl font-semibold",children:r("errorBoundary.title",{defaultValue:"Something went wrong."})}),g.jsx("p",{className:"text-sm text-text-dim",children:r("errorBoundary.description",{defaultValue:"An unexpected error broke the page render. Try reloading or heading back to the home screen; if it persists, copy the message below and report it."})}),g.jsxs("pre",{className:"w-full max-w-lg overflow-auto rounded-md bg-surface-2 px-3 py-2 text-left text-xs leading-5 text-text-dim",children:[e.name,": ",e.message]}),i&&t?.componentStack&&g.jsxs("details",{className:"w-full max-w-lg text-left text-xs",children:[g.jsx("summary",{className:"cursor-pointer text-text-dim",children:"component stack (dev)"}),g.jsx("pre",{className:"mt-1 max-h-64 overflow-auto rounded-md bg-surface-2 px-3 py-2 text-text-muted",children:t.componentStack})]}),g.jsxs("div",{className:"mt-2 flex flex-wrap items-center justify-center gap-2",children:[g.jsxs(qe,{type:"button",variant:"default",onClick:()=>{n(),typeof window<"u"&&window.location.reload()},children:[g.jsx(tb,{className:"h-4 w-4"}),r("errorBoundary.reload",{defaultValue:"Reload"})]}),g.jsx(qe,{type:"button",variant:"secondary",asChild:!0,children:g.jsxs(ci,{to:"/",onClick:n,children:[g.jsx(Qy,{className:"h-4 w-4"}),r("errorBoundary.home",{defaultValue:"Home"})]})})]})]})})}var Dr=class{constructor(){this.listeners=new Set,this.subscribe=this.subscribe.bind(this)}subscribe(e){return this.listeners.add(e),this.onSubscribe(),()=>{this.listeners.delete(e),this.onUnsubscribe()}}hasListeners(){return this.listeners.size>0}onSubscribe(){}onUnsubscribe(){}},Zb=class extends Dr{#e;#t;#n;constructor(){super(),this.#n=e=>{if(typeof window<"u"&&window.addEventListener){const t=()=>e();return window.addEventListener("visibilitychange",t,!1),()=>{window.removeEventListener("visibilitychange",t)}}}}onSubscribe(){this.#t||this.setEventListener(this.#n)}onUnsubscribe(){this.hasListeners()||(this.#t?.(),this.#t=void 0)}setEventListener(e){this.#n=e,this.#t?.(),this.#t=e(t=>{typeof t=="boolean"?this.setFocused(t):this.onFocus()})}setFocused(e){this.#e!==e&&(this.#e=e,this.onFocus())}onFocus(){const e=this.isFocused();this.listeners.forEach(t=>{t(e)})}isFocused(){return typeof this.#e=="boolean"?this.#e:globalThis.document?.visibilityState!=="hidden"}},Os=new Zb,ev={setTimeout:(e,t)=>setTimeout(e,t),clearTimeout:e=>clearTimeout(e),setInterval:(e,t)=>setInterval(e,t),clearInterval:e=>clearInterval(e)},tv=class{#e=ev;#t=!1;setTimeoutProvider(e){this.#e=e}setTimeout(e,t){return this.#e.setTimeout(e,t)}clearTimeout(e){this.#e.clearTimeout(e)}setInterval(e,t){return this.#e.setInterval(e,t)}clearInterval(e){this.#e.clearInterval(e)}},Kn=new tv;function nv(e){setTimeout(e,0)}var rv=typeof window>"u"||"Deno"in globalThis;function ft(){}function iv(e,t){return typeof e=="function"?e(t):e}function za(e){return typeof e=="number"&&e>=0&&e!==1/0}function of(e,t){return Math.max(e+(t||0)-Date.now(),0)}function xn(e,t){return typeof e=="function"?e(t):e}function kt(e,t){return typeof e=="function"?e(t):e}function pc(e,t){const{type:n="all",exact:r,fetchStatus:i,predicate:o,queryKey:a,stale:s}=e;if(a){if(r){if(t.queryHash!==Ds(a,t.options))return!1}else if(!ui(t.queryKey,a))return!1}if(n!=="all"){const l=t.isActive();if(n==="active"&&!l||n==="inactive"&&l)return!1}return!(typeof s=="boolean"&&t.isStale()!==s||i&&i!==t.state.fetchStatus||o&&!o(t))}function mc(e,t){const{exact:n,status:r,predicate:i,mutationKey:o}=e;if(o){if(!t.options.mutationKey)return!1;if(n){if(Xn(t.options.mutationKey)!==Xn(o))return!1}else if(!ui(t.options.mutationKey,o))return!1}return!(r&&t.state.status!==r||i&&!i(t))}function Ds(e,t){return(t?.queryKeyHashFn||Xn)(e)}function Xn(e){return JSON.stringify(e,(t,n)=>$a(n)?Object.keys(n).sort().reduce((r,i)=>(r[i]=n[i],r),{}):n)}function ui(e,t){return e===t?!0:typeof e!=typeof t?!1:e&&t&&typeof e=="object"&&typeof t=="object"?Object.keys(t).every(n=>ui(e[n],t[n])):!1}var ov=Object.prototype.hasOwnProperty;function af(e,t,n=0){if(e===t)return e;if(n>500)return t;const r=gc(e)&&gc(t);if(!r&&!($a(e)&&$a(t)))return t;const o=(r?e:Object.keys(e)).length,a=r?t:Object.keys(t),s=a.length,l=r?new Array(s):{};let c=0;for(let u=0;u<s;u++){const d=r?u:a[u],h=e[d],f=t[d];if(h===f){l[d]=h,(r?u<o:ov.call(e,d))&&c++;continue}if(h===null||f===null||typeof h!="object"||typeof f!="object"){l[d]=f;continue}const m=af(h,f,n+1);l[d]=m,m===h&&c++}return o===s&&c===o?e:l}function oo(e,t){if(!t||Object.keys(e).length!==Object.keys(t).length)return!1;for(const n in e)if(e[n]!==t[n])return!1;return!0}function gc(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function $a(e){if(!yc(e))return!1;const t=e.constructor;if(t===void 0)return!0;const n=t.prototype;return!(!yc(n)||!n.hasOwnProperty("isPrototypeOf")||Object.getPrototypeOf(e)!==Object.prototype)}function yc(e){return Object.prototype.toString.call(e)==="[object Object]"}function av(e){return new Promise(t=>{Kn.setTimeout(t,e)})}function Va(e,t,n){return typeof n.structuralSharing=="function"?n.structuralSharing(e,t):n.structuralSharing!==!1?af(e,t):t}function sv(e,t,n=0){const r=[...e,t];return n&&r.length>n?r.slice(1):r}function lv(e,t,n=0){const r=[t,...e];return n&&r.length>n?r.slice(0,-1):r}var Ns=Symbol();function sf(e,t){return!e.queryFn&&t?.initialPromise?()=>t.initialPromise:!e.queryFn||e.queryFn===Ns?()=>Promise.reject(new Error(`Missing queryFn: '${e.queryHash}'`)):e.queryFn}function Ms(e,t){return typeof e=="function"?e(...t):!!e}function cv(e,t,n){let r=!1,i;return Object.defineProperty(e,"signal",{enumerable:!0,get:()=>(i??=t(),r||(r=!0,i.aborted?n():i.addEventListener("abort",n,{once:!0})),i)}),e}var di=(()=>{let e=()=>rv;return{isServer(){return e()},setIsServer(t){e=t}}})();function Wa(){let e,t;const n=new Promise((i,o)=>{e=i,t=o});n.status="pending",n.catch(()=>{});function r(i){Object.assign(n,i),delete n.resolve,delete n.reject}return n.resolve=i=>{r({status:"fulfilled",value:i}),e(i)},n.reject=i=>{r({status:"rejected",reason:i}),t(i)},n}var uv=nv;function dv(){let e=[],t=0,n=s=>{s()},r=s=>{s()},i=uv;const o=s=>{t?e.push(s):i(()=>{n(s)})},a=()=>{const s=e;e=[],s.length&&i(()=>{r(()=>{s.forEach(l=>{n(l)})})})};return{batch:s=>{let l;t++;try{l=s()}finally{t--,t||a()}return l},batchCalls:s=>(...l)=>{o(()=>{s(...l)})},schedule:o,setNotifyFunction:s=>{n=s},setBatchNotifyFunction:s=>{r=s},setScheduler:s=>{i=s}}}var tt=dv(),fv=class extends Dr{#e=!0;#t;#n;constructor(){super(),this.#n=e=>{if(typeof window<"u"&&window.addEventListener){const t=()=>e(!0),n=()=>e(!1);return window.addEventListener("online",t,!1),window.addEventListener("offline",n,!1),()=>{window.removeEventListener("online",t),window.removeEventListener("offline",n)}}}}onSubscribe(){this.#t||this.setEventListener(this.#n)}onUnsubscribe(){this.hasListeners()||(this.#t?.(),this.#t=void 0)}setEventListener(e){this.#n=e,this.#t?.(),this.#t=e(this.setOnline.bind(this))}setOnline(e){this.#e!==e&&(this.#e=e,this.listeners.forEach(n=>{n(e)}))}isOnline(){return this.#e}},ao=new fv;function hv(e){return Math.min(1e3*2**e,3e4)}function lf(e){return(e??"online")==="online"?ao.isOnline():!0}var Ka=class extends Error{constructor(e){super("CancelledError"),this.revert=e?.revert,this.silent=e?.silent}};function cf(e){let t=!1,n=0,r;const i=Wa(),o=()=>i.status!=="pending",a=p=>{if(!o()){const b=new Ka(p);h(b),e.onCancel?.(b)}},s=()=>{t=!0},l=()=>{t=!1},c=()=>Os.isFocused()&&(e.networkMode==="always"||ao.isOnline())&&e.canRun(),u=()=>lf(e.networkMode)&&e.canRun(),d=p=>{o()||(r?.(),i.resolve(p))},h=p=>{o()||(r?.(),i.reject(p))},f=()=>new Promise(p=>{r=b=>{(o()||c())&&p(b)},e.onPause?.()}).then(()=>{r=void 0,o()||e.onContinue?.()}),m=()=>{if(o())return;let p;const b=n===0?e.initialPromise:void 0;try{p=b??e.fn()}catch(v){p=Promise.reject(v)}Promise.resolve(p).then(d).catch(v=>{if(o())return;const x=e.retry??(di.isServer()?0:3),w=e.retryDelay??hv,E=typeof w=="function"?w(n,v):w,T=x===!0||typeof x=="number"&&n<x||typeof x=="function"&&x(n,v);if(t||!T){h(v);return}n++,e.onFail?.(n,v),av(E).then(()=>c()?void 0:f()).then(()=>{t?h(v):m()})})};return{promise:i,status:()=>i.status,cancel:a,continue:()=>(r?.(),i),cancelRetry:s,continueRetry:l,canStart:u,start:()=>(u()?m():f().then(m),i)}}var uf=class{#e;destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),za(this.gcTime)&&(this.#e=Kn.setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(di.isServer()?1/0:5*60*1e3))}clearGcTimeout(){this.#e!==void 0&&(Kn.clearTimeout(this.#e),this.#e=void 0)}};function pv(e){return{onFetch:(t,n)=>{const r=t.options,i=t.fetchOptions?.meta?.fetchMore?.direction,o=t.state.data?.pages||[],a=t.state.data?.pageParams||[];let s={pages:[],pageParams:[]},l=0;const c=async()=>{let u=!1;const d=m=>{cv(m,()=>t.signal,()=>u=!0)},h=sf(t.options,t.fetchOptions),f=async(m,p,b)=>{if(u)return Promise.reject(t.signal.reason);if(p==null&&m.pages.length)return Promise.resolve(m);const x=(()=>{const S={client:t.client,queryKey:t.queryKey,pageParam:p,direction:b?"backward":"forward",meta:t.options.meta};return d(S),S})(),w=await h(x),{maxPages:E}=t.options,T=b?lv:sv;return{pages:T(m.pages,w,E),pageParams:T(m.pageParams,p,E)}};if(i&&o.length){const m=i==="backward",p=m?mv:bc,b={pages:o,pageParams:a},v=p(r,b);s=await f(b,v,m)}else{const m=e??o.length;do{const p=l===0?a[0]??r.initialPageParam:bc(r,s);if(l>0&&p==null)break;s=await f(s,p),l++}while(l<m)}return s};t.options.persister?t.fetchFn=()=>t.options.persister?.(c,{client:t.client,queryKey:t.queryKey,meta:t.options.meta,signal:t.signal},n):t.fetchFn=c}}}function bc(e,{pages:t,pageParams:n}){const r=t.length-1;return t.length>0?e.getNextPageParam(t[r],t,n[r],n):void 0}function mv(e,{pages:t,pageParams:n}){return t.length>0?e.getPreviousPageParam?.(t[0],t,n[0],n):void 0}var gv=class extends uf{#e;#t;#n;#r;#o;#i;#s;#a;constructor(e){super(),this.#a=!1,this.#s=e.defaultOptions,this.setOptions(e.options),this.observers=[],this.#o=e.client,this.#r=this.#o.getQueryCache(),this.queryKey=e.queryKey,this.queryHash=e.queryHash,this.#t=xc(this.options),this.state=e.state??this.#t,this.scheduleGc()}get meta(){return this.options.meta}get queryType(){return this.#e}get promise(){return this.#i?.promise}setOptions(e){if(this.options={...this.#s,...e},e?._type&&(this.#e=e._type),this.updateGcTime(this.options.gcTime),this.state&&this.state.data===void 0){const t=xc(this.options);t.data!==void 0&&(this.setState(vc(t.data,t.dataUpdatedAt)),this.#t=t)}}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&this.#r.remove(this)}setData(e,t){const n=Va(this.state.data,e,this.options);return this.#l({data:n,type:"success",dataUpdatedAt:t?.updatedAt,manual:t?.manual}),n}setState(e){this.#l({type:"setState",state:e})}cancel(e){const t=this.#i?.promise;return this.#i?.cancel(e),t?t.then(ft).catch(ft):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}get resetState(){return this.#t}reset(){this.destroy(),this.setState(this.resetState)}isActive(){return this.observers.some(e=>kt(e.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===Ns||!this.isFetched()}isFetched(){return this.state.dataUpdateCount+this.state.errorUpdateCount>0}isStatic(){return this.getObserversCount()>0?this.observers.some(e=>xn(e.options.staleTime,this)==="static"):!1}isStale(){return this.getObserversCount()>0?this.observers.some(e=>e.getCurrentResult().isStale):this.state.data===void 0||this.state.isInvalidated}isStaleByTime(e=0){return this.state.data===void 0?!0:e==="static"?!1:this.state.isInvalidated?!0:!of(this.state.dataUpdatedAt,e)}onFocus(){this.observers.find(t=>t.shouldFetchOnWindowFocus())?.refetch({cancelRefetch:!1}),this.#i?.continue()}onOnline(){this.observers.find(t=>t.shouldFetchOnReconnect())?.refetch({cancelRefetch:!1}),this.#i?.continue()}addObserver(e){this.observers.includes(e)||(this.observers.push(e),this.clearGcTimeout(),this.#r.notify({type:"observerAdded",query:this,observer:e}))}removeObserver(e){this.observers.includes(e)&&(this.observers=this.observers.filter(t=>t!==e),this.observers.length||(this.#i&&(this.#a||this.#u()?this.#i.cancel({revert:!0}):this.#i.cancelRetry()),this.scheduleGc()),this.#r.notify({type:"observerRemoved",query:this,observer:e}))}getObserversCount(){return this.observers.length}#u(){return this.state.fetchStatus==="paused"&&this.state.status==="pending"}invalidate(){this.state.isInvalidated||this.#l({type:"invalidate"})}async fetch(e,t){if(this.state.fetchStatus!=="idle"&&this.#i?.status()!=="rejected"){if(this.state.data!==void 0&&t?.cancelRefetch)this.cancel({silent:!0});else if(this.#i)return this.#i.continueRetry(),this.#i.promise}if(e&&this.setOptions(e),!this.options.queryFn){const l=this.observers.find(c=>c.options.queryFn);l&&this.setOptions(l.options)}const n=new AbortController,r=l=>{Object.defineProperty(l,"signal",{enumerable:!0,get:()=>(this.#a=!0,n.signal)})},i=()=>{const l=sf(this.options,t),u=(()=>{const d={client:this.#o,queryKey:this.queryKey,meta:this.meta};return r(d),d})();return this.#a=!1,this.options.persister?this.options.persister(l,u,this):l(u)},a=(()=>{const l={fetchOptions:t,options:this.options,queryKey:this.queryKey,client:this.#o,state:this.state,fetchFn:i};return r(l),l})();(this.#e==="infinite"?pv(this.options.pages):this.options.behavior)?.onFetch(a,this),this.#n=this.state,(this.state.fetchStatus==="idle"||this.state.fetchMeta!==a.fetchOptions?.meta)&&this.#l({type:"fetch",meta:a.fetchOptions?.meta}),this.#i=cf({initialPromise:t?.initialPromise,fn:a.fetchFn,onCancel:l=>{l instanceof Ka&&l.revert&&this.setState({...this.#n,fetchStatus:"idle"}),n.abort()},onFail:(l,c)=>{this.#l({type:"failed",failureCount:l,error:c})},onPause:()=>{this.#l({type:"pause"})},onContinue:()=>{this.#l({type:"continue"})},retry:a.options.retry,retryDelay:a.options.retryDelay,networkMode:a.options.networkMode,canRun:()=>!0});try{const l=await this.#i.start();if(l===void 0)throw new Error(`${this.queryHash} data is undefined`);return this.setData(l),this.#r.config.onSuccess?.(l,this),this.#r.config.onSettled?.(l,this.state.error,this),l}catch(l){if(l instanceof Ka){if(l.silent)return this.#i.promise;if(l.revert){if(this.state.data===void 0)throw l;return this.state.data}}throw this.#l({type:"error",error:l}),this.#r.config.onError?.(l,this),this.#r.config.onSettled?.(this.state.data,l,this),l}finally{this.scheduleGc()}}#l(e){const t=n=>{switch(e.type){case"failed":return{...n,fetchFailureCount:e.failureCount,fetchFailureReason:e.error};case"pause":return{...n,fetchStatus:"paused"};case"continue":return{...n,fetchStatus:"fetching"};case"fetch":return{...n,...df(n.data,this.options),fetchMeta:e.meta??null};case"success":const r={...n,...vc(e.data,e.dataUpdatedAt),dataUpdateCount:n.dataUpdateCount+1,...!e.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};return this.#n=e.manual?r:void 0,r;case"error":const i=e.error;return{...n,error:i,errorUpdateCount:n.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:n.fetchFailureCount+1,fetchFailureReason:i,fetchStatus:"idle",status:"error",isInvalidated:!0};case"invalidate":return{...n,isInvalidated:!0};case"setState":return{...n,...e.state}}};this.state=t(this.state),tt.batch(()=>{this.observers.forEach(n=>{n.onQueryUpdate()}),this.#r.notify({query:this,type:"updated",action:e})})}};function df(e,t){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:lf(t.networkMode)?"fetching":"paused",...e===void 0&&{error:null,status:"pending"}}}function vc(e,t){return{data:e,dataUpdatedAt:t??Date.now(),error:null,isInvalidated:!1,status:"success"}}function xc(e){const t=typeof e.initialData=="function"?e.initialData():e.initialData,n=t!==void 0,r=n?typeof e.initialDataUpdatedAt=="function"?e.initialDataUpdatedAt():e.initialDataUpdatedAt:0;return{data:t,dataUpdateCount:0,dataUpdatedAt:n?r??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:n?"success":"pending",fetchStatus:"idle"}}var yv=class extends Dr{constructor(e,t){super(),this.options=t,this.#e=e,this.#a=null,this.#s=Wa(),this.bindMethods(),this.setOptions(t)}#e;#t=void 0;#n=void 0;#r=void 0;#o;#i;#s;#a;#u;#l;#p;#d;#f;#c;#m=new Set;bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(this.#t.addObserver(this),wc(this.#t,this.options)?this.#h():this.updateResult(),this.#v())}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return qa(this.#t,this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return qa(this.#t,this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,this.#x(),this.#w(),this.#t.removeObserver(this)}setOptions(e){const t=this.options,n=this.#t;if(this.options=this.#e.defaultQueryOptions(e),this.options.enabled!==void 0&&typeof this.options.enabled!="boolean"&&typeof this.options.enabled!="function"&&typeof kt(this.options.enabled,this.#t)!="boolean")throw new Error("Expected enabled to be a boolean or a callback that returns a boolean");this.#k(),this.#t.setOptions(this.options),t._defaulted&&!oo(this.options,t)&&this.#e.getQueryCache().notify({type:"observerOptionsUpdated",query:this.#t,observer:this});const r=this.hasListeners();r&&kc(this.#t,n,this.options,t)&&this.#h(),this.updateResult(),r&&(this.#t!==n||kt(this.options.enabled,this.#t)!==kt(t.enabled,this.#t)||xn(this.options.staleTime,this.#t)!==xn(t.staleTime,this.#t))&&this.#g();const i=this.#y();r&&(this.#t!==n||kt(this.options.enabled,this.#t)!==kt(t.enabled,this.#t)||i!==this.#c)&&this.#b(i)}getOptimisticResult(e){const t=this.#e.getQueryCache().build(this.#e,e),n=this.createResult(t,e);return vv(this,n)&&(this.#r=n,this.#i=this.options,this.#o=this.#t.state),n}getCurrentResult(){return this.#r}trackResult(e,t){return new Proxy(e,{get:(n,r)=>(this.trackProp(r),t?.(r),r==="promise"&&(this.trackProp("data"),!this.options.experimental_prefetchInRender&&this.#s.status==="pending"&&this.#s.reject(new Error("experimental_prefetchInRender feature flag is not enabled"))),Reflect.get(n,r))})}trackProp(e){this.#m.add(e)}getCurrentQuery(){return this.#t}refetch({...e}={}){return this.fetch({...e})}fetchOptimistic(e){const t=this.#e.defaultQueryOptions(e),n=this.#e.getQueryCache().build(this.#e,t);return n.fetch().then(()=>this.createResult(n,t))}fetch(e){return this.#h({...e,cancelRefetch:e.cancelRefetch??!0}).then(()=>(this.updateResult(),this.#r))}#h(e){this.#k();let t=this.#t.fetch(this.options,e);return e?.throwOnError||(t=t.catch(ft)),t}#g(){this.#x();const e=xn(this.options.staleTime,this.#t);if(di.isServer()||this.#r.isStale||!za(e))return;const n=of(this.#r.dataUpdatedAt,e)+1;this.#d=Kn.setTimeout(()=>{this.#r.isStale||this.updateResult()},n)}#y(){return(typeof this.options.refetchInterval=="function"?this.options.refetchInterval(this.#t):this.options.refetchInterval)??!1}#b(e){this.#w(),this.#c=e,!(di.isServer()||kt(this.options.enabled,this.#t)===!1||!za(this.#c)||this.#c===0)&&(this.#f=Kn.setInterval(()=>{(this.options.refetchIntervalInBackground||Os.isFocused())&&this.#h()},this.#c))}#v(){this.#g(),this.#b(this.#y())}#x(){this.#d!==void 0&&(Kn.clearTimeout(this.#d),this.#d=void 0)}#w(){this.#f!==void 0&&(Kn.clearInterval(this.#f),this.#f=void 0)}createResult(e,t){const n=this.#t,r=this.options,i=this.#r,o=this.#o,a=this.#i,l=e!==n?e.state:this.#n,{state:c}=e;let u={...c},d=!1,h;if(t._optimisticResults){const O=this.hasListeners(),_=!O&&wc(e,t),R=O&&kc(e,n,t,r);(_||R)&&(u={...u,...df(c.data,e.options)}),t._optimisticResults==="isRestoring"&&(u.fetchStatus="idle")}let{error:f,errorUpdatedAt:m,status:p}=u;h=u.data;let b=!1;if(t.placeholderData!==void 0&&h===void 0&&p==="pending"){let O;i?.isPlaceholderData&&t.placeholderData===a?.placeholderData?(O=i.data,b=!0):O=typeof t.placeholderData=="function"?t.placeholderData(this.#p?.state.data,this.#p):t.placeholderData,O!==void 0&&(p="success",h=Va(i?.data,O,t),d=!0)}if(t.select&&h!==void 0&&!b)if(i&&h===o?.data&&t.select===this.#u)h=this.#l;else try{this.#u=t.select,h=t.select(h),h=Va(i?.data,h,t),this.#l=h,this.#a=null}catch(O){this.#a=O}this.#a&&(f=this.#a,h=this.#l,m=Date.now(),p="error");const v=u.fetchStatus==="fetching",x=p==="pending",w=p==="error",E=x&&v,T=h!==void 0,k={status:p,fetchStatus:u.fetchStatus,isPending:x,isSuccess:p==="success",isError:w,isInitialLoading:E,isLoading:E,data:h,dataUpdatedAt:u.dataUpdatedAt,error:f,errorUpdatedAt:m,failureCount:u.fetchFailureCount,failureReason:u.fetchFailureReason,errorUpdateCount:u.errorUpdateCount,isFetched:e.isFetched(),isFetchedAfterMount:u.dataUpdateCount>l.dataUpdateCount||u.errorUpdateCount>l.errorUpdateCount,isFetching:v,isRefetching:v&&!x,isLoadingError:w&&!T,isPaused:u.fetchStatus==="paused",isPlaceholderData:d,isRefetchError:w&&T,isStale:_s(e,t),refetch:this.refetch,promise:this.#s,isEnabled:kt(t.enabled,e)!==!1};if(this.options.experimental_prefetchInRender){const O=k.data!==void 0,_=k.status==="error"&&!O,R=z=>{_?z.reject(k.error):O&&z.resolve(k.data)},D=()=>{const z=this.#s=k.promise=Wa();R(z)},L=this.#s;switch(L.status){case"pending":e.queryHash===n.queryHash&&R(L);break;case"fulfilled":(_||k.data!==L.value)&&D();break;case"rejected":(!_||k.error!==L.reason)&&D();break}}return k}updateResult(){const e=this.#r,t=this.createResult(this.#t,this.options);if(this.#o=this.#t.state,this.#i=this.options,this.#o.data!==void 0&&(this.#p=this.#t),oo(t,e))return;this.#r=t;const n=()=>{if(!e)return!0;const{notifyOnChangeProps:r}=this.options,i=typeof r=="function"?r():r;if(i==="all"||!i&&!this.#m.size)return!0;const o=new Set(i??this.#m);return this.options.throwOnError&&o.add("error"),Object.keys(this.#r).some(a=>{const s=a;return this.#r[s]!==e[s]&&o.has(s)})};this.#S({listeners:n()})}#k(){const e=this.#e.getQueryCache().build(this.#e,this.options);if(e===this.#t)return;const t=this.#t;this.#t=e,this.#n=e.state,this.hasListeners()&&(t?.removeObserver(this),e.addObserver(this))}onQueryUpdate(){this.updateResult(),this.hasListeners()&&this.#v()}#S(e){tt.batch(()=>{e.listeners&&this.listeners.forEach(t=>{t(this.#r)}),this.#e.getQueryCache().notify({query:this.#t,type:"observerResultsUpdated"})})}};function bv(e,t){return kt(t.enabled,e)!==!1&&e.state.data===void 0&&!(e.state.status==="error"&&kt(t.retryOnMount,e)===!1)}function wc(e,t){return bv(e,t)||e.state.data!==void 0&&qa(e,t,t.refetchOnMount)}function qa(e,t,n){if(kt(t.enabled,e)!==!1&&xn(t.staleTime,e)!=="static"){const r=typeof n=="function"?n(e):n;return r==="always"||r!==!1&&_s(e,t)}return!1}function kc(e,t,n,r){return(e!==t||kt(r.enabled,e)===!1)&&(!n.suspense||e.state.status!=="error")&&_s(e,n)}function _s(e,t){return kt(t.enabled,e)!==!1&&e.isStaleByTime(xn(t.staleTime,e))}function vv(e,t){return!oo(e.getCurrentResult(),t)}var xv=class extends uf{#e;#t;#n;#r;constructor(e){super(),this.#e=e.client,this.mutationId=e.mutationId,this.#n=e.mutationCache,this.#t=[],this.state=e.state||ff(),this.setOptions(e.options),this.scheduleGc()}setOptions(e){this.options=e,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(e){this.#t.includes(e)||(this.#t.push(e),this.clearGcTimeout(),this.#n.notify({type:"observerAdded",mutation:this,observer:e}))}removeObserver(e){this.#t=this.#t.filter(t=>t!==e),this.scheduleGc(),this.#n.notify({type:"observerRemoved",mutation:this,observer:e})}optionalRemove(){this.#t.length||(this.state.status==="pending"?this.scheduleGc():this.#n.remove(this))}continue(){return this.#r?.continue()??this.execute(this.state.variables)}async execute(e){const t=()=>{this.#o({type:"continue"})},n={client:this.#e,meta:this.options.meta,mutationKey:this.options.mutationKey};this.#r=cf({fn:()=>this.options.mutationFn?this.options.mutationFn(e,n):Promise.reject(new Error("No mutationFn found")),onFail:(o,a)=>{this.#o({type:"failed",failureCount:o,error:a})},onPause:()=>{this.#o({type:"pause"})},onContinue:t,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>this.#n.canRun(this)});const r=this.state.status==="pending",i=!this.#r.canStart();try{if(r)t();else{this.#o({type:"pending",variables:e,isPaused:i}),this.#n.config.onMutate&&await this.#n.config.onMutate(e,this,n);const a=await this.options.onMutate?.(e,n);a!==this.state.context&&this.#o({type:"pending",context:a,variables:e,isPaused:i})}const o=await this.#r.start();return await this.#n.config.onSuccess?.(o,e,this.state.context,this,n),await this.options.onSuccess?.(o,e,this.state.context,n),await this.#n.config.onSettled?.(o,null,this.state.variables,this.state.context,this,n),await this.options.onSettled?.(o,null,e,this.state.context,n),this.#o({type:"success",data:o}),o}catch(o){try{await this.#n.config.onError?.(o,e,this.state.context,this,n)}catch(a){Promise.reject(a)}try{await this.options.onError?.(o,e,this.state.context,n)}catch(a){Promise.reject(a)}try{await this.#n.config.onSettled?.(void 0,o,this.state.variables,this.state.context,this,n)}catch(a){Promise.reject(a)}try{await this.options.onSettled?.(void 0,o,e,this.state.context,n)}catch(a){Promise.reject(a)}throw this.#o({type:"error",error:o}),o}finally{this.#n.runNext(this)}}#o(e){const t=n=>{switch(e.type){case"failed":return{...n,failureCount:e.failureCount,failureReason:e.error};case"pause":return{...n,isPaused:!0};case"continue":return{...n,isPaused:!1};case"pending":return{...n,context:e.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:e.isPaused,status:"pending",variables:e.variables,submittedAt:Date.now()};case"success":return{...n,data:e.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...n,data:void 0,error:e.error,failureCount:n.failureCount+1,failureReason:e.error,isPaused:!1,status:"error"}}};this.state=t(this.state),tt.batch(()=>{this.#t.forEach(n=>{n.onMutationUpdate(e)}),this.#n.notify({mutation:this,type:"updated",action:e})})}};function ff(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var wv=class extends Dr{constructor(e={}){super(),this.config=e,this.#e=new Set,this.#t=new Map,this.#n=0}#e;#t;#n;build(e,t,n){const r=new xv({client:e,mutationCache:this,mutationId:++this.#n,options:e.defaultMutationOptions(t),state:n});return this.add(r),r}add(e){this.#e.add(e);const t=Ii(e);if(typeof t=="string"){const n=this.#t.get(t);n?n.push(e):this.#t.set(t,[e])}this.notify({type:"added",mutation:e})}remove(e){if(this.#e.delete(e)){const t=Ii(e);if(typeof t=="string"){const n=this.#t.get(t);if(n)if(n.length>1){const r=n.indexOf(e);r!==-1&&n.splice(r,1)}else n[0]===e&&this.#t.delete(t)}}this.notify({type:"removed",mutation:e})}canRun(e){const t=Ii(e);if(typeof t=="string"){const r=this.#t.get(t)?.find(i=>i.state.status==="pending");return!r||r===e}else return!0}runNext(e){const t=Ii(e);return typeof t=="string"?this.#t.get(t)?.find(r=>r!==e&&r.state.isPaused)?.continue()??Promise.resolve():Promise.resolve()}clear(){tt.batch(()=>{this.#e.forEach(e=>{this.notify({type:"removed",mutation:e})}),this.#e.clear(),this.#t.clear()})}getAll(){return Array.from(this.#e)}find(e){const t={exact:!0,...e};return this.getAll().find(n=>mc(t,n))}findAll(e={}){return this.getAll().filter(t=>mc(e,t))}notify(e){tt.batch(()=>{this.listeners.forEach(t=>{t(e)})})}resumePausedMutations(){const e=this.getAll().filter(t=>t.state.isPaused);return tt.batch(()=>Promise.all(e.map(t=>t.continue().catch(ft))))}};function Ii(e){return e.options.scope?.id}var kv=class extends Dr{#e;#t=void 0;#n;#r;constructor(t,n){super(),this.#e=t,this.setOptions(n),this.bindMethods(),this.#o()}bindMethods(){this.mutate=this.mutate.bind(this),this.reset=this.reset.bind(this)}setOptions(t){const n=this.options;this.options=this.#e.defaultMutationOptions(t),oo(this.options,n)||this.#e.getMutationCache().notify({type:"observerOptionsUpdated",mutation:this.#n,observer:this}),n?.mutationKey&&this.options.mutationKey&&Xn(n.mutationKey)!==Xn(this.options.mutationKey)?this.reset():this.#n?.state.status==="pending"&&this.#n.setOptions(this.options)}onUnsubscribe(){this.hasListeners()||this.#n?.removeObserver(this)}onMutationUpdate(t){this.#o(),this.#i(t)}getCurrentResult(){return this.#t}reset(){this.#n?.removeObserver(this),this.#n=void 0,this.#o(),this.#i()}mutate(t,n){return this.#r=n,this.#n?.removeObserver(this),this.#n=this.#e.getMutationCache().build(this.#e,this.options),this.#n.addObserver(this),this.#n.execute(t)}#o(){const t=this.#n?.state??ff();this.#t={...t,isPending:t.status==="pending",isSuccess:t.status==="success",isError:t.status==="error",isIdle:t.status==="idle",mutate:this.mutate,reset:this.reset}}#i(t){tt.batch(()=>{if(this.#r&&this.hasListeners()){const n=this.#t.variables,r=this.#t.context,i={client:this.#e,meta:this.options.meta,mutationKey:this.options.mutationKey};if(t?.type==="success"){try{this.#r.onSuccess?.(t.data,n,r,i)}catch(o){Promise.reject(o)}try{this.#r.onSettled?.(t.data,null,n,r,i)}catch(o){Promise.reject(o)}}else if(t?.type==="error"){try{this.#r.onError?.(t.error,n,r,i)}catch(o){Promise.reject(o)}try{this.#r.onSettled?.(void 0,t.error,n,r,i)}catch(o){Promise.reject(o)}}}this.listeners.forEach(n=>{n(this.#t)})})}},Sv=class extends Dr{constructor(e={}){super(),this.config=e,this.#e=new Map}#e;build(e,t,n){const r=t.queryKey,i=t.queryHash??Ds(r,t);let o=this.get(i);return o||(o=new gv({client:e,queryKey:r,queryHash:i,options:e.defaultQueryOptions(t),state:n,defaultOptions:e.getQueryDefaults(r)}),this.add(o)),o}add(e){this.#e.has(e.queryHash)||(this.#e.set(e.queryHash,e),this.notify({type:"added",query:e}))}remove(e){const t=this.#e.get(e.queryHash);t&&(e.destroy(),t===e&&this.#e.delete(e.queryHash),this.notify({type:"removed",query:e}))}clear(){tt.batch(()=>{this.getAll().forEach(e=>{this.remove(e)})})}get(e){return this.#e.get(e)}getAll(){return[...this.#e.values()]}find(e){const t={exact:!0,...e};return this.getAll().find(n=>pc(t,n))}findAll(e={}){const t=this.getAll();return Object.keys(e).length>0?t.filter(n=>pc(e,n)):t}notify(e){tt.batch(()=>{this.listeners.forEach(t=>{t(e)})})}onFocus(){tt.batch(()=>{this.getAll().forEach(e=>{e.onFocus()})})}onOnline(){tt.batch(()=>{this.getAll().forEach(e=>{e.onOnline()})})}},Av=class{#e;#t;#n;#r;#o;#i;#s;#a;constructor(e={}){this.#e=e.queryCache||new Sv,this.#t=e.mutationCache||new wv,this.#n=e.defaultOptions||{},this.#r=new Map,this.#o=new Map,this.#i=0}mount(){this.#i++,this.#i===1&&(this.#s=Os.subscribe(async e=>{e&&(await this.resumePausedMutations(),this.#e.onFocus())}),this.#a=ao.subscribe(async e=>{e&&(await this.resumePausedMutations(),this.#e.onOnline())}))}unmount(){this.#i--,this.#i===0&&(this.#s?.(),this.#s=void 0,this.#a?.(),this.#a=void 0)}isFetching(e){return this.#e.findAll({...e,fetchStatus:"fetching"}).length}isMutating(e){return this.#t.findAll({...e,status:"pending"}).length}getQueryData(e){const t=this.defaultQueryOptions({queryKey:e});return this.#e.get(t.queryHash)?.state.data}ensureQueryData(e){const t=this.defaultQueryOptions(e),n=this.#e.build(this,t),r=n.state.data;return r===void 0?this.fetchQuery(e):(e.revalidateIfStale&&n.isStaleByTime(xn(t.staleTime,n))&&this.prefetchQuery(t),Promise.resolve(r))}getQueriesData(e){return this.#e.findAll(e).map(({queryKey:t,state:n})=>{const r=n.data;return[t,r]})}setQueryData(e,t,n){const r=this.defaultQueryOptions({queryKey:e}),o=this.#e.get(r.queryHash)?.state.data,a=iv(t,o);if(a!==void 0)return this.#e.build(this,r).setData(a,{...n,manual:!0})}setQueriesData(e,t,n){return tt.batch(()=>this.#e.findAll(e).map(({queryKey:r})=>[r,this.setQueryData(r,t,n)]))}getQueryState(e){const t=this.defaultQueryOptions({queryKey:e});return this.#e.get(t.queryHash)?.state}removeQueries(e){const t=this.#e;tt.batch(()=>{t.findAll(e).forEach(n=>{t.remove(n)})})}resetQueries(e,t){const n=this.#e;return tt.batch(()=>(n.findAll(e).forEach(r=>{r.reset()}),this.refetchQueries({type:"active",...e},t)))}cancelQueries(e,t={}){const n={revert:!0,...t},r=tt.batch(()=>this.#e.findAll(e).map(i=>i.cancel(n)));return Promise.all(r).then(ft).catch(ft)}invalidateQueries(e,t={}){return tt.batch(()=>(this.#e.findAll(e).forEach(n=>{n.invalidate()}),e?.refetchType==="none"?Promise.resolve():this.refetchQueries({...e,type:e?.refetchType??e?.type??"active"},t)))}refetchQueries(e,t={}){const n={...t,cancelRefetch:t.cancelRefetch??!0},r=tt.batch(()=>this.#e.findAll(e).filter(i=>!i.isDisabled()&&!i.isStatic()).map(i=>{let o=i.fetch(void 0,n);return n.throwOnError||(o=o.catch(ft)),i.state.fetchStatus==="paused"?Promise.resolve():o}));return Promise.all(r).then(ft)}fetchQuery(e){const t=this.defaultQueryOptions(e);t.retry===void 0&&(t.retry=!1);const n=this.#e.build(this,t);return n.isStaleByTime(xn(t.staleTime,n))?n.fetch(t):Promise.resolve(n.state.data)}prefetchQuery(e){return this.fetchQuery(e).then(ft).catch(ft)}fetchInfiniteQuery(e){return e._type="infinite",this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(ft).catch(ft)}ensureInfiniteQueryData(e){return e._type="infinite",this.ensureQueryData(e)}resumePausedMutations(){return ao.isOnline()?this.#t.resumePausedMutations():Promise.resolve()}getQueryCache(){return this.#e}getMutationCache(){return this.#t}getDefaultOptions(){return this.#n}setDefaultOptions(e){this.#n=e}setQueryDefaults(e,t){this.#r.set(Xn(e),{queryKey:e,defaultOptions:t})}getQueryDefaults(e){const t=[...this.#r.values()],n={};return t.forEach(r=>{ui(e,r.queryKey)&&Object.assign(n,r.defaultOptions)}),n}setMutationDefaults(e,t){this.#o.set(Xn(e),{mutationKey:e,defaultOptions:t})}getMutationDefaults(e){const t=[...this.#o.values()],n={};return t.forEach(r=>{ui(e,r.mutationKey)&&Object.assign(n,r.defaultOptions)}),n}defaultQueryOptions(e){if(e._defaulted)return e;const t={...this.#n.queries,...this.getQueryDefaults(e.queryKey),...e,_defaulted:!0};return t.queryHash||(t.queryHash=Ds(t.queryKey,t)),t.refetchOnReconnect===void 0&&(t.refetchOnReconnect=t.networkMode!=="always"),t.throwOnError===void 0&&(t.throwOnError=!!t.suspense),!t.networkMode&&t.persister&&(t.networkMode="offlineFirst"),t.queryFn===Ns&&(t.enabled=!1),t}defaultMutationOptions(e){return e?._defaulted?e:{...this.#n.mutations,...e?.mutationKey&&this.getMutationDefaults(e.mutationKey),...e,_defaulted:!0}}clear(){this.#e.clear(),this.#t.clear()}},hf=y.createContext(void 0),Rn=e=>{const t=y.useContext(hf);if(!t)throw new Error("No QueryClient set, use QueryClientProvider to set one");return t},Cv=({client:e,children:t})=>(y.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),g.jsx(hf.Provider,{value:e,children:t})),pf=y.createContext(!1),Ev=()=>y.useContext(pf);pf.Provider;function Rv(){let e=!1;return{clearReset:()=>{e=!1},reset:()=>{e=!0},isReset:()=>e}}var Pv=y.createContext(Rv()),Tv=()=>y.useContext(Pv),Iv=(e,t,n)=>{const r=n?.state.error&&typeof e.throwOnError=="function"?Ms(e.throwOnError,[n.state.error,n]):e.throwOnError;(e.suspense||e.experimental_prefetchInRender||r)&&(t.isReset()||(e.retryOnMount=!1))},Lv=e=>{y.useEffect(()=>{e.clearReset()},[e])},Ov=({result:e,errorResetBoundary:t,throwOnError:n,query:r,suspense:i})=>e.isError&&!t.isReset()&&!e.isFetching&&r&&(i&&e.data===void 0||Ms(n,[e.error,r])),Dv=e=>{if(e.suspense){const n=i=>i==="static"?i:Math.max(i??1e3,1e3),r=e.staleTime;e.staleTime=typeof r=="function"?(...i)=>n(r(...i)):n(r),typeof e.gcTime=="number"&&(e.gcTime=Math.max(e.gcTime,1e3))}},Nv=(e,t)=>e.isLoading&&e.isFetching&&!t,Mv=(e,t)=>e?.suspense&&t.isPending,Sc=(e,t,n)=>t.fetchOptimistic(e).catch(()=>{n.clearReset()});function _v(e,t,n){const r=Ev(),i=Tv(),o=Rn(),a=o.defaultQueryOptions(e);o.getDefaultOptions().queries?._experimental_beforeQuery?.(a);const s=o.getQueryCache().get(a.queryHash),l=e.subscribed!==!1;a._optimisticResults=r?"isRestoring":l?"optimistic":void 0,Dv(a),Iv(a,i,s),Lv(i);const c=!o.getQueryCache().get(a.queryHash),[u]=y.useState(()=>new t(o,a)),d=u.getOptimisticResult(a),h=!r&&l;if(y.useSyncExternalStore(y.useCallback(f=>{const m=h?u.subscribe(tt.batchCalls(f)):ft;return u.updateResult(),m},[u,h]),()=>u.getCurrentResult(),()=>u.getCurrentResult()),y.useEffect(()=>{u.setOptions(a)},[a,u]),Mv(a,d))throw Sc(a,u,i);if(Ov({result:d,errorResetBoundary:i,throwOnError:a.throwOnError,query:s,suspense:a.suspense}))throw d.error;return o.getDefaultOptions().queries?._experimental_afterQuery?.(a,d),a.experimental_prefetchInRender&&!di.isServer()&&Nv(d,r)&&(c?Sc(a,u,i):s?.promise)?.catch(ft).finally(()=>{u.updateResult()}),a.notifyOnChangeProps?d:u.trackResult(d)}function mf(e,t){return _v(e,yv)}function Pn(e,t){const n=Rn(),[r]=y.useState(()=>new kv(n,e));y.useEffect(()=>{r.setOptions(e)},[r,e]);const i=y.useSyncExternalStore(y.useCallback(a=>r.subscribe(tt.batchCalls(a)),[r]),()=>r.getCurrentResult(),()=>r.getCurrentResult()),o=y.useCallback((a,s)=>{r.mutate(a,s).catch(ft)},[r]);if(i.error&&Ms(r.options.throwOnError,[i.error]))throw i.error;return{...i,mutate:o,mutateAsync:i.mutate}}var jv=e=>{switch(e){case"success":return Uv;case"info":return zv;case"warning":return Bv;case"error":return $v;default:return null}},Fv=Array(12).fill(0),Hv=({visible:e,className:t})=>K.createElement("div",{className:["sonner-loading-wrapper",t].filter(Boolean).join(" "),"data-visible":e},K.createElement("div",{className:"sonner-spinner"},Fv.map((n,r)=>K.createElement("div",{className:"sonner-loading-bar",key:`spinner-bar-${r}`})))),Uv=K.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},K.createElement("path",{fillRule:"evenodd",d:"M10 18a8 8 0 100-16 8 8 0 000 16zm3.857-9.809a.75.75 0 00-1.214-.882l-3.483 4.79-1.88-1.88a.75.75 0 10-1.06 1.061l2.5 2.5a.75.75 0 001.137-.089l4-5.5z",clipRule:"evenodd"})),Bv=K.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",height:"20",width:"20"},K.createElement("path",{fillRule:"evenodd",d:"M9.401 3.003c1.155-2 4.043-2 5.197 0l7.355 12.748c1.154 2-.29 4.5-2.599 4.5H4.645c-2.309 0-3.752-2.5-2.598-4.5L9.4 3.003zM12 8.25a.75.75 0 01.75.75v3.75a.75.75 0 01-1.5 0V9a.75.75 0 01.75-.75zm0 8.25a.75.75 0 100-1.5.75.75 0 000 1.5z",clipRule:"evenodd"})),zv=K.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},K.createElement("path",{fillRule:"evenodd",d:"M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-7-4a1 1 0 11-2 0 1 1 0 012 0zM9 9a.75.75 0 000 1.5h.253a.25.25 0 01.244.304l-.459 2.066A1.75 1.75 0 0010.747 15H11a.75.75 0 000-1.5h-.253a.25.25 0 01-.244-.304l.459-2.066A1.75 1.75 0 009.253 9H9z",clipRule:"evenodd"})),$v=K.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},K.createElement("path",{fillRule:"evenodd",d:"M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-8-5a.75.75 0 01.75.75v4.5a.75.75 0 01-1.5 0v-4.5A.75.75 0 0110 5zm0 10a1 1 0 100-2 1 1 0 000 2z",clipRule:"evenodd"})),Vv=K.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"},K.createElement("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),K.createElement("line",{x1:"6",y1:"6",x2:"18",y2:"18"})),Wv=()=>{let[e,t]=K.useState(document.hidden);return K.useEffect(()=>{let n=()=>{t(document.hidden)};return document.addEventListener("visibilitychange",n),()=>window.removeEventListener("visibilitychange",n)},[]),e},Ga=1,Kv=class{constructor(){this.subscribe=e=>(this.subscribers.push(e),()=>{let t=this.subscribers.indexOf(e);this.subscribers.splice(t,1)}),this.publish=e=>{this.subscribers.forEach(t=>t(e))},this.addToast=e=>{this.publish(e),this.toasts=[...this.toasts,e]},this.create=e=>{var t;let{message:n,...r}=e,i=typeof e?.id=="number"||((t=e.id)==null?void 0:t.length)>0?e.id:Ga++,o=this.toasts.find(s=>s.id===i),a=e.dismissible===void 0?!0:e.dismissible;return this.dismissedToasts.has(i)&&this.dismissedToasts.delete(i),o?this.toasts=this.toasts.map(s=>s.id===i?(this.publish({...s,...e,id:i,title:n}),{...s,...e,id:i,dismissible:a,title:n}):s):this.addToast({title:n,...r,dismissible:a,id:i}),i},this.dismiss=e=>(this.dismissedToasts.add(e),e||this.toasts.forEach(t=>{this.subscribers.forEach(n=>n({id:t.id,dismiss:!0}))}),this.subscribers.forEach(t=>t({id:e,dismiss:!0})),e),this.message=(e,t)=>this.create({...t,message:e}),this.error=(e,t)=>this.create({...t,message:e,type:"error"}),this.success=(e,t)=>this.create({...t,type:"success",message:e}),this.info=(e,t)=>this.create({...t,type:"info",message:e}),this.warning=(e,t)=>this.create({...t,type:"warning",message:e}),this.loading=(e,t)=>this.create({...t,type:"loading",message:e}),this.promise=(e,t)=>{if(!t)return;let n;t.loading!==void 0&&(n=this.create({...t,promise:e,type:"loading",message:t.loading,description:typeof t.description!="function"?t.description:void 0}));let r=e instanceof Promise?e:e(),i=n!==void 0,o,a=r.then(async l=>{if(o=["resolve",l],K.isValidElement(l))i=!1,this.create({id:n,type:"default",message:l});else if(Gv(l)&&!l.ok){i=!1;let c=typeof t.error=="function"?await t.error(`HTTP error! status: ${l.status}`):t.error,u=typeof t.description=="function"?await t.description(`HTTP error! status: ${l.status}`):t.description;this.create({id:n,type:"error",message:c,description:u})}else if(t.success!==void 0){i=!1;let c=typeof t.success=="function"?await t.success(l):t.success,u=typeof t.description=="function"?await t.description(l):t.description;this.create({id:n,type:"success",message:c,description:u})}}).catch(async l=>{if(o=["reject",l],t.error!==void 0){i=!1;let c=typeof t.error=="function"?await t.error(l):t.error,u=typeof t.description=="function"?await t.description(l):t.description;this.create({id:n,type:"error",message:c,description:u})}}).finally(()=>{var l;i&&(this.dismiss(n),n=void 0),(l=t.finally)==null||l.call(t)}),s=()=>new Promise((l,c)=>a.then(()=>o[0]==="reject"?c(o[1]):l(o[1])).catch(c));return typeof n!="string"&&typeof n!="number"?{unwrap:s}:Object.assign(n,{unwrap:s})},this.custom=(e,t)=>{let n=t?.id||Ga++;return this.create({jsx:e(n),id:n,...t}),n},this.getActiveToasts=()=>this.toasts.filter(e=>!this.dismissedToasts.has(e.id)),this.subscribers=[],this.toasts=[],this.dismissedToasts=new Set}},yt=new Kv,qv=(e,t)=>{let n=t?.id||Ga++;return yt.addToast({title:e,...t,id:n}),n},Gv=e=>e&&typeof e=="object"&&"ok"in e&&typeof e.ok=="boolean"&&"status"in e&&typeof e.status=="number",Qv=qv,Yv=()=>yt.toasts,Xv=()=>yt.getActiveToasts(),et=Object.assign(Qv,{success:yt.success,info:yt.info,warning:yt.warning,error:yt.error,custom:yt.custom,message:yt.message,promise:yt.promise,dismiss:yt.dismiss,loading:yt.loading},{getHistory:Yv,getToasts:Xv});function Jv(e,{insertAt:t}={}){if(typeof document>"u")return;let n=document.head||document.getElementsByTagName("head")[0],r=document.createElement("style");r.type="text/css",t==="top"&&n.firstChild?n.insertBefore(r,n.firstChild):n.appendChild(r),r.styleSheet?r.styleSheet.cssText=e:r.appendChild(document.createTextNode(e))}Jv(`:where(html[dir="ltr"]),:where([data-sonner-toaster][dir="ltr"]){--toast-icon-margin-start: -3px;--toast-icon-margin-end: 4px;--toast-svg-margin-start: -1px;--toast-svg-margin-end: 0px;--toast-button-margin-start: auto;--toast-button-margin-end: 0;--toast-close-button-start: 0;--toast-close-button-end: unset;--toast-close-button-transform: translate(-35%, -35%)}:where(html[dir="rtl"]),:where([data-sonner-toaster][dir="rtl"]){--toast-icon-margin-start: 4px;--toast-icon-margin-end: -3px;--toast-svg-margin-start: 0px;--toast-svg-margin-end: -1px;--toast-button-margin-start: 0;--toast-button-margin-end: auto;--toast-close-button-start: unset;--toast-close-button-end: 0;--toast-close-button-transform: translate(35%, -35%)}:where([data-sonner-toaster]){position:fixed;width:var(--width);font-family:ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,Noto Sans,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji;--gray1: hsl(0, 0%, 99%);--gray2: hsl(0, 0%, 97.3%);--gray3: hsl(0, 0%, 95.1%);--gray4: hsl(0, 0%, 93%);--gray5: hsl(0, 0%, 90.9%);--gray6: hsl(0, 0%, 88.7%);--gray7: hsl(0, 0%, 85.8%);--gray8: hsl(0, 0%, 78%);--gray9: hsl(0, 0%, 56.1%);--gray10: hsl(0, 0%, 52.3%);--gray11: hsl(0, 0%, 43.5%);--gray12: hsl(0, 0%, 9%);--border-radius: 8px;box-sizing:border-box;padding:0;margin:0;list-style:none;outline:none;z-index:999999999;transition:transform .4s ease}:where([data-sonner-toaster][data-lifted="true"]){transform:translateY(-10px)}@media (hover: none) and (pointer: coarse){:where([data-sonner-toaster][data-lifted="true"]){transform:none}}:where([data-sonner-toaster][data-x-position="right"]){right:var(--offset-right)}:where([data-sonner-toaster][data-x-position="left"]){left:var(--offset-left)}:where([data-sonner-toaster][data-x-position="center"]){left:50%;transform:translate(-50%)}:where([data-sonner-toaster][data-y-position="top"]){top:var(--offset-top)}:where([data-sonner-toaster][data-y-position="bottom"]){bottom:var(--offset-bottom)}:where([data-sonner-toast]){--y: translateY(100%);--lift-amount: calc(var(--lift) * var(--gap));z-index:var(--z-index);position:absolute;opacity:0;transform:var(--y);filter:blur(0);touch-action:none;transition:transform .4s,opacity .4s,height .4s,box-shadow .2s;box-sizing:border-box;outline:none;overflow-wrap:anywhere}:where([data-sonner-toast][data-styled="true"]){padding:16px;background:var(--normal-bg);border:1px solid var(--normal-border);color:var(--normal-text);border-radius:var(--border-radius);box-shadow:0 4px 12px #0000001a;width:var(--width);font-size:13px;display:flex;align-items:center;gap:6px}:where([data-sonner-toast]:focus-visible){box-shadow:0 4px 12px #0000001a,0 0 0 2px #0003}:where([data-sonner-toast][data-y-position="top"]){top:0;--y: translateY(-100%);--lift: 1;--lift-amount: calc(1 * var(--gap))}:where([data-sonner-toast][data-y-position="bottom"]){bottom:0;--y: translateY(100%);--lift: -1;--lift-amount: calc(var(--lift) * var(--gap))}:where([data-sonner-toast]) :where([data-description]){font-weight:400;line-height:1.4;color:inherit}:where([data-sonner-toast]) :where([data-title]){font-weight:500;line-height:1.5;color:inherit}:where([data-sonner-toast]) :where([data-icon]){display:flex;height:16px;width:16px;position:relative;justify-content:flex-start;align-items:center;flex-shrink:0;margin-left:var(--toast-icon-margin-start);margin-right:var(--toast-icon-margin-end)}:where([data-sonner-toast][data-promise="true"]) :where([data-icon])>svg{opacity:0;transform:scale(.8);transform-origin:center;animation:sonner-fade-in .3s ease forwards}:where([data-sonner-toast]) :where([data-icon])>*{flex-shrink:0}:where([data-sonner-toast]) :where([data-icon]) svg{margin-left:var(--toast-svg-margin-start);margin-right:var(--toast-svg-margin-end)}:where([data-sonner-toast]) :where([data-content]){display:flex;flex-direction:column;gap:2px}[data-sonner-toast][data-styled=true] [data-button]{border-radius:4px;padding-left:8px;padding-right:8px;height:24px;font-size:12px;color:var(--normal-bg);background:var(--normal-text);margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end);border:none;cursor:pointer;outline:none;display:flex;align-items:center;flex-shrink:0;transition:opacity .4s,box-shadow .2s}:where([data-sonner-toast]) :where([data-button]):focus-visible{box-shadow:0 0 0 2px #0006}:where([data-sonner-toast]) :where([data-button]):first-of-type{margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end)}:where([data-sonner-toast]) :where([data-cancel]){color:var(--normal-text);background:rgba(0,0,0,.08)}:where([data-sonner-toast][data-theme="dark"]) :where([data-cancel]){background:rgba(255,255,255,.3)}:where([data-sonner-toast]) :where([data-close-button]){position:absolute;left:var(--toast-close-button-start);right:var(--toast-close-button-end);top:0;height:20px;width:20px;display:flex;justify-content:center;align-items:center;padding:0;color:var(--gray12);border:1px solid var(--gray4);transform:var(--toast-close-button-transform);border-radius:50%;cursor:pointer;z-index:1;transition:opacity .1s,background .2s,border-color .2s}[data-sonner-toast] [data-close-button]{background:var(--gray1)}:where([data-sonner-toast]) :where([data-close-button]):focus-visible{box-shadow:0 4px 12px #0000001a,0 0 0 2px #0003}:where([data-sonner-toast]) :where([data-disabled="true"]){cursor:not-allowed}:where([data-sonner-toast]):hover :where([data-close-button]):hover{background:var(--gray2);border-color:var(--gray5)}:where([data-sonner-toast][data-swiping="true"]):before{content:"";position:absolute;left:-50%;right:-50%;height:100%;z-index:-1}:where([data-sonner-toast][data-y-position="top"][data-swiping="true"]):before{bottom:50%;transform:scaleY(3) translateY(50%)}:where([data-sonner-toast][data-y-position="bottom"][data-swiping="true"]):before{top:50%;transform:scaleY(3) translateY(-50%)}:where([data-sonner-toast][data-swiping="false"][data-removed="true"]):before{content:"";position:absolute;inset:0;transform:scaleY(2)}:where([data-sonner-toast]):after{content:"";position:absolute;left:0;height:calc(var(--gap) + 1px);bottom:100%;width:100%}:where([data-sonner-toast][data-mounted="true"]){--y: translateY(0);opacity:1}:where([data-sonner-toast][data-expanded="false"][data-front="false"]){--scale: var(--toasts-before) * .05 + 1;--y: translateY(calc(var(--lift-amount) * var(--toasts-before))) scale(calc(-1 * var(--scale)));height:var(--front-toast-height)}:where([data-sonner-toast])>*{transition:opacity .4s}:where([data-sonner-toast][data-expanded="false"][data-front="false"][data-styled="true"])>*{opacity:0}:where([data-sonner-toast][data-visible="false"]){opacity:0;pointer-events:none}:where([data-sonner-toast][data-mounted="true"][data-expanded="true"]){--y: translateY(calc(var(--lift) * var(--offset)));height:var(--initial-height)}:where([data-sonner-toast][data-removed="true"][data-front="true"][data-swipe-out="false"]){--y: translateY(calc(var(--lift) * -100%));opacity:0}:where([data-sonner-toast][data-removed="true"][data-front="false"][data-swipe-out="false"][data-expanded="true"]){--y: translateY(calc(var(--lift) * var(--offset) + var(--lift) * -100%));opacity:0}:where([data-sonner-toast][data-removed="true"][data-front="false"][data-swipe-out="false"][data-expanded="false"]){--y: translateY(40%);opacity:0;transition:transform .5s,opacity .2s}:where([data-sonner-toast][data-removed="true"][data-front="false"]):before{height:calc(var(--initial-height) + 20%)}[data-sonner-toast][data-swiping=true]{transform:var(--y) translateY(var(--swipe-amount-y, 0px)) translate(var(--swipe-amount-x, 0px));transition:none}[data-sonner-toast][data-swiped=true]{user-select:none}[data-sonner-toast][data-swipe-out=true][data-y-position=bottom],[data-sonner-toast][data-swipe-out=true][data-y-position=top]{animation-duration:.2s;animation-timing-function:ease-out;animation-fill-mode:forwards}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=left]{animation-name:swipe-out-left}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=right]{animation-name:swipe-out-right}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=up]{animation-name:swipe-out-up}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=down]{animation-name:swipe-out-down}@keyframes swipe-out-left{0%{transform:var(--y) translate(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translate(calc(var(--swipe-amount-x) - 100%));opacity:0}}@keyframes swipe-out-right{0%{transform:var(--y) translate(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translate(calc(var(--swipe-amount-x) + 100%));opacity:0}}@keyframes swipe-out-up{0%{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) - 100%));opacity:0}}@keyframes swipe-out-down{0%{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) + 100%));opacity:0}}@media (max-width: 600px){[data-sonner-toaster]{position:fixed;right:var(--mobile-offset-right);left:var(--mobile-offset-left);width:100%}[data-sonner-toaster][dir=rtl]{left:calc(var(--mobile-offset-left) * -1)}[data-sonner-toaster] [data-sonner-toast]{left:0;right:0;width:calc(100% - var(--mobile-offset-left) * 2)}[data-sonner-toaster][data-x-position=left]{left:var(--mobile-offset-left)}[data-sonner-toaster][data-y-position=bottom]{bottom:var(--mobile-offset-bottom)}[data-sonner-toaster][data-y-position=top]{top:var(--mobile-offset-top)}[data-sonner-toaster][data-x-position=center]{left:var(--mobile-offset-left);right:var(--mobile-offset-right);transform:none}}[data-sonner-toaster][data-theme=light]{--normal-bg: #fff;--normal-border: var(--gray4);--normal-text: var(--gray12);--success-bg: hsl(143, 85%, 96%);--success-border: hsl(145, 92%, 91%);--success-text: hsl(140, 100%, 27%);--info-bg: hsl(208, 100%, 97%);--info-border: hsl(221, 91%, 91%);--info-text: hsl(210, 92%, 45%);--warning-bg: hsl(49, 100%, 97%);--warning-border: hsl(49, 91%, 91%);--warning-text: hsl(31, 92%, 45%);--error-bg: hsl(359, 100%, 97%);--error-border: hsl(359, 100%, 94%);--error-text: hsl(360, 100%, 45%)}[data-sonner-toaster][data-theme=light] [data-sonner-toast][data-invert=true]{--normal-bg: #000;--normal-border: hsl(0, 0%, 20%);--normal-text: var(--gray1)}[data-sonner-toaster][data-theme=dark] [data-sonner-toast][data-invert=true]{--normal-bg: #fff;--normal-border: var(--gray3);--normal-text: var(--gray12)}[data-sonner-toaster][data-theme=dark]{--normal-bg: #000;--normal-bg-hover: hsl(0, 0%, 12%);--normal-border: hsl(0, 0%, 20%);--normal-border-hover: hsl(0, 0%, 25%);--normal-text: var(--gray1);--success-bg: hsl(150, 100%, 6%);--success-border: hsl(147, 100%, 12%);--success-text: hsl(150, 86%, 65%);--info-bg: hsl(215, 100%, 6%);--info-border: hsl(223, 100%, 12%);--info-text: hsl(216, 87%, 65%);--warning-bg: hsl(64, 100%, 6%);--warning-border: hsl(60, 100%, 12%);--warning-text: hsl(46, 87%, 65%);--error-bg: hsl(358, 76%, 10%);--error-border: hsl(357, 89%, 16%);--error-text: hsl(358, 100%, 81%)}[data-sonner-toaster][data-theme=dark] [data-sonner-toast] [data-close-button]{background:var(--normal-bg);border-color:var(--normal-border);color:var(--normal-text)}[data-sonner-toaster][data-theme=dark] [data-sonner-toast] [data-close-button]:hover{background:var(--normal-bg-hover);border-color:var(--normal-border-hover)}[data-rich-colors=true][data-sonner-toast][data-type=success],[data-rich-colors=true][data-sonner-toast][data-type=success] [data-close-button]{background:var(--success-bg);border-color:var(--success-border);color:var(--success-text)}[data-rich-colors=true][data-sonner-toast][data-type=info],[data-rich-colors=true][data-sonner-toast][data-type=info] [data-close-button]{background:var(--info-bg);border-color:var(--info-border);color:var(--info-text)}[data-rich-colors=true][data-sonner-toast][data-type=warning],[data-rich-colors=true][data-sonner-toast][data-type=warning] [data-close-button]{background:var(--warning-bg);border-color:var(--warning-border);color:var(--warning-text)}[data-rich-colors=true][data-sonner-toast][data-type=error],[data-rich-colors=true][data-sonner-toast][data-type=error] [data-close-button]{background:var(--error-bg);border-color:var(--error-border);color:var(--error-text)}.sonner-loading-wrapper{--size: 16px;height:var(--size);width:var(--size);position:absolute;inset:0;z-index:10}.sonner-loading-wrapper[data-visible=false]{transform-origin:center;animation:sonner-fade-out .2s ease forwards}.sonner-spinner{position:relative;top:50%;left:50%;height:var(--size);width:var(--size)}.sonner-loading-bar{animation:sonner-spin 1.2s linear infinite;background:var(--gray11);border-radius:6px;height:8%;left:-10%;position:absolute;top:-3.9%;width:24%}.sonner-loading-bar:nth-child(1){animation-delay:-1.2s;transform:rotate(.0001deg) translate(146%)}.sonner-loading-bar:nth-child(2){animation-delay:-1.1s;transform:rotate(30deg) translate(146%)}.sonner-loading-bar:nth-child(3){animation-delay:-1s;transform:rotate(60deg) translate(146%)}.sonner-loading-bar:nth-child(4){animation-delay:-.9s;transform:rotate(90deg) translate(146%)}.sonner-loading-bar:nth-child(5){animation-delay:-.8s;transform:rotate(120deg) translate(146%)}.sonner-loading-bar:nth-child(6){animation-delay:-.7s;transform:rotate(150deg) translate(146%)}.sonner-loading-bar:nth-child(7){animation-delay:-.6s;transform:rotate(180deg) translate(146%)}.sonner-loading-bar:nth-child(8){animation-delay:-.5s;transform:rotate(210deg) translate(146%)}.sonner-loading-bar:nth-child(9){animation-delay:-.4s;transform:rotate(240deg) translate(146%)}.sonner-loading-bar:nth-child(10){animation-delay:-.3s;transform:rotate(270deg) translate(146%)}.sonner-loading-bar:nth-child(11){animation-delay:-.2s;transform:rotate(300deg) translate(146%)}.sonner-loading-bar:nth-child(12){animation-delay:-.1s;transform:rotate(330deg) translate(146%)}@keyframes sonner-fade-in{0%{opacity:0;transform:scale(.8)}to{opacity:1;transform:scale(1)}}@keyframes sonner-fade-out{0%{opacity:1;transform:scale(1)}to{opacity:0;transform:scale(.8)}}@keyframes sonner-spin{0%{opacity:1}to{opacity:.15}}@media (prefers-reduced-motion){[data-sonner-toast],[data-sonner-toast]>*,.sonner-loading-bar{transition:none!important;animation:none!important}}.sonner-loader{position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);transform-origin:center;transition:opacity .2s,transform .2s}.sonner-loader[data-visible=false]{opacity:0;transform:scale(.8) translate(-50%,-50%)}
164
+ `);function Li(e){return e.label!==void 0}var Zv=3,ex="32px",tx="16px",Ac=4e3,nx=356,rx=14,ix=20,ox=200;function Lt(...e){return e.filter(Boolean).join(" ")}function ax(e){let[t,n]=e.split("-"),r=[];return t&&r.push(t),n&&r.push(n),r}var sx=e=>{var t,n,r,i,o,a,s,l,c,u,d;let{invert:h,toast:f,unstyled:m,interacting:p,setHeights:b,visibleToasts:v,heights:x,index:w,toasts:E,expanded:T,removeToast:S,defaultRichColors:k,closeButton:O,style:_,cancelButtonStyle:R,actionButtonStyle:D,className:L="",descriptionClassName:z="",duration:H,position:V,gap:Q,loadingIcon:Y,expandByDefault:W,classNames:F,icons:A,closeButtonAriaLabel:ie="Close toast",pauseWhenPageIsHidden:Z}=e,[C,ae]=K.useState(null),[pe,ve]=K.useState(null),[q,me]=K.useState(!1),[Te,xe]=K.useState(!1),[Se,he]=K.useState(!1),[Ge,Ze]=K.useState(!1),[Ft,at]=K.useState(!1),[Ht,On]=K.useState(0),[Dn,Nn]=K.useState(0),Jt=K.useRef(f.duration||H||Ac),ir=K.useRef(null),Pt=K.useRef(null),Tt=w===0,Zt=w+1<=v,M=f.type,B=f.dismissible!==!1,ne=f.className||"",le=f.descriptionClassName||"",Ce=K.useMemo(()=>x.findIndex(ue=>ue.toastId===f.id)||0,[x,f.id]),nt=K.useMemo(()=>{var ue;return(ue=f.closeButton)!=null?ue:O},[f.closeButton,O]),Et=K.useMemo(()=>f.duration||H||Ac,[f.duration,H]),Ve=K.useRef(0),dt=K.useRef(0),It=K.useRef(0),ze=K.useRef(null),[Ut,pt]=V.split("-"),Mn=K.useMemo(()=>x.reduce((ue,Ie,De)=>De>=Ce?ue:ue+Ie.height,0),[x,Ce]),Hr=Wv(),Ur=f.invert||h,_n=M==="loading";dt.current=K.useMemo(()=>Ce*Q+Mn,[Ce,Mn]),K.useEffect(()=>{Jt.current=Et},[Et]),K.useEffect(()=>{me(!0)},[]),K.useEffect(()=>{let ue=Pt.current;if(ue){let Ie=ue.getBoundingClientRect().height;return Nn(Ie),b(De=>[{toastId:f.id,height:Ie,position:f.position},...De]),()=>b(De=>De.filter(lt=>lt.toastId!==f.id))}},[b,f.id]),K.useLayoutEffect(()=>{if(!q)return;let ue=Pt.current,Ie=ue.style.height;ue.style.height="auto";let De=ue.getBoundingClientRect().height;ue.style.height=Ie,Nn(De),b(lt=>lt.find(vt=>vt.toastId===f.id)?lt.map(vt=>vt.toastId===f.id?{...vt,height:De}:vt):[{toastId:f.id,height:De,position:f.position},...lt])},[q,f.title,f.description,b,f.id]);let Bt=K.useCallback(()=>{xe(!0),On(dt.current),b(ue=>ue.filter(Ie=>Ie.toastId!==f.id)),setTimeout(()=>{S(f)},ox)},[f,S,b,dt]);K.useEffect(()=>{if(f.promise&&M==="loading"||f.duration===1/0||f.type==="loading")return;let ue;return T||p||Z&&Hr?(()=>{if(It.current<Ve.current){let Ie=new Date().getTime()-Ve.current;Jt.current=Jt.current-Ie}It.current=new Date().getTime()})():Jt.current!==1/0&&(Ve.current=new Date().getTime(),ue=setTimeout(()=>{var Ie;(Ie=f.onAutoClose)==null||Ie.call(f,f),Bt()},Jt.current)),()=>clearTimeout(ue)},[T,p,f,M,Z,Hr,Bt]),K.useEffect(()=>{f.delete&&Bt()},[Bt,f.delete]);function Ci(){var ue,Ie,De;return A!=null&&A.loading?K.createElement("div",{className:Lt(F?.loader,(ue=f?.classNames)==null?void 0:ue.loader,"sonner-loader"),"data-visible":M==="loading"},A.loading):Y?K.createElement("div",{className:Lt(F?.loader,(Ie=f?.classNames)==null?void 0:Ie.loader,"sonner-loader"),"data-visible":M==="loading"},Y):K.createElement(Hv,{className:Lt(F?.loader,(De=f?.classNames)==null?void 0:De.loader),visible:M==="loading"})}return K.createElement("li",{tabIndex:0,ref:Pt,className:Lt(L,ne,F?.toast,(t=f?.classNames)==null?void 0:t.toast,F?.default,F?.[M],(n=f?.classNames)==null?void 0:n[M]),"data-sonner-toast":"","data-rich-colors":(r=f.richColors)!=null?r:k,"data-styled":!(f.jsx||f.unstyled||m),"data-mounted":q,"data-promise":!!f.promise,"data-swiped":Ft,"data-removed":Te,"data-visible":Zt,"data-y-position":Ut,"data-x-position":pt,"data-index":w,"data-front":Tt,"data-swiping":Se,"data-dismissible":B,"data-type":M,"data-invert":Ur,"data-swipe-out":Ge,"data-swipe-direction":pe,"data-expanded":!!(T||W&&q),style:{"--index":w,"--toasts-before":w,"--z-index":E.length-w,"--offset":`${Te?Ht:dt.current}px`,"--initial-height":W?"auto":`${Dn}px`,..._,...f.style},onDragEnd:()=>{he(!1),ae(null),ze.current=null},onPointerDown:ue=>{_n||!B||(ir.current=new Date,On(dt.current),ue.target.setPointerCapture(ue.pointerId),ue.target.tagName!=="BUTTON"&&(he(!0),ze.current={x:ue.clientX,y:ue.clientY}))},onPointerUp:()=>{var ue,Ie,De,lt;if(Ge||!B)return;ze.current=null;let vt=Number(((ue=Pt.current)==null?void 0:ue.style.getPropertyValue("--swipe-amount-x").replace("px",""))||0),zt=Number(((Ie=Pt.current)==null?void 0:Ie.style.getPropertyValue("--swipe-amount-y").replace("px",""))||0),P=new Date().getTime()-((De=ir.current)==null?void 0:De.getTime()),I=C==="x"?vt:zt,N=Math.abs(I)/P;if(Math.abs(I)>=ix||N>.11){On(dt.current),(lt=f.onDismiss)==null||lt.call(f,f),ve(C==="x"?vt>0?"right":"left":zt>0?"down":"up"),Bt(),Ze(!0),at(!1);return}he(!1),ae(null)},onPointerMove:ue=>{var Ie,De,lt,vt;if(!ze.current||!B||((Ie=window.getSelection())==null?void 0:Ie.toString().length)>0)return;let zt=ue.clientY-ze.current.y,P=ue.clientX-ze.current.x,I=(De=e.swipeDirections)!=null?De:ax(V);!C&&(Math.abs(P)>1||Math.abs(zt)>1)&&ae(Math.abs(P)>Math.abs(zt)?"x":"y");let N={x:0,y:0};C==="y"?(I.includes("top")||I.includes("bottom"))&&(I.includes("top")&&zt<0||I.includes("bottom")&&zt>0)&&(N.y=zt):C==="x"&&(I.includes("left")||I.includes("right"))&&(I.includes("left")&&P<0||I.includes("right")&&P>0)&&(N.x=P),(Math.abs(N.x)>0||Math.abs(N.y)>0)&&at(!0),(lt=Pt.current)==null||lt.style.setProperty("--swipe-amount-x",`${N.x}px`),(vt=Pt.current)==null||vt.style.setProperty("--swipe-amount-y",`${N.y}px`)}},nt&&!f.jsx?K.createElement("button",{"aria-label":ie,"data-disabled":_n,"data-close-button":!0,onClick:_n||!B?()=>{}:()=>{var ue;Bt(),(ue=f.onDismiss)==null||ue.call(f,f)},className:Lt(F?.closeButton,(i=f?.classNames)==null?void 0:i.closeButton)},(o=A?.close)!=null?o:Vv):null,f.jsx||y.isValidElement(f.title)?f.jsx?f.jsx:typeof f.title=="function"?f.title():f.title:K.createElement(K.Fragment,null,M||f.icon||f.promise?K.createElement("div",{"data-icon":"",className:Lt(F?.icon,(a=f?.classNames)==null?void 0:a.icon)},f.promise||f.type==="loading"&&!f.icon?f.icon||Ci():null,f.type!=="loading"?f.icon||A?.[M]||jv(M):null):null,K.createElement("div",{"data-content":"",className:Lt(F?.content,(s=f?.classNames)==null?void 0:s.content)},K.createElement("div",{"data-title":"",className:Lt(F?.title,(l=f?.classNames)==null?void 0:l.title)},typeof f.title=="function"?f.title():f.title),f.description?K.createElement("div",{"data-description":"",className:Lt(z,le,F?.description,(c=f?.classNames)==null?void 0:c.description)},typeof f.description=="function"?f.description():f.description):null),y.isValidElement(f.cancel)?f.cancel:f.cancel&&Li(f.cancel)?K.createElement("button",{"data-button":!0,"data-cancel":!0,style:f.cancelButtonStyle||R,onClick:ue=>{var Ie,De;Li(f.cancel)&&B&&((De=(Ie=f.cancel).onClick)==null||De.call(Ie,ue),Bt())},className:Lt(F?.cancelButton,(u=f?.classNames)==null?void 0:u.cancelButton)},f.cancel.label):null,y.isValidElement(f.action)?f.action:f.action&&Li(f.action)?K.createElement("button",{"data-button":!0,"data-action":!0,style:f.actionButtonStyle||D,onClick:ue=>{var Ie,De;Li(f.action)&&((De=(Ie=f.action).onClick)==null||De.call(Ie,ue),!ue.defaultPrevented&&Bt())},className:Lt(F?.actionButton,(d=f?.classNames)==null?void 0:d.actionButton)},f.action.label):null))};function Cc(){if(typeof window>"u"||typeof document>"u")return"ltr";let e=document.documentElement.getAttribute("dir");return e==="auto"||!e?window.getComputedStyle(document.documentElement).direction:e}function lx(e,t){let n={};return[e,t].forEach((r,i)=>{let o=i===1,a=o?"--mobile-offset":"--offset",s=o?tx:ex;function l(c){["top","right","bottom","left"].forEach(u=>{n[`${a}-${u}`]=typeof c=="number"?`${c}px`:c})}typeof r=="number"||typeof r=="string"?l(r):typeof r=="object"?["top","right","bottom","left"].forEach(c=>{r[c]===void 0?n[`${a}-${c}`]=s:n[`${a}-${c}`]=typeof r[c]=="number"?`${r[c]}px`:r[c]}):l(s)}),n}var cx=y.forwardRef(function(e,t){let{invert:n,position:r="bottom-right",hotkey:i=["altKey","KeyT"],expand:o,closeButton:a,className:s,offset:l,mobileOffset:c,theme:u="light",richColors:d,duration:h,style:f,visibleToasts:m=Zv,toastOptions:p,dir:b=Cc(),gap:v=rx,loadingIcon:x,icons:w,containerAriaLabel:E="Notifications",pauseWhenPageIsHidden:T}=e,[S,k]=K.useState([]),O=K.useMemo(()=>Array.from(new Set([r].concat(S.filter(Z=>Z.position).map(Z=>Z.position)))),[S,r]),[_,R]=K.useState([]),[D,L]=K.useState(!1),[z,H]=K.useState(!1),[V,Q]=K.useState(u!=="system"?u:typeof window<"u"&&window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"),Y=K.useRef(null),W=i.join("+").replace(/Key/g,"").replace(/Digit/g,""),F=K.useRef(null),A=K.useRef(!1),ie=K.useCallback(Z=>{k(C=>{var ae;return(ae=C.find(pe=>pe.id===Z.id))!=null&&ae.delete||yt.dismiss(Z.id),C.filter(({id:pe})=>pe!==Z.id)})},[]);return K.useEffect(()=>yt.subscribe(Z=>{if(Z.dismiss){k(C=>C.map(ae=>ae.id===Z.id?{...ae,delete:!0}:ae));return}setTimeout(()=>{Em.flushSync(()=>{k(C=>{let ae=C.findIndex(pe=>pe.id===Z.id);return ae!==-1?[...C.slice(0,ae),{...C[ae],...Z},...C.slice(ae+1)]:[Z,...C]})})})}),[]),K.useEffect(()=>{if(u!=="system"){Q(u);return}if(u==="system"&&(window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?Q("dark"):Q("light")),typeof window>"u")return;let Z=window.matchMedia("(prefers-color-scheme: dark)");try{Z.addEventListener("change",({matches:C})=>{Q(C?"dark":"light")})}catch{Z.addListener(({matches:ae})=>{try{Q(ae?"dark":"light")}catch(pe){console.error(pe)}})}},[u]),K.useEffect(()=>{S.length<=1&&L(!1)},[S]),K.useEffect(()=>{let Z=C=>{var ae,pe;i.every(ve=>C[ve]||C.code===ve)&&(L(!0),(ae=Y.current)==null||ae.focus()),C.code==="Escape"&&(document.activeElement===Y.current||(pe=Y.current)!=null&&pe.contains(document.activeElement))&&L(!1)};return document.addEventListener("keydown",Z),()=>document.removeEventListener("keydown",Z)},[i]),K.useEffect(()=>{if(Y.current)return()=>{F.current&&(F.current.focus({preventScroll:!0}),F.current=null,A.current=!1)}},[Y.current]),K.createElement("section",{ref:t,"aria-label":`${E} ${W}`,tabIndex:-1,"aria-live":"polite","aria-relevant":"additions text","aria-atomic":"false",suppressHydrationWarning:!0},O.map((Z,C)=>{var ae;let[pe,ve]=Z.split("-");return S.length?K.createElement("ol",{key:Z,dir:b==="auto"?Cc():b,tabIndex:-1,ref:Y,className:s,"data-sonner-toaster":!0,"data-theme":V,"data-y-position":pe,"data-lifted":D&&S.length>1&&!o,"data-x-position":ve,style:{"--front-toast-height":`${((ae=_[0])==null?void 0:ae.height)||0}px`,"--width":`${nx}px`,"--gap":`${v}px`,...f,...lx(l,c)},onBlur:q=>{A.current&&!q.currentTarget.contains(q.relatedTarget)&&(A.current=!1,F.current&&(F.current.focus({preventScroll:!0}),F.current=null))},onFocus:q=>{q.target instanceof HTMLElement&&q.target.dataset.dismissible==="false"||A.current||(A.current=!0,F.current=q.relatedTarget)},onMouseEnter:()=>L(!0),onMouseMove:()=>L(!0),onMouseLeave:()=>{z||L(!1)},onDragEnd:()=>L(!1),onPointerDown:q=>{q.target instanceof HTMLElement&&q.target.dataset.dismissible==="false"||H(!0)},onPointerUp:()=>H(!1)},S.filter(q=>!q.position&&C===0||q.position===Z).map((q,me)=>{var Te,xe;return K.createElement(sx,{key:q.id,icons:w,index:me,toast:q,defaultRichColors:d,duration:(Te=p?.duration)!=null?Te:h,className:p?.className,descriptionClassName:p?.descriptionClassName,invert:n,visibleToasts:m,closeButton:(xe=p?.closeButton)!=null?xe:a,interacting:z,position:Z,style:p?.style,unstyled:p?.unstyled,classNames:p?.classNames,cancelButtonStyle:p?.cancelButtonStyle,actionButtonStyle:p?.actionButtonStyle,removeToast:ie,toasts:S.filter(Se=>Se.position==q.position),heights:_.filter(Se=>Se.position==q.position),setHeights:R,expandByDefault:o,gap:v,loadingIcon:x,expanded:D,pauseWhenPageIsHidden:T,swipeDirections:e.swipeDirections})})):null}))});const gf="agim_token";function ux(e){if(!e)return"";const t=[];for(const[n,r]of Object.entries(e))if(!(r==null||r==="")){if(typeof r=="boolean"){t.push(`${encodeURIComponent(n)}=${r?"1":"0"}`);continue}t.push(`${encodeURIComponent(n)}=${encodeURIComponent(String(r))}`)}return t.length?`?${t.join("&")}`:""}function dx(){try{return localStorage.getItem(gf)}catch{return null}}async function Qr(e,t,n={}){const r=t+ux(n.query),i={...n.headers??{}},o=dx();o&&!i.Authorization&&(i.Authorization=`Bearer ${o}`);let a;n.body!==void 0&&n.body!==null&&(n.body instanceof FormData||typeof n.body=="string"?a=n.body:(i["Content-Type"]=i["Content-Type"]??"application/json",a=JSON.stringify(n.body)));let s;try{s=await fetch(r,{method:e,headers:i,body:a,credentials:"same-origin",signal:n.signal})}catch(u){const d=u instanceof Error?u.message:String(u);throw new Qa({code:"NETWORK",message:d,status:0})}if(s.status===204)return;const c=(s.headers.get("content-type")||"").includes("application/json");if(!s.ok){let u=`HTTP_${s.status}`,d=s.statusText,h=!1;if(c)try{const p=await s.json();p.error&&(d=p.error),p.code&&(u=p.code,h=!0)}catch{}h||(s.status===401&&(u="AUTH_INVALID"),s.status===403&&(u="FORBIDDEN"),s.status===404&&(u="NOT_FOUND"),s.status===413&&(u="PAYLOAD_TOO_LARGE"));const f=u==="AUTH_ADMIN_REQUIRED"||s.status===403&&d.toLowerCase()==="admin role required";if((s.status===401||f)&&!t.startsWith("/api/auth/")){try{localStorage.removeItem(gf)}catch{}const p=encodeURIComponent(location.pathname+location.search),b=f?"&reason=admin":"";location.pathname.startsWith("/login")||(location.href=`/login?next=${p}${b}`)}throw new Qa({code:u,message:d,status:s.status})}return c?await s.json():await s.text()}class Qa extends Error{code;status;constructor(t){super(t.message),this.name="ApiClientError",this.code=t.code,this.status=t.status}}const $={get:(e,t)=>Qr("GET",e,t),post:(e,t)=>Qr("POST",e,t),put:(e,t)=>Qr("PUT",e,t),patch:(e,t)=>Qr("PATCH",e,t),delete:(e,t)=>Qr("DELETE",e,t)},fx={getA2ARecent:e=>$.get("/api/a2a/recent",{query:e}),getA2AStats:()=>$.get("/api/a2a/stats"),removeAdminAllowlist:e=>$.delete("/api/admin-allowlist",{body:e}),listAdminAllowlist:()=>$.get("/api/admin-allowlist"),addAdminAllowlist:e=>$.post("/api/admin-allowlist",{body:e}),getAgentHealth:e=>$.get("/api/agent-health",e),discoverAcpAgents:e=>$.post("/api/agents/acp/discover",{body:e}),testAcpAgent:e=>$.post("/api/agents/acp/test",{body:e}),testEmail:()=>$.post("/api/messengers/email/test"),getSearchProviders:()=>$.get("/api/search/providers"),testSearchProvider:e=>$.post("/api/search/test",{body:e}),generateMobileQR:e=>$.post("/api/mobile/qr",{body:e??{}}),getAgentsStatus:()=>$.get("/api/agents/status"),listApprovals:()=>$.get("/api/approvals"),resolveApproval:(e,t)=>$.post(`/api/approvals/${encodeURIComponent(e)}/resolve`,{body:t}),getAudit:e=>$.get("/api/audit",{query:e}),login:e=>$.post("/api/auth/login",{body:e}),logout:e=>$.post("/api/auth/logout",e),listBgJobs:e=>$.get("/api/bgjobs",{query:e}),getConfig:()=>$.get("/api/config"),updateConfig:e=>$.put("/api/config",{body:e}),listWorkspacesFull:()=>$.get("/api/workspaces",{query:{full:!0}}),upsertWorkspace:e=>$.post("/api/workspaces",{body:e}),deleteWorkspace:e=>$.delete(`/api/workspaces/${encodeURIComponent(e)}`),startWechatQr:()=>$.post("/api/messengers/wechat/qr-start"),getWechatQrStatus:e=>$.get("/api/messengers/wechat/qr-status",{query:e}),getEnv:e=>$.get("/api/env",{query:e}),updateEnv:e=>$.put("/api/env",{body:e}),getHealth:e=>$.get("/api/health",e),getHealthSummary:e=>$.get("/api/health/summary",{query:e}),getHealthTopN:e=>$.get("/api/health/topn",{query:e}),getServiceLogTail:e=>$.get("/api/service/log-tail",{query:e}),invoke:e=>$.post("/api/invoke",e),listJobs:e=>$.get("/api/jobs",{query:e}),createJob:e=>$.post("/api/jobs",{body:e}),batchCancelJobs:e=>$.post("/api/jobs/batch-cancel",{body:e}),batchRunJobs:e=>$.post("/api/jobs/batch-run",{body:e}),submitLoc:e=>$.post("/api/loc",e),getLocInfo:e=>$.get("/api/loc/info",e),consolidateMemory:()=>$.post("/api/memory/consolidate"),getMemoryConsolidateStatus:()=>$.get("/api/memory/consolidate/status"),triggerMemoryDistill:()=>$.post("/api/memory/distill"),getMemoryDistillStatus:()=>$.get("/api/memory/distill/status"),exportMemory:e=>$.get("/api/memory/export",e),deleteMemoryFacts:(e,t)=>$.delete("/api/memory/facts",{query:e,body:t}),deleteMemoryFactById:(e,t)=>$.delete(`/api/memory/facts/${e}`,{query:t}),listMemoryFacts:e=>$.get("/api/memory/facts",{query:e}),deleteMemoryPersona:e=>$.delete("/api/memory/persona",{query:e}),getMemoryPersona:e=>$.get("/api/memory/persona",{query:e}),updateMemoryPersona:(e,t)=>$.put("/api/memory/persona",{query:e,body:t}),listMemoryUsers:()=>$.get("/api/memory/users"),backfillMemoryVector:(e,t)=>$.post("/api/memory/vector/backfill",{query:e,body:t}),clearMemoryVector:e=>$.post("/api/memory/vector/clear",{query:e}),downloadMemoryVector:()=>$.post("/api/memory/vector/download"),getMemoryVectorStatus:e=>$.get("/api/memory/vector/status",{query:e}),testMemoryVector:()=>$.post("/api/memory/vector/test"),listMemos:e=>$.get("/api/memos",{query:e}),deleteMemo:e=>$.delete(`/api/memos/${e}`),getMetrics:e=>$.get("/api/metrics",e),notify:e=>$.post("/api/notify",e),listOutbox:e=>$.get("/api/outbox",{query:e}),getOutboxStats:()=>$.get("/api/outbox/stats"),retryOutbox:e=>$.post(`/api/outbox/${e}/retry`),listReminders:e=>$.get("/api/reminders",{query:e}),cancelReminder:e=>$.post(`/api/reminders/${e}/cancel`),snoozeReminder:(e,t)=>$.post(`/api/reminders/${e}/snooze`,{body:t}),listSchedules:e=>$.get("/api/schedules",{query:e}),restartService:()=>$.post("/api/service/restart"),startService:()=>$.post("/api/service/start"),getServiceStatus:()=>$.get("/api/service/status"),stopService:()=>$.post("/api/service/stop"),listSkills:()=>$.get("/api/skills"),getSkillDetail:e=>$.get(`/api/skills/${encodeURIComponent(e)}`),getSkillsRemoteHot:()=>$.get("/api/skills/remote/hot"),listSubtasks:e=>$.get("/api/subtasks",{query:e}),listViewerPastes:e=>$.get("/api/viewer",e),getViewerTunnel:()=>$.get("/api/viewer/tunnel"),getWorkspaceFiles:e=>$.get("/api/workspace-files",{query:e}),writeWorkspaceFile:(e,t)=>$.put("/api/workspace-files",{query:e,body:t})};function hx(e,t){if(e instanceof Qa){const n=t("errors:UNKNOWN",{code:e.code,detail:e.message,defaultValue:e.message}),r=t(`errors:${e.code}`,{defaultValue:n,detail:e.message});return{code:e.code,message:r}}return e instanceof Error?{code:"UNKNOWN",message:t("errors:UNKNOWN",{code:e.name,defaultValue:e.message})}:{code:"UNKNOWN",message:t("errors:UNKNOWN",{code:"UNKNOWN",defaultValue:String(e)})}}const yf=y.forwardRef(({className:e,...t},n)=>g.jsx("div",{ref:n,className:be("rounded-lg border border-border bg-surface text-text shadow-sm",e),...t}));yf.displayName="Card";const bf=y.forwardRef(({className:e,...t},n)=>g.jsx("div",{ref:n,className:be("flex flex-col space-y-1 p-3 sm:p-4",e),...t}));bf.displayName="CardHeader";const vf=y.forwardRef(({className:e,...t},n)=>g.jsx("div",{ref:n,className:be("text-md font-semibold leading-tight",e),...t}));vf.displayName="CardTitle";const xf=y.forwardRef(({className:e,...t},n)=>g.jsx("div",{ref:n,className:be("text-sm text-text-dim",e),...t}));xf.displayName="CardDescription";const wf=y.forwardRef(({className:e,...t},n)=>g.jsx("div",{ref:n,className:be("p-3 pt-0 sm:p-4 sm:pt-0",e),...t}));wf.displayName="CardContent";const kf=y.forwardRef(({className:e,...t},n)=>g.jsx("div",{ref:n,className:be("flex items-center p-5 pt-0 sm:p-6 sm:pt-0 gap-2",e),...t}));kf.displayName="CardFooter";const gr=y.forwardRef(({className:e,type:t,...n},r)=>g.jsx("input",{type:t,className:be("flex h-8 w-full rounded-md border border-border bg-surface","px-3 py-1 text-sm shadow-sm","file:border-0 file:bg-transparent file:text-sm file:font-medium","placeholder:text-text-muted","focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent focus-visible:ring-offset-1 focus-visible:ring-offset-bg","disabled:cursor-not-allowed disabled:opacity-55",e),ref:r,...n}));gr.displayName="Input";var px=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],Me=px.reduce((e,t)=>{const n=Sr(`Primitive.${t}`),r=y.forwardRef((i,o)=>{const{asChild:a,...s}=i,l=a?n:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),g.jsx(l,{...s,ref:o})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{});function mx(e,t){e&&Tr.flushSync(()=>e.dispatchEvent(t))}var gx="Label",Sf=y.forwardRef((e,t)=>g.jsx(Me.label,{...e,ref:t,onMouseDown:n=>{n.target.closest("button, input, select, textarea")||(e.onMouseDown?.(n),!n.defaultPrevented&&n.detail>1&&n.preventDefault())}}));Sf.displayName=gx;var Af=Sf;const yx=Is("text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70"),$n=y.forwardRef(({className:e,...t},n)=>g.jsx(Af,{ref:n,className:be(yx(),e),...t}));$n.displayName=Af.displayName;function bx(e){if(!e)return"/";try{const t=decodeURIComponent(e);if(t.startsWith("/")&&!t.startsWith("//"))return t}catch{}return"/"}function vx(){const{t:e}=ot(),t=Po(),[n]=zd(),r=Ts(d=>d.setToken),[i,o]=y.useState(""),a=bx(n.get("next")),l=n.get("reason")==="admin",c=Pn({mutationFn:d=>fx.login({token:d}),onSuccess:()=>{r(i.trim()),et.success(e("states.saved")),t(a,{replace:!0})},onError:d=>{const{message:h}=hx(d,e);et.error(h)}});function u(d){d.preventDefault();const h=i.trim();h&&c.mutate(h)}return g.jsx("div",{className:"grid min-h-dvh place-items-center bg-bg px-4 py-8 pt-safe",children:g.jsxs(yf,{className:"w-full max-w-md",children:[g.jsxs(bf,{children:[g.jsxs(vf,{className:"text-xl",children:[g.jsx("span",{className:"mr-2",children:"🤖"}),e("appName")]}),g.jsx(xf,{children:e("login.intro",{defaultValue:"Paste your access token from `agim token bootstrap` (first boot) or `agim token create`."})})]}),g.jsxs(wf,{children:[l&&g.jsx("p",{className:"mb-3 rounded-md border border-warning/40 bg-warning-bg/50 px-3 py-2 text-sm text-warning",children:e("login.adminRequired",{defaultValue:"Current token has no admin permission. Please sign in with an admin token."})}),g.jsxs("form",{onSubmit:u,className:"flex flex-col gap-4",children:[g.jsxs("div",{className:"flex flex-col gap-2",children:[g.jsx($n,{htmlFor:"token",children:e("login.tokenLabel",{defaultValue:"Access token"})}),g.jsx(gr,{id:"token",type:"password",value:i,onChange:d=>o(d.target.value),placeholder:"agim_••••••••",autoComplete:"off",autoFocus:!0,required:!0})]}),g.jsx(qe,{type:"submit",size:"lg",disabled:c.isPending||i.trim().length===0,children:c.isPending?e("states.loading"):e("login.submit",{defaultValue:"Sign in"})})]})]}),g.jsx(kf,{className:"block text-xs text-text-muted",children:e("login.hint",{defaultValue:"Loopback (127.0.0.1) requests bypass this check; you only see this page when accessing agim from another host or with AGIM_TRUST_LOOPBACK=off."})})]})})}const Ec=[1e3,2e3,5e3,1e4,3e4];function xx(e){return`${location.protocol==="https:"?"wss:":"ws:"}//${location.host}${e}`}let Yr=null;function wx(){if(Yr)return Yr;let e=null,t="connecting",n=0,r=null,i=!1;const o=new Set;function a(b){t=b;for(const v of o)v.type==="status"&&v.fn(b)}function s(b){for(const v of o)v.type==="message"&&v.fn(b)}function l(){r!=null&&(clearTimeout(r),r=null)}function c(){if(i)return;l();const b=Ec[Math.min(n,Ec.length-1)]??3e4;n+=1,r=setTimeout(()=>u(),b)}function u(){l(),a("connecting");try{e=new WebSocket(xx("/ws"))}catch(b){a("error"),console.warn("[ws] construct failed",b),c();return}e.addEventListener("open",()=>{n=0,a("open")}),e.addEventListener("message",b=>{let v;try{v=JSON.parse(b.data)}catch{console.warn("[ws] bad json",b.data?.slice?.(0,200));return}s(v)}),e.addEventListener("close",()=>{a("closed"),i||c()}),e.addEventListener("error",()=>{a("error")})}function d(b){if(!e||e.readyState!==WebSocket.OPEN)return!1;try{return e.send(JSON.stringify(b)),!0}catch{return!1}}function h(b){return o.add(b),b.type==="status"&&b.fn(t),()=>{o.delete(b)}}function f(){i=!0,l();try{e?.close()}catch{}e=null,Yr=null}function m(){document.visibilityState==="visible"&&(!e||e.readyState===WebSocket.CLOSED)&&(n=0,u())}function p(){n=0,(!e||e.readyState!==WebSocket.OPEN)&&u()}return document.addEventListener("visibilitychange",m),window.addEventListener("online",p),u(),Yr={send:d,subscribe:h,status:()=>t,close:()=>{document.removeEventListener("visibilitychange",m),window.removeEventListener("online",p),f()}},Yr}const fe=e=>typeof e=="string",Xr=()=>{let e,t;const n=new Promise((r,i)=>{e=r,t=i});return n.resolve=e,n.reject=t,n},Rc=e=>e==null?"":""+e,kx=(e,t,n)=>{e.forEach(r=>{t[r]&&(n[r]=t[r])})},Sx=/###/g,Pc=e=>e&&e.indexOf("###")>-1?e.replace(Sx,"."):e,Tc=e=>!e||fe(e),ni=(e,t,n)=>{const r=fe(t)?t.split("."):t;let i=0;for(;i<r.length-1;){if(Tc(e))return{};const o=Pc(r[i]);!e[o]&&n&&(e[o]=new n),Object.prototype.hasOwnProperty.call(e,o)?e=e[o]:e={},++i}return Tc(e)?{}:{obj:e,k:Pc(r[i])}},Ic=(e,t,n)=>{const{obj:r,k:i}=ni(e,t,Object);if(r!==void 0||t.length===1){r[i]=n;return}let o=t[t.length-1],a=t.slice(0,t.length-1),s=ni(e,a,Object);for(;s.obj===void 0&&a.length;)o=`${a[a.length-1]}.${o}`,a=a.slice(0,a.length-1),s=ni(e,a,Object),s?.obj&&typeof s.obj[`${s.k}.${o}`]<"u"&&(s.obj=void 0);s.obj[`${s.k}.${o}`]=n},Ax=(e,t,n,r)=>{const{obj:i,k:o}=ni(e,t,Object);i[o]=i[o]||[],i[o].push(n)},so=(e,t)=>{const{obj:n,k:r}=ni(e,t);if(n&&Object.prototype.hasOwnProperty.call(n,r))return n[r]},Cx=(e,t,n)=>{const r=so(e,n);return r!==void 0?r:so(t,n)},Cf=(e,t,n)=>{for(const r in t)r!=="__proto__"&&r!=="constructor"&&(r in e?fe(e[r])||e[r]instanceof String||fe(t[r])||t[r]instanceof String?n&&(e[r]=t[r]):Cf(e[r],t[r],n):e[r]=t[r]);return e},cr=e=>e.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&");var Ex={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;","/":"&#x2F;"};const Rx=e=>fe(e)?e.replace(/[&<>"'\/]/g,t=>Ex[t]):e;class Px{constructor(t){this.capacity=t,this.regExpMap=new Map,this.regExpQueue=[]}getRegExp(t){const n=this.regExpMap.get(t);if(n!==void 0)return n;const r=new RegExp(t);return this.regExpQueue.length===this.capacity&&this.regExpMap.delete(this.regExpQueue.shift()),this.regExpMap.set(t,r),this.regExpQueue.push(t),r}}const Tx=[" ",",","?","!",";"],Ix=new Px(20),Lx=(e,t,n)=>{t=t||"",n=n||"";const r=Tx.filter(a=>t.indexOf(a)<0&&n.indexOf(a)<0);if(r.length===0)return!0;const i=Ix.getRegExp(`(${r.map(a=>a==="?"?"\\?":a).join("|")})`);let o=!i.test(e);if(!o){const a=e.indexOf(n);a>0&&!i.test(e.substring(0,a))&&(o=!0)}return o},Ya=function(e,t){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:".";if(!e)return;if(e[t])return Object.prototype.hasOwnProperty.call(e,t)?e[t]:void 0;const r=t.split(n);let i=e;for(let o=0;o<r.length;){if(!i||typeof i!="object")return;let a,s="";for(let l=o;l<r.length;++l)if(l!==o&&(s+=n),s+=r[l],a=i[s],a!==void 0){if(["string","number","boolean"].indexOf(typeof a)>-1&&l<r.length-1)continue;o+=l-o+1;break}i=a}return i},lo=e=>e?.replace("_","-"),Ox={type:"logger",log(e){this.output("log",e)},warn(e){this.output("warn",e)},error(e){this.output("error",e)},output(e,t){console?.[e]?.apply?.(console,t)}};class co{constructor(t){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};this.init(t,n)}init(t){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};this.prefix=n.prefix||"i18next:",this.logger=t||Ox,this.options=n,this.debug=n.debug}log(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return this.forward(n,"log","",!0)}warn(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return this.forward(n,"warn","",!0)}error(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return this.forward(n,"error","")}deprecate(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return this.forward(n,"warn","WARNING DEPRECATED: ",!0)}forward(t,n,r,i){return i&&!this.debug?null:(fe(t[0])&&(t[0]=`${r}${this.prefix} ${t[0]}`),this.logger[n](t))}create(t){return new co(this.logger,{prefix:`${this.prefix}:${t}:`,...this.options})}clone(t){return t=t||this.options,t.prefix=t.prefix||this.prefix,new co(this.logger,t)}}var qt=new co;class Io{constructor(){this.observers={}}on(t,n){return t.split(" ").forEach(r=>{this.observers[r]||(this.observers[r]=new Map);const i=this.observers[r].get(n)||0;this.observers[r].set(n,i+1)}),this}off(t,n){if(this.observers[t]){if(!n){delete this.observers[t];return}this.observers[t].delete(n)}}emit(t){for(var n=arguments.length,r=new Array(n>1?n-1:0),i=1;i<n;i++)r[i-1]=arguments[i];this.observers[t]&&Array.from(this.observers[t].entries()).forEach(a=>{let[s,l]=a;for(let c=0;c<l;c++)s(...r)}),this.observers["*"]&&Array.from(this.observers["*"].entries()).forEach(a=>{let[s,l]=a;for(let c=0;c<l;c++)s.apply(s,[t,...r])})}}class Lc extends Io{constructor(t){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{ns:["translation"],defaultNS:"translation"};super(),this.data=t||{},this.options=n,this.options.keySeparator===void 0&&(this.options.keySeparator="."),this.options.ignoreJSONStructure===void 0&&(this.options.ignoreJSONStructure=!0)}addNamespaces(t){this.options.ns.indexOf(t)<0&&this.options.ns.push(t)}removeNamespaces(t){const n=this.options.ns.indexOf(t);n>-1&&this.options.ns.splice(n,1)}getResource(t,n,r){let i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{};const o=i.keySeparator!==void 0?i.keySeparator:this.options.keySeparator,a=i.ignoreJSONStructure!==void 0?i.ignoreJSONStructure:this.options.ignoreJSONStructure;let s;t.indexOf(".")>-1?s=t.split("."):(s=[t,n],r&&(Array.isArray(r)?s.push(...r):fe(r)&&o?s.push(...r.split(o)):s.push(r)));const l=so(this.data,s);return!l&&!n&&!r&&t.indexOf(".")>-1&&(t=s[0],n=s[1],r=s.slice(2).join(".")),l||!a||!fe(r)?l:Ya(this.data?.[t]?.[n],r,o)}addResource(t,n,r,i){let o=arguments.length>4&&arguments[4]!==void 0?arguments[4]:{silent:!1};const a=o.keySeparator!==void 0?o.keySeparator:this.options.keySeparator;let s=[t,n];r&&(s=s.concat(a?r.split(a):r)),t.indexOf(".")>-1&&(s=t.split("."),i=n,n=s[1]),this.addNamespaces(n),Ic(this.data,s,i),o.silent||this.emit("added",t,n,r,i)}addResources(t,n,r){let i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{silent:!1};for(const o in r)(fe(r[o])||Array.isArray(r[o]))&&this.addResource(t,n,o,r[o],{silent:!0});i.silent||this.emit("added",t,n,r)}addResourceBundle(t,n,r,i,o){let a=arguments.length>5&&arguments[5]!==void 0?arguments[5]:{silent:!1,skipCopy:!1},s=[t,n];t.indexOf(".")>-1&&(s=t.split("."),i=r,r=n,n=s[1]),this.addNamespaces(n);let l=so(this.data,s)||{};a.skipCopy||(r=JSON.parse(JSON.stringify(r))),i?Cf(l,r,o):l={...l,...r},Ic(this.data,s,l),a.silent||this.emit("added",t,n,r)}removeResourceBundle(t,n){this.hasResourceBundle(t,n)&&delete this.data[t][n],this.removeNamespaces(n),this.emit("removed",t,n)}hasResourceBundle(t,n){return this.getResource(t,n)!==void 0}getResourceBundle(t,n){return n||(n=this.options.defaultNS),this.getResource(t,n)}getDataByLanguage(t){return this.data[t]}hasLanguageSomeTranslations(t){const n=this.getDataByLanguage(t);return!!(n&&Object.keys(n)||[]).find(i=>n[i]&&Object.keys(n[i]).length>0)}toJSON(){return this.data}}var Ef={processors:{},addPostProcessor(e){this.processors[e.name]=e},handle(e,t,n,r,i){return e.forEach(o=>{t=this.processors[o]?.process(t,n,r,i)??t}),t}};const Oc={},Dc=e=>!fe(e)&&typeof e!="boolean"&&typeof e!="number";class uo extends Io{constructor(t){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};super(),kx(["resourceStore","languageUtils","pluralResolver","interpolator","backendConnector","i18nFormat","utils"],t,this),this.options=n,this.options.keySeparator===void 0&&(this.options.keySeparator="."),this.logger=qt.create("translator")}changeLanguage(t){t&&(this.language=t)}exists(t){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{interpolation:{}};return t==null?!1:this.resolve(t,n)?.res!==void 0}extractFromKey(t,n){let r=n.nsSeparator!==void 0?n.nsSeparator:this.options.nsSeparator;r===void 0&&(r=":");const i=n.keySeparator!==void 0?n.keySeparator:this.options.keySeparator;let o=n.ns||this.options.defaultNS||[];const a=r&&t.indexOf(r)>-1,s=!this.options.userDefinedKeySeparator&&!n.keySeparator&&!this.options.userDefinedNsSeparator&&!n.nsSeparator&&!Lx(t,r,i);if(a&&!s){const l=t.match(this.interpolator.nestingRegexp);if(l&&l.length>0)return{key:t,namespaces:fe(o)?[o]:o};const c=t.split(r);(r!==i||r===i&&this.options.ns.indexOf(c[0])>-1)&&(o=c.shift()),t=c.join(i)}return{key:t,namespaces:fe(o)?[o]:o}}translate(t,n,r){if(typeof n!="object"&&this.options.overloadTranslationOptionHandler&&(n=this.options.overloadTranslationOptionHandler(arguments)),typeof n=="object"&&(n={...n}),n||(n={}),t==null)return"";Array.isArray(t)||(t=[String(t)]);const i=n.returnDetails!==void 0?n.returnDetails:this.options.returnDetails,o=n.keySeparator!==void 0?n.keySeparator:this.options.keySeparator,{key:a,namespaces:s}=this.extractFromKey(t[t.length-1],n),l=s[s.length-1],c=n.lng||this.language,u=n.appendNamespaceToCIMode||this.options.appendNamespaceToCIMode;if(c?.toLowerCase()==="cimode"){if(u){const D=n.nsSeparator||this.options.nsSeparator;return i?{res:`${l}${D}${a}`,usedKey:a,exactUsedKey:a,usedLng:c,usedNS:l,usedParams:this.getUsedParamsDetails(n)}:`${l}${D}${a}`}return i?{res:a,usedKey:a,exactUsedKey:a,usedLng:c,usedNS:l,usedParams:this.getUsedParamsDetails(n)}:a}const d=this.resolve(t,n);let h=d?.res;const f=d?.usedKey||a,m=d?.exactUsedKey||a,p=["[object Number]","[object Function]","[object RegExp]"],b=n.joinArrays!==void 0?n.joinArrays:this.options.joinArrays,v=!this.i18nFormat||this.i18nFormat.handleAsObject,x=n.count!==void 0&&!fe(n.count),w=uo.hasDefaultValue(n),E=x?this.pluralResolver.getSuffix(c,n.count,n):"",T=n.ordinal&&x?this.pluralResolver.getSuffix(c,n.count,{ordinal:!1}):"",S=x&&!n.ordinal&&n.count===0,k=S&&n[`defaultValue${this.options.pluralSeparator}zero`]||n[`defaultValue${E}`]||n[`defaultValue${T}`]||n.defaultValue;let O=h;v&&!h&&w&&(O=k);const _=Dc(O),R=Object.prototype.toString.apply(O);if(v&&O&&_&&p.indexOf(R)<0&&!(fe(b)&&Array.isArray(O))){if(!n.returnObjects&&!this.options.returnObjects){this.options.returnedObjectHandler||this.logger.warn("accessing an object - but returnObjects options is not enabled!");const D=this.options.returnedObjectHandler?this.options.returnedObjectHandler(f,O,{...n,ns:s}):`key '${a} (${this.language})' returned an object instead of string.`;return i?(d.res=D,d.usedParams=this.getUsedParamsDetails(n),d):D}if(o){const D=Array.isArray(O),L=D?[]:{},z=D?m:f;for(const H in O)if(Object.prototype.hasOwnProperty.call(O,H)){const V=`${z}${o}${H}`;w&&!h?L[H]=this.translate(V,{...n,defaultValue:Dc(k)?k[H]:void 0,joinArrays:!1,ns:s}):L[H]=this.translate(V,{...n,joinArrays:!1,ns:s}),L[H]===V&&(L[H]=O[H])}h=L}}else if(v&&fe(b)&&Array.isArray(h))h=h.join(b),h&&(h=this.extendTranslation(h,t,n,r));else{let D=!1,L=!1;!this.isValidLookup(h)&&w&&(D=!0,h=k),this.isValidLookup(h)||(L=!0,h=a);const H=(n.missingKeyNoValueFallbackToKey||this.options.missingKeyNoValueFallbackToKey)&&L?void 0:h,V=w&&k!==h&&this.options.updateMissing;if(L||D||V){if(this.logger.log(V?"updateKey":"missingKey",c,l,a,V?k:h),o){const F=this.resolve(a,{...n,keySeparator:!1});F&&F.res&&this.logger.warn("Seems the loaded translations were in flat JSON format instead of nested. Either set keySeparator: false on init or make sure your translations are published in nested format.")}let Q=[];const Y=this.languageUtils.getFallbackCodes(this.options.fallbackLng,n.lng||this.language);if(this.options.saveMissingTo==="fallback"&&Y&&Y[0])for(let F=0;F<Y.length;F++)Q.push(Y[F]);else this.options.saveMissingTo==="all"?Q=this.languageUtils.toResolveHierarchy(n.lng||this.language):Q.push(n.lng||this.language);const W=(F,A,ie)=>{const Z=w&&ie!==h?ie:H;this.options.missingKeyHandler?this.options.missingKeyHandler(F,l,A,Z,V,n):this.backendConnector?.saveMissing&&this.backendConnector.saveMissing(F,l,A,Z,V,n),this.emit("missingKey",F,l,A,h)};this.options.saveMissing&&(this.options.saveMissingPlurals&&x?Q.forEach(F=>{const A=this.pluralResolver.getSuffixes(F,n);S&&n[`defaultValue${this.options.pluralSeparator}zero`]&&A.indexOf(`${this.options.pluralSeparator}zero`)<0&&A.push(`${this.options.pluralSeparator}zero`),A.forEach(ie=>{W([F],a+ie,n[`defaultValue${ie}`]||k)})}):W(Q,a,k))}h=this.extendTranslation(h,t,n,d,r),L&&h===a&&this.options.appendNamespaceToMissingKey&&(h=`${l}:${a}`),(L||D)&&this.options.parseMissingKeyHandler&&(h=this.options.parseMissingKeyHandler(this.options.appendNamespaceToMissingKey?`${l}:${a}`:a,D?h:void 0))}return i?(d.res=h,d.usedParams=this.getUsedParamsDetails(n),d):h}extendTranslation(t,n,r,i,o){var a=this;if(this.i18nFormat?.parse)t=this.i18nFormat.parse(t,{...this.options.interpolation.defaultVariables,...r},r.lng||this.language||i.usedLng,i.usedNS,i.usedKey,{resolved:i});else if(!r.skipInterpolation){r.interpolation&&this.interpolator.init({...r,interpolation:{...this.options.interpolation,...r.interpolation}});const c=fe(t)&&(r?.interpolation?.skipOnVariables!==void 0?r.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables);let u;if(c){const h=t.match(this.interpolator.nestingRegexp);u=h&&h.length}let d=r.replace&&!fe(r.replace)?r.replace:r;if(this.options.interpolation.defaultVariables&&(d={...this.options.interpolation.defaultVariables,...d}),t=this.interpolator.interpolate(t,d,r.lng||this.language||i.usedLng,r),c){const h=t.match(this.interpolator.nestingRegexp),f=h&&h.length;u<f&&(r.nest=!1)}!r.lng&&i&&i.res&&(r.lng=this.language||i.usedLng),r.nest!==!1&&(t=this.interpolator.nest(t,function(){for(var h=arguments.length,f=new Array(h),m=0;m<h;m++)f[m]=arguments[m];return o?.[0]===f[0]&&!r.context?(a.logger.warn(`It seems you are nesting recursively key: ${f[0]} in key: ${n[0]}`),null):a.translate(...f,n)},r)),r.interpolation&&this.interpolator.reset()}const s=r.postProcess||this.options.postProcess,l=fe(s)?[s]:s;return t!=null&&l?.length&&r.applyPostProcessor!==!1&&(t=Ef.handle(l,t,n,this.options&&this.options.postProcessPassResolved?{i18nResolved:{...i,usedParams:this.getUsedParamsDetails(r)},...r}:r,this)),t}resolve(t){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},r,i,o,a,s;return fe(t)&&(t=[t]),t.forEach(l=>{if(this.isValidLookup(r))return;const c=this.extractFromKey(l,n),u=c.key;i=u;let d=c.namespaces;this.options.fallbackNS&&(d=d.concat(this.options.fallbackNS));const h=n.count!==void 0&&!fe(n.count),f=h&&!n.ordinal&&n.count===0,m=n.context!==void 0&&(fe(n.context)||typeof n.context=="number")&&n.context!=="",p=n.lngs?n.lngs:this.languageUtils.toResolveHierarchy(n.lng||this.language,n.fallbackLng);d.forEach(b=>{this.isValidLookup(r)||(s=b,!Oc[`${p[0]}-${b}`]&&this.utils?.hasLoadedNamespace&&!this.utils?.hasLoadedNamespace(s)&&(Oc[`${p[0]}-${b}`]=!0,this.logger.warn(`key "${i}" for languages "${p.join(", ")}" won't get resolved as namespace "${s}" was not yet loaded`,"This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!")),p.forEach(v=>{if(this.isValidLookup(r))return;a=v;const x=[u];if(this.i18nFormat?.addLookupKeys)this.i18nFormat.addLookupKeys(x,u,v,b,n);else{let E;h&&(E=this.pluralResolver.getSuffix(v,n.count,n));const T=`${this.options.pluralSeparator}zero`,S=`${this.options.pluralSeparator}ordinal${this.options.pluralSeparator}`;if(h&&(x.push(u+E),n.ordinal&&E.indexOf(S)===0&&x.push(u+E.replace(S,this.options.pluralSeparator)),f&&x.push(u+T)),m){const k=`${u}${this.options.contextSeparator}${n.context}`;x.push(k),h&&(x.push(k+E),n.ordinal&&E.indexOf(S)===0&&x.push(k+E.replace(S,this.options.pluralSeparator)),f&&x.push(k+T))}}let w;for(;w=x.pop();)this.isValidLookup(r)||(o=w,r=this.getResource(v,b,w,n))}))})}),{res:r,usedKey:i,exactUsedKey:o,usedLng:a,usedNS:s}}isValidLookup(t){return t!==void 0&&!(!this.options.returnNull&&t===null)&&!(!this.options.returnEmptyString&&t==="")}getResource(t,n,r){let i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{};return this.i18nFormat?.getResource?this.i18nFormat.getResource(t,n,r,i):this.resourceStore.getResource(t,n,r,i)}getUsedParamsDetails(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};const n=["defaultValue","ordinal","context","replace","lng","lngs","fallbackLng","ns","keySeparator","nsSeparator","returnObjects","returnDetails","joinArrays","postProcess","interpolation"],r=t.replace&&!fe(t.replace);let i=r?t.replace:t;if(r&&typeof t.count<"u"&&(i.count=t.count),this.options.interpolation.defaultVariables&&(i={...this.options.interpolation.defaultVariables,...i}),!r){i={...i};for(const o of n)delete i[o]}return i}static hasDefaultValue(t){const n="defaultValue";for(const r in t)if(Object.prototype.hasOwnProperty.call(t,r)&&n===r.substring(0,n.length)&&t[r]!==void 0)return!0;return!1}}class Nc{constructor(t){this.options=t,this.supportedLngs=this.options.supportedLngs||!1,this.logger=qt.create("languageUtils")}getScriptPartFromCode(t){if(t=lo(t),!t||t.indexOf("-")<0)return null;const n=t.split("-");return n.length===2||(n.pop(),n[n.length-1].toLowerCase()==="x")?null:this.formatLanguageCode(n.join("-"))}getLanguagePartFromCode(t){if(t=lo(t),!t||t.indexOf("-")<0)return t;const n=t.split("-");return this.formatLanguageCode(n[0])}formatLanguageCode(t){if(fe(t)&&t.indexOf("-")>-1){let n;try{n=Intl.getCanonicalLocales(t)[0]}catch{}return n&&this.options.lowerCaseLng&&(n=n.toLowerCase()),n||(this.options.lowerCaseLng?t.toLowerCase():t)}return this.options.cleanCode||this.options.lowerCaseLng?t.toLowerCase():t}isSupportedCode(t){return(this.options.load==="languageOnly"||this.options.nonExplicitSupportedLngs)&&(t=this.getLanguagePartFromCode(t)),!this.supportedLngs||!this.supportedLngs.length||this.supportedLngs.indexOf(t)>-1}getBestMatchFromCodes(t){if(!t)return null;let n;return t.forEach(r=>{if(n)return;const i=this.formatLanguageCode(r);(!this.options.supportedLngs||this.isSupportedCode(i))&&(n=i)}),!n&&this.options.supportedLngs&&t.forEach(r=>{if(n)return;const i=this.getLanguagePartFromCode(r);if(this.isSupportedCode(i))return n=i;n=this.options.supportedLngs.find(o=>{if(o===i)return o;if(!(o.indexOf("-")<0&&i.indexOf("-")<0)&&(o.indexOf("-")>0&&i.indexOf("-")<0&&o.substring(0,o.indexOf("-"))===i||o.indexOf(i)===0&&i.length>1))return o})}),n||(n=this.getFallbackCodes(this.options.fallbackLng)[0]),n}getFallbackCodes(t,n){if(!t)return[];if(typeof t=="function"&&(t=t(n)),fe(t)&&(t=[t]),Array.isArray(t))return t;if(!n)return t.default||[];let r=t[n];return r||(r=t[this.getScriptPartFromCode(n)]),r||(r=t[this.formatLanguageCode(n)]),r||(r=t[this.getLanguagePartFromCode(n)]),r||(r=t.default),r||[]}toResolveHierarchy(t,n){const r=this.getFallbackCodes(n||this.options.fallbackLng||[],t),i=[],o=a=>{a&&(this.isSupportedCode(a)?i.push(a):this.logger.warn(`rejecting language code not found in supportedLngs: ${a}`))};return fe(t)&&(t.indexOf("-")>-1||t.indexOf("_")>-1)?(this.options.load!=="languageOnly"&&o(this.formatLanguageCode(t)),this.options.load!=="languageOnly"&&this.options.load!=="currentOnly"&&o(this.getScriptPartFromCode(t)),this.options.load!=="currentOnly"&&o(this.getLanguagePartFromCode(t))):fe(t)&&o(this.formatLanguageCode(t)),r.forEach(a=>{i.indexOf(a)<0&&o(this.formatLanguageCode(a))}),i}}const Mc={zero:0,one:1,two:2,few:3,many:4,other:5},_c={select:e=>e===1?"one":"other",resolvedOptions:()=>({pluralCategories:["one","other"]})};class Dx{constructor(t){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};this.languageUtils=t,this.options=n,this.logger=qt.create("pluralResolver"),this.pluralRulesCache={}}addRule(t,n){this.rules[t]=n}clearCache(){this.pluralRulesCache={}}getRule(t){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};const r=lo(t==="dev"?"en":t),i=n.ordinal?"ordinal":"cardinal",o=JSON.stringify({cleanedCode:r,type:i});if(o in this.pluralRulesCache)return this.pluralRulesCache[o];let a;try{a=new Intl.PluralRules(r,{type:i})}catch{if(!Intl)return this.logger.error("No Intl support, please use an Intl polyfill!"),_c;if(!t.match(/-|_/))return _c;const l=this.languageUtils.getLanguagePartFromCode(t);a=this.getRule(l,n)}return this.pluralRulesCache[o]=a,a}needsPlural(t){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},r=this.getRule(t,n);return r||(r=this.getRule("dev",n)),r?.resolvedOptions().pluralCategories.length>1}getPluralFormsOfKey(t,n){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};return this.getSuffixes(t,r).map(i=>`${n}${i}`)}getSuffixes(t){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},r=this.getRule(t,n);return r||(r=this.getRule("dev",n)),r?r.resolvedOptions().pluralCategories.sort((i,o)=>Mc[i]-Mc[o]).map(i=>`${this.options.prepend}${n.ordinal?`ordinal${this.options.prepend}`:""}${i}`):[]}getSuffix(t,n){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};const i=this.getRule(t,r);return i?`${this.options.prepend}${r.ordinal?`ordinal${this.options.prepend}`:""}${i.select(n)}`:(this.logger.warn(`no plural rule found for: ${t}`),this.getSuffix("dev",n,r))}}const jc=function(e,t,n){let r=arguments.length>3&&arguments[3]!==void 0?arguments[3]:".",i=arguments.length>4&&arguments[4]!==void 0?arguments[4]:!0,o=Cx(e,t,n);return!o&&i&&fe(n)&&(o=Ya(e,n,r),o===void 0&&(o=Ya(t,n,r))),o},ia=e=>e.replace(/\$/g,"$$$$");class Nx{constructor(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};this.logger=qt.create("interpolator"),this.options=t,this.format=t?.interpolation?.format||(n=>n),this.init(t)}init(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};t.interpolation||(t.interpolation={escapeValue:!0});const{escape:n,escapeValue:r,useRawValueToEscape:i,prefix:o,prefixEscaped:a,suffix:s,suffixEscaped:l,formatSeparator:c,unescapeSuffix:u,unescapePrefix:d,nestingPrefix:h,nestingPrefixEscaped:f,nestingSuffix:m,nestingSuffixEscaped:p,nestingOptionsSeparator:b,maxReplaces:v,alwaysFormat:x}=t.interpolation;this.escape=n!==void 0?n:Rx,this.escapeValue=r!==void 0?r:!0,this.useRawValueToEscape=i!==void 0?i:!1,this.prefix=o?cr(o):a||"{{",this.suffix=s?cr(s):l||"}}",this.formatSeparator=c||",",this.unescapePrefix=u?"":d||"-",this.unescapeSuffix=this.unescapePrefix?"":u||"",this.nestingPrefix=h?cr(h):f||cr("$t("),this.nestingSuffix=m?cr(m):p||cr(")"),this.nestingOptionsSeparator=b||",",this.maxReplaces=v||1e3,this.alwaysFormat=x!==void 0?x:!1,this.resetRegExp()}reset(){this.options&&this.init(this.options)}resetRegExp(){const t=(n,r)=>n?.source===r?(n.lastIndex=0,n):new RegExp(r,"g");this.regexp=t(this.regexp,`${this.prefix}(.+?)${this.suffix}`),this.regexpUnescape=t(this.regexpUnescape,`${this.prefix}${this.unescapePrefix}(.+?)${this.unescapeSuffix}${this.suffix}`),this.nestingRegexp=t(this.nestingRegexp,`${this.nestingPrefix}(.+?)${this.nestingSuffix}`)}interpolate(t,n,r,i){let o,a,s;const l=this.options&&this.options.interpolation&&this.options.interpolation.defaultVariables||{},c=f=>{if(f.indexOf(this.formatSeparator)<0){const v=jc(n,l,f,this.options.keySeparator,this.options.ignoreJSONStructure);return this.alwaysFormat?this.format(v,void 0,r,{...i,...n,interpolationkey:f}):v}const m=f.split(this.formatSeparator),p=m.shift().trim(),b=m.join(this.formatSeparator).trim();return this.format(jc(n,l,p,this.options.keySeparator,this.options.ignoreJSONStructure),b,r,{...i,...n,interpolationkey:p})};this.resetRegExp();const u=i?.missingInterpolationHandler||this.options.missingInterpolationHandler,d=i?.interpolation?.skipOnVariables!==void 0?i.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables;return[{regex:this.regexpUnescape,safeValue:f=>ia(f)},{regex:this.regexp,safeValue:f=>this.escapeValue?ia(this.escape(f)):ia(f)}].forEach(f=>{for(s=0;o=f.regex.exec(t);){const m=o[1].trim();if(a=c(m),a===void 0)if(typeof u=="function"){const b=u(t,o,i);a=fe(b)?b:""}else if(i&&Object.prototype.hasOwnProperty.call(i,m))a="";else if(d){a=o[0];continue}else this.logger.warn(`missed to pass in variable ${m} for interpolating ${t}`),a="";else!fe(a)&&!this.useRawValueToEscape&&(a=Rc(a));const p=f.safeValue(a);if(t=t.replace(o[0],p),d?(f.regex.lastIndex+=a.length,f.regex.lastIndex-=o[0].length):f.regex.lastIndex=0,s++,s>=this.maxReplaces)break}}),t}nest(t,n){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},i,o,a;const s=(l,c)=>{const u=this.nestingOptionsSeparator;if(l.indexOf(u)<0)return l;const d=l.split(new RegExp(`${u}[ ]*{`));let h=`{${d[1]}`;l=d[0],h=this.interpolate(h,a);const f=h.match(/'/g),m=h.match(/"/g);((f?.length??0)%2===0&&!m||m.length%2!==0)&&(h=h.replace(/'/g,'"'));try{a=JSON.parse(h),c&&(a={...c,...a})}catch(p){return this.logger.warn(`failed parsing options string in nesting for key ${l}`,p),`${l}${u}${h}`}return a.defaultValue&&a.defaultValue.indexOf(this.prefix)>-1&&delete a.defaultValue,l};for(;i=this.nestingRegexp.exec(t);){let l=[];a={...r},a=a.replace&&!fe(a.replace)?a.replace:a,a.applyPostProcessor=!1,delete a.defaultValue;let c=!1;if(i[0].indexOf(this.formatSeparator)!==-1&&!/{.*}/.test(i[1])){const u=i[1].split(this.formatSeparator).map(d=>d.trim());i[1]=u.shift(),l=u,c=!0}if(o=n(s.call(this,i[1].trim(),a),a),o&&i[0]===t&&!fe(o))return o;fe(o)||(o=Rc(o)),o||(this.logger.warn(`missed to resolve ${i[1]} for nesting ${t}`),o=""),c&&(o=l.reduce((u,d)=>this.format(u,d,r.lng,{...r,interpolationkey:i[1].trim()}),o.trim())),t=t.replace(i[0],o),this.regexp.lastIndex=0}return t}}const Mx=e=>{let t=e.toLowerCase().trim();const n={};if(e.indexOf("(")>-1){const r=e.split("(");t=r[0].toLowerCase().trim();const i=r[1].substring(0,r[1].length-1);t==="currency"&&i.indexOf(":")<0?n.currency||(n.currency=i.trim()):t==="relativetime"&&i.indexOf(":")<0?n.range||(n.range=i.trim()):i.split(";").forEach(a=>{if(a){const[s,...l]=a.split(":"),c=l.join(":").trim().replace(/^'+|'+$/g,""),u=s.trim();n[u]||(n[u]=c),c==="false"&&(n[u]=!1),c==="true"&&(n[u]=!0),isNaN(c)||(n[u]=parseInt(c,10))}})}return{formatName:t,formatOptions:n}},ur=e=>{const t={};return(n,r,i)=>{let o=i;i&&i.interpolationkey&&i.formatParams&&i.formatParams[i.interpolationkey]&&i[i.interpolationkey]&&(o={...o,[i.interpolationkey]:void 0});const a=r+JSON.stringify(o);let s=t[a];return s||(s=e(lo(r),i),t[a]=s),s(n)}};class _x{constructor(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};this.logger=qt.create("formatter"),this.options=t,this.formats={number:ur((n,r)=>{const i=new Intl.NumberFormat(n,{...r});return o=>i.format(o)}),currency:ur((n,r)=>{const i=new Intl.NumberFormat(n,{...r,style:"currency"});return o=>i.format(o)}),datetime:ur((n,r)=>{const i=new Intl.DateTimeFormat(n,{...r});return o=>i.format(o)}),relativetime:ur((n,r)=>{const i=new Intl.RelativeTimeFormat(n,{...r});return o=>i.format(o,r.range||"day")}),list:ur((n,r)=>{const i=new Intl.ListFormat(n,{...r});return o=>i.format(o)})},this.init(t)}init(t){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{interpolation:{}};this.formatSeparator=n.interpolation.formatSeparator||","}add(t,n){this.formats[t.toLowerCase().trim()]=n}addCached(t,n){this.formats[t.toLowerCase().trim()]=ur(n)}format(t,n,r){let i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{};const o=n.split(this.formatSeparator);if(o.length>1&&o[0].indexOf("(")>1&&o[0].indexOf(")")<0&&o.find(s=>s.indexOf(")")>-1)){const s=o.findIndex(l=>l.indexOf(")")>-1);o[0]=[o[0],...o.splice(1,s)].join(this.formatSeparator)}return o.reduce((s,l)=>{const{formatName:c,formatOptions:u}=Mx(l);if(this.formats[c]){let d=s;try{const h=i?.formatParams?.[i.interpolationkey]||{},f=h.locale||h.lng||i.locale||i.lng||r;d=this.formats[c](s,f,{...u,...i,...h})}catch(h){this.logger.warn(h)}return d}else this.logger.warn(`there was no format function for ${c}`);return s},t)}}const jx=(e,t)=>{e.pending[t]!==void 0&&(delete e.pending[t],e.pendingCount--)};class Fx extends Io{constructor(t,n,r){let i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{};super(),this.backend=t,this.store=n,this.services=r,this.languageUtils=r.languageUtils,this.options=i,this.logger=qt.create("backendConnector"),this.waitingReads=[],this.maxParallelReads=i.maxParallelReads||10,this.readingCalls=0,this.maxRetries=i.maxRetries>=0?i.maxRetries:5,this.retryTimeout=i.retryTimeout>=1?i.retryTimeout:350,this.state={},this.queue=[],this.backend?.init?.(r,i.backend,i)}queueLoad(t,n,r,i){const o={},a={},s={},l={};return t.forEach(c=>{let u=!0;n.forEach(d=>{const h=`${c}|${d}`;!r.reload&&this.store.hasResourceBundle(c,d)?this.state[h]=2:this.state[h]<0||(this.state[h]===1?a[h]===void 0&&(a[h]=!0):(this.state[h]=1,u=!1,a[h]===void 0&&(a[h]=!0),o[h]===void 0&&(o[h]=!0),l[d]===void 0&&(l[d]=!0)))}),u||(s[c]=!0)}),(Object.keys(o).length||Object.keys(a).length)&&this.queue.push({pending:a,pendingCount:Object.keys(a).length,loaded:{},errors:[],callback:i}),{toLoad:Object.keys(o),pending:Object.keys(a),toLoadLanguages:Object.keys(s),toLoadNamespaces:Object.keys(l)}}loaded(t,n,r){const i=t.split("|"),o=i[0],a=i[1];n&&this.emit("failedLoading",o,a,n),!n&&r&&this.store.addResourceBundle(o,a,r,void 0,void 0,{skipCopy:!0}),this.state[t]=n?-1:2,n&&r&&(this.state[t]=0);const s={};this.queue.forEach(l=>{Ax(l.loaded,[o],a),jx(l,t),n&&l.errors.push(n),l.pendingCount===0&&!l.done&&(Object.keys(l.loaded).forEach(c=>{s[c]||(s[c]={});const u=l.loaded[c];u.length&&u.forEach(d=>{s[c][d]===void 0&&(s[c][d]=!0)})}),l.done=!0,l.errors.length?l.callback(l.errors):l.callback())}),this.emit("loaded",s),this.queue=this.queue.filter(l=>!l.done)}read(t,n,r){let i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:0,o=arguments.length>4&&arguments[4]!==void 0?arguments[4]:this.retryTimeout,a=arguments.length>5?arguments[5]:void 0;if(!t.length)return a(null,{});if(this.readingCalls>=this.maxParallelReads){this.waitingReads.push({lng:t,ns:n,fcName:r,tried:i,wait:o,callback:a});return}this.readingCalls++;const s=(c,u)=>{if(this.readingCalls--,this.waitingReads.length>0){const d=this.waitingReads.shift();this.read(d.lng,d.ns,d.fcName,d.tried,d.wait,d.callback)}if(c&&u&&i<this.maxRetries){setTimeout(()=>{this.read.call(this,t,n,r,i+1,o*2,a)},o);return}a(c,u)},l=this.backend[r].bind(this.backend);if(l.length===2){try{const c=l(t,n);c&&typeof c.then=="function"?c.then(u=>s(null,u)).catch(s):s(null,c)}catch(c){s(c)}return}return l(t,n,s)}prepareLoading(t,n){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},i=arguments.length>3?arguments[3]:void 0;if(!this.backend)return this.logger.warn("No backend was added via i18next.use. Will not load resources."),i&&i();fe(t)&&(t=this.languageUtils.toResolveHierarchy(t)),fe(n)&&(n=[n]);const o=this.queueLoad(t,n,r,i);if(!o.toLoad.length)return o.pending.length||i(),null;o.toLoad.forEach(a=>{this.loadOne(a)})}load(t,n,r){this.prepareLoading(t,n,{},r)}reload(t,n,r){this.prepareLoading(t,n,{reload:!0},r)}loadOne(t){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"";const r=t.split("|"),i=r[0],o=r[1];this.read(i,o,"read",void 0,void 0,(a,s)=>{a&&this.logger.warn(`${n}loading namespace ${o} for language ${i} failed`,a),!a&&s&&this.logger.log(`${n}loaded namespace ${o} for language ${i}`,s),this.loaded(t,a,s)})}saveMissing(t,n,r,i,o){let a=arguments.length>5&&arguments[5]!==void 0?arguments[5]:{},s=arguments.length>6&&arguments[6]!==void 0?arguments[6]:()=>{};if(this.services?.utils?.hasLoadedNamespace&&!this.services?.utils?.hasLoadedNamespace(n)){this.logger.warn(`did not save key "${r}" as the namespace "${n}" was not yet loaded`,"This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!");return}if(!(r==null||r==="")){if(this.backend?.create){const l={...a,isUpdate:o},c=this.backend.create.bind(this.backend);if(c.length<6)try{let u;c.length===5?u=c(t,n,r,i,l):u=c(t,n,r,i),u&&typeof u.then=="function"?u.then(d=>s(null,d)).catch(s):s(null,u)}catch(u){s(u)}else c(t,n,r,i,s,l)}!t||!t[0]||this.store.addResource(t[0],n,r,i)}}}const Fc=()=>({debug:!1,initAsync:!0,ns:["translation"],defaultNS:["translation"],fallbackLng:["dev"],fallbackNS:!1,supportedLngs:!1,nonExplicitSupportedLngs:!1,load:"all",preload:!1,simplifyPluralSuffix:!0,keySeparator:".",nsSeparator:":",pluralSeparator:"_",contextSeparator:"_",partialBundledLanguages:!1,saveMissing:!1,updateMissing:!1,saveMissingTo:"fallback",saveMissingPlurals:!0,missingKeyHandler:!1,missingInterpolationHandler:!1,postProcess:!1,postProcessPassResolved:!1,returnNull:!1,returnEmptyString:!0,returnObjects:!1,joinArrays:!1,returnedObjectHandler:!1,parseMissingKeyHandler:!1,appendNamespaceToMissingKey:!1,appendNamespaceToCIMode:!1,overloadTranslationOptionHandler:e=>{let t={};if(typeof e[1]=="object"&&(t=e[1]),fe(e[1])&&(t.defaultValue=e[1]),fe(e[2])&&(t.tDescription=e[2]),typeof e[2]=="object"||typeof e[3]=="object"){const n=e[3]||e[2];Object.keys(n).forEach(r=>{t[r]=n[r]})}return t},interpolation:{escapeValue:!0,format:e=>e,prefix:"{{",suffix:"}}",formatSeparator:",",unescapePrefix:"-",nestingPrefix:"$t(",nestingSuffix:")",nestingOptionsSeparator:",",maxReplaces:1e3,skipOnVariables:!0}}),Hc=e=>(fe(e.ns)&&(e.ns=[e.ns]),fe(e.fallbackLng)&&(e.fallbackLng=[e.fallbackLng]),fe(e.fallbackNS)&&(e.fallbackNS=[e.fallbackNS]),e.supportedLngs?.indexOf?.("cimode")<0&&(e.supportedLngs=e.supportedLngs.concat(["cimode"])),typeof e.initImmediate=="boolean"&&(e.initAsync=e.initImmediate),e),Oi=()=>{},Hx=e=>{Object.getOwnPropertyNames(Object.getPrototypeOf(e)).forEach(n=>{typeof e[n]=="function"&&(e[n]=e[n].bind(e))})};class fi extends Io{constructor(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},n=arguments.length>1?arguments[1]:void 0;if(super(),this.options=Hc(t),this.services={},this.logger=qt,this.modules={external:[]},Hx(this),n&&!this.isInitialized&&!t.isClone){if(!this.options.initAsync)return this.init(t,n),this;setTimeout(()=>{this.init(t,n)},0)}}init(){var t=this;let n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},r=arguments.length>1?arguments[1]:void 0;this.isInitializing=!0,typeof n=="function"&&(r=n,n={}),n.defaultNS==null&&n.ns&&(fe(n.ns)?n.defaultNS=n.ns:n.ns.indexOf("translation")<0&&(n.defaultNS=n.ns[0]));const i=Fc();this.options={...i,...this.options,...Hc(n)},this.options.interpolation={...i.interpolation,...this.options.interpolation},n.keySeparator!==void 0&&(this.options.userDefinedKeySeparator=n.keySeparator),n.nsSeparator!==void 0&&(this.options.userDefinedNsSeparator=n.nsSeparator);const o=u=>u?typeof u=="function"?new u:u:null;if(!this.options.isClone){this.modules.logger?qt.init(o(this.modules.logger),this.options):qt.init(null,this.options);let u;this.modules.formatter?u=this.modules.formatter:u=_x;const d=new Nc(this.options);this.store=new Lc(this.options.resources,this.options);const h=this.services;h.logger=qt,h.resourceStore=this.store,h.languageUtils=d,h.pluralResolver=new Dx(d,{prepend:this.options.pluralSeparator,simplifyPluralSuffix:this.options.simplifyPluralSuffix}),u&&(!this.options.interpolation.format||this.options.interpolation.format===i.interpolation.format)&&(h.formatter=o(u),h.formatter.init(h,this.options),this.options.interpolation.format=h.formatter.format.bind(h.formatter)),h.interpolator=new Nx(this.options),h.utils={hasLoadedNamespace:this.hasLoadedNamespace.bind(this)},h.backendConnector=new Fx(o(this.modules.backend),h.resourceStore,h,this.options),h.backendConnector.on("*",function(f){for(var m=arguments.length,p=new Array(m>1?m-1:0),b=1;b<m;b++)p[b-1]=arguments[b];t.emit(f,...p)}),this.modules.languageDetector&&(h.languageDetector=o(this.modules.languageDetector),h.languageDetector.init&&h.languageDetector.init(h,this.options.detection,this.options)),this.modules.i18nFormat&&(h.i18nFormat=o(this.modules.i18nFormat),h.i18nFormat.init&&h.i18nFormat.init(this)),this.translator=new uo(this.services,this.options),this.translator.on("*",function(f){for(var m=arguments.length,p=new Array(m>1?m-1:0),b=1;b<m;b++)p[b-1]=arguments[b];t.emit(f,...p)}),this.modules.external.forEach(f=>{f.init&&f.init(this)})}if(this.format=this.options.interpolation.format,r||(r=Oi),this.options.fallbackLng&&!this.services.languageDetector&&!this.options.lng){const u=this.services.languageUtils.getFallbackCodes(this.options.fallbackLng);u.length>0&&u[0]!=="dev"&&(this.options.lng=u[0])}!this.services.languageDetector&&!this.options.lng&&this.logger.warn("init: no languageDetector is used and no lng is defined"),["getResource","hasResourceBundle","getResourceBundle","getDataByLanguage"].forEach(u=>{this[u]=function(){return t.store[u](...arguments)}}),["addResource","addResources","addResourceBundle","removeResourceBundle"].forEach(u=>{this[u]=function(){return t.store[u](...arguments),t}});const l=Xr(),c=()=>{const u=(d,h)=>{this.isInitializing=!1,this.isInitialized&&!this.initializedStoreOnce&&this.logger.warn("init: i18next is already initialized. You should call init just once!"),this.isInitialized=!0,this.options.isClone||this.logger.log("initialized",this.options),this.emit("initialized",this.options),l.resolve(h),r(d,h)};if(this.languages&&!this.isInitialized)return u(null,this.t.bind(this));this.changeLanguage(this.options.lng,u)};return this.options.resources||!this.options.initAsync?c():setTimeout(c,0),l}loadResources(t){let r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:Oi;const i=fe(t)?t:this.language;if(typeof t=="function"&&(r=t),!this.options.resources||this.options.partialBundledLanguages){if(i?.toLowerCase()==="cimode"&&(!this.options.preload||this.options.preload.length===0))return r();const o=[],a=s=>{if(!s||s==="cimode")return;this.services.languageUtils.toResolveHierarchy(s).forEach(c=>{c!=="cimode"&&o.indexOf(c)<0&&o.push(c)})};i?a(i):this.services.languageUtils.getFallbackCodes(this.options.fallbackLng).forEach(l=>a(l)),this.options.preload?.forEach?.(s=>a(s)),this.services.backendConnector.load(o,this.options.ns,s=>{!s&&!this.resolvedLanguage&&this.language&&this.setResolvedLanguage(this.language),r(s)})}else r(null)}reloadResources(t,n,r){const i=Xr();return typeof t=="function"&&(r=t,t=void 0),typeof n=="function"&&(r=n,n=void 0),t||(t=this.languages),n||(n=this.options.ns),r||(r=Oi),this.services.backendConnector.reload(t,n,o=>{i.resolve(),r(o)}),i}use(t){if(!t)throw new Error("You are passing an undefined module! Please check the object you are passing to i18next.use()");if(!t.type)throw new Error("You are passing a wrong module! Please check the object you are passing to i18next.use()");return t.type==="backend"&&(this.modules.backend=t),(t.type==="logger"||t.log&&t.warn&&t.error)&&(this.modules.logger=t),t.type==="languageDetector"&&(this.modules.languageDetector=t),t.type==="i18nFormat"&&(this.modules.i18nFormat=t),t.type==="postProcessor"&&Ef.addPostProcessor(t),t.type==="formatter"&&(this.modules.formatter=t),t.type==="3rdParty"&&this.modules.external.push(t),this}setResolvedLanguage(t){if(!(!t||!this.languages)&&!(["cimode","dev"].indexOf(t)>-1))for(let n=0;n<this.languages.length;n++){const r=this.languages[n];if(!(["cimode","dev"].indexOf(r)>-1)&&this.store.hasLanguageSomeTranslations(r)){this.resolvedLanguage=r;break}}}changeLanguage(t,n){var r=this;this.isLanguageChangingTo=t;const i=Xr();this.emit("languageChanging",t);const o=l=>{this.language=l,this.languages=this.services.languageUtils.toResolveHierarchy(l),this.resolvedLanguage=void 0,this.setResolvedLanguage(l)},a=(l,c)=>{c?(o(c),this.translator.changeLanguage(c),this.isLanguageChangingTo=void 0,this.emit("languageChanged",c),this.logger.log("languageChanged",c)):this.isLanguageChangingTo=void 0,i.resolve(function(){return r.t(...arguments)}),n&&n(l,function(){return r.t(...arguments)})},s=l=>{!t&&!l&&this.services.languageDetector&&(l=[]);const c=fe(l)?l:this.services.languageUtils.getBestMatchFromCodes(l);c&&(this.language||o(c),this.translator.language||this.translator.changeLanguage(c),this.services.languageDetector?.cacheUserLanguage?.(c)),this.loadResources(c,u=>{a(u,c)})};return!t&&this.services.languageDetector&&!this.services.languageDetector.async?s(this.services.languageDetector.detect()):!t&&this.services.languageDetector&&this.services.languageDetector.async?this.services.languageDetector.detect.length===0?this.services.languageDetector.detect().then(s):this.services.languageDetector.detect(s):s(t),i}getFixedT(t,n,r){var i=this;const o=function(a,s){let l;if(typeof s!="object"){for(var c=arguments.length,u=new Array(c>2?c-2:0),d=2;d<c;d++)u[d-2]=arguments[d];l=i.options.overloadTranslationOptionHandler([a,s].concat(u))}else l={...s};l.lng=l.lng||o.lng,l.lngs=l.lngs||o.lngs,l.ns=l.ns||o.ns,l.keyPrefix!==""&&(l.keyPrefix=l.keyPrefix||r||o.keyPrefix);const h=i.options.keySeparator||".";let f;return l.keyPrefix&&Array.isArray(a)?f=a.map(m=>`${l.keyPrefix}${h}${m}`):f=l.keyPrefix?`${l.keyPrefix}${h}${a}`:a,i.t(f,l)};return fe(t)?o.lng=t:o.lngs=t,o.ns=n,o.keyPrefix=r,o}t(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return this.translator?.translate(...n)}exists(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return this.translator?.exists(...n)}setDefaultNamespace(t){this.options.defaultNS=t}hasLoadedNamespace(t){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(!this.isInitialized)return this.logger.warn("hasLoadedNamespace: i18next was not initialized",this.languages),!1;if(!this.languages||!this.languages.length)return this.logger.warn("hasLoadedNamespace: i18n.languages were undefined or empty",this.languages),!1;const r=n.lng||this.resolvedLanguage||this.languages[0],i=this.options?this.options.fallbackLng:!1,o=this.languages[this.languages.length-1];if(r.toLowerCase()==="cimode")return!0;const a=(s,l)=>{const c=this.services.backendConnector.state[`${s}|${l}`];return c===-1||c===0||c===2};if(n.precheck){const s=n.precheck(this,a);if(s!==void 0)return s}return!!(this.hasResourceBundle(r,t)||!this.services.backendConnector.backend||this.options.resources&&!this.options.partialBundledLanguages||a(r,t)&&(!i||a(o,t)))}loadNamespaces(t,n){const r=Xr();return this.options.ns?(fe(t)&&(t=[t]),t.forEach(i=>{this.options.ns.indexOf(i)<0&&this.options.ns.push(i)}),this.loadResources(i=>{r.resolve(),n&&n(i)}),r):(n&&n(),Promise.resolve())}loadLanguages(t,n){const r=Xr();fe(t)&&(t=[t]);const i=this.options.preload||[],o=t.filter(a=>i.indexOf(a)<0&&this.services.languageUtils.isSupportedCode(a));return o.length?(this.options.preload=i.concat(o),this.loadResources(a=>{r.resolve(),n&&n(a)}),r):(n&&n(),Promise.resolve())}dir(t){if(t||(t=this.resolvedLanguage||(this.languages?.length>0?this.languages[0]:this.language)),!t)return"rtl";const n=["ar","shu","sqr","ssh","xaa","yhd","yud","aao","abh","abv","acm","acq","acw","acx","acy","adf","ads","aeb","aec","afb","ajp","apc","apd","arb","arq","ars","ary","arz","auz","avl","ayh","ayl","ayn","ayp","bbz","pga","he","iw","ps","pbt","pbu","pst","prp","prd","ug","ur","ydd","yds","yih","ji","yi","hbo","men","xmn","fa","jpr","peo","pes","prs","dv","sam","ckb"],r=this.services?.languageUtils||new Nc(Fc());return n.indexOf(r.getLanguagePartFromCode(t))>-1||t.toLowerCase().indexOf("-arab")>1?"rtl":"ltr"}static createInstance(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},n=arguments.length>1?arguments[1]:void 0;return new fi(t,n)}cloneInstance(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:Oi;const r=t.forkResourceStore;r&&delete t.forkResourceStore;const i={...this.options,...t,isClone:!0},o=new fi(i);if((t.debug!==void 0||t.prefix!==void 0)&&(o.logger=o.logger.clone(t)),["store","services","language"].forEach(s=>{o[s]=this[s]}),o.services={...this.services},o.services.utils={hasLoadedNamespace:o.hasLoadedNamespace.bind(o)},r){const s=Object.keys(this.store.data).reduce((l,c)=>(l[c]={...this.store.data[c]},Object.keys(l[c]).reduce((u,d)=>(u[d]={...l[c][d]},u),{})),{});o.store=new Lc(s,i),o.services.resourceStore=o.store}return o.translator=new uo(o.services,i),o.translator.on("*",function(s){for(var l=arguments.length,c=new Array(l>1?l-1:0),u=1;u<l;u++)c[u-1]=arguments[u];o.emit(s,...c)}),o.init(i,n),o.translator.options=i,o.translator.backendConnector.services.utils={hasLoadedNamespace:o.hasLoadedNamespace.bind(o)},o}toJSON(){return{options:this.options,store:this.store,language:this.language,languages:this.languages,resolvedLanguage:this.resolvedLanguage}}}const Ue=fi.createInstance();Ue.createInstance=fi.createInstance;Ue.createInstance;Ue.dir;Ue.init;Ue.loadResources;Ue.reloadResources;Ue.use;Ue.changeLanguage;Ue.getFixedT;Ue.t;Ue.exists;Ue.setDefaultNamespace;Ue.hasLoadedNamespace;Ue.loadNamespaces;Ue.loadLanguages;function Ux(e,t){var n=typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=Bx(e))||t){n&&(e=n);var r=0,i=function(){};return{s:i,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(c){throw c},f:i}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
165
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var o,a=!0,s=!1;return{s:function(){n=n.call(e)},n:function(){var c=n.next();return a=c.done,c},e:function(c){s=!0,o=c},f:function(){try{a||n.return==null||n.return()}finally{if(s)throw o}}}}function Bx(e,t){if(e){if(typeof e=="string")return Uc(e,t);var n={}.toString.call(e).slice(8,-1);return n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set"?Array.from(e):n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Uc(e,t):void 0}}function Uc(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function Xa(e){"@babel/helpers - typeof";return Xa=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Xa(e)}var Rf=["__proto__","constructor","prototype"];function Pf(e){return!(typeof e!="string"||e.length===0||e.length>128||Rf.indexOf(e)>-1||e.indexOf("..")>-1||e.indexOf("\\")>-1||/[?#%\s@]/.test(e)||/[\x00-\x1F\x7F]/.test(e))}function Tf(e){return!(!Pf(e)||e.indexOf("/")>-1)}function zx(e){return Pf(e)}var $x={lng:Tf,ns:zx};function Di(e){return typeof e!="string"?e:e.replace(/[\r\n\x00-\x1F\x7F]/g," ")}function Vx(e){if(typeof e!="string"||e.length===0)return e;try{var t=new URL(e);return t.username||t.password?(t.username="",t.password="",t.toString()):e}catch{return e.replace(/(\/\/)[^/@\s]+@/g,"$1")}}function If(){return typeof XMLHttpRequest=="function"||(typeof XMLHttpRequest>"u"?"undefined":Xa(XMLHttpRequest))==="object"}function Wx(e){return!!e&&typeof e.then=="function"}function Kx(e){return Wx(e)?e:Promise.resolve(e)}var qx=/\{\{(.+?)\}\}/g;function Bc(e,t){var n=!1,r=e.replace(qx,function(i,o){var a=o.trim();if(Rf.indexOf(a)>-1)return i;var s=t[a];if(s==null)return i;var l=$x[a]||Tf,c=String(s).split("+"),u=Ux(c),d;try{for(u.s();!(d=u.n()).done;){var h=d.value;if(!l(h))return n=!0,i}}catch(f){u.e(f)}finally{u.f()}return c.join("+")});return n?null:r}function zc(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function $c(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?zc(Object(n),!0).forEach(function(r){Gx(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):zc(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Gx(e,t,n){return(t=Qx(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Qx(e){var t=Yx(e,"string");return Jn(t)=="symbol"?t:t+""}function Yx(e,t){if(Jn(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(Jn(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Jn(e){"@babel/helpers - typeof";return Jn=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Jn(e)}var wn=typeof fetch=="function"?fetch:void 0;typeof global<"u"&&global.fetch?wn=global.fetch:typeof window<"u"&&window.fetch&&(wn=window.fetch);var hi;If()&&(typeof global<"u"&&global.XMLHttpRequest?hi=global.XMLHttpRequest:typeof window<"u"&&window.XMLHttpRequest&&(hi=window.XMLHttpRequest));var fo;typeof ActiveXObject=="function"&&(typeof global<"u"&&global.ActiveXObject?fo=global.ActiveXObject:typeof window<"u"&&window.ActiveXObject&&(fo=window.ActiveXObject));typeof wn!="function"&&(wn=void 0);if(!wn&&!hi&&!fo)try{se(()=>import("./browser-ponyfill-DBWdeCTC.js").then(e=>e.b),__vite__mapDeps([0,1])).then(function(e){wn=e.default}).catch(function(){})}catch{}var Lf=["__proto__","constructor","prototype"],Ja=function(t,n){if(n&&Jn(n)==="object"){for(var r="",i=0,o=Object.keys(n);i<o.length;i++){var a=o[i];Lf.indexOf(a)>-1||(r+="&"+encodeURIComponent(a)+"="+encodeURIComponent(n[a]))}if(!r)return t;t=t+(t.indexOf("?")!==-1?"&":"?")+r.slice(1)}return t},Vc=function(t,n,r,i){var o=function(l){if(!l.ok)return r(l.statusText||"Error",{status:l.status});l.text().then(function(c){r(null,{status:l.status,data:c})}).catch(r)};if(i){var a=i(t,n);if(a instanceof Promise){a.then(o).catch(r);return}}typeof fetch=="function"?fetch(t,n).then(o).catch(r):wn(t,n).then(o).catch(r)},Xx=function(t,n,r,i){t.queryStringParams&&(n=Ja(n,t.queryStringParams));var o=$c({},typeof t.customHeaders=="function"?t.customHeaders():t.customHeaders);typeof window>"u"&&typeof global<"u"&&typeof global.process<"u"&&global.process.versions&&global.process.versions.node&&(o["User-Agent"]="i18next-http-backend (node/".concat(global.process.version,"; ").concat(global.process.platform," ").concat(global.process.arch,")")),r&&(o["Content-Type"]="application/json");var a=typeof t.requestOptions=="function"?t.requestOptions(r):t.requestOptions,s=$c({method:r?"POST":"GET",body:r?t.stringify(r):void 0,headers:o},t._omitFetchOptions?{}:a),l=typeof t.alternateFetch=="function"&&t.alternateFetch.length>=1?t.alternateFetch:void 0;try{Vc(n,s,i,l)}catch(c){if(!a||Object.keys(a).length===0||!c.message||c.message.indexOf("not implemented")<0)return i(c);try{Object.keys(a).forEach(function(u){delete s[u]}),Vc(n,s,i,l),t._omitFetchOptions=!0}catch(u){i(u)}}},Jx=function(t,n,r,i){r&&Jn(r)==="object"&&(r=Ja("",r).slice(1)),t.queryStringParams&&(n=Ja(n,t.queryStringParams));try{var o=hi?new hi:new fo("MSXML2.XMLHTTP.3.0");o.open(r?"POST":"GET",n,1),t.crossDomain||o.setRequestHeader("X-Requested-With","XMLHttpRequest"),o.withCredentials=!!t.withCredentials,r&&o.setRequestHeader("Content-Type","application/x-www-form-urlencoded"),o.overrideMimeType&&o.overrideMimeType("application/json");var a=t.customHeaders;if(a=typeof a=="function"?a():a,a)for(var s=0,l=Object.keys(a);s<l.length;s++){var c=l[s];Lf.indexOf(c)>-1||o.setRequestHeader(c,a[c])}o.onreadystatechange=function(){o.readyState>3&&i(o.status>=400?o.statusText:null,{status:o.status,data:o.responseText})},o.send(r)}catch(u){console&&console.log(u)}},Zx=function(t,n,r,i){if(typeof r=="function"&&(i=r,r=void 0),i=i||function(){},wn&&n.indexOf("file:")!==0)return Xx(t,n,r,i);if(If()||typeof ActiveXObject=="function")return Jx(t,n,r,i);i(new Error("No fetch and no xhr implementation found!"))};function Ar(e){"@babel/helpers - typeof";return Ar=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Ar(e)}function Wc(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function oa(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?Wc(Object(n),!0).forEach(function(r){Of(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Wc(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function ew(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function tw(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,Df(r.key),r)}}function nw(e,t,n){return t&&tw(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function Of(e,t,n){return(t=Df(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Df(e){var t=rw(e,"string");return Ar(t)=="symbol"?t:t+""}function rw(e,t){if(Ar(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(Ar(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}var iw=function(){return{loadPath:"/locales/{{lng}}/{{ns}}.json",addPath:"/locales/add/{{lng}}/{{ns}}",parse:function(n){return JSON.parse(n)},stringify:JSON.stringify,parsePayload:function(n,r,i){return Of({},r,i||"")},parseLoadPayload:function(n,r){},request:Zx,reloadInterval:typeof window<"u"?!1:60*60*1e3,customHeaders:{},queryStringParams:{},crossDomain:!1,withCredentials:!1,overrideMimeType:!1,requestOptions:{mode:"cors",credentials:"same-origin",cache:"default"}}},Nf=function(){function e(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};ew(this,e),this.services=t,this.options=n,this.allOptions=r,this.type="backend",this.init(t,n,r)}return nw(e,[{key:"init",value:function(n){var r=this,i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},o=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};if(this.services=n,this.options=oa(oa(oa({},iw()),this.options||{}),i),this.allOptions=o,this.services&&this.options.reloadInterval){var a=setInterval(function(){return r.reload()},this.options.reloadInterval);Ar(a)==="object"&&typeof a.unref=="function"&&a.unref()}}},{key:"readMulti",value:function(n,r,i){this._readAny(n,n,r,r,i)}},{key:"read",value:function(n,r,i){this._readAny([n],n,[r],r,i)}},{key:"_readAny",value:function(n,r,i,o,a){var s=this,l=this.options.loadPath;typeof this.options.loadPath=="function"&&(l=this.options.loadPath(n,i)),l=Kx(l),l.then(function(c){if(!c)return a(null,{});var u=Bc(c,{lng:n.join("+"),ns:i.join("+")});if(u==null){var d=n.map(Di).join(", "),h=i.map(Di).join(", ");return a(new Error("i18next-http-backend: unsafe lng/ns value — refusing to build request URL for languages=["+d+"] namespaces=["+h+"]"),!1)}s.loadUrl(u,a,r,o)})}},{key:"loadUrl",value:function(n,r,i,o){var a=this,s=typeof i=="string"?[i]:i,l=typeof o=="string"?[o]:o,c=this.options.parseLoadPayload(s,l),u=Di(Vx(n));this.options.request(this.options,n,c,function(d,h){if(h&&(h.status>=500&&h.status<600||!h.status))return r("failed loading "+u+"; status code: "+h.status,!0);if(h&&h.status>=400&&h.status<500)return r("failed loading "+u+"; status code: "+h.status,!1);if(!h&&d&&d.message){var f=d.message.toLowerCase(),m=["failed","fetch","network","load"].find(function(v){return f.indexOf(v)>-1});if(m)return r("failed loading "+u+": "+Di(d.message),!0)}if(d)return r(d,!1);var p,b;try{typeof h.data=="string"?p=a.options.parse(h.data,i,o):p=h.data}catch{b="failed parsing "+u+" to json"}if(b)return r(b,!1);r(null,p)})}},{key:"create",value:function(n,r,i,o,a){var s=this;if(this.options.addPath){typeof n=="string"&&(n=[n]);var l=this.options.parsePayload(r,i,o),c=0,u=[],d=[];n.forEach(function(h){var f=s.options.addPath;typeof s.options.addPath=="function"&&(f=s.options.addPath(h,r));var m=Bc(f,{lng:h,ns:r});if(m==null){c+=1,a&&c===n.length&&a(u,d);return}s.options.request(s.options,m,l,function(p,b){c+=1,u.push(p),d.push(b),c===n.length&&typeof a=="function"&&a(u,d)})})}}},{key:"reload",value:function(){var n=this,r=this.services,i=r.backendConnector,o=r.languageUtils,a=r.logger,s=i.language;if(!(s&&s.toLowerCase()==="cimode")){var l=[],c=function(d){var h=o.toResolveHierarchy(d);h.forEach(function(f){l.indexOf(f)<0&&l.push(f)})};c(s),this.allOptions.preload&&this.allOptions.preload.forEach(function(u){return c(u)}),l.forEach(function(u){n.allOptions.ns.forEach(function(d){i.read(u,d,"read",null,null,function(h,f){h&&a.warn("loading namespace ".concat(d," for language ").concat(u," failed"),h),!h&&f&&a.log("loaded namespace ".concat(d," for language ").concat(u),f),i.loaded("".concat(u,"|").concat(d),h,f)})})})}}}])}();Nf.type="backend";const ow="Agim",aw={refresh:"Refresh",save:"Save",cancel:"Cancel",delete:"Delete",edit:"Edit",submit:"Submit",close:"Close",back:"Back",next:"Next",previous:"Previous",create:"Create",search:"Search",retry:"Retry",confirm:"Confirm"},sw={loading:"Loading…",empty:"No data",saving:"Saving…",saved:"Saved",error:"Something went wrong"},lw={label:"Theme",system:"System",light:"Light",dark:"Dark",cycleHint:"Click to cycle theme"},cw={label:"Language",en:"English",zh:"中文"},uw={dashboard:"Home",chat:"Chat",tasks:"Tasks",approvals:"Approvals",reminders:"Reminders",memos:"Memos",memory:"Memory",skills:"Skills",workspace:"Workspace",observability:"Observability",settings:"Settings"},dw={deleteTitle:"Delete this item?",deleteDescription:"This cannot be undone.",destructiveAction:"Delete"},fw={label:"Pagination",perPage:"Per page",firstPage:"First page",lastPage:"Last page",pageOfTotal:"Page {{page}} of {{totalPages}}",range:"{{from}}–{{to}} of {{total}}"},hw={selectAll:"Select all rows",selectRow:"Select row"},pw={intro:"Paste your access token from `agim token bootstrap` (first boot) or `agim token create`.",tokenLabel:"Access token",submit:"Sign in",adminRequired:"Current token has no admin permission. Please sign in with an admin token.",hint:"Loopback (127.0.0.1) requests bypass this page; you only land here from another host or with AGIM_TRUST_LOOPBACK=off."},mw={placeholder:"Signed in. Open Chat from the sidebar.",healthCheck:"Backend reachable"},gw={title:"Home",subtitle:"Check the current state and take the next step.",coreReady:"{{count}}/3 ready",unknown:"not selected",actions:{chat:"Open chat"},state:{done:"Ready",todo:"Next",warn:"Needs attention",loading:"Loading"},cards:{web:{title:"Web console",ready:"Service is running: {{mode}}",needsStart:"Service is not running.",open:"Open chat",action:"Open service"},agent:{title:"Agent",ready:"{{agent}} is online",offline:"{{agent}} is not ready",selected:"{{agent}} is selected; waiting for runtime status.",empty:"No default agent selected.",default:"default",action:"Agent settings"},llm:{title:"Agim Agent API",ready:"{{count}} usable API configured.",required:"Agim Agent needs a model API.",optional:"No model API yet; external agents can still run.",core:"required for agim",meta:"built-in agent",action:"Configure API"},im:{title:"IM bridge",ready:"Connected: {{platforms}}",empty:"No IM connected yet.",metaReady:"{{count}} connected",action:"Connect IM"}},next:{title:"Next step",ready:"base ready",pending:"in progress",items:{service:{title:"Start the service",detail:"Bring Web online before testing chat or IM."},agent:{title:"Make one agent available",detail:"Pick a default agent and confirm it can run."},llm:{title:"Configure Agim Agent API",detail:"Add one usable model API for the built-in agent."},llmOptional:{title:"Enable Agim Agent",detail:"Add a model API when you want to avoid external CLIs."},chat:{title:"Send a Web message",detail:"Verify the basic loop before connecting messengers."},im:{title:"Connect one IM",detail:"Add WeChat, Feishu, DingTalk, Telegram, Discord, or Email."},operate:{title:"Review task activity",detail:"Watch jobs, approvals, reminders, and handoffs."}}},quick:{title:"Common",chat:"Chat",start:"Setup",workspace:"Workspace",service:"Service"},advanced:{title:"Advanced",tasks:"Tasks",memory:"Memory",skills:"Skills",observability:"Observability"},platform:{wechat:"WeChat",telegram:"Telegram",feishu:"Feishu",dingtalk:"DingTalk",discord:"Discord",email:"Email"}},yw={title:"Nothing here.",description:"The page you're looking for doesn't exist."},bw={title:"Something went wrong.",description:"An unexpected error broke the page render. Try reloading or heading back to the home screen; if it persists, copy the message below and report it.",reload:"Reload",home:"Home"},vw={mobileTitle:"agim chat",menu:"Menu",back:"Back",logout:"Log out",agent:"Agent",scrollDown:"Scroll to bottom",send:"Send",streaming:"… streaming",running:"Running",status:{open:"Connected",connecting:"Connecting…",closed:"Disconnected",error:"Error"},notConnected:"Not connected. Reconnecting…",notConnectedRetry:"Not connected. Reconnecting — try again in a moment.",connecting:"Connecting to agim…",disconnected:"Disconnected. Reconnecting automatically; you can keep typing.",welcomeTitle:"Start a conversation",welcomeBody:"Type a message to ask the active agent. Use the agent dropdown to switch.",welcomeBodyMobile:"Type a message below. Switch agent or start over from the menu.",onboarding:{title:"Get one chat working first",readyBadge:"Web ready",body:"Current agent: {{agent}}",agentPending:"Loading agent…",stepWeb:"Web console connected",stepAgent:"Agent selected: {{agent}}",agentCount:"{{count}} available",stepMessage:"Send the first message",stepMessenger:"Connect IM after chat works",agentSettings:"Agent settings",messengerSettings:"Connect IM"},inputPlaceholder:"Message… (Enter sends, Shift+Enter newlines)",inputPlaceholderMobile:"Message…",mobileHint:"Enter creates new lines, tap Send to submit.",activity:"Activity",activityTitle:"Run activity",activityEmpty:"No recent runs yet.",llmSettings:"Agim Agent settings",nativeSetupRequired:"Agim Agent is not configured. Open /settings/llm to add a usable model API (role bindings are optional).",nativeSetupAction:"Configure now",nativeSetupDialogTitle:"Configure model API for Agim Agent",nativeSetupDialogDesc:"Agim Agent works as soon as one model API with a valid API key is configured. Role Bindings are optional advanced wiring.",nativeSetupDialogReason:"Most recent error",nativeSetupDialogRoleOptional:"Role Bindings are optional and do not block Agim Agent usage.",nativeSetupDialogSave:"Save and enable agim",nativeSetupDialogCancel:"Later",nativeSetupDialogAdvanced:"Open full model API settings",nativeSetupApiKeyRequired:"API key is required",nativeSetupSaved:"Model API saved. Retrying agim switch…",pendingApprovals:"Pending approvals",quickPrompt:{plan:"Tell me who you are",risks:"List risks and rollback steps",summary:"Write an executive summary"},newConv:"New",newConvHint:"Clear messages and start a fresh session",newConvToast:"Started a new conversation",switchAgentConfirm:"Switch to agent “{{agent}}”?",copy:"Copy",copied:"Copied",copyMarkdown:"Copy Markdown",copyFailed:"Copy failed",approvalTitle:"🔐 Tool approval",approvalAutoBadge:"auto-allow",approvalAutoIn:"Auto-allowing in {{count}}s — Deny to stop.",approvalAutoResolving:"Auto-allowing now…",approvalToolLabel:"Tool",approvalInputLabel:"Input",approvalAllow:"Allow",approvalAuto:"Auto for similar",approvalAutoTip:"Allow and auto-allow similar calls for the rest of the session",approvalDeny:"Deny",approvalSubmitting:"Sent — waiting for result…",askTitle:"🤔 Please choose",askMultiHint:"Pick {{min}}–{{max}}",askSubmit:"Submit",askCustomPlaceholder:"Custom answer…",askResolved:"✅ Answered",outcome:{allowed:"✅ Allowed",allowedPinned:"✅ Allowed + auto-allow further",denied:"❌ Denied",deniedRevoked:"❌ Denied (auto-allow revoked)",expired:"⏱ Timed out"}},xw={appName:ow,actions:aw,states:sw,theme:lw,lang:cw,nav:uw,confirm:dw,pagination:fw,table:hw,login:pw,home:mw,dashboard:gw,notFound:yw,errorBoundary:bw,chat:vw},ww="Agim",kw={refresh:"刷新",save:"保存",cancel:"取消",delete:"删除",edit:"编辑",submit:"提交",close:"关闭",back:"返回",next:"下一页",previous:"上一页",create:"新建",search:"搜索",retry:"重试",confirm:"确定"},Sw={loading:"加载中…",empty:"暂无数据",saving:"保存中…",saved:"已保存",error:"出错了"},Aw={label:"主题",system:"跟随系统",light:"浅色",dark:"深色",cycleHint:"点击切换主题"},Cw={label:"语言",en:"English",zh:"中文"},Ew={dashboard:"首页",chat:"对话",tasks:"任务",approvals:"审批",reminders:"提醒",memos:"备忘",memory:"记忆",skills:"技能",workspace:"工作区",observability:"观测",settings:"设置"},Rw={deleteTitle:"确认删除?",deleteDescription:"操作不可撤销。",destructiveAction:"删除"},Pw={label:"分页",perPage:"每页",firstPage:"首页",lastPage:"末页",pageOfTotal:"第 {{page}} / {{totalPages}} 页",range:"{{from}}–{{to}} / 共 {{total}}"},Tw={selectAll:"全选",selectRow:"选中此行"},Iw={intro:"粘贴访问令牌:首次部署可运行 `agim token bootstrap`,后续可用 `agim token create` 生成。",tokenLabel:"访问令牌",submit:"登录",adminRequired:"当前 token 没有管理权限,请使用管理员 token 重新登录。",hint:"loopback(127.0.0.1)的请求会跳过此页;只有跨机访问或设置了 AGIM_TRUST_LOOPBACK=off 时才会看到此页。"},Lw={placeholder:"已登录,请从侧栏进入对话。",healthCheck:"后端可达"},Ow={title:"首页",subtitle:"查看当前状态,直接进入下一步。",coreReady:"{{count}}/3 就绪",unknown:"未选择",actions:{chat:"打开对话"},state:{done:"已就绪",todo:"待处理",warn:"需处理",loading:"读取中"},cards:{web:{title:"Web 控制台",ready:"服务正在运行:{{mode}}",needsStart:"服务未运行。",open:"打开对话",action:"打开服务"},agent:{title:"Agent",ready:"{{agent}} 在线",offline:"{{agent}} 未就绪",selected:"已选择 {{agent}},等待运行状态。",empty:"尚未选择默认 Agent。",default:"默认",action:"Agent 设置"},llm:{title:"Agim Agent API",ready:"已有 {{count}} 个可用 API。",required:"Agim Agent 需要配置模型 API。",optional:"未配置模型 API;外部 Agent 仍可运行。",core:"agim 必需",meta:"内置 Agent",action:"配置 API"},im:{title:"IM 桥接",ready:"已连接:{{platforms}}",empty:"还未连接 IM。",metaReady:"{{count}} 个接入",action:"连接 IM"}},next:{title:"下一步",ready:"基础就绪",pending:"进行中",items:{service:{title:"启动服务",detail:"先让 Web 在线,再测试对话和 IM。"},agent:{title:"准备一个可用 Agent",detail:"选择默认 Agent,并确认它能运行。"},llm:{title:"配置 Agim Agent API",detail:"为内置 Agent 添加一个可用模型 API。"},llmOptional:{title:"启用 Agim Agent",detail:"想摆脱外部 CLI 时,再添加模型 API。"},chat:{title:"发送一条 Web 消息",detail:"先验证基础闭环,再接入 IM。"},im:{title:"连接一个 IM",detail:"接入微信、飞书、钉钉、Telegram、Discord 或邮件。"},operate:{title:"查看任务动态",detail:"观察任务、审批、提醒与 Agent 协作。"}}},quick:{title:"常用入口",chat:"对话",start:"开始配置",workspace:"工作区",service:"服务"},advanced:{title:"高级能力",tasks:"任务",memory:"记忆",skills:"技能",observability:"观测"},platform:{wechat:"微信",telegram:"Telegram",feishu:"飞书",dingtalk:"钉钉",discord:"Discord",email:"邮件"}},Dw={title:"什么也没找到。",description:"你要找的页面不存在。"},Nw={title:"出错了。",description:"页面渲染过程中遇到了未预期的错误。可以尝试刷新或返回主页;若问题反复出现,请复制下方错误信息反馈。",reload:"刷新",home:"返回主页"},Mw={mobileTitle:"agim 对话",menu:"菜单",back:"返回",logout:"退出登录",agent:"Agent",scrollDown:"回到底部",send:"发送",streaming:"… 接收中",running:"处理中",status:{open:"已连接",connecting:"连接中…",closed:"已断开",error:"连接异常"},notConnected:"未连接,正在重连…",notConnectedRetry:"未连接,正在重连,请稍后重试。",connecting:"正在连接 agim…",disconnected:"已断开,自动重连中;可以继续输入。",welcomeTitle:"开始对话",welcomeBody:"输入消息向当前 Agent 提问。点上方下拉可切换 Agent。",welcomeBodyMobile:"在下方输入消息,或从菜单切换 Agent、开启新对话。",onboarding:{title:"先跑通一次对话",readyBadge:"Web 已就绪",body:"当前 Agent:{{agent}}",agentPending:"正在读取 Agent…",stepWeb:"Web 控制台已连接",stepAgent:"Agent 已选择:{{agent}}",agentCount:"{{count}} 个可用",stepMessage:"发送第一条消息",stepMessenger:"对话跑通后再接 IM",agentSettings:"Agent 设置",messengerSettings:"连接 IM"},inputPlaceholder:"输入消息……(Enter 发送,Shift+Enter 换行)",inputPlaceholderMobile:"输入消息…",mobileHint:"Enter 换行,点击发送提交。",activity:"运行动态",activityTitle:"运行动态",activityEmpty:"暂无运行记录。",llmSettings:"Agim Agent 配置",nativeSetupRequired:"Agim Agent 未配置。请先在 /settings/llm 配置一个可用模型 API(角色绑定可选)。",nativeSetupAction:"去配置",nativeSetupDialogTitle:"配置 Agim Agent 所需大模型 API",nativeSetupDialogDesc:"只要配置一个可用且含 API Key 的大模型 API,agim 就可以使用。角色绑定属于可选高级配置。",nativeSetupDialogReason:"最近一次错误信息",nativeSetupDialogRoleOptional:"角色绑定是可选增强项,不配置也不会阻塞 Agim Agent。",nativeSetupDialogSave:"保存并启用 agim",nativeSetupDialogCancel:"稍后再配",nativeSetupDialogAdvanced:"打开完整大模型API设置页",nativeSetupApiKeyRequired:"请填写 API Key",nativeSetupSaved:"大模型 API 配置已保存,正在重试切换 agim…",pendingApprovals:"待审批数",quickPrompt:{plan:"告诉我你是谁",risks:"列出风险与回滚方案",summary:"给我一版汇报摘要"},newConv:"新对话",newConvHint:"清空消息并开启新会话",newConvToast:"已开启新对话",switchAgentConfirm:"切换到「{{agent}}」?",copy:"复制",copied:"已复制",copyMarkdown:"复制 Markdown",copyFailed:"复制失败",approvalTitle:"🔐 工具授权",approvalAutoBadge:"自动放行",approvalAutoIn:"{{count}} 秒后自动放行 — 点「拒绝」可中止。",approvalAutoResolving:"正在自动放行…",approvalToolLabel:"工具",approvalInputLabel:"输入",approvalAllow:"批准",approvalAuto:"本类自动放行",approvalAutoTip:"批准并对本会话内同类调用自动放行",approvalDeny:"拒绝",approvalSubmitting:"已发送,等待结果…",askTitle:"🤔 请选择",askMultiHint:"选择 {{min}}–{{max}} 项",askSubmit:"提交",askCustomPlaceholder:"自定义回答…",askResolved:"✅ 已回答",outcome:{allowed:"✅ 已批准",allowedPinned:"✅ 已批准 · 后续同类自动放行",denied:"❌ 已拒绝",deniedRevoked:"❌ 已拒绝(撤销自动放行)",expired:"⏱ 已超时"}},_w={appName:ww,actions:kw,states:Sw,theme:Aw,lang:Cw,nav:Ew,confirm:Rw,pagination:Pw,table:Tw,login:Iw,home:Lw,dashboard:Ow,notFound:Dw,errorBoundary:Nw,chat:Mw},jw="Couldn't reach the server. Check your connection and retry.",Fw="Your session expired. Please sign in again.",Hw="This token has no admin permission. Please sign in with an admin token.",Uw="Sign-in required.",Bw="Auth token missing from request.",zw="Auth subsystem isn't ready yet. Retry in a moment.",$w="You don't have permission to do that.",Vw="The requested resource wasn't found.",Ww="That request is too big — try splitting it.",Kw="The server rejected the request: {{detail}}",qw="Request body wasn't valid JSON.",Gw="Configuration didn't validate. Check the form fields.",Qw="Couldn't save configuration: {{detail}}",Yw="Send an `updates` object to change env values.",Xw="None of the keys you sent are editable.",Jw="SMTP isn't configured. Save host / user / password first.",Zw="SMTP verify failed: {{detail}}",ek="Provide a baseUrl to discover ACP agents.",tk="Provide an `endpoint` to test the agent.",nk="ACP discovery failed: {{detail}}",rk="ACP agent test failed: {{detail}}",ik="A user_key (platform:userId) is required.",ok="Something went wrong (code {{code}}).",ak="Bad request.",sk="Sign-in required.",lk="Forbidden.",ck="Not found.",uk="Conflict — refresh and try again.",dk="Request too large.",fk="Server error.",hk="Gateway error.",pk="Service unavailable.",mk="Gateway timeout.",gk={NETWORK:jw,AUTH_INVALID:Fw,AUTH_ADMIN_REQUIRED:Hw,AUTH_REQUIRED:Uw,AUTH_TOKEN_REQUIRED:Bw,AUTH_NOT_READY:zw,FORBIDDEN:$w,NOT_FOUND:Vw,PAYLOAD_TOO_LARGE:Ww,VALIDATION:Kw,INVALID_JSON_BODY:qw,CONFIG_INVALID:Gw,CONFIG_SAVE_FAILED:Qw,ENV_UPDATES_REQUIRED:Yw,ENV_NO_EDITABLE_KEYS:Xw,EMAIL_NOT_CONFIGURED:Jw,EMAIL_VERIFY_FAILED:Zw,ACP_BASEURL_REQUIRED:ek,ACP_ENDPOINT_REQUIRED:tk,ACP_DISCOVER_FAILED:nk,ACP_TEST_FAILED:rk,MEMORY_USER_KEY_REQUIRED:ik,UNKNOWN:ok,HTTP_400:ak,HTTP_401:sk,HTTP_403:lk,HTTP_404:ck,HTTP_409:uk,HTTP_413:dk,HTTP_500:fk,HTTP_502:hk,HTTP_503:pk,HTTP_504:mk},yk="无法访问服务器,请检查网络后重试。",bk="登录状态已过期,请重新登录。",vk="当前 token 没有管理权限,请使用管理员 token 重新登录。",xk="请先登录。",wk="请求缺少 auth token。",kk="鉴权子系统尚未就绪,请稍后重试。",Sk="没有执行该操作的权限。",Ak="请求的资源不存在。",Ck="请求体过大,请拆分后重试。",Ek="服务端拒绝了请求:{{detail}}",Rk="请求体不是合法的 JSON。",Pk="配置校验失败,请检查表单字段。",Tk="保存配置失败:{{detail}}",Ik="请在请求体中提供 `updates` 对象以修改 env。",Lk="请求里的 key 均不可编辑。",Ok="SMTP 未配置,请先保存 host / user / password。",Dk="SMTP 连接测试失败:{{detail}}",Nk="需要 baseUrl 才能发现 ACP Agent。",Mk="需要 `endpoint` 才能测试该 Agent。",_k="ACP 发现失败:{{detail}}",jk="ACP Agent 测试失败:{{detail}}",Fk="需要 user_key(形如 `platform:userId`)。",Hk="出错了 (code {{code}})。",Uk="请求格式不正确。",Bk="请先登录。",zk="没有权限。",$k="未找到。",Vk="状态冲突,请刷新后重试。",Wk="请求体过大。",Kk="服务端出错。",qk="网关错误。",Gk="服务暂不可用。",Qk="网关超时。",Yk={NETWORK:yk,AUTH_INVALID:bk,AUTH_ADMIN_REQUIRED:vk,AUTH_REQUIRED:xk,AUTH_TOKEN_REQUIRED:wk,AUTH_NOT_READY:kk,FORBIDDEN:Sk,NOT_FOUND:Ak,PAYLOAD_TOO_LARGE:Ck,VALIDATION:Ek,INVALID_JSON_BODY:Rk,CONFIG_INVALID:Pk,CONFIG_SAVE_FAILED:Tk,ENV_UPDATES_REQUIRED:Ik,ENV_NO_EDITABLE_KEYS:Lk,EMAIL_NOT_CONFIGURED:Ok,EMAIL_VERIFY_FAILED:Dk,ACP_BASEURL_REQUIRED:Nk,ACP_ENDPOINT_REQUIRED:Mk,ACP_DISCOVER_FAILED:_k,ACP_TEST_FAILED:jk,MEMORY_USER_KEY_REQUIRED:Fk,UNKNOWN:Hk,HTTP_400:Uk,HTTP_401:Bk,HTTP_403:zk,HTTP_404:$k,HTTP_409:Vk,HTTP_413:Wk,HTTP_500:Kk,HTTP_502:qk,HTTP_503:Gk,HTTP_504:Qk},Xk="Tasks",Jk={groups:{overview:"Start",work:"Work",automation:"Automation",review:"Review"}},Zk={overview:"Overview",jobs:"Jobs",subtasks:"Subtasks",bgjobs:"Background",schedules:"Schedules",outbox:"Outbox",a2a:"Agent ↔ Agent",heartbeat:"Heartbeat",goals:"Goals",asks:"Ask User",plans:"Plans"},e0={title:"Tasks overview",subtitle:"See what is running, what needs you, and where to inspect details.",refresh:"Refresh",clear:"All clear",needsAttention:"{{count}} need attention",cards:{work:{title:"Agent work",detail:"{{running}} running · {{pending}} pending",action:"Open jobs"},asks:{title:"Waiting on you",waiting:"{{count}} ask_user pending",clear:"No pending questions",action:"Open asks"},outbox:{title:"IM delivery",detail:"{{pending}} pending",stuck:"{{count}} stuck",action:"Open outbox"},automation:{title:"Automation",detail:"{{schedules}} schedules · {{heartbeats}} heartbeats · {{goals}} goals",action:"Open schedules"},a2a:{title:"Agent handoffs",detail:"Agent-to-agent calls in the last 24h",action:"Open handoffs"}},next:{asks:{title:"Answer pending questions",detail:"Agents are waiting for human input before they continue."},outboxStuck:{title:"Retry stuck deliveries",detail:"One or more IM messages stopped retrying and need inspection."},jobs:{title:"Watch running work",detail:"Jobs are currently pending or running."},outbox:{title:"Watch message delivery",detail:"Outbound IM messages are still moving through the queue."},automation:{title:"Review automation",detail:"Schedules, heartbeats, or active goals are running in the background."},idle:{title:"No active task pressure",detail:"Open Jobs when you want to inspect recent agent runs."}},groups:{title:"Detailed views",work:"Work",automation:"Automation",review:"Review"}},t0={title:"Jobs",subtitle:"Long-running agent invocations and their results.",empty:{title:"No jobs yet",description:"Jobs are created when an agent runs in async mode — via `agim --invoke` or an inline /run command from chat."},filter:{status:"Status",statusAny:"Any status",agent:"Agent",agentAny:"Any agent",kind:"Kind",kindAny:"Any kind"},col:{id:"ID",agent:"Agent",prompt:"Prompt",status:"Status",createdAt:"Created",duration:"Duration",cost:"Cost"},status:{pending:"Pending",running:"Running",completed:"Completed",delivered:"Delivered",failed:"Failed",cancelled:"Cancelled",interrupted:"Interrupted",replaced:"Replaced",abandoned:"Abandoned"},kind:{job:"Job",inline:"Inline"},stats:{pending:"Pending",running:"Running",completed:"Completed",failed:"Failed"},batch:{selected:"{{count}} selected",cancel:"Cancel selected",rerun:"Re-run selected",confirmCancel:"Cancel {{count}} job(s)?",confirmCancelDesc:"Running jobs will be sent a stop signal. Already-completed jobs are unaffected.",confirmRerun:"Re-run {{count}} job(s)?",confirmRerunDesc:"New jobs will be created from the original prompts."},live:{connected:"● Live",connecting:"● Connecting",reconnecting:"● Reconnecting",closed:"● Offline"}},n0={title:"Subtasks",subtitle:"Per-conversation child tasks spawned by the parent agent.",empty:{title:"No subtasks yet",description:"Subtasks appear when an agent dispatches work to another agent inside a chat thread."},filter:{agent:"Parent agent",agentAny:"Any agent"},col:{id:"ID",agent:"Agent",prompt:"Prompt",status:"Status",parent:"Parent",platform:"Platform",createdAt:"Created"},status:{pending:"Pending",running:"Running",completed:"Completed",failed:"Failed",cancelled:"Cancelled"}},r0={title:"Background jobs",subtitle:"Long-running scripts the agent wrappers (Claude Code / opencode / codex) launched via bgjob.",empty:{title:"No background jobs",description:"Background jobs show up here once an agent has used its bgjob wrapper. Roots come from ~/.claude/bgjobs/, ~/.config/opencode/bgjobs/, ~/.codex/bgjobs/ (override via AGIM_BGJOB_ROOTS)."},filter:{root:"Root",rootAny:"All roots"},col:{name:"Name",status:"Status",root:"Root",pid:"PID",startedAt:"Started",endedAt:"Ended",exit:"Exit"},exitOk:"ok",stillRunning:"—"},i0={title:"Schedules",subtitle:"Cron-style triggers that re-invoke an agent with a fixed prompt.",empty:{title:"No schedules configured",description:"Create a schedule from the agent's chat via `/cron set` or by running `agim cron create` in the CLI."},filter:{agent:"Agent",agentAny:"Any agent"},col:{id:"ID",name:"Name",agent:"Agent",cron:"Cron",prompt:"Prompt",enabled:"Enabled",nextRun:"Next run",lastRun:"Last run"},enabled:"On",disabled:"Off"},o0={title:"Outbox",subtitle:"Pending IM-platform deliveries. The crash-safe queue retries on transient failures and parks unrecoverable ones in `giving_up`.",empty:{title:"Outbox is empty",description:"Messages move through the queue and are deleted on successful delivery. A non-empty outbox here means the queue is actively flushing or a delivery is stuck."},filter:{status:"Status",statusAny:"Any status",thread:"Thread key"},stats:{pending:"Pending",giving_up:"Giving up",delivered:"Delivered (lifetime)",lastDelivered:"Last delivery"},col:{id:"ID",status:"Status",platform:"Platform",preview:"Preview",thread:"Thread",kind:"Kind",attempts:"Attempts",createdAt:"Created",lastError:"Last error",jobId:"Job"},status:{pending:"Pending",delivered:"Delivered",giving_up:"Giving up"},action:{retry:"Retry",confirmRetry:"Re-queue this delivery?",confirmRetryDesc:"The row's status flips back to pending and the sender will attempt delivery again on the next tick."}},a0={title:"Agent ↔ Agent",subtitle:"Recent inline jobs spawned with a parent (one agent invoking another).",empty:{title:"No agent-to-agent calls yet",description:"Inline a2a calls appear here once an agent uses the `agim --invoke` tool with a parent context."},stats:{total:"Total",recent24h:"Last 24h",maxDepth:"Max depth"},col:{id:"ID",agent:"Agent",parent:"Parent",depth:"Depth",status:"Status",prompt:"Prompt",createdAt:"Created"}},s0={title:"Heartbeat bindings",subtitle:"Cross-thread view of every /heartbeat bind. Enable/disable a binding from here; create new ones from inside the IM thread itself (/heartbeat bind <body>).",refresh:"Refresh",empty:"No heartbeat bindings yet. Run /heartbeat bind <body> in any IM thread to create one.",col:{thread:"Thread",owner:"Owner",interval:"Interval",lastTick:"Last tick",enabled:"Enabled",body:"Body"},never:"never",pause:"Pause",enable:"Enable",show:"Show",hide:"Hide",enabledToast:"Binding enabled",disabledToast:"Binding paused",justNow:"just now",minutesAgo:"{{count}}m ago",hoursAgo:"{{count}}h ago",daysAgo:"{{count}}d ago",intervalMin:"{{count}}m"},l0={title:"Active goals",subtitle:"Cross-thread view of every active /goal. Lifecycle controls (pause / complete / cancel) operate without the IM thread; creating a new goal still requires the thread context — /goal set <title>.",refresh:"Refresh",empty:"No active goals. Create one inside any IM thread with /goal set <title>.",col:{id:"#",thread:"Thread",title:"Title",progress:"Progress",updated:"Updated",actions:"Actions"},showBody:"Show body",hideBody:"Hide body",pause:"Pause",complete:"Complete",cancel:"Cancel",status:{paused:"Paused",completed:"Completed",cancelled:"Cancelled"},body:"Body",recentProgress:"Recent progress (latest {{count}})",created:"created {{at}}",closed:"closed {{at}}",statusUpdated:"Goal {{status}}"},c0={title:"Pending ask_user",subtitle:"Live list of every mcp__agim__ask_user waiting on a reply. Cancelling here gives the agent the same response shape as a natural timeout (ok: false, reason: 'cancelled').",refresh:"Refresh",empty:"No pending asks. Auto-refreshes every 5s.",col:{reqId:"Req ID",thread:"Thread",question:"Question",choices:"Choices",age:"Age",actions:""},cancel:"Cancel",cancelConfirm:"Cancel pending ask {{id}}…?",cancelledToast:"Cancelled",justNow:"just now",seconds:"{{count}}s",minutes:"{{count}}m",hours:"{{count}}h"},u0={title:"Plan history",subtitle:"Audit log of plan-mode exit handshakes, including outcomes and proposed plan text.",refresh:"Refresh",filterLabel:"Filter by thread key (optional)",applyFilter:"Apply",clearFilter:"Clear",empty:"No plan history yet.",emptyFiltered:"No plan history for this thread key.",planMdLabel:"Proposed plan:",col:{outcome:"Outcome",thread:"Thread",resolvedAt:"Resolved",pending:"Wait",detail:"Detail"},outcome:{approved:"Approved",rejected:"Rejected",edited:"Edited",expired:"Expired"}},d0={pageTitle:Xk,navigation:Jk,subnav:Zk,overview:e0,jobs:t0,subtasks:n0,bgjobs:r0,schedules:i0,outbox:o0,a2a:a0,heartbeat:s0,goals:l0,asks:c0,plans:u0},f0="任务",h0={groups:{overview:"开始",work:"任务",automation:"自动化",review:"审计"}},p0={overview:"总览",jobs:"作业",subtasks:"子任务",bgjobs:"后台脚本",schedules:"定时任务",outbox:"投递队列",a2a:"Agent 互调",heartbeat:"心跳",goals:"目标",asks:"待回答",plans:"计划审计"},m0={title:"任务总览",subtitle:"查看哪些任务在运行、哪些需要你处理、细节该去哪里看。",refresh:"刷新",clear:"暂无需处理",needsAttention:"{{count}} 项需处理",cards:{work:{title:"Agent 作业",detail:"{{running}} 运行中 · {{pending}} 等待中",action:"查看作业"},asks:{title:"等待你回答",waiting:"{{count}} 个 ask_user 待处理",clear:"暂无待回答问题",action:"查看待回答"},outbox:{title:"IM 投递",detail:"{{pending}} 条待发送",stuck:"{{count}} 条卡住",action:"查看队列"},automation:{title:"自动化",detail:"{{schedules}} 个定时 · {{heartbeats}} 个心跳 · {{goals}} 个目标",action:"查看定时"},a2a:{title:"Agent 协作",detail:"近 24 小时 Agent 互调次数",action:"查看互调"}},next:{asks:{title:"先回答待处理问题",detail:"Agent 正在等待人工输入,处理后才能继续。"},outboxStuck:{title:"重试卡住的投递",detail:"有 IM 消息已停止重试,需要检查原因。"},jobs:{title:"查看运行中的作业",detail:"当前有作业正在等待或运行。"},outbox:{title:"查看消息投递",detail:"仍有 IM 消息在队列中等待投递。"},automation:{title:"检查自动化任务",detail:"定时、心跳或目标正在后台运行。"},idle:{title:"当前没有任务压力",detail:"需要排查历史运行时,可打开作业列表。"}},groups:{title:"详细视图",work:"任务",automation:"自动化",review:"审计"}},g0={title:"作业",subtitle:"Agent 的长任务调用与结果。",empty:{title:"暂无作业",description:"通过 `agim --invoke` 或聊天里的 /run 命令异步启动 Agent 时会自动生成作业记录。"},filter:{status:"状态",statusAny:"全部状态",agent:"Agent",agentAny:"全部 Agent",kind:"类型",kindAny:"全部类型"},col:{id:"ID",agent:"Agent",prompt:"提示词",status:"状态",createdAt:"创建时间",duration:"耗时",cost:"成本"},status:{pending:"等待中",running:"运行中",completed:"已完成",delivered:"已送达",failed:"失败",cancelled:"已取消",interrupted:"已中断",replaced:"已替换",abandoned:"已放弃"},kind:{job:"作业",inline:"即时"},stats:{pending:"等待中",running:"运行中",completed:"已完成",failed:"失败"},batch:{selected:"已选 {{count}} 项",cancel:"取消所选",rerun:"重跑所选",confirmCancel:"确认取消 {{count}} 个作业?",confirmCancelDesc:"运行中的作业会收到停止信号。已完成的作业不受影响。",confirmRerun:"确认重跑 {{count}} 个作业?",confirmRerunDesc:"将根据原 Prompt 重新创建作业。"},live:{connected:"● 实时",connecting:"● 连接中",reconnecting:"● 重连中",closed:"● 离线"}},y0={title:"子任务",subtitle:"由父 Agent 在对话内派发出的子任务列表。",empty:{title:"暂无子任务",description:"当 Agent 在聊天线程内向其他 Agent 委派工作时,子任务会出现在这里。"},filter:{agent:"父 Agent",agentAny:"全部 Agent"},col:{id:"ID",agent:"Agent",prompt:"提示词",status:"状态",parent:"父级",platform:"平台",createdAt:"创建时间"},status:{pending:"等待中",running:"运行中",completed:"已完成",failed:"失败",cancelled:"已取消"}},b0={title:"后台脚本",subtitle:"Agent 封装(Claude Code / opencode / codex)通过 bgjob 启动的长任务进程。",empty:{title:"暂无后台脚本",description:"当 Agent 使用其 bgjob 封装时,记录会在这里出现。Root 路径默认取 ~/.claude/bgjobs/、~/.config/opencode/bgjobs/、~/.codex/bgjobs/(可通过 AGIM_BGJOB_ROOTS 覆盖)。"},filter:{root:"Root",rootAny:"全部 Root"},col:{name:"名称",status:"状态",root:"Root",pid:"PID",startedAt:"开始时间",endedAt:"结束时间",exit:"退出码"},exitOk:"ok",stillRunning:"—"},v0={title:"定时任务",subtitle:"Cron 触发的 Agent 调用 — 按固定 Prompt 重新执行。",empty:{title:"暂无定时任务",description:"可在聊天中通过 `/cron set` 或 CLI `agim cron create` 创建定时任务。"},filter:{agent:"Agent",agentAny:"全部 Agent"},col:{id:"ID",name:"名称",agent:"Agent",cron:"Cron",prompt:"Prompt",enabled:"启用",nextRun:"下次运行",lastRun:"上次运行"},enabled:"开",disabled:"关"},x0={title:"投递队列",subtitle:"面向 IM 平台的待投递消息队列。瞬态失败会自动重试;不可恢复的会停在 giving_up。",empty:{title:"投递队列为空",description:"消息成功投递后会被删除。如果这里非空,说明队列正在刷出消息,或某条消息卡住了。"},filter:{status:"状态",statusAny:"全部状态",thread:"线程标识"},stats:{pending:"待发送",giving_up:"放弃中",delivered:"已投递(累计)",lastDelivered:"最近投递"},col:{id:"ID",status:"状态",platform:"平台",preview:"内容",thread:"线程",kind:"类型",attempts:"尝试次数",createdAt:"创建时间",lastError:"最后错误",jobId:"作业"},status:{pending:"待发送",delivered:"已投递",giving_up:"放弃中"},action:{retry:"重试",confirmRetry:"重新入队这条投递?",confirmRetryDesc:"状态会切回 pending,发送器会在下一轮 tick 再次尝试投递。"}},w0={title:"Agent 互调",subtitle:"带父级 ID 的最近 inline 作业(一个 Agent 调用另一个 Agent 的记录)。",empty:{title:"暂无 Agent 互调记录",description:"当某 Agent 使用 `agim --invoke` 工具并带上父级上下文时,这里会出现 inline a2a 调用记录。"},stats:{total:"累计",recent24h:"近 24 小时",maxDepth:"最大深度"},col:{id:"ID",agent:"Agent",parent:"父级",depth:"深度",status:"状态",prompt:"提示词",createdAt:"创建时间"}},k0={title:"心跳绑定",subtitle:"跨线程查看所有 /heartbeat bind。可在此启用/停用绑定;新建绑定需在 IM 线程内执行 /heartbeat bind <body>。",refresh:"刷新",empty:"尚无心跳绑定。在任意 IM 线程执行 /heartbeat bind <body> 即可创建。",col:{thread:"线程",owner:"所有者",interval:"间隔",lastTick:"上次 tick",enabled:"启用",body:"正文"},never:"从未",pause:"暂停",enable:"启用",show:"展开",hide:"收起",enabledToast:"已启用绑定",disabledToast:"已停用绑定",justNow:"刚刚",minutesAgo:"{{count}} 分钟前",hoursAgo:"{{count}} 小时前",daysAgo:"{{count}} 天前",intervalMin:"{{count}} 分钟"},S0={title:"活跃目标",subtitle:"跨线程查看所有活跃 /goal。生命周期操作(暂停/完成/取消)无需 IM 线程;新建目标仍需在线程内执行 /goal set <title>。",refresh:"刷新",empty:"暂无活跃目标。在任意 IM 线程执行 /goal set <title> 创建。",col:{id:"#",thread:"线程",title:"标题",progress:"进度",updated:"更新",actions:"操作"},showBody:"展开正文",hideBody:"收起正文",pause:"暂停",complete:"完成",cancel:"取消",status:{paused:"暂停",completed:"完成",cancelled:"取消"},body:"正文",recentProgress:"最近进度(最新 {{count}} 条)",created:"创建于 {{at}}",closed:"关闭于 {{at}}",statusUpdated:"目标已{{status}}"},A0={title:"待回答 ask_user",subtitle:"所有等待回复的 mcp__agim__ask_user 实时列表。在此取消与超时相同(ok: false, reason: 'cancelled')。",refresh:"刷新",empty:"暂无待回答。每 5 秒自动刷新。",col:{reqId:"请求 ID",thread:"线程",question:"问题",choices:"选项数",age:"等待时长",actions:""},cancel:"取消",cancelConfirm:"取消待回答 {{id}}…?",cancelledToast:"已取消",justNow:"刚刚",seconds:"{{count}} 秒",minutes:"{{count}} 分",hours:"{{count}} 小时"},C0={title:"计划记录",subtitle:"查看 Plan 模式退出时的处理结果与计划正文。",refresh:"刷新",filterLabel:"按线程标识筛选(可选)",applyFilter:"应用",clearFilter:"清空",empty:"暂无计划记录。",emptyFiltered:"该线程暂无计划记录。",planMdLabel:"计划正文:",col:{outcome:"结果",thread:"线程",resolvedAt:"处理时间",pending:"等待时长",detail:"说明"},outcome:{approved:"已通过",rejected:"已拒绝",edited:"已修改",expired:"已超时"}},E0={pageTitle:f0,navigation:h0,subnav:p0,overview:m0,jobs:g0,subtasks:y0,bgjobs:b0,schedules:v0,outbox:x0,a2a:w0,heartbeat:k0,goals:S0,asks:A0,plans:C0},R0="Approvals",P0="Pending tool invocations the agent is asking permission for.",T0={connected:"● Live",connecting:"● Connecting",reconnecting:"● Reconnecting",closed:"● Offline"},I0={pending:"Pending",totalAllowed:"Total allowed",totalDenied:"Total denied",totalTimedOut:"Timed out",totalReadonly:"Read-only auto-allowed"},L0={title:"No approvals waiting",description:"The queue is empty. Tool requests show up here when an agent calls a tool that's not on its allow-list yet."},O0="Thread",D0="auto-allow",N0="Backend auto-allowed this read-only tool; the card is shown for visibility only.",M0="Allow",_0="Deny",j0={allowedShort:"Allowed",deniedShort:"Denied"},F0={pageTitle:R0,subtitle:P0,live:T0,stats:I0,empty:L0,threadLabel:O0,autoAllowedTag:D0,autoAllowedTitle:N0,allow:M0,deny:_0,toast:j0},H0="审批",U0="Agent 等待批准的工具调用。",B0={connected:"● 实时",connecting:"● 连接中",reconnecting:"● 重连中",closed:"● 离线"},z0={pending:"待审批",totalAllowed:"累计放行",totalDenied:"累计拒绝",totalTimedOut:"超时",totalReadonly:"只读自动放行"},$0={title:"暂无待审批请求",description:"队列为空。当 Agent 调用尚未加入白名单的工具时,请求会在这里出现。"},V0="线程",W0="自动放行",K0="后端已对该只读工具自动放行;此处仅供可见性展示。",q0="放行",G0="拒绝",Q0={allowedShort:"已放行",deniedShort:"已拒绝"},Y0={pageTitle:H0,subtitle:U0,live:B0,stats:z0,empty:$0,threadLabel:V0,autoAllowedTag:W0,autoAllowedTitle:K0,allow:q0,deny:G0,toast:Q0},X0="Reminders",J0="Queued reminders waiting to fire. Cancel or snooze pending ones; fired and cancelled rows are kept for audit.",Z0={status:"Status",statusAny:"Any status"},eS={pending:"Pending",firing:"Firing",fired:"Fired",cancelled:"Cancelled",failed:"Failed"},tS={slash:"/remind",mcp:"MCP",api:"API"},nS={literal:"Literal",llm:"LLM"},rS={title:"Nothing scheduled",description:"Reminders show up here once an agent (via /remind, MCP, or API) queues one. Filter by status to see fired or cancelled ones."},iS={id:"ID",fireAt:"Fires",text:"Text",status:"Status",platform:"Platform",thread:"Thread",source:"Source",recurrence:"Recurrence",createdAt:"Created"},oS={cancel:"Cancel",snooze:"Snooze",confirmCancel:"Cancel this reminder?",confirmCancelDesc:"The reminder is removed from the queue. Recurring reminders won't fire again unless re-created."},aS={title:"Snooze reminder",description:"How long should it be pushed back?",preset5m:"5 minutes",preset30m:"30 minutes",preset1h:"1 hour",preset1d:"1 day",submit:"Snooze",toastOk:"Snoozed for {{duration}}"},sS={cancelled:"Reminder cancelled"},lS={pageTitle:X0,subtitle:J0,filter:Z0,status:eS,source:tS,promptMode:nS,empty:rS,col:iS,action:oS,snooze:aS,toast:sS},cS="提醒",uS="排队待触发的提醒。可对 pending 的提醒做取消 / 延后;已触发与已取消的记录保留以备审计。",dS={status:"状态",statusAny:"全部状态"},fS={pending:"等待中",firing:"触发中",fired:"已触发",cancelled:"已取消",failed:"失败"},hS={slash:"/remind",mcp:"MCP",api:"API"},pS={literal:"原文",llm:"LLM"},mS={title:"暂无提醒",description:"当 Agent 通过 /remind、MCP 或 API 创建提醒时,记录会出现在这里。可切换状态查看已触发或已取消的记录。"},gS={id:"ID",fireAt:"触发时间",text:"内容",status:"状态",platform:"平台",thread:"线程",source:"来源",recurrence:"周期",createdAt:"创建时间"},yS={cancel:"取消",snooze:"延后",confirmCancel:"确认取消这条提醒?",confirmCancelDesc:"该提醒会被移出队列。周期提醒在未重新创建前不会再触发。"},bS={title:"延后提醒",description:"延后多久?",preset5m:"5 分钟",preset30m:"30 分钟",preset1h:"1 小时",preset1d:"1 天",submit:"确认延后",toastOk:"已延后 {{duration}}"},vS={cancelled:"已取消"},xS={pageTitle:cS,subtitle:uS,filter:dS,status:fS,source:hS,promptMode:pS,empty:mS,col:gS,action:yS,snooze:bS,toast:vS},wS="Memos",kS="Long-term notes the operator captured for the agent — searchable by content, person, or location.",SS={placeholder:"Search memos…",who:"Who",what:"What",hasLocation:"Has location",includeExpired:"Include expired"},AS={title:"No memos match",description:"Memos are created from chat via `/memo` or auto-extracted by the memory subsystem. Try clearing filters or widening the search."},CS={id:"ID",what:"What",who:"Who",when:"When",where:"Where",platform:"Platform",createdAt:"Created",expiresAt:"Expires"},ES={delete:"Delete",confirmDelete:"Delete this memo?",confirmDeleteDesc:"This cannot be undone. The memory subsystem still has any embeddings derived from this memo until a backfill prune lands."},RS={label:"Open map",baidu:"Baidu Maps",apple:"Apple Maps",google:"Google Maps",osm:"OpenStreetMap"},PS={deleted:"Memo deleted"},TS={pageTitle:wS,subtitle:kS,search:SS,empty:AS,col:CS,action:ES,openMap:RS,toast:PS},IS="备忘",LS="操作员为 Agent 记下的长期备忘 — 可按内容、人物、地点检索。",OS={placeholder:"搜索备忘…",who:"谁",what:"做什么",hasLocation:"含位置",includeExpired:"包含过期"},DS={title:"未匹配到备忘",description:"备忘通过聊天中的 `/memo` 命令或记忆子系统自动抽取生成。可清空筛选或放宽搜索条件再试。"},NS={id:"ID",what:"事项",who:"对象",when:"时间",where:"地点",platform:"平台",createdAt:"创建时间",expiresAt:"过期时间"},MS={delete:"删除",confirmDelete:"确认删除此备忘?",confirmDeleteDesc:"操作不可撤销。记忆子系统中由此备忘衍生的 embedding 在下一次 backfill 清理前仍会保留。"},_S={label:"在地图中打开",baidu:"百度地图",apple:"Apple 地图",google:"Google 地图",osm:"OpenStreetMap"},jS={deleted:"已删除"},FS={pageTitle:IS,subtitle:LS,search:OS,empty:DS,col:NS,action:MS,openMap:_S,toast:jS},HS="Memory",US="Per-user facts the agent has accumulated. Long-term memory that survives session resets.",BS={label:"User",placeholder:"Pick a user",factsLabel:"{{count}} facts",personaTag:"persona"},zS={title:"Pick a user to view their memory",description:"Memory is partitioned per user_key (platform:userId). The dropdown above lists every user whose memory has any rows in the bank."},$S={groups:{overview:"Start",user:"User memory",processing:"Processing",recall:"Recall"}},VS={overview:"Overview",facts:"Facts",persona:"Persona",distill:"Distillation",vector:"Vector",skills:"Skills"},WS={title:"Memory overview",subtitle:"See what Agim remembers, whether extraction is healthy, and whether recall is ready.",refresh:"Refresh",clear:"Healthy",needsAttention:"{{count}} need attention",cards:{bank:{title:"Memory bank",detail:"{{facts}} facts · {{personas}} personas",action:"Open facts"},selected:{title:"Selected user",empty:"Pick a user above to inspect one memory bank.",ready:"{{user}} has facts and a persona.",noPersona:"{{user}} has facts but no persona yet.",action:"Open persona"},distill:{title:"Extraction queue",running:"A distillation pass is running.",error:"The last distillation pass failed.",ready:"Background extraction is enabled.",off:"Background extraction is off.",action:"Open distillation"},consolidate:{title:"Personas",detail:"{{count}} users have personas.",running:"Consolidation is running.",failed:"A recent consolidation failed.",action:"Open persona"},vector:{title:"Recall",offValue:"Off",off:"Vector recall is disabled.",ready:"{{embedded}}/{{total}} facts embedded.",notReady:"Vector backend is not ready.",action:"Open vector"}},next:{pickUser:{title:"Pick a user",detail:"Choose a user above to inspect facts, persona, and recall coverage."},createMemory:{title:"Create the first memory",detail:"Start a conversation, then run memory extraction after useful context accumulates."},persona:{title:"Generate or edit the persona",detail:"This user has facts but no long-form summary yet."},distill:{title:"Run memory extraction",detail:"Buffered chat turns are waiting to become facts."},vector:{title:"Backfill recall embeddings",detail:"Some facts are not covered by the active vector backend."},facts:{title:"Review remembered facts",detail:"Inspect and clean up what Agim has retained for this user."}},views:{title:"Detailed views"}},KS={title:"Facts",empty:{title:"No facts yet",description:"Facts accumulate as the agent extracts them from chat history during memory consolidation. Triggering `/memory consolidate` from chat (or the Persona tab's button when it lands) seeds this list."},filter:{search:"Search",category:"Category",categoryAny:"Any category"},category:{fact:"Fact",preference:"Preference",goal:"Goal",history:"History",profile:"Profile"},col:{id:"ID",what:"What",category:"Category",confidence:"Confidence",source:"Source",createdAt:"Created"},batch:{selected:"{{count}} selected",deleteSelected:"Delete selected",confirmDelete:"Delete {{count}} fact(s)?",confirmDeleteDesc:"This removes the rows from the bank. The vector index keeps any embedding derived from these rows until the next backfill prune."},action:{delete:"Delete",confirmDelete:"Delete this fact?",confirmDeleteDesc:"This row is removed permanently. The vector index retains its embedding until the next backfill prune."},toast:{deletedOne:"Fact deleted",deletedMany:"Deleted {{count}} facts"}},qS={title:"Persona",subtitle:"Long-form summary of who this user is, refined by periodic consolidation of their facts.",empty:{title:"No persona yet",description:"Personas are written by the consolidation pass — run it from the button below once enough facts have accumulated."},updated:"Updated {{at}}",editorLabel:"Persona summary",save:"Save",saved:"Saved",delete:"Delete persona",confirmDelete:"Delete this persona?",confirmDeleteDesc:"The persona summary is removed from the bank. Facts the persona was derived from stay in place; the next consolidate pass will rewrite a fresh one.",consolidate:{trigger:"Run consolidation",triggering:"Starting…",running:"Consolidation running…",doneOk:"Consolidation complete",doneFailed:"Consolidation failed",lastRun:"Last run {{at}}",result:"Processed {{users}} user(s), {{updated}} persona(s) updated"}},GS={title:"Dream distillation",subtitle:"Chat turns are buffered, then batch-extracted into facts in the background when the system is idle — or once a user's oldest turn passes the staleness floor. Configure the extraction model + cadence, watch the buffer, or force a pass now.",form:{title:"Configuration",hint:"Pick which model extracts facts, then tune the schedule. Changes hit the env file and reload in-process; a restart re-reads them.",dirty:"Unsaved changes",discard:"Discard",save:"Save",savedToast:"Saved",nothingChanged:"Nothing to save",source:"Extraction source",sourceHelp:"Which LLM turns buffered chat into facts.",sourceAuto:"Auto — the turn's own agent",sourceAgent:"A specific agent CLI",sourceLlm:"A standalone LLM backend",autoNote:"Zero-config: each batch is extracted by the agent that handled those turns. Recommended for most installs.",agent:"Agent",agentHelp:"Use this enabled agent CLI for every extraction, regardless of which agent handled the turn.",agentPlaceholder:"Pick an agent",noAgents:"No agents enabled. Enable one under Settings → Agents first.",llmBackend:"LLM backend",llmBackendHelp:"Bind a configured LLM backend to the `distill` role — a direct API call, no CLI spawn. Manage backends under Settings → LLM.",llmPlaceholder:"Pick a backend",noBackends:"No LLM backends configured. Add one under Settings → LLM first.",scheduleTitle:"Schedule",enabled:"Distiller",enabledHelp:"Master switch for the background pass. When off, turns still buffer but are never extracted.",enabledOn:"On",enabledOff:"Off",intervalMs:"Tick interval (ms)",intervalMsHelp:"How often the background pass wakes up. Default 300000 (5 min); minimum 10000.",floorMin:"Staleness floor (min)",floorMinHelp:"On a continuously-busy bot, force-flush a user once their oldest buffered turn is this old. Default 30.",batchMax:"Batch size",batchMaxHelp:"Max turns fed to one extraction call. Default 20.",maxPending:"Per-user buffer cap",maxPendingHelp:"Max buffered turns kept per user before the oldest are dropped. Default 200.",errors:{agentRequired:"Pick an agent for the agent source",llmRequired:"Pick an LLM backend for the LLM source",numRange:"{{field}} must be a number ≥ {{min}}"}},status:{title:"Status",enabledTrue:"Enabled",enabledFalse:"Disabled",running:"Running",pending:"Buffered turns",lastProcessed:"Last processed",lastRun:"Last run",bufferEmpty:"Buffer is empty — all turns have been distilled.",lastError:"Last error"},actions:{runNow:"Run now",runStarted:"Distillation pass started"}},QS={title:"Vector backend",subtitle:"Embeddings power hybrid recall on memory facts. The active backend, model, and per-user coverage live here.",config:{title:"Backend configuration",hint:"Backend selection + OpenAI / local-model parameters live in env. Edit `~/.agim/env` on the host (or set systemd `Environment=`); the `AGIM_MEMORY_VECTOR_*` keys are listed below.",editLink:"env file"},form:{title:"Backend configuration",hint:"Pick a backend, fill in the parameters, then save & test. Changes hit the env file and reload in-process; a restart re-reads them.",dirty:"Unsaved changes",discard:"Discard",saveAndTest:"Save & test",savedToast:"Saved — running test…",nothingChanged:"Nothing to save",backend:"Backend",backendHelp:"off = vector recall disabled; local = on-device BGE; openai = OpenAI-compatible remote endpoint",backendOff:"Off",backendLocal:"Local (BGE)",backendOpenai:"OpenAI-compatible",localModel:"Local model",localModelHelp:"Xenova model id, defaults to Xenova/bge-base-zh-v1.5. First-time use needs a manual download.",openaiBaseUrl:"Base URL",openaiBaseUrlHelp:"OpenAI-compatible endpoint root, e.g. https://api.openai.com/v1 or your self-hosted gateway.",openaiModel:"Model",openaiModelHelp:"Embedding model id, defaults to text-embedding-3-small. Match your provider's docs for other endpoints.",openaiApiKey:"API key",apiKeyKeepHint:"Leave blank to keep the existing key (placeholder shows the masked value); typing replaces it.",apiKeyNewHint:"Paste your OpenAI-compatible API key (only the server sees the raw value after save).",toggleApiKey:"Show / hide API key",batchSize:"Batch size",batchSizeHelp:"Max texts per embed call, 1–1024 (default 32).",hybridWeight:"Hybrid weight",hybridWeightHelp:"Vector branch weight when fusing with FTS5 recall, 0–1 (default 0.5).",errors:{baseUrlRequired:"Base URL is required",baseUrlInvalid:"Base URL is not a valid URL",openaiModelRequired:"Embedding model id is required",apiKeyRequired:"API key is required for the OpenAI backend on first setup",localModelRequired:"Local model id is required",batchSizeRange:"Batch size must be between 1 and 1024",hybridWeightRange:"Hybrid weight must be between 0 and 1"}},backendLabel:"Backend",modelLabel:"Model",dimsLabel:"Dimensions",readyTrue:"Ready",readyFalse:"Not ready",downloadedTrue:"Files on disk",lastError:"Last error",coverage:{title:"Coverage",total:"Facts",withEmbedding:"Embedded",withDifferentModel:"Mismatched model",scope_user:"for {{userKey}}",scope_global:"across every user"},actions:{title:"Maintenance",test:"Test",testOk:"Backend test OK",testFail:"Backend test failed: {{detail}}",download:"Download model",downloadStarted:"Download started",downloadAlreadyReady:"Model is already ready",backfill:"Backfill embeddings",backfillStarted:"Backfill started",backfillNotReady:"Backend not ready — run download first",clear:"Clear embeddings",clearStarted:"Cleared {{count}} embedding(s)",confirmClear:"Clear all embeddings?",confirmClearDesc:"Drops the embedding column for {{scope}}. Facts themselves stay; you'll need to backfill again before vector recall works."},jobs:{title:"Recent jobs",empty:"No recent jobs",phase:{running:"Running",done:"Done",failed:"Failed"}}},YS={title:"Skills",subtitle:"SKILL.md files the host agents pick up from ~/.claude/skills/ + ~/.config/opencode/skills/.",empty:{title:"No skills installed",description:"Drop a SKILL.md (with `name` and `description` frontmatter) under one of the configured roots and refresh."},filter:{search:"Search",category:"Category",categoryAny:"All categories"},sources:{title:"Source directories",claude:"Claude Code",opencode:"opencode"},agentTag:{claude:"claude",opencode:"opencode"},detail:{loading:"Loading SKILL.md…",loadFailed:"Failed to load skill detail",metadataLabel:"Metadata",agentsLabel:"Available to"}},XS={pageTitle:HS,subtitle:US,userPicker:BS,noUserSelected:zS,navigation:$S,tabs:VS,overview:WS,facts:KS,persona:qS,distill:GS,vector:QS,skills:YS},JS="记忆",ZS="Agent 为每个用户积累的事实库。跨会话保留的长期记忆。",eA={label:"用户",placeholder:"选择一个用户",factsLabel:"{{count}} 条事实",personaTag:"画像"},tA={title:"选择一个用户查看其记忆",description:"记忆按 user_key(platform:userId)分隔。上方下拉列出每位在库中有任何记忆数据的用户。"},nA={groups:{overview:"开始",user:"用户记忆",processing:"后台处理",recall:"检索"}},rA={overview:"总览",facts:"事实",persona:"画像",distill:"蒸馏",vector:"向量",skills:"技能"},iA={title:"记忆总览",subtitle:"查看 Agim 记住了什么、抽取是否健康、检索是否可用。",refresh:"刷新",clear:"状态正常",needsAttention:"{{count}} 项需处理",cards:{bank:{title:"记忆库",detail:"{{facts}} 条事实 · {{personas}} 个画像",action:"查看事实"},selected:{title:"当前用户",empty:"先在上方选择一个用户,再查看单用户记忆。",ready:"{{user}} 已有事实与画像。",noPersona:"{{user}} 有事实,但还没有画像。",action:"查看画像"},distill:{title:"抽取队列",running:"蒸馏任务正在运行。",error:"最近一次蒸馏失败。",ready:"后台抽取已启用。",off:"后台抽取已关闭。",action:"打开蒸馏"},consolidate:{title:"用户画像",detail:"{{count}} 位用户已有画像。",running:"画像整理正在运行。",failed:"最近一次画像整理失败。",action:"查看画像"},vector:{title:"记忆检索",offValue:"关闭",off:"向量召回已关闭。",ready:"已嵌入 {{embedded}} / {{total}} 条事实。",notReady:"向量后端未就绪。",action:"打开向量"}},next:{pickUser:{title:"选择一个用户",detail:"在上方选择用户后,可查看事实、画像与召回覆盖率。"},createMemory:{title:"生成第一批记忆",detail:"先开始一段对话,积累上下文后再运行记忆抽取。"},persona:{title:"生成或编辑用户画像",detail:"该用户已有事实,但还没有长篇画像。"},distill:{title:"运行记忆抽取",detail:"还有聊天轮次等待抽取成事实。"},vector:{title:"回填检索 embedding",detail:"部分事实还没有被当前向量后端覆盖。"},facts:{title:"检查已记住的事实",detail:"查看并清理 Agim 为该用户保留的内容。"}},views:{title:"详细视图"}},oA={title:"事实",empty:{title:"暂无事实",description:"Agent 在记忆整理过程中会从聊天历史中抽取事实。可在聊天里运行 `/memory consolidate` 或后续 Persona 子页内的按钮触发整理。"},filter:{search:"搜索",category:"类别",categoryAny:"全部类别"},category:{fact:"事实",preference:"偏好",goal:"目标",history:"历史",profile:"档案"},col:{id:"ID",what:"内容",category:"类别",confidence:"置信度",source:"来源",createdAt:"创建时间"},batch:{selected:"已选 {{count}} 项",deleteSelected:"删除所选",confirmDelete:"确认删除 {{count}} 条事实?",confirmDeleteDesc:"记忆库中的这些行将被删除。向量索引中相应的 embedding 在下一次 backfill 清理前仍会保留。"},action:{delete:"删除",confirmDelete:"确认删除此事实?",confirmDeleteDesc:"该行被永久删除。向量索引会在下一次 backfill 清理前保留对应 embedding。"},toast:{deletedOne:"已删除",deletedMany:"已删除 {{count}} 条"}},aA={title:"Persona",subtitle:"该用户的长篇画像,由记忆整理任务从事实库中提炼。",empty:{title:"暂无 Persona",description:"Persona 由整理任务生成。当事实积累到一定量后,点击下方按钮运行整理。"},updated:"更新于 {{at}}",editorLabel:"Persona 内容",save:"保存",saved:"已保存",delete:"删除 Persona",confirmDelete:"确认删除此 Persona?",confirmDeleteDesc:"Persona 概要会从库中删除。生成它的事实仍保留,下一次整理会重新生成。",consolidate:{trigger:"运行整理",triggering:"启动中…",running:"整理进行中…",doneOk:"整理完成",doneFailed:"整理失败",lastRun:"上次运行:{{at}}",result:"处理 {{users}} 位用户,更新 {{updated}} 条 Persona"}},sA={title:"梦境蒸馏",subtitle:"聊天轮次会先缓冲下来,在系统空闲时(或某用户最早一条缓冲超过陈旧阈值后)于后台批量抽取为事实。在这里配置抽取所用的模型与节奏、查看缓冲队列,或立即手动触发一次。",form:{title:"配置",hint:"选择由哪个模型抽取事实,再调节调度参数。改动写入 env 文件并对本进程生效,重启后从 env 重新加载。",dirty:"有未保存的改动",discard:"放弃改动",save:"保存",savedToast:"已保存",nothingChanged:"没有需要保存的改动",source:"抽取来源",sourceHelp:"由哪个 LLM 把缓冲的聊天抽取为事实。",sourceAuto:"自动 —— 用该轮次自身的 Agent",sourceAgent:"指定一个 Agent CLI",sourceLlm:"单独配置一个 LLM 后端",autoNote:"零配置:每批由处理这些轮次的 Agent 来抽取。适合大多数部署,推荐。",agent:"Agent",agentHelp:"无论该轮次由谁处理,都用这个已启用的 Agent CLI 来抽取。",agentPlaceholder:"选择一个 Agent",noAgents:"尚未启用任何 Agent。请先在 设置 → Agents 中启用一个。",llmBackend:"LLM 后端",llmBackendHelp:"把一个已配置的 LLM 后端绑定到 `distill` 角色 —— 直接调 API,不拉起 CLI。后端在 设置 → LLM 中管理。",llmPlaceholder:"选择一个后端",noBackends:"尚未配置任何 LLM 后端。请先在 设置 → LLM 中添加一个。",scheduleTitle:"调度",enabled:"蒸馏器",enabledHelp:"后台抽取的总开关。关闭后轮次仍会缓冲,但不会被抽取。",enabledOn:"开启",enabledOff:"关闭",intervalMs:"轮询间隔(毫秒)",intervalMsHelp:"后台任务的唤醒频率。默认 300000(5 分钟),最小 10000。",floorMin:"陈旧阈值(分钟)",floorMinHelp:"在持续繁忙的 bot 上,当某用户最早一条缓冲超过此时长时强制抽取。默认 30。",batchMax:"批大小",batchMaxHelp:"单次抽取调用喂入的最大轮次数。默认 20。",maxPending:"单用户缓冲上限",maxPendingHelp:"每位用户最多保留多少条缓冲轮次,超出后丢弃最旧的。默认 200。",errors:{agentRequired:"选择 Agent 来源时必须指定一个 Agent",llmRequired:"选择 LLM 来源时必须指定一个 LLM 后端",numRange:"{{field}} 必须是 ≥ {{min}} 的数字"}},status:{title:"状态",enabledTrue:"已启用",enabledFalse:"已禁用",running:"运行中",pending:"缓冲轮次",lastProcessed:"上次处理",lastRun:"上次运行",bufferEmpty:"缓冲为空 —— 所有轮次都已蒸馏。",lastError:"最近错误"},actions:{runNow:"立即运行",runStarted:"已开始一次蒸馏"}},lA={title:"向量后端",subtitle:"Embedding 驱动事实库的混合检索。当前后端、模型与每位用户的覆盖情况都在这里。",config:{title:"后端配置",hint:"后端选择与 OpenAI / 本地模型的参数都通过环境变量配置。请在宿主机直接编辑 `~/.agim/env`(或 systemd unit 的 `Environment=`),下方列出的 `AGIM_MEMORY_VECTOR_*` 系列 key 即对应字段。",editLink:"env file"},form:{title:"后端配置",hint:"选好后端、填好参数 → 保存并测试。配置只对本进程生效,重启服务后从 env 文件重新加载。",dirty:"有未保存的改动",discard:"放弃改动",saveAndTest:"保存并测试",savedToast:"已保存,正在测试…",nothingChanged:"没有需要保存的改动",backend:"后端",backendHelp:"off = 关闭向量召回;local = 本地 BGE 模型;openai = 调远程 OpenAI 协议端点",backendOff:"关闭",backendLocal:"本地(BGE)",backendOpenai:"OpenAI 协议远程",localModel:"本地模型",localModelHelp:"Xenova 仓库的 model id,默认 Xenova/bge-base-zh-v1.5;首次使用需手动触发下载。",openaiBaseUrl:"Base URL",openaiBaseUrlHelp:"OpenAI 兼容端点根路径,例如 https://api.openai.com/v1 或自部署网关。",openaiModel:"模型",openaiModelHelp:"Embedding 模型 id,默认 text-embedding-3-small;用其他兼容端点请按其文档填写。",openaiApiKey:"API Key",apiKeyKeepHint:"留空 = 保留当前 key(占位显示为脱敏值);填了就会覆盖。",apiKeyNewHint:"粘贴你的 OpenAI 兼容 API Key(保存后只在服务端可见)。",toggleApiKey:"显示 / 隐藏 API Key",batchSize:"批大小",batchSizeHelp:"单次嵌入的最大文本数,1–1024,默认 32。",hybridWeight:"混合权重",hybridWeightHelp:"FTS5 与向量召回融合时向量分支的权重,0–1,默认 0.5。",errors:{baseUrlRequired:"Base URL 不能为空",baseUrlInvalid:"Base URL 不是合法 URL",openaiModelRequired:"Embedding 模型 id 不能为空",apiKeyRequired:"首次使用 OpenAI 后端需要填 API Key",localModelRequired:"本地模型 id 不能为空",batchSizeRange:"批大小需在 1–1024 之间",hybridWeightRange:"混合权重需在 0–1 之间"}},backendLabel:"后端",modelLabel:"模型",dimsLabel:"维度",readyTrue:"就绪",readyFalse:"未就绪",downloadedTrue:"已下载",lastError:"最近错误",coverage:{title:"覆盖率",total:"事实总数",withEmbedding:"已嵌入",withDifferentModel:"模型不匹配",scope_user:"(针对 {{userKey}})",scope_global:"(全部用户)"},actions:{title:"维护",test:"测试",testOk:"后端测试通过",testFail:"后端测试失败:{{detail}}",download:"下载模型",downloadStarted:"下载已开始",downloadAlreadyReady:"模型已就绪",backfill:"回填 embedding",backfillStarted:"回填已开始",backfillNotReady:"后端未就绪 — 请先下载",clear:"清空 embedding",clearStarted:"已清空 {{count}} 条",confirmClear:"确认清空全部 embedding?",confirmClearDesc:"会丢弃 {{scope}} 的 embedding 列。事实本身保留;下次回填前向量检索不可用。"},jobs:{title:"近期任务",empty:"暂无任务",phase:{running:"运行中",done:"完成",failed:"失败"}}},cA={title:"技能",subtitle:"宿主 Agent 从 ~/.claude/skills/ + ~/.config/opencode/skills/ 中识别的 SKILL.md 文件。",empty:{title:"暂无技能",description:"在已配置的 root 目录下放一个带 `name` + `description` frontmatter 的 SKILL.md,然后刷新。"},filter:{search:"搜索",category:"类别",categoryAny:"全部类别"},sources:{title:"源目录",claude:"Claude Code",opencode:"opencode"},agentTag:{claude:"claude",opencode:"opencode"},detail:{loading:"正在加载 SKILL.md…",loadFailed:"加载技能详情失败",metadataLabel:"元数据",agentsLabel:"可用于"}},uA={pageTitle:JS,subtitle:ZS,userPicker:eA,noUserSelected:tA,navigation:nA,tabs:rA,overview:iA,facts:oA,persona:aA,distill:sA,vector:lA,skills:cA},dA="Skills",fA={installed:"Installed",hot:"Hot on skillhub.cn"},hA={title:"Installed skills",subtitle:"SKILL.md files the host agents pick up from ~/.claude/skills/ + ~/.config/opencode/skills/.",empty:{title:"No skills",description:"Drop a SKILL.md with `name` + `description` frontmatter under a configured root and refresh."},filter:{search:"Search",category:"Category",categoryAny:"Any category"},sources:{title:"Sources",claude:"Claude Code",opencode:"opencode"},agentTag:{claude:"claude",opencode:"opencode"},detail:{loading:"Loading SKILL.md…",loadFailed:"Failed to load skill detail",metadataLabel:"Metadata",agentsLabel:"Picked up by"}},pA={title:"Hot on skillhub.cn",subtitle:"Live top entries from skillhub.cn (cached 5 min on the server). Click a row for the install commands. agim never auto-runs installs — you copy the command and paste into shell or IM.",openHub:"Open skillhub.cn",loading:"Loading…",empty:"No data",cached:"cache hit",stale:"upstream unreachable — serving stale",updatedAt:"updated {{at}}",col:{slug:"slug",name:"Name / description",stars:"stars",installs:"installs"},detail:{slug:"Slug",version:"Version",category:"Category",stars:"Stars",installs:"Installs",downloads:"Downloads",howInstall:"How to install (pick one; agim never auto-runs)",copy:"Copy",copied:"Copied",label:{cliInstall:"On host (recommended)",cliSearch:"Dry-run first",imAsk:"Ask an IM agent"},hint:"The two CLI commands need skillhub CLI installed on the host first. See docs/skills.md or skillhub.cn."}},mA={pageTitle:dA,subnav:fA,installed:hA,hot:pA},gA="技能",yA={installed:"已安装",hot:"skillhub.cn 热门"},bA={title:"已安装的技能",subtitle:"宿主 Agent 从 ~/.claude/skills/ + ~/.config/opencode/skills/ 中识别的 SKILL.md 文件。",empty:{title:"暂无技能",description:"在已配置的 root 目录下放一个带 `name` + `description` frontmatter 的 SKILL.md,然后刷新。"},filter:{search:"搜索",category:"类别",categoryAny:"全部类别"},sources:{title:"源目录",claude:"Claude Code",opencode:"opencode"},agentTag:{claude:"claude",opencode:"opencode"},detail:{loading:"正在加载 SKILL.md…",loadFailed:"加载技能详情失败",metadataLabel:"元数据",agentsLabel:"可用于"}},vA={title:"skillhub.cn 热门",subtitle:"实时拉取 skillhub.cn 热门下载(服务端 5 分钟缓存)。点击任意条目查看安装命令。agim 不会自动跑安装——命令复制后由你贴去 shell 或 IM 触发。",openHub:"前往 skillhub.cn",loading:"正在加载…",empty:"暂无数据",cached:"缓存命中",stale:"上游不可达,使用旧数据",updatedAt:"更新于 {{at}}",col:{slug:"slug",name:"名称 / 描述",stars:"收藏",installs:"安装量"},detail:{slug:"标识",version:"版本",category:"类别",stars:"收藏",installs:"安装量",downloads:"下载量",howInstall:"安装方式(任选一个;agim 不会自动跑)",copy:"复制",copied:"已复制",label:{cliInstall:"Host 上跑(推荐)",cliSearch:"先查再装",imAsk:"在 IM 里让 agent 装"},hint:"前两条要先在 host 上安装 skillhub CLI。详见 docs/skills.md 或 skillhub.cn。"}},xA={pageTitle:gA,subnav:yA,installed:bA,hot:vA},wA="Workspace",kA="Read and edit files in the per-agent working directories (`AGENT_CWD`).",SA={label:"Agent",placeholder:"Pick an agent",online:"online",offline:"offline"},AA={title:"Pick an agent to browse its workspace",description:"Each registered agent runs from its own CWD. The picker lists every agent the registry knows about; the green dot next to a name means it reports available."},CA={title:"Agent notes",detail:"Keep the agent role and long-term notes here; MEMORY.md is fed into Agim conversations for this agent.",openRoleFile:"Role file",openMemory:"Memory",missingTitle:"This file does not exist yet",missingDetail:"{{path}} can be created here and edited right away.",createMemory:"Create memory file",createFile:"Create file",memoryTemplate:`# Memory
166
+
167
+ Add stable notes this agent should keep in mind when replying from Agim. Agim feeds this file into the agent context before conversations.
168
+ `,fileTemplate:`# Notes
169
+
170
+ `},EA={title:"Files",loading:"Loading…",empty:"(empty directory)",up:"Up",rootLabel:"(workspace root)",binary:"binary",symlinkEscape:"symlink → outside workspace, hidden",broken:"unreadable"},RA={noFile:"Select a file from the tree to view or edit it.",binary:"This file looks binary (base64-encoded) — editing not supported.",truncated:"File is over 1 MiB; only the first 1 MiB is shown. Saving from here would replace the whole file with the truncated content — close without saving.",truncatedBadge:"Truncated",save:"Save",saving:"Saving…",savedMeta:"Saved · {{size}} bytes · {{at}}",dirtyHint:"Unsaved changes",loadFailed:"Failed to load file"},PA={saved:"Saved {{path}}",created:"Created {{path}}"},TA={pageTitle:wA,subtitle:kA,agentPicker:SA,noAgent:AA,quick:CA,tree:EA,editor:RA,toast:PA},IA="工作区",LA="在每个 Agent 的工作目录(`AGENT_CWD`)下浏览与编辑文件。",OA={label:"Agent",placeholder:"选择一个 Agent",online:"在线",offline:"离线"},DA={title:"选择一个 Agent 来浏览其工作区",description:"每个已注册的 Agent 都有自己的 CWD。下拉列出注册表中所有已知的 Agent;名字旁的绿点表示该 Agent 当前可用。"},NA={title:"Agent 笔记",detail:"在这里维护 Agent 的角色说明和长期笔记;MEMORY.md 会随 Agim 对话进入 Agent 上下文。",openRoleFile:"角色文件",openMemory:"记忆",missingTitle:"这个文件还不存在",missingDetail:"可以在这里创建 {{path}},创建后立即编辑。",createMemory:"创建记忆文件",createFile:"创建文件",memoryTemplate:`# 记忆
171
+
172
+ 写下希望这个 Agent 在 Agim 对话中长期参考的稳定信息。Agim 会在对话前把本文件接入 Agent 上下文。
173
+ `,fileTemplate:`# 笔记
174
+
175
+ `},MA={title:"文件",loading:"加载中…",empty:"(目录为空)",up:"返回上级",rootLabel:"(工作区根目录)",binary:"二进制",symlinkEscape:"符号链接指向工作区外,已隐藏",broken:"不可读"},_A={noFile:"从左侧选择一个文件查看或编辑。",binary:"该文件是二进制(base64 编码)— 不支持编辑。",truncated:"文件超过 1 MiB;仅显示前 1 MiB。直接保存会用截断内容覆盖整个文件 — 请关闭而不要保存。",truncatedBadge:"已截断",save:"保存",saving:"保存中…",savedMeta:"已保存 · {{size}} 字节 · {{at}}",dirtyHint:"有未保存的修改",loadFailed:"加载文件失败"},jA={saved:"已保存 {{path}}",created:"已创建 {{path}}"},FA={pageTitle:IA,subtitle:LA,agentPicker:OA,noAgent:DA,quick:NA,tree:MA,editor:_A,toast:jA},HA="Observability",UA="Operational health: invocation totals, top-N leaderboards, and the audit timeline.",BA={health:"Health",topn:"Top-N",audit:"Audit"},zA={label:"Window",days_one:"{{count}} day",days_other:"{{count}} days"},$A={title:"Health",totals:"Totals",byDay:"By day",kpi:{calls:"Calls",cost:"Cost",errors:"Errors",errorRate:"Error rate",avgLatencyMs:"Avg latency",p95LatencyMs:"P95 latency"},byDayCol:{date:"Date",calls:"Calls",cost:"Cost",errors:"Errors",avgLatencyMs:"Avg latency"},empty:{title:"No data in this window",description:"No invocations recorded in the selected time window. Widen the window or wait for an agent call to fire."}},VA={title:"Top-N",filter:{dim:"Group by",metric:"Rank by"},dim:{user:"User",agent:"Agent",platform:"Platform",intent:"Intent"},metric:{cost:"Cost",calls:"Calls",errors:"Errors",avg_latency:"Avg latency"},col:{rank:"#",key:"Key",calls:"Calls",cost:"Cost",errors:"Errors",avgLatencyMs:"Avg latency"},empty:{title:"No data",description:"No invocations matched the filters."}},WA={title:"Audit",stats:{total:"Total",totalCost:"Total cost"},filter:{agent:"Agent",platform:"Platform",user:"User",intent:"Intent"},col:{ts:"Time",trace:"Trace",agent:"Agent",platform:"Platform",user:"User",intent:"Intent",duration:"Duration",cost:"Cost",outcome:"Outcome"},outcome:{ok:"ok",fail:"fail"},empty:{title:"No invocations",description:"Audit rows appear here when an agent is invoked. Adjust filters or widen the window."}},KA={pageTitle:HA,subtitle:UA,tabs:BA,window:zA,health:$A,topn:VA,audit:WA},qA="观测",GA="运行健康:调用总量、Top-N 排行与审计时间线。",QA={health:"健康",topn:"排行",audit:"审计"},YA={label:"时间窗口",days_one:"{{count}} 天",days_other:"{{count}} 天"},XA={title:"健康",totals:"总览",byDay:"每日明细",kpi:{calls:"调用",cost:"成本",errors:"错误",errorRate:"错误率",avgLatencyMs:"平均延迟",p95LatencyMs:"P95 延迟"},byDayCol:{date:"日期",calls:"调用",cost:"成本",errors:"错误",avgLatencyMs:"平均延迟"},empty:{title:"时间窗口内无数据",description:"所选时间范围内没有任何调用记录。可以放宽时间窗口或等待 Agent 被调用。"}},JA={title:"Top-N",filter:{dim:"分组维度",metric:"排序依据"},dim:{user:"用户",agent:"Agent",platform:"平台",intent:"意图"},metric:{cost:"成本",calls:"调用",errors:"错误",avg_latency:"平均延迟"},col:{rank:"#",key:"键",calls:"调用",cost:"成本",errors:"错误",avgLatencyMs:"平均延迟"},empty:{title:"暂无数据",description:"当前筛选下没有调用记录。"}},ZA={title:"审计",stats:{total:"累计",totalCost:"累计成本"},filter:{agent:"Agent",platform:"平台",user:"用户",intent:"意图"},col:{ts:"时间",trace:"追踪 ID",agent:"Agent",platform:"平台",user:"用户",intent:"意图",duration:"耗时",cost:"成本",outcome:"结果"},outcome:{ok:"成功",fail:"失败"},empty:{title:"暂无调用",description:"当 Agent 被调用时,审计记录会出现在这里。可调整筛选或放宽时间窗口。"}},eC={pageTitle:qA,subtitle:GA,tabs:QA,window:YA,health:XA,topn:JA,audit:ZA},tC="Settings",nC="Operational configuration: environment variables and service lifecycle.",rC={recommended:"first",groups:{start:"Start",core:"Core setup",capabilities:"Capabilities",operations:"Operations"}},iC={start:"Start",messengers:"Messengers",email:"Email (SMTP)",viewer:"Viewer & Maps",agents:"Agents",llm:"Agim Agent",mcp:"MCP Servers",nativeAgent:"Agim Agent",search:"Web search",mobile:"Mobile",agimSkills:"agim Skills",policy:"Policy",security:"Security",workspaces:"Access Rules",admins:"Admins",env:"Env Vars",service:"Service"},oC={title:"Start here",subtitle:"Finish this in order: get Web chat working, settle the agent, then connect IM.",unknown:"not selected",actions:{chat:"Open chat",refresh:"Refresh"},state:{done:"Ready",todo:"Next",warn:"Needs attention",loading:"Loading"},steps:{web:{title:"Web chat",ready:"Service is running: {{mode}}",needsStart:"Service is not running yet.",action:"Open chat"},agent:{title:"Current agent",ready:"{{agent}} is online",offline:"{{agent}} is not ready",selected:"{{agent}} is selected; waiting for runtime status.",empty:"No default agent selected.",action:"Manage agents"},llm:{title:"Agim Agent API",ready:"{{count}} usable API configured.",empty:"No model API yet. Add one to use Agim without an external agent CLI.",action:"Configure API"},im:{title:"Connect IM",ready:"Connected: {{platforms}}",empty:"No IM connected yet. Connect one after Web chat works.",action:"Connect IM"}},deploy:{title:"Keep it running",detail:"Before sharing it with others, check ports, restart behavior, and background service status.",action:"View service"}},aC={title:"Agents",subtitle:"Manage bridged external agents (CLI / ACP). Agim Agent is the built-in default agent and is configured from the Agim Agent tab via Model APIs.",installHint:"Not installed. `npm install -g {{pkg}}` on the host.",nativeInstallHint:"No model API configured for Agim Agent. Open Settings → Agim Agent to add one (OpenAI / DeepSeek / Anthropic / …).",inProcessBadge:"built-in",inProcessHint:"built-in — runs inside agim, no external CLI to install",agimAgentCardTitle:"Agim Agent (built-in default agent)",agimAgentCardDesc:"Agim Agent runs inside agim and uses Model APIs you configure. It is separate from bridged external agents on this page.",agimAgentCardAction:"Open Agim Agent settings",aliasesLabel:"Aliases",online:"online",offline:"offline",defaultAgent:"Default agent",defaultAgentHint:"Used when the intent classifier has no preference (new web threads, etc.). Only enabled + online agents appear here.",noEligible:"No eligible default",saveBtn:"Save",saving:"Saving…",dirtyHint:"Unsaved changes",discard:"Discard",toast:{saved:"Saved"},acp:{title:"Remote agents (ACP)",subtitle:"Agents reachable over HTTP via the Agent Communication Protocol. Each entry persists in config and registers on the next service restart.",discoverBtn:"Discover",runDiscover:"Probe",baseUrl:"Discovery URL",baseUrlHint:"Probes `<base>/.well-known/acp` and adds the entries it lists. Skips names already present.",addTitle:"Add agent",name:"Name",nameHint:"Stable identifier; letters, digits, `._-`.",aliases:"Aliases",aliasesHint:"Comma-separated; routed via `/alias` in chat.",endpoint:"Endpoint",endpointHint:"Base URL of the agent's ACP root (no trailing `/`).",authType:"Auth",auth:{none:"None",apikey:"API key",bearer:"Bearer"},token:"Token",tokenPlaceholder:"Paste token",testBtn:"Test",addBtn:"Add",removeBtn:"Remove",on:"on",off:"off",dupName:"An agent with this name already exists.",empty:{title:"No remote agents",description:"Add an ACP endpoint below or use Discover for a `.well-known/acp` directory."},toast:{staged:"Added — click Save to apply.",testOk:"Reached `{{name}}`",testMasked:"Save first — token is masked, can't test in place.",discoverEmpty:"Nothing new to add.",discoverAdded_one:"Added {{count}} agent.",discoverAdded_other:"Added {{count}} agents."}}},sC={title:"Policy & toggles",subtitle:"Frequently used switches backed by environment values. Each toggle is saved immediately and usually takes effect at once; a few settings still require a service restart.",savingToast:"Saved",safety:{title:"Skip permissions (DANGEROUS)",description:"When ON, the Claude Code adapter passes `--dangerously-skip-permissions` to the wrapped CLI, bypassing every tool-use confirmation. Recommended OFF for production. Only enable for trusted, isolated workspaces.",envKey:"AGIM_DANGEROUSLY_SKIP_PERMISSIONS",tagWarn:"production deployments should keep this OFF"},approval:{title:"Approval timeout default",description:'What the approval bus does when a pending tool-use request expires with no human reply. `Deny` is the safe default and keeps write-side calls (Bash / Edit / Write) gated; `Allow` is "user away" mode and lets the agent keep moving.',envKey:"AGIM_TIMEOUT_DEFAULT",valDeny:"Deny on timeout",valAllow:"Allow on timeout"},memory:{title:"Long-term memory",description:"Master switch for the per-user memory subsystem (facts + persona + vector retrieval). Disabling stops new fact extraction and persona consolidation; the existing bank stays on disk.",envKey:"AGIM_MEMORY_ENABLED"},viewer:{title:"Long-message viewer",description:"When ON, IM replies that exceed the viewer threshold are uploaded to the local paste store and the IM message becomes a short URL the user can click. Without it, long replies get truncated by the messenger.",envKey:"AGIM_VIEWER_ENABLED"},a2aNotify:{title:"A2A notify mode",description:"How verbose the bus is when one agent calls another. `essential` (default) sends only headline events; `verbose` includes every transition; `off` silences cross-agent notifications entirely.",envKey:"AGIM_A2A_NOTIFY_MODE",valEssential:"Essential",valVerbose:"Verbose",valOff:"Off"}},lC={title:"Messengers",subtitle:"Per-IM-platform connection settings. Toggle a platform on, fill in its credentials, and Save. The next service restart picks up the new config.",quick:{title:"Connect one messenger",subtitle:"Pick a path first. WeChat uses QR login; Feishu, DingTalk, and others need app credentials from their developer consoles.",connectedTitle:"Messenger connected",connectedBadge:"ready",nextBadge:"next",connectedDetail:"Connected: {{platforms}}. Open Web chat to verify it, or add another messenger.",webChat:"Open chat",addAnother:"Add another",scanWechat:"Scan WeChat QR",configurePlatform:"Configure {{platform}}",option:{wechat:{title:"WeChat QR",detail:"Fastest path. Scan with WeChat on your phone and confirm the login."},feishu:{title:"Feishu app",detail:"Good for company chats. Requires App ID, App Secret, and message scopes."},dingtalk:{title:"DingTalk Stream",detail:"Good for company chats. Requires Stream API client credentials."},telegram:{title:"Telegram bot",detail:"Good for global groups. Requires a Bot Token from BotFather."},discord:{title:"Discord bot",detail:"Good for community channels. Requires a Bot Token and bot invite."}}},saveAll:"Save all",saving:"Saving…",savedToast:"Configuration saved",discardAll:"Discard changes",dirtyHint:"Unsaved changes",apply:{title:"Apply IM changes",badge:"restart needed",restartDetail:"Saved. Restart Agim to connect the enabled messengers.",startDetail:"Saved. Start Agim to connect the enabled messengers.",restart:"Restart Agim",start:"Start Agim",restarting:"Restarting…",starting:"Starting…",appliedToast:"IM changes applied."},platform:{wechat:"WeChat",telegram:"Telegram",feishu:"Feishu (Lark)",dingtalk:"DingTalk",discord:"Discord"},hint:{wechat:"iLink-based QR login. Click Scan, scan the QR with your phone WeChat, confirm — the bot logs in as that account.",telegram:"Bot API token from @BotFather; channel id is optional and only used when targeting a specific chat.",feishu:"App credentials from the Lark developer console. App must have the messaging scopes.",dingtalk:"Stream API client credentials from the DingTalk developer console.",discord:"Bot token from the Discord developer portal. The bot must be invited to the target channel."},enabled:"Enabled",disabled:"Disabled",scanQr:"Scan QR",fields:{botToken:"Bot token",appId:"App ID",appSecret:"App secret",clientId:"Client ID",clientSecret:"Client secret",channelId:"Channel ID"},dingtalk:{dmPolicy:"DM policy",groupPolicy:"Group policy",allowFrom:"DM allowFrom (staffIds, comma-separated)",groupAllowFrom:"Group allowFrom (staffIds, comma-separated)",ackReaction:"Ack-reaction",policy:{open:"open — anyone may talk",pairing:"pairing — first DMer pinned",allowlist:"allowlist — only listed IDs",disabled:"disabled — bot ignores groups"},ack:{off:"off — no ack glyph",emoji:"emoji ⏳→✅",kaomoji:"kaomoji (text-face)"},accountsTitle:"Extra accounts",accountDisabled:"disabled",accountsHint:"Each entry starts its own DWClient with isolated dmPolicy / allowFrom / ack-reaction. Restart agim after Save for new accounts to take effect.",accountsEmpty:"No extra accounts yet. Click ‘+ add account’ to wire another DingTalk bot.",addAccount:"Add account",accountName:"Display name (optional)",accountRenameCollision:'An account with id "{{id}}" already exists; pick another id.'},qr:{title:"Scan WeChat QR",description:"Open WeChat on your phone, scan this code, then confirm the login prompt inside WeChat.",starting:"Starting QR session…",loadFailed:"Failed to start QR session",expired:"QR code expired — close and start a new one.",cancelled:"Cancelled.",confirmed:"Login confirmed — wechat-ilink will start on the next service restart."}},cC={title:"Email (SMTP)",subtitle:"Outbound mail delivery for `/remind email me@x.com …`. Credentials persist to `~/.agim/.env`. Leave blank to disable.",cardTitle:"SMTP credentials",statusOn:"configured",statusOff:"disabled",host:"Host",hostHint:"Mail server hostname (e.g. `smtp.gmail.com`).",port:"Port",portHint:"Usually 465 (SSL) or 587 (STARTTLS).",user:"Username",userHint:"Login email; often the sender address too.",pass:"Password / app token",passHint:"Stored in `~/.agim/.env` (chmod 600). Masked unless Reveal is on.",from:"From",fromHint:"Sender header. Defaults to the username when blank.",secure:"TLS mode",secureHint:"`auto` follows the port; force SSL or STARTTLS if your provider requires it.",secureAuto:"auto (port-based)",secureTrue:"true (SSL, port 465)",secureFalse:"false (STARTTLS, port 587)",reveal:"Reveal",hide:"Hide",testBtn:"Test connection",testNeedsConfigured:"Save host / user / password first.",disableBtn:"Disable SMTP",saveBtn:"Save",saving:"Saving…",discard:"Discard",toast:{saved:"SMTP saved",disabled:"SMTP disabled",noChanges:"Nothing to save"}},uC={title:"Viewer & Maps",subtitle:"Public-facing surfaces: the long-message Viewer (turns >threshold replies into a `/v/<id>` short link) and Baidu Maps AK (drives `/memo` address geocoding).",reveal:"Reveal",hide:"Hide",save:"Save",saving:"Saving…",discard:"Discard",dirtyHint:"Unsaved changes",toast:{saved:"Viewer settings saved"},viewer:{title:"Viewer (long-message links)",subtitle:"Replies longer than the chars / lines threshold are uploaded to the local paste store and the IM message becomes a short `/v/<id>` link.",on:"enabled",off:"disabled",enableLabel:"Enable the long-message Viewer",publicUrl:"Public base URL",publicUrlHint:"What the operator's reverse proxy / tunnel exposes. Used to build `/v/<id>` links.",tunnelMode:"Tunnel mode",tunnelOff:"off (use Public base URL)",tunnelQuick:"quick (cloudflared)",tunnelHint:"`quick` launches a Cloudflare quick tunnel and uses its URL when the operator hasn't fronted agim themselves.",remotePasteUrl:"Remote paste URL",remotePasteUrlHint:"POST markdown here to get a public URL back; overrides Public base URL + tunnel. Leave empty to use the community default https://viewer.iclaw.host/paste.",remotePasteToken:"Remote paste bearer token",remotePasteTokenHint:"Optional bearer token sent to the remote paste server. Required only if your paste server protects POSTs.",noDefaultRemote:"Disable community default",noDefaultRemoteLabel:"Don't fall back to viewer.iclaw.host when nothing else is configured",noDefaultRemoteHint:"When no mode is configured, agim falls back to viewer.iclaw.host. Enable this to disable that fallback (long content stays inline unless another mode is configured).",tunnelStatus:"Tunnel status",refreshTunnel:"Refresh",tunnelRunning:"Running",yes:"yes",no:"no",tunnelUrl:"Live URL",effectiveUrl:"Effective URL",binary:"cloudflared binary",binaryMissing:"not found in PATH — install from cloudflare/cloudflared releases",lastError:"Last error",tunnelLoading:"Loading tunnel status…",thresholds:"Thresholds",chars:"Max chars",charsHint:"Replies above this length route through Viewer.",lines:"Max lines",linesHint:"Same routing decision, on line count.",codeLines:"Max code lines",codeLinesHint:"Lower threshold for replies inside code fences.",maxPastes:"Paste store cap",maxPastesHint:"Older pastes are evicted FIFO once the count exceeds this."},baidu:{title:"Baidu Maps AK",subtitle:"Enables `/memo` address-to-coords lookup. Without it, /memo still works via raw coords or browser GPS share. Free AK: lbsyun.baidu.com → Console → Application → Server-side API.",configured:"configured",empty:"not set",placeholder:"32-char AK starting with a non-digit",hint:"Stored in `~/.agim/.env` (chmod 600). Masked unless Reveal is on.",suspicious:"AK length is {{length}} — usually a Baidu AK is 32 characters. Double-check?",clear:"Clear AK",toast:{saved:"Baidu Maps AK saved",cleared:"Baidu Maps AK cleared"}}},dC={title:"Access Scopes",subtitle:"Partition available Agents and call rates by user, team, or customer. `default` catches every unrouted user.",empty:{title:"Only the default scope",description:"Add a scope below to partition available Agents and call rates by team, project, or customer."},col:{id:"ID",name:"Name",agents:"Agents",members:"Members",rateLimit:"Rate limit"},rateLimitFormat:"{{rate}} per {{intervalSec}}s, burst {{burst}}",membersOpen:"open (any user)",membersCount_one:"{{count}} member",membersCount_other:"{{count}} members",edit:"Edit",remove:{label:"Delete",ariaLabel:"Delete {{id}}",confirm:"Delete scope",confirmTitle:"Delete scope {{id}}?",confirmDescription:"After deletion, members of {{name}} fall back to the default scope. This takes effect immediately."},form:{title:"Add or edit access scope",subtitleEdit:"Editing an existing scope — change id to clone, keep to upsert.",id:"ID",idHint:"Stable identifier; [a-zA-Z0-9_-]+; the special name `default` is reserved.",name:"Display name",agents:"Agent whitelist",agentsHint:"Leave empty to allow every registered Agent; choose entries to restrict this scope.",emptyAgents:"All registered Agents allowed",selectAgents:"Choose Agents",customAgentPlaceholder:"agent-name",agentOnline:"online",agentOffline:"offline",members:"Member user IDs",membersHint:"Leave empty to open this scope to every user; you can also add `platform:userId` manually.",emptyMembers:"Open to every user",selectMembers:"Choose members",customMemberPlaceholder:"platform:userId",memberLastSeen:"last seen {{time}}",memberFromScope:"from scope {{scope}}",selectedCount:"{{count}} selected",noChoices:"No candidates yet",addCustom:"Add",removeSelected:"Remove {{value}}",rateLimit:"Rate limit (optional)",ratePresetHint:"Default uses the system rate limit; you can still edit the numbers below.",ratePresets:{default:"Default",strict:"Strict",busy:"Higher traffic"},ratePresetDescriptions:{default:"system default 10/60s · burst 15",strict:"3/60s · burst 5",busy:"30/60s · burst 45"},rate:"Calls",intervalSec:"Per (seconds)",burst:"Burst",submit:"Save scope",reset:"Clear form"},toast:{saved:"Access scope saved",deleted:"Access scope deleted"}},fC={title:"Service",subtitle:"Inspect the running agim process + start, stop, or restart it.",modeLabel:"Mode",pidLabel:"PID",uptimeLabel:"Uptime",webLabel:"Web",bootPhaseLabel:"Boot phase",mode:{systemd:"systemd",background:"background",foreground:"foreground",none:"not running"},actions:{start:"Start",stop:"Stop",restart:"Restart",confirmStop:"Stop the agim service?",confirmStopDesc:"The web console, the messenger adapters, and any in-flight job will all stop. You'll need to start the service again before you can use it.",confirmRestart:"Restart the agim service?",confirmRestartDesc:"The process stops and re-starts. In-flight jobs are cancelled; outbox + queued reminders survive the bounce. The web console will be unreachable for ~5-30 seconds."},toast:{started:"Service started",stopped:"Service stopped",restarted:"Service restarted"},ports:{title:"Ports",subtitle:"Which ports agim binds when started. Leave blank to use the default. Changes apply on the next service restart (use the Restart button below after saving).",webPort:"Web port",webPortHint:"HTTP server for the chat UI + REST API. Default: {{default}}.",acpPort:"ACP port",acpPortHint:"Agent Communication Protocol server (remote agent surface). Default: {{default}}.",invalidPort:"Must be a number between 1 and 65535.",restartRequired:"Restart required",save:"Save",saving:"Saving…",discard:"Discard",toast:{saved:"Ports saved — restart agim to bind the new ports"}},recovery:{title:"Recovery",refreshLog:"Refresh log",state:{loading:"checking",running:"running",booting:"starting",stopped:"stopped"},detail:{loading:"Reading service status and the latest log lines.",running:"The service is running. If chat, IM, or an agent misbehaves, check the recent log or run the local doctor.",booting:"The service has started but is still in the {{phase}} phase. Wait briefly; if it stays there, check the recent log.",stopped:"The service is not running. Click Start above, then watch whether the recent log keeps updating."},commands:{doctor:"Local doctor",status:"Service status",tail:"View log",tailPending:"Log not created yet",tailChecking:"Checking the log file.",tailPendingDetail:"It is created automatically after the first background service start."},truncated:"Tail only",logMissing:"No log file yet. It is created after the first background service start.",logEmpty:"The log is empty.",toast:{copied:"Command copied",copyFailed:"Copy failed"}}},hC={title:"Security",subtitle:"Before sharing Agim, confirm who can reach the bot, who can administer it, and which high-risk tools are tightened.",posture:{title:"Security posture",loading:"checking",ready:"ready for sharing",needsAction:"{{count}} to review",detail:"Handle these before connecting public IM channels or a reverse proxy.",readyDetail:"The main access gates are in place. Advanced controls can still be tuned for your deployment.",issue:{skipPermissions:{title:"Agent permission confirmations are skipped",detail:"This bypasses tool-use confirmations and should only be used temporarily in isolated environments.",action:"Turn off"},senderOpenImplicit:{title:"IM sender access is open",detail:"Anyone who can reach the bot can start a conversation. Restrict it before sharing externally.",action:"Configure"},senderOpenExplicit:{title:"IM sender access is explicitly open",detail:"Everyone is allowed by choice. For public groups or internet-facing access, use a restricted list.",action:"Configure"},adminEmpty:{title:"No IM admin configured",detail:"Admin-tier IM commands cannot be assigned safely yet. Ask the admin to send one message, then grant access.",action:"Configure"},envPerms:{title:"Env file permissions are too broad",detail:"Current mode is {{mode}}. Use 600 so other local users cannot read tokens or keys."},root:{title:"Service is running as root",detail:"Tool calls inherit root privileges. Production deployments should run under a dedicated system user."},privateWeb:{title:"Native web can reach all private ranges",detail:"This relaxes SSRF protection. Keep it on only for trusted internal deployments.",action:"Turn off"},fsOpen:{title:"Native filesystem is not confined to the workspace",detail:"By default it can access non-sensitive paths. Restrict it before external use.",action:"Restrict"}}},diagnostics:{title:"Runtime diagnostics",summary:"Open when troubleshooting; use the posture above for daily checks.",advanced:"Advanced",runningAsRoot:"Running as root",runningAsRootHelp:"Tool calls run with root privileges. Recommend creating a dedicated user + setting User= in the systemd unit.",envFilePerms:"Env file permissions",envFilePermsLax:"Too permissive (group/world readable)",envFilePermsOk:"0600 (owner-only)",bwrapAvailable:"bubblewrap installed",bwrapMissing:"Not installed (apt install bubblewrap)",senderAllowlist:"Sender allowlist",senderAllowlistOff:"Not configured (open access)",senderAllowlistOn:"Configured",adminAllowlist:"Admin allowlist",adminAllowlistOff:"Not configured (populated after first /setup)",adminAllowlistOn:"Configured"},sender:{title:"Sender allowlist (who can talk to the bot)",description:"Controls who can message the IM bot. For external use, choose a restricted list from discovered users. For local personal testing, explicitly allow everyone.",envKey:"AGIM_ALLOWED_USERS",placeholder:"platform:userId,platform:userId",modeRestricted:"Restrict to list",modeOpen:"Everyone can use it",openExplicit:"explicitly open",openImplicit:"blank, open by default",openHint:"Anyone who can reach the IM bot can start a conversation. This is fine for personal testing; switch to a restricted list before public groups, company IM, or internet-facing access.",emptyMembers:"No allowed senders yet",chooseMembers:"Choose users",noChoices:"No discovered users yet",lastSeen:"last seen {{time}}",fromCurrentValue:"from current config",addCustom:"Add",removeMember:"Remove {{value}}",save:"Save gate",saved:"Saved",unsaved:"Unsaved changes",emptyRestrictedToast:"Restricted mode needs at least one selected or manual user."},exec:{title:"Native exec tool",description:"Sandbox + timeout controls for native_exec. Each invocation also goes through an IM approval card (unless previously auto-allowed by fingerprint).",sandbox:"Sandbox backend",sandboxNone:"None (plain spawn)",sandboxBwrap:"bubblewrap (Linux only)",sandboxBwrapMissing:"bubblewrap not installed",sandboxNet:"Sandbox network",sandboxNetOn:"Allowed (default)",sandboxNetOff:"Blocked (--unshare-net)",timeoutMs:"Command timeout (ms, default 60000)",maxOutput:"Per-stream output cap (bytes, default 32768)"},web:{title:"Native web tools",description:"SSRF defense and timeouts. CIDR whitelist lets you allow Tailscale / 100.64.0.0/10 / VPN ranges back in.",allowPrivate:"Allow all private ranges (not recommended)",allowPrivateHelp:"= 1 disables all private-IP checks. Only for trusted internal deployments.",ssrfWhitelist:"SSRF CIDR whitelist",ssrfWhitelistPlaceholder:"100.64.0.0/10,10.20.0.0/16",timeoutMs:"fetch / search timeout (ms, default 30000)"},fs:{title:"Native filesystem tools",description:"By default, fs tools can access non-sensitive paths. Turn this on to confine them to the native agent's per-thread workspace subtree.",restrict:"Restrict to workspace",restrictOn:"ON (recommended)",restrictOff:"OFF (allow any path; sensitive-paths denylist still applies)",timeoutMs:"fs tool timeout (ms, default 60000)"},delegation:{title:"Native call_agent cap",description:"Max mcp__agim__call_agent invocations per turn. Prevents native from spinning on infinite delegations. 0 = unlimited.",envKey:"AGIM_NATIVE_CALL_AGENT_MAX_PER_TURN",valueLabel:"default 2"},platformBlacklist:{title:"IM platform blacklist",description:"Comma-separated platform ids. Listed platforms are hidden from the CLI wizard, from this admin page, and registry.registerMessenger refuses to register them at boot — even if their credentials still live in the env file the adapter won't come up. Default empty (no blocks). Common ids: wechat-ilink / telegram / feishu / dingtalk / discord / email.",envKey:"AGIM_PLATFORM_BLACKLIST",placeholder:"telegram,discord",currentLabel:"Currently in force"},diagnosticsPlatformBlacklist:"Platform blacklist",savingToast:"Saved.",resetTitle:"Reset to default"},pC={title:"IM admin registry",subtitle:"Web admin tokens decide who can run IM admin-tier commands. Candidate IM users are auto-discovered after they send any message to agim.",configured:"Allowlist configured",notConfigured:"No IM admin configured yet.",empty:"No admins added yet.",col:{platform:"Platform",userId:"User ID"},known:{title:"Discovered IM users",hint:"Users appear here automatically after they talk to agim. Grant admin directly from this list.",count:"Discovered users: {{count}}",empty:"No discovered IM users yet.",emptyHint:"Ask the user to send one message to agim first.",col:{lastSeen:"Last seen"},promote:"Grant admin",alreadyAdmin:"Already admin"},remove:{label:"Remove",confirmTitle:"Remove this admin?",confirmDescription:"They lose access to all admin-tier commands. Re-add to restore."},toast:{added:"Admin added",removed:"Admin removed"}},mC={title:"Agim Agent Settings",subtitle:"Add one model API first so Agim Agent can run. Multiple APIs, role bindings, and runtime behavior live under advanced settings. API keys are saved in ~/.agim/llm-secrets.json (0600) or AGIM_LLM_SECRET_<NAME>.",refresh:"Refresh",next:{emptyTitle:"Save and test the API above first",emptyDetail:"After the test passes, Agim binds the default role and makes Agim Agent the default agent.",title:"Next: send one message",backendBadge:"using {{backend}}",detail:"In chat, you can list and switch the model API used by this conversation.",chat:"Open chat",im:"Connect IM"},advanced:{title:"Advanced settings",badge:"optional",subtitle:"Manage multiple APIs, role bindings, tool approvals, context compaction, A2A, notification evaluation, and heartbeat.",show:"Show advanced settings",hide:"Hide advanced settings"},quick:{title:"Quick-enable Agim Agent",subtitle:"Pick a provider and paste an API key. Agim saves the API, binds the default role, and runs one connection test.",readyTitle:"Agim Agent is ready",readyBadge:"enabled",enableBadge:"needs enable",readyDetail:"Currently using {{backend}}. Open Web chat to test it.",enableDetail:"{{backend}} is usable. Enable it to bind Agim Agent and make it the default agent.",enableAction:"Enable Agim Agent",chatAction:"Open chat",saveAndTest:"Save and test",saving:"Saving…",testing:"Testing…",setupDone:"Agim Agent is enabled and the test passed.",enabledToast:"Agim Agent enabled.",testOk:"Connection test passed: {{ms}}ms",testFailed:"Connection test failed. The API is saved; check the key, model, or Base URL."},backendsTitle:"APIs ({{count}})",backendsEmpty:"No model APIs configured yet. Add one below.",rolesTitle:"Role Bindings (optional, advanced)",rolesOptionalHint:"Role bindings are optional. Native auto-uses any usable API.",addTitle:"Add API",col:{name:"Name",provider:"Provider",model:"Model",baseUrl:"Base URL",apiKey:"API Key",actions:"Actions"},secretMissing:"missing",ping:"Ping",remove:"Remove",pinging:"pinging…",setKeyFirst:"set API key first",pingHint:"send a tiny chat probe",errorDialog:{title:"Probe failed",description:"Backend {{backend}} returned an error.",defaultHint:"Check the API key, Base URL, and model name. Details are below.",temperatureHint:"This model does not accept the temperature parameter. Agim now sends temperature only when you explicitly configure it; run the probe again."},removeConfirm:'Remove API "{{name}}"? Role bindings and API key will be cleared.',removedToast:"Removed (also cleared {{count}} role binding(s)).",roleUpdated:"Updated role {{role}}",unset:"(unset)",unbound:"(unbound)",roleHint:{cheap:"Used by built-in helper tasks such as memory extraction and intent classification.",evaluator:"Used by notification evaluation and route comparison.","native-chat":"Preferred for /agim chat (/na still works). If unbound, Agim Agent auto-falls back to any usable API."},preset:"Provider preset",name:"Name",namePlaceholder:"e.g. deepseek-cheap",baseUrl:"Base URL",baseUrlPlaceholder:"https://api.example.com/v1",model:"Model",modelPlaceholder:"model-id",apiKey:"API Key",apiKeyPlaceholder:"sk-...",addBackend:"Add API",invalidPreset:"invalid preset",nameRequired:"name required",baseUrlRequired:"baseUrl required",modelRequired:"model required",apiKeyRequired:"API key required",addedWithKey:'Added API "{{name}}"',agimAgentRuntimeTitle:"Agim Agent runtime settings",agimAgentRuntimeHint:"Behavior controls below apply to Agim Agent. Model APIs above decide which models it uses.",presets:{deepseek:"DeepSeek",moonshot:"Moonshot Kimi",zhipu:"Zhipu GLM",openai:"OpenAI",anthropic:"Anthropic",custom:"Custom"}},gC={title:"External MCP Servers",subtitle:"Tools from these servers are exposed to the built-in Agim Agent (via mcp_<server>_<tool> naming). CLI agents keep their own MCP configs and ignore this list. Header values may contain bearer tokens, so this page is admin-only.",refresh:"Refresh",serversTitle:"Servers ({{count}})",serversEmpty:"No MCP servers configured. Add one below — common picks: filesystem, github, postgres.",totalTools:"total tools: {{count}}",addTitle:"Add Server",col:{name:"Name",transport:"Transport",target:"Target",runtime:"Runtime",actions:"Actions"},transportStdio:"stdio",transportSse:"SSE",transportHttp:"http",runtimeUnknown:"unknown",runtimeConnected:"connected · {{count}} tools",runtimeConnectedOne:"connected · {{count}} tool",runtimeDisconnected:"disconnected",health:"Health",remove:"Remove",probing:"probing…",removeConfirm:'Remove MCP server "{{name}}"?',removedToast:'Removed "{{name}}"',nameRequired:"name required",commandRequired:"command required for stdio transport",urlRequired:"url required for http/sse transport",headersInvalid:"headers must be valid JSON",addedToast:'Added "{{name}}"',nameLabel:"Name",namePlaceholder:"e.g. filesystem",transportLabel:"Transport",transportStdioOption:"stdio (subprocess)",transportHttpOption:"http / SSE",commandLabel:"Command",commandPlaceholder:"e.g. npx",argsLabel:"Args (space-separated)",urlLabel:"URL",urlPlaceholder:"https://example.com/mcp",headersLabel:"Headers (JSON, optional)",headersPlaceholder:'{"Authorization":"Bearer …"}',addServer:"Add Server"},yC={title:"Agim Agent · Evaluator · Heartbeat",subtitle:"Runtime controls for Agim Agent and two LLM-based gates (notification evaluator, heartbeat). Model APIs and optional role bindings are configured above on this page.",llmLink:"/settings/llm",refresh:"Refresh",unsaved:"unsaved changes",discard:"Discard",save:"Save",savedToast:"Saved.",agentCard:"Agim Agent (built-in)",evaluatorCard:"Notification Evaluator",heartbeatCard:"Heartbeat Scheduler",on:"on",off:"off",roleOverride:"Role override",roleHint:"Agim Agent prefers this role first; when no role resolves, it auto-falls back to any usable API. Role bindings are optional.",approvalMode:"Approval mode",approvalHint:"How tool calls from the Agim Agent loop are gated.",modeReadOnly:"read-only (safe default)",modeAllowList:"allow-list (only autoAllow entries)",modeAllowAll:"allow-all (every tool, no gate)",modeDenyAll:"deny-all (no tools)",autoAllow:"Auto-allow tool prefixes",autoAllowHint:"Comma-separated. Tool names starting with any entry bypass the gate (e.g. native_,mcp_filesystem_).",denyList:"Deny-list tool prefixes",denyListHint:"Comma-separated. Always rejected regardless of mode (e.g. mcp_shell_).",evalDesc:"LLM gate that filters routine / empty agent-initiated push messages. Uses the evaluator role. Fail-open: LLM error or missing API → message is delivered.",enableGate:"Enable gate",filterViaLlm:"Filter via LLM",evalSources:"Sources to gate",evalSourcesHint:"Comma-separated subset of: push, notify, reminder, heartbeat. Empty = default push,heartbeat.",hbDesc:"Periodic proactive wake-up loop. With this off, /heartbeat bind still works (saves the binding) but no scans run. Three-phase tick: DECIDE → EXECUTE → EVALUATE.",enableScheduler:"Enable scheduler",startScanLoop:"Start scan loop",tickInterval:"Tick interval (ms)",tickHint:"How often the scan loop checks due bindings. Default 60000.",defaultInterval:"Default binding interval (min)",defaultIntervalHint:"Minutes between ticks when a binding didn't specify one. Default 15.",runtimeCard:"Runtime caps",runtimeDesc:"Limits for Agim Agent tool calls and retries. Leave blank to use defaults.",toolResultCap:"Max tool-result chars",toolResultCapHint:"AGIM_NATIVE_TOOL_RESULT_MAX_CHARS. Truncates + appends a note. Default 64000.",toolTimeoutMs:"Per-tool timeout (ms)",toolTimeoutHint:"AGIM_NATIVE_TOOL_TIMEOUT_MS. Default 60000 (60 s).",blankRetryMax:"Blank-response retries",blankRetryHint:"AGIM_NATIVE_BLANK_RETRY_MAX. Times to retry when the model returns empty text. Default 1.",lengthRecoveryMax:"Length-truncation continues",lengthRecoveryHint:"AGIM_NATIVE_LENGTH_RECOVERY_MAX. Times to auto-continue on finishReason=length. Default 1.",a2aCard:"A2A sub-agent delegation",a2aDesc:"Controls for model-triggered `mcp__agim__call_agent`, including depth and timeout limits. Agim→Agim calls use the built-in fast path by default.",a2aMaxDepth:"Max recursion depth",a2aMaxDepthHint:"AGIM_A2A_MAX_DEPTH. Hard cap on nested call_agent chains. Default 1.",a2aTimeoutMs:"Default timeout (ms)",a2aTimeoutMsHint:"AGIM_A2A_TIMEOUT_DEFAULT_MS. Default 1800000 (30 min).",callAgentInProcess:"Agim→Agim built-in path",callAgentInProcessHint:"AGIM_NATIVE_CALL_AGENT_IN_PROCESS. Off falls back to the CLI subprocess. Default on.",callAgentMaxPerTurn:"Calls per turn cap",callAgentMaxPerTurnHint:"AGIM_NATIVE_CALL_AGENT_MAX_PER_TURN. 0 = unlimited. Default 2.",criticCard:"Early stop and critic",criticDesc:"Semantic stuck-loop kills 3-strike same-intent across tools. Critic is an opt-in goal-divergence detector.",semanticStuckLoop:"Semantic stuck-loop",semanticStuckLoopHint:"AGIM_NATIVE_SEMANTIC_STUCK_LOOP. Enabled by default. Turn off to disable semantic cross-tool deduplication.",criticEnabled:"Goal critic",criticEnabledHint:"AGIM_NATIVE_CRITIC. Off by default; on enables off-track early-stop reviews.",criticRole:"Critic LLM role",criticRoleHint:"AGIM_NATIVE_CRITIC_ROLE. Optional override (else uses main API).",planModeDefault:"PlanMode default state",planModeDefaultHint:"AGIM_NATIVE_PLAN_MODE. Default off; `/plan on` toggles per-thread regardless.",planIntentAuto:"Auto-enter plan mode",planIntentAutoHint:"AGIM_PLAN_INTENT_AUTO. When on, a prompt containing 先想想 / plan only / don't act yet temporarily enables plan mode for THAT turn only. Never auto-exits — user must /plan off or model must call native_exit_plan_mode.",planIntentPhrases:"Plan-intent phrase list (optional override)",planIntentPhrasesHint:"AGIM_PLAN_INTENT_PHRASES. Comma-separated. Empty = use built-in CN/EN defaults. Matching is case-insensitive substring.",compactCard:"Auto-compaction",compactDesc:"Summarize older turns when the conversation gets long, while preserving recent messages and the original goal context.",compactTriggerChars:"Trigger chars",compactTriggerCharsHint:"AGIM_NATIVE_COMPACT_TRIGGER_CHARS. Set 0 to disable. Default 60000.",compactKeepTurns:"Keep last N pairs",compactKeepTurnsHint:"AGIM_NATIVE_COMPACT_KEEP_TURNS. Tail size in user/assistant turns. Default 6.",compactKeepFirst:"Keep first N user msgs",compactKeepFirstHint:"AGIM_NATIVE_COMPACT_KEEP_FIRST. Preserves the earliest user goals. Default 1.",compactSummaryChars:"Summary char cap",compactSummaryCharsHint:"AGIM_NATIVE_COMPACT_SUMMARY_CHARS. Cap on the LLM-generated summary. Default 1500.",streamCard:"Streaming and iteration",streamDesc:"Streaming preserves partial text on IM's 30-min hard timeout. Max-iter is the worst-case tool-call ceiling.",streamPartial:"Stream partial",streamPartialHint:"AGIM_NATIVE_STREAM_PARTIAL. Default on; off uses legacy non-stream path.",maxIter:"Max iterations",maxIterHint:"AGIM_NATIVE_AGENT_MAX_ITER. Clamped to [1,100]. Default 50."},bC={title:"Web search providers",subtitle:"Provider chain for native_web_search. On errors, requests fall through to the next provider. Clear a key to remove it; type to overwrite. Changes apply immediately.",refresh:"Refresh",save:"Save",discard:"Discard",unsaved:"Unsaved changes",savedToast:"Saved. Next search will use the new chain.",chainLabel:"Active chain:",chainEmpty:"no providers available",chainHint:"Resolved from AGIM_WEB_SEARCH_PROVIDERS; only entries whose available() is true appear.",configured:"configured",missingKey:"missing key",noKey:"no key needed",moveUp:"Move up",moveDown:"Move down",testBtn:"Test",clearKey:"Clear",placeholderConfigured:"Saved (hidden) — leave blank to keep",placeholderEnter:"Enter new key",keyHint:"On Save, value is written to ~/.agim/env under {{envKey}}.",testOk:"{{provider}} ✓ {{hits}} hits / {{ms}} ms",testFail:"{{provider}} ✗ {{error}}"},vC={title:"Mobile sign-in QR",subtitle:"Generate a single QR code an operator can scan with a phone to open /m/chat. The scanned URL carries a fresh role=user token; on first scan the phone gets an auth cookie and lands inside the mobile chat.",generateCard:"Generate QR",generateDesc:"Each click mints a NEW token (the previous QR keeps working until you revoke it). Operators with phones already signed in are not affected.",hostLabel:"Override host (optional)",hostPlaceholder:"leave blank to auto-detect",hostHint:"By default the URL uses the same hostname:port this admin tab opened on. Override if your phone reaches agim via a different domain (e.g. cloudflared tunnel).",generate:"Generate QR",regenerate:"Regenerate",generating:"Generating…",generatedToast:"QR generated. Scan within sight of the screen.",scanCard:"Scan from your phone",scanDesc:"Open the phone camera, point it at the QR. The phone will sign in once and stay signed in until the token is revoked.",tokenLabel:"Label",urlLabel:"Embedded URL",urlHint:"Anyone with this URL can sign in as the user role. Keep it private; treat it like a password.",tokenIdLabel:"Token id",tokenIdHint:"Use this to find the token in the security page when you want to revoke it.",warningTitle:"Treat the QR like a password.",warningBody:"Scanned tokens persist until revoked. If a phone is lost, revoke the matching mobile-via-qr-* token in Security.",revokeLink:"Manage / revoke tokens →",copied:"URL copied",copyFailed:"Copy failed; long-press the URL field instead.",showUrl:"Show URL",hideUrl:"Hide URL",copyUrl:"Copy URL",qrAlt:"QR code for mobile chat sign-in"},xC={title:"System Prompt Skill Injection",subtitle:"Tune the skill summary block injected into every system prompt. When the override file is non-empty, it replaces the auto-generated block (routing header and always-on skill bodies are still preserved).",autoLabel:"Auto-generated (read-only preview)",overrideLabel:"Operator override (saved on Save)",overridePlaceholder:"Leave empty to use auto. Common pattern: copy auto above, prune families you don't need, or prepend routing hints at the top.",overrideActive:"Override active",overrideInactive:"Auto-generated",largeWarn:"Large block — watch your token budget",copyToOverride:"Copy to override",save:"Save",clear:"Clear override",savedToast:"Saved. Next turn picks it up.",clearedToast:"Override cleared. Back to auto.",refreshedToast:"Auto preview refreshed.",rebuild:"Rebuild auto block",rebuildTooltip:"Rescan all SKILL.md on disk and regenerate the auto-generated block above (override below is unaffected).",rebuiltToast:"Rescanned and rebuilt the auto-generated block. Picks up next turn.",overLimitToast:"Body is {{len}} chars, over the {{max}} limit",confirmClear:"Delete the override file and revert to auto-generated?",hint:"No restart needed; the next system-prompt build reads the latest content."},wC={title:"agim Skills",tab:{overview:"Overview",installed:"Installed",hot:"skillhub Hot",injection:"Prompt Injection"},overview:{title:"Skills overview",subtitle:"Manage the skills the Agent can read, external skill sources, and the summary injected into each turn.",ready:"Ready",needsAttention:"{{count}} needs attention",refresh:"Refresh",cards:{installed:{title:"Installed skills",detail:"{{workspace}} workspace · {{builtin}} builtin",action:"Manage"},availability:{title:"Dependency check",ready:"Skill dependencies are ready",missing:"{{count}} skill(s) missing dependencies",action:"Review"},hot:{title:"Hot skills",ready:"{{count}} available to browse",stale:"Showing cached results",error:"Could not load right now",action:"Browse"},injection:{title:"Agent visibility",autoValue:"Auto",overrideValue:"Override",autoDetail:"{{always}} always-on · {{chars}} chars summary",overrideDetail:"{{chars}} chars in override",action:"Tune"}},next:{fixUnavailable:{title:"Fix unavailable skills first",detail:"Some skills are missing commands or environment variables, so the Agent cannot use them reliably yet."},browseHot:{title:"Pick a hot skill to try",detail:"There are no workspace skills yet; start from common capabilities."},reviewOverride:{title:"Review prompt injection override",detail:"A custom injected block is active; make sure it still matches the current skill library."},manageInstalled:{title:"Review installed skills",detail:"The skill library is healthy; open the list to inspect, edit, or create skills."},createSkill:{title:"Create the first skill",detail:"No skills are available yet; create a workspace skill from the Installed page."}},views:{title:"Common entries"}},group:{framework:"Framework (agim-*)",builtin:"Agim builtin (non-ECC)",workspace:"Workspace (operator-installed)",eccPicks:"ECC recommended picks",eccRemainder:"ECC remainder"},searchPlaceholder:"Filter skills by name or description...",searchEmpty:"No matching skills.",reload:"Reload from disk",subtitle:"SKILL.md files loaded by src/core/skills/loader.ts. Tier-1 summary (name + description) is auto-injected into every agent system prompt; full body is read on-demand via mcp__agim__read_skill. Workspace skills shadow bundled builtin skills by name.",reloadedToast:"Reloaded — {{count}} skill(s) on disk",selectHint:"Select a skill on the left, or click New to create one.",emptyList:"No skills loaded. Click New to create one (lands at ~/.agim/skills/<name>/SKILL.md).",unavailable:"unavailable",alwaysOn:"always-on",sourceWs:"ws",sourceBuiltin:"builtin",notFound:"Not found.",sourceWorkspace:"workspace",sourceBuiltinReadonly:"builtin (read-only via UI)",builtinShadowHint:"Builtin shown for reference. Save creates a workspace shadow that overrides it.",delete:"Delete",save:"Save",saveShadow:"Save (create workspace shadow)",savedToast:'Saved "{{name}}"',deleteConfirm:'Delete workspace skill "{{name}}"? The builtin (if any) will become visible again.',deletedToast:'Deleted "{{name}}"',new:"New",newTitle:"New skill",newName:"Skill name",newNamePlaceholder:"my-skill",newCreate:"Create",createdToast:'Created "{{name}}"',nameRequired:"name required",invalidNameChars:"Name may only use letters, numbers, and . _ -",pathLabel:"Workspace path:",binsLabel:"Required bins:",envLabel:"Required env:",none:"none"},kC={pageTitle:tC,subtitle:nC,navigation:rC,tabs:iC,start:oC,agents:aC,policy:sC,messengers:lC,email:cC,viewerSettings:uC,workspaces:dC,service:fC,security:hC,admins:pC,llm:mC,mcp:gC,nativeAgent:yC,search:bC,mobile:vC,skillInjection:xC,agimSkills:wC},SC="设置",AC="运维配置:环境变量与服务生命周期。",CC={recommended:"优先",groups:{start:"开始",core:"核心连接",capabilities:"扩展能力",operations:"运维安全"}},EC={start:"开始",messengers:"IM 平台",email:"邮件 (SMTP)",viewer:"Viewer & 地图",agents:"Agents",llm:"Agim Agent",mcp:"MCP 服务器",nativeAgent:"Agim Agent",search:"Web 搜索",mobile:"手机端",agimSkills:"agim Skills",policy:"策略",security:"安全",workspaces:"成员与限流",admins:"管理员",env:"环境变量",service:"服务"},RC={title:"开始使用",subtitle:"按这个顺序完成即可:先确认 Web 对话可用,再整理 Agent,最后接入 IM。",unknown:"未选择",actions:{chat:"打开对话",refresh:"刷新状态"},state:{done:"已就绪",todo:"待处理",warn:"需处理",loading:"读取中"},steps:{web:{title:"Web 对话",ready:"服务正在运行:{{mode}}",needsStart:"服务未运行;先启动服务再对话。",action:"打开对话"},agent:{title:"当前 Agent",ready:"{{agent}} 在线",offline:"{{agent}} 未就绪",selected:"已选择 {{agent}},等待运行状态。",empty:"尚未选择默认 Agent。",action:"管理 Agent"},llm:{title:"Agim Agent API",ready:"已有 {{count}} 个可用 API。",empty:"未配置模型 API;配置后可不依赖外部 Agent CLI。",action:"配置 API"},im:{title:"连接 IM",ready:"已连接:{{platforms}}",empty:"还未连接 IM;Web 跑通后再接入。",action:"连接 IM"}},deploy:{title:"长期运行",detail:"准备对外使用时,再检查端口、重启和后台服务状态。",action:"查看服务"}},PC={title:"Agents",subtitle:"这里管理桥接的外部 Agent(CLI / ACP)。Agim Agent 是系统内置默认 Agent,在「Agim Agent」页通过大模型 API 配置。",installHint:"未安装。在宿主机执行 `npm install -g {{pkg}}`。",nativeInstallHint:"Agim Agent 尚未配置大模型 API。前往 设置 → Agim Agent 添加一个 API(OpenAI / DeepSeek / Anthropic 等)即可使用。",inProcessBadge:"内置",inProcessHint:"内置运行 — 在 agim 进程内执行,无需安装外部 CLI",agimAgentCardTitle:"Agim Agent(系统内置默认Agent)",agimAgentCardDesc:"Agim Agent 运行在 agim 进程内,通过你配置的大模型 API 提供能力;与本页桥接的外部 Agent 是两类能力。",agimAgentCardAction:"打开 Agim Agent 配置",aliasesLabel:"别名",online:"在线",offline:"未就绪",defaultAgent:"默认 Agent",defaultAgentHint:"意图分类无判定时使用(新建 web 线程等)。下拉只列出已启用且在线的 Agent。",noEligible:"无可选默认",saveBtn:"保存",saving:"保存中…",dirtyHint:"有未保存改动",discard:"放弃改动",toast:{saved:"已保存"},acp:{title:"远程 Agent (ACP)",subtitle:"通过 Agent Communication Protocol 接入的 HTTP Agent。每个条目持久化到 config,下次服务重启时注册。",discoverBtn:"批量发现",runDiscover:"探测",baseUrl:"发现地址",baseUrlHint:"探测 `<base>/.well-known/acp` 并追加返回的 Agent;同名条目自动跳过。",addTitle:"新增 Agent",name:"名称",nameHint:"稳定标识;只允许 字母 数字 `._-`。",aliases:"别名",aliasesHint:"逗号分隔;在 IM 内通过 `/alias` 路由。",endpoint:"Endpoint",endpointHint:"Agent 的 ACP 根路径(不带尾部 `/`)。",authType:"鉴权",auth:{none:"无",apikey:"API key",bearer:"Bearer"},token:"Token",tokenPlaceholder:"粘贴 token",testBtn:"测试",addBtn:"新增",removeBtn:"移除",on:"已启用",off:"已停用",dupName:"已存在同名 Agent。",empty:{title:"暂无远程 Agent",description:"下方填写 ACP endpoint 新增,或使用「批量发现」自动从 `.well-known/acp` 导入。"},toast:{staged:"已暂存,点击「保存」生效。",testOk:"已联通 `{{name}}`",testMasked:"Token 是掩码态,请先保存后再测试。",discoverEmpty:"没有可新增的 Agent。",discoverAdded_one:"已新增 {{count}} 个 Agent。",discoverAdded_other:"已新增 {{count}} 个 Agent。"}}},TC={title:"策略与开关",subtitle:"高频切换的开关,底层操作的是 env 值。每个开关变更后立即持久化;多数模块支持热加载,少数需要等下次服务重启。",savingToast:"已保存",safety:{title:"跳过权限确认(危险)",description:"打开后,Claude Code 适配器会向 CLI 传递 `--dangerously-skip-permissions`,跳过所有工具调用确认。生产环境强烈建议保持关闭;仅在隔离的可信工作区内启用。",envKey:"AGIM_DANGEROUSLY_SKIP_PERMISSIONS",tagWarn:"生产部署建议保持关闭"},approval:{title:"审批超时默认行为",description:'当 pending 的工具调用无人响应而超时时审批 bus 的行为。`拒绝` 是安全默认值,会让 Bash / Edit / Write 等写入调用保持阻断;`放行` 是"用户离开"模式,让 Agent 继续运行。',envKey:"AGIM_TIMEOUT_DEFAULT",valDeny:"超时拒绝",valAllow:"超时放行"},memory:{title:"长期记忆",description:"每用户记忆子系统(事实 + persona + 向量检索)的总开关。关闭后停止抽取新事实和 persona 整理;已有数据保留在磁盘。",envKey:"AGIM_MEMORY_ENABLED"},viewer:{title:"长消息查看器",description:"打开后,超过阈值的 IM 回复会被上传到本地 paste 存储,IM 消息变成一个可点击的短链。关闭则消息会被 IM 平台截断。",envKey:"AGIM_VIEWER_ENABLED"},a2aNotify:{title:"A2A 通知模式",description:"Agent 间互相调用时 bus 的提示详细程度。`essential`(默认)仅发关键事件;`verbose` 包含每次状态切换;`off` 完全静默跨 Agent 通知。",envKey:"AGIM_A2A_NOTIFY_MODE",valEssential:"关键事件",valVerbose:"详细",valOff:"关闭"}},IC={title:"IM 平台",subtitle:"各 IM 平台的连接配置。打开开关、填写凭据、保存;下次服务重启即生效。",quick:{title:"连接一个 IM",subtitle:"先选一种接入方式。微信走扫码;飞书、钉钉等需要在对应开放平台创建应用并填写凭据。",connectedTitle:"IM 已连接",connectedBadge:"已就绪",nextBadge:"下一步",connectedDetail:"当前已连接:{{platforms}}。可以回到 Web 对话验证,也可以继续添加其他 IM。",webChat:"打开对话",addAnother:"继续添加",scanWechat:"扫码连接微信",configurePlatform:"配置 {{platform}}",option:{wechat:{title:"微信扫码",detail:"最快体验路径。用手机微信扫码确认,适合个人或小团队先跑通。"},feishu:{title:"飞书应用",detail:"适合企业群聊。需要 App ID、App Secret 和消息权限。"},dingtalk:{title:"钉钉 Stream",detail:"适合企业群聊。需要钉钉 Stream API 的客户端凭据。"},telegram:{title:"Telegram Bot",detail:"适合海外或公开群组。需要 BotFather 生成的 Bot Token。"},discord:{title:"Discord Bot",detail:"适合社区频道。需要 Bot Token 并邀请机器人进频道。"}}},saveAll:"全部保存",saving:"保存中…",savedToast:"配置已保存",discardAll:"放弃改动",dirtyHint:"有未保存的改动",apply:{title:"让 IM 配置生效",badge:"需要重启",restartDetail:"已保存。重启 Agim 后会连接已启用的 IM。",startDetail:"已保存。启动 Agim 后会连接已启用的 IM。",restart:"重启 Agim",start:"启动 Agim",restarting:"正在重启…",starting:"正在启动…",appliedToast:"IM 配置已生效。"},platform:{wechat:"微信",telegram:"Telegram",feishu:"飞书",dingtalk:"钉钉",discord:"Discord"},hint:{wechat:'基于 iLink 的扫码登录。点击 "扫码登录",用手机微信扫码并在弹窗中确认;机器人以该微信账号登录。',telegram:"@BotFather 申请的 Bot Token;Channel ID 可选,仅用于定向到特定群组。",feishu:"飞书开放平台的应用凭据。应用需开启消息权限。",dingtalk:"钉钉开发者后台的 Stream API 客户端凭据。",discord:"Discord 开发者门户的 Bot Token。需将机器人邀请到目标频道。"},enabled:"已启用",disabled:"未启用",scanQr:"扫码登录",fields:{botToken:"Bot Token",appId:"App ID",appSecret:"App Secret",clientId:"Client ID",clientSecret:"Client Secret",channelId:"Channel ID"},dingtalk:{dmPolicy:"私聊访问策略",groupPolicy:"群聊访问策略",allowFrom:"私聊白名单(staffId,英文逗号分隔)",groupAllowFrom:"群聊白名单(staffId,英文逗号分隔)",ackReaction:"ack 反馈方式",policy:{open:"开放(任何人都能对话)",pairing:"配对(第一个私聊用户会被锁定)",allowlist:"白名单(仅允许名单中的 ID)",disabled:"禁用(忽略群聊消息)"},ack:{off:"off — 不发标记",emoji:"emoji ⏳→✅",kaomoji:"kaomoji(纯文本颜文字)"},accountsTitle:"多账号 / 多机器人",accountDisabled:"已禁用",accountsHint:"每个 entry 启动独立的 DWClient,dmPolicy / allowFrom / ack-reaction 全部隔离。保存后请重启 agim 让新账号生效。",accountsEmpty:"还没有额外账号。点「+ 添加账号」接入另一个钉钉机器人。",addAccount:"添加账号",accountName:"显示名(可选)",accountRenameCollision:'已存在 id 为 "{{id}}" 的账号;请换一个 id。'},qr:{title:"扫码登录微信",description:"打开手机微信扫一扫这个二维码,然后在微信内确认登录。",starting:"正在启动 QR 会话…",loadFailed:"QR 启动失败",expired:"二维码已过期 — 关闭并重新发起。",cancelled:"已取消。",confirmed:"登录成功 — wechat-ilink 将在下次服务重启后启用。"}},LC={title:"邮件 (SMTP)",subtitle:"用于 `/remind email me@x.com …` 的对外邮件投递。凭据保存在 `~/.agim/.env`,留空即停用。",cardTitle:"SMTP 凭据",statusOn:"已配置",statusOff:"未配置",host:"Host",hostHint:"邮件服务器域名(如 `smtp.gmail.com`)。",port:"Port",portHint:"通常 465 (SSL) 或 587 (STARTTLS)。",user:"用户名",userHint:"登录邮箱;通常也是发件人地址。",pass:"密码 / 应用 Token",passHint:"保存到 `~/.agim/.env`(chmod 600)。默认遮罩,按「显示」可查看。",from:"发件人",fromHint:"发件 header;为空则使用用户名。",secure:"TLS 模式",secureHint:"`auto` 按端口判定;如运营商要求可强制 SSL 或 STARTTLS。",secureAuto:"auto(按端口)",secureTrue:"true(SSL,对应 465)",secureFalse:"false(STARTTLS,对应 587)",reveal:"显示",hide:"隐藏",testBtn:"测试连接",testNeedsConfigured:"请先保存 host / user / password。",disableBtn:"停用 SMTP",saveBtn:"保存",saving:"保存中…",discard:"放弃改动",toast:{saved:"SMTP 已保存",disabled:"SMTP 已停用",noChanges:"无可保存的改动"}},OC={title:"Viewer & 地图",subtitle:"公开访问的两个外设:长消息 Viewer(超过阈值的回复转成 `/v/<id>` 短链)+ Baidu Maps AK(驱动 `/memo` 地址解析)。",reveal:"显示",hide:"隐藏",save:"保存",saving:"保存中…",discard:"放弃改动",dirtyHint:"有未保存改动",toast:{saved:"Viewer 设置已保存"},viewer:{title:"Viewer(长消息短链)",subtitle:"超过字符 / 行数阈值的回复会被上传到本地 paste 存储,IM 消息变成一条 `/v/<id>` 短链。",on:"已启用",off:"未启用",enableLabel:"启用长消息 Viewer",publicUrl:"公开基础 URL",publicUrlHint:"反代 / 隧道暴露给外网的地址。用于拼接 `/v/<id>` 短链。",remotePasteUrl:"远端 paste URL",remotePasteUrlHint:"POST markdown 到这个地址换公网链接;优先级高于 Public base URL 和 quick 隧道。留空使用社区默认 https://viewer.iclaw.host/paste。",remotePasteToken:"远端 paste Bearer Token",remotePasteTokenHint:"可选;只在你的 paste 服务要求鉴权时需要填。",noDefaultRemote:"禁用社区默认",noDefaultRemoteLabel:"未配置任何模式时不回退到 viewer.iclaw.host",noDefaultRemoteHint:"未配置任何模式时,agim 会回退到 viewer.iclaw.host。勾选后可关闭该回退(此时长内容会直接内联展示)。",tunnelMode:"隧道模式",tunnelOff:"关闭(使用上方公开 URL)",tunnelQuick:"quick(cloudflared 临时隧道)",tunnelHint:"`quick` 会本地拉起 Cloudflare quick tunnel;当运营商自己没有反代 agim 时启用。",tunnelStatus:"隧道状态",refreshTunnel:"刷新",tunnelRunning:"运行中",yes:"是",no:"否",tunnelUrl:"实时 URL",effectiveUrl:"生效 URL",binary:"cloudflared 二进制",binaryMissing:"PATH 中未找到 — 请从 cloudflare/cloudflared releases 安装",lastError:"最近一次错误",tunnelLoading:"正在加载隧道状态…",thresholds:"路由阈值",chars:"字符上限",charsHint:"回复超过此长度走 Viewer。",lines:"行数上限",linesHint:"相同的路由判定,按行数。",codeLines:"代码行数上限",codeLinesHint:"代码块内回复的更低阈值。",maxPastes:"Paste 存储上限",maxPastesHint:"超过此数量后按 FIFO 淘汰旧 paste。"},baidu:{title:"Baidu Maps AK",subtitle:"启用 `/memo` 的地址→坐标解析。不配置 AK,/memo 仍可通过裸坐标或浏览器 GPS 分享工作。免费 AK:lbsyun.baidu.com → 控制台 → 应用管理 → 创建应用 → 服务端 API。",configured:"已配置",empty:"未配置",placeholder:"32 位 AK,首字符非数字",hint:"保存到 `~/.agim/.env`(chmod 600),默认遮罩,按「显示」可查看。",suspicious:"AK 长度为 {{length}},通常 Baidu AK 是 32 位 — 请核对。",clear:"清除 AK",toast:{saved:"Baidu Maps AK 已保存",cleared:"Baidu Maps AK 已清除"}}},DC={title:"访问域",subtitle:"按用户、团队或客户划分可用 Agent 与调用频率。`default` 承接所有未匹配的用户。",empty:{title:"只有默认访问域",description:"在下方添加访问域,可按团队 / 项目 / 客户分隔可用 Agent 与调用频率。"},col:{id:"ID",name:"名称",agents:"Agent 白名单",members:"成员",rateLimit:"限流"},rateLimitFormat:"{{rate}} / {{intervalSec}}s,突发 {{burst}}",membersOpen:"开放(任何用户)",membersCount_one:"{{count}} 位成员",membersCount_other:"{{count}} 位成员",edit:"编辑",remove:{label:"删除",ariaLabel:"删除 {{id}}",confirm:"删除访问域",confirmTitle:"删除访问域 {{id}}?",confirmDescription:"删除后,{{name}} 的成员会回到 default 访问域;该操作会立即生效。"},form:{title:"新增或编辑访问域",subtitleEdit:"编辑已有访问域 — 改 ID 可克隆,保持原 ID 即 upsert。",id:"ID",idHint:"稳定标识符;只允许 [a-zA-Z0-9_-]+;`default` 为保留名。",name:"显示名",agents:"Agent 白名单",agentsHint:"不选择即允许所有已注册 Agent;选择后仅这些 Agent 可用。",emptyAgents:"允许所有已注册 Agent",selectAgents:"选择 Agent",customAgentPlaceholder:"agent-name",agentOnline:"在线",agentOffline:"离线",members:"成员用户 ID",membersHint:"不选择即对所有用户开放;也可手动添加 `platform:userId`。",emptyMembers:"对所有用户开放",selectMembers:"选择成员",customMemberPlaceholder:"platform:userId",memberLastSeen:"最近出现:{{time}}",memberFromScope:"来自访问域:{{scope}}",selectedCount:"已选 {{count}}",noChoices:"暂无可选项",addCustom:"添加",removeSelected:"移除 {{value}}",rateLimit:"限流(可选)",ratePresetHint:"选择「默认」时使用系统默认限流;也可以直接修改下方数字。",ratePresets:{default:"默认",strict:"严格",busy:"宽松"},ratePresetDescriptions:{default:"系统默认 10/60s · 突发 15",strict:"3/60s · 突发 5",busy:"30/60s · 突发 45"},rate:"调用数",intervalSec:"周期(秒)",burst:"突发上限",submit:"保存访问域",reset:"清空表单"},toast:{saved:"访问域已保存",deleted:"访问域已删除"}},NC={title:"服务",subtitle:"查看运行中的 agim 进程,并启动 / 停止 / 重启它。",modeLabel:"运行模式",pidLabel:"PID",uptimeLabel:"运行时长",webLabel:"Web 端口",bootPhaseLabel:"启动阶段",mode:{systemd:"systemd",background:"后台",foreground:"前台",none:"未运行"},actions:{start:"启动",stop:"停止",restart:"重启",confirmStop:"停止 agim 服务?",confirmStopDesc:"Web 控制台、消息适配器、所有正在进行的作业都会停止。需要重新启动后才能继续使用。",confirmRestart:"重启 agim 服务?",confirmRestartDesc:"进程会先停止再启动。进行中的作业会被取消;投递队列与已排队的提醒会保留。重启期间 Web 控制台不可达,通常 5-30 秒。"},toast:{started:"服务已启动",stopped:"服务已停止",restarted:"服务已重启"},ports:{title:"端口",subtitle:"agim 启动时监听的端口。留空使用默认值;改动需下次服务重启生效(保存后点下方「重启」按钮)。",webPort:"Web 端口",webPortHint:"聊天 UI + REST API 的 HTTP 服务端口。默认 {{default}}。",acpPort:"ACP 端口",acpPortHint:"Agent Communication Protocol 服务端口(远程 Agent 接入面)。默认 {{default}}。",invalidPort:"需为 1-65535 之间的数字。",restartRequired:"需重启生效",save:"保存",saving:"保存中…",discard:"放弃改动",toast:{saved:"端口已保存 — 重启 agim 以绑定新端口"}},recovery:{title:"故障恢复",refreshLog:"刷新日志",state:{loading:"检查中",running:"运行中",booting:"启动中",stopped:"未运行"},detail:{loading:"正在读取服务状态与最近日志。",running:"服务正在运行。若对话、IM 或 Agent 异常,先查看最近日志或运行本机体检。",booting:"服务已启动,但仍处于 {{phase}} 阶段。等待片刻;若持续不变,查看最近日志。",stopped:"服务未运行。点击上方「启动」后,观察最近日志是否继续刷新。"},commands:{doctor:"本机体检",status:"服务状态",tail:"查看日志",tailPending:"日志未生成",tailChecking:"正在检查日志文件。",tailPendingDetail:"首次后台启动服务后会自动创建。"},truncated:"仅显示尾部",logMissing:"日志文件还不存在;服务首次后台启动后会创建。",logEmpty:"日志为空。",toast:{copied:"已复制命令",copyFailed:"复制失败"}}},MC={title:"安全",subtitle:"对外使用前,先确认谁能访问 bot、谁能管理,以及高风险工具是否收紧。",posture:{title:"安全状态",loading:"读取中",ready:"适合对外使用",needsAction:"{{count}} 项需处理",detail:"先处理这里的建议,再把服务接到公开 IM 或反向代理。",readyDetail:"关键门禁已就绪;高级选项可按部署环境继续微调。",issue:{skipPermissions:{title:"Agent 跳过权限确认已开启",detail:"这会绕过工具调用确认,只建议在隔离环境临时使用。",action:"关闭"},senderOpenImplicit:{title:"IM 发送方当前开放",detail:"任何能触达 bot 的账号都能发起对话;对外使用前建议限制到可信用户。",action:"配置门禁"},senderOpenExplicit:{title:"IM 发送方显式开放",detail:"已选择所有人可用;如果准备接入公开群或公网入口,建议改为限制名单。",action:"配置门禁"},adminEmpty:{title:"尚未配置 IM 管理员",detail:"IM 侧无法安全执行管理员命令;先让管理员发一条消息,再授予权限。",action:"去配置"},envPerms:{title:"env 文件权限过宽",detail:"当前权限是 {{mode}},建议改为 600,避免 token 或密钥被其他用户读取。"},root:{title:"服务正在以 root 运行",detail:"工具调用会继承 root 权限;生产环境建议使用独立系统用户运行。"},privateWeb:{title:"Native web 允许访问所有私网",detail:"这会放宽 SSRF 防护;仅内网可信部署才建议打开。",action:"关闭"},fsOpen:{title:"Native 文件系统未限制到 workspace",detail:"默认可读写非敏感路径;对外使用前建议限制到 Agent 工作区。",action:"限制到 workspace"}}},diagnostics:{title:"运行时诊断",summary:"排查问题时展开查看;日常先看上方状态即可。",advanced:"高级",runningAsRoot:"以 root 运行",runningAsRootHelp:"tool 调用会拿到 root 权限。建议在 systemd unit 设 User=agim 后重启。",envFilePerms:"env 文件权限",envFilePermsLax:"过宽(group/world 可读)",envFilePermsOk:"0600(仅 owner 可读写)",bwrapAvailable:"bubblewrap 已装",bwrapMissing:"未装(apt install bubblewrap)",senderAllowlist:"发送方门禁",senderAllowlistOff:"未配置(开放访问)",senderAllowlistOn:"已配置",adminAllowlist:"管理员清单",adminAllowlistOff:"未配置(首次 setup 后填充)",adminAllowlistOn:"已配置"},sender:{title:"发送方门禁 (谁能跟 bot 说话)",description:"决定谁能向 IM bot 发消息。对外使用建议选择「限制到名单」,并从已感知用户里勾选;个人本机体验可显式开放所有人。",envKey:"AGIM_ALLOWED_USERS",placeholder:"platform:userId,platform:userId",modeRestricted:"限制到名单",modeOpen:"所有人可用",openExplicit:"已显式开放",openImplicit:"当前为空,默认开放",openHint:"所有能触达 IM bot 的用户都可以发起对话。个人体验可以这样用;接入公开群、公司 IM 或公网入口前建议切回限制名单。",emptyMembers:"还没有允许的发送方",chooseMembers:"选择用户",noChoices:"暂无已感知用户",lastSeen:"最近出现:{{time}}",fromCurrentValue:"来自当前配置",addCustom:"添加",removeMember:"移除 {{value}}",save:"保存门禁",saved:"已保存",unsaved:"有未保存改动",emptyRestrictedToast:"限制模式下至少选择或添加一个用户。"},exec:{title:"Native exec 工具",description:"对 native_exec 的沙盒与超时控制。每次 exec 调用还会经 IM 审批卡(除非已 autoallow 同 fingerprint)。",sandbox:"沙盒后端",sandboxNone:"无(直接 spawn)",sandboxBwrap:"bubblewrap(Linux only)",sandboxBwrapMissing:"bubblewrap 未装",sandboxNet:"沙盒内网络",sandboxNetOn:"允许(默认)",sandboxNetOff:"禁用(--unshare-net)",timeoutMs:"命令超时(毫秒,默认 60000)",maxOutput:"单流输出上限(字节,默认 32768)"},web:{title:"Native web 工具",description:"SSRF 防护与超时。CIDR 白名单可放行 Tailscale/100.64.0.0/10 这类私网。",allowPrivate:"允许所有私网(不推荐)",allowPrivateHelp:"= 1 时跳过所有私网检查。仅用于受信任的内网部署。",ssrfWhitelist:"SSRF CIDR 白名单",ssrfWhitelistPlaceholder:"100.64.0.0/10,10.20.0.0/16",timeoutMs:"fetch / search 超时(毫秒,默认 30000)"},fs:{title:"Native filesystem 工具",description:"fs 工具默认可访问非敏感路径;开启后限制在 native 当前线程的 workspace 子树内。",restrict:"限制到 workspace",restrictOn:"ON(推荐)",restrictOff:"OFF(允许任意路径;sensitive-paths 黑名单仍生效)",timeoutMs:"fs 工具超时(毫秒,默认 60000)"},delegation:{title:"Native call_agent 上限",description:"一次对话内 mcp__agim__call_agent 允许的最多次数。防止 native 死循环委托给 CLI agent。0 = 无限。",envKey:"AGIM_NATIVE_CALL_AGENT_MAX_PER_TURN",valueLabel:"默认 2"},platformBlacklist:{title:"IM 平台黑名单",description:"逗号分隔的 IM 平台 id,列入后:CLI 向导不显示、web 后台不出现、注册时被直接拒绝。即使凭证仍在 env 文件里,进程也不会拉起这个适配器。默认空(不拦截)。常见 id:wechat-ilink / telegram / feishu / dingtalk / discord / email。",envKey:"AGIM_PLATFORM_BLACKLIST",placeholder:"telegram,discord",currentLabel:"当前生效"},diagnosticsPlatformBlacklist:"IM 平台黑名单",savingToast:"已保存。",resetTitle:"清空 (使用默认值)"},_C={title:"IM 管理员名单",subtitle:"Web 管理员 token 决定谁可以执行 IM 管理员级命令。IM 候选用户在与 agim 对话后会自动出现在这里,可直接授予管理员。",configured:"名单已配置",notConfigured:"尚未配置任何 IM 管理员。",empty:"暂无管理员。",col:{platform:"平台",userId:"用户 ID"},known:{title:"已感知 IM 用户",hint:"用户给 agim 发过消息后会自动出现在此列表,可直接设为管理员。",count:"已感知用户:{{count}}",empty:"暂无已感知 IM 用户。",emptyHint:"请先让该用户给 agim 发送一条消息。",col:{lastSeen:"最近出现时间"},promote:"设为管理员",alreadyAdmin:"已是管理员"},remove:{label:"移除",confirmTitle:"确认移除该管理员?",confirmDescription:"该用户将失去所有管理员命令访问权限。可再次添加恢复。"},toast:{added:"已添加",removed:"已移除"}},jC={title:"Agim Agent配置",subtitle:"先配置一个大模型 API,让 Agim Agent 跑起来;多 API、角色绑定与运行参数可在高级设置中调整。API Key 会保存到 ~/.agim/llm-secrets.json(0600)或 AGIM_LLM_SECRET_<NAME> 环境变量。",refresh:"刷新",next:{emptyTitle:"先完成上方保存并测试",emptyDetail:"测试通过后,Agim 会自动绑定默认角色并把 Agim Agent 设为默认 Agent。",title:"下一步:发一条消息",backendBadge:"当前 {{backend}}",detail:"在对话里可以查看和切换本会话使用的模型 API。",chat:"打开对话",im:"连接 IM"},advanced:{title:"高级设置",badge:"可选",subtitle:"管理多个 API、角色绑定、工具审批、上下文压缩、A2A、通知评估器和心跳。",show:"展开高级设置",hide:"收起高级设置"},quick:{title:"快速启用 Agim Agent",subtitle:"选择供应商并粘贴 API Key;Agim 会保存 API、绑定默认角色,并做一次连通测试。",readyTitle:"Agim Agent 已可用",readyBadge:"已启用",enableBadge:"待启用",readyDetail:"当前使用 {{backend}},可以回到 Web 对话测试。",enableDetail:"已有可用 API:{{backend}}。点击启用后会绑定 Agim Agent 并设为默认 Agent。",enableAction:"启用 Agim Agent",chatAction:"打开对话",saveAndTest:"保存并测试",saving:"保存中…",testing:"测试中…",setupDone:"Agim Agent 已启用并测试通过。",enabledToast:"Agim Agent 已启用。",testOk:"连通测试通过:{{ms}}ms",testFailed:"连通测试未通过;API 已保存,可检查 Key、模型或 Base URL。"},backendsTitle:"API ({{count}})",backendsEmpty:"尚未配置大模型 API。请先在下方添加 API。",rolesTitle:"角色绑定(可选,高级)",rolesOptionalHint:"角色绑定是可选增强项;不配置也会自动使用可用 API。",addTitle:"添加 API",col:{name:"名称",provider:"提供商",model:"模型",baseUrl:"Base URL",apiKey:"API Key",actions:"操作"},secretMissing:"缺失",ping:"探测",remove:"删除",pinging:"探测中…",setKeyFirst:"请先设置 API Key",pingHint:"发送一次小型 chat 探测",errorDialog:{title:"探测失败",description:"后端 {{backend}} 返回了错误。",defaultHint:"请检查 API Key、Base URL 与模型名称;错误详情如下。",temperatureHint:"该模型不接受 temperature 参数。Agim 现在只会在你显式配置 temperature 时发送它;请重新探测一次。"},removeConfirm:'删除 API "{{name}}"?角色绑定与 API Key 将被清除。',removedToast:"已删除(同时清除 {{count}} 个角色绑定)。",roleUpdated:"已更新角色 {{role}}",unset:"(未设置)",unbound:"(未绑定)",roleHint:{cheap:"用于记忆提取、意图分类等内置辅助任务。",evaluator:"用于通知评估与路由对比。","native-chat":"/agim 对话优先角色(/na 仍兼容);不绑定时 Agim Agent 会自动回退到任意可用 API。"},preset:"提供商预设",name:"名称",namePlaceholder:"如 deepseek-cheap",baseUrl:"Base URL",baseUrlPlaceholder:"https://api.example.com/v1",model:"模型",modelPlaceholder:"model-id",apiKey:"API Key",apiKeyPlaceholder:"sk-...",addBackend:"添加 API",invalidPreset:"无效预设",nameRequired:"名称必填",baseUrlRequired:"baseUrl 必填",modelRequired:"model 必填",apiKeyRequired:"API Key 必填",addedWithKey:'已添加 API "{{name}}"',agimAgentRuntimeTitle:"Agim Agent 运行参数",agimAgentRuntimeHint:"下方参数控制 Agim Agent 的行为;上方 API 决定它使用哪个模型。",presets:{deepseek:"DeepSeek",moonshot:"Moonshot Kimi",zhipu:"智谱 GLM",openai:"OpenAI",anthropic:"Anthropic",custom:"自定义"}},FC={title:"外部 MCP 服务器",subtitle:"这些服务器提供的工具会暴露给内置 Agim Agent(命名规则 mcp_<server>_<tool>)。CLI agent 使用各自的 MCP 配置,不会读取此列表。Header 可能包含 Bearer Token — 仅管理员可见。",refresh:"刷新",serversTitle:"服务器 ({{count}})",serversEmpty:"尚未配置 MCP 服务器。请在下方添加 — 常见选择:filesystem、github、postgres。",totalTools:"工具总数:{{count}}",addTitle:"添加服务器",col:{name:"名称",transport:"传输",target:"目标",runtime:"运行时",actions:"操作"},transportStdio:"stdio",transportSse:"SSE",transportHttp:"http",runtimeUnknown:"未知",runtimeConnected:"已连接 · {{count}} 个工具",runtimeConnectedOne:"已连接 · {{count}} 个工具",runtimeDisconnected:"未连接",health:"健康检查",remove:"删除",probing:"探测中…",removeConfirm:'删除 MCP 服务器 "{{name}}"?',removedToast:'已删除 "{{name}}"',nameRequired:"名称必填",commandRequired:"stdio 传输需要 command",urlRequired:"http/sse 传输需要 url",headersInvalid:"headers 必须是合法 JSON",addedToast:'已添加 "{{name}}"',nameLabel:"名称",namePlaceholder:"如 filesystem",transportLabel:"传输",transportStdioOption:"stdio(子进程)",transportHttpOption:"http / SSE",commandLabel:"命令",commandPlaceholder:"如 npx",argsLabel:"参数(空格分隔)",urlLabel:"URL",urlPlaceholder:"https://example.com/mcp",headersLabel:"Headers(JSON,可选)",headersPlaceholder:'{"Authorization":"Bearer …"}',addServer:"添加服务器"},HC={title:"Agim Agent · 评估器 · 心跳",subtitle:"Agim Agent 与两个 LLM 驱动门控(通知评估器、心跳)的运行时行为。大模型 API 与可选角色绑定在本页上方配置。",llmLink:"/settings/llm",refresh:"刷新",unsaved:"有未保存改动",discard:"放弃",save:"保存",savedToast:"已保存。",agentCard:"Agim Agent(系统内置)",evaluatorCard:"通知评估器",heartbeatCard:"心跳调度器",on:"开",off:"关",roleOverride:"角色覆盖",roleHint:"Agim Agent 循环优先解析此角色;若未命中,会自动回退到任意可用 API。角色绑定为可选增强项。",approvalMode:"审批模式",approvalHint:"Agim Agent 循环中工具调用的门控方式。",modeReadOnly:"只读(安全默认)",modeAllowList:"白名单(仅 autoAllow 条目)",modeAllowAll:"全部放行(所有工具)",modeDenyAll:"全部禁止(不允许工具)",autoAllow:"自动允许工具前缀",autoAllowHint:"逗号分隔。名称以任一前缀开头的工具绕过门控(如 native_,mcp_filesystem_)。",denyList:"拒绝列表工具前缀",denyListHint:"逗号分隔。无论模式如何始终拒绝(如 mcp_shell_)。",evalDesc:"过滤例行/空的 agent 主动推送消息的 LLM 门控。使用 evaluator 角色。失败开放:LLM 错误或缺少可用 API → 仍投递消息。",enableGate:"启用门控",filterViaLlm:"通过 LLM 过滤",evalSources:"门控来源",evalSourcesHint:"逗号分隔子集:push, notify, reminder, heartbeat。留空 = 默认 push,heartbeat。",hbDesc:"周期性主动唤醒循环。关闭后 /heartbeat bind 仍可保存绑定,但不执行扫描。三阶段 tick:DECIDE → EXECUTE → EVALUATE。",enableScheduler:"启用调度器",startScanLoop:"启动扫描循环",tickInterval:"Tick 间隔(毫秒)",tickHint:"扫描循环检查到期绑定的频率。默认 60000。",defaultInterval:"默认绑定间隔(分钟)",defaultIntervalHint:"绑定未指定时的 tick 间隔。默认 15。",runtimeCard:"运行参数上限",runtimeDesc:"Agim Agent 工具调用与重试的上限控制。留空使用默认值。",toolResultCap:"单次工具返回最大字符",toolResultCapHint:"AGIM_NATIVE_TOOL_RESULT_MAX_CHARS。超出截断+附说明。默认 64000。",toolTimeoutMs:"单次工具超时(毫秒)",toolTimeoutHint:"AGIM_NATIVE_TOOL_TIMEOUT_MS。默认 60000(60 秒)。",blankRetryMax:"空响应重试上限",blankRetryHint:"AGIM_NATIVE_BLANK_RETRY_MAX。模型连续返回空文本时的重试次数。默认 1。",lengthRecoveryMax:"长度截断续写上限",lengthRecoveryHint:"AGIM_NATIVE_LENGTH_RECOVERY_MAX。finishReason=length 时自动续写次数。默认 1。",a2aCard:"A2A 子 Agent 派发",a2aDesc:"模型调用 `mcp__agim__call_agent` 时的深度、超时与单轮上限。agim→agim 默认走内置快速路径。",a2aMaxDepth:"递归深度上限",a2aMaxDepthHint:"AGIM_A2A_MAX_DEPTH。call_agent 嵌套调用最大层数。默认 1。",a2aTimeoutMs:"默认超时(毫秒)",a2aTimeoutMsHint:"AGIM_A2A_TIMEOUT_DEFAULT_MS。默认 1800000(30 分钟)。",callAgentInProcess:"agim→agim 内置快速路径",callAgentInProcessHint:"AGIM_NATIVE_CALL_AGENT_IN_PROCESS。关闭则回退到子进程 CLI。默认开。",callAgentMaxPerTurn:"单轮调用上限",callAgentMaxPerTurnHint:"AGIM_NATIVE_CALL_AGENT_MAX_PER_TURN。0 = 不限。默认 2。",criticCard:"早停与复盘",criticDesc:"语义死循环检测识别「3 次同意图但工具不同」的情形并早停。Critic 是可选的目标偏离检测器。",semanticStuckLoop:"语义死循环检测",semanticStuckLoopHint:"AGIM_NATIVE_SEMANTIC_STUCK_LOOP。默认开启;关闭后不再进行跨工具语义去重。",criticEnabled:"Goal Critic 复盘",criticEnabledHint:"AGIM_NATIVE_CRITIC。默认关;开启后启用目标偏离早停。",criticRole:"Critic LLM role",criticRoleHint:"AGIM_NATIVE_CRITIC_ROLE。可选 override(留空走主 API)。",planModeDefault:"PlanMode 默认状态",planModeDefaultHint:"AGIM_NATIVE_PLAN_MODE。默认关;`/plan on` 在单线程内可独立切换不受此影响。",planIntentAuto:"自动进入 Plan 模式",planIntentAutoHint:"AGIM_PLAN_INTENT_AUTO。开启后,含「先想想 / plan only / 不要直接做」等关键词的 prompt 会临时进入 plan 模式,仅本轮生效;从不自动退出——必须 /plan off 或模型调 native_exit_plan_mode。",planIntentPhrases:"意图关键词列表(可选覆盖)",planIntentPhrasesHint:"AGIM_PLAN_INTENT_PHRASES。逗号分隔。留空则用内置中英文默认列表。匹配方式:大小写不敏感的子串。",compactCard:"自动压缩上下文",compactDesc:"对较早对话做摘要,保留最近几轮消息和最初目标,避免上下文过长。",compactTriggerChars:"触发字符数",compactTriggerCharsHint:"AGIM_NATIVE_COMPACT_TRIGGER_CHARS。设为 0 禁用。默认 60000。",compactKeepTurns:"保留最后 N 对",compactKeepTurnsHint:"AGIM_NATIVE_COMPACT_KEEP_TURNS。tail 保留的 user/assistant 对数。默认 6。",compactKeepFirst:"保留前 N 条 user 消息",compactKeepFirstHint:"AGIM_NATIVE_COMPACT_KEEP_FIRST。保留最早的用户目标。默认 1。",compactSummaryChars:"摘要字符上限",compactSummaryCharsHint:"AGIM_NATIVE_COMPACT_SUMMARY_CHARS。LLM 生成摘要的字符上限。默认 1500。",streamCard:"流式与迭代",streamDesc:"流式回传可在 IM 30 分钟硬超时时保留部分文本。max-iter 是工具循环的最坏上限。",streamPartial:"流式增量回写",streamPartialHint:"AGIM_NATIVE_STREAM_PARTIAL。默认开;关闭走旧的非流式路径。",maxIter:"迭代上限",maxIterHint:"AGIM_NATIVE_AGENT_MAX_ITER。范围 [1,100],默认 50。"},UC={title:"Web 搜索 Provider",subtitle:"native_web_search 工具的后端链路。失败时按顺序回退到下一家。键留空 = 删除该值;填则覆盖。所有修改热生效。",refresh:"刷新",save:"保存",discard:"放弃",unsaved:"有未保存改动",savedToast:"已保存。下一次搜索即生效。",chainLabel:"当前生效链路:",chainEmpty:"无可用 provider",chainHint:"由 AGIM_WEB_SEARCH_PROVIDERS 决定;只列出已启用且 available() 为真的项。",configured:"已配置",missingKey:"缺 API key",noKey:"无需 key",moveUp:"上移",moveDown:"下移",testBtn:"测试",clearKey:"清空",placeholderConfigured:"已保存(隐藏) — 不输入则保留",placeholderEnter:"输入新 key",keyHint:"提交后将以密文写入 ~/.agim/env 的 {{envKey}} 键。",testOk:"{{provider}} ✓ {{hits}} 条结果 / {{ms}} ms",testFail:"{{provider}} ✗ {{error}}"},BC={title:"手机端登录二维码",subtitle:"生成一张二维码,让操作员用手机扫码即可打开 /m/chat。链接里带一次性 role=user token,首次扫码后手机会拿到 cookie 并跳转到手机版聊天界面。",generateCard:"生成二维码",generateDesc:"每次点击会新建 token(旧二维码在被吊销前仍然可用)。已登录的手机不受影响。",hostLabel:"覆盖访问域名(可选)",hostPlaceholder:"留空自动识别",hostHint:"默认沿用当前 admin 页面的域名/端口。如果手机走的是另一个域名(例如 cloudflared 隧道),请在此覆盖。",generate:"生成二维码",regenerate:"重新生成",generating:"生成中…",generatedToast:"二维码已生成,请在屏幕前扫码。",scanCard:"用手机扫码",scanDesc:"打开手机相机对准二维码,首次扫码即完成登录,token 未被吊销前保持登录态。",tokenLabel:"标签",urlLabel:"内嵌 URL",urlHint:"持有此 URL 的人可以以 user 身份登录。请妥善保管,与密码同等敏感。",tokenIdLabel:"Token ID",tokenIdHint:"需要吊销时,在「安全」页按此 ID 定位 token。",warningTitle:"请像对待密码一样保护此二维码。",warningBody:"扫码 token 在被吊销前长期有效。手机丢失时,请到「安全」页吊销 mobile-via-qr-* 标签下的 token。",revokeLink:"管理 / 吊销 token →",copied:"URL 已复制",copyFailed:"复制失败,请长按 URL 字段选中。",showUrl:"显示 URL",hideUrl:"隐藏 URL",copyUrl:"复制 URL",qrAlt:"手机端聊天登录二维码"},zC={title:"系统提示 Skill 注入",subtitle:"调整每轮注入到系统提示的技能摘要块。覆盖文件存在且非空时,会替换自动生成内容(路由头与常驻技能正文仍会保留)。",autoLabel:"自动生成(只读预览)",overrideLabel:"运营者覆盖(保存后生效)",overridePlaceholder:"留空表示使用自动生成。常见做法:从上方复制后删掉不需要的族,或在头部加几行路由提示。",overrideActive:"覆盖生效中",overrideInactive:"使用自动生成",largeWarn:"占用偏大,注意 token 预算",copyToOverride:"复制到下方编辑",save:"保存",clear:"清除覆盖",savedToast:"已保存。下一轮对话生效。",clearedToast:"已清除覆盖。回到自动生成。",refreshedToast:"已刷新自动生成预览。",rebuild:"重建默认注入词",rebuildTooltip:"重新扫描磁盘的所有 SKILL.md,按规则重新生成上方自动注入词(不影响下方覆盖)。",rebuiltToast:"已重新扫描磁盘并按规则生成自动注入词。下次对话生效。",overLimitToast:"内容 {{len}} 字符,超过上限 {{max}}",confirmClear:"清除覆盖文件,回到自动生成?",hint:"保存后无需重启;下一轮系统提示构建会读取最新内容。"},$C={title:"agim Skills",tab:{overview:"总览",installed:"已安装",hot:"skillhub 热门",injection:"系统提示注入"},overview:{title:"Skills 总览",subtitle:"管理 Agent 可读取的技能库、外部技能来源,以及每轮对话会注入的技能摘要。",ready:"已就绪",needsAttention:"{{count}} 项需处理",refresh:"刷新",cards:{installed:{title:"已安装技能",detail:"{{workspace}} 个工作区 · {{builtin}} 个内置",action:"管理"},availability:{title:"依赖检查",ready:"当前技能依赖完整",missing:"{{count}} 个技能缺少依赖",action:"查看"},hot:{title:"热门技能",ready:"{{count}} 个可浏览",stale:"使用缓存结果",error:"暂时无法加载",action:"浏览"},injection:{title:"Agent 可见范围",autoValue:"自动",overrideValue:"覆盖",autoDetail:"{{always}} 个常驻技能 · {{chars}} 字符摘要",overrideDetail:"覆盖内容 {{chars}} 字符",action:"调整"}},next:{fixUnavailable:{title:"先处理不可用技能",detail:"有技能缺少命令或环境变量,处理后 Agent 才能稳定使用。"},browseHot:{title:"从热门技能挑一个试用",detail:"当前还没有工作区技能,可以先看看常用能力。"},reviewOverride:{title:"复核系统提示覆盖",detail:"当前使用自定义注入内容,确认它仍符合新的技能库状态。"},manageInstalled:{title:"查看已安装技能",detail:"技能库状态正常,可以进入列表查看、编辑或新建。"},createSkill:{title:"创建第一个技能",detail:"当前没有可用技能,先进入已安装页新建一个工作区技能。"}},views:{title:"常用入口"}},group:{framework:"Framework(agim-*)",builtin:"Agim 内置(非 ECC)",workspace:"Workspace(运营者亲装业务)",eccPicks:"ECC 推荐池",eccRemainder:"ECC 余下"},searchPlaceholder:"搜索 skill 名称或描述…",searchEmpty:"没有匹配的 skill。",reload:"从磁盘重新加载",subtitle:"由 src/core/skills/loader.ts 加载的 SKILL.md 文件。Tier-1 摘要(name + description)自动注入每个 agent 系统提示;完整正文通过 mcp__agim__read_skill 按需读取。工作区 skill 按名称覆盖内置 skill。",reloadedToast:"已重新加载 — 磁盘上 {{count}} 个 skill",selectHint:"在左侧选择一个 skill,或点击「新建」创建。",emptyList:"尚未加载 skill。点击「新建」创建(保存到 ~/.agim/skills/<name>/SKILL.md)。",unavailable:"不可用",alwaysOn:"常驻",sourceWs:"ws",sourceBuiltin:"builtin",notFound:"未找到。",sourceWorkspace:"workspace",sourceBuiltinReadonly:"builtin(UI 只读)",builtinShadowHint:"内置 skill 仅供参考。保存将创建工作区 shadow 覆盖它。",delete:"删除",save:"保存",saveShadow:"保存(创建工作区 shadow)",savedToast:'已保存 "{{name}}"',deleteConfirm:'删除工作区 skill "{{name}}"?如有内置版本将重新可见。',deletedToast:'已删除 "{{name}}"',new:"新建",newTitle:"新建 skill",newName:"Skill 名称",newNamePlaceholder:"my-skill",newCreate:"创建",createdToast:'已创建 "{{name}}"',nameRequired:"名称必填",invalidNameChars:"名称仅允许字母、数字及 . _ -",pathLabel:"工作区路径:",binsLabel:"依赖二进制:",envLabel:"依赖环境变量:",none:"无"},VC={pageTitle:SC,subtitle:AC,navigation:CC,tabs:EC,start:RC,agents:PC,policy:TC,messengers:IC,email:LC,viewerSettings:OC,workspaces:DC,service:NC,security:MC,admins:_C,llm:jC,mcp:FC,nativeAgent:HC,search:UC,mobile:BC,skillInjection:zC,agimSkills:$C},WC=KC();Ue.use(Nf).use(My).init({resources:{en:{common:xw,errors:gk,tasks:d0,approvals:F0,reminders:lS,memos:TS,memory:XS,skills:mA,workspace:TA,observability:KA,settings:kC},zh:{common:_w,errors:Yk,tasks:E0,approvals:Y0,reminders:xS,memos:FS,memory:uA,skills:xA,workspace:FA,observability:eC,settings:VC}},lng:WC,fallbackLng:"en",supportedLngs:["en","zh"],ns:["common","errors","tasks","approvals","reminders","memos","memory","skills","workspace","observability","settings"],defaultNS:"common",interpolation:{escapeValue:!1},react:{useSuspense:!1},backend:{loadPath:"/locales/{{lng}}/{{ns}}.json"},detection:{order:[],caches:[]}}).then(()=>{Mf(Ue.language==="zh"?"zh":"en")});function KC(){try{const e=localStorage.getItem("agim-lang");if(e==="en"||e==="zh")return e}catch{}return(navigator.language||"en").toLowerCase().startsWith("zh")?"zh":"en"}function qC(e){Mf(e),Ue.language!==e&&Ue.changeLanguage(e)}function Mf(e){typeof document>"u"||(document.documentElement.lang=e==="zh"?"zh-CN":"en")}const aa=1200,GC={messages:[],pendingApprovals:[],pendingAsks:[],runActivities:[],activeRunId:null,agents:[],agent:"",status:"connecting",currentReplyId:null,error:null},QC=24;function YC(e,t){switch(t.kind){case"WS_STATUS":return{...e,status:t.status};case"INIT":return{...e,agents:t.agents,agent:e.agent||t.defaultAgent};case"HISTORY":return{...e,messages:t.messages,agent:t.agent};case"AGENTS":return{...e,agents:t.agents};case"AGENT_SWITCHED":return{...e,agent:t.agent};case"SEND_USER":return{...e,messages:[...e.messages,t.message,t.placeholder],currentReplyId:t.placeholder.id,error:null};case"CHUNK":{const n=e.messages.findIndex(o=>o.id===t.replyId);if(n<0)return e;const r=[...e.messages],i=r[n];return i&&(r[n]={...i,content:i.content+t.text}),{...e,messages:r}}case"DONE":{const n=e.messages.findIndex(o=>o.id===t.replyId);if(n<0)return{...e,currentReplyId:null};const r=[...e.messages],i=r[n];return i&&(r[n]={...i,content:t.finalText||i.content}),{...e,messages:r,currentReplyId:null}}case"ERROR":return{...e,error:t.message,currentReplyId:null};case"APPROVAL_CARD":return e.pendingApprovals.some(n=>n.messageId===t.messageId)?e:{...e,pendingApprovals:[...e.pendingApprovals,{messageId:t.messageId,prompt:t.prompt}]};case"APPROVAL_TEXT":return e;case"APPROVAL_EDIT":{const n=e.pendingApprovals.findIndex(o=>o.messageId===t.messageId);if(n<0)return e;const r=[...e.pendingApprovals],i=r[n];return i&&(r[n]={...i,outcome:t.outcome,resolvedAt:Date.now()}),{...e,pendingApprovals:r}}case"APPROVAL_DISMISS":return{...e,pendingApprovals:e.pendingApprovals.filter(n=>n.messageId!==t.messageId)};case"CHOICE_CARD":return e.pendingAsks.some(n=>n.messageId===t.messageId)?e:{...e,pendingAsks:[...e.pendingAsks,{messageId:t.messageId,prompt:t.prompt}]};case"CHOICE_EDIT":{const n=e.pendingAsks.findIndex(o=>o.messageId===t.messageId);if(n<0)return e;const r=[...e.pendingAsks],i=r[n];return i&&(r[n]={...i,finalText:t.finalText,resolvedAt:Date.now()}),{...e,pendingAsks:r}}case"CHOICE_DISMISS":return{...e,pendingAsks:e.pendingAsks.filter(n=>n.messageId!==t.messageId)};case"RUN_START":{const n=[{runId:t.runId,agent:t.agent,startedAt:t.startedAt,status:"running"},...e.runActivities.filter(r=>r.runId!==t.runId)];return{...e,runActivities:n.slice(0,QC),activeRunId:t.runId}}case"RUN_USAGE":{const n=e.runActivities.findIndex(o=>o.runId===t.runId);if(n<0)return e;const r=[...e.runActivities],i=r[n];return i&&(r[n]={...i,durationMs:t.durationMs,outputChars:t.outputChars}),{...e,runActivities:r}}case"RUN_FINISH":{const n=e.runActivities.findIndex(o=>o.runId===t.runId);if(n<0)return{...e,activeRunId:e.activeRunId===t.runId?null:e.activeRunId};const r=[...e.runActivities],i=r[n];return i&&(r[n]={...i,status:t.status,finishedAt:t.finishedAt,durationMs:t.durationMs,error:t.error}),{...e,runActivities:r,activeRunId:e.activeRunId===t.runId?null:e.activeRunId}}case"RESET_CONVERSATION":return{...e,messages:[],pendingApprovals:[],pendingAsks:[],runActivities:[],activeRunId:null,currentReplyId:null,error:null};case"CLEAR_ERROR":return{...e,error:null}}}function XC(e){const t=(n,r)=>Ue.t(`chat.outcome.${n}`,{ns:"common",defaultValue:r});switch(e.decision){case"allowed":et.success(t("allowed","Allowed"));return;case"allowed-pinned":et.success(t("allowedPinned","Allowed + auto-allow further"));return;case"denied":et.error(t("denied","Denied"));return;case"denied-revoked":et.error(t("deniedRevoked","Denied (auto-allow revoked)"));return;case"expired":et.warning(t("expired","Timed out"));return}}let Kc=0;function qc(e){return Kc+=1,`${e}-${Date.now()}-${Kc}`}function JC(){const[e,t]=y.useReducer(YC,GC),n=y.useRef(wx()),r=y.useRef(new Map),i=y.useRef(!1),o=y.useRef(null);y.useEffect(()=>{o.current=e.currentReplyId},[e.currentReplyId]),y.useEffect(()=>{const m=n.current,p=m.subscribe({type:"status",fn:T=>t({kind:"WS_STATUS",status:T})}),b=m.subscribe({type:"message",fn:T=>a(T)});function v(){try{const S=localStorage.getItem("agim-web-thread-id");if(S&&/^web-[A-Za-z0-9_-]{4,64}$/.test(S))return S}catch{}const T=`web-${Date.now().toString(36)}-${Math.random().toString(36).slice(2,8)}`;try{localStorage.setItem("agim-web-thread-id",T)}catch{}return T}const x=v();function w(){m.send({type:"get-history",threadId:x}),m.send({type:"get-agents"})}let E=()=>{};return m.status()==="open"?w():E=m.subscribe({type:"status",fn:T=>{T==="open"&&(w(),E())}}),()=>{p(),b(),E()}},[]);function a(m){switch(m.type){case"init":t({kind:"INIT",agents:m.agents,defaultAgent:m.defaultAgent});return;case"history":t({kind:"HISTORY",agent:m.agent,messages:m.messages.map((p,b)=>({id:`hist-${b}`,role:p.role,content:p.content,agent:p.agent,timestamp:p.timestamp?Date.parse(p.timestamp):Date.now()-b*1e3}))});return;case"agents":t({kind:"AGENTS",agents:m.agents});return;case"agent-switched":t({kind:"AGENT_SWITCHED",agent:m.agent});return;case"run-start":t({kind:"RUN_START",runId:m.runId,agent:m.agent,startedAt:Number.isFinite(Date.parse(m.startedAt))?Date.parse(m.startedAt):Date.now()});return;case"usage":t({kind:"RUN_USAGE",runId:m.runId,durationMs:m.durationMs,outputChars:m.outputChars});return;case"run-finish":t({kind:"RUN_FINISH",runId:m.runId,status:m.status,finishedAt:Number.isFinite(Date.parse(m.finishedAt))?Date.parse(m.finishedAt):Date.now(),durationMs:m.durationMs,error:m.error});return;case"chunk":s(m.text);return;case"done":l(),t({kind:"DONE",replyId:o.current??"",finalText:m.text});return;case"error":l(),t({kind:"ERROR",message:m.message});return;case"approval-card":t({kind:"APPROVAL_CARD",messageId:m.messageId,prompt:m.prompt});return;case"approval-card-edit":t({kind:"APPROVAL_EDIT",messageId:m.messageId,outcome:m.outcome}),XC(m.outcome),window.setTimeout(()=>{t({kind:"APPROVAL_DISMISS",messageId:m.messageId})},aa);return;case"choice-card":t({kind:"CHOICE_CARD",messageId:m.messageId,prompt:m.prompt});return;case"choice-card-edit":t({kind:"CHOICE_EDIT",messageId:m.messageId,finalText:m.finalText}),window.setTimeout(()=>{t({kind:"CHOICE_DISMISS",messageId:m.messageId})},aa);return;case"approval-text":et.info(m.text);return;case"metrics":return;default:return}}function s(m){const p=o.current;if(!p)return;const b=r.current.get(p)??"";r.current.set(p,b+m),!i.current&&(i.current=!0,requestAnimationFrame(()=>{i.current=!1,l()}))}function l(){for(const[m,p]of r.current.entries())p&&t({kind:"CHUNK",replyId:m,text:p});r.current.clear()}function c(m){const p=m.trim();if(!p)return;const b=n.current,v=qc("u"),x=qc("a");t({kind:"SEND_USER",message:{id:v,role:"user",content:p,timestamp:Date.now()},placeholder:{id:x,role:"assistant",content:"",agent:e.agent,timestamp:Date.now()}}),b.send({type:"message",text:p,agent:e.agent})||t({kind:"ERROR",message:Ue.t("chat.notConnected",{ns:"common",defaultValue:"Not connected. Reconnecting…"})})}function u(m){n.current.send({type:"switch-agent",agent:m})}function d(m,p,b){const v=n.current.send({type:"approval-action",data:`apv:${p}:${b}`,messageId:m});return v||t({kind:"ERROR",message:Ue.t("chat.notConnectedRetry",{ns:"common",defaultValue:"Not connected. Reconnecting — try again in a moment."})}),v}function h(m,p){const b=n.current.send({type:"choice-action",data:p,messageId:m});return b?(t({kind:"CHOICE_EDIT",messageId:m,finalText:Ue.t("chat.askResolved",{ns:"common",defaultValue:"✅ 已回答"})}),window.setTimeout(()=>{t({kind:"CHOICE_DISMISS",messageId:m})},aa),b):(t({kind:"ERROR",message:Ue.t("chat.notConnectedRetry",{ns:"common",defaultValue:"Not connected. Reconnecting — try again in a moment."})}),b)}function f(){t({kind:"RESET_CONVERSATION"}),n.current.send({type:"new-conversation"})}return{state:e,send:c,switchAgent:u,approvalClick:d,choiceSubmit:h,newConversation:f,clearError:()=>t({kind:"CLEAR_ERROR"})}}const ZC=Is(["inline-flex items-center gap-1","rounded-full border px-2 py-0.5","text-xs font-semibold uppercase tracking-wide leading-5","transition-colors"].join(" "),{variants:{variant:{default:"bg-surface-2 text-text-dim border-transparent",secondary:"bg-surface-2 text-text border-border",outline:"bg-transparent text-text-dim border-border",success:"bg-success-bg text-success border-transparent",warning:"bg-warning-bg text-warning border-transparent",danger:"bg-danger-bg text-danger border-transparent",info:"bg-info-bg text-info border-transparent",accent:"bg-accent-bg text-accent border-transparent"}},defaultVariants:{variant:"default"}});function rt({className:e,variant:t,...n}){return g.jsx("span",{className:be(ZC({variant:t}),e),...n})}function e1(e,t){const n={};return(e[e.length-1]===""?[...e,""]:e).join((n.padRight?" ":"")+","+(n.padLeft===!1?"":" ")).trim()}const t1=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,n1=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,r1={};function Gc(e,t){return(r1.jsx?n1:t1).test(e)}const i1=/[ \t\n\f\r]/g;function o1(e){return typeof e=="object"?e.type==="text"?Qc(e.value):!1:Qc(e)}function Qc(e){return e.replace(i1,"")===""}class xi{constructor(t,n,r){this.normal=n,this.property=t,r&&(this.space=r)}}xi.prototype.normal={};xi.prototype.property={};xi.prototype.space=void 0;function _f(e,t){const n={},r={};for(const i of e)Object.assign(n,i.property),Object.assign(r,i.normal);return new xi(n,r,t)}function Za(e){return e.toLowerCase()}class bt{constructor(t,n){this.attribute=n,this.property=t}}bt.prototype.attribute="";bt.prototype.booleanish=!1;bt.prototype.boolean=!1;bt.prototype.commaOrSpaceSeparated=!1;bt.prototype.commaSeparated=!1;bt.prototype.defined=!1;bt.prototype.mustUseProperty=!1;bt.prototype.number=!1;bt.prototype.overloadedBoolean=!1;bt.prototype.property="";bt.prototype.spaceSeparated=!1;bt.prototype.space=void 0;let a1=0;const de=nr(),Xe=nr(),es=nr(),U=nr(),_e=nr(),Gn=nr(),xt=nr();function nr(){return 2**++a1}const ts=Object.freeze(Object.defineProperty({__proto__:null,boolean:de,booleanish:Xe,commaOrSpaceSeparated:xt,commaSeparated:Gn,number:U,overloadedBoolean:es,spaceSeparated:_e},Symbol.toStringTag,{value:"Module"})),sa=Object.keys(ts);class js extends bt{constructor(t,n,r,i){let o=-1;if(super(t,n),Yc(this,"space",i),typeof r=="number")for(;++o<sa.length;){const a=sa[o];Yc(this,sa[o],(r&ts[a])===ts[a])}}}js.prototype.defined=!0;function Yc(e,t,n){n&&(e[t]=n)}function Nr(e){const t={},n={};for(const[r,i]of Object.entries(e.properties)){const o=new js(r,e.transform(e.attributes||{},r),i,e.space);e.mustUseProperty&&e.mustUseProperty.includes(r)&&(o.mustUseProperty=!0),t[r]=o,n[Za(r)]=r,n[Za(o.attribute)]=r}return new xi(t,n,e.space)}const jf=Nr({properties:{ariaActiveDescendant:null,ariaAtomic:Xe,ariaAutoComplete:null,ariaBusy:Xe,ariaChecked:Xe,ariaColCount:U,ariaColIndex:U,ariaColSpan:U,ariaControls:_e,ariaCurrent:null,ariaDescribedBy:_e,ariaDetails:null,ariaDisabled:Xe,ariaDropEffect:_e,ariaErrorMessage:null,ariaExpanded:Xe,ariaFlowTo:_e,ariaGrabbed:Xe,ariaHasPopup:null,ariaHidden:Xe,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:_e,ariaLevel:U,ariaLive:null,ariaModal:Xe,ariaMultiLine:Xe,ariaMultiSelectable:Xe,ariaOrientation:null,ariaOwns:_e,ariaPlaceholder:null,ariaPosInSet:U,ariaPressed:Xe,ariaReadOnly:Xe,ariaRelevant:null,ariaRequired:Xe,ariaRoleDescription:_e,ariaRowCount:U,ariaRowIndex:U,ariaRowSpan:U,ariaSelected:Xe,ariaSetSize:U,ariaSort:null,ariaValueMax:U,ariaValueMin:U,ariaValueNow:U,ariaValueText:null,role:null},transform(e,t){return t==="role"?t:"aria-"+t.slice(4).toLowerCase()}});function Ff(e,t){return t in e?e[t]:t}function Hf(e,t){return Ff(e,t.toLowerCase())}const s1=Nr({attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:Gn,acceptCharset:_e,accessKey:_e,action:null,allow:null,allowFullScreen:de,allowPaymentRequest:de,allowUserMedia:de,alpha:de,alt:null,as:null,async:de,autoCapitalize:null,autoComplete:_e,autoFocus:de,autoPlay:de,blocking:_e,capture:null,charSet:null,checked:de,cite:null,className:_e,closedBy:null,colorSpace:null,cols:U,colSpan:U,command:null,commandFor:null,content:null,contentEditable:Xe,controls:de,controlsList:_e,coords:U|Gn,crossOrigin:null,data:null,dateTime:null,decoding:null,default:de,defer:de,dir:null,dirName:null,disabled:de,download:es,draggable:Xe,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:de,formTarget:null,headers:_e,height:U,hidden:es,high:U,href:null,hrefLang:null,htmlFor:_e,httpEquiv:_e,id:null,imageSizes:null,imageSrcSet:null,inert:de,inputMode:null,integrity:null,is:null,isMap:de,itemId:null,itemProp:_e,itemRef:_e,itemScope:de,itemType:_e,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:de,low:U,manifest:null,max:null,maxLength:U,media:null,method:null,min:null,minLength:U,multiple:de,muted:de,name:null,nonce:null,noModule:de,noValidate:de,onAbort:null,onAfterPrint:null,onAuxClick:null,onBeforeMatch:null,onBeforePrint:null,onBeforeToggle:null,onBeforeUnload:null,onBlur:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onContextLost:null,onContextMenu:null,onContextRestored:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnded:null,onError:null,onFocus:null,onFormData:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLanguageChange:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadEnd:null,onLoadStart:null,onMessage:null,onMessageError:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRejectionHandled:null,onReset:null,onResize:null,onScroll:null,onScrollEnd:null,onSecurityPolicyViolation:null,onSeeked:null,onSeeking:null,onSelect:null,onSlotChange:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnhandledRejection:null,onUnload:null,onVolumeChange:null,onWaiting:null,onWheel:null,open:de,optimum:U,pattern:null,ping:_e,placeholder:null,playsInline:de,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:de,referrerPolicy:null,rel:_e,required:de,reversed:de,rows:U,rowSpan:U,sandbox:_e,scope:null,scoped:de,seamless:de,selected:de,shadowRootClonable:de,shadowRootCustomElementRegistry:de,shadowRootDelegatesFocus:de,shadowRootMode:null,shadowRootSerializable:de,shape:null,size:U,sizes:null,slot:null,span:U,spellCheck:Xe,src:null,srcDoc:null,srcLang:null,srcSet:null,start:U,step:null,style:null,tabIndex:U,target:null,title:null,translate:null,type:null,typeMustMatch:de,useMap:null,value:Xe,width:U,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:_e,axis:null,background:null,bgColor:null,border:U,borderColor:null,bottomMargin:U,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:de,declare:de,event:null,face:null,frame:null,frameBorder:null,hSpace:U,leftMargin:U,link:null,longDesc:null,lowSrc:null,marginHeight:U,marginWidth:U,noResize:de,noHref:de,noShade:de,noWrap:de,object:null,profile:null,prompt:null,rev:null,rightMargin:U,rules:null,scheme:null,scrolling:Xe,standby:null,summary:null,text:null,topMargin:U,valueType:null,version:null,vAlign:null,vLink:null,vSpace:U,allowTransparency:null,autoCorrect:null,autoSave:null,credentialless:de,disablePictureInPicture:de,disableRemotePlayback:de,exportParts:Gn,part:_e,prefix:null,property:null,results:U,security:null,unselectable:null},space:"html",transform:Hf}),l1=Nr({attributes:{accentHeight:"accent-height",alignmentBaseline:"alignment-baseline",arabicForm:"arabic-form",baselineShift:"baseline-shift",capHeight:"cap-height",className:"class",clipPath:"clip-path",clipRule:"clip-rule",colorInterpolation:"color-interpolation",colorInterpolationFilters:"color-interpolation-filters",colorProfile:"color-profile",colorRendering:"color-rendering",crossOrigin:"crossorigin",dataType:"datatype",dominantBaseline:"dominant-baseline",enableBackground:"enable-background",fillOpacity:"fill-opacity",fillRule:"fill-rule",floodColor:"flood-color",floodOpacity:"flood-opacity",fontFamily:"font-family",fontSize:"font-size",fontSizeAdjust:"font-size-adjust",fontStretch:"font-stretch",fontStyle:"font-style",fontVariant:"font-variant",fontWeight:"font-weight",glyphName:"glyph-name",glyphOrientationHorizontal:"glyph-orientation-horizontal",glyphOrientationVertical:"glyph-orientation-vertical",hrefLang:"hreflang",horizAdvX:"horiz-adv-x",horizOriginX:"horiz-origin-x",horizOriginY:"horiz-origin-y",imageRendering:"image-rendering",letterSpacing:"letter-spacing",lightingColor:"lighting-color",markerEnd:"marker-end",markerMid:"marker-mid",markerStart:"marker-start",maskType:"mask-type",navDown:"nav-down",navDownLeft:"nav-down-left",navDownRight:"nav-down-right",navLeft:"nav-left",navNext:"nav-next",navPrev:"nav-prev",navRight:"nav-right",navUp:"nav-up",navUpLeft:"nav-up-left",navUpRight:"nav-up-right",onAbort:"onabort",onActivate:"onactivate",onAfterPrint:"onafterprint",onBeforePrint:"onbeforeprint",onBegin:"onbegin",onCancel:"oncancel",onCanPlay:"oncanplay",onCanPlayThrough:"oncanplaythrough",onChange:"onchange",onClick:"onclick",onClose:"onclose",onCopy:"oncopy",onCueChange:"oncuechange",onCut:"oncut",onDblClick:"ondblclick",onDrag:"ondrag",onDragEnd:"ondragend",onDragEnter:"ondragenter",onDragExit:"ondragexit",onDragLeave:"ondragleave",onDragOver:"ondragover",onDragStart:"ondragstart",onDrop:"ondrop",onDurationChange:"ondurationchange",onEmptied:"onemptied",onEnd:"onend",onEnded:"onended",onError:"onerror",onFocus:"onfocus",onFocusIn:"onfocusin",onFocusOut:"onfocusout",onHashChange:"onhashchange",onInput:"oninput",onInvalid:"oninvalid",onKeyDown:"onkeydown",onKeyPress:"onkeypress",onKeyUp:"onkeyup",onLoad:"onload",onLoadedData:"onloadeddata",onLoadedMetadata:"onloadedmetadata",onLoadStart:"onloadstart",onMessage:"onmessage",onMouseDown:"onmousedown",onMouseEnter:"onmouseenter",onMouseLeave:"onmouseleave",onMouseMove:"onmousemove",onMouseOut:"onmouseout",onMouseOver:"onmouseover",onMouseUp:"onmouseup",onMouseWheel:"onmousewheel",onOffline:"onoffline",onOnline:"ononline",onPageHide:"onpagehide",onPageShow:"onpageshow",onPaste:"onpaste",onPause:"onpause",onPlay:"onplay",onPlaying:"onplaying",onPopState:"onpopstate",onProgress:"onprogress",onRateChange:"onratechange",onRepeat:"onrepeat",onReset:"onreset",onResize:"onresize",onScroll:"onscroll",onSeeked:"onseeked",onSeeking:"onseeking",onSelect:"onselect",onShow:"onshow",onStalled:"onstalled",onStorage:"onstorage",onSubmit:"onsubmit",onSuspend:"onsuspend",onTimeUpdate:"ontimeupdate",onToggle:"ontoggle",onUnload:"onunload",onVolumeChange:"onvolumechange",onWaiting:"onwaiting",onZoom:"onzoom",overlinePosition:"overline-position",overlineThickness:"overline-thickness",paintOrder:"paint-order",panose1:"panose-1",pointerEvents:"pointer-events",referrerPolicy:"referrerpolicy",renderingIntent:"rendering-intent",shapeRendering:"shape-rendering",stopColor:"stop-color",stopOpacity:"stop-opacity",strikethroughPosition:"strikethrough-position",strikethroughThickness:"strikethrough-thickness",strokeDashArray:"stroke-dasharray",strokeDashOffset:"stroke-dashoffset",strokeLineCap:"stroke-linecap",strokeLineJoin:"stroke-linejoin",strokeMiterLimit:"stroke-miterlimit",strokeOpacity:"stroke-opacity",strokeWidth:"stroke-width",tabIndex:"tabindex",textAnchor:"text-anchor",textDecoration:"text-decoration",textRendering:"text-rendering",transformOrigin:"transform-origin",typeOf:"typeof",underlinePosition:"underline-position",underlineThickness:"underline-thickness",unicodeBidi:"unicode-bidi",unicodeRange:"unicode-range",unitsPerEm:"units-per-em",vAlphabetic:"v-alphabetic",vHanging:"v-hanging",vIdeographic:"v-ideographic",vMathematical:"v-mathematical",vectorEffect:"vector-effect",vertAdvY:"vert-adv-y",vertOriginX:"vert-origin-x",vertOriginY:"vert-origin-y",wordSpacing:"word-spacing",writingMode:"writing-mode",xHeight:"x-height",playbackOrder:"playbackorder",timelineBegin:"timelinebegin"},properties:{about:xt,accentHeight:U,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:U,amplitude:U,arabicForm:null,ascent:U,attributeName:null,attributeType:null,azimuth:U,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:U,by:null,calcMode:null,capHeight:U,className:_e,clip:null,clipPath:null,clipPathUnits:null,clipRule:null,color:null,colorInterpolation:null,colorInterpolationFilters:null,colorProfile:null,colorRendering:null,content:null,contentScriptType:null,contentStyleType:null,crossOrigin:null,cursor:null,cx:null,cy:null,d:null,dataType:null,defaultAction:null,descent:U,diffuseConstant:U,direction:null,display:null,dur:null,divisor:U,dominantBaseline:null,download:de,dx:null,dy:null,edgeMode:null,editable:null,elevation:U,enableBackground:null,end:null,event:null,exponent:U,externalResourcesRequired:null,fill:null,fillOpacity:U,fillRule:null,filter:null,filterRes:null,filterUnits:null,floodColor:null,floodOpacity:null,focusable:null,focusHighlight:null,fontFamily:null,fontSize:null,fontSizeAdjust:null,fontStretch:null,fontStyle:null,fontVariant:null,fontWeight:null,format:null,fr:null,from:null,fx:null,fy:null,g1:Gn,g2:Gn,glyphName:Gn,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:U,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:U,horizOriginX:U,horizOriginY:U,id:null,ideographic:U,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:U,k:U,k1:U,k2:U,k3:U,k4:U,kernelMatrix:xt,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:U,local:null,markerEnd:null,markerMid:null,markerStart:null,markerHeight:null,markerUnits:null,markerWidth:null,mask:null,maskContentUnits:null,maskType:null,maskUnits:null,mathematical:null,max:null,media:null,mediaCharacterEncoding:null,mediaContentEncodings:null,mediaSize:U,mediaTime:null,method:null,min:null,mode:null,name:null,navDown:null,navDownLeft:null,navDownRight:null,navLeft:null,navNext:null,navPrev:null,navRight:null,navUp:null,navUpLeft:null,navUpRight:null,numOctaves:null,observer:null,offset:null,onAbort:null,onActivate:null,onAfterPrint:null,onBeforePrint:null,onBegin:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnd:null,onEnded:null,onError:null,onFocus:null,onFocusIn:null,onFocusOut:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadStart:null,onMessage:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onMouseWheel:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRepeat:null,onReset:null,onResize:null,onScroll:null,onSeeked:null,onSeeking:null,onSelect:null,onShow:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnload:null,onVolumeChange:null,onWaiting:null,onZoom:null,opacity:null,operator:null,order:null,orient:null,orientation:null,origin:null,overflow:null,overlay:null,overlinePosition:U,overlineThickness:U,paintOrder:null,panose1:null,path:null,pathLength:U,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:_e,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:U,pointsAtY:U,pointsAtZ:U,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:xt,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:xt,rev:xt,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:xt,requiredFeatures:xt,requiredFonts:xt,requiredFormats:xt,resource:null,restart:null,result:null,rotate:null,rx:null,ry:null,scale:null,seed:null,shapeRendering:null,side:null,slope:null,snapshotTime:null,specularConstant:U,specularExponent:U,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:U,strikethroughThickness:U,string:null,stroke:null,strokeDashArray:xt,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:U,strokeOpacity:U,strokeWidth:null,style:null,surfaceScale:U,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:xt,tabIndex:U,tableValues:null,target:null,targetX:U,targetY:U,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:xt,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:U,underlineThickness:U,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:U,values:null,vAlphabetic:U,vMathematical:U,vectorEffect:null,vHanging:U,vIdeographic:U,version:null,vertAdvY:U,vertOriginX:U,vertOriginY:U,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:U,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:"svg",transform:Ff}),Uf=Nr({properties:{xLinkActuate:null,xLinkArcRole:null,xLinkHref:null,xLinkRole:null,xLinkShow:null,xLinkTitle:null,xLinkType:null},space:"xlink",transform(e,t){return"xlink:"+t.slice(5).toLowerCase()}}),Bf=Nr({attributes:{xmlnsxlink:"xmlns:xlink"},properties:{xmlnsXLink:null,xmlns:null},space:"xmlns",transform:Hf}),zf=Nr({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:"xml",transform(e,t){return"xml:"+t.slice(3).toLowerCase()}}),c1={classId:"classID",dataType:"datatype",itemId:"itemID",strokeDashArray:"strokeDasharray",strokeDashOffset:"strokeDashoffset",strokeLineCap:"strokeLinecap",strokeLineJoin:"strokeLinejoin",strokeMiterLimit:"strokeMiterlimit",typeOf:"typeof",xLinkActuate:"xlinkActuate",xLinkArcRole:"xlinkArcrole",xLinkHref:"xlinkHref",xLinkRole:"xlinkRole",xLinkShow:"xlinkShow",xLinkTitle:"xlinkTitle",xLinkType:"xlinkType",xmlnsXLink:"xmlnsXlink"},u1=/[A-Z]/g,Xc=/-[a-z]/g,d1=/^data[-\w.:]+$/i;function f1(e,t){const n=Za(t);let r=t,i=bt;if(n in e.normal)return e.property[e.normal[n]];if(n.length>4&&n.slice(0,4)==="data"&&d1.test(t)){if(t.charAt(4)==="-"){const o=t.slice(5).replace(Xc,p1);r="data"+o.charAt(0).toUpperCase()+o.slice(1)}else{const o=t.slice(4);if(!Xc.test(o)){let a=o.replace(u1,h1);a.charAt(0)!=="-"&&(a="-"+a),t="data"+a}}i=js}return new i(r,t)}function h1(e){return"-"+e.toLowerCase()}function p1(e){return e.charAt(1).toUpperCase()}const m1=_f([jf,s1,Uf,Bf,zf],"html"),Fs=_f([jf,l1,Uf,Bf,zf],"svg");function g1(e){return e.join(" ").trim()}var Hs={},Jc=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,y1=/\n/g,b1=/^\s*/,v1=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,x1=/^:\s*/,w1=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,k1=/^[;\s]*/,S1=/^\s+|\s+$/g,A1=`
176
+ `,Zc="/",eu="*",Vn="",C1="comment",E1="declaration";function R1(e,t){if(typeof e!="string")throw new TypeError("First argument must be a string");if(!e)return[];t=t||{};var n=1,r=1;function i(m){var p=m.match(y1);p&&(n+=p.length);var b=m.lastIndexOf(A1);r=~b?m.length-b:r+m.length}function o(){var m={line:n,column:r};return function(p){return p.position=new a(m),c(),p}}function a(m){this.start=m,this.end={line:n,column:r},this.source=t.source}a.prototype.content=e;function s(m){var p=new Error(t.source+":"+n+":"+r+": "+m);if(p.reason=m,p.filename=t.source,p.line=n,p.column=r,p.source=e,!t.silent)throw p}function l(m){var p=m.exec(e);if(p){var b=p[0];return i(b),e=e.slice(b.length),p}}function c(){l(b1)}function u(m){var p;for(m=m||[];p=d();)p!==!1&&m.push(p);return m}function d(){var m=o();if(!(Zc!=e.charAt(0)||eu!=e.charAt(1))){for(var p=2;Vn!=e.charAt(p)&&(eu!=e.charAt(p)||Zc!=e.charAt(p+1));)++p;if(p+=2,Vn===e.charAt(p-1))return s("End of comment missing");var b=e.slice(2,p-2);return r+=2,i(b),e=e.slice(p),r+=2,m({type:C1,comment:b})}}function h(){var m=o(),p=l(v1);if(p){if(d(),!l(x1))return s("property missing ':'");var b=l(w1),v=m({type:E1,property:tu(p[0].replace(Jc,Vn)),value:b?tu(b[0].replace(Jc,Vn)):Vn});return l(k1),v}}function f(){var m=[];u(m);for(var p;p=h();)p!==!1&&(m.push(p),u(m));return m}return c(),f()}function tu(e){return e?e.replace(S1,Vn):Vn}var P1=R1,T1=Zi&&Zi.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(Hs,"__esModule",{value:!0});Hs.default=L1;const I1=T1(P1);function L1(e,t){let n=null;if(!e||typeof e!="string")return n;const r=(0,I1.default)(e),i=typeof t=="function";return r.forEach(o=>{if(o.type!=="declaration")return;const{property:a,value:s}=o;i?t(a,s,o):s&&(n=n||{},n[a]=s)}),n}var Lo={};Object.defineProperty(Lo,"__esModule",{value:!0});Lo.camelCase=void 0;var O1=/^--[a-zA-Z0-9_-]+$/,D1=/-([a-z])/g,N1=/^[^-]+$/,M1=/^-(webkit|moz|ms|o|khtml)-/,_1=/^-(ms)-/,j1=function(e){return!e||N1.test(e)||O1.test(e)},F1=function(e,t){return t.toUpperCase()},nu=function(e,t){return"".concat(t,"-")},H1=function(e,t){return t===void 0&&(t={}),j1(e)?e:(e=e.toLowerCase(),t.reactCompat?e=e.replace(_1,nu):e=e.replace(M1,nu),e.replace(D1,F1))};Lo.camelCase=H1;var U1=Zi&&Zi.__importDefault||function(e){return e&&e.__esModule?e:{default:e}},B1=U1(Hs),z1=Lo;function ns(e,t){var n={};return!e||typeof e!="string"||(0,B1.default)(e,function(r,i){r&&i&&(n[(0,z1.camelCase)(r,t)]=i)}),n}ns.default=ns;var $1=ns;const V1=Sd($1),$f=Vf("end"),Us=Vf("start");function Vf(e){return t;function t(n){const r=n&&n.position&&n.position[e]||{};if(typeof r.line=="number"&&r.line>0&&typeof r.column=="number"&&r.column>0)return{line:r.line,column:r.column,offset:typeof r.offset=="number"&&r.offset>-1?r.offset:void 0}}}function W1(e){const t=Us(e),n=$f(e);if(t&&n)return{start:t,end:n}}function ri(e){return!e||typeof e!="object"?"":"position"in e||"type"in e?ru(e.position):"start"in e||"end"in e?ru(e):"line"in e||"column"in e?rs(e):""}function rs(e){return iu(e&&e.line)+":"+iu(e&&e.column)}function ru(e){return rs(e&&e.start)+"-"+rs(e&&e.end)}function iu(e){return e&&typeof e=="number"?e:1}class ut extends Error{constructor(t,n,r){super(),typeof n=="string"&&(r=n,n=void 0);let i="",o={},a=!1;if(n&&("line"in n&&"column"in n?o={place:n}:"start"in n&&"end"in n?o={place:n}:"type"in n?o={ancestors:[n],place:n.position}:o={...n}),typeof t=="string"?i=t:!o.cause&&t&&(a=!0,i=t.message,o.cause=t),!o.ruleId&&!o.source&&typeof r=="string"){const l=r.indexOf(":");l===-1?o.ruleId=r:(o.source=r.slice(0,l),o.ruleId=r.slice(l+1))}if(!o.place&&o.ancestors&&o.ancestors){const l=o.ancestors[o.ancestors.length-1];l&&(o.place=l.position)}const s=o.place&&"start"in o.place?o.place.start:o.place;this.ancestors=o.ancestors||void 0,this.cause=o.cause||void 0,this.column=s?s.column:void 0,this.fatal=void 0,this.file="",this.message=i,this.line=s?s.line:void 0,this.name=ri(o.place)||"1:1",this.place=o.place||void 0,this.reason=this.message,this.ruleId=o.ruleId||void 0,this.source=o.source||void 0,this.stack=a&&o.cause&&typeof o.cause.stack=="string"?o.cause.stack:"",this.actual=void 0,this.expected=void 0,this.note=void 0,this.url=void 0}}ut.prototype.file="";ut.prototype.name="";ut.prototype.reason="";ut.prototype.message="";ut.prototype.stack="";ut.prototype.column=void 0;ut.prototype.line=void 0;ut.prototype.ancestors=void 0;ut.prototype.cause=void 0;ut.prototype.fatal=void 0;ut.prototype.place=void 0;ut.prototype.ruleId=void 0;ut.prototype.source=void 0;const Bs={}.hasOwnProperty,K1=new Map,q1=/[A-Z]/g,G1=new Set(["table","tbody","thead","tfoot","tr"]),Q1=new Set(["td","th"]),Wf="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function Y1(e,t){if(!t||t.Fragment===void 0)throw new TypeError("Expected `Fragment` in options");const n=t.filePath||void 0;let r;if(t.development){if(typeof t.jsxDEV!="function")throw new TypeError("Expected `jsxDEV` in options when `development: true`");r=iE(n,t.jsxDEV)}else{if(typeof t.jsx!="function")throw new TypeError("Expected `jsx` in production options");if(typeof t.jsxs!="function")throw new TypeError("Expected `jsxs` in production options");r=rE(n,t.jsx,t.jsxs)}const i={Fragment:t.Fragment,ancestors:[],components:t.components||{},create:r,elementAttributeNameCase:t.elementAttributeNameCase||"react",evaluater:t.createEvaluater?t.createEvaluater():void 0,filePath:n,ignoreInvalidStyle:t.ignoreInvalidStyle||!1,passKeys:t.passKeys!==!1,passNode:t.passNode||!1,schema:t.space==="svg"?Fs:m1,stylePropertyNameCase:t.stylePropertyNameCase||"dom",tableCellAlignToStyle:t.tableCellAlignToStyle!==!1},o=Kf(i,e,void 0);return o&&typeof o!="string"?o:i.create(e,i.Fragment,{children:o||void 0},void 0)}function Kf(e,t,n){if(t.type==="element")return X1(e,t,n);if(t.type==="mdxFlowExpression"||t.type==="mdxTextExpression")return J1(e,t);if(t.type==="mdxJsxFlowElement"||t.type==="mdxJsxTextElement")return eE(e,t,n);if(t.type==="mdxjsEsm")return Z1(e,t);if(t.type==="root")return tE(e,t,n);if(t.type==="text")return nE(e,t)}function X1(e,t,n){const r=e.schema;let i=r;t.tagName.toLowerCase()==="svg"&&r.space==="html"&&(i=Fs,e.schema=i),e.ancestors.push(t);const o=Gf(e,t.tagName,!1),a=oE(e,t);let s=$s(e,t);return G1.has(t.tagName)&&(s=s.filter(function(l){return typeof l=="string"?!o1(l):!0})),qf(e,a,o,t),zs(a,s),e.ancestors.pop(),e.schema=r,e.create(t,o,a,n)}function J1(e,t){if(t.data&&t.data.estree&&e.evaluater){const r=t.data.estree.body[0];return r.type,e.evaluater.evaluateExpression(r.expression)}pi(e,t.position)}function Z1(e,t){if(t.data&&t.data.estree&&e.evaluater)return e.evaluater.evaluateProgram(t.data.estree);pi(e,t.position)}function eE(e,t,n){const r=e.schema;let i=r;t.name==="svg"&&r.space==="html"&&(i=Fs,e.schema=i),e.ancestors.push(t);const o=t.name===null?e.Fragment:Gf(e,t.name,!0),a=aE(e,t),s=$s(e,t);return qf(e,a,o,t),zs(a,s),e.ancestors.pop(),e.schema=r,e.create(t,o,a,n)}function tE(e,t,n){const r={};return zs(r,$s(e,t)),e.create(t,e.Fragment,r,n)}function nE(e,t){return t.value}function qf(e,t,n,r){typeof n!="string"&&n!==e.Fragment&&e.passNode&&(t.node=r)}function zs(e,t){if(t.length>0){const n=t.length>1?t:t[0];n&&(e.children=n)}}function rE(e,t,n){return r;function r(i,o,a,s){const c=Array.isArray(a.children)?n:t;return s?c(o,a,s):c(o,a)}}function iE(e,t){return n;function n(r,i,o,a){const s=Array.isArray(o.children),l=Us(r);return t(i,o,a,s,{columnNumber:l?l.column-1:void 0,fileName:e,lineNumber:l?l.line:void 0},void 0)}}function oE(e,t){const n={};let r,i;for(i in t.properties)if(i!=="children"&&Bs.call(t.properties,i)){const o=sE(e,i,t.properties[i]);if(o){const[a,s]=o;e.tableCellAlignToStyle&&a==="align"&&typeof s=="string"&&Q1.has(t.tagName)?r=s:n[a]=s}}if(r){const o=n.style||(n.style={});o[e.stylePropertyNameCase==="css"?"text-align":"textAlign"]=r}return n}function aE(e,t){const n={};for(const r of t.attributes)if(r.type==="mdxJsxExpressionAttribute")if(r.data&&r.data.estree&&e.evaluater){const o=r.data.estree.body[0];o.type;const a=o.expression;a.type;const s=a.properties[0];s.type,Object.assign(n,e.evaluater.evaluateExpression(s.argument))}else pi(e,t.position);else{const i=r.name;let o;if(r.value&&typeof r.value=="object")if(r.value.data&&r.value.data.estree&&e.evaluater){const s=r.value.data.estree.body[0];s.type,o=e.evaluater.evaluateExpression(s.expression)}else pi(e,t.position);else o=r.value===null?!0:r.value;n[i]=o}return n}function $s(e,t){const n=[];let r=-1;const i=e.passKeys?new Map:K1;for(;++r<t.children.length;){const o=t.children[r];let a;if(e.passKeys){const l=o.type==="element"?o.tagName:o.type==="mdxJsxFlowElement"||o.type==="mdxJsxTextElement"?o.name:void 0;if(l){const c=i.get(l)||0;a=l+"-"+c,i.set(l,c+1)}}const s=Kf(e,o,a);s!==void 0&&n.push(s)}return n}function sE(e,t,n){const r=f1(e.schema,t);if(!(n==null||typeof n=="number"&&Number.isNaN(n))){if(Array.isArray(n)&&(n=r.commaSeparated?e1(n):g1(n)),r.property==="style"){let i=typeof n=="object"?n:lE(e,String(n));return e.stylePropertyNameCase==="css"&&(i=cE(i)),["style",i]}return[e.elementAttributeNameCase==="react"&&r.space?c1[r.property]||r.property:r.attribute,n]}}function lE(e,t){try{return V1(t,{reactCompat:!0})}catch(n){if(e.ignoreInvalidStyle)return{};const r=n,i=new ut("Cannot parse `style` attribute",{ancestors:e.ancestors,cause:r,ruleId:"style",source:"hast-util-to-jsx-runtime"});throw i.file=e.filePath||void 0,i.url=Wf+"#cannot-parse-style-attribute",i}}function Gf(e,t,n){let r;if(!n)r={type:"Literal",value:t};else if(t.includes(".")){const i=t.split(".");let o=-1,a;for(;++o<i.length;){const s=Gc(i[o])?{type:"Identifier",name:i[o]}:{type:"Literal",value:i[o]};a=a?{type:"MemberExpression",object:a,property:s,computed:!!(o&&s.type==="Literal"),optional:!1}:s}r=a}else r=Gc(t)&&!/^[a-z]/.test(t)?{type:"Identifier",name:t}:{type:"Literal",value:t};if(r.type==="Literal"){const i=r.value;return Bs.call(e.components,i)?e.components[i]:i}if(e.evaluater)return e.evaluater.evaluateExpression(r);pi(e)}function pi(e,t){const n=new ut("Cannot handle MDX estrees without `createEvaluater`",{ancestors:e.ancestors,place:t,ruleId:"mdx-estree",source:"hast-util-to-jsx-runtime"});throw n.file=e.filePath||void 0,n.url=Wf+"#cannot-handle-mdx-estrees-without-createevaluater",n}function cE(e){const t={};let n;for(n in e)Bs.call(e,n)&&(t[uE(n)]=e[n]);return t}function uE(e){let t=e.replace(q1,dE);return t.slice(0,3)==="ms-"&&(t="-"+t),t}function dE(e){return"-"+e.toLowerCase()}const la={action:["form"],cite:["blockquote","del","ins","q"],data:["object"],formAction:["button","input"],href:["a","area","base","link"],icon:["menuitem"],itemId:null,manifest:["html"],ping:["a","area"],poster:["video"],src:["audio","embed","iframe","img","input","script","source","track","video"]},fE={};function Vs(e,t){const n=fE,r=typeof n.includeImageAlt=="boolean"?n.includeImageAlt:!0,i=typeof n.includeHtml=="boolean"?n.includeHtml:!0;return Qf(e,r,i)}function Qf(e,t,n){if(hE(e)){if("value"in e)return e.type==="html"&&!n?"":e.value;if(t&&"alt"in e&&e.alt)return e.alt;if("children"in e)return ou(e.children,t,n)}return Array.isArray(e)?ou(e,t,n):""}function ou(e,t,n){const r=[];let i=-1;for(;++i<e.length;)r[i]=Qf(e[i],t,n);return r.join("")}function hE(e){return!!(e&&typeof e=="object")}const au=document.createElement("i");function Ws(e){const t="&"+e+";";au.innerHTML=t;const n=au.textContent;return n.charCodeAt(n.length-1)===59&&e!=="semi"||n===t?!1:n}function At(e,t,n,r){const i=e.length;let o=0,a;if(t<0?t=-t>i?0:i+t:t=t>i?i:t,n=n>0?n:0,r.length<1e4)a=Array.from(r),a.unshift(t,n),e.splice(...a);else for(n&&e.splice(t,n);o<r.length;)a=r.slice(o,o+1e4),a.unshift(t,0),e.splice(...a),o+=1e4,t+=1e4}function Rt(e,t){return e.length>0?(At(e,e.length,0,t),e):t}const su={}.hasOwnProperty;function Yf(e){const t={};let n=-1;for(;++n<e.length;)pE(t,e[n]);return t}function pE(e,t){let n;for(n in t){const i=(su.call(e,n)?e[n]:void 0)||(e[n]={}),o=t[n];let a;if(o)for(a in o){su.call(i,a)||(i[a]=[]);const s=o[a];mE(i[a],Array.isArray(s)?s:s?[s]:[])}}}function mE(e,t){let n=-1;const r=[];for(;++n<t.length;)(t[n].add==="after"?e:r).push(t[n]);At(e,0,0,r)}function Xf(e,t){const n=Number.parseInt(e,t);return n<9||n===11||n>13&&n<32||n>126&&n<160||n>55295&&n<57344||n>64975&&n<65008||(n&65535)===65535||(n&65535)===65534||n>1114111?"�":String.fromCodePoint(n)}function Nt(e){return e.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}const ht=Tn(/[A-Za-z]/),ct=Tn(/[\dA-Za-z]/),gE=Tn(/[#-'*+\--9=?A-Z^-~]/);function ho(e){return e!==null&&(e<32||e===127)}const is=Tn(/\d/),yE=Tn(/[\dA-Fa-f]/),bE=Tn(/[!-/:-@[-`{-~]/);function oe(e){return e!==null&&e<-2}function je(e){return e!==null&&(e<0||e===32)}function Ae(e){return e===-2||e===-1||e===32}const Oo=Tn(/\p{P}|\p{S}/u),Zn=Tn(/\s/);function Tn(e){return t;function t(n){return n!==null&&n>-1&&e.test(String.fromCharCode(n))}}function Mr(e){const t=[];let n=-1,r=0,i=0;for(;++n<e.length;){const o=e.charCodeAt(n);let a="";if(o===37&&ct(e.charCodeAt(n+1))&&ct(e.charCodeAt(n+2)))i=2;else if(o<128)/[!#$&-;=?-Z_a-z~]/.test(String.fromCharCode(o))||(a=String.fromCharCode(o));else if(o>55295&&o<57344){const s=e.charCodeAt(n+1);o<56320&&s>56319&&s<57344?(a=String.fromCharCode(o,s),i=1):a="�"}else a=String.fromCharCode(o);a&&(t.push(e.slice(r,n),encodeURIComponent(a)),r=n+i+1,a=""),i&&(n+=i,i=0)}return t.join("")+e.slice(r)}function Re(e,t,n,r){const i=r?r-1:Number.POSITIVE_INFINITY;let o=0;return a;function a(l){return Ae(l)?(e.enter(n),s(l)):t(l)}function s(l){return Ae(l)&&o++<i?(e.consume(l),s):(e.exit(n),t(l))}}const vE={tokenize:xE};function xE(e){const t=e.attempt(this.parser.constructs.contentInitial,r,i);let n;return t;function r(s){if(s===null){e.consume(s);return}return e.enter("lineEnding"),e.consume(s),e.exit("lineEnding"),Re(e,t,"linePrefix")}function i(s){return e.enter("paragraph"),o(s)}function o(s){const l=e.enter("chunkText",{contentType:"text",previous:n});return n&&(n.next=l),n=l,a(s)}function a(s){if(s===null){e.exit("chunkText"),e.exit("paragraph"),e.consume(s);return}return oe(s)?(e.consume(s),e.exit("chunkText"),o):(e.consume(s),a)}}const wE={tokenize:kE},lu={tokenize:SE};function kE(e){const t=this,n=[];let r=0,i,o,a;return s;function s(w){if(r<n.length){const E=n[r];return t.containerState=E[1],e.attempt(E[0].continuation,l,c)(w)}return c(w)}function l(w){if(r++,t.containerState._closeFlow){t.containerState._closeFlow=void 0,i&&x();const E=t.events.length;let T=E,S;for(;T--;)if(t.events[T][0]==="exit"&&t.events[T][1].type==="chunkFlow"){S=t.events[T][1].end;break}v(r);let k=E;for(;k<t.events.length;)t.events[k][1].end={...S},k++;return At(t.events,T+1,0,t.events.slice(E)),t.events.length=k,c(w)}return s(w)}function c(w){if(r===n.length){if(!i)return h(w);if(i.currentConstruct&&i.currentConstruct.concrete)return m(w);t.interrupt=!!(i.currentConstruct&&!i._gfmTableDynamicInterruptHack)}return t.containerState={},e.check(lu,u,d)(w)}function u(w){return i&&x(),v(r),h(w)}function d(w){return t.parser.lazy[t.now().line]=r!==n.length,a=t.now().offset,m(w)}function h(w){return t.containerState={},e.attempt(lu,f,m)(w)}function f(w){return r++,n.push([t.currentConstruct,t.containerState]),h(w)}function m(w){if(w===null){i&&x(),v(0),e.consume(w);return}return i=i||t.parser.flow(t.now()),e.enter("chunkFlow",{_tokenizer:i,contentType:"flow",previous:o}),p(w)}function p(w){if(w===null){b(e.exit("chunkFlow"),!0),v(0),e.consume(w);return}return oe(w)?(e.consume(w),b(e.exit("chunkFlow")),r=0,t.interrupt=void 0,s):(e.consume(w),p)}function b(w,E){const T=t.sliceStream(w);if(E&&T.push(null),w.previous=o,o&&(o.next=w),o=w,i.defineSkip(w.start),i.write(T),t.parser.lazy[w.start.line]){let S=i.events.length;for(;S--;)if(i.events[S][1].start.offset<a&&(!i.events[S][1].end||i.events[S][1].end.offset>a))return;const k=t.events.length;let O=k,_,R;for(;O--;)if(t.events[O][0]==="exit"&&t.events[O][1].type==="chunkFlow"){if(_){R=t.events[O][1].end;break}_=!0}for(v(r),S=k;S<t.events.length;)t.events[S][1].end={...R},S++;At(t.events,O+1,0,t.events.slice(k)),t.events.length=S}}function v(w){let E=n.length;for(;E-- >w;){const T=n[E];t.containerState=T[1],T[0].exit.call(t,e)}n.length=w}function x(){i.write([null]),o=void 0,i=void 0,t.containerState._closeFlow=void 0}}function SE(e,t,n){return Re(e,e.attempt(this.parser.constructs.document,t,n),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}function Cr(e){if(e===null||je(e)||Zn(e))return 1;if(Oo(e))return 2}function Do(e,t,n){const r=[];let i=-1;for(;++i<e.length;){const o=e[i].resolveAll;o&&!r.includes(o)&&(t=o(t,n),r.push(o))}return t}const os={name:"attention",resolveAll:AE,tokenize:CE};function AE(e,t){let n=-1,r,i,o,a,s,l,c,u;for(;++n<e.length;)if(e[n][0]==="enter"&&e[n][1].type==="attentionSequence"&&e[n][1]._close){for(r=n;r--;)if(e[r][0]==="exit"&&e[r][1].type==="attentionSequence"&&e[r][1]._open&&t.sliceSerialize(e[r][1]).charCodeAt(0)===t.sliceSerialize(e[n][1]).charCodeAt(0)){if((e[r][1]._close||e[n][1]._open)&&(e[n][1].end.offset-e[n][1].start.offset)%3&&!((e[r][1].end.offset-e[r][1].start.offset+e[n][1].end.offset-e[n][1].start.offset)%3))continue;l=e[r][1].end.offset-e[r][1].start.offset>1&&e[n][1].end.offset-e[n][1].start.offset>1?2:1;const d={...e[r][1].end},h={...e[n][1].start};cu(d,-l),cu(h,l),a={type:l>1?"strongSequence":"emphasisSequence",start:d,end:{...e[r][1].end}},s={type:l>1?"strongSequence":"emphasisSequence",start:{...e[n][1].start},end:h},o={type:l>1?"strongText":"emphasisText",start:{...e[r][1].end},end:{...e[n][1].start}},i={type:l>1?"strong":"emphasis",start:{...a.start},end:{...s.end}},e[r][1].end={...a.start},e[n][1].start={...s.end},c=[],e[r][1].end.offset-e[r][1].start.offset&&(c=Rt(c,[["enter",e[r][1],t],["exit",e[r][1],t]])),c=Rt(c,[["enter",i,t],["enter",a,t],["exit",a,t],["enter",o,t]]),c=Rt(c,Do(t.parser.constructs.insideSpan.null,e.slice(r+1,n),t)),c=Rt(c,[["exit",o,t],["enter",s,t],["exit",s,t],["exit",i,t]]),e[n][1].end.offset-e[n][1].start.offset?(u=2,c=Rt(c,[["enter",e[n][1],t],["exit",e[n][1],t]])):u=0,At(e,r-1,n-r+3,c),n=r+c.length-u-2;break}}for(n=-1;++n<e.length;)e[n][1].type==="attentionSequence"&&(e[n][1].type="data");return e}function CE(e,t){const n=this.parser.constructs.attentionMarkers.null,r=this.previous,i=Cr(r);let o;return a;function a(l){return o=l,e.enter("attentionSequence"),s(l)}function s(l){if(l===o)return e.consume(l),s;const c=e.exit("attentionSequence"),u=Cr(l),d=!u||u===2&&i||n.includes(l),h=!i||i===2&&u||n.includes(r);return c._open=!!(o===42?d:d&&(i||!h)),c._close=!!(o===42?h:h&&(u||!d)),t(l)}}function cu(e,t){e.column+=t,e.offset+=t,e._bufferIndex+=t}const EE={name:"autolink",tokenize:RE};function RE(e,t,n){let r=0;return i;function i(f){return e.enter("autolink"),e.enter("autolinkMarker"),e.consume(f),e.exit("autolinkMarker"),e.enter("autolinkProtocol"),o}function o(f){return ht(f)?(e.consume(f),a):f===64?n(f):c(f)}function a(f){return f===43||f===45||f===46||ct(f)?(r=1,s(f)):c(f)}function s(f){return f===58?(e.consume(f),r=0,l):(f===43||f===45||f===46||ct(f))&&r++<32?(e.consume(f),s):(r=0,c(f))}function l(f){return f===62?(e.exit("autolinkProtocol"),e.enter("autolinkMarker"),e.consume(f),e.exit("autolinkMarker"),e.exit("autolink"),t):f===null||f===32||f===60||ho(f)?n(f):(e.consume(f),l)}function c(f){return f===64?(e.consume(f),u):gE(f)?(e.consume(f),c):n(f)}function u(f){return ct(f)?d(f):n(f)}function d(f){return f===46?(e.consume(f),r=0,u):f===62?(e.exit("autolinkProtocol").type="autolinkEmail",e.enter("autolinkMarker"),e.consume(f),e.exit("autolinkMarker"),e.exit("autolink"),t):h(f)}function h(f){if((f===45||ct(f))&&r++<63){const m=f===45?h:d;return e.consume(f),m}return n(f)}}const wi={partial:!0,tokenize:PE};function PE(e,t,n){return r;function r(o){return Ae(o)?Re(e,i,"linePrefix")(o):i(o)}function i(o){return o===null||oe(o)?t(o):n(o)}}const Jf={continuation:{tokenize:IE},exit:LE,name:"blockQuote",tokenize:TE};function TE(e,t,n){const r=this;return i;function i(a){if(a===62){const s=r.containerState;return s.open||(e.enter("blockQuote",{_container:!0}),s.open=!0),e.enter("blockQuotePrefix"),e.enter("blockQuoteMarker"),e.consume(a),e.exit("blockQuoteMarker"),o}return n(a)}function o(a){return Ae(a)?(e.enter("blockQuotePrefixWhitespace"),e.consume(a),e.exit("blockQuotePrefixWhitespace"),e.exit("blockQuotePrefix"),t):(e.exit("blockQuotePrefix"),t(a))}}function IE(e,t,n){const r=this;return i;function i(a){return Ae(a)?Re(e,o,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(a):o(a)}function o(a){return e.attempt(Jf,t,n)(a)}}function LE(e){e.exit("blockQuote")}const Zf={name:"characterEscape",tokenize:OE};function OE(e,t,n){return r;function r(o){return e.enter("characterEscape"),e.enter("escapeMarker"),e.consume(o),e.exit("escapeMarker"),i}function i(o){return bE(o)?(e.enter("characterEscapeValue"),e.consume(o),e.exit("characterEscapeValue"),e.exit("characterEscape"),t):n(o)}}const eh={name:"characterReference",tokenize:DE};function DE(e,t,n){const r=this;let i=0,o,a;return s;function s(d){return e.enter("characterReference"),e.enter("characterReferenceMarker"),e.consume(d),e.exit("characterReferenceMarker"),l}function l(d){return d===35?(e.enter("characterReferenceMarkerNumeric"),e.consume(d),e.exit("characterReferenceMarkerNumeric"),c):(e.enter("characterReferenceValue"),o=31,a=ct,u(d))}function c(d){return d===88||d===120?(e.enter("characterReferenceMarkerHexadecimal"),e.consume(d),e.exit("characterReferenceMarkerHexadecimal"),e.enter("characterReferenceValue"),o=6,a=yE,u):(e.enter("characterReferenceValue"),o=7,a=is,u(d))}function u(d){if(d===59&&i){const h=e.exit("characterReferenceValue");return a===ct&&!Ws(r.sliceSerialize(h))?n(d):(e.enter("characterReferenceMarker"),e.consume(d),e.exit("characterReferenceMarker"),e.exit("characterReference"),t)}return a(d)&&i++<o?(e.consume(d),u):n(d)}}const uu={partial:!0,tokenize:ME},du={concrete:!0,name:"codeFenced",tokenize:NE};function NE(e,t,n){const r=this,i={partial:!0,tokenize:T};let o=0,a=0,s;return l;function l(S){return c(S)}function c(S){const k=r.events[r.events.length-1];return o=k&&k[1].type==="linePrefix"?k[2].sliceSerialize(k[1],!0).length:0,s=S,e.enter("codeFenced"),e.enter("codeFencedFence"),e.enter("codeFencedFenceSequence"),u(S)}function u(S){return S===s?(a++,e.consume(S),u):a<3?n(S):(e.exit("codeFencedFenceSequence"),Ae(S)?Re(e,d,"whitespace")(S):d(S))}function d(S){return S===null||oe(S)?(e.exit("codeFencedFence"),r.interrupt?t(S):e.check(uu,p,E)(S)):(e.enter("codeFencedFenceInfo"),e.enter("chunkString",{contentType:"string"}),h(S))}function h(S){return S===null||oe(S)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),d(S)):Ae(S)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),Re(e,f,"whitespace")(S)):S===96&&S===s?n(S):(e.consume(S),h)}function f(S){return S===null||oe(S)?d(S):(e.enter("codeFencedFenceMeta"),e.enter("chunkString",{contentType:"string"}),m(S))}function m(S){return S===null||oe(S)?(e.exit("chunkString"),e.exit("codeFencedFenceMeta"),d(S)):S===96&&S===s?n(S):(e.consume(S),m)}function p(S){return e.attempt(i,E,b)(S)}function b(S){return e.enter("lineEnding"),e.consume(S),e.exit("lineEnding"),v}function v(S){return o>0&&Ae(S)?Re(e,x,"linePrefix",o+1)(S):x(S)}function x(S){return S===null||oe(S)?e.check(uu,p,E)(S):(e.enter("codeFlowValue"),w(S))}function w(S){return S===null||oe(S)?(e.exit("codeFlowValue"),x(S)):(e.consume(S),w)}function E(S){return e.exit("codeFenced"),t(S)}function T(S,k,O){let _=0;return R;function R(V){return S.enter("lineEnding"),S.consume(V),S.exit("lineEnding"),D}function D(V){return S.enter("codeFencedFence"),Ae(V)?Re(S,L,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(V):L(V)}function L(V){return V===s?(S.enter("codeFencedFenceSequence"),z(V)):O(V)}function z(V){return V===s?(_++,S.consume(V),z):_>=a?(S.exit("codeFencedFenceSequence"),Ae(V)?Re(S,H,"whitespace")(V):H(V)):O(V)}function H(V){return V===null||oe(V)?(S.exit("codeFencedFence"),k(V)):O(V)}}}function ME(e,t,n){const r=this;return i;function i(a){return a===null?n(a):(e.enter("lineEnding"),e.consume(a),e.exit("lineEnding"),o)}function o(a){return r.parser.lazy[r.now().line]?n(a):t(a)}}const ca={name:"codeIndented",tokenize:jE},_E={partial:!0,tokenize:FE};function jE(e,t,n){const r=this;return i;function i(c){return e.enter("codeIndented"),Re(e,o,"linePrefix",5)(c)}function o(c){const u=r.events[r.events.length-1];return u&&u[1].type==="linePrefix"&&u[2].sliceSerialize(u[1],!0).length>=4?a(c):n(c)}function a(c){return c===null?l(c):oe(c)?e.attempt(_E,a,l)(c):(e.enter("codeFlowValue"),s(c))}function s(c){return c===null||oe(c)?(e.exit("codeFlowValue"),a(c)):(e.consume(c),s)}function l(c){return e.exit("codeIndented"),t(c)}}function FE(e,t,n){const r=this;return i;function i(a){return r.parser.lazy[r.now().line]?n(a):oe(a)?(e.enter("lineEnding"),e.consume(a),e.exit("lineEnding"),i):Re(e,o,"linePrefix",5)(a)}function o(a){const s=r.events[r.events.length-1];return s&&s[1].type==="linePrefix"&&s[2].sliceSerialize(s[1],!0).length>=4?t(a):oe(a)?i(a):n(a)}}const HE={name:"codeText",previous:BE,resolve:UE,tokenize:zE};function UE(e){let t=e.length-4,n=3,r,i;if((e[n][1].type==="lineEnding"||e[n][1].type==="space")&&(e[t][1].type==="lineEnding"||e[t][1].type==="space")){for(r=n;++r<t;)if(e[r][1].type==="codeTextData"){e[n][1].type="codeTextPadding",e[t][1].type="codeTextPadding",n+=2,t-=2;break}}for(r=n-1,t++;++r<=t;)i===void 0?r!==t&&e[r][1].type!=="lineEnding"&&(i=r):(r===t||e[r][1].type==="lineEnding")&&(e[i][1].type="codeTextData",r!==i+2&&(e[i][1].end=e[r-1][1].end,e.splice(i+2,r-i-2),t-=r-i-2,r=i+2),i=void 0);return e}function BE(e){return e!==96||this.events[this.events.length-1][1].type==="characterEscape"}function zE(e,t,n){let r=0,i,o;return a;function a(d){return e.enter("codeText"),e.enter("codeTextSequence"),s(d)}function s(d){return d===96?(e.consume(d),r++,s):(e.exit("codeTextSequence"),l(d))}function l(d){return d===null?n(d):d===32?(e.enter("space"),e.consume(d),e.exit("space"),l):d===96?(o=e.enter("codeTextSequence"),i=0,u(d)):oe(d)?(e.enter("lineEnding"),e.consume(d),e.exit("lineEnding"),l):(e.enter("codeTextData"),c(d))}function c(d){return d===null||d===32||d===96||oe(d)?(e.exit("codeTextData"),l(d)):(e.consume(d),c)}function u(d){return d===96?(e.consume(d),i++,u):i===r?(e.exit("codeTextSequence"),e.exit("codeText"),t(d)):(o.type="codeTextData",c(d))}}class $E{constructor(t){this.left=t?[...t]:[],this.right=[]}get(t){if(t<0||t>=this.left.length+this.right.length)throw new RangeError("Cannot access index `"+t+"` in a splice buffer of size `"+(this.left.length+this.right.length)+"`");return t<this.left.length?this.left[t]:this.right[this.right.length-t+this.left.length-1]}get length(){return this.left.length+this.right.length}shift(){return this.setCursor(0),this.right.pop()}slice(t,n){const r=n??Number.POSITIVE_INFINITY;return r<this.left.length?this.left.slice(t,r):t>this.left.length?this.right.slice(this.right.length-r+this.left.length,this.right.length-t+this.left.length).reverse():this.left.slice(t).concat(this.right.slice(this.right.length-r+this.left.length).reverse())}splice(t,n,r){const i=n||0;this.setCursor(Math.trunc(t));const o=this.right.splice(this.right.length-i,Number.POSITIVE_INFINITY);return r&&Jr(this.left,r),o.reverse()}pop(){return this.setCursor(Number.POSITIVE_INFINITY),this.left.pop()}push(t){this.setCursor(Number.POSITIVE_INFINITY),this.left.push(t)}pushMany(t){this.setCursor(Number.POSITIVE_INFINITY),Jr(this.left,t)}unshift(t){this.setCursor(0),this.right.push(t)}unshiftMany(t){this.setCursor(0),Jr(this.right,t.reverse())}setCursor(t){if(!(t===this.left.length||t>this.left.length&&this.right.length===0||t<0&&this.left.length===0))if(t<this.left.length){const n=this.left.splice(t,Number.POSITIVE_INFINITY);Jr(this.right,n.reverse())}else{const n=this.right.splice(this.left.length+this.right.length-t,Number.POSITIVE_INFINITY);Jr(this.left,n.reverse())}}}function Jr(e,t){let n=0;if(t.length<1e4)e.push(...t);else for(;n<t.length;)e.push(...t.slice(n,n+1e4)),n+=1e4}function th(e){const t={};let n=-1,r,i,o,a,s,l,c;const u=new $E(e);for(;++n<u.length;){for(;n in t;)n=t[n];if(r=u.get(n),n&&r[1].type==="chunkFlow"&&u.get(n-1)[1].type==="listItemPrefix"&&(l=r[1]._tokenizer.events,o=0,o<l.length&&l[o][1].type==="lineEndingBlank"&&(o+=2),o<l.length&&l[o][1].type==="content"))for(;++o<l.length&&l[o][1].type!=="content";)l[o][1].type==="chunkText"&&(l[o][1]._isInFirstContentOfListItem=!0,o++);if(r[0]==="enter")r[1].contentType&&(Object.assign(t,VE(u,n)),n=t[n],c=!0);else if(r[1]._container){for(o=n,i=void 0;o--;)if(a=u.get(o),a[1].type==="lineEnding"||a[1].type==="lineEndingBlank")a[0]==="enter"&&(i&&(u.get(i)[1].type="lineEndingBlank"),a[1].type="lineEnding",i=o);else if(!(a[1].type==="linePrefix"||a[1].type==="listItemIndent"))break;i&&(r[1].end={...u.get(i)[1].start},s=u.slice(i,n),s.unshift(r),u.splice(i,n-i+1,s))}}return At(e,0,Number.POSITIVE_INFINITY,u.slice(0)),!c}function VE(e,t){const n=e.get(t)[1],r=e.get(t)[2];let i=t-1;const o=[];let a=n._tokenizer;a||(a=r.parser[n.contentType](n.start),n._contentTypeTextTrailing&&(a._contentTypeTextTrailing=!0));const s=a.events,l=[],c={};let u,d,h=-1,f=n,m=0,p=0;const b=[p];for(;f;){for(;e.get(++i)[1]!==f;);o.push(i),f._tokenizer||(u=r.sliceStream(f),f.next||u.push(null),d&&a.defineSkip(f.start),f._isInFirstContentOfListItem&&(a._gfmTasklistFirstContentOfListItem=!0),a.write(u),f._isInFirstContentOfListItem&&(a._gfmTasklistFirstContentOfListItem=void 0)),d=f,f=f.next}for(f=n;++h<s.length;)s[h][0]==="exit"&&s[h-1][0]==="enter"&&s[h][1].type===s[h-1][1].type&&s[h][1].start.line!==s[h][1].end.line&&(p=h+1,b.push(p),f._tokenizer=void 0,f.previous=void 0,f=f.next);for(a.events=[],f?(f._tokenizer=void 0,f.previous=void 0):b.pop(),h=b.length;h--;){const v=s.slice(b[h],b[h+1]),x=o.pop();l.push([x,x+v.length-1]),e.splice(x,2,v)}for(l.reverse(),h=-1;++h<l.length;)c[m+l[h][0]]=m+l[h][1],m+=l[h][1]-l[h][0]-1;return c}const WE={resolve:qE,tokenize:GE},KE={partial:!0,tokenize:QE};function qE(e){return th(e),e}function GE(e,t){let n;return r;function r(s){return e.enter("content"),n=e.enter("chunkContent",{contentType:"content"}),i(s)}function i(s){return s===null?o(s):oe(s)?e.check(KE,a,o)(s):(e.consume(s),i)}function o(s){return e.exit("chunkContent"),e.exit("content"),t(s)}function a(s){return e.consume(s),e.exit("chunkContent"),n.next=e.enter("chunkContent",{contentType:"content",previous:n}),n=n.next,i}}function QE(e,t,n){const r=this;return i;function i(a){return e.exit("chunkContent"),e.enter("lineEnding"),e.consume(a),e.exit("lineEnding"),Re(e,o,"linePrefix")}function o(a){if(a===null||oe(a))return n(a);const s=r.events[r.events.length-1];return!r.parser.constructs.disable.null.includes("codeIndented")&&s&&s[1].type==="linePrefix"&&s[2].sliceSerialize(s[1],!0).length>=4?t(a):e.interrupt(r.parser.constructs.flow,n,t)(a)}}function nh(e,t,n,r,i,o,a,s,l){const c=l||Number.POSITIVE_INFINITY;let u=0;return d;function d(v){return v===60?(e.enter(r),e.enter(i),e.enter(o),e.consume(v),e.exit(o),h):v===null||v===32||v===41||ho(v)?n(v):(e.enter(r),e.enter(a),e.enter(s),e.enter("chunkString",{contentType:"string"}),p(v))}function h(v){return v===62?(e.enter(o),e.consume(v),e.exit(o),e.exit(i),e.exit(r),t):(e.enter(s),e.enter("chunkString",{contentType:"string"}),f(v))}function f(v){return v===62?(e.exit("chunkString"),e.exit(s),h(v)):v===null||v===60||oe(v)?n(v):(e.consume(v),v===92?m:f)}function m(v){return v===60||v===62||v===92?(e.consume(v),f):f(v)}function p(v){return!u&&(v===null||v===41||je(v))?(e.exit("chunkString"),e.exit(s),e.exit(a),e.exit(r),t(v)):u<c&&v===40?(e.consume(v),u++,p):v===41?(e.consume(v),u--,p):v===null||v===32||v===40||ho(v)?n(v):(e.consume(v),v===92?b:p)}function b(v){return v===40||v===41||v===92?(e.consume(v),p):p(v)}}function rh(e,t,n,r,i,o){const a=this;let s=0,l;return c;function c(f){return e.enter(r),e.enter(i),e.consume(f),e.exit(i),e.enter(o),u}function u(f){return s>999||f===null||f===91||f===93&&!l||f===94&&!s&&"_hiddenFootnoteSupport"in a.parser.constructs?n(f):f===93?(e.exit(o),e.enter(i),e.consume(f),e.exit(i),e.exit(r),t):oe(f)?(e.enter("lineEnding"),e.consume(f),e.exit("lineEnding"),u):(e.enter("chunkString",{contentType:"string"}),d(f))}function d(f){return f===null||f===91||f===93||oe(f)||s++>999?(e.exit("chunkString"),u(f)):(e.consume(f),l||(l=!Ae(f)),f===92?h:d)}function h(f){return f===91||f===92||f===93?(e.consume(f),s++,d):d(f)}}function ih(e,t,n,r,i,o){let a;return s;function s(h){return h===34||h===39||h===40?(e.enter(r),e.enter(i),e.consume(h),e.exit(i),a=h===40?41:h,l):n(h)}function l(h){return h===a?(e.enter(i),e.consume(h),e.exit(i),e.exit(r),t):(e.enter(o),c(h))}function c(h){return h===a?(e.exit(o),l(a)):h===null?n(h):oe(h)?(e.enter("lineEnding"),e.consume(h),e.exit("lineEnding"),Re(e,c,"linePrefix")):(e.enter("chunkString",{contentType:"string"}),u(h))}function u(h){return h===a||h===null||oe(h)?(e.exit("chunkString"),c(h)):(e.consume(h),h===92?d:u)}function d(h){return h===a||h===92?(e.consume(h),u):u(h)}}function ii(e,t){let n;return r;function r(i){return oe(i)?(e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),n=!0,r):Ae(i)?Re(e,r,n?"linePrefix":"lineSuffix")(i):t(i)}}const YE={name:"definition",tokenize:JE},XE={partial:!0,tokenize:ZE};function JE(e,t,n){const r=this;let i;return o;function o(f){return e.enter("definition"),a(f)}function a(f){return rh.call(r,e,s,n,"definitionLabel","definitionLabelMarker","definitionLabelString")(f)}function s(f){return i=Nt(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)),f===58?(e.enter("definitionMarker"),e.consume(f),e.exit("definitionMarker"),l):n(f)}function l(f){return je(f)?ii(e,c)(f):c(f)}function c(f){return nh(e,u,n,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(f)}function u(f){return e.attempt(XE,d,d)(f)}function d(f){return Ae(f)?Re(e,h,"whitespace")(f):h(f)}function h(f){return f===null||oe(f)?(e.exit("definition"),r.parser.defined.push(i),t(f)):n(f)}}function ZE(e,t,n){return r;function r(s){return je(s)?ii(e,i)(s):n(s)}function i(s){return ih(e,o,n,"definitionTitle","definitionTitleMarker","definitionTitleString")(s)}function o(s){return Ae(s)?Re(e,a,"whitespace")(s):a(s)}function a(s){return s===null||oe(s)?t(s):n(s)}}const eR={name:"hardBreakEscape",tokenize:tR};function tR(e,t,n){return r;function r(o){return e.enter("hardBreakEscape"),e.consume(o),i}function i(o){return oe(o)?(e.exit("hardBreakEscape"),t(o)):n(o)}}const nR={name:"headingAtx",resolve:rR,tokenize:iR};function rR(e,t){let n=e.length-2,r=3,i,o;return e[r][1].type==="whitespace"&&(r+=2),n-2>r&&e[n][1].type==="whitespace"&&(n-=2),e[n][1].type==="atxHeadingSequence"&&(r===n-1||n-4>r&&e[n-2][1].type==="whitespace")&&(n-=r+1===n?2:4),n>r&&(i={type:"atxHeadingText",start:e[r][1].start,end:e[n][1].end},o={type:"chunkText",start:e[r][1].start,end:e[n][1].end,contentType:"text"},At(e,r,n-r+1,[["enter",i,t],["enter",o,t],["exit",o,t],["exit",i,t]])),e}function iR(e,t,n){let r=0;return i;function i(u){return e.enter("atxHeading"),o(u)}function o(u){return e.enter("atxHeadingSequence"),a(u)}function a(u){return u===35&&r++<6?(e.consume(u),a):u===null||je(u)?(e.exit("atxHeadingSequence"),s(u)):n(u)}function s(u){return u===35?(e.enter("atxHeadingSequence"),l(u)):u===null||oe(u)?(e.exit("atxHeading"),t(u)):Ae(u)?Re(e,s,"whitespace")(u):(e.enter("atxHeadingText"),c(u))}function l(u){return u===35?(e.consume(u),l):(e.exit("atxHeadingSequence"),s(u))}function c(u){return u===null||u===35||je(u)?(e.exit("atxHeadingText"),s(u)):(e.consume(u),c)}}const oR=["address","article","aside","base","basefont","blockquote","body","caption","center","col","colgroup","dd","details","dialog","dir","div","dl","dt","fieldset","figcaption","figure","footer","form","frame","frameset","h1","h2","h3","h4","h5","h6","head","header","hr","html","iframe","legend","li","link","main","menu","menuitem","nav","noframes","ol","optgroup","option","p","param","search","section","summary","table","tbody","td","tfoot","th","thead","title","tr","track","ul"],fu=["pre","script","style","textarea"],aR={concrete:!0,name:"htmlFlow",resolveTo:cR,tokenize:uR},sR={partial:!0,tokenize:fR},lR={partial:!0,tokenize:dR};function cR(e){let t=e.length;for(;t--&&!(e[t][0]==="enter"&&e[t][1].type==="htmlFlow"););return t>1&&e[t-2][1].type==="linePrefix"&&(e[t][1].start=e[t-2][1].start,e[t+1][1].start=e[t-2][1].start,e.splice(t-2,2)),e}function uR(e,t,n){const r=this;let i,o,a,s,l;return c;function c(C){return u(C)}function u(C){return e.enter("htmlFlow"),e.enter("htmlFlowData"),e.consume(C),d}function d(C){return C===33?(e.consume(C),h):C===47?(e.consume(C),o=!0,p):C===63?(e.consume(C),i=3,r.interrupt?t:A):ht(C)?(e.consume(C),a=String.fromCharCode(C),b):n(C)}function h(C){return C===45?(e.consume(C),i=2,f):C===91?(e.consume(C),i=5,s=0,m):ht(C)?(e.consume(C),i=4,r.interrupt?t:A):n(C)}function f(C){return C===45?(e.consume(C),r.interrupt?t:A):n(C)}function m(C){const ae="CDATA[";return C===ae.charCodeAt(s++)?(e.consume(C),s===ae.length?r.interrupt?t:L:m):n(C)}function p(C){return ht(C)?(e.consume(C),a=String.fromCharCode(C),b):n(C)}function b(C){if(C===null||C===47||C===62||je(C)){const ae=C===47,pe=a.toLowerCase();return!ae&&!o&&fu.includes(pe)?(i=1,r.interrupt?t(C):L(C)):oR.includes(a.toLowerCase())?(i=6,ae?(e.consume(C),v):r.interrupt?t(C):L(C)):(i=7,r.interrupt&&!r.parser.lazy[r.now().line]?n(C):o?x(C):w(C))}return C===45||ct(C)?(e.consume(C),a+=String.fromCharCode(C),b):n(C)}function v(C){return C===62?(e.consume(C),r.interrupt?t:L):n(C)}function x(C){return Ae(C)?(e.consume(C),x):R(C)}function w(C){return C===47?(e.consume(C),R):C===58||C===95||ht(C)?(e.consume(C),E):Ae(C)?(e.consume(C),w):R(C)}function E(C){return C===45||C===46||C===58||C===95||ct(C)?(e.consume(C),E):T(C)}function T(C){return C===61?(e.consume(C),S):Ae(C)?(e.consume(C),T):w(C)}function S(C){return C===null||C===60||C===61||C===62||C===96?n(C):C===34||C===39?(e.consume(C),l=C,k):Ae(C)?(e.consume(C),S):O(C)}function k(C){return C===l?(e.consume(C),l=null,_):C===null||oe(C)?n(C):(e.consume(C),k)}function O(C){return C===null||C===34||C===39||C===47||C===60||C===61||C===62||C===96||je(C)?T(C):(e.consume(C),O)}function _(C){return C===47||C===62||Ae(C)?w(C):n(C)}function R(C){return C===62?(e.consume(C),D):n(C)}function D(C){return C===null||oe(C)?L(C):Ae(C)?(e.consume(C),D):n(C)}function L(C){return C===45&&i===2?(e.consume(C),Q):C===60&&i===1?(e.consume(C),Y):C===62&&i===4?(e.consume(C),ie):C===63&&i===3?(e.consume(C),A):C===93&&i===5?(e.consume(C),F):oe(C)&&(i===6||i===7)?(e.exit("htmlFlowData"),e.check(sR,Z,z)(C)):C===null||oe(C)?(e.exit("htmlFlowData"),z(C)):(e.consume(C),L)}function z(C){return e.check(lR,H,Z)(C)}function H(C){return e.enter("lineEnding"),e.consume(C),e.exit("lineEnding"),V}function V(C){return C===null||oe(C)?z(C):(e.enter("htmlFlowData"),L(C))}function Q(C){return C===45?(e.consume(C),A):L(C)}function Y(C){return C===47?(e.consume(C),a="",W):L(C)}function W(C){if(C===62){const ae=a.toLowerCase();return fu.includes(ae)?(e.consume(C),ie):L(C)}return ht(C)&&a.length<8?(e.consume(C),a+=String.fromCharCode(C),W):L(C)}function F(C){return C===93?(e.consume(C),A):L(C)}function A(C){return C===62?(e.consume(C),ie):C===45&&i===2?(e.consume(C),A):L(C)}function ie(C){return C===null||oe(C)?(e.exit("htmlFlowData"),Z(C)):(e.consume(C),ie)}function Z(C){return e.exit("htmlFlow"),t(C)}}function dR(e,t,n){const r=this;return i;function i(a){return oe(a)?(e.enter("lineEnding"),e.consume(a),e.exit("lineEnding"),o):n(a)}function o(a){return r.parser.lazy[r.now().line]?n(a):t(a)}}function fR(e,t,n){return r;function r(i){return e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),e.attempt(wi,t,n)}}const hR={name:"htmlText",tokenize:pR};function pR(e,t,n){const r=this;let i,o,a;return s;function s(A){return e.enter("htmlText"),e.enter("htmlTextData"),e.consume(A),l}function l(A){return A===33?(e.consume(A),c):A===47?(e.consume(A),T):A===63?(e.consume(A),w):ht(A)?(e.consume(A),O):n(A)}function c(A){return A===45?(e.consume(A),u):A===91?(e.consume(A),o=0,m):ht(A)?(e.consume(A),x):n(A)}function u(A){return A===45?(e.consume(A),f):n(A)}function d(A){return A===null?n(A):A===45?(e.consume(A),h):oe(A)?(a=d,Y(A)):(e.consume(A),d)}function h(A){return A===45?(e.consume(A),f):d(A)}function f(A){return A===62?Q(A):A===45?h(A):d(A)}function m(A){const ie="CDATA[";return A===ie.charCodeAt(o++)?(e.consume(A),o===ie.length?p:m):n(A)}function p(A){return A===null?n(A):A===93?(e.consume(A),b):oe(A)?(a=p,Y(A)):(e.consume(A),p)}function b(A){return A===93?(e.consume(A),v):p(A)}function v(A){return A===62?Q(A):A===93?(e.consume(A),v):p(A)}function x(A){return A===null||A===62?Q(A):oe(A)?(a=x,Y(A)):(e.consume(A),x)}function w(A){return A===null?n(A):A===63?(e.consume(A),E):oe(A)?(a=w,Y(A)):(e.consume(A),w)}function E(A){return A===62?Q(A):w(A)}function T(A){return ht(A)?(e.consume(A),S):n(A)}function S(A){return A===45||ct(A)?(e.consume(A),S):k(A)}function k(A){return oe(A)?(a=k,Y(A)):Ae(A)?(e.consume(A),k):Q(A)}function O(A){return A===45||ct(A)?(e.consume(A),O):A===47||A===62||je(A)?_(A):n(A)}function _(A){return A===47?(e.consume(A),Q):A===58||A===95||ht(A)?(e.consume(A),R):oe(A)?(a=_,Y(A)):Ae(A)?(e.consume(A),_):Q(A)}function R(A){return A===45||A===46||A===58||A===95||ct(A)?(e.consume(A),R):D(A)}function D(A){return A===61?(e.consume(A),L):oe(A)?(a=D,Y(A)):Ae(A)?(e.consume(A),D):_(A)}function L(A){return A===null||A===60||A===61||A===62||A===96?n(A):A===34||A===39?(e.consume(A),i=A,z):oe(A)?(a=L,Y(A)):Ae(A)?(e.consume(A),L):(e.consume(A),H)}function z(A){return A===i?(e.consume(A),i=void 0,V):A===null?n(A):oe(A)?(a=z,Y(A)):(e.consume(A),z)}function H(A){return A===null||A===34||A===39||A===60||A===61||A===96?n(A):A===47||A===62||je(A)?_(A):(e.consume(A),H)}function V(A){return A===47||A===62||je(A)?_(A):n(A)}function Q(A){return A===62?(e.consume(A),e.exit("htmlTextData"),e.exit("htmlText"),t):n(A)}function Y(A){return e.exit("htmlTextData"),e.enter("lineEnding"),e.consume(A),e.exit("lineEnding"),W}function W(A){return Ae(A)?Re(e,F,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(A):F(A)}function F(A){return e.enter("htmlTextData"),a(A)}}const Ks={name:"labelEnd",resolveAll:bR,resolveTo:vR,tokenize:xR},mR={tokenize:wR},gR={tokenize:kR},yR={tokenize:SR};function bR(e){let t=-1;const n=[];for(;++t<e.length;){const r=e[t][1];if(n.push(e[t]),r.type==="labelImage"||r.type==="labelLink"||r.type==="labelEnd"){const i=r.type==="labelImage"?4:2;r.type="data",t+=i}}return e.length!==n.length&&At(e,0,e.length,n),e}function vR(e,t){let n=e.length,r=0,i,o,a,s;for(;n--;)if(i=e[n][1],o){if(i.type==="link"||i.type==="labelLink"&&i._inactive)break;e[n][0]==="enter"&&i.type==="labelLink"&&(i._inactive=!0)}else if(a){if(e[n][0]==="enter"&&(i.type==="labelImage"||i.type==="labelLink")&&!i._balanced&&(o=n,i.type!=="labelLink")){r=2;break}}else i.type==="labelEnd"&&(a=n);const l={type:e[o][1].type==="labelLink"?"link":"image",start:{...e[o][1].start},end:{...e[e.length-1][1].end}},c={type:"label",start:{...e[o][1].start},end:{...e[a][1].end}},u={type:"labelText",start:{...e[o+r+2][1].end},end:{...e[a-2][1].start}};return s=[["enter",l,t],["enter",c,t]],s=Rt(s,e.slice(o+1,o+r+3)),s=Rt(s,[["enter",u,t]]),s=Rt(s,Do(t.parser.constructs.insideSpan.null,e.slice(o+r+4,a-3),t)),s=Rt(s,[["exit",u,t],e[a-2],e[a-1],["exit",c,t]]),s=Rt(s,e.slice(a+1)),s=Rt(s,[["exit",l,t]]),At(e,o,e.length,s),e}function xR(e,t,n){const r=this;let i=r.events.length,o,a;for(;i--;)if((r.events[i][1].type==="labelImage"||r.events[i][1].type==="labelLink")&&!r.events[i][1]._balanced){o=r.events[i][1];break}return s;function s(h){return o?o._inactive?d(h):(a=r.parser.defined.includes(Nt(r.sliceSerialize({start:o.end,end:r.now()}))),e.enter("labelEnd"),e.enter("labelMarker"),e.consume(h),e.exit("labelMarker"),e.exit("labelEnd"),l):n(h)}function l(h){return h===40?e.attempt(mR,u,a?u:d)(h):h===91?e.attempt(gR,u,a?c:d)(h):a?u(h):d(h)}function c(h){return e.attempt(yR,u,d)(h)}function u(h){return t(h)}function d(h){return o._balanced=!0,n(h)}}function wR(e,t,n){return r;function r(d){return e.enter("resource"),e.enter("resourceMarker"),e.consume(d),e.exit("resourceMarker"),i}function i(d){return je(d)?ii(e,o)(d):o(d)}function o(d){return d===41?u(d):nh(e,a,s,"resourceDestination","resourceDestinationLiteral","resourceDestinationLiteralMarker","resourceDestinationRaw","resourceDestinationString",32)(d)}function a(d){return je(d)?ii(e,l)(d):u(d)}function s(d){return n(d)}function l(d){return d===34||d===39||d===40?ih(e,c,n,"resourceTitle","resourceTitleMarker","resourceTitleString")(d):u(d)}function c(d){return je(d)?ii(e,u)(d):u(d)}function u(d){return d===41?(e.enter("resourceMarker"),e.consume(d),e.exit("resourceMarker"),e.exit("resource"),t):n(d)}}function kR(e,t,n){const r=this;return i;function i(s){return rh.call(r,e,o,a,"reference","referenceMarker","referenceString")(s)}function o(s){return r.parser.defined.includes(Nt(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)))?t(s):n(s)}function a(s){return n(s)}}function SR(e,t,n){return r;function r(o){return e.enter("reference"),e.enter("referenceMarker"),e.consume(o),e.exit("referenceMarker"),i}function i(o){return o===93?(e.enter("referenceMarker"),e.consume(o),e.exit("referenceMarker"),e.exit("reference"),t):n(o)}}const AR={name:"labelStartImage",resolveAll:Ks.resolveAll,tokenize:CR};function CR(e,t,n){const r=this;return i;function i(s){return e.enter("labelImage"),e.enter("labelImageMarker"),e.consume(s),e.exit("labelImageMarker"),o}function o(s){return s===91?(e.enter("labelMarker"),e.consume(s),e.exit("labelMarker"),e.exit("labelImage"),a):n(s)}function a(s){return s===94&&"_hiddenFootnoteSupport"in r.parser.constructs?n(s):t(s)}}const ER={name:"labelStartLink",resolveAll:Ks.resolveAll,tokenize:RR};function RR(e,t,n){const r=this;return i;function i(a){return e.enter("labelLink"),e.enter("labelMarker"),e.consume(a),e.exit("labelMarker"),e.exit("labelLink"),o}function o(a){return a===94&&"_hiddenFootnoteSupport"in r.parser.constructs?n(a):t(a)}}const ua={name:"lineEnding",tokenize:PR};function PR(e,t){return n;function n(r){return e.enter("lineEnding"),e.consume(r),e.exit("lineEnding"),Re(e,t,"linePrefix")}}const qi={name:"thematicBreak",tokenize:TR};function TR(e,t,n){let r=0,i;return o;function o(c){return e.enter("thematicBreak"),a(c)}function a(c){return i=c,s(c)}function s(c){return c===i?(e.enter("thematicBreakSequence"),l(c)):r>=3&&(c===null||oe(c))?(e.exit("thematicBreak"),t(c)):n(c)}function l(c){return c===i?(e.consume(c),r++,l):(e.exit("thematicBreakSequence"),Ae(c)?Re(e,s,"whitespace")(c):s(c))}}const mt={continuation:{tokenize:DR},exit:MR,name:"list",tokenize:OR},IR={partial:!0,tokenize:_R},LR={partial:!0,tokenize:NR};function OR(e,t,n){const r=this,i=r.events[r.events.length-1];let o=i&&i[1].type==="linePrefix"?i[2].sliceSerialize(i[1],!0).length:0,a=0;return s;function s(f){const m=r.containerState.type||(f===42||f===43||f===45?"listUnordered":"listOrdered");if(m==="listUnordered"?!r.containerState.marker||f===r.containerState.marker:is(f)){if(r.containerState.type||(r.containerState.type=m,e.enter(m,{_container:!0})),m==="listUnordered")return e.enter("listItemPrefix"),f===42||f===45?e.check(qi,n,c)(f):c(f);if(!r.interrupt||f===49)return e.enter("listItemPrefix"),e.enter("listItemValue"),l(f)}return n(f)}function l(f){return is(f)&&++a<10?(e.consume(f),l):(!r.interrupt||a<2)&&(r.containerState.marker?f===r.containerState.marker:f===41||f===46)?(e.exit("listItemValue"),c(f)):n(f)}function c(f){return e.enter("listItemMarker"),e.consume(f),e.exit("listItemMarker"),r.containerState.marker=r.containerState.marker||f,e.check(wi,r.interrupt?n:u,e.attempt(IR,h,d))}function u(f){return r.containerState.initialBlankLine=!0,o++,h(f)}function d(f){return Ae(f)?(e.enter("listItemPrefixWhitespace"),e.consume(f),e.exit("listItemPrefixWhitespace"),h):n(f)}function h(f){return r.containerState.size=o+r.sliceSerialize(e.exit("listItemPrefix"),!0).length,t(f)}}function DR(e,t,n){const r=this;return r.containerState._closeFlow=void 0,e.check(wi,i,o);function i(s){return r.containerState.furtherBlankLines=r.containerState.furtherBlankLines||r.containerState.initialBlankLine,Re(e,t,"listItemIndent",r.containerState.size+1)(s)}function o(s){return r.containerState.furtherBlankLines||!Ae(s)?(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,a(s)):(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,e.attempt(LR,t,a)(s))}function a(s){return r.containerState._closeFlow=!0,r.interrupt=void 0,Re(e,e.attempt(mt,t,n),"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(s)}}function NR(e,t,n){const r=this;return Re(e,i,"listItemIndent",r.containerState.size+1);function i(o){const a=r.events[r.events.length-1];return a&&a[1].type==="listItemIndent"&&a[2].sliceSerialize(a[1],!0).length===r.containerState.size?t(o):n(o)}}function MR(e){e.exit(this.containerState.type)}function _R(e,t,n){const r=this;return Re(e,i,"listItemPrefixWhitespace",r.parser.constructs.disable.null.includes("codeIndented")?void 0:5);function i(o){const a=r.events[r.events.length-1];return!Ae(o)&&a&&a[1].type==="listItemPrefixWhitespace"?t(o):n(o)}}const hu={name:"setextUnderline",resolveTo:jR,tokenize:FR};function jR(e,t){let n=e.length,r,i,o;for(;n--;)if(e[n][0]==="enter"){if(e[n][1].type==="content"){r=n;break}e[n][1].type==="paragraph"&&(i=n)}else e[n][1].type==="content"&&e.splice(n,1),!o&&e[n][1].type==="definition"&&(o=n);const a={type:"setextHeading",start:{...e[r][1].start},end:{...e[e.length-1][1].end}};return e[i][1].type="setextHeadingText",o?(e.splice(i,0,["enter",a,t]),e.splice(o+1,0,["exit",e[r][1],t]),e[r][1].end={...e[o][1].end}):e[r][1]=a,e.push(["exit",a,t]),e}function FR(e,t,n){const r=this;let i;return o;function o(c){let u=r.events.length,d;for(;u--;)if(r.events[u][1].type!=="lineEnding"&&r.events[u][1].type!=="linePrefix"&&r.events[u][1].type!=="content"){d=r.events[u][1].type==="paragraph";break}return!r.parser.lazy[r.now().line]&&(r.interrupt||d)?(e.enter("setextHeadingLine"),i=c,a(c)):n(c)}function a(c){return e.enter("setextHeadingLineSequence"),s(c)}function s(c){return c===i?(e.consume(c),s):(e.exit("setextHeadingLineSequence"),Ae(c)?Re(e,l,"lineSuffix")(c):l(c))}function l(c){return c===null||oe(c)?(e.exit("setextHeadingLine"),t(c)):n(c)}}const HR={tokenize:UR};function UR(e){const t=this,n=e.attempt(wi,r,e.attempt(this.parser.constructs.flowInitial,i,Re(e,e.attempt(this.parser.constructs.flow,i,e.attempt(WE,i)),"linePrefix")));return n;function r(o){if(o===null){e.consume(o);return}return e.enter("lineEndingBlank"),e.consume(o),e.exit("lineEndingBlank"),t.currentConstruct=void 0,n}function i(o){if(o===null){e.consume(o);return}return e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),t.currentConstruct=void 0,n}}const BR={resolveAll:ah()},zR=oh("string"),$R=oh("text");function oh(e){return{resolveAll:ah(e==="text"?VR:void 0),tokenize:t};function t(n){const r=this,i=this.parser.constructs[e],o=n.attempt(i,a,s);return a;function a(u){return c(u)?o(u):s(u)}function s(u){if(u===null){n.consume(u);return}return n.enter("data"),n.consume(u),l}function l(u){return c(u)?(n.exit("data"),o(u)):(n.consume(u),l)}function c(u){if(u===null)return!0;const d=i[u];let h=-1;if(d)for(;++h<d.length;){const f=d[h];if(!f.previous||f.previous.call(r,r.previous))return!0}return!1}}}function ah(e){return t;function t(n,r){let i=-1,o;for(;++i<=n.length;)o===void 0?n[i]&&n[i][1].type==="data"&&(o=i,i++):(!n[i]||n[i][1].type!=="data")&&(i!==o+2&&(n[o][1].end=n[i-1][1].end,n.splice(o+2,i-o-2),i=o+2),o=void 0);return e?e(n,r):n}}function VR(e,t){let n=0;for(;++n<=e.length;)if((n===e.length||e[n][1].type==="lineEnding")&&e[n-1][1].type==="data"){const r=e[n-1][1],i=t.sliceStream(r);let o=i.length,a=-1,s=0,l;for(;o--;){const c=i[o];if(typeof c=="string"){for(a=c.length;c.charCodeAt(a-1)===32;)s++,a--;if(a)break;a=-1}else if(c===-2)l=!0,s++;else if(c!==-1){o++;break}}if(t._contentTypeTextTrailing&&n===e.length&&(s=0),s){const c={type:n===e.length||l||s<2?"lineSuffix":"hardBreakTrailing",start:{_bufferIndex:o?a:r.start._bufferIndex+a,_index:r.start._index+o,line:r.end.line,column:r.end.column-s,offset:r.end.offset-s},end:{...r.end}};r.end={...c.start},r.start.offset===r.end.offset?Object.assign(r,c):(e.splice(n,0,["enter",c,t],["exit",c,t]),n+=2)}n++}return e}const WR={42:mt,43:mt,45:mt,48:mt,49:mt,50:mt,51:mt,52:mt,53:mt,54:mt,55:mt,56:mt,57:mt,62:Jf},KR={91:YE},qR={[-2]:ca,[-1]:ca,32:ca},GR={35:nR,42:qi,45:[hu,qi],60:aR,61:hu,95:qi,96:du,126:du},QR={38:eh,92:Zf},YR={[-5]:ua,[-4]:ua,[-3]:ua,33:AR,38:eh,42:os,60:[EE,hR],91:ER,92:[eR,Zf],93:Ks,95:os,96:HE},XR={null:[os,BR]},JR={null:[42,95]},ZR={null:[]},eP=Object.freeze(Object.defineProperty({__proto__:null,attentionMarkers:JR,contentInitial:KR,disable:ZR,document:WR,flow:GR,flowInitial:qR,insideSpan:XR,string:QR,text:YR},Symbol.toStringTag,{value:"Module"}));function tP(e,t,n){let r={_bufferIndex:-1,_index:0,line:n&&n.line||1,column:n&&n.column||1,offset:n&&n.offset||0};const i={},o=[];let a=[],s=[];const l={attempt:k(T),check:k(S),consume:x,enter:w,exit:E,interrupt:k(S,{interrupt:!0})},c={code:null,containerState:{},defineSkip:p,events:[],now:m,parser:e,previous:null,sliceSerialize:h,sliceStream:f,write:d};let u=t.tokenize.call(c,l);return t.resolveAll&&o.push(t),c;function d(D){return a=Rt(a,D),b(),a[a.length-1]!==null?[]:(O(t,0),c.events=Do(o,c.events,c),c.events)}function h(D,L){return rP(f(D),L)}function f(D){return nP(a,D)}function m(){const{_bufferIndex:D,_index:L,line:z,column:H,offset:V}=r;return{_bufferIndex:D,_index:L,line:z,column:H,offset:V}}function p(D){i[D.line]=D.column,R()}function b(){let D;for(;r._index<a.length;){const L=a[r._index];if(typeof L=="string")for(D=r._index,r._bufferIndex<0&&(r._bufferIndex=0);r._index===D&&r._bufferIndex<L.length;)v(L.charCodeAt(r._bufferIndex));else v(L)}}function v(D){u=u(D)}function x(D){oe(D)?(r.line++,r.column=1,r.offset+=D===-3?2:1,R()):D!==-1&&(r.column++,r.offset++),r._bufferIndex<0?r._index++:(r._bufferIndex++,r._bufferIndex===a[r._index].length&&(r._bufferIndex=-1,r._index++)),c.previous=D}function w(D,L){const z=L||{};return z.type=D,z.start=m(),c.events.push(["enter",z,c]),s.push(z),z}function E(D){const L=s.pop();return L.end=m(),c.events.push(["exit",L,c]),L}function T(D,L){O(D,L.from)}function S(D,L){L.restore()}function k(D,L){return z;function z(H,V,Q){let Y,W,F,A;return Array.isArray(H)?Z(H):"tokenize"in H?Z([H]):ie(H);function ie(ve){return q;function q(me){const Te=me!==null&&ve[me],xe=me!==null&&ve.null,Se=[...Array.isArray(Te)?Te:Te?[Te]:[],...Array.isArray(xe)?xe:xe?[xe]:[]];return Z(Se)(me)}}function Z(ve){return Y=ve,W=0,ve.length===0?Q:C(ve[W])}function C(ve){return q;function q(me){return A=_(),F=ve,ve.partial||(c.currentConstruct=ve),ve.name&&c.parser.constructs.disable.null.includes(ve.name)?pe():ve.tokenize.call(L?Object.assign(Object.create(c),L):c,l,ae,pe)(me)}}function ae(ve){return D(F,A),V}function pe(ve){return A.restore(),++W<Y.length?C(Y[W]):Q}}}function O(D,L){D.resolveAll&&!o.includes(D)&&o.push(D),D.resolve&&At(c.events,L,c.events.length-L,D.resolve(c.events.slice(L),c)),D.resolveTo&&(c.events=D.resolveTo(c.events,c))}function _(){const D=m(),L=c.previous,z=c.currentConstruct,H=c.events.length,V=Array.from(s);return{from:H,restore:Q};function Q(){r=D,c.previous=L,c.currentConstruct=z,c.events.length=H,s=V,R()}}function R(){r.line in i&&r.column<2&&(r.column=i[r.line],r.offset+=i[r.line]-1)}}function nP(e,t){const n=t.start._index,r=t.start._bufferIndex,i=t.end._index,o=t.end._bufferIndex;let a;if(n===i)a=[e[n].slice(r,o)];else{if(a=e.slice(n,i),r>-1){const s=a[0];typeof s=="string"?a[0]=s.slice(r):a.shift()}o>0&&a.push(e[i].slice(0,o))}return a}function rP(e,t){let n=-1;const r=[];let i;for(;++n<e.length;){const o=e[n];let a;if(typeof o=="string")a=o;else switch(o){case-5:{a="\r";break}case-4:{a=`
177
+ `;break}case-3:{a=`\r
178
+ `;break}case-2:{a=t?" ":" ";break}case-1:{if(!t&&i)continue;a=" ";break}default:a=String.fromCharCode(o)}i=o===-2,r.push(a)}return r.join("")}function iP(e){const r={constructs:Yf([eP,...(e||{}).extensions||[]]),content:i(vE),defined:[],document:i(wE),flow:i(HR),lazy:{},string:i(zR),text:i($R)};return r;function i(o){return a;function a(s){return tP(r,o,s)}}}function oP(e){for(;!th(e););return e}const pu=/[\0\t\n\r]/g;function aP(){let e=1,t="",n=!0,r;return i;function i(o,a,s){const l=[];let c,u,d,h,f;for(o=t+(typeof o=="string"?o.toString():new TextDecoder(a||void 0).decode(o)),d=0,t="",n&&(o.charCodeAt(0)===65279&&d++,n=void 0);d<o.length;){if(pu.lastIndex=d,c=pu.exec(o),h=c&&c.index!==void 0?c.index:o.length,f=o.charCodeAt(h),!c){t=o.slice(d);break}if(f===10&&d===h&&r)l.push(-3),r=void 0;else switch(r&&(l.push(-5),r=void 0),d<h&&(l.push(o.slice(d,h)),e+=h-d),f){case 0:{l.push(65533),e++;break}case 9:{for(u=Math.ceil(e/4)*4,l.push(-2);e++<u;)l.push(-1);break}case 10:{l.push(-4),e=1;break}default:r=!0,e=1}d=h+1}return s&&(r&&l.push(-5),t&&l.push(t),l.push(null)),l}}const sP=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function lP(e){return e.replace(sP,cP)}function cP(e,t,n){if(t)return t;if(n.charCodeAt(0)===35){const i=n.charCodeAt(1),o=i===120||i===88;return Xf(n.slice(o?2:1),o?16:10)}return Ws(n)||e}const sh={}.hasOwnProperty;function uP(e,t,n){return t&&typeof t=="object"&&(n=t,t=void 0),dP(n)(oP(iP(n).document().write(aP()(e,t,!0))))}function dP(e){const t={transforms:[],canContainEols:["emphasis","fragment","heading","paragraph","strong"],enter:{autolink:o(Dn),autolinkProtocol:_,autolinkEmail:_,atxHeading:o(Ft),blockQuote:o(xe),characterEscape:_,characterReference:_,codeFenced:o(Se),codeFencedFenceInfo:a,codeFencedFenceMeta:a,codeIndented:o(Se,a),codeText:o(he,a),codeTextData:_,data:_,codeFlowValue:_,definition:o(Ge),definitionDestinationString:a,definitionLabelString:a,definitionTitleString:a,emphasis:o(Ze),hardBreakEscape:o(at),hardBreakTrailing:o(at),htmlFlow:o(Ht,a),htmlFlowData:_,htmlText:o(Ht,a),htmlTextData:_,image:o(On),label:a,link:o(Dn),listItem:o(Jt),listItemValue:h,listOrdered:o(Nn,d),listUnordered:o(Nn),paragraph:o(ir),reference:C,referenceString:a,resourceDestinationString:a,resourceTitleString:a,setextHeading:o(Ft),strong:o(Pt),thematicBreak:o(Zt)},exit:{atxHeading:l(),atxHeadingSequence:T,autolink:l(),autolinkEmail:Te,autolinkProtocol:me,blockQuote:l(),characterEscapeValue:R,characterReferenceMarkerHexadecimal:pe,characterReferenceMarkerNumeric:pe,characterReferenceValue:ve,characterReference:q,codeFenced:l(b),codeFencedFence:p,codeFencedFenceInfo:f,codeFencedFenceMeta:m,codeFlowValue:R,codeIndented:l(v),codeText:l(V),codeTextData:R,data:R,definition:l(),definitionDestinationString:E,definitionLabelString:x,definitionTitleString:w,emphasis:l(),hardBreakEscape:l(L),hardBreakTrailing:l(L),htmlFlow:l(z),htmlFlowData:R,htmlText:l(H),htmlTextData:R,image:l(Y),label:F,labelText:W,lineEnding:D,link:l(Q),listItem:l(),listOrdered:l(),listUnordered:l(),paragraph:l(),referenceString:ae,resourceDestinationString:A,resourceTitleString:ie,resource:Z,setextHeading:l(O),setextHeadingLineSequence:k,setextHeadingText:S,strong:l(),thematicBreak:l()}};lh(t,(e||{}).mdastExtensions||[]);const n={};return r;function r(M){let B={type:"root",children:[]};const ne={stack:[B],tokenStack:[],config:t,enter:s,exit:c,buffer:a,resume:u,data:n},le=[];let Ce=-1;for(;++Ce<M.length;)if(M[Ce][1].type==="listOrdered"||M[Ce][1].type==="listUnordered")if(M[Ce][0]==="enter")le.push(Ce);else{const nt=le.pop();Ce=i(M,nt,Ce)}for(Ce=-1;++Ce<M.length;){const nt=t[M[Ce][0]];sh.call(nt,M[Ce][1].type)&&nt[M[Ce][1].type].call(Object.assign({sliceSerialize:M[Ce][2].sliceSerialize},ne),M[Ce][1])}if(ne.tokenStack.length>0){const nt=ne.tokenStack[ne.tokenStack.length-1];(nt[1]||mu).call(ne,void 0,nt[0])}for(B.position={start:pn(M.length>0?M[0][1].start:{line:1,column:1,offset:0}),end:pn(M.length>0?M[M.length-2][1].end:{line:1,column:1,offset:0})},Ce=-1;++Ce<t.transforms.length;)B=t.transforms[Ce](B)||B;return B}function i(M,B,ne){let le=B-1,Ce=-1,nt=!1,Et,Ve,dt,It;for(;++le<=ne;){const ze=M[le];switch(ze[1].type){case"listUnordered":case"listOrdered":case"blockQuote":{ze[0]==="enter"?Ce++:Ce--,It=void 0;break}case"lineEndingBlank":{ze[0]==="enter"&&(Et&&!It&&!Ce&&!dt&&(dt=le),It=void 0);break}case"linePrefix":case"listItemValue":case"listItemMarker":case"listItemPrefix":case"listItemPrefixWhitespace":break;default:It=void 0}if(!Ce&&ze[0]==="enter"&&ze[1].type==="listItemPrefix"||Ce===-1&&ze[0]==="exit"&&(ze[1].type==="listUnordered"||ze[1].type==="listOrdered")){if(Et){let Ut=le;for(Ve=void 0;Ut--;){const pt=M[Ut];if(pt[1].type==="lineEnding"||pt[1].type==="lineEndingBlank"){if(pt[0]==="exit")continue;Ve&&(M[Ve][1].type="lineEndingBlank",nt=!0),pt[1].type="lineEnding",Ve=Ut}else if(!(pt[1].type==="linePrefix"||pt[1].type==="blockQuotePrefix"||pt[1].type==="blockQuotePrefixWhitespace"||pt[1].type==="blockQuoteMarker"||pt[1].type==="listItemIndent"))break}dt&&(!Ve||dt<Ve)&&(Et._spread=!0),Et.end=Object.assign({},Ve?M[Ve][1].start:ze[1].end),M.splice(Ve||le,0,["exit",Et,ze[2]]),le++,ne++}if(ze[1].type==="listItemPrefix"){const Ut={type:"listItem",_spread:!1,start:Object.assign({},ze[1].start),end:void 0};Et=Ut,M.splice(le,0,["enter",Ut,ze[2]]),le++,ne++,dt=void 0,It=!0}}}return M[B][1]._spread=nt,ne}function o(M,B){return ne;function ne(le){s.call(this,M(le),le),B&&B.call(this,le)}}function a(){this.stack.push({type:"fragment",children:[]})}function s(M,B,ne){this.stack[this.stack.length-1].children.push(M),this.stack.push(M),this.tokenStack.push([B,ne||void 0]),M.position={start:pn(B.start),end:void 0}}function l(M){return B;function B(ne){M&&M.call(this,ne),c.call(this,ne)}}function c(M,B){const ne=this.stack.pop(),le=this.tokenStack.pop();if(le)le[0].type!==M.type&&(B?B.call(this,M,le[0]):(le[1]||mu).call(this,M,le[0]));else throw new Error("Cannot close `"+M.type+"` ("+ri({start:M.start,end:M.end})+"): it’s not open");ne.position.end=pn(M.end)}function u(){return Vs(this.stack.pop())}function d(){this.data.expectingFirstListItemValue=!0}function h(M){if(this.data.expectingFirstListItemValue){const B=this.stack[this.stack.length-2];B.start=Number.parseInt(this.sliceSerialize(M),10),this.data.expectingFirstListItemValue=void 0}}function f(){const M=this.resume(),B=this.stack[this.stack.length-1];B.lang=M}function m(){const M=this.resume(),B=this.stack[this.stack.length-1];B.meta=M}function p(){this.data.flowCodeInside||(this.buffer(),this.data.flowCodeInside=!0)}function b(){const M=this.resume(),B=this.stack[this.stack.length-1];B.value=M.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,""),this.data.flowCodeInside=void 0}function v(){const M=this.resume(),B=this.stack[this.stack.length-1];B.value=M.replace(/(\r?\n|\r)$/g,"")}function x(M){const B=this.resume(),ne=this.stack[this.stack.length-1];ne.label=B,ne.identifier=Nt(this.sliceSerialize(M)).toLowerCase()}function w(){const M=this.resume(),B=this.stack[this.stack.length-1];B.title=M}function E(){const M=this.resume(),B=this.stack[this.stack.length-1];B.url=M}function T(M){const B=this.stack[this.stack.length-1];if(!B.depth){const ne=this.sliceSerialize(M).length;B.depth=ne}}function S(){this.data.setextHeadingSlurpLineEnding=!0}function k(M){const B=this.stack[this.stack.length-1];B.depth=this.sliceSerialize(M).codePointAt(0)===61?1:2}function O(){this.data.setextHeadingSlurpLineEnding=void 0}function _(M){const ne=this.stack[this.stack.length-1].children;let le=ne[ne.length-1];(!le||le.type!=="text")&&(le=Tt(),le.position={start:pn(M.start),end:void 0},ne.push(le)),this.stack.push(le)}function R(M){const B=this.stack.pop();B.value+=this.sliceSerialize(M),B.position.end=pn(M.end)}function D(M){const B=this.stack[this.stack.length-1];if(this.data.atHardBreak){const ne=B.children[B.children.length-1];ne.position.end=pn(M.end),this.data.atHardBreak=void 0;return}!this.data.setextHeadingSlurpLineEnding&&t.canContainEols.includes(B.type)&&(_.call(this,M),R.call(this,M))}function L(){this.data.atHardBreak=!0}function z(){const M=this.resume(),B=this.stack[this.stack.length-1];B.value=M}function H(){const M=this.resume(),B=this.stack[this.stack.length-1];B.value=M}function V(){const M=this.resume(),B=this.stack[this.stack.length-1];B.value=M}function Q(){const M=this.stack[this.stack.length-1];if(this.data.inReference){const B=this.data.referenceType||"shortcut";M.type+="Reference",M.referenceType=B,delete M.url,delete M.title}else delete M.identifier,delete M.label;this.data.referenceType=void 0}function Y(){const M=this.stack[this.stack.length-1];if(this.data.inReference){const B=this.data.referenceType||"shortcut";M.type+="Reference",M.referenceType=B,delete M.url,delete M.title}else delete M.identifier,delete M.label;this.data.referenceType=void 0}function W(M){const B=this.sliceSerialize(M),ne=this.stack[this.stack.length-2];ne.label=lP(B),ne.identifier=Nt(B).toLowerCase()}function F(){const M=this.stack[this.stack.length-1],B=this.resume(),ne=this.stack[this.stack.length-1];if(this.data.inReference=!0,ne.type==="link"){const le=M.children;ne.children=le}else ne.alt=B}function A(){const M=this.resume(),B=this.stack[this.stack.length-1];B.url=M}function ie(){const M=this.resume(),B=this.stack[this.stack.length-1];B.title=M}function Z(){this.data.inReference=void 0}function C(){this.data.referenceType="collapsed"}function ae(M){const B=this.resume(),ne=this.stack[this.stack.length-1];ne.label=B,ne.identifier=Nt(this.sliceSerialize(M)).toLowerCase(),this.data.referenceType="full"}function pe(M){this.data.characterReferenceType=M.type}function ve(M){const B=this.sliceSerialize(M),ne=this.data.characterReferenceType;let le;ne?(le=Xf(B,ne==="characterReferenceMarkerNumeric"?10:16),this.data.characterReferenceType=void 0):le=Ws(B);const Ce=this.stack[this.stack.length-1];Ce.value+=le}function q(M){const B=this.stack.pop();B.position.end=pn(M.end)}function me(M){R.call(this,M);const B=this.stack[this.stack.length-1];B.url=this.sliceSerialize(M)}function Te(M){R.call(this,M);const B=this.stack[this.stack.length-1];B.url="mailto:"+this.sliceSerialize(M)}function xe(){return{type:"blockquote",children:[]}}function Se(){return{type:"code",lang:null,meta:null,value:""}}function he(){return{type:"inlineCode",value:""}}function Ge(){return{type:"definition",identifier:"",label:null,title:null,url:""}}function Ze(){return{type:"emphasis",children:[]}}function Ft(){return{type:"heading",depth:0,children:[]}}function at(){return{type:"break"}}function Ht(){return{type:"html",value:""}}function On(){return{type:"image",title:null,url:"",alt:null}}function Dn(){return{type:"link",title:null,url:"",children:[]}}function Nn(M){return{type:"list",ordered:M.type==="listOrdered",start:null,spread:M._spread,children:[]}}function Jt(M){return{type:"listItem",spread:M._spread,checked:null,children:[]}}function ir(){return{type:"paragraph",children:[]}}function Pt(){return{type:"strong",children:[]}}function Tt(){return{type:"text",value:""}}function Zt(){return{type:"thematicBreak"}}}function pn(e){return{line:e.line,column:e.column,offset:e.offset}}function lh(e,t){let n=-1;for(;++n<t.length;){const r=t[n];Array.isArray(r)?lh(e,r):fP(e,r)}}function fP(e,t){let n;for(n in t)if(sh.call(t,n))switch(n){case"canContainEols":{const r=t[n];r&&e[n].push(...r);break}case"transforms":{const r=t[n];r&&e[n].push(...r);break}case"enter":case"exit":{const r=t[n];r&&Object.assign(e[n],r);break}}}function mu(e,t){throw e?new Error("Cannot close `"+e.type+"` ("+ri({start:e.start,end:e.end})+"): a different token (`"+t.type+"`, "+ri({start:t.start,end:t.end})+") is open"):new Error("Cannot close document, a token (`"+t.type+"`, "+ri({start:t.start,end:t.end})+") is still open")}function hP(e){const t=this;t.parser=n;function n(r){return uP(r,{...t.data("settings"),...e,extensions:t.data("micromarkExtensions")||[],mdastExtensions:t.data("fromMarkdownExtensions")||[]})}}function pP(e,t){const n={type:"element",tagName:"blockquote",properties:{},children:e.wrap(e.all(t),!0)};return e.patch(t,n),e.applyData(t,n)}function mP(e,t){const n={type:"element",tagName:"br",properties:{},children:[]};return e.patch(t,n),[e.applyData(t,n),{type:"text",value:`
179
+ `}]}function gP(e,t){const n=t.value?t.value+`
180
+ `:"",r={},i=t.lang?t.lang.split(/\s+/):[];i.length>0&&(r.className=["language-"+i[0]]);let o={type:"element",tagName:"code",properties:r,children:[{type:"text",value:n}]};return t.meta&&(o.data={meta:t.meta}),e.patch(t,o),o=e.applyData(t,o),o={type:"element",tagName:"pre",properties:{},children:[o]},e.patch(t,o),o}function yP(e,t){const n={type:"element",tagName:"del",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function bP(e,t){const n={type:"element",tagName:"em",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function vP(e,t){const n=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",r=String(t.identifier).toUpperCase(),i=Mr(r.toLowerCase()),o=e.footnoteOrder.indexOf(r);let a,s=e.footnoteCounts.get(r);s===void 0?(s=0,e.footnoteOrder.push(r),a=e.footnoteOrder.length):a=o+1,s+=1,e.footnoteCounts.set(r,s);const l={type:"element",tagName:"a",properties:{href:"#"+n+"fn-"+i,id:n+"fnref-"+i+(s>1?"-"+s:""),dataFootnoteRef:!0,ariaDescribedBy:["footnote-label"]},children:[{type:"text",value:String(a)}]};e.patch(t,l);const c={type:"element",tagName:"sup",properties:{},children:[l]};return e.patch(t,c),e.applyData(t,c)}function xP(e,t){const n={type:"element",tagName:"h"+t.depth,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function wP(e,t){if(e.options.allowDangerousHtml){const n={type:"raw",value:t.value};return e.patch(t,n),e.applyData(t,n)}}function ch(e,t){const n=t.referenceType;let r="]";if(n==="collapsed"?r+="[]":n==="full"&&(r+="["+(t.label||t.identifier)+"]"),t.type==="imageReference")return[{type:"text",value:"!["+t.alt+r}];const i=e.all(t),o=i[0];o&&o.type==="text"?o.value="["+o.value:i.unshift({type:"text",value:"["});const a=i[i.length-1];return a&&a.type==="text"?a.value+=r:i.push({type:"text",value:r}),i}function kP(e,t){const n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return ch(e,t);const i={src:Mr(r.url||""),alt:t.alt};r.title!==null&&r.title!==void 0&&(i.title=r.title);const o={type:"element",tagName:"img",properties:i,children:[]};return e.patch(t,o),e.applyData(t,o)}function SP(e,t){const n={src:Mr(t.url)};t.alt!==null&&t.alt!==void 0&&(n.alt=t.alt),t.title!==null&&t.title!==void 0&&(n.title=t.title);const r={type:"element",tagName:"img",properties:n,children:[]};return e.patch(t,r),e.applyData(t,r)}function AP(e,t){const n={type:"text",value:t.value.replace(/\r?\n|\r/g," ")};e.patch(t,n);const r={type:"element",tagName:"code",properties:{},children:[n]};return e.patch(t,r),e.applyData(t,r)}function CP(e,t){const n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return ch(e,t);const i={href:Mr(r.url||"")};r.title!==null&&r.title!==void 0&&(i.title=r.title);const o={type:"element",tagName:"a",properties:i,children:e.all(t)};return e.patch(t,o),e.applyData(t,o)}function EP(e,t){const n={href:Mr(t.url)};t.title!==null&&t.title!==void 0&&(n.title=t.title);const r={type:"element",tagName:"a",properties:n,children:e.all(t)};return e.patch(t,r),e.applyData(t,r)}function RP(e,t,n){const r=e.all(t),i=n?PP(n):uh(t),o={},a=[];if(typeof t.checked=="boolean"){const u=r[0];let d;u&&u.type==="element"&&u.tagName==="p"?d=u:(d={type:"element",tagName:"p",properties:{},children:[]},r.unshift(d)),d.children.length>0&&d.children.unshift({type:"text",value:" "}),d.children.unshift({type:"element",tagName:"input",properties:{type:"checkbox",checked:t.checked,disabled:!0},children:[]}),o.className=["task-list-item"]}let s=-1;for(;++s<r.length;){const u=r[s];(i||s!==0||u.type!=="element"||u.tagName!=="p")&&a.push({type:"text",value:`
181
+ `}),u.type==="element"&&u.tagName==="p"&&!i?a.push(...u.children):a.push(u)}const l=r[r.length-1];l&&(i||l.type!=="element"||l.tagName!=="p")&&a.push({type:"text",value:`
182
+ `});const c={type:"element",tagName:"li",properties:o,children:a};return e.patch(t,c),e.applyData(t,c)}function PP(e){let t=!1;if(e.type==="list"){t=e.spread||!1;const n=e.children;let r=-1;for(;!t&&++r<n.length;)t=uh(n[r])}return t}function uh(e){const t=e.spread;return t??e.children.length>1}function TP(e,t){const n={},r=e.all(t);let i=-1;for(typeof t.start=="number"&&t.start!==1&&(n.start=t.start);++i<r.length;){const a=r[i];if(a.type==="element"&&a.tagName==="li"&&a.properties&&Array.isArray(a.properties.className)&&a.properties.className.includes("task-list-item")){n.className=["contains-task-list"];break}}const o={type:"element",tagName:t.ordered?"ol":"ul",properties:n,children:e.wrap(r,!0)};return e.patch(t,o),e.applyData(t,o)}function IP(e,t){const n={type:"element",tagName:"p",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function LP(e,t){const n={type:"root",children:e.wrap(e.all(t))};return e.patch(t,n),e.applyData(t,n)}function OP(e,t){const n={type:"element",tagName:"strong",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function DP(e,t){const n=e.all(t),r=n.shift(),i=[];if(r){const a={type:"element",tagName:"thead",properties:{},children:e.wrap([r],!0)};e.patch(t.children[0],a),i.push(a)}if(n.length>0){const a={type:"element",tagName:"tbody",properties:{},children:e.wrap(n,!0)},s=Us(t.children[1]),l=$f(t.children[t.children.length-1]);s&&l&&(a.position={start:s,end:l}),i.push(a)}const o={type:"element",tagName:"table",properties:{},children:e.wrap(i,!0)};return e.patch(t,o),e.applyData(t,o)}function NP(e,t,n){const r=n?n.children:void 0,o=(r?r.indexOf(t):1)===0?"th":"td",a=n&&n.type==="table"?n.align:void 0,s=a?a.length:t.children.length;let l=-1;const c=[];for(;++l<s;){const d=t.children[l],h={},f=a?a[l]:void 0;f&&(h.align=f);let m={type:"element",tagName:o,properties:h,children:[]};d&&(m.children=e.all(d),e.patch(d,m),m=e.applyData(d,m)),c.push(m)}const u={type:"element",tagName:"tr",properties:{},children:e.wrap(c,!0)};return e.patch(t,u),e.applyData(t,u)}function MP(e,t){const n={type:"element",tagName:"td",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}const gu=9,yu=32;function _P(e){const t=String(e),n=/\r?\n|\r/g;let r=n.exec(t),i=0;const o=[];for(;r;)o.push(bu(t.slice(i,r.index),i>0,!0),r[0]),i=r.index+r[0].length,r=n.exec(t);return o.push(bu(t.slice(i),i>0,!1)),o.join("")}function bu(e,t,n){let r=0,i=e.length;if(t){let o=e.codePointAt(r);for(;o===gu||o===yu;)r++,o=e.codePointAt(r)}if(n){let o=e.codePointAt(i-1);for(;o===gu||o===yu;)i--,o=e.codePointAt(i-1)}return i>r?e.slice(r,i):""}function jP(e,t){const n={type:"text",value:_P(String(t.value))};return e.patch(t,n),e.applyData(t,n)}function FP(e,t){const n={type:"element",tagName:"hr",properties:{},children:[]};return e.patch(t,n),e.applyData(t,n)}const HP={blockquote:pP,break:mP,code:gP,delete:yP,emphasis:bP,footnoteReference:vP,heading:xP,html:wP,imageReference:kP,image:SP,inlineCode:AP,linkReference:CP,link:EP,listItem:RP,list:TP,paragraph:IP,root:LP,strong:OP,table:DP,tableCell:MP,tableRow:NP,text:jP,thematicBreak:FP,toml:Ni,yaml:Ni,definition:Ni,footnoteDefinition:Ni};function Ni(){}const dh=-1,No=0,oi=1,po=2,qs=3,Gs=4,Qs=5,Ys=6,fh=7,hh=8,UP=typeof self=="object"?self:globalThis,vu=(e,t)=>{switch(e){case"Function":case"SharedWorker":case"Worker":case"eval":case"setInterval":case"setTimeout":throw new TypeError("unable to deserialize "+e)}return new UP[e](t)},BP=(e,t)=>{const n=(i,o)=>(e.set(o,i),i),r=i=>{if(e.has(i))return e.get(i);const[o,a]=t[i];switch(o){case No:case dh:return n(a,i);case oi:{const s=n([],i);for(const l of a)s.push(r(l));return s}case po:{const s=n({},i);for(const[l,c]of a)s[r(l)]=r(c);return s}case qs:return n(new Date(a),i);case Gs:{const{source:s,flags:l}=a;return n(new RegExp(s,l),i)}case Qs:{const s=n(new Map,i);for(const[l,c]of a)s.set(r(l),r(c));return s}case Ys:{const s=n(new Set,i);for(const l of a)s.add(r(l));return s}case fh:{const{name:s,message:l}=a;return n(vu(s,l),i)}case hh:return n(BigInt(a),i);case"BigInt":return n(Object(BigInt(a)),i);case"ArrayBuffer":return n(new Uint8Array(a).buffer,a);case"DataView":{const{buffer:s}=new Uint8Array(a);return n(new DataView(s),a)}}return n(vu(o,a),i)};return r},xu=e=>BP(new Map,e)(0),Un="",{toString:zP}={},{keys:$P}=Object,Zr=e=>{const t=typeof e;if(t!=="object"||!e)return[No,t];const n=zP.call(e).slice(8,-1);switch(n){case"Array":return[oi,Un];case"Object":return[po,Un];case"Date":return[qs,Un];case"RegExp":return[Gs,Un];case"Map":return[Qs,Un];case"Set":return[Ys,Un];case"DataView":return[oi,n]}return n.includes("Array")?[oi,n]:n.includes("Error")?[fh,n]:[po,n]},Mi=([e,t])=>e===No&&(t==="function"||t==="symbol"),VP=(e,t,n,r)=>{const i=(a,s)=>{const l=r.push(a)-1;return n.set(s,l),l},o=a=>{if(n.has(a))return n.get(a);let[s,l]=Zr(a);switch(s){case No:{let u=a;switch(l){case"bigint":s=hh,u=a.toString();break;case"function":case"symbol":if(e)throw new TypeError("unable to serialize "+l);u=null;break;case"undefined":return i([dh],a)}return i([s,u],a)}case oi:{if(l){let h=a;return l==="DataView"?h=new Uint8Array(a.buffer):l==="ArrayBuffer"&&(h=new Uint8Array(a)),i([l,[...h]],a)}const u=[],d=i([s,u],a);for(const h of a)u.push(o(h));return d}case po:{if(l)switch(l){case"BigInt":return i([l,a.toString()],a);case"Boolean":case"Number":case"String":return i([l,a.valueOf()],a)}if(t&&"toJSON"in a)return o(a.toJSON());const u=[],d=i([s,u],a);for(const h of $P(a))(e||!Mi(Zr(a[h])))&&u.push([o(h),o(a[h])]);return d}case qs:return i([s,isNaN(a.getTime())?Un:a.toISOString()],a);case Gs:{const{source:u,flags:d}=a;return i([s,{source:u,flags:d}],a)}case Qs:{const u=[],d=i([s,u],a);for(const[h,f]of a)(e||!(Mi(Zr(h))||Mi(Zr(f))))&&u.push([o(h),o(f)]);return d}case Ys:{const u=[],d=i([s,u],a);for(const h of a)(e||!Mi(Zr(h)))&&u.push(o(h));return d}}const{message:c}=a;return i([s,{name:l,message:c}],a)};return o},wu=(e,{json:t,lossy:n}={})=>{const r=[];return VP(!(t||n),!!t,new Map,r)(e),r},mo=typeof structuredClone=="function"?(e,t)=>t&&("json"in t||"lossy"in t)?xu(wu(e,t)):structuredClone(e):(e,t)=>xu(wu(e,t));function WP(e,t){const n=[{type:"text",value:"↩"}];return t>1&&n.push({type:"element",tagName:"sup",properties:{},children:[{type:"text",value:String(t)}]}),n}function KP(e,t){return"Back to reference "+(e+1)+(t>1?"-"+t:"")}function qP(e){const t=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",n=e.options.footnoteBackContent||WP,r=e.options.footnoteBackLabel||KP,i=e.options.footnoteLabel||"Footnotes",o=e.options.footnoteLabelTagName||"h2",a=e.options.footnoteLabelProperties||{className:["sr-only"]},s=[];let l=-1;for(;++l<e.footnoteOrder.length;){const c=e.footnoteById.get(e.footnoteOrder[l]);if(!c)continue;const u=e.all(c),d=String(c.identifier).toUpperCase(),h=Mr(d.toLowerCase());let f=0;const m=[],p=e.footnoteCounts.get(d);for(;p!==void 0&&++f<=p;){m.length>0&&m.push({type:"text",value:" "});let x=typeof n=="string"?n:n(l,f);typeof x=="string"&&(x={type:"text",value:x}),m.push({type:"element",tagName:"a",properties:{href:"#"+t+"fnref-"+h+(f>1?"-"+f:""),dataFootnoteBackref:"",ariaLabel:typeof r=="string"?r:r(l,f),className:["data-footnote-backref"]},children:Array.isArray(x)?x:[x]})}const b=u[u.length-1];if(b&&b.type==="element"&&b.tagName==="p"){const x=b.children[b.children.length-1];x&&x.type==="text"?x.value+=" ":b.children.push({type:"text",value:" "}),b.children.push(...m)}else u.push(...m);const v={type:"element",tagName:"li",properties:{id:t+"fn-"+h},children:e.wrap(u,!0)};e.patch(c,v),s.push(v)}if(s.length!==0)return{type:"element",tagName:"section",properties:{dataFootnotes:!0,className:["footnotes"]},children:[{type:"element",tagName:o,properties:{...mo(a),id:"footnote-label"},children:[{type:"text",value:i}]},{type:"text",value:`
183
+ `},{type:"element",tagName:"ol",properties:{},children:e.wrap(s,!0)},{type:"text",value:`
184
+ `}]}}const Mo=function(e){if(e==null)return XP;if(typeof e=="function")return _o(e);if(typeof e=="object")return Array.isArray(e)?GP(e):QP(e);if(typeof e=="string")return YP(e);throw new Error("Expected function, string, or object as test")};function GP(e){const t=[];let n=-1;for(;++n<e.length;)t[n]=Mo(e[n]);return _o(r);function r(...i){let o=-1;for(;++o<t.length;)if(t[o].apply(this,i))return!0;return!1}}function QP(e){const t=e;return _o(n);function n(r){const i=r;let o;for(o in e)if(i[o]!==t[o])return!1;return!0}}function YP(e){return _o(t);function t(n){return n&&n.type===e}}function _o(e){return t;function t(n,r,i){return!!(JP(n)&&e.call(this,n,typeof r=="number"?r:void 0,i||void 0))}}function XP(){return!0}function JP(e){return e!==null&&typeof e=="object"&&"type"in e}const ph=[],ZP=!0,as=!1,eT="skip";function mh(e,t,n,r){let i;typeof t=="function"&&typeof n!="function"?(r=n,n=t):i=t;const o=Mo(i),a=r?-1:1;s(e,void 0,[])();function s(l,c,u){const d=l&&typeof l=="object"?l:{};if(typeof d.type=="string"){const f=typeof d.tagName=="string"?d.tagName:typeof d.name=="string"?d.name:void 0;Object.defineProperty(h,"name",{value:"node ("+(l.type+(f?"<"+f+">":""))+")"})}return h;function h(){let f=ph,m,p,b;if((!t||o(l,c,u[u.length-1]||void 0))&&(f=tT(n(l,u)),f[0]===as))return f;if("children"in l&&l.children){const v=l;if(v.children&&f[0]!==eT)for(p=(r?v.children.length:-1)+a,b=u.concat(v);p>-1&&p<v.children.length;){const x=v.children[p];if(m=s(x,p,b)(),m[0]===as)return m;p=typeof m[1]=="number"?m[1]:p+a}}return f}}}function tT(e){return Array.isArray(e)?e:typeof e=="number"?[ZP,e]:e==null?ph:[e]}function Xs(e,t,n,r){let i,o,a;typeof t=="function"&&typeof n!="function"?(o=void 0,a=t,i=n):(o=t,a=n,i=r),mh(e,o,s,i);function s(l,c){const u=c[c.length-1],d=u?u.children.indexOf(l):void 0;return a(l,d,u)}}const ss={}.hasOwnProperty,nT={};function rT(e,t){const n=t||nT,r=new Map,i=new Map,o=new Map,a={...HP,...n.handlers},s={all:c,applyData:oT,definitionById:r,footnoteById:i,footnoteCounts:o,footnoteOrder:[],handlers:a,one:l,options:n,patch:iT,wrap:sT};return Xs(e,function(u){if(u.type==="definition"||u.type==="footnoteDefinition"){const d=u.type==="definition"?r:i,h=String(u.identifier).toUpperCase();d.has(h)||d.set(h,u)}}),s;function l(u,d){const h=u.type,f=s.handlers[h];if(ss.call(s.handlers,h)&&f)return f(s,u,d);if(s.options.passThrough&&s.options.passThrough.includes(h)){if("children"in u){const{children:p,...b}=u,v=mo(b);return v.children=s.all(u),v}return mo(u)}return(s.options.unknownHandler||aT)(s,u,d)}function c(u){const d=[];if("children"in u){const h=u.children;let f=-1;for(;++f<h.length;){const m=s.one(h[f],u);if(m){if(f&&h[f-1].type==="break"&&(!Array.isArray(m)&&m.type==="text"&&(m.value=ku(m.value)),!Array.isArray(m)&&m.type==="element")){const p=m.children[0];p&&p.type==="text"&&(p.value=ku(p.value))}Array.isArray(m)?d.push(...m):d.push(m)}}}return d}}function iT(e,t){e.position&&(t.position=W1(e))}function oT(e,t){let n=t;if(e&&e.data){const r=e.data.hName,i=e.data.hChildren,o=e.data.hProperties;if(typeof r=="string")if(n.type==="element")n.tagName=r;else{const a="children"in n?n.children:[n];n={type:"element",tagName:r,properties:{},children:a}}n.type==="element"&&o&&Object.assign(n.properties,mo(o)),"children"in n&&n.children&&i!==null&&i!==void 0&&(n.children=i)}return n}function aT(e,t){const n=t.data||{},r="value"in t&&!(ss.call(n,"hProperties")||ss.call(n,"hChildren"))?{type:"text",value:t.value}:{type:"element",tagName:"div",properties:{},children:e.all(t)};return e.patch(t,r),e.applyData(t,r)}function sT(e,t){const n=[];let r=-1;for(t&&n.push({type:"text",value:`
185
+ `});++r<e.length;)r&&n.push({type:"text",value:`
186
+ `}),n.push(e[r]);return t&&e.length>0&&n.push({type:"text",value:`
187
+ `}),n}function ku(e){let t=0,n=e.charCodeAt(t);for(;n===9||n===32;)t++,n=e.charCodeAt(t);return e.slice(t)}function Su(e,t){const n=rT(e,t),r=n.one(e,void 0),i=qP(n),o=Array.isArray(r)?{type:"root",children:r}:r||{type:"root",children:[]};return i&&o.children.push({type:"text",value:`
188
+ `},i),o}function lT(e,t){return e&&"run"in e?async function(n,r){const i=Su(n,{file:r,...t});await e.run(i,r)}:function(n,r){return Su(n,{file:r,...e||t})}}function Au(e){if(e)throw e}var Gi=Object.prototype.hasOwnProperty,gh=Object.prototype.toString,Cu=Object.defineProperty,Eu=Object.getOwnPropertyDescriptor,Ru=function(t){return typeof Array.isArray=="function"?Array.isArray(t):gh.call(t)==="[object Array]"},Pu=function(t){if(!t||gh.call(t)!=="[object Object]")return!1;var n=Gi.call(t,"constructor"),r=t.constructor&&t.constructor.prototype&&Gi.call(t.constructor.prototype,"isPrototypeOf");if(t.constructor&&!n&&!r)return!1;var i;for(i in t);return typeof i>"u"||Gi.call(t,i)},Tu=function(t,n){Cu&&n.name==="__proto__"?Cu(t,n.name,{enumerable:!0,configurable:!0,value:n.newValue,writable:!0}):t[n.name]=n.newValue},Iu=function(t,n){if(n==="__proto__")if(Gi.call(t,n)){if(Eu)return Eu(t,n).value}else return;return t[n]},cT=function e(){var t,n,r,i,o,a,s=arguments[0],l=1,c=arguments.length,u=!1;for(typeof s=="boolean"&&(u=s,s=arguments[1]||{},l=2),(s==null||typeof s!="object"&&typeof s!="function")&&(s={});l<c;++l)if(t=arguments[l],t!=null)for(n in t)r=Iu(s,n),i=Iu(t,n),s!==i&&(u&&i&&(Pu(i)||(o=Ru(i)))?(o?(o=!1,a=r&&Ru(r)?r:[]):a=r&&Pu(r)?r:{},Tu(s,{name:n,newValue:e(u,a,i)})):typeof i<"u"&&Tu(s,{name:n,newValue:i}));return s};const da=Sd(cT);function ls(e){if(typeof e!="object"||e===null)return!1;const t=Object.getPrototypeOf(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(Symbol.toStringTag in e)&&!(Symbol.iterator in e)}function uT(){const e=[],t={run:n,use:r};return t;function n(...i){let o=-1;const a=i.pop();if(typeof a!="function")throw new TypeError("Expected function as last argument, not "+a);s(null,...i);function s(l,...c){const u=e[++o];let d=-1;if(l){a(l);return}for(;++d<i.length;)(c[d]===null||c[d]===void 0)&&(c[d]=i[d]);i=c,u?dT(u,s)(...c):a(null,...c)}}function r(i){if(typeof i!="function")throw new TypeError("Expected `middelware` to be a function, not "+i);return e.push(i),t}}function dT(e,t){let n;return r;function r(...a){const s=e.length>a.length;let l;s&&a.push(i);try{l=e.apply(this,a)}catch(c){const u=c;if(s&&n)throw u;return i(u)}s||(l&&l.then&&typeof l.then=="function"?l.then(o,i):l instanceof Error?i(l):o(l))}function i(a,...s){n||(n=!0,t(a,...s))}function o(a){i(null,a)}}const Wt={basename:fT,dirname:hT,extname:pT,join:mT,sep:"/"};function fT(e,t){if(t!==void 0&&typeof t!="string")throw new TypeError('"ext" argument must be a string');ki(e);let n=0,r=-1,i=e.length,o;if(t===void 0||t.length===0||t.length>e.length){for(;i--;)if(e.codePointAt(i)===47){if(o){n=i+1;break}}else r<0&&(o=!0,r=i+1);return r<0?"":e.slice(n,r)}if(t===e)return"";let a=-1,s=t.length-1;for(;i--;)if(e.codePointAt(i)===47){if(o){n=i+1;break}}else a<0&&(o=!0,a=i+1),s>-1&&(e.codePointAt(i)===t.codePointAt(s--)?s<0&&(r=i):(s=-1,r=a));return n===r?r=a:r<0&&(r=e.length),e.slice(n,r)}function hT(e){if(ki(e),e.length===0)return".";let t=-1,n=e.length,r;for(;--n;)if(e.codePointAt(n)===47){if(r){t=n;break}}else r||(r=!0);return t<0?e.codePointAt(0)===47?"/":".":t===1&&e.codePointAt(0)===47?"//":e.slice(0,t)}function pT(e){ki(e);let t=e.length,n=-1,r=0,i=-1,o=0,a;for(;t--;){const s=e.codePointAt(t);if(s===47){if(a){r=t+1;break}continue}n<0&&(a=!0,n=t+1),s===46?i<0?i=t:o!==1&&(o=1):i>-1&&(o=-1)}return i<0||n<0||o===0||o===1&&i===n-1&&i===r+1?"":e.slice(i,n)}function mT(...e){let t=-1,n;for(;++t<e.length;)ki(e[t]),e[t]&&(n=n===void 0?e[t]:n+"/"+e[t]);return n===void 0?".":gT(n)}function gT(e){ki(e);const t=e.codePointAt(0)===47;let n=yT(e,!t);return n.length===0&&!t&&(n="."),n.length>0&&e.codePointAt(e.length-1)===47&&(n+="/"),t?"/"+n:n}function yT(e,t){let n="",r=0,i=-1,o=0,a=-1,s,l;for(;++a<=e.length;){if(a<e.length)s=e.codePointAt(a);else{if(s===47)break;s=47}if(s===47){if(!(i===a-1||o===1))if(i!==a-1&&o===2){if(n.length<2||r!==2||n.codePointAt(n.length-1)!==46||n.codePointAt(n.length-2)!==46){if(n.length>2){if(l=n.lastIndexOf("/"),l!==n.length-1){l<0?(n="",r=0):(n=n.slice(0,l),r=n.length-1-n.lastIndexOf("/")),i=a,o=0;continue}}else if(n.length>0){n="",r=0,i=a,o=0;continue}}t&&(n=n.length>0?n+"/..":"..",r=2)}else n.length>0?n+="/"+e.slice(i+1,a):n=e.slice(i+1,a),r=a-i-1;i=a,o=0}else s===46&&o>-1?o++:o=-1}return n}function ki(e){if(typeof e!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(e))}const bT={cwd:vT};function vT(){return"/"}function cs(e){return!!(e!==null&&typeof e=="object"&&"href"in e&&e.href&&"protocol"in e&&e.protocol&&e.auth===void 0)}function xT(e){if(typeof e=="string")e=new URL(e);else if(!cs(e)){const t=new TypeError('The "path" argument must be of type string or an instance of URL. Received `'+e+"`");throw t.code="ERR_INVALID_ARG_TYPE",t}if(e.protocol!=="file:"){const t=new TypeError("The URL must be of scheme file");throw t.code="ERR_INVALID_URL_SCHEME",t}return wT(e)}function wT(e){if(e.hostname!==""){const r=new TypeError('File URL host must be "localhost" or empty on darwin');throw r.code="ERR_INVALID_FILE_URL_HOST",r}const t=e.pathname;let n=-1;for(;++n<t.length;)if(t.codePointAt(n)===37&&t.codePointAt(n+1)===50){const r=t.codePointAt(n+2);if(r===70||r===102){const i=new TypeError("File URL path must not include encoded / characters");throw i.code="ERR_INVALID_FILE_URL_PATH",i}}return decodeURIComponent(t)}const fa=["history","path","basename","stem","extname","dirname"];class yh{constructor(t){let n;t?cs(t)?n={path:t}:typeof t=="string"||kT(t)?n={value:t}:n=t:n={},this.cwd="cwd"in n?"":bT.cwd(),this.data={},this.history=[],this.messages=[],this.value,this.map,this.result,this.stored;let r=-1;for(;++r<fa.length;){const o=fa[r];o in n&&n[o]!==void 0&&n[o]!==null&&(this[o]=o==="history"?[...n[o]]:n[o])}let i;for(i in n)fa.includes(i)||(this[i]=n[i])}get basename(){return typeof this.path=="string"?Wt.basename(this.path):void 0}set basename(t){pa(t,"basename"),ha(t,"basename"),this.path=Wt.join(this.dirname||"",t)}get dirname(){return typeof this.path=="string"?Wt.dirname(this.path):void 0}set dirname(t){Lu(this.basename,"dirname"),this.path=Wt.join(t||"",this.basename)}get extname(){return typeof this.path=="string"?Wt.extname(this.path):void 0}set extname(t){if(ha(t,"extname"),Lu(this.dirname,"extname"),t){if(t.codePointAt(0)!==46)throw new Error("`extname` must start with `.`");if(t.includes(".",1))throw new Error("`extname` cannot contain multiple dots")}this.path=Wt.join(this.dirname,this.stem+(t||""))}get path(){return this.history[this.history.length-1]}set path(t){cs(t)&&(t=xT(t)),pa(t,"path"),this.path!==t&&this.history.push(t)}get stem(){return typeof this.path=="string"?Wt.basename(this.path,this.extname):void 0}set stem(t){pa(t,"stem"),ha(t,"stem"),this.path=Wt.join(this.dirname||"",t+(this.extname||""))}fail(t,n,r){const i=this.message(t,n,r);throw i.fatal=!0,i}info(t,n,r){const i=this.message(t,n,r);return i.fatal=void 0,i}message(t,n,r){const i=new ut(t,n,r);return this.path&&(i.name=this.path+":"+i.name,i.file=this.path),i.fatal=!1,this.messages.push(i),i}toString(t){return this.value===void 0?"":typeof this.value=="string"?this.value:new TextDecoder(t||void 0).decode(this.value)}}function ha(e,t){if(e&&e.includes(Wt.sep))throw new Error("`"+t+"` cannot be a path: did not expect `"+Wt.sep+"`")}function pa(e,t){if(!e)throw new Error("`"+t+"` cannot be empty")}function Lu(e,t){if(!e)throw new Error("Setting `"+t+"` requires `path` to be set too")}function kT(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const ST=function(e){const r=this.constructor.prototype,i=r[e],o=function(){return i.apply(o,arguments)};return Object.setPrototypeOf(o,r),o},AT={}.hasOwnProperty;class Js extends ST{constructor(){super("copy"),this.Compiler=void 0,this.Parser=void 0,this.attachers=[],this.compiler=void 0,this.freezeIndex=-1,this.frozen=void 0,this.namespace={},this.parser=void 0,this.transformers=uT()}copy(){const t=new Js;let n=-1;for(;++n<this.attachers.length;){const r=this.attachers[n];t.use(...r)}return t.data(da(!0,{},this.namespace)),t}data(t,n){return typeof t=="string"?arguments.length===2?(ya("data",this.frozen),this.namespace[t]=n,this):AT.call(this.namespace,t)&&this.namespace[t]||void 0:t?(ya("data",this.frozen),this.namespace=t,this):this.namespace}freeze(){if(this.frozen)return this;const t=this;for(;++this.freezeIndex<this.attachers.length;){const[n,...r]=this.attachers[this.freezeIndex];if(r[0]===!1)continue;r[0]===!0&&(r[0]=void 0);const i=n.call(t,...r);typeof i=="function"&&this.transformers.use(i)}return this.frozen=!0,this.freezeIndex=Number.POSITIVE_INFINITY,this}parse(t){this.freeze();const n=_i(t),r=this.parser||this.Parser;return ma("parse",r),r(String(n),n)}process(t,n){const r=this;return this.freeze(),ma("process",this.parser||this.Parser),ga("process",this.compiler||this.Compiler),n?i(void 0,n):new Promise(i);function i(o,a){const s=_i(t),l=r.parse(s);r.run(l,s,function(u,d,h){if(u||!d||!h)return c(u);const f=d,m=r.stringify(f,h);RT(m)?h.value=m:h.result=m,c(u,h)});function c(u,d){u||!d?a(u):o?o(d):n(void 0,d)}}}processSync(t){let n=!1,r;return this.freeze(),ma("processSync",this.parser||this.Parser),ga("processSync",this.compiler||this.Compiler),this.process(t,i),Du("processSync","process",n),r;function i(o,a){n=!0,Au(o),r=a}}run(t,n,r){Ou(t),this.freeze();const i=this.transformers;return!r&&typeof n=="function"&&(r=n,n=void 0),r?o(void 0,r):new Promise(o);function o(a,s){const l=_i(n);i.run(t,l,c);function c(u,d,h){const f=d||t;u?s(u):a?a(f):r(void 0,f,h)}}}runSync(t,n){let r=!1,i;return this.run(t,n,o),Du("runSync","run",r),i;function o(a,s){Au(a),i=s,r=!0}}stringify(t,n){this.freeze();const r=_i(n),i=this.compiler||this.Compiler;return ga("stringify",i),Ou(t),i(t,r)}use(t,...n){const r=this.attachers,i=this.namespace;if(ya("use",this.frozen),t!=null)if(typeof t=="function")l(t,n);else if(typeof t=="object")Array.isArray(t)?s(t):a(t);else throw new TypeError("Expected usable value, not `"+t+"`");return this;function o(c){if(typeof c=="function")l(c,[]);else if(typeof c=="object")if(Array.isArray(c)){const[u,...d]=c;l(u,d)}else a(c);else throw new TypeError("Expected usable value, not `"+c+"`")}function a(c){if(!("plugins"in c)&&!("settings"in c))throw new Error("Expected usable value but received an empty preset, which is probably a mistake: presets typically come with `plugins` and sometimes with `settings`, but this has neither");s(c.plugins),c.settings&&(i.settings=da(!0,i.settings,c.settings))}function s(c){let u=-1;if(c!=null)if(Array.isArray(c))for(;++u<c.length;){const d=c[u];o(d)}else throw new TypeError("Expected a list of plugins, not `"+c+"`")}function l(c,u){let d=-1,h=-1;for(;++d<r.length;)if(r[d][0]===c){h=d;break}if(h===-1)r.push([c,...u]);else if(u.length>0){let[f,...m]=u;const p=r[h][1];ls(p)&&ls(f)&&(f=da(!0,p,f)),r[h]=[c,f,...m]}}}}const CT=new Js().freeze();function ma(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `parser`")}function ga(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `compiler`")}function ya(e,t){if(t)throw new Error("Cannot call `"+e+"` on a frozen processor.\nCreate a new processor first, by calling it: use `processor()` instead of `processor`.")}function Ou(e){if(!ls(e)||typeof e.type!="string")throw new TypeError("Expected node, got `"+e+"`")}function Du(e,t,n){if(!n)throw new Error("`"+e+"` finished async. Use `"+t+"` instead")}function _i(e){return ET(e)?e:new yh(e)}function ET(e){return!!(e&&typeof e=="object"&&"message"in e&&"messages"in e)}function RT(e){return typeof e=="string"||PT(e)}function PT(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const TT="https://github.com/remarkjs/react-markdown/blob/main/changelog.md",Nu=[],Mu={allowDangerousHtml:!0},IT=/^(https?|ircs?|mailto|xmpp)$/i,LT=[{from:"astPlugins",id:"remove-buggy-html-in-markdown-parser"},{from:"allowDangerousHtml",id:"remove-buggy-html-in-markdown-parser"},{from:"allowNode",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"allowElement"},{from:"allowedTypes",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"allowedElements"},{from:"className",id:"remove-classname"},{from:"disallowedTypes",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"disallowedElements"},{from:"escapeHtml",id:"remove-buggy-html-in-markdown-parser"},{from:"includeElementIndex",id:"#remove-includeelementindex"},{from:"includeNodeIndex",id:"change-includenodeindex-to-includeelementindex"},{from:"linkTarget",id:"remove-linktarget"},{from:"plugins",id:"change-plugins-to-remarkplugins",to:"remarkPlugins"},{from:"rawSourcePos",id:"#remove-rawsourcepos"},{from:"renderers",id:"change-renderers-to-components",to:"components"},{from:"source",id:"change-source-to-children",to:"children"},{from:"sourcePos",id:"#remove-sourcepos"},{from:"transformImageUri",id:"#add-urltransform",to:"urlTransform"},{from:"transformLinkUri",id:"#add-urltransform",to:"urlTransform"}];function OT(e){const t=DT(e),n=NT(e);return MT(t.runSync(t.parse(n),n),e)}function DT(e){const t=e.rehypePlugins||Nu,n=e.remarkPlugins||Nu,r=e.remarkRehypeOptions?{...e.remarkRehypeOptions,...Mu}:Mu;return CT().use(hP).use(n).use(lT,r).use(t)}function NT(e){const t=e.children||"",n=new yh;return typeof t=="string"&&(n.value=t),n}function MT(e,t){const n=t.allowedElements,r=t.allowElement,i=t.components,o=t.disallowedElements,a=t.skipHtml,s=t.unwrapDisallowed,l=t.urlTransform||_T;for(const u of LT)Object.hasOwn(t,u.from)&&(""+u.from+(u.to?"use `"+u.to+"` instead":"remove it")+TT+u.id,void 0);return Xs(e,c),Y1(e,{Fragment:g.Fragment,components:i,ignoreInvalidStyle:!0,jsx:g.jsx,jsxs:g.jsxs,passKeys:!0,passNode:!0});function c(u,d,h){if(u.type==="raw"&&h&&typeof d=="number")return a?h.children.splice(d,1):h.children[d]={type:"text",value:u.value},d;if(u.type==="element"){let f;for(f in la)if(Object.hasOwn(la,f)&&Object.hasOwn(u.properties,f)){const m=u.properties[f],p=la[f];(p===null||p.includes(u.tagName))&&(u.properties[f]=l(String(m||""),f,u))}}if(u.type==="element"){let f=n?!n.includes(u.tagName):o?o.includes(u.tagName):!1;if(!f&&r&&typeof d=="number"&&(f=!r(u,d,h)),f&&h&&typeof d=="number")return s&&u.children?h.children.splice(d,1,...u.children):h.children.splice(d,1),d}}}function _T(e){const t=e.indexOf(":"),n=e.indexOf("?"),r=e.indexOf("#"),i=e.indexOf("/");return t===-1||i!==-1&&t>i||n!==-1&&t>n||r!==-1&&t>r||IT.test(e.slice(0,t))?e:""}function _u(e,t){const n=String(e);if(typeof t!="string")throw new TypeError("Expected character");let r=0,i=n.indexOf(t);for(;i!==-1;)r++,i=n.indexOf(t,i+t.length);return r}function jT(e){if(typeof e!="string")throw new TypeError("Expected a string");return e.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d")}function FT(e,t,n){const i=Mo((n||{}).ignore||[]),o=HT(t);let a=-1;for(;++a<o.length;)mh(e,"text",s);function s(c,u){let d=-1,h;for(;++d<u.length;){const f=u[d],m=h?h.children:void 0;if(i(f,m?m.indexOf(f):void 0,h))return;h=f}if(h)return l(c,u)}function l(c,u){const d=u[u.length-1],h=o[a][0],f=o[a][1];let m=0;const b=d.children.indexOf(c);let v=!1,x=[];h.lastIndex=0;let w=h.exec(c.value);for(;w;){const E=w.index,T={index:w.index,input:w.input,stack:[...u,c]};let S=f(...w,T);if(typeof S=="string"&&(S=S.length>0?{type:"text",value:S}:void 0),S===!1?h.lastIndex=E+1:(m!==E&&x.push({type:"text",value:c.value.slice(m,E)}),Array.isArray(S)?x.push(...S):S&&x.push(S),m=E+w[0].length,v=!0),!h.global)break;w=h.exec(c.value)}return v?(m<c.value.length&&x.push({type:"text",value:c.value.slice(m)}),d.children.splice(b,1,...x)):x=[c],b+x.length}}function HT(e){const t=[];if(!Array.isArray(e))throw new TypeError("Expected find and replace tuple or list of tuples");const n=!e[0]||Array.isArray(e[0])?e:[e];let r=-1;for(;++r<n.length;){const i=n[r];t.push([UT(i[0]),BT(i[1])])}return t}function UT(e){return typeof e=="string"?new RegExp(jT(e),"g"):e}function BT(e){return typeof e=="function"?e:function(){return e}}const ba="phrasing",va=["autolink","link","image","label"];function zT(){return{transforms:[QT],enter:{literalAutolink:VT,literalAutolinkEmail:xa,literalAutolinkHttp:xa,literalAutolinkWww:xa},exit:{literalAutolink:GT,literalAutolinkEmail:qT,literalAutolinkHttp:WT,literalAutolinkWww:KT}}}function $T(){return{unsafe:[{character:"@",before:"[+\\-.\\w]",after:"[\\-.\\w]",inConstruct:ba,notInConstruct:va},{character:".",before:"[Ww]",after:"[\\-.\\w]",inConstruct:ba,notInConstruct:va},{character:":",before:"[ps]",after:"\\/",inConstruct:ba,notInConstruct:va}]}}function VT(e){this.enter({type:"link",title:null,url:"",children:[]},e)}function xa(e){this.config.enter.autolinkProtocol.call(this,e)}function WT(e){this.config.exit.autolinkProtocol.call(this,e)}function KT(e){this.config.exit.data.call(this,e);const t=this.stack[this.stack.length-1];t.type,t.url="http://"+this.sliceSerialize(e)}function qT(e){this.config.exit.autolinkEmail.call(this,e)}function GT(e){this.exit(e)}function QT(e){FT(e,[[/(https?:\/\/|www(?=\.))([-.\w]+)([^ \t\r\n]*)/gi,YT],[/(?<=^|\s|\p{P}|\p{S})([-.\w+]+)@([-\w]+(?:\.[-\w]+)+)/gu,XT]],{ignore:["link","linkReference"]})}function YT(e,t,n,r,i){let o="";if(!bh(i)||(/^w/i.test(t)&&(n=t+n,t="",o="http://"),!JT(n)))return!1;const a=ZT(n+r);if(!a[0])return!1;const s={type:"link",title:null,url:o+t+a[0],children:[{type:"text",value:t+a[0]}]};return a[1]?[s,{type:"text",value:a[1]}]:s}function XT(e,t,n,r){return!bh(r,!0)||/[-\d_]$/.test(n)?!1:{type:"link",title:null,url:"mailto:"+t+"@"+n,children:[{type:"text",value:t+"@"+n}]}}function JT(e){const t=e.split(".");return!(t.length<2||t[t.length-1]&&(/_/.test(t[t.length-1])||!/[a-zA-Z\d]/.test(t[t.length-1]))||t[t.length-2]&&(/_/.test(t[t.length-2])||!/[a-zA-Z\d]/.test(t[t.length-2])))}function ZT(e){const t=/[!"&'),.:;<>?\]}]+$/.exec(e);if(!t)return[e,void 0];e=e.slice(0,t.index);let n=t[0],r=n.indexOf(")");const i=_u(e,"(");let o=_u(e,")");for(;r!==-1&&i>o;)e+=n.slice(0,r+1),n=n.slice(r+1),r=n.indexOf(")"),o++;return[e,n]}function bh(e,t){const n=e.input.charCodeAt(e.index-1);return(e.index===0||Zn(n)||Oo(n))&&(!t||n!==47)}vh.peek=lI;function eI(){this.buffer()}function tI(e){this.enter({type:"footnoteReference",identifier:"",label:""},e)}function nI(){this.buffer()}function rI(e){this.enter({type:"footnoteDefinition",identifier:"",label:"",children:[]},e)}function iI(e){const t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=Nt(this.sliceSerialize(e)).toLowerCase(),n.label=t}function oI(e){this.exit(e)}function aI(e){const t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=Nt(this.sliceSerialize(e)).toLowerCase(),n.label=t}function sI(e){this.exit(e)}function lI(){return"["}function vh(e,t,n,r){const i=n.createTracker(r);let o=i.move("[^");const a=n.enter("footnoteReference"),s=n.enter("reference");return o+=i.move(n.safe(n.associationId(e),{after:"]",before:o})),s(),a(),o+=i.move("]"),o}function cI(){return{enter:{gfmFootnoteCallString:eI,gfmFootnoteCall:tI,gfmFootnoteDefinitionLabelString:nI,gfmFootnoteDefinition:rI},exit:{gfmFootnoteCallString:iI,gfmFootnoteCall:oI,gfmFootnoteDefinitionLabelString:aI,gfmFootnoteDefinition:sI}}}function uI(e){let t=!1;return e&&e.firstLineBlank&&(t=!0),{handlers:{footnoteDefinition:n,footnoteReference:vh},unsafe:[{character:"[",inConstruct:["label","phrasing","reference"]}]};function n(r,i,o,a){const s=o.createTracker(a);let l=s.move("[^");const c=o.enter("footnoteDefinition"),u=o.enter("label");return l+=s.move(o.safe(o.associationId(r),{before:l,after:"]"})),u(),l+=s.move("]:"),r.children&&r.children.length>0&&(s.shift(4),l+=s.move((t?`
189
+ `:" ")+o.indentLines(o.containerFlow(r,s.current()),t?xh:dI))),c(),l}}function dI(e,t,n){return t===0?e:xh(e,t,n)}function xh(e,t,n){return(n?"":" ")+e}const fI=["autolink","destinationLiteral","destinationRaw","reference","titleQuote","titleApostrophe"];wh.peek=yI;function hI(){return{canContainEols:["delete"],enter:{strikethrough:mI},exit:{strikethrough:gI}}}function pI(){return{unsafe:[{character:"~",inConstruct:"phrasing",notInConstruct:fI}],handlers:{delete:wh}}}function mI(e){this.enter({type:"delete",children:[]},e)}function gI(e){this.exit(e)}function wh(e,t,n,r){const i=n.createTracker(r),o=n.enter("strikethrough");let a=i.move("~~");return a+=n.containerPhrasing(e,{...i.current(),before:a,after:"~"}),a+=i.move("~~"),o(),a}function yI(){return"~"}function bI(e){return e.length}function vI(e,t){const n=t||{},r=(n.align||[]).concat(),i=n.stringLength||bI,o=[],a=[],s=[],l=[];let c=0,u=-1;for(;++u<e.length;){const p=[],b=[];let v=-1;for(e[u].length>c&&(c=e[u].length);++v<e[u].length;){const x=xI(e[u][v]);if(n.alignDelimiters!==!1){const w=i(x);b[v]=w,(l[v]===void 0||w>l[v])&&(l[v]=w)}p.push(x)}a[u]=p,s[u]=b}let d=-1;if(typeof r=="object"&&"length"in r)for(;++d<c;)o[d]=ju(r[d]);else{const p=ju(r);for(;++d<c;)o[d]=p}d=-1;const h=[],f=[];for(;++d<c;){const p=o[d];let b="",v="";p===99?(b=":",v=":"):p===108?b=":":p===114&&(v=":");let x=n.alignDelimiters===!1?1:Math.max(1,l[d]-b.length-v.length);const w=b+"-".repeat(x)+v;n.alignDelimiters!==!1&&(x=b.length+x+v.length,x>l[d]&&(l[d]=x),f[d]=x),h[d]=w}a.splice(1,0,h),s.splice(1,0,f),u=-1;const m=[];for(;++u<a.length;){const p=a[u],b=s[u];d=-1;const v=[];for(;++d<c;){const x=p[d]||"";let w="",E="";if(n.alignDelimiters!==!1){const T=l[d]-(b[d]||0),S=o[d];S===114?w=" ".repeat(T):S===99?T%2?(w=" ".repeat(T/2+.5),E=" ".repeat(T/2-.5)):(w=" ".repeat(T/2),E=w):E=" ".repeat(T)}n.delimiterStart!==!1&&!d&&v.push("|"),n.padding!==!1&&!(n.alignDelimiters===!1&&x==="")&&(n.delimiterStart!==!1||d)&&v.push(" "),n.alignDelimiters!==!1&&v.push(w),v.push(x),n.alignDelimiters!==!1&&v.push(E),n.padding!==!1&&v.push(" "),(n.delimiterEnd!==!1||d!==c-1)&&v.push("|")}m.push(n.delimiterEnd===!1?v.join("").replace(/ +$/,""):v.join(""))}return m.join(`
190
+ `)}function xI(e){return e==null?"":String(e)}function ju(e){const t=typeof e=="string"?e.codePointAt(0):0;return t===67||t===99?99:t===76||t===108?108:t===82||t===114?114:0}function wI(e,t,n,r){const i=n.enter("blockquote"),o=n.createTracker(r);o.move("> "),o.shift(2);const a=n.indentLines(n.containerFlow(e,o.current()),kI);return i(),a}function kI(e,t,n){return">"+(n?"":" ")+e}function SI(e,t){return Fu(e,t.inConstruct,!0)&&!Fu(e,t.notInConstruct,!1)}function Fu(e,t,n){if(typeof t=="string"&&(t=[t]),!t||t.length===0)return n;let r=-1;for(;++r<t.length;)if(e.includes(t[r]))return!0;return!1}function Hu(e,t,n,r){let i=-1;for(;++i<n.unsafe.length;)if(n.unsafe[i].character===`
191
+ `&&SI(n.stack,n.unsafe[i]))return/[ \t]/.test(r.before)?"":" ";return`\\
192
+ `}function AI(e,t){const n=String(e);let r=n.indexOf(t),i=r,o=0,a=0;if(typeof t!="string")throw new TypeError("Expected substring");for(;r!==-1;)r===i?++o>a&&(a=o):o=1,i=r+t.length,r=n.indexOf(t,i);return a}function CI(e,t){return!!(t.options.fences===!1&&e.value&&!e.lang&&/[^ \r\n]/.test(e.value)&&!/^[\t ]*(?:[\r\n]|$)|(?:^|[\r\n])[\t ]*$/.test(e.value))}function EI(e){const t=e.options.fence||"`";if(t!=="`"&&t!=="~")throw new Error("Cannot serialize code with `"+t+"` for `options.fence`, expected `` ` `` or `~`");return t}function RI(e,t,n,r){const i=EI(n),o=e.value||"",a=i==="`"?"GraveAccent":"Tilde";if(CI(e,n)){const d=n.enter("codeIndented"),h=n.indentLines(o,PI);return d(),h}const s=n.createTracker(r),l=i.repeat(Math.max(AI(o,i)+1,3)),c=n.enter("codeFenced");let u=s.move(l);if(e.lang){const d=n.enter(`codeFencedLang${a}`);u+=s.move(n.safe(e.lang,{before:u,after:" ",encode:["`"],...s.current()})),d()}if(e.lang&&e.meta){const d=n.enter(`codeFencedMeta${a}`);u+=s.move(" "),u+=s.move(n.safe(e.meta,{before:u,after:`
193
+ `,encode:["`"],...s.current()})),d()}return u+=s.move(`
194
+ `),o&&(u+=s.move(o+`
195
+ `)),u+=s.move(l),c(),u}function PI(e,t,n){return(n?"":" ")+e}function Zs(e){const t=e.options.quote||'"';if(t!=='"'&&t!=="'")throw new Error("Cannot serialize title with `"+t+"` for `options.quote`, expected `\"`, or `'`");return t}function TI(e,t,n,r){const i=Zs(n),o=i==='"'?"Quote":"Apostrophe",a=n.enter("definition");let s=n.enter("label");const l=n.createTracker(r);let c=l.move("[");return c+=l.move(n.safe(n.associationId(e),{before:c,after:"]",...l.current()})),c+=l.move("]: "),s(),!e.url||/[\0- \u007F]/.test(e.url)?(s=n.enter("destinationLiteral"),c+=l.move("<"),c+=l.move(n.safe(e.url,{before:c,after:">",...l.current()})),c+=l.move(">")):(s=n.enter("destinationRaw"),c+=l.move(n.safe(e.url,{before:c,after:e.title?" ":`
196
+ `,...l.current()}))),s(),e.title&&(s=n.enter(`title${o}`),c+=l.move(" "+i),c+=l.move(n.safe(e.title,{before:c,after:i,...l.current()})),c+=l.move(i),s()),a(),c}function II(e){const t=e.options.emphasis||"*";if(t!=="*"&&t!=="_")throw new Error("Cannot serialize emphasis with `"+t+"` for `options.emphasis`, expected `*`, or `_`");return t}function mi(e){return"&#x"+e.toString(16).toUpperCase()+";"}function go(e,t,n){const r=Cr(e),i=Cr(t);return r===void 0?i===void 0?n==="_"?{inside:!0,outside:!0}:{inside:!1,outside:!1}:i===1?{inside:!0,outside:!0}:{inside:!1,outside:!0}:r===1?i===void 0?{inside:!1,outside:!1}:i===1?{inside:!0,outside:!0}:{inside:!1,outside:!1}:i===void 0?{inside:!1,outside:!1}:i===1?{inside:!0,outside:!1}:{inside:!1,outside:!1}}kh.peek=LI;function kh(e,t,n,r){const i=II(n),o=n.enter("emphasis"),a=n.createTracker(r),s=a.move(i);let l=a.move(n.containerPhrasing(e,{after:i,before:s,...a.current()}));const c=l.charCodeAt(0),u=go(r.before.charCodeAt(r.before.length-1),c,i);u.inside&&(l=mi(c)+l.slice(1));const d=l.charCodeAt(l.length-1),h=go(r.after.charCodeAt(0),d,i);h.inside&&(l=l.slice(0,-1)+mi(d));const f=a.move(i);return o(),n.attentionEncodeSurroundingInfo={after:h.outside,before:u.outside},s+l+f}function LI(e,t,n){return n.options.emphasis||"*"}function OI(e,t){let n=!1;return Xs(e,function(r){if("value"in r&&/\r?\n|\r/.test(r.value)||r.type==="break")return n=!0,as}),!!((!e.depth||e.depth<3)&&Vs(e)&&(t.options.setext||n))}function DI(e,t,n,r){const i=Math.max(Math.min(6,e.depth||1),1),o=n.createTracker(r);if(OI(e,n)){const u=n.enter("headingSetext"),d=n.enter("phrasing"),h=n.containerPhrasing(e,{...o.current(),before:`
197
+ `,after:`
198
+ `});return d(),u(),h+`
199
+ `+(i===1?"=":"-").repeat(h.length-(Math.max(h.lastIndexOf("\r"),h.lastIndexOf(`
200
+ `))+1))}const a="#".repeat(i),s=n.enter("headingAtx"),l=n.enter("phrasing");o.move(a+" ");let c=n.containerPhrasing(e,{before:"# ",after:`
201
+ `,...o.current()});return/^[\t ]/.test(c)&&(c=mi(c.charCodeAt(0))+c.slice(1)),c=c?a+" "+c:a,n.options.closeAtx&&(c+=" "+a),l(),s(),c}Sh.peek=NI;function Sh(e){return e.value||""}function NI(){return"<"}Ah.peek=MI;function Ah(e,t,n,r){const i=Zs(n),o=i==='"'?"Quote":"Apostrophe",a=n.enter("image");let s=n.enter("label");const l=n.createTracker(r);let c=l.move("![");return c+=l.move(n.safe(e.alt,{before:c,after:"]",...l.current()})),c+=l.move("]("),s(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(s=n.enter("destinationLiteral"),c+=l.move("<"),c+=l.move(n.safe(e.url,{before:c,after:">",...l.current()})),c+=l.move(">")):(s=n.enter("destinationRaw"),c+=l.move(n.safe(e.url,{before:c,after:e.title?" ":")",...l.current()}))),s(),e.title&&(s=n.enter(`title${o}`),c+=l.move(" "+i),c+=l.move(n.safe(e.title,{before:c,after:i,...l.current()})),c+=l.move(i),s()),c+=l.move(")"),a(),c}function MI(){return"!"}Ch.peek=_I;function Ch(e,t,n,r){const i=e.referenceType,o=n.enter("imageReference");let a=n.enter("label");const s=n.createTracker(r);let l=s.move("![");const c=n.safe(e.alt,{before:l,after:"]",...s.current()});l+=s.move(c+"]["),a();const u=n.stack;n.stack=[],a=n.enter("reference");const d=n.safe(n.associationId(e),{before:l,after:"]",...s.current()});return a(),n.stack=u,o(),i==="full"||!c||c!==d?l+=s.move(d+"]"):i==="shortcut"?l=l.slice(0,-1):l+=s.move("]"),l}function _I(){return"!"}Eh.peek=jI;function Eh(e,t,n){let r=e.value||"",i="`",o=-1;for(;new RegExp("(^|[^`])"+i+"([^`]|$)").test(r);)i+="`";for(/[^ \r\n]/.test(r)&&(/^[ \r\n]/.test(r)&&/[ \r\n]$/.test(r)||/^`|`$/.test(r))&&(r=" "+r+" ");++o<n.unsafe.length;){const a=n.unsafe[o],s=n.compilePattern(a);let l;if(a.atBreak)for(;l=s.exec(r);){let c=l.index;r.charCodeAt(c)===10&&r.charCodeAt(c-1)===13&&c--,r=r.slice(0,c)+" "+r.slice(l.index+1)}}return i+r+i}function jI(){return"`"}function Rh(e,t){const n=Vs(e);return!!(!t.options.resourceLink&&e.url&&!e.title&&e.children&&e.children.length===1&&e.children[0].type==="text"&&(n===e.url||"mailto:"+n===e.url)&&/^[a-z][a-z+.-]+:/i.test(e.url)&&!/[\0- <>\u007F]/.test(e.url))}Ph.peek=FI;function Ph(e,t,n,r){const i=Zs(n),o=i==='"'?"Quote":"Apostrophe",a=n.createTracker(r);let s,l;if(Rh(e,n)){const u=n.stack;n.stack=[],s=n.enter("autolink");let d=a.move("<");return d+=a.move(n.containerPhrasing(e,{before:d,after:">",...a.current()})),d+=a.move(">"),s(),n.stack=u,d}s=n.enter("link"),l=n.enter("label");let c=a.move("[");return c+=a.move(n.containerPhrasing(e,{before:c,after:"](",...a.current()})),c+=a.move("]("),l(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(l=n.enter("destinationLiteral"),c+=a.move("<"),c+=a.move(n.safe(e.url,{before:c,after:">",...a.current()})),c+=a.move(">")):(l=n.enter("destinationRaw"),c+=a.move(n.safe(e.url,{before:c,after:e.title?" ":")",...a.current()}))),l(),e.title&&(l=n.enter(`title${o}`),c+=a.move(" "+i),c+=a.move(n.safe(e.title,{before:c,after:i,...a.current()})),c+=a.move(i),l()),c+=a.move(")"),s(),c}function FI(e,t,n){return Rh(e,n)?"<":"["}Th.peek=HI;function Th(e,t,n,r){const i=e.referenceType,o=n.enter("linkReference");let a=n.enter("label");const s=n.createTracker(r);let l=s.move("[");const c=n.containerPhrasing(e,{before:l,after:"]",...s.current()});l+=s.move(c+"]["),a();const u=n.stack;n.stack=[],a=n.enter("reference");const d=n.safe(n.associationId(e),{before:l,after:"]",...s.current()});return a(),n.stack=u,o(),i==="full"||!c||c!==d?l+=s.move(d+"]"):i==="shortcut"?l=l.slice(0,-1):l+=s.move("]"),l}function HI(){return"["}function el(e){const t=e.options.bullet||"*";if(t!=="*"&&t!=="+"&&t!=="-")throw new Error("Cannot serialize items with `"+t+"` for `options.bullet`, expected `*`, `+`, or `-`");return t}function UI(e){const t=el(e),n=e.options.bulletOther;if(!n)return t==="*"?"-":"*";if(n!=="*"&&n!=="+"&&n!=="-")throw new Error("Cannot serialize items with `"+n+"` for `options.bulletOther`, expected `*`, `+`, or `-`");if(n===t)throw new Error("Expected `bullet` (`"+t+"`) and `bulletOther` (`"+n+"`) to be different");return n}function BI(e){const t=e.options.bulletOrdered||".";if(t!=="."&&t!==")")throw new Error("Cannot serialize items with `"+t+"` for `options.bulletOrdered`, expected `.` or `)`");return t}function Ih(e){const t=e.options.rule||"*";if(t!=="*"&&t!=="-"&&t!=="_")throw new Error("Cannot serialize rules with `"+t+"` for `options.rule`, expected `*`, `-`, or `_`");return t}function zI(e,t,n,r){const i=n.enter("list"),o=n.bulletCurrent;let a=e.ordered?BI(n):el(n);const s=e.ordered?a==="."?")":".":UI(n);let l=t&&n.bulletLastUsed?a===n.bulletLastUsed:!1;if(!e.ordered){const u=e.children?e.children[0]:void 0;if((a==="*"||a==="-")&&u&&(!u.children||!u.children[0])&&n.stack[n.stack.length-1]==="list"&&n.stack[n.stack.length-2]==="listItem"&&n.stack[n.stack.length-3]==="list"&&n.stack[n.stack.length-4]==="listItem"&&n.indexStack[n.indexStack.length-1]===0&&n.indexStack[n.indexStack.length-2]===0&&n.indexStack[n.indexStack.length-3]===0&&(l=!0),Ih(n)===a&&u){let d=-1;for(;++d<e.children.length;){const h=e.children[d];if(h&&h.type==="listItem"&&h.children&&h.children[0]&&h.children[0].type==="thematicBreak"){l=!0;break}}}}l&&(a=s),n.bulletCurrent=a;const c=n.containerFlow(e,r);return n.bulletLastUsed=a,n.bulletCurrent=o,i(),c}function $I(e){const t=e.options.listItemIndent||"one";if(t!=="tab"&&t!=="one"&&t!=="mixed")throw new Error("Cannot serialize items with `"+t+"` for `options.listItemIndent`, expected `tab`, `one`, or `mixed`");return t}function VI(e,t,n,r){const i=$I(n);let o=n.bulletCurrent||el(n);t&&t.type==="list"&&t.ordered&&(o=(typeof t.start=="number"&&t.start>-1?t.start:1)+(n.options.incrementListMarker===!1?0:t.children.indexOf(e))+o);let a=o.length+1;(i==="tab"||i==="mixed"&&(t&&t.type==="list"&&t.spread||e.spread))&&(a=Math.ceil(a/4)*4);const s=n.createTracker(r);s.move(o+" ".repeat(a-o.length)),s.shift(a);const l=n.enter("listItem"),c=n.indentLines(n.containerFlow(e,s.current()),u);return l(),c;function u(d,h,f){return h?(f?"":" ".repeat(a))+d:(f?o:o+" ".repeat(a-o.length))+d}}function WI(e,t,n,r){const i=n.enter("paragraph"),o=n.enter("phrasing"),a=n.containerPhrasing(e,r);return o(),i(),a}const KI=Mo(["break","delete","emphasis","footnote","footnoteReference","image","imageReference","inlineCode","inlineMath","link","linkReference","mdxJsxTextElement","mdxTextExpression","strong","text","textDirective"]);function qI(e,t,n,r){return(e.children.some(function(a){return KI(a)})?n.containerPhrasing:n.containerFlow).call(n,e,r)}function GI(e){const t=e.options.strong||"*";if(t!=="*"&&t!=="_")throw new Error("Cannot serialize strong with `"+t+"` for `options.strong`, expected `*`, or `_`");return t}Lh.peek=QI;function Lh(e,t,n,r){const i=GI(n),o=n.enter("strong"),a=n.createTracker(r),s=a.move(i+i);let l=a.move(n.containerPhrasing(e,{after:i,before:s,...a.current()}));const c=l.charCodeAt(0),u=go(r.before.charCodeAt(r.before.length-1),c,i);u.inside&&(l=mi(c)+l.slice(1));const d=l.charCodeAt(l.length-1),h=go(r.after.charCodeAt(0),d,i);h.inside&&(l=l.slice(0,-1)+mi(d));const f=a.move(i+i);return o(),n.attentionEncodeSurroundingInfo={after:h.outside,before:u.outside},s+l+f}function QI(e,t,n){return n.options.strong||"*"}function YI(e,t,n,r){return n.safe(e.value,r)}function XI(e){const t=e.options.ruleRepetition||3;if(t<3)throw new Error("Cannot serialize rules with repetition `"+t+"` for `options.ruleRepetition`, expected `3` or more");return t}function JI(e,t,n){const r=(Ih(n)+(n.options.ruleSpaces?" ":"")).repeat(XI(n));return n.options.ruleSpaces?r.slice(0,-1):r}const Oh={blockquote:wI,break:Hu,code:RI,definition:TI,emphasis:kh,hardBreak:Hu,heading:DI,html:Sh,image:Ah,imageReference:Ch,inlineCode:Eh,link:Ph,linkReference:Th,list:zI,listItem:VI,paragraph:WI,root:qI,strong:Lh,text:YI,thematicBreak:JI};function ZI(){return{enter:{table:eL,tableData:Uu,tableHeader:Uu,tableRow:nL},exit:{codeText:rL,table:tL,tableData:wa,tableHeader:wa,tableRow:wa}}}function eL(e){const t=e._align;this.enter({type:"table",align:t.map(function(n){return n==="none"?null:n}),children:[]},e),this.data.inTable=!0}function tL(e){this.exit(e),this.data.inTable=void 0}function nL(e){this.enter({type:"tableRow",children:[]},e)}function wa(e){this.exit(e)}function Uu(e){this.enter({type:"tableCell",children:[]},e)}function rL(e){let t=this.resume();this.data.inTable&&(t=t.replace(/\\([\\|])/g,iL));const n=this.stack[this.stack.length-1];n.type,n.value=t,this.exit(e)}function iL(e,t){return t==="|"?t:e}function oL(e){const t=e||{},n=t.tableCellPadding,r=t.tablePipeAlign,i=t.stringLength,o=n?" ":"|";return{unsafe:[{character:"\r",inConstruct:"tableCell"},{character:`
202
+ `,inConstruct:"tableCell"},{atBreak:!0,character:"|",after:"[ :-]"},{character:"|",inConstruct:"tableCell"},{atBreak:!0,character:":",after:"-"},{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{inlineCode:h,table:a,tableCell:l,tableRow:s}};function a(f,m,p,b){return c(u(f,p,b),f.align)}function s(f,m,p,b){const v=d(f,p,b),x=c([v]);return x.slice(0,x.indexOf(`
203
+ `))}function l(f,m,p,b){const v=p.enter("tableCell"),x=p.enter("phrasing"),w=p.containerPhrasing(f,{...b,before:o,after:o});return x(),v(),w}function c(f,m){return vI(f,{align:m,alignDelimiters:r,padding:n,stringLength:i})}function u(f,m,p){const b=f.children;let v=-1;const x=[],w=m.enter("table");for(;++v<b.length;)x[v]=d(b[v],m,p);return w(),x}function d(f,m,p){const b=f.children;let v=-1;const x=[],w=m.enter("tableRow");for(;++v<b.length;)x[v]=l(b[v],f,m,p);return w(),x}function h(f,m,p){let b=Oh.inlineCode(f,m,p);return p.stack.includes("tableCell")&&(b=b.replace(/\|/g,"\\$&")),b}}function aL(){return{exit:{taskListCheckValueChecked:Bu,taskListCheckValueUnchecked:Bu,paragraph:lL}}}function sL(){return{unsafe:[{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{listItem:cL}}}function Bu(e){const t=this.stack[this.stack.length-2];t.type,t.checked=e.type==="taskListCheckValueChecked"}function lL(e){const t=this.stack[this.stack.length-2];if(t&&t.type==="listItem"&&typeof t.checked=="boolean"){const n=this.stack[this.stack.length-1];n.type;const r=n.children[0];if(r&&r.type==="text"){const i=t.children;let o=-1,a;for(;++o<i.length;){const s=i[o];if(s.type==="paragraph"){a=s;break}}a===n&&(r.value=r.value.slice(1),r.value.length===0?n.children.shift():n.position&&r.position&&typeof r.position.start.offset=="number"&&(r.position.start.column++,r.position.start.offset++,n.position.start=Object.assign({},r.position.start)))}}this.exit(e)}function cL(e,t,n,r){const i=e.children[0],o=typeof e.checked=="boolean"&&i&&i.type==="paragraph",a="["+(e.checked?"x":" ")+"] ",s=n.createTracker(r);o&&s.move(a);let l=Oh.listItem(e,t,n,{...r,...s.current()});return o&&(l=l.replace(/^(?:[*+-]|\d+\.)([\r\n]| {1,3})/,c)),l;function c(u){return u+a}}function uL(){return[zT(),cI(),hI(),ZI(),aL()]}function dL(e){return{extensions:[$T(),uI(e),pI(),oL(e),sL()]}}const fL={tokenize:bL,partial:!0},Dh={tokenize:vL,partial:!0},Nh={tokenize:xL,partial:!0},Mh={tokenize:wL,partial:!0},hL={tokenize:kL,partial:!0},_h={name:"wwwAutolink",tokenize:gL,previous:Fh},jh={name:"protocolAutolink",tokenize:yL,previous:Hh},un={name:"emailAutolink",tokenize:mL,previous:Uh},Yt={};function pL(){return{text:Yt}}let Fn=48;for(;Fn<123;)Yt[Fn]=un,Fn++,Fn===58?Fn=65:Fn===91&&(Fn=97);Yt[43]=un;Yt[45]=un;Yt[46]=un;Yt[95]=un;Yt[72]=[un,jh];Yt[104]=[un,jh];Yt[87]=[un,_h];Yt[119]=[un,_h];function mL(e,t,n){const r=this;let i,o;return a;function a(d){return!us(d)||!Uh.call(r,r.previous)||tl(r.events)?n(d):(e.enter("literalAutolink"),e.enter("literalAutolinkEmail"),s(d))}function s(d){return us(d)?(e.consume(d),s):d===64?(e.consume(d),l):n(d)}function l(d){return d===46?e.check(hL,u,c)(d):d===45||d===95||ct(d)?(o=!0,e.consume(d),l):u(d)}function c(d){return e.consume(d),i=!0,l}function u(d){return o&&i&&ht(r.previous)?(e.exit("literalAutolinkEmail"),e.exit("literalAutolink"),t(d)):n(d)}}function gL(e,t,n){const r=this;return i;function i(a){return a!==87&&a!==119||!Fh.call(r,r.previous)||tl(r.events)?n(a):(e.enter("literalAutolink"),e.enter("literalAutolinkWww"),e.check(fL,e.attempt(Dh,e.attempt(Nh,o),n),n)(a))}function o(a){return e.exit("literalAutolinkWww"),e.exit("literalAutolink"),t(a)}}function yL(e,t,n){const r=this;let i="",o=!1;return a;function a(d){return(d===72||d===104)&&Hh.call(r,r.previous)&&!tl(r.events)?(e.enter("literalAutolink"),e.enter("literalAutolinkHttp"),i+=String.fromCodePoint(d),e.consume(d),s):n(d)}function s(d){if(ht(d)&&i.length<5)return i+=String.fromCodePoint(d),e.consume(d),s;if(d===58){const h=i.toLowerCase();if(h==="http"||h==="https")return e.consume(d),l}return n(d)}function l(d){return d===47?(e.consume(d),o?c:(o=!0,l)):n(d)}function c(d){return d===null||ho(d)||je(d)||Zn(d)||Oo(d)?n(d):e.attempt(Dh,e.attempt(Nh,u),n)(d)}function u(d){return e.exit("literalAutolinkHttp"),e.exit("literalAutolink"),t(d)}}function bL(e,t,n){let r=0;return i;function i(a){return(a===87||a===119)&&r<3?(r++,e.consume(a),i):a===46&&r===3?(e.consume(a),o):n(a)}function o(a){return a===null?n(a):t(a)}}function vL(e,t,n){let r,i,o;return a;function a(c){return c===46||c===95?e.check(Mh,l,s)(c):c===null||je(c)||Zn(c)||c!==45&&Oo(c)?l(c):(o=!0,e.consume(c),a)}function s(c){return c===95?r=!0:(i=r,r=void 0),e.consume(c),a}function l(c){return i||r||!o?n(c):t(c)}}function xL(e,t){let n=0,r=0;return i;function i(a){return a===40?(n++,e.consume(a),i):a===41&&r<n?o(a):a===33||a===34||a===38||a===39||a===41||a===42||a===44||a===46||a===58||a===59||a===60||a===63||a===93||a===95||a===126?e.check(Mh,t,o)(a):a===null||je(a)||Zn(a)?t(a):(e.consume(a),i)}function o(a){return a===41&&r++,e.consume(a),i}}function wL(e,t,n){return r;function r(s){return s===33||s===34||s===39||s===41||s===42||s===44||s===46||s===58||s===59||s===63||s===95||s===126?(e.consume(s),r):s===38?(e.consume(s),o):s===93?(e.consume(s),i):s===60||s===null||je(s)||Zn(s)?t(s):n(s)}function i(s){return s===null||s===40||s===91||je(s)||Zn(s)?t(s):r(s)}function o(s){return ht(s)?a(s):n(s)}function a(s){return s===59?(e.consume(s),r):ht(s)?(e.consume(s),a):n(s)}}function kL(e,t,n){return r;function r(o){return e.consume(o),i}function i(o){return ct(o)?n(o):t(o)}}function Fh(e){return e===null||e===40||e===42||e===95||e===91||e===93||e===126||je(e)}function Hh(e){return!ht(e)}function Uh(e){return!(e===47||us(e))}function us(e){return e===43||e===45||e===46||e===95||ct(e)}function tl(e){let t=e.length,n=!1;for(;t--;){const r=e[t][1];if((r.type==="labelLink"||r.type==="labelImage")&&!r._balanced){n=!0;break}if(r._gfmAutolinkLiteralWalkedInto){n=!1;break}}return e.length>0&&!n&&(e[e.length-1][1]._gfmAutolinkLiteralWalkedInto=!0),n}const SL={tokenize:LL,partial:!0};function AL(){return{document:{91:{name:"gfmFootnoteDefinition",tokenize:PL,continuation:{tokenize:TL},exit:IL}},text:{91:{name:"gfmFootnoteCall",tokenize:RL},93:{name:"gfmPotentialFootnoteCall",add:"after",tokenize:CL,resolveTo:EL}}}}function CL(e,t,n){const r=this;let i=r.events.length;const o=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let a;for(;i--;){const l=r.events[i][1];if(l.type==="labelImage"){a=l;break}if(l.type==="gfmFootnoteCall"||l.type==="labelLink"||l.type==="label"||l.type==="image"||l.type==="link")break}return s;function s(l){if(!a||!a._balanced)return n(l);const c=Nt(r.sliceSerialize({start:a.end,end:r.now()}));return c.codePointAt(0)!==94||!o.includes(c.slice(1))?n(l):(e.enter("gfmFootnoteCallLabelMarker"),e.consume(l),e.exit("gfmFootnoteCallLabelMarker"),t(l))}}function EL(e,t){let n=e.length;for(;n--;)if(e[n][1].type==="labelImage"&&e[n][0]==="enter"){e[n][1];break}e[n+1][1].type="data",e[n+3][1].type="gfmFootnoteCallLabelMarker";const r={type:"gfmFootnoteCall",start:Object.assign({},e[n+3][1].start),end:Object.assign({},e[e.length-1][1].end)},i={type:"gfmFootnoteCallMarker",start:Object.assign({},e[n+3][1].end),end:Object.assign({},e[n+3][1].end)};i.end.column++,i.end.offset++,i.end._bufferIndex++;const o={type:"gfmFootnoteCallString",start:Object.assign({},i.end),end:Object.assign({},e[e.length-1][1].start)},a={type:"chunkString",contentType:"string",start:Object.assign({},o.start),end:Object.assign({},o.end)},s=[e[n+1],e[n+2],["enter",r,t],e[n+3],e[n+4],["enter",i,t],["exit",i,t],["enter",o,t],["enter",a,t],["exit",a,t],["exit",o,t],e[e.length-2],e[e.length-1],["exit",r,t]];return e.splice(n,e.length-n+1,...s),e}function RL(e,t,n){const r=this,i=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let o=0,a;return s;function s(d){return e.enter("gfmFootnoteCall"),e.enter("gfmFootnoteCallLabelMarker"),e.consume(d),e.exit("gfmFootnoteCallLabelMarker"),l}function l(d){return d!==94?n(d):(e.enter("gfmFootnoteCallMarker"),e.consume(d),e.exit("gfmFootnoteCallMarker"),e.enter("gfmFootnoteCallString"),e.enter("chunkString").contentType="string",c)}function c(d){if(o>999||d===93&&!a||d===null||d===91||je(d))return n(d);if(d===93){e.exit("chunkString");const h=e.exit("gfmFootnoteCallString");return i.includes(Nt(r.sliceSerialize(h)))?(e.enter("gfmFootnoteCallLabelMarker"),e.consume(d),e.exit("gfmFootnoteCallLabelMarker"),e.exit("gfmFootnoteCall"),t):n(d)}return je(d)||(a=!0),o++,e.consume(d),d===92?u:c}function u(d){return d===91||d===92||d===93?(e.consume(d),o++,c):c(d)}}function PL(e,t,n){const r=this,i=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let o,a=0,s;return l;function l(m){return e.enter("gfmFootnoteDefinition")._container=!0,e.enter("gfmFootnoteDefinitionLabel"),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(m),e.exit("gfmFootnoteDefinitionLabelMarker"),c}function c(m){return m===94?(e.enter("gfmFootnoteDefinitionMarker"),e.consume(m),e.exit("gfmFootnoteDefinitionMarker"),e.enter("gfmFootnoteDefinitionLabelString"),e.enter("chunkString").contentType="string",u):n(m)}function u(m){if(a>999||m===93&&!s||m===null||m===91||je(m))return n(m);if(m===93){e.exit("chunkString");const p=e.exit("gfmFootnoteDefinitionLabelString");return o=Nt(r.sliceSerialize(p)),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(m),e.exit("gfmFootnoteDefinitionLabelMarker"),e.exit("gfmFootnoteDefinitionLabel"),h}return je(m)||(s=!0),a++,e.consume(m),m===92?d:u}function d(m){return m===91||m===92||m===93?(e.consume(m),a++,u):u(m)}function h(m){return m===58?(e.enter("definitionMarker"),e.consume(m),e.exit("definitionMarker"),i.includes(o)||i.push(o),Re(e,f,"gfmFootnoteDefinitionWhitespace")):n(m)}function f(m){return t(m)}}function TL(e,t,n){return e.check(wi,t,e.attempt(SL,t,n))}function IL(e){e.exit("gfmFootnoteDefinition")}function LL(e,t,n){const r=this;return Re(e,i,"gfmFootnoteDefinitionIndent",5);function i(o){const a=r.events[r.events.length-1];return a&&a[1].type==="gfmFootnoteDefinitionIndent"&&a[2].sliceSerialize(a[1],!0).length===4?t(o):n(o)}}function OL(e){let n=(e||{}).singleTilde;const r={name:"strikethrough",tokenize:o,resolveAll:i};return n==null&&(n=!0),{text:{126:r},insideSpan:{null:[r]},attentionMarkers:{null:[126]}};function i(a,s){let l=-1;for(;++l<a.length;)if(a[l][0]==="enter"&&a[l][1].type==="strikethroughSequenceTemporary"&&a[l][1]._close){let c=l;for(;c--;)if(a[c][0]==="exit"&&a[c][1].type==="strikethroughSequenceTemporary"&&a[c][1]._open&&a[l][1].end.offset-a[l][1].start.offset===a[c][1].end.offset-a[c][1].start.offset){a[l][1].type="strikethroughSequence",a[c][1].type="strikethroughSequence";const u={type:"strikethrough",start:Object.assign({},a[c][1].start),end:Object.assign({},a[l][1].end)},d={type:"strikethroughText",start:Object.assign({},a[c][1].end),end:Object.assign({},a[l][1].start)},h=[["enter",u,s],["enter",a[c][1],s],["exit",a[c][1],s],["enter",d,s]],f=s.parser.constructs.insideSpan.null;f&&At(h,h.length,0,Do(f,a.slice(c+1,l),s)),At(h,h.length,0,[["exit",d,s],["enter",a[l][1],s],["exit",a[l][1],s],["exit",u,s]]),At(a,c-1,l-c+3,h),l=c+h.length-2;break}}for(l=-1;++l<a.length;)a[l][1].type==="strikethroughSequenceTemporary"&&(a[l][1].type="data");return a}function o(a,s,l){const c=this.previous,u=this.events;let d=0;return h;function h(m){return c===126&&u[u.length-1][1].type!=="characterEscape"?l(m):(a.enter("strikethroughSequenceTemporary"),f(m))}function f(m){const p=Cr(c);if(m===126)return d>1?l(m):(a.consume(m),d++,f);if(d<2&&!n)return l(m);const b=a.exit("strikethroughSequenceTemporary"),v=Cr(m);return b._open=!v||v===2&&!!p,b._close=!p||p===2&&!!v,s(m)}}}class DL{constructor(){this.map=[]}add(t,n,r){NL(this,t,n,r)}consume(t){if(this.map.sort(function(o,a){return o[0]-a[0]}),this.map.length===0)return;let n=this.map.length;const r=[];for(;n>0;)n-=1,r.push(t.slice(this.map[n][0]+this.map[n][1]),this.map[n][2]),t.length=this.map[n][0];r.push(t.slice()),t.length=0;let i=r.pop();for(;i;){for(const o of i)t.push(o);i=r.pop()}this.map.length=0}}function NL(e,t,n,r){let i=0;if(!(n===0&&r.length===0)){for(;i<e.map.length;){if(e.map[i][0]===t){e.map[i][1]+=n,e.map[i][2].push(...r);return}i+=1}e.map.push([t,n,r])}}function ML(e,t){let n=!1;const r=[];for(;t<e.length;){const i=e[t];if(n){if(i[0]==="enter")i[1].type==="tableContent"&&r.push(e[t+1][1].type==="tableDelimiterMarker"?"left":"none");else if(i[1].type==="tableContent"){if(e[t-1][1].type==="tableDelimiterMarker"){const o=r.length-1;r[o]=r[o]==="left"?"center":"right"}}else if(i[1].type==="tableDelimiterRow")break}else i[0]==="enter"&&i[1].type==="tableDelimiterRow"&&(n=!0);t+=1}return r}function _L(){return{flow:{null:{name:"table",tokenize:jL,resolveAll:FL}}}}function jL(e,t,n){const r=this;let i=0,o=0,a;return s;function s(R){let D=r.events.length-1;for(;D>-1;){const H=r.events[D][1].type;if(H==="lineEnding"||H==="linePrefix")D--;else break}const L=D>-1?r.events[D][1].type:null,z=L==="tableHead"||L==="tableRow"?S:l;return z===S&&r.parser.lazy[r.now().line]?n(R):z(R)}function l(R){return e.enter("tableHead"),e.enter("tableRow"),c(R)}function c(R){return R===124||(a=!0,o+=1),u(R)}function u(R){return R===null?n(R):oe(R)?o>1?(o=0,r.interrupt=!0,e.exit("tableRow"),e.enter("lineEnding"),e.consume(R),e.exit("lineEnding"),f):n(R):Ae(R)?Re(e,u,"whitespace")(R):(o+=1,a&&(a=!1,i+=1),R===124?(e.enter("tableCellDivider"),e.consume(R),e.exit("tableCellDivider"),a=!0,u):(e.enter("data"),d(R)))}function d(R){return R===null||R===124||je(R)?(e.exit("data"),u(R)):(e.consume(R),R===92?h:d)}function h(R){return R===92||R===124?(e.consume(R),d):d(R)}function f(R){return r.interrupt=!1,r.parser.lazy[r.now().line]?n(R):(e.enter("tableDelimiterRow"),a=!1,Ae(R)?Re(e,m,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(R):m(R))}function m(R){return R===45||R===58?b(R):R===124?(a=!0,e.enter("tableCellDivider"),e.consume(R),e.exit("tableCellDivider"),p):T(R)}function p(R){return Ae(R)?Re(e,b,"whitespace")(R):b(R)}function b(R){return R===58?(o+=1,a=!0,e.enter("tableDelimiterMarker"),e.consume(R),e.exit("tableDelimiterMarker"),v):R===45?(o+=1,v(R)):R===null||oe(R)?E(R):T(R)}function v(R){return R===45?(e.enter("tableDelimiterFiller"),x(R)):T(R)}function x(R){return R===45?(e.consume(R),x):R===58?(a=!0,e.exit("tableDelimiterFiller"),e.enter("tableDelimiterMarker"),e.consume(R),e.exit("tableDelimiterMarker"),w):(e.exit("tableDelimiterFiller"),w(R))}function w(R){return Ae(R)?Re(e,E,"whitespace")(R):E(R)}function E(R){return R===124?m(R):R===null||oe(R)?!a||i!==o?T(R):(e.exit("tableDelimiterRow"),e.exit("tableHead"),t(R)):T(R)}function T(R){return n(R)}function S(R){return e.enter("tableRow"),k(R)}function k(R){return R===124?(e.enter("tableCellDivider"),e.consume(R),e.exit("tableCellDivider"),k):R===null||oe(R)?(e.exit("tableRow"),t(R)):Ae(R)?Re(e,k,"whitespace")(R):(e.enter("data"),O(R))}function O(R){return R===null||R===124||je(R)?(e.exit("data"),k(R)):(e.consume(R),R===92?_:O)}function _(R){return R===92||R===124?(e.consume(R),O):O(R)}}function FL(e,t){let n=-1,r=!0,i=0,o=[0,0,0,0],a=[0,0,0,0],s=!1,l=0,c,u,d;const h=new DL;for(;++n<e.length;){const f=e[n],m=f[1];f[0]==="enter"?m.type==="tableHead"?(s=!1,l!==0&&(zu(h,t,l,c,u),u=void 0,l=0),c={type:"table",start:Object.assign({},m.start),end:Object.assign({},m.end)},h.add(n,0,[["enter",c,t]])):m.type==="tableRow"||m.type==="tableDelimiterRow"?(r=!0,d=void 0,o=[0,0,0,0],a=[0,n+1,0,0],s&&(s=!1,u={type:"tableBody",start:Object.assign({},m.start),end:Object.assign({},m.end)},h.add(n,0,[["enter",u,t]])),i=m.type==="tableDelimiterRow"?2:u?3:1):i&&(m.type==="data"||m.type==="tableDelimiterMarker"||m.type==="tableDelimiterFiller")?(r=!1,a[2]===0&&(o[1]!==0&&(a[0]=a[1],d=ji(h,t,o,i,void 0,d),o=[0,0,0,0]),a[2]=n)):m.type==="tableCellDivider"&&(r?r=!1:(o[1]!==0&&(a[0]=a[1],d=ji(h,t,o,i,void 0,d)),o=a,a=[o[1],n,0,0])):m.type==="tableHead"?(s=!0,l=n):m.type==="tableRow"||m.type==="tableDelimiterRow"?(l=n,o[1]!==0?(a[0]=a[1],d=ji(h,t,o,i,n,d)):a[1]!==0&&(d=ji(h,t,a,i,n,d)),i=0):i&&(m.type==="data"||m.type==="tableDelimiterMarker"||m.type==="tableDelimiterFiller")&&(a[3]=n)}for(l!==0&&zu(h,t,l,c,u),h.consume(t.events),n=-1;++n<t.events.length;){const f=t.events[n];f[0]==="enter"&&f[1].type==="table"&&(f[1]._align=ML(t.events,n))}return e}function ji(e,t,n,r,i,o){const a=r===1?"tableHeader":r===2?"tableDelimiter":"tableData",s="tableContent";n[0]!==0&&(o.end=Object.assign({},mr(t.events,n[0])),e.add(n[0],0,[["exit",o,t]]));const l=mr(t.events,n[1]);if(o={type:a,start:Object.assign({},l),end:Object.assign({},l)},e.add(n[1],0,[["enter",o,t]]),n[2]!==0){const c=mr(t.events,n[2]),u=mr(t.events,n[3]),d={type:s,start:Object.assign({},c),end:Object.assign({},u)};if(e.add(n[2],0,[["enter",d,t]]),r!==2){const h=t.events[n[2]],f=t.events[n[3]];if(h[1].end=Object.assign({},f[1].end),h[1].type="chunkText",h[1].contentType="text",n[3]>n[2]+1){const m=n[2]+1,p=n[3]-n[2]-1;e.add(m,p,[])}}e.add(n[3]+1,0,[["exit",d,t]])}return i!==void 0&&(o.end=Object.assign({},mr(t.events,i)),e.add(i,0,[["exit",o,t]]),o=void 0),o}function zu(e,t,n,r,i){const o=[],a=mr(t.events,n);i&&(i.end=Object.assign({},a),o.push(["exit",i,t])),r.end=Object.assign({},a),o.push(["exit",r,t]),e.add(n+1,0,o)}function mr(e,t){const n=e[t],r=n[0]==="enter"?"start":"end";return n[1][r]}const HL={name:"tasklistCheck",tokenize:BL};function UL(){return{text:{91:HL}}}function BL(e,t,n){const r=this;return i;function i(l){return r.previous!==null||!r._gfmTasklistFirstContentOfListItem?n(l):(e.enter("taskListCheck"),e.enter("taskListCheckMarker"),e.consume(l),e.exit("taskListCheckMarker"),o)}function o(l){return je(l)?(e.enter("taskListCheckValueUnchecked"),e.consume(l),e.exit("taskListCheckValueUnchecked"),a):l===88||l===120?(e.enter("taskListCheckValueChecked"),e.consume(l),e.exit("taskListCheckValueChecked"),a):n(l)}function a(l){return l===93?(e.enter("taskListCheckMarker"),e.consume(l),e.exit("taskListCheckMarker"),e.exit("taskListCheck"),s):n(l)}function s(l){return oe(l)?t(l):Ae(l)?e.check({tokenize:zL},t,n)(l):n(l)}}function zL(e,t,n){return Re(e,r,"whitespace");function r(i){return i===null?n(i):t(i)}}function $L(e){return Yf([pL(),AL(),OL(e),_L(),UL()])}const VL={};function WL(e){const t=this,n=e||VL,r=t.data(),i=r.micromarkExtensions||(r.micromarkExtensions=[]),o=r.fromMarkdownExtensions||(r.fromMarkdownExtensions=[]),a=r.toMarkdownExtensions||(r.toMarkdownExtensions=[]);i.push($L(n)),o.push(uL()),a.push(dL(n))}const KL={h1:({children:e,...t})=>g.jsx("h2",{className:"mt-2 mb-1 text-base font-semibold",...t,children:e}),h2:({children:e,...t})=>g.jsx("h3",{className:"mt-2 mb-1 text-sm font-semibold",...t,children:e}),h3:({children:e,...t})=>g.jsx("h4",{className:"mt-1.5 mb-1 text-sm font-semibold",...t,children:e}),h4:({children:e,...t})=>g.jsx("h5",{className:"mt-1.5 mb-1 text-xs font-semibold uppercase tracking-wide text-text-muted",...t,children:e}),h5:({children:e,...t})=>g.jsx("h6",{className:"mt-1.5 mb-0.5 text-xs font-semibold text-text-muted",...t,children:e}),h6:({children:e,...t})=>g.jsx("h6",{className:"mt-1.5 mb-0.5 text-xs font-medium text-text-muted",...t,children:e}),p:({children:e,...t})=>g.jsx("p",{className:"my-1 leading-relaxed",...t,children:e}),strong:({children:e,...t})=>g.jsx("strong",{className:"font-semibold text-text",...t,children:e}),em:({children:e,...t})=>g.jsx("em",{className:"italic",...t,children:e}),a:({children:e,...t})=>g.jsx("a",{className:"text-accent underline decoration-accent/40 underline-offset-2 hover:decoration-accent",target:"_blank",rel:"noreferrer",...t,children:e}),ul:({children:e,...t})=>g.jsx("ul",{className:"my-1 ml-5 list-disc space-y-0.5",...t,children:e}),ol:({children:e,...t})=>g.jsx("ol",{className:"my-1 ml-5 list-decimal space-y-0.5",...t,children:e}),li:({children:e,...t})=>g.jsx("li",{className:"leading-relaxed",...t,children:e}),blockquote:({children:e,...t})=>g.jsx("blockquote",{className:"my-2 border-l-2 border-border pl-3 text-text-dim",...t,children:e}),code:({inline:e,className:t,children:n,...r})=>e?g.jsx("code",{className:"rounded bg-surface-2 px-1 py-0.5 font-mono text-[0.85em]",...r,children:n}):g.jsx("code",{className:be("font-mono text-xs",t),...r,children:n}),pre:({children:e,...t})=>g.jsx("pre",{className:"my-2 overflow-x-auto rounded bg-surface-2 p-2 text-xs leading-relaxed",...t,children:e}),table:({children:e,...t})=>g.jsx("div",{className:"my-2 overflow-x-auto",children:g.jsx("table",{className:"w-full border-collapse text-xs",...t,children:e})}),thead:({children:e,...t})=>g.jsx("thead",{className:"border-b border-border bg-surface-2/50",...t,children:e}),tbody:({children:e,...t})=>g.jsx("tbody",{...t,children:e}),tr:({children:e,...t})=>g.jsx("tr",{className:"border-b border-border/40 last:border-b-0",...t,children:e}),th:({children:e,...t})=>g.jsx("th",{className:"px-2 py-1 text-left font-semibold",...t,children:e}),td:({children:e,...t})=>g.jsx("td",{className:"px-2 py-1 align-top",...t,children:e}),hr:e=>g.jsx("hr",{className:"my-2 border-border",...e})};function qL({content:e,className:t}){return g.jsx("div",{className:be("text-sm leading-relaxed [&>*:first-child]:mt-0 [&>*:last-child]:mb-0",t),children:g.jsx(OT,{remarkPlugins:[WL],components:KL,children:e})})}function ai(e){return e==="native"?"agim":e}function GL({msg:e,onApprove:t}){if(e.approval)return g.jsx(YL,{approval:e.approval,onApprove:t});const n=e.role==="user",r=!n&&!!e.content,i=e.agent?ai(e.agent):"";return g.jsx("div",{className:be("flex",n?"justify-end":"justify-start"),children:g.jsxs("div",{className:be("max-w-[85%] sm:max-w-[75%] rounded-lg px-3 py-2 shadow-sm",n?"bg-accent text-accent-fg":"bg-surface text-text border border-border"),children:[!n&&(e.agent||r)&&g.jsxs("div",{className:"mb-1 flex items-center justify-between gap-2",children:[g.jsx("span",{className:"text-xs font-medium text-text-muted",children:i}),r&&g.jsx(QL,{text:e.content})]}),!n&&e.content?g.jsx(qL,{content:e.content,className:"break-words"}):g.jsx("div",{className:"whitespace-pre-wrap break-words text-sm leading-relaxed",children:e.content||e.role==="assistant"&&g.jsx("span",{className:"inline-block animate-pulse text-text-dim",children:"…"})})]})})}function QL({text:e}){const{t}=ot(),[n,r]=y.useState(!1);async function i(){try{await navigator.clipboard.writeText(e),r(!0),setTimeout(()=>r(!1),1500)}catch{et.error(t("chat.copyFailed"))}}return g.jsx("button",{type:"button",onClick:i,title:t("chat.copyMarkdown"),className:"shrink-0 rounded px-1.5 py-0.5 text-[11px] text-text-dim transition hover:bg-surface-2 hover:text-text",children:t(n?"chat.copied":"chat.copy")})}function YL({approval:e,onApprove:t}){const{t:n}=ot(),{messageId:r,prompt:i,text:o,outcome:a}=e,s=i?.mode==="auto-allow",[l,c]=y.useState(null);y.useEffect(()=>{a&&c(null)},[a]);function u(d){if(l||!i||!t)return;c(d),t(r,i.reqId,d)===!1&&c(null)}return g.jsxs("div",{className:be("mx-auto w-full max-w-2xl rounded-lg border p-4",s?"border-warning/60 bg-warning-bg":"border-warning bg-warning-bg",a&&"opacity-90"),children:[g.jsxs("div",{className:"mb-2 flex flex-wrap items-center gap-2",children:[g.jsx(rt,{variant:"warning",children:n("chat.approvalTitle",{defaultValue:"🔐 Tool approval"})}),s&&!a&&g.jsx(rt,{variant:"outline",className:"text-[10px] uppercase",children:n("chat.approvalAutoBadge",{defaultValue:"auto-allow"})})]}),s&&!a&&i&&g.jsx(XL,{graceSeconds:i.graceSeconds??0}),i?g.jsxs("div",{className:"mt-1 flex flex-col gap-2 text-sm",children:[g.jsx($u,{label:n("chat.approvalToolLabel",{defaultValue:"Tool"}),children:g.jsx("code",{className:"rounded bg-surface-2 px-1.5 py-0.5 font-mono text-xs",children:i.toolName})}),g.jsx($u,{label:n("chat.approvalInputLabel",{defaultValue:"Input"}),children:g.jsx("pre",{className:"mt-1 max-h-64 overflow-auto rounded bg-surface-2 p-2 font-mono text-xs leading-relaxed text-text",children:i.inputJson})})]}):o?g.jsx("pre",{className:"whitespace-pre-wrap break-words text-sm text-text",children:o}):null,a?g.jsx(JL,{outcome:a}):i?g.jsxs(g.Fragment,{children:[g.jsxs("div",{className:"mt-3 flex flex-wrap gap-2",children:[!s&&g.jsxs(g.Fragment,{children:[g.jsx(qe,{size:"sm",disabled:l!==null,onClick:()=>u("y"),children:n("chat.approvalAllow",{defaultValue:"Allow"})}),g.jsx(qe,{size:"sm",variant:"secondary",disabled:l!==null,onClick:()=>u("a"),title:n("chat.approvalAutoTip",{defaultValue:"Allow and auto-allow similar calls for the rest of the session"}),children:n("chat.approvalAuto",{defaultValue:"Auto for similar"})})]}),g.jsx(qe,{size:"sm",variant:"destructive",disabled:l!==null,onClick:()=>u("n"),children:n("chat.approvalDeny",{defaultValue:"Deny"})})]}),l!==null&&g.jsx("p",{className:"mt-2 text-xs text-text-dim",children:n("chat.approvalSubmitting")})]}):null]})}function $u({label:e,children:t}){return g.jsxs("div",{className:"flex flex-col gap-0.5",children:[g.jsx("span",{className:"text-xs font-medium text-text-muted",children:e}),t]})}function XL({graceSeconds:e}){const{t}=ot(),[n,r]=y.useState(Math.max(0,e));return y.useEffect(()=>{if(e<=0)return;r(e);const i=setInterval(()=>{r(o=>o>0?o-1:0)},1e3);return()=>clearInterval(i)},[e]),e<=0?null:g.jsx("p",{className:"mb-2 text-xs text-warning",children:n>0?t("chat.approvalAutoIn",{count:n,defaultValue:"Auto-allowing in {{count}}s — Deny to stop."}):t("chat.approvalAutoResolving",{defaultValue:"Auto-allowing now…"})})}function JL({outcome:e}){const{t}=ot(),n=e.byUserDisplay?` · ${e.byUserDisplay}`:"";switch(e.decision){case"allowed":return g.jsx("div",{className:"mt-3",children:g.jsxs(rt,{variant:"success",children:[t("chat.outcome.allowed",{defaultValue:"✅ Allowed"}),n]})});case"allowed-pinned":return g.jsx("div",{className:"mt-3",children:g.jsxs(rt,{variant:"success",children:[t("chat.outcome.allowedPinned",{defaultValue:"✅ Allowed + auto-allow further"}),n]})});case"denied":return g.jsx("div",{className:"mt-3",children:g.jsxs(rt,{variant:"danger",children:[t("chat.outcome.denied",{defaultValue:"❌ Denied"}),n]})});case"denied-revoked":return g.jsx("div",{className:"mt-3",children:g.jsxs(rt,{variant:"danger",children:[t("chat.outcome.deniedRevoked",{defaultValue:"❌ Denied (auto-allow revoked)"}),n]})});case"expired":return g.jsx("div",{className:"mt-3",children:g.jsxs(rt,{variant:"outline",children:[t("chat.outcome.expired",{defaultValue:"⏱ Timed out"}),n]})})}}function ZL({approvals:e,onApprove:t}){return e.length===0?null:g.jsx("div",{className:"border-t border-warning/40 bg-warning-bg/40",children:g.jsx("div",{className:"mx-auto max-h-60 w-full max-w-3xl overflow-y-auto px-3 py-2 sm:px-4",children:g.jsx("div",{className:"flex flex-col gap-2",children:e.map(n=>g.jsx(eO,{entry:n,onApprove:t},n.messageId))})})})}function eO({entry:e,onApprove:t}){const{t:n}=ot(),{messageId:r,prompt:i,outcome:o}=e,a=i.mode==="auto-allow",[s,l]=y.useState(null);y.useEffect(()=>{o&&l(null)},[o]);function c(u){if(s||!t)return;l(u),t(r,i.reqId,u)===!1&&l(null)}return g.jsxs("div",{className:be("rounded-lg border bg-surface p-3 shadow-sm transition-opacity",o?"border-success/60 opacity-80":"border-warning"),children:[g.jsxs("div",{className:"mb-1.5 flex flex-wrap items-center gap-2",children:[g.jsxs(rt,{variant:"warning",className:"gap-1",children:[g.jsx(rb,{className:"h-3 w-3"}),n("chat.approvalTitle")]}),a&&!o&&g.jsx(rt,{variant:"outline",className:"text-[10px] uppercase",children:n("chat.approvalAutoBadge",{defaultValue:"auto-allow"})}),a&&!o&&i.graceSeconds!=null&&g.jsx(tO,{graceSeconds:i.graceSeconds}),g.jsx("code",{className:"ml-auto rounded bg-surface-2 px-1.5 py-0.5 font-mono text-xs",children:i.toolName})]}),g.jsx("pre",{className:"mb-2 max-h-32 overflow-auto rounded bg-surface-2 p-2 font-mono text-xs leading-relaxed text-text",children:i.inputJson}),o?g.jsx(nO,{outcome:o}):g.jsxs(g.Fragment,{children:[g.jsxs("div",{className:"flex flex-wrap gap-2",children:[!a&&g.jsxs(g.Fragment,{children:[g.jsx(qe,{size:"sm",disabled:s!==null,onClick:()=>c("y"),children:n("chat.approvalAllow")}),g.jsx(qe,{size:"sm",variant:"secondary",disabled:s!==null,onClick:()=>c("a"),title:n("chat.approvalAutoTip",{defaultValue:"Allow and auto-allow similar calls for the rest of the session"}),children:n("chat.approvalAuto")})]}),g.jsx(qe,{size:"sm",variant:"destructive",disabled:s!==null,onClick:()=>c("n"),children:n("chat.approvalDeny")})]}),s!==null&&g.jsx("p",{className:"mt-1.5 text-xs text-text-dim",children:n("chat.approvalSubmitting")})]})]})}function tO({graceSeconds:e}){const{t}=ot(),[n,r]=y.useState(Math.max(0,e));return y.useEffect(()=>{if(e<=0)return;r(e);const i=setInterval(()=>{r(o=>o>0?o-1:0)},1e3);return()=>clearInterval(i)},[e]),e<=0?null:g.jsx("span",{className:"text-xs text-warning",children:n>0?t("chat.approvalAutoIn",{count:n,defaultValue:"Auto-allowing in {{count}}s — Deny to stop."}):t("chat.approvalAutoResolving",{defaultValue:"Auto-allowing now…"})})}function nO({outcome:e}){const{t}=ot(),n=e.byUserDisplay?` · ${e.byUserDisplay}`:"";switch(e.decision){case"allowed":return g.jsxs(rt,{variant:"success",children:[t("chat.outcome.allowed",{defaultValue:"✅ Allowed"}),n]});case"allowed-pinned":return g.jsxs(rt,{variant:"success",children:[t("chat.outcome.allowedPinned",{defaultValue:"✅ Allowed + auto-allow further"}),n]});case"denied":return g.jsxs(rt,{variant:"danger",children:[t("chat.outcome.denied",{defaultValue:"❌ Denied"}),n]});case"denied-revoked":return g.jsxs(rt,{variant:"danger",children:[t("chat.outcome.deniedRevoked",{defaultValue:"❌ Denied (auto-allow revoked)"}),n]});case"expired":return g.jsxs(rt,{variant:"outline",children:[t("chat.outcome.expired",{defaultValue:"⏱ Timed out"}),n]})}}function rO({asks:e,onSubmit:t}){return e.length===0?null:g.jsx("div",{className:"border-t border-info/40 bg-info-bg/40",children:g.jsx("div",{className:"mx-auto max-h-72 w-full max-w-3xl overflow-y-auto px-3 py-2 sm:px-4",children:g.jsx("div",{className:"flex flex-col gap-2",children:e.map(n=>g.jsx(oO,{entry:n,onSubmit:t},n.messageId))})})})}function Vu(e){const t=new TextEncoder().encode(e);let n="";for(const r of t)n+=String.fromCharCode(r);return btoa(n).replace(/\+/g,"-").replace(/\//g,"_").replace(/=+$/,"")}function iO(e){const t=e.split(":").pop()??"";return Number.parseInt(t,10)}function oO({entry:e,onSubmit:t}){const{t:n}=ot(),{messageId:r,prompt:i,finalText:o,resolvedAt:a}=e,s=i.meta,l=o!=null||a!=null,[c,u]=y.useState(!1),[d,h]=y.useState([]),[f,m]=y.useState("");y.useEffect(()=>{l&&u(!1)},[l]);const p=s?.selectionMode??"single",b=s?.minSelections??1,v=s?.maxSelections??i.choices.length,x=s?.allowCustomInput??!1,w=s?.reqId??"";function E(k){if(c)return;u(!0),t(r,k)===!1&&u(!1)}function T(k){h(O=>O.includes(k)?O.filter(_=>_!==k):[...O,k])}const S=d.length>=b&&d.length<=v;return g.jsxs("div",{className:be("rounded-lg border bg-surface p-3 shadow-sm transition-opacity",l?"border-success/60 opacity-80":"border-info"),children:[g.jsxs("div",{className:"mb-1.5 flex flex-wrap items-center gap-2",children:[g.jsxs(rt,{variant:"info",className:"gap-1",children:[g.jsx(Xy,{className:"h-3 w-3"}),i.title||n("chat.askTitle",{defaultValue:"🤔 请选择"})]}),!l&&p==="multi"&&g.jsx("span",{className:"text-xs text-text-dim",children:n("chat.askMultiHint",{min:b,max:v,defaultValue:"Pick {{min}}–{{max}}"})})]}),g.jsx("p",{className:"mb-2 whitespace-pre-wrap break-words text-sm text-text",children:i.body}),l?g.jsx(rt,{variant:"success",children:o||n("chat.askResolved",{defaultValue:"✅ 已回答"})}):p==="multi"?g.jsxs(g.Fragment,{children:[g.jsx("div",{className:"flex flex-col gap-1.5",children:i.choices.map(k=>{const O=iO(k.data),_=d.includes(O);return g.jsxs("label",{className:be("flex cursor-pointer items-center gap-2 rounded border px-2 py-1.5 text-sm transition",_?"border-info bg-info-bg/50":"border-border hover:bg-surface-2",c&&"pointer-events-none opacity-60"),children:[g.jsx("input",{type:"checkbox",checked:_,disabled:c,onChange:()=>T(O)}),g.jsx("span",{children:k.label})]},k.data)})}),g.jsx("div",{className:"mt-2",children:g.jsx(qe,{size:"sm",disabled:c||!S,onClick:()=>E(`ask:${w}:multi:${[...d].sort((k,O)=>k-O).join(",")}`),children:n("chat.askSubmit",{defaultValue:"Submit"})})})]}):g.jsx("div",{className:"flex flex-wrap gap-2",children:i.choices.map(k=>g.jsx(qe,{size:"sm",variant:"secondary",disabled:c,onClick:()=>E(k.data),children:k.label},k.data))}),!l&&x&&g.jsxs("div",{className:"mt-2 flex gap-2",children:[g.jsx("input",{type:"text",value:f,disabled:c,placeholder:s?.customInputLabel||n("chat.askCustomPlaceholder",{defaultValue:"自定义回答…"}),onChange:k=>m(k.target.value),onKeyDown:k=>{k.key==="Enter"&&f.trim()&&E(`ask:${w}:custom:${Vu(f.trim())}`)},className:"flex-1 rounded border border-border bg-surface px-2 py-1 text-sm text-text outline-none focus:border-info"}),g.jsx(qe,{size:"sm",variant:"outline",disabled:c||!f.trim(),onClick:()=>E(`ask:${w}:custom:${Vu(f.trim())}`),children:n("chat.askSubmit",{defaultValue:"Submit"})})]}),i.links?.length?g.jsx("div",{className:"mt-2 flex flex-wrap gap-2",children:i.links.map(k=>g.jsx("a",{href:k.url,target:"_blank",rel:"noopener noreferrer",className:"inline-flex items-center rounded border border-border px-2 py-1 text-xs text-info underline-offset-2 transition hover:bg-surface-2 hover:underline",children:k.label},k.url))}):null,c&&!l&&g.jsx("p",{className:"mt-1.5 text-xs text-text-dim",children:n("chat.approvalSubmitting")})]})}function Wu(e,[t,n]){return Math.min(n,Math.max(t,e))}function Oe(e,t,{checkForDefaultPrevented:n=!0}={}){return function(i){if(e?.(i),n===!1||!i.defaultPrevented)return t?.(i)}}function Si(e,t=[]){let n=[];function r(o,a){const s=y.createContext(a);s.displayName=o+"Context";const l=n.length;n=[...n,a];const c=d=>{const{scope:h,children:f,...m}=d,p=h?.[e]?.[l]||s,b=y.useMemo(()=>m,Object.values(m));return g.jsx(p.Provider,{value:b,children:f})};c.displayName=o+"Provider";function u(d,h){const f=h?.[e]?.[l]||s,m=y.useContext(f);if(m)return m;if(a!==void 0)return a;throw new Error(`\`${d}\` must be used within \`${o}\``)}return[c,u]}const i=()=>{const o=n.map(a=>y.createContext(a));return function(s){const l=s?.[e]||o;return y.useMemo(()=>({[`__scope${e}`]:{...s,[e]:l}}),[s,l])}};return i.scopeName=e,[r,aO(i,...t)]}function aO(...e){const t=e[0];if(e.length===1)return t;const n=()=>{const r=e.map(i=>({useScope:i(),scopeName:i.scopeName}));return function(o){const a=r.reduce((s,{useScope:l,scopeName:c})=>{const d=l(o)[`__scope${c}`];return{...s,...d}},{});return y.useMemo(()=>({[`__scope${t.scopeName}`]:a}),[a])}};return n.scopeName=t.scopeName,n}function sO(e){const t=e+"CollectionProvider",[n,r]=Si(t),[i,o]=n(t,{collectionRef:{current:null},itemMap:new Map}),a=p=>{const{scope:b,children:v}=p,x=y.useRef(null),w=y.useRef(new Map).current;return g.jsx(i,{scope:b,itemMap:w,collectionRef:x,children:v})};a.displayName=t;const s=e+"CollectionSlot",l=Sr(s),c=y.forwardRef((p,b)=>{const{scope:v,children:x}=p,w=o(s,v),E=$e(b,w.collectionRef);return g.jsx(l,{ref:E,children:x})});c.displayName=s;const u=e+"CollectionItemSlot",d="data-radix-collection-item",h=Sr(u),f=y.forwardRef((p,b)=>{const{scope:v,children:x,...w}=p,E=y.useRef(null),T=$e(b,E),S=o(u,v);return y.useEffect(()=>(S.itemMap.set(E,{ref:E,...w}),()=>void S.itemMap.delete(E))),g.jsx(h,{[d]:"",ref:T,children:x})});f.displayName=u;function m(p){const b=o(e+"CollectionConsumer",p);return y.useCallback(()=>{const x=b.collectionRef.current;if(!x)return[];const w=Array.from(x.querySelectorAll(`[${d}]`));return Array.from(b.itemMap.values()).sort((S,k)=>w.indexOf(S.ref.current)-w.indexOf(k.ref.current))},[b.collectionRef,b.itemMap])}return[{Provider:a,Slot:c,ItemSlot:f},m,r]}var lO=y.createContext(void 0);function cO(e){const t=y.useContext(lO);return e||t||"ltr"}function kn(e){const t=y.useRef(e);return y.useEffect(()=>{t.current=e}),y.useMemo(()=>(...n)=>t.current?.(...n),[])}var it=globalThis?.document?y.useLayoutEffect:()=>{},Ku=Ir[" useEffectEvent ".trim().toString()],qu=Ir[" useInsertionEffect ".trim().toString()];function uO(e){if(typeof Ku=="function")return Ku(e);const t=y.useRef(()=>{throw new Error("Cannot call an event handler while rendering.")});return typeof qu=="function"?qu(()=>{t.current=e}):it(()=>{t.current=e}),y.useMemo(()=>(...n)=>t.current?.(...n),[])}var dO="DismissableLayer",ds="dismissableLayer.update",fO="dismissableLayer.pointerDownOutside",hO="dismissableLayer.focusOutside",Gu,nl=y.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set,dismissableSurfaces:new Set}),jo=y.forwardRef((e,t)=>{const{disableOutsidePointerEvents:n=!1,deferPointerDownOutside:r=!1,onEscapeKeyDown:i,onPointerDownOutside:o,onFocusOutside:a,onInteractOutside:s,onDismiss:l,...c}=e,u=y.useContext(nl),[d,h]=y.useState(null),f=d?.ownerDocument??globalThis?.document,[,m]=y.useState({}),p=$e(t,h),b=Array.from(u.layers),[v]=[...u.layersWithOutsidePointerEventsDisabled].slice(-1),x=b.indexOf(v),w=d?b.indexOf(d):-1,E=u.layersWithOutsidePointerEventsDisabled.size>0,T=w>=x,S=y.useRef(!1),k=yO(D=>{const L=D.target;if(!(L instanceof Node))return;const z=[...u.branches].some(H=>H.contains(L));!T||z||(o?.(D),s?.(D),D.defaultPrevented||l?.())},{ownerDocument:f,deferPointerDownOutside:r,isDeferredPointerDownOutsideRef:S,dismissableSurfaces:u.dismissableSurfaces}),O=bO(D=>{if(r&&S.current)return;const L=D.target;[...u.branches].some(H=>H.contains(L))||(a?.(D),s?.(D),D.defaultPrevented||l?.())},f),_=d?w===b.length-1:!1,R=uO(D=>{D.key==="Escape"&&(i?.(D),!D.defaultPrevented&&l&&(D.preventDefault(),l()))});return y.useEffect(()=>{if(_)return f.addEventListener("keydown",R,{capture:!0}),()=>f.removeEventListener("keydown",R,{capture:!0})},[f,_]),y.useEffect(()=>{if(d)return n&&(u.layersWithOutsidePointerEventsDisabled.size===0&&(Gu=f.body.style.pointerEvents,f.body.style.pointerEvents="none"),u.layersWithOutsidePointerEventsDisabled.add(d)),u.layers.add(d),Qu(),()=>{n&&(u.layersWithOutsidePointerEventsDisabled.delete(d),u.layersWithOutsidePointerEventsDisabled.size===0&&(f.body.style.pointerEvents=Gu))}},[d,f,n,u]),y.useEffect(()=>()=>{d&&(u.layers.delete(d),u.layersWithOutsidePointerEventsDisabled.delete(d),Qu())},[d,u]),y.useEffect(()=>{const D=()=>m({});return document.addEventListener(ds,D),()=>document.removeEventListener(ds,D)},[]),g.jsx(Me.div,{...c,ref:p,style:{pointerEvents:E?T?"auto":"none":void 0,...e.style},onFocusCapture:Oe(e.onFocusCapture,O.onFocusCapture),onBlurCapture:Oe(e.onBlurCapture,O.onBlurCapture),onPointerDownCapture:Oe(e.onPointerDownCapture,k.onPointerDownCapture)})});jo.displayName=dO;var pO="DismissableLayerBranch",mO=y.forwardRef((e,t)=>{const n=y.useContext(nl),r=y.useRef(null),i=$e(t,r);return y.useEffect(()=>{const o=r.current;if(o)return n.branches.add(o),()=>{n.branches.delete(o)}},[n.branches]),g.jsx(Me.div,{...e,ref:i})});mO.displayName=pO;function gO(){const e=y.useContext(nl),[t,n]=y.useState(null);return y.useEffect(()=>{if(t)return e.dismissableSurfaces.add(t),()=>{e.dismissableSurfaces.delete(t)}},[t,e.dismissableSurfaces]),n}function yO(e,t){const{ownerDocument:n=globalThis?.document,deferPointerDownOutside:r=!1,isDeferredPointerDownOutsideRef:i,dismissableSurfaces:o}=t,a=kn(e),s=y.useRef(!1),l=y.useRef(!1),c=y.useRef(new Map),u=y.useRef(()=>{});return y.useEffect(()=>{function d(){l.current=!1,i.current=!1,c.current.clear()}function h(){return Array.from(c.current.values()).some(Boolean)}function f(x){if(!l.current)return;const w=x.target;w instanceof Node&&[...o].some(T=>T.contains(w))||c.current.set(x.type,!0),x.type==="click"&&window.setTimeout(()=>{l.current&&u.current()},0)}function m(x){l.current&&c.current.set(x.type,!1)}const p=x=>{if(x.target&&!s.current){let w=function(){n.removeEventListener("click",u.current);const T=h();d(),T||Bh(fO,a,E,{discrete:!0})};const E={originalEvent:x};l.current=!0,i.current=r&&x.button===0,c.current.clear(),!r||x.button!==0?w():(n.removeEventListener("click",u.current),u.current=w,n.addEventListener("click",u.current,{once:!0}))}else n.removeEventListener("click",u.current),d();s.current=!1},b=["pointerup","mousedown","mouseup","touchstart","touchend","click"];for(const x of b)n.addEventListener(x,f,!0),n.addEventListener(x,m);const v=window.setTimeout(()=>{n.addEventListener("pointerdown",p)},0);return()=>{window.clearTimeout(v),n.removeEventListener("pointerdown",p),n.removeEventListener("click",u.current);for(const x of b)n.removeEventListener(x,f,!0),n.removeEventListener(x,m)}},[n,a,r,i,o]),{onPointerDownCapture:()=>s.current=!0}}function bO(e,t=globalThis?.document){const n=kn(e),r=y.useRef(!1);return y.useEffect(()=>{const i=o=>{o.target&&!r.current&&Bh(hO,n,{originalEvent:o},{discrete:!1})};return t.addEventListener("focusin",i),()=>t.removeEventListener("focusin",i)},[t,n]),{onFocusCapture:()=>r.current=!0,onBlurCapture:()=>r.current=!1}}function Qu(){const e=new CustomEvent(ds);document.dispatchEvent(e)}function Bh(e,t,n,{discrete:r}){const i=n.originalEvent.target,o=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&i.addEventListener(e,t,{once:!0}),r?mx(i,o):i.dispatchEvent(o)}var Fi=0,dr=null;function zh(){y.useEffect(()=>{dr||(dr={start:Yu(),end:Yu()});const{start:e,end:t}=dr;return document.body.firstElementChild!==e&&document.body.insertAdjacentElement("afterbegin",e),document.body.lastElementChild!==t&&document.body.insertAdjacentElement("beforeend",t),Fi++,()=>{Fi===1&&(dr?.start.remove(),dr?.end.remove(),dr=null),Fi=Math.max(0,Fi-1)}},[])}function Yu(){const e=document.createElement("span");return e.setAttribute("data-radix-focus-guard",""),e.tabIndex=0,e.style.outline="none",e.style.opacity="0",e.style.position="fixed",e.style.pointerEvents="none",e}var ka="focusScope.autoFocusOnMount",Sa="focusScope.autoFocusOnUnmount",Xu={bubbles:!1,cancelable:!0},vO="FocusScope",rl=y.forwardRef((e,t)=>{const{loop:n=!1,trapped:r=!1,onMountAutoFocus:i,onUnmountAutoFocus:o,...a}=e,[s,l]=y.useState(null),c=kn(i),u=kn(o),d=y.useRef(null),h=$e(t,l),f=y.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;y.useEffect(()=>{if(r){let p=function(w){if(f.paused||!s)return;const E=w.target;s.contains(E)?d.current=E:yn(d.current,{select:!0})},b=function(w){if(f.paused||!s)return;const E=w.relatedTarget;E!==null&&(s.contains(E)||yn(d.current,{select:!0}))},v=function(w){if(document.activeElement===document.body)for(const T of w)T.removedNodes.length>0&&yn(s)};document.addEventListener("focusin",p),document.addEventListener("focusout",b);const x=new MutationObserver(v);return s&&x.observe(s,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",p),document.removeEventListener("focusout",b),x.disconnect()}}},[r,s,f.paused]),y.useEffect(()=>{if(s){Zu.add(f);const p=document.activeElement;if(!s.contains(p)){const v=new CustomEvent(ka,Xu);s.addEventListener(ka,c),s.dispatchEvent(v),v.defaultPrevented||(xO(CO($h(s)),{select:!0}),document.activeElement===p&&yn(s))}return()=>{s.removeEventListener(ka,c),setTimeout(()=>{const v=new CustomEvent(Sa,Xu);s.addEventListener(Sa,u),s.dispatchEvent(v),v.defaultPrevented||yn(p??document.body,{select:!0}),s.removeEventListener(Sa,u),Zu.remove(f)},0)}}},[s,c,u,f]);const m=y.useCallback(p=>{if(!n&&!r||f.paused)return;const b=p.key==="Tab"&&!p.altKey&&!p.ctrlKey&&!p.metaKey,v=document.activeElement;if(b&&v){const x=p.currentTarget,[w,E]=wO(x);w&&E?!p.shiftKey&&v===E?(p.preventDefault(),n&&yn(w,{select:!0})):p.shiftKey&&v===w&&(p.preventDefault(),n&&yn(E,{select:!0})):v===x&&p.preventDefault()}},[n,r,f.paused]);return g.jsx(Me.div,{tabIndex:-1,...a,ref:h,onKeyDown:m})});rl.displayName=vO;function xO(e,{select:t=!1}={}){const n=document.activeElement;for(const r of e)if(yn(r,{select:t}),document.activeElement!==n)return}function wO(e){const t=$h(e),n=Ju(t,e),r=Ju(t.reverse(),e);return[n,r]}function $h(e){const t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:r=>{const i=r.tagName==="INPUT"&&r.type==="hidden";return r.disabled||r.hidden||i?NodeFilter.FILTER_SKIP:r.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)t.push(n.currentNode);return t}function Ju(e,t){for(const n of e)if(!kO(n,{upTo:t}))return n}function kO(e,{upTo:t}){if(getComputedStyle(e).visibility==="hidden")return!0;for(;e;){if(t!==void 0&&e===t)return!1;if(getComputedStyle(e).display==="none")return!0;e=e.parentElement}return!1}function SO(e){return e instanceof HTMLInputElement&&"select"in e}function yn(e,{select:t=!1}={}){if(e&&e.focus){const n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&SO(e)&&t&&e.select()}}var Zu=AO();function AO(){let e=[];return{add(t){const n=e[0];t!==n&&n?.pause(),e=ed(e,t),e.unshift(t)},remove(t){e=ed(e,t),e[0]?.resume()}}}function ed(e,t){const n=[...e],r=n.indexOf(t);return r!==-1&&n.splice(r,1),n}function CO(e){return e.filter(t=>t.tagName!=="A")}var EO=Ir[" useId ".trim().toString()]||(()=>{}),RO=0;function vr(e){const[t,n]=y.useState(EO());return it(()=>{n(r=>r??String(RO++))},[e]),t?`radix-${t}`:""}const PO=["top","right","bottom","left"],Sn=Math.min,St=Math.max,yo=Math.round,Hi=Math.floor,Qt=e=>({x:e,y:e}),TO={left:"right",right:"left",bottom:"top",top:"bottom"};function fs(e,t,n){return St(e,Sn(t,n))}function on(e,t){return typeof e=="function"?e(t):e}function an(e){return e.split("-")[0]}function _r(e){return e.split("-")[1]}function il(e){return e==="x"?"y":"x"}function ol(e){return e==="y"?"height":"width"}function Gt(e){const t=e[0];return t==="t"||t==="b"?"y":"x"}function al(e){return il(Gt(e))}function IO(e,t,n){n===void 0&&(n=!1);const r=_r(e),i=al(e),o=ol(i);let a=i==="x"?r===(n?"end":"start")?"right":"left":r==="start"?"bottom":"top";return t.reference[o]>t.floating[o]&&(a=bo(a)),[a,bo(a)]}function LO(e){const t=bo(e);return[hs(e),t,hs(t)]}function hs(e){return e.includes("start")?e.replace("start","end"):e.replace("end","start")}const td=["left","right"],nd=["right","left"],OO=["top","bottom"],DO=["bottom","top"];function NO(e,t,n){switch(e){case"top":case"bottom":return n?t?nd:td:t?td:nd;case"left":case"right":return t?OO:DO;default:return[]}}function MO(e,t,n,r){const i=_r(e);let o=NO(an(e),n==="start",r);return i&&(o=o.map(a=>a+"-"+i),t&&(o=o.concat(o.map(hs)))),o}function bo(e){const t=an(e);return TO[t]+e.slice(t.length)}function _O(e){return{top:0,right:0,bottom:0,left:0,...e}}function Vh(e){return typeof e!="number"?_O(e):{top:e,right:e,bottom:e,left:e}}function vo(e){const{x:t,y:n,width:r,height:i}=e;return{width:r,height:i,top:n,left:t,right:t+r,bottom:n+i,x:t,y:n}}function rd(e,t,n){let{reference:r,floating:i}=e;const o=Gt(t),a=al(t),s=ol(a),l=an(t),c=o==="y",u=r.x+r.width/2-i.width/2,d=r.y+r.height/2-i.height/2,h=r[s]/2-i[s]/2;let f;switch(l){case"top":f={x:u,y:r.y-i.height};break;case"bottom":f={x:u,y:r.y+r.height};break;case"right":f={x:r.x+r.width,y:d};break;case"left":f={x:r.x-i.width,y:d};break;default:f={x:r.x,y:r.y}}switch(_r(t)){case"start":f[a]-=h*(n&&c?-1:1);break;case"end":f[a]+=h*(n&&c?-1:1);break}return f}async function jO(e,t){var n;t===void 0&&(t={});const{x:r,y:i,platform:o,rects:a,elements:s,strategy:l}=e,{boundary:c="clippingAncestors",rootBoundary:u="viewport",elementContext:d="floating",altBoundary:h=!1,padding:f=0}=on(t,e),m=Vh(f),b=s[h?d==="floating"?"reference":"floating":d],v=vo(await o.getClippingRect({element:(n=await(o.isElement==null?void 0:o.isElement(b)))==null||n?b:b.contextElement||await(o.getDocumentElement==null?void 0:o.getDocumentElement(s.floating)),boundary:c,rootBoundary:u,strategy:l})),x=d==="floating"?{x:r,y:i,width:a.floating.width,height:a.floating.height}:a.reference,w=await(o.getOffsetParent==null?void 0:o.getOffsetParent(s.floating)),E=await(o.isElement==null?void 0:o.isElement(w))?await(o.getScale==null?void 0:o.getScale(w))||{x:1,y:1}:{x:1,y:1},T=vo(o.convertOffsetParentRelativeRectToViewportRelativeRect?await o.convertOffsetParentRelativeRectToViewportRelativeRect({elements:s,rect:x,offsetParent:w,strategy:l}):x);return{top:(v.top-T.top+m.top)/E.y,bottom:(T.bottom-v.bottom+m.bottom)/E.y,left:(v.left-T.left+m.left)/E.x,right:(T.right-v.right+m.right)/E.x}}const FO=50,HO=async(e,t,n)=>{const{placement:r="bottom",strategy:i="absolute",middleware:o=[],platform:a}=n,s=a.detectOverflow?a:{...a,detectOverflow:jO},l=await(a.isRTL==null?void 0:a.isRTL(t));let c=await a.getElementRects({reference:e,floating:t,strategy:i}),{x:u,y:d}=rd(c,r,l),h=r,f=0;const m={};for(let p=0;p<o.length;p++){const b=o[p];if(!b)continue;const{name:v,fn:x}=b,{x:w,y:E,data:T,reset:S}=await x({x:u,y:d,initialPlacement:r,placement:h,strategy:i,middlewareData:m,rects:c,platform:s,elements:{reference:e,floating:t}});u=w??u,d=E??d,m[v]={...m[v],...T},S&&f<FO&&(f++,typeof S=="object"&&(S.placement&&(h=S.placement),S.rects&&(c=S.rects===!0?await a.getElementRects({reference:e,floating:t,strategy:i}):S.rects),{x:u,y:d}=rd(c,h,l)),p=-1)}return{x:u,y:d,placement:h,strategy:i,middlewareData:m}},UO=e=>({name:"arrow",options:e,async fn(t){const{x:n,y:r,placement:i,rects:o,platform:a,elements:s,middlewareData:l}=t,{element:c,padding:u=0}=on(e,t)||{};if(c==null)return{};const d=Vh(u),h={x:n,y:r},f=al(i),m=ol(f),p=await a.getDimensions(c),b=f==="y",v=b?"top":"left",x=b?"bottom":"right",w=b?"clientHeight":"clientWidth",E=o.reference[m]+o.reference[f]-h[f]-o.floating[m],T=h[f]-o.reference[f],S=await(a.getOffsetParent==null?void 0:a.getOffsetParent(c));let k=S?S[w]:0;(!k||!await(a.isElement==null?void 0:a.isElement(S)))&&(k=s.floating[w]||o.floating[m]);const O=E/2-T/2,_=k/2-p[m]/2-1,R=Sn(d[v],_),D=Sn(d[x],_),L=R,z=k-p[m]-D,H=k/2-p[m]/2+O,V=fs(L,H,z),Q=!l.arrow&&_r(i)!=null&&H!==V&&o.reference[m]/2-(H<L?R:D)-p[m]/2<0,Y=Q?H<L?H-L:H-z:0;return{[f]:h[f]+Y,data:{[f]:V,centerOffset:H-V-Y,...Q&&{alignmentOffset:Y}},reset:Q}}}),BO=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var n,r;const{placement:i,middlewareData:o,rects:a,initialPlacement:s,platform:l,elements:c}=t,{mainAxis:u=!0,crossAxis:d=!0,fallbackPlacements:h,fallbackStrategy:f="bestFit",fallbackAxisSideDirection:m="none",flipAlignment:p=!0,...b}=on(e,t);if((n=o.arrow)!=null&&n.alignmentOffset)return{};const v=an(i),x=Gt(s),w=an(s)===s,E=await(l.isRTL==null?void 0:l.isRTL(c.floating)),T=h||(w||!p?[bo(s)]:LO(s)),S=m!=="none";!h&&S&&T.push(...MO(s,p,m,E));const k=[s,...T],O=await l.detectOverflow(t,b),_=[];let R=((r=o.flip)==null?void 0:r.overflows)||[];if(u&&_.push(O[v]),d){const H=IO(i,a,E);_.push(O[H[0]],O[H[1]])}if(R=[...R,{placement:i,overflows:_}],!_.every(H=>H<=0)){var D,L;const H=(((D=o.flip)==null?void 0:D.index)||0)+1,V=k[H];if(V&&(!(d==="alignment"?x!==Gt(V):!1)||R.every(W=>Gt(W.placement)===x?W.overflows[0]>0:!0)))return{data:{index:H,overflows:R},reset:{placement:V}};let Q=(L=R.filter(Y=>Y.overflows[0]<=0).sort((Y,W)=>Y.overflows[1]-W.overflows[1])[0])==null?void 0:L.placement;if(!Q)switch(f){case"bestFit":{var z;const Y=(z=R.filter(W=>{if(S){const F=Gt(W.placement);return F===x||F==="y"}return!0}).map(W=>[W.placement,W.overflows.filter(F=>F>0).reduce((F,A)=>F+A,0)]).sort((W,F)=>W[1]-F[1])[0])==null?void 0:z[0];Y&&(Q=Y);break}case"initialPlacement":Q=s;break}if(i!==Q)return{reset:{placement:Q}}}return{}}}};function id(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function od(e){return PO.some(t=>e[t]>=0)}const zO=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(t){const{rects:n,platform:r}=t,{strategy:i="referenceHidden",...o}=on(e,t);switch(i){case"referenceHidden":{const a=await r.detectOverflow(t,{...o,elementContext:"reference"}),s=id(a,n.reference);return{data:{referenceHiddenOffsets:s,referenceHidden:od(s)}}}case"escaped":{const a=await r.detectOverflow(t,{...o,altBoundary:!0}),s=id(a,n.floating);return{data:{escapedOffsets:s,escaped:od(s)}}}default:return{}}}}},Wh=new Set(["left","top"]);async function $O(e,t){const{placement:n,platform:r,elements:i}=e,o=await(r.isRTL==null?void 0:r.isRTL(i.floating)),a=an(n),s=_r(n),l=Gt(n)==="y",c=Wh.has(a)?-1:1,u=o&&l?-1:1,d=on(t,e);let{mainAxis:h,crossAxis:f,alignmentAxis:m}=typeof d=="number"?{mainAxis:d,crossAxis:0,alignmentAxis:null}:{mainAxis:d.mainAxis||0,crossAxis:d.crossAxis||0,alignmentAxis:d.alignmentAxis};return s&&typeof m=="number"&&(f=s==="end"?m*-1:m),l?{x:f*u,y:h*c}:{x:h*c,y:f*u}}const VO=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var n,r;const{x:i,y:o,placement:a,middlewareData:s}=t,l=await $O(t,e);return a===((n=s.offset)==null?void 0:n.placement)&&(r=s.arrow)!=null&&r.alignmentOffset?{}:{x:i+l.x,y:o+l.y,data:{...l,placement:a}}}}},WO=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:r,placement:i,platform:o}=t,{mainAxis:a=!0,crossAxis:s=!1,limiter:l={fn:v=>{let{x,y:w}=v;return{x,y:w}}},...c}=on(e,t),u={x:n,y:r},d=await o.detectOverflow(t,c),h=Gt(an(i)),f=il(h);let m=u[f],p=u[h];if(a){const v=f==="y"?"top":"left",x=f==="y"?"bottom":"right",w=m+d[v],E=m-d[x];m=fs(w,m,E)}if(s){const v=h==="y"?"top":"left",x=h==="y"?"bottom":"right",w=p+d[v],E=p-d[x];p=fs(w,p,E)}const b=l.fn({...t,[f]:m,[h]:p});return{...b,data:{x:b.x-n,y:b.y-r,enabled:{[f]:a,[h]:s}}}}}},KO=function(e){return e===void 0&&(e={}),{options:e,fn(t){const{x:n,y:r,placement:i,rects:o,middlewareData:a}=t,{offset:s=0,mainAxis:l=!0,crossAxis:c=!0}=on(e,t),u={x:n,y:r},d=Gt(i),h=il(d);let f=u[h],m=u[d];const p=on(s,t),b=typeof p=="number"?{mainAxis:p,crossAxis:0}:{mainAxis:0,crossAxis:0,...p};if(l){const w=h==="y"?"height":"width",E=o.reference[h]-o.floating[w]+b.mainAxis,T=o.reference[h]+o.reference[w]-b.mainAxis;f<E?f=E:f>T&&(f=T)}if(c){var v,x;const w=h==="y"?"width":"height",E=Wh.has(an(i)),T=o.reference[d]-o.floating[w]+(E&&((v=a.offset)==null?void 0:v[d])||0)+(E?0:b.crossAxis),S=o.reference[d]+o.reference[w]+(E?0:((x=a.offset)==null?void 0:x[d])||0)-(E?b.crossAxis:0);m<T?m=T:m>S&&(m=S)}return{[h]:f,[d]:m}}}},qO=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){var n,r;const{placement:i,rects:o,platform:a,elements:s}=t,{apply:l=()=>{},...c}=on(e,t),u=await a.detectOverflow(t,c),d=an(i),h=_r(i),f=Gt(i)==="y",{width:m,height:p}=o.floating;let b,v;d==="top"||d==="bottom"?(b=d,v=h===(await(a.isRTL==null?void 0:a.isRTL(s.floating))?"start":"end")?"left":"right"):(v=d,b=h==="end"?"top":"bottom");const x=p-u.top-u.bottom,w=m-u.left-u.right,E=Sn(p-u[b],x),T=Sn(m-u[v],w),S=!t.middlewareData.shift;let k=E,O=T;if((n=t.middlewareData.shift)!=null&&n.enabled.x&&(O=w),(r=t.middlewareData.shift)!=null&&r.enabled.y&&(k=x),S&&!h){const R=St(u.left,0),D=St(u.right,0),L=St(u.top,0),z=St(u.bottom,0);f?O=m-2*(R!==0||D!==0?R+D:St(u.left,u.right)):k=p-2*(L!==0||z!==0?L+z:St(u.top,u.bottom))}await l({...t,availableWidth:O,availableHeight:k});const _=await a.getDimensions(s.floating);return m!==_.width||p!==_.height?{reset:{rects:!0}}:{}}}};function Fo(){return typeof window<"u"}function jr(e){return Kh(e)?(e.nodeName||"").toLowerCase():"#document"}function Ct(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function Xt(e){var t;return(t=(Kh(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function Kh(e){return Fo()?e instanceof Node||e instanceof Ct(e).Node:!1}function Mt(e){return Fo()?e instanceof Element||e instanceof Ct(e).Element:!1}function dn(e){return Fo()?e instanceof HTMLElement||e instanceof Ct(e).HTMLElement:!1}function ad(e){return!Fo()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof Ct(e).ShadowRoot}function Ai(e){const{overflow:t,overflowX:n,overflowY:r,display:i}=_t(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&i!=="inline"&&i!=="contents"}function GO(e){return/^(table|td|th)$/.test(jr(e))}function Ho(e){try{if(e.matches(":popover-open"))return!0}catch{}try{return e.matches(":modal")}catch{return!1}}const QO=/transform|translate|scale|rotate|perspective|filter/,YO=/paint|layout|strict|content/,Hn=e=>!!e&&e!=="none";let Aa;function sl(e){const t=Mt(e)?_t(e):e;return Hn(t.transform)||Hn(t.translate)||Hn(t.scale)||Hn(t.rotate)||Hn(t.perspective)||!ll()&&(Hn(t.backdropFilter)||Hn(t.filter))||QO.test(t.willChange||"")||YO.test(t.contain||"")}function XO(e){let t=An(e);for(;dn(t)&&!Er(t);){if(sl(t))return t;if(Ho(t))return null;t=An(t)}return null}function ll(){return Aa==null&&(Aa=typeof CSS<"u"&&CSS.supports&&CSS.supports("-webkit-backdrop-filter","none")),Aa}function Er(e){return/^(html|body|#document)$/.test(jr(e))}function _t(e){return Ct(e).getComputedStyle(e)}function Uo(e){return Mt(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function An(e){if(jr(e)==="html")return e;const t=e.assignedSlot||e.parentNode||ad(e)&&e.host||Xt(e);return ad(t)?t.host:t}function qh(e){const t=An(e);return Er(t)?e.ownerDocument?e.ownerDocument.body:e.body:dn(t)&&Ai(t)?t:qh(t)}function gi(e,t,n){var r;t===void 0&&(t=[]),n===void 0&&(n=!0);const i=qh(e),o=i===((r=e.ownerDocument)==null?void 0:r.body),a=Ct(i);if(o){const s=ps(a);return t.concat(a,a.visualViewport||[],Ai(i)?i:[],s&&n?gi(s):[])}else return t.concat(i,gi(i,[],n))}function ps(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function Gh(e){const t=_t(e);let n=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const i=dn(e),o=i?e.offsetWidth:n,a=i?e.offsetHeight:r,s=yo(n)!==o||yo(r)!==a;return s&&(n=o,r=a),{width:n,height:r,$:s}}function cl(e){return Mt(e)?e:e.contextElement}function xr(e){const t=cl(e);if(!dn(t))return Qt(1);const n=t.getBoundingClientRect(),{width:r,height:i,$:o}=Gh(t);let a=(o?yo(n.width):n.width)/r,s=(o?yo(n.height):n.height)/i;return(!a||!Number.isFinite(a))&&(a=1),(!s||!Number.isFinite(s))&&(s=1),{x:a,y:s}}const JO=Qt(0);function Qh(e){const t=Ct(e);return!ll()||!t.visualViewport?JO:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function ZO(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==Ct(e)?!1:t}function er(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);const i=e.getBoundingClientRect(),o=cl(e);let a=Qt(1);t&&(r?Mt(r)&&(a=xr(r)):a=xr(e));const s=ZO(o,n,r)?Qh(o):Qt(0);let l=(i.left+s.x)/a.x,c=(i.top+s.y)/a.y,u=i.width/a.x,d=i.height/a.y;if(o){const h=Ct(o),f=r&&Mt(r)?Ct(r):r;let m=h,p=ps(m);for(;p&&r&&f!==m;){const b=xr(p),v=p.getBoundingClientRect(),x=_t(p),w=v.left+(p.clientLeft+parseFloat(x.paddingLeft))*b.x,E=v.top+(p.clientTop+parseFloat(x.paddingTop))*b.y;l*=b.x,c*=b.y,u*=b.x,d*=b.y,l+=w,c+=E,m=Ct(p),p=ps(m)}}return vo({width:u,height:d,x:l,y:c})}function Bo(e,t){const n=Uo(e).scrollLeft;return t?t.left+n:er(Xt(e)).left+n}function Yh(e,t){const n=e.getBoundingClientRect(),r=n.left+t.scrollLeft-Bo(e,n),i=n.top+t.scrollTop;return{x:r,y:i}}function eD(e){let{elements:t,rect:n,offsetParent:r,strategy:i}=e;const o=i==="fixed",a=Xt(r),s=t?Ho(t.floating):!1;if(r===a||s&&o)return n;let l={scrollLeft:0,scrollTop:0},c=Qt(1);const u=Qt(0),d=dn(r);if((d||!d&&!o)&&((jr(r)!=="body"||Ai(a))&&(l=Uo(r)),d)){const f=er(r);c=xr(r),u.x=f.x+r.clientLeft,u.y=f.y+r.clientTop}const h=a&&!d&&!o?Yh(a,l):Qt(0);return{width:n.width*c.x,height:n.height*c.y,x:n.x*c.x-l.scrollLeft*c.x+u.x+h.x,y:n.y*c.y-l.scrollTop*c.y+u.y+h.y}}function tD(e){return Array.from(e.getClientRects())}function nD(e){const t=Xt(e),n=Uo(e),r=e.ownerDocument.body,i=St(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),o=St(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight);let a=-n.scrollLeft+Bo(e);const s=-n.scrollTop;return _t(r).direction==="rtl"&&(a+=St(t.clientWidth,r.clientWidth)-i),{width:i,height:o,x:a,y:s}}const sd=25;function rD(e,t){const n=Ct(e),r=Xt(e),i=n.visualViewport;let o=r.clientWidth,a=r.clientHeight,s=0,l=0;if(i){o=i.width,a=i.height;const u=ll();(!u||u&&t==="fixed")&&(s=i.offsetLeft,l=i.offsetTop)}const c=Bo(r);if(c<=0){const u=r.ownerDocument,d=u.body,h=getComputedStyle(d),f=u.compatMode==="CSS1Compat"&&parseFloat(h.marginLeft)+parseFloat(h.marginRight)||0,m=Math.abs(r.clientWidth-d.clientWidth-f);m<=sd&&(o-=m)}else c<=sd&&(o+=c);return{width:o,height:a,x:s,y:l}}function iD(e,t){const n=er(e,!0,t==="fixed"),r=n.top+e.clientTop,i=n.left+e.clientLeft,o=dn(e)?xr(e):Qt(1),a=e.clientWidth*o.x,s=e.clientHeight*o.y,l=i*o.x,c=r*o.y;return{width:a,height:s,x:l,y:c}}function ld(e,t,n){let r;if(t==="viewport")r=rD(e,n);else if(t==="document")r=nD(Xt(e));else if(Mt(t))r=iD(t,n);else{const i=Qh(e);r={x:t.x-i.x,y:t.y-i.y,width:t.width,height:t.height}}return vo(r)}function Xh(e,t){const n=An(e);return n===t||!Mt(n)||Er(n)?!1:_t(n).position==="fixed"||Xh(n,t)}function oD(e,t){const n=t.get(e);if(n)return n;let r=gi(e,[],!1).filter(s=>Mt(s)&&jr(s)!=="body"),i=null;const o=_t(e).position==="fixed";let a=o?An(e):e;for(;Mt(a)&&!Er(a);){const s=_t(a),l=sl(a);!l&&s.position==="fixed"&&(i=null),(o?!l&&!i:!l&&s.position==="static"&&!!i&&(i.position==="absolute"||i.position==="fixed")||Ai(a)&&!l&&Xh(e,a))?r=r.filter(u=>u!==a):i=s,a=An(a)}return t.set(e,r),r}function aD(e){let{element:t,boundary:n,rootBoundary:r,strategy:i}=e;const a=[...n==="clippingAncestors"?Ho(t)?[]:oD(t,this._c):[].concat(n),r],s=ld(t,a[0],i);let l=s.top,c=s.right,u=s.bottom,d=s.left;for(let h=1;h<a.length;h++){const f=ld(t,a[h],i);l=St(f.top,l),c=Sn(f.right,c),u=Sn(f.bottom,u),d=St(f.left,d)}return{width:c-d,height:u-l,x:d,y:l}}function sD(e){const{width:t,height:n}=Gh(e);return{width:t,height:n}}function lD(e,t,n){const r=dn(t),i=Xt(t),o=n==="fixed",a=er(e,!0,o,t);let s={scrollLeft:0,scrollTop:0};const l=Qt(0);function c(){l.x=Bo(i)}if(r||!r&&!o)if((jr(t)!=="body"||Ai(i))&&(s=Uo(t)),r){const f=er(t,!0,o,t);l.x=f.x+t.clientLeft,l.y=f.y+t.clientTop}else i&&c();o&&!r&&i&&c();const u=i&&!r&&!o?Yh(i,s):Qt(0),d=a.left+s.scrollLeft-l.x-u.x,h=a.top+s.scrollTop-l.y-u.y;return{x:d,y:h,width:a.width,height:a.height}}function Ca(e){return _t(e).position==="static"}function cd(e,t){if(!dn(e)||_t(e).position==="fixed")return null;if(t)return t(e);let n=e.offsetParent;return Xt(e)===n&&(n=n.ownerDocument.body),n}function Jh(e,t){const n=Ct(e);if(Ho(e))return n;if(!dn(e)){let i=An(e);for(;i&&!Er(i);){if(Mt(i)&&!Ca(i))return i;i=An(i)}return n}let r=cd(e,t);for(;r&&GO(r)&&Ca(r);)r=cd(r,t);return r&&Er(r)&&Ca(r)&&!sl(r)?n:r||XO(e)||n}const cD=async function(e){const t=this.getOffsetParent||Jh,n=this.getDimensions,r=await n(e.floating);return{reference:lD(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function uD(e){return _t(e).direction==="rtl"}const dD={convertOffsetParentRelativeRectToViewportRelativeRect:eD,getDocumentElement:Xt,getClippingRect:aD,getOffsetParent:Jh,getElementRects:cD,getClientRects:tD,getDimensions:sD,getScale:xr,isElement:Mt,isRTL:uD};function Zh(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function fD(e,t){let n=null,r;const i=Xt(e);function o(){var s;clearTimeout(r),(s=n)==null||s.disconnect(),n=null}function a(s,l){s===void 0&&(s=!1),l===void 0&&(l=1),o();const c=e.getBoundingClientRect(),{left:u,top:d,width:h,height:f}=c;if(s||t(),!h||!f)return;const m=Hi(d),p=Hi(i.clientWidth-(u+h)),b=Hi(i.clientHeight-(d+f)),v=Hi(u),w={rootMargin:-m+"px "+-p+"px "+-b+"px "+-v+"px",threshold:St(0,Sn(1,l))||1};let E=!0;function T(S){const k=S[0].intersectionRatio;if(k!==l){if(!E)return a();k?a(!1,k):r=setTimeout(()=>{a(!1,1e-7)},1e3)}k===1&&!Zh(c,e.getBoundingClientRect())&&a(),E=!1}try{n=new IntersectionObserver(T,{...w,root:i.ownerDocument})}catch{n=new IntersectionObserver(T,w)}n.observe(e)}return a(!0),o}function hD(e,t,n,r){r===void 0&&(r={});const{ancestorScroll:i=!0,ancestorResize:o=!0,elementResize:a=typeof ResizeObserver=="function",layoutShift:s=typeof IntersectionObserver=="function",animationFrame:l=!1}=r,c=cl(e),u=i||o?[...c?gi(c):[],...t?gi(t):[]]:[];u.forEach(v=>{i&&v.addEventListener("scroll",n,{passive:!0}),o&&v.addEventListener("resize",n)});const d=c&&s?fD(c,n):null;let h=-1,f=null;a&&(f=new ResizeObserver(v=>{let[x]=v;x&&x.target===c&&f&&t&&(f.unobserve(t),cancelAnimationFrame(h),h=requestAnimationFrame(()=>{var w;(w=f)==null||w.observe(t)})),n()}),c&&!l&&f.observe(c),t&&f.observe(t));let m,p=l?er(e):null;l&&b();function b(){const v=er(e);p&&!Zh(p,v)&&n(),p=v,m=requestAnimationFrame(b)}return n(),()=>{var v;u.forEach(x=>{i&&x.removeEventListener("scroll",n),o&&x.removeEventListener("resize",n)}),d?.(),(v=f)==null||v.disconnect(),f=null,l&&cancelAnimationFrame(m)}}const pD=VO,mD=WO,gD=BO,yD=qO,bD=zO,ud=UO,vD=KO,xD=(e,t,n)=>{const r=new Map,i={platform:dD,...n},o={...i.platform,_c:r};return HO(e,t,{...i,platform:o})};var wD=typeof document<"u",kD=function(){},Qi=wD?y.useLayoutEffect:kD;function xo(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(typeof e=="function"&&e.toString()===t.toString())return!0;let n,r,i;if(e&&t&&typeof e=="object"){if(Array.isArray(e)){if(n=e.length,n!==t.length)return!1;for(r=n;r--!==0;)if(!xo(e[r],t[r]))return!1;return!0}if(i=Object.keys(e),n=i.length,n!==Object.keys(t).length)return!1;for(r=n;r--!==0;)if(!{}.hasOwnProperty.call(t,i[r]))return!1;for(r=n;r--!==0;){const o=i[r];if(!(o==="_owner"&&e.$$typeof)&&!xo(e[o],t[o]))return!1}return!0}return e!==e&&t!==t}function ep(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function dd(e,t){const n=ep(e);return Math.round(t*n)/n}function Ea(e){const t=y.useRef(e);return Qi(()=>{t.current=e}),t}function SD(e){e===void 0&&(e={});const{placement:t="bottom",strategy:n="absolute",middleware:r=[],platform:i,elements:{reference:o,floating:a}={},transform:s=!0,whileElementsMounted:l,open:c}=e,[u,d]=y.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[h,f]=y.useState(r);xo(h,r)||f(r);const[m,p]=y.useState(null),[b,v]=y.useState(null),x=y.useCallback(W=>{W!==S.current&&(S.current=W,p(W))},[]),w=y.useCallback(W=>{W!==k.current&&(k.current=W,v(W))},[]),E=o||m,T=a||b,S=y.useRef(null),k=y.useRef(null),O=y.useRef(u),_=l!=null,R=Ea(l),D=Ea(i),L=Ea(c),z=y.useCallback(()=>{if(!S.current||!k.current)return;const W={placement:t,strategy:n,middleware:h};D.current&&(W.platform=D.current),xD(S.current,k.current,W).then(F=>{const A={...F,isPositioned:L.current!==!1};H.current&&!xo(O.current,A)&&(O.current=A,Tr.flushSync(()=>{d(A)}))})},[h,t,n,D,L]);Qi(()=>{c===!1&&O.current.isPositioned&&(O.current.isPositioned=!1,d(W=>({...W,isPositioned:!1})))},[c]);const H=y.useRef(!1);Qi(()=>(H.current=!0,()=>{H.current=!1}),[]),Qi(()=>{if(E&&(S.current=E),T&&(k.current=T),E&&T){if(R.current)return R.current(E,T,z);z()}},[E,T,z,R,_]);const V=y.useMemo(()=>({reference:S,floating:k,setReference:x,setFloating:w}),[x,w]),Q=y.useMemo(()=>({reference:E,floating:T}),[E,T]),Y=y.useMemo(()=>{const W={position:n,left:0,top:0};if(!Q.floating)return W;const F=dd(Q.floating,u.x),A=dd(Q.floating,u.y);return s?{...W,transform:"translate("+F+"px, "+A+"px)",...ep(Q.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:F,top:A}},[n,s,Q.floating,u.x,u.y]);return y.useMemo(()=>({...u,update:z,refs:V,elements:Q,floatingStyles:Y}),[u,z,V,Q,Y])}const AD=e=>{function t(n){return{}.hasOwnProperty.call(n,"current")}return{name:"arrow",options:e,fn(n){const{element:r,padding:i}=typeof e=="function"?e(n):e;return r&&t(r)?r.current!=null?ud({element:r.current,padding:i}).fn(n):{}:r?ud({element:r,padding:i}).fn(n):{}}}},CD=(e,t)=>{const n=pD(e);return{name:n.name,fn:n.fn,options:[e,t]}},ED=(e,t)=>{const n=mD(e);return{name:n.name,fn:n.fn,options:[e,t]}},RD=(e,t)=>({fn:vD(e).fn,options:[e,t]}),PD=(e,t)=>{const n=gD(e);return{name:n.name,fn:n.fn,options:[e,t]}},TD=(e,t)=>{const n=yD(e);return{name:n.name,fn:n.fn,options:[e,t]}},ID=(e,t)=>{const n=bD(e);return{name:n.name,fn:n.fn,options:[e,t]}},LD=(e,t)=>{const n=AD(e);return{name:n.name,fn:n.fn,options:[e,t]}};var OD="Arrow",tp=y.forwardRef((e,t)=>{const{children:n,width:r=10,height:i=5,...o}=e;return g.jsx(Me.svg,{...o,ref:t,width:r,height:i,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:e.asChild?n:g.jsx("polygon",{points:"0,0 30,0 15,10"})})});tp.displayName=OD;var DD=tp;function ND(e){const[t,n]=y.useState(void 0);return it(()=>{if(e){n({width:e.offsetWidth,height:e.offsetHeight});const r=new ResizeObserver(i=>{if(!Array.isArray(i)||!i.length)return;const o=i[0];let a,s;if("borderBoxSize"in o){const l=o.borderBoxSize,c=Array.isArray(l)?l[0]:l;a=c.inlineSize,s=c.blockSize}else a=e.offsetWidth,s=e.offsetHeight;n({width:a,height:s})});return r.observe(e,{box:"border-box"}),()=>r.unobserve(e)}else n(void 0)},[e]),t}var ul="Popper",[np,zo]=Si(ul),[MD,rp]=np(ul),ip=e=>{const{__scopePopper:t,children:n}=e,[r,i]=y.useState(null),[o,a]=y.useState(void 0);return g.jsx(MD,{scope:t,anchor:r,onAnchorChange:i,placementState:o,setPlacementState:a,children:n})};ip.displayName=ul;var op="PopperAnchor",ap=y.forwardRef((e,t)=>{const{__scopePopper:n,virtualRef:r,...i}=e,o=rp(op,n),a=y.useRef(null),s=o.onAnchorChange,l=y.useCallback(m=>{a.current=m,m&&s(m)},[s]),c=$e(t,l),u=y.useRef(null);y.useEffect(()=>{if(!r)return;const m=u.current;u.current=r.current,m!==u.current&&s(u.current)});const d=o.placementState&&fl(o.placementState),h=d?.[0],f=d?.[1];return r?null:g.jsx(Me.div,{"data-radix-popper-side":h,"data-radix-popper-align":f,...i,ref:c})});ap.displayName=op;var dl="PopperContent",[_D,jD]=np(dl),sp=y.forwardRef((e,t)=>{const{__scopePopper:n,side:r="bottom",sideOffset:i=0,align:o="center",alignOffset:a=0,arrowPadding:s=0,avoidCollisions:l=!0,collisionBoundary:c=[],collisionPadding:u=0,sticky:d="partial",hideWhenDetached:h=!1,updatePositionStrategy:f="optimized",onPlaced:m,...p}=e,b=rp(dl,n),[v,x]=y.useState(null),w=$e(t,x),[E,T]=y.useState(null),S=ND(E),k=S?.width??0,O=S?.height??0,_=r+(o!=="center"?"-"+o:""),R=typeof u=="number"?u:{top:0,right:0,bottom:0,left:0,...u},D=Array.isArray(c)?c:[c],L=D.length>0,z={padding:R,boundary:D.filter(HD),altBoundary:L},{refs:H,floatingStyles:V,placement:Q,isPositioned:Y,middlewareData:W}=SD({strategy:"fixed",placement:_,whileElementsMounted:(...me)=>hD(...me,{animationFrame:f==="always"}),elements:{reference:b.anchor},middleware:[CD({mainAxis:i+O,alignmentAxis:a}),l&&ED({mainAxis:!0,crossAxis:!1,limiter:d==="partial"?RD():void 0,...z}),l&&PD({...z}),TD({...z,apply:({elements:me,rects:Te,availableWidth:xe,availableHeight:Se})=>{const{width:he,height:Ge}=Te.reference,Ze=me.floating.style;Ze.setProperty("--radix-popper-available-width",`${xe}px`),Ze.setProperty("--radix-popper-available-height",`${Se}px`),Ze.setProperty("--radix-popper-anchor-width",`${he}px`),Ze.setProperty("--radix-popper-anchor-height",`${Ge}px`)}}),E&&LD({element:E,padding:s}),UD({arrowWidth:k,arrowHeight:O}),h&&ID({strategy:"referenceHidden",...z,boundary:L?z.boundary:void 0})]}),F=b.setPlacementState;it(()=>(F(Q),()=>{F(void 0)}),[Q,F]);const[A,ie]=fl(Q),Z=kn(m);it(()=>{Y&&Z?.()},[Y,Z]);const C=W.arrow?.x,ae=W.arrow?.y,pe=W.arrow?.centerOffset!==0,[ve,q]=y.useState();return it(()=>{v&&q(window.getComputedStyle(v).zIndex)},[v]),g.jsx("div",{ref:H.setFloating,"data-radix-popper-content-wrapper":"",style:{...V,transform:Y?V.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:ve,"--radix-popper-transform-origin":[W.transformOrigin?.x,W.transformOrigin?.y].join(" "),...W.hide?.referenceHidden&&{visibility:"hidden",pointerEvents:"none"}},dir:e.dir,children:g.jsx(_D,{scope:n,placedSide:A,placedAlign:ie,onArrowChange:T,arrowX:C,arrowY:ae,shouldHideArrow:pe,children:g.jsx(Me.div,{"data-side":A,"data-align":ie,...p,ref:w,style:{...p.style,animation:Y?void 0:"none"}})})})});sp.displayName=dl;var lp="PopperArrow",FD={top:"bottom",right:"left",bottom:"top",left:"right"},cp=y.forwardRef(function(t,n){const{__scopePopper:r,...i}=t,o=jD(lp,r),a=FD[o.placedSide];return g.jsx("span",{ref:o.onArrowChange,style:{position:"absolute",left:o.arrowX,top:o.arrowY,[a]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[o.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[o.placedSide],visibility:o.shouldHideArrow?"hidden":void 0},children:g.jsx(DD,{...i,ref:n,style:{...i.style,display:"block"}})})});cp.displayName=lp;function HD(e){return e!==null}var UD=e=>({name:"transformOrigin",options:e,fn(t){const{placement:n,rects:r,middlewareData:i}=t,a=i.arrow?.centerOffset!==0,s=a?0:e.arrowWidth,l=a?0:e.arrowHeight,[c,u]=fl(n),d={start:"0%",center:"50%",end:"100%"}[u],h=(i.arrow?.x??0)+s/2,f=(i.arrow?.y??0)+l/2;let m="",p="";return c==="bottom"?(m=a?d:`${h}px`,p=`${-l}px`):c==="top"?(m=a?d:`${h}px`,p=`${r.floating.height+l}px`):c==="right"?(m=`${-l}px`,p=a?d:`${f}px`):c==="left"&&(m=`${r.floating.width+l}px`,p=a?d:`${f}px`),{data:{x:m,y:p}}}});function fl(e){const[t,n="center"]=e.split("-");return[t,n]}var BD=ip,up=ap,dp=sp,fp=cp,zD="Portal",hl=y.forwardRef((e,t)=>{const{container:n,...r}=e,[i,o]=y.useState(!1);it(()=>o(!0),[]);const a=n||i&&globalThis?.document?.body;return a?Tr.createPortal(g.jsx(Me.div,{...r,ref:t}),a):null});hl.displayName=zD;function $D(e,t){return y.useReducer((n,r)=>t[n][r]??n,e)}var Fr=e=>{const{present:t,children:n}=e,r=VD(t),i=typeof n=="function"?n({present:r.isPresent}):y.Children.only(n),o=WD(r.ref,KD(i));return typeof n=="function"||r.isPresent?y.cloneElement(i,{ref:o}):null};Fr.displayName="Presence";function VD(e){const[t,n]=y.useState(),r=y.useRef(null),i=y.useRef(e),o=y.useRef("none"),a=e?"mounted":"unmounted",[s,l]=$D(a,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return y.useEffect(()=>{const c=Ui(r.current);o.current=s==="mounted"?c:"none"},[s]),it(()=>{const c=r.current,u=i.current;if(u!==e){const h=o.current,f=Ui(c);e?l("MOUNT"):f==="none"||c?.display==="none"?l("UNMOUNT"):l(u&&h!==f?"ANIMATION_OUT":"UNMOUNT"),i.current=e}},[e,l]),it(()=>{if(t){let c;const u=t.ownerDocument.defaultView??window,d=f=>{const p=Ui(r.current).includes(CSS.escape(f.animationName));if(f.target===t&&p&&(l("ANIMATION_END"),!i.current)){const b=t.style.animationFillMode;t.style.animationFillMode="forwards",c=u.setTimeout(()=>{t.style.animationFillMode==="forwards"&&(t.style.animationFillMode=b)})}},h=f=>{f.target===t&&(o.current=Ui(r.current))};return t.addEventListener("animationstart",h),t.addEventListener("animationcancel",d),t.addEventListener("animationend",d),()=>{u.clearTimeout(c),t.removeEventListener("animationstart",h),t.removeEventListener("animationcancel",d),t.removeEventListener("animationend",d)}}else l("ANIMATION_END")},[t,l]),{isPresent:["mounted","unmountSuspended"].includes(s),ref:y.useCallback(c=>{r.current=c?getComputedStyle(c):null,n(c)},[])}}function fd(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function WD(...e){const t=y.useRef(e);return t.current=e,y.useCallback(n=>{const r=t.current;let i=!1;const o=r.map(a=>{const s=fd(a,n);return!i&&typeof s=="function"&&(i=!0),s});if(i)return()=>{for(let a=0;a<o.length;a++){const s=o[a];typeof s=="function"?s():fd(r[a],null)}}},[])}function Ui(e){return e?.animationName||"none"}function KD(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var qD=Ir[" useInsertionEffect ".trim().toString()]||it;function ms({prop:e,defaultProp:t,onChange:n=()=>{},caller:r}){const[i,o,a]=GD({defaultProp:t,onChange:n}),s=e!==void 0,l=s?e:i;{const u=y.useRef(e!==void 0);y.useEffect(()=>{const d=u.current;d!==s&&console.warn(`${r} is changing from ${d?"controlled":"uncontrolled"} to ${s?"controlled":"uncontrolled"}. Components should not switch from controlled to uncontrolled (or vice versa). Decide between using a controlled or uncontrolled value for the lifetime of the component.`),u.current=s},[s,r])}const c=y.useCallback(u=>{if(s){const d=QD(u)?u(e):u;d!==e&&a.current?.(d)}else o(u)},[s,e,o,a]);return[l,c]}function GD({defaultProp:e,onChange:t}){const[n,r]=y.useState(e),i=y.useRef(n),o=y.useRef(t);return qD(()=>{o.current=t},[t]),y.useEffect(()=>{i.current!==n&&(o.current?.(n),i.current=n)},[n,i]),[n,r,o]}function QD(e){return typeof e=="function"}function YD(e){const t=y.useRef({value:e,previous:e});return y.useMemo(()=>(t.current.value!==e&&(t.current.previous=t.current.value,t.current.value=e),t.current.previous),[e])}var hp=Object.freeze({position:"absolute",border:0,width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",wordWrap:"normal"}),XD="VisuallyHidden",pp=y.forwardRef((e,t)=>g.jsx(Me.span,{...e,ref:t,style:{...hp,...e.style}}));pp.displayName=XD;var JD=pp,ZD=function(e){if(typeof document>"u")return null;var t=Array.isArray(e)?e[0]:e;return t.ownerDocument.body},fr=new WeakMap,Bi=new WeakMap,zi={},Ra=0,mp=function(e){return e&&(e.host||mp(e.parentNode))},eN=function(e,t){return t.map(function(n){if(e.contains(n))return n;var r=mp(n);return r&&e.contains(r)?r:(console.error("aria-hidden",n,"in not contained inside",e,". Doing nothing"),null)}).filter(function(n){return!!n})},tN=function(e,t,n,r){var i=eN(t,Array.isArray(e)?e:[e]);zi[n]||(zi[n]=new WeakMap);var o=zi[n],a=[],s=new Set,l=new Set(i),c=function(d){!d||s.has(d)||(s.add(d),c(d.parentNode))};i.forEach(c);var u=function(d){!d||l.has(d)||Array.prototype.forEach.call(d.children,function(h){if(s.has(h))u(h);else try{var f=h.getAttribute(r),m=f!==null&&f!=="false",p=(fr.get(h)||0)+1,b=(o.get(h)||0)+1;fr.set(h,p),o.set(h,b),a.push(h),p===1&&m&&Bi.set(h,!0),b===1&&h.setAttribute(n,"true"),m||h.setAttribute(r,"true")}catch(v){console.error("aria-hidden: cannot operate on ",h,v)}})};return u(t),s.clear(),Ra++,function(){a.forEach(function(d){var h=fr.get(d)-1,f=o.get(d)-1;fr.set(d,h),o.set(d,f),h||(Bi.has(d)||d.removeAttribute(r),Bi.delete(d)),f||d.removeAttribute(n)}),Ra--,Ra||(fr=new WeakMap,fr=new WeakMap,Bi=new WeakMap,zi={})}},gp=function(e,t,n){n===void 0&&(n="data-aria-hidden");var r=Array.from(Array.isArray(e)?e:[e]),i=ZD(e);return i?(r.push.apply(r,Array.from(i.querySelectorAll("[aria-live], script"))),tN(r,i,n,"aria-hidden")):function(){return null}},Kt=function(){return Kt=Object.assign||function(t){for(var n,r=1,i=arguments.length;r<i;r++){n=arguments[r];for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(t[o]=n[o])}return t},Kt.apply(this,arguments)};function yp(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]]);return n}function nN(e,t,n){if(n||arguments.length===2)for(var r=0,i=t.length,o;r<i;r++)(o||!(r in t))&&(o||(o=Array.prototype.slice.call(t,0,r)),o[r]=t[r]);return e.concat(o||Array.prototype.slice.call(t))}var Yi="right-scroll-bar-position",Xi="width-before-scroll-bar",rN="with-scroll-bars-hidden",iN="--removed-body-scroll-bar-size";function Pa(e,t){return typeof e=="function"?e(t):e&&(e.current=t),e}function oN(e,t){var n=y.useState(function(){return{value:e,callback:t,facade:{get current(){return n.value},set current(r){var i=n.value;i!==r&&(n.value=r,n.callback(r,i))}}}})[0];return n.callback=t,n.facade}var aN=typeof window<"u"?y.useLayoutEffect:y.useEffect,hd=new WeakMap;function sN(e,t){var n=oN(null,function(r){return e.forEach(function(i){return Pa(i,r)})});return aN(function(){var r=hd.get(n);if(r){var i=new Set(r),o=new Set(e),a=n.current;i.forEach(function(s){o.has(s)||Pa(s,null)}),o.forEach(function(s){i.has(s)||Pa(s,a)})}hd.set(n,e)},[e]),n}function lN(e){return e}function cN(e,t){t===void 0&&(t=lN);var n=[],r=!1,i={read:function(){if(r)throw new Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return n.length?n[n.length-1]:e},useMedium:function(o){var a=t(o,r);return n.push(a),function(){n=n.filter(function(s){return s!==a})}},assignSyncMedium:function(o){for(r=!0;n.length;){var a=n;n=[],a.forEach(o)}n={push:function(s){return o(s)},filter:function(){return n}}},assignMedium:function(o){r=!0;var a=[];if(n.length){var s=n;n=[],s.forEach(o),a=n}var l=function(){var u=a;a=[],u.forEach(o)},c=function(){return Promise.resolve().then(l)};c(),n={push:function(u){a.push(u),c()},filter:function(u){return a=a.filter(u),n}}}};return i}function uN(e){e===void 0&&(e={});var t=cN(null);return t.options=Kt({async:!0,ssr:!1},e),t}var bp=function(e){var t=e.sideCar,n=yp(e,["sideCar"]);if(!t)throw new Error("Sidecar: please provide `sideCar` property to import the right car");var r=t.read();if(!r)throw new Error("Sidecar medium not found");return y.createElement(r,Kt({},n))};bp.isSideCarExport=!0;function dN(e,t){return e.useMedium(t),bp}var vp=uN(),Ta=function(){},$o=y.forwardRef(function(e,t){var n=y.useRef(null),r=y.useState({onScrollCapture:Ta,onWheelCapture:Ta,onTouchMoveCapture:Ta}),i=r[0],o=r[1],a=e.forwardProps,s=e.children,l=e.className,c=e.removeScrollBar,u=e.enabled,d=e.shards,h=e.sideCar,f=e.noRelative,m=e.noIsolation,p=e.inert,b=e.allowPinchZoom,v=e.as,x=v===void 0?"div":v,w=e.gapMode,E=yp(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noRelative","noIsolation","inert","allowPinchZoom","as","gapMode"]),T=h,S=sN([n,t]),k=Kt(Kt({},E),i);return y.createElement(y.Fragment,null,u&&y.createElement(T,{sideCar:vp,removeScrollBar:c,shards:d,noRelative:f,noIsolation:m,inert:p,setCallbacks:o,allowPinchZoom:!!b,lockRef:n,gapMode:w}),a?y.cloneElement(y.Children.only(s),Kt(Kt({},k),{ref:S})):y.createElement(x,Kt({},k,{className:l,ref:S}),s))});$o.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};$o.classNames={fullWidth:Xi,zeroRight:Yi};var fN=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function hN(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var t=fN();return t&&e.setAttribute("nonce",t),e}function pN(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function mN(e){var t=document.head||document.getElementsByTagName("head")[0];t.appendChild(e)}var gN=function(){var e=0,t=null;return{add:function(n){e==0&&(t=hN())&&(pN(t,n),mN(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},yN=function(){var e=gN();return function(t,n){y.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&n])}},xp=function(){var e=yN(),t=function(n){var r=n.styles,i=n.dynamic;return e(r,i),null};return t},bN={left:0,top:0,right:0,gap:0},Ia=function(e){return parseInt(e||"",10)||0},vN=function(e){var t=window.getComputedStyle(document.body),n=t[e==="padding"?"paddingLeft":"marginLeft"],r=t[e==="padding"?"paddingTop":"marginTop"],i=t[e==="padding"?"paddingRight":"marginRight"];return[Ia(n),Ia(r),Ia(i)]},xN=function(e){if(e===void 0&&(e="margin"),typeof window>"u")return bN;var t=vN(e),n=document.documentElement.clientWidth,r=window.innerWidth;return{left:t[0],top:t[1],right:t[2],gap:Math.max(0,r-n+t[2]-t[0])}},wN=xp(),wr="data-scroll-locked",kN=function(e,t,n,r){var i=e.left,o=e.top,a=e.right,s=e.gap;return n===void 0&&(n="margin"),`
204
+ .`.concat(rN,` {
205
+ overflow: hidden `).concat(r,`;
206
+ padding-right: `).concat(s,"px ").concat(r,`;
207
+ }
208
+ body[`).concat(wr,`] {
209
+ overflow: hidden `).concat(r,`;
210
+ overscroll-behavior: contain;
211
+ `).concat([t&&"position: relative ".concat(r,";"),n==="margin"&&`
212
+ padding-left: `.concat(i,`px;
213
+ padding-top: `).concat(o,`px;
214
+ padding-right: `).concat(a,`px;
215
+ margin-left:0;
216
+ margin-top:0;
217
+ margin-right: `).concat(s,"px ").concat(r,`;
218
+ `),n==="padding"&&"padding-right: ".concat(s,"px ").concat(r,";")].filter(Boolean).join(""),`
219
+ }
220
+
221
+ .`).concat(Yi,` {
222
+ right: `).concat(s,"px ").concat(r,`;
223
+ }
224
+
225
+ .`).concat(Xi,` {
226
+ margin-right: `).concat(s,"px ").concat(r,`;
227
+ }
228
+
229
+ .`).concat(Yi," .").concat(Yi,` {
230
+ right: 0 `).concat(r,`;
231
+ }
232
+
233
+ .`).concat(Xi," .").concat(Xi,` {
234
+ margin-right: 0 `).concat(r,`;
235
+ }
236
+
237
+ body[`).concat(wr,`] {
238
+ `).concat(iN,": ").concat(s,`px;
239
+ }
240
+ `)},pd=function(){var e=parseInt(document.body.getAttribute(wr)||"0",10);return isFinite(e)?e:0},SN=function(){y.useEffect(function(){return document.body.setAttribute(wr,(pd()+1).toString()),function(){var e=pd()-1;e<=0?document.body.removeAttribute(wr):document.body.setAttribute(wr,e.toString())}},[])},AN=function(e){var t=e.noRelative,n=e.noImportant,r=e.gapMode,i=r===void 0?"margin":r;SN();var o=y.useMemo(function(){return xN(i)},[i]);return y.createElement(wN,{styles:kN(o,!t,i,n?"":"!important")})},gs=!1;if(typeof window<"u")try{var $i=Object.defineProperty({},"passive",{get:function(){return gs=!0,!0}});window.addEventListener("test",$i,$i),window.removeEventListener("test",$i,$i)}catch{gs=!1}var hr=gs?{passive:!1}:!1,CN=function(e){return e.tagName==="TEXTAREA"},wp=function(e,t){if(!(e instanceof Element))return!1;var n=window.getComputedStyle(e);return n[t]!=="hidden"&&!(n.overflowY===n.overflowX&&!CN(e)&&n[t]==="visible")},EN=function(e){return wp(e,"overflowY")},RN=function(e){return wp(e,"overflowX")},md=function(e,t){var n=t.ownerDocument,r=t;do{typeof ShadowRoot<"u"&&r instanceof ShadowRoot&&(r=r.host);var i=kp(e,r);if(i){var o=Sp(e,r),a=o[1],s=o[2];if(a>s)return!0}r=r.parentNode}while(r&&r!==n.body);return!1},PN=function(e){var t=e.scrollTop,n=e.scrollHeight,r=e.clientHeight;return[t,n,r]},TN=function(e){var t=e.scrollLeft,n=e.scrollWidth,r=e.clientWidth;return[t,n,r]},kp=function(e,t){return e==="v"?EN(t):RN(t)},Sp=function(e,t){return e==="v"?PN(t):TN(t)},IN=function(e,t){return e==="h"&&t==="rtl"?-1:1},LN=function(e,t,n,r,i){var o=IN(e,window.getComputedStyle(t).direction),a=o*r,s=n.target,l=t.contains(s),c=!1,u=a>0,d=0,h=0;do{if(!s)break;var f=Sp(e,s),m=f[0],p=f[1],b=f[2],v=p-b-o*m;(m||v)&&kp(e,s)&&(d+=v,h+=m);var x=s.parentNode;s=x&&x.nodeType===Node.DOCUMENT_FRAGMENT_NODE?x.host:x}while(!l&&s!==document.body||l&&(t.contains(s)||t===s));return(u&&Math.abs(d)<1||!u&&Math.abs(h)<1)&&(c=!0),c},Vi=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},gd=function(e){return[e.deltaX,e.deltaY]},yd=function(e){return e&&"current"in e?e.current:e},ON=function(e,t){return e[0]===t[0]&&e[1]===t[1]},DN=function(e){return`
241
+ .block-interactivity-`.concat(e,` {pointer-events: none;}
242
+ .allow-interactivity-`).concat(e,` {pointer-events: all;}
243
+ `)},NN=0,pr=[];function MN(e){var t=y.useRef([]),n=y.useRef([0,0]),r=y.useRef(),i=y.useState(NN++)[0],o=y.useState(xp)[0],a=y.useRef(e);y.useEffect(function(){a.current=e},[e]),y.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(i));var p=nN([e.lockRef.current],(e.shards||[]).map(yd),!0).filter(Boolean);return p.forEach(function(b){return b.classList.add("allow-interactivity-".concat(i))}),function(){document.body.classList.remove("block-interactivity-".concat(i)),p.forEach(function(b){return b.classList.remove("allow-interactivity-".concat(i))})}}},[e.inert,e.lockRef.current,e.shards]);var s=y.useCallback(function(p,b){if("touches"in p&&p.touches.length===2||p.type==="wheel"&&p.ctrlKey)return!a.current.allowPinchZoom;var v=Vi(p),x=n.current,w="deltaX"in p?p.deltaX:x[0]-v[0],E="deltaY"in p?p.deltaY:x[1]-v[1],T,S=p.target,k=Math.abs(w)>Math.abs(E)?"h":"v";if("touches"in p&&k==="h"&&S.type==="range")return!1;var O=window.getSelection(),_=O&&O.anchorNode,R=_?_===S||_.contains(S):!1;if(R)return!1;var D=md(k,S);if(!D)return!0;if(D?T=k:(T=k==="v"?"h":"v",D=md(k,S)),!D)return!1;if(!r.current&&"changedTouches"in p&&(w||E)&&(r.current=T),!T)return!0;var L=r.current||T;return LN(L,b,p,L==="h"?w:E)},[]),l=y.useCallback(function(p){var b=p;if(!(!pr.length||pr[pr.length-1]!==o)){var v="deltaY"in b?gd(b):Vi(b),x=t.current.filter(function(T){return T.name===b.type&&(T.target===b.target||b.target===T.shadowParent)&&ON(T.delta,v)})[0];if(x&&x.should){b.cancelable&&b.preventDefault();return}if(!x){var w=(a.current.shards||[]).map(yd).filter(Boolean).filter(function(T){return T.contains(b.target)}),E=w.length>0?s(b,w[0]):!a.current.noIsolation;E&&b.cancelable&&b.preventDefault()}}},[]),c=y.useCallback(function(p,b,v,x){var w={name:p,delta:b,target:v,should:x,shadowParent:_N(v)};t.current.push(w),setTimeout(function(){t.current=t.current.filter(function(E){return E!==w})},1)},[]),u=y.useCallback(function(p){n.current=Vi(p),r.current=void 0},[]),d=y.useCallback(function(p){c(p.type,gd(p),p.target,s(p,e.lockRef.current))},[]),h=y.useCallback(function(p){c(p.type,Vi(p),p.target,s(p,e.lockRef.current))},[]);y.useEffect(function(){return pr.push(o),e.setCallbacks({onScrollCapture:d,onWheelCapture:d,onTouchMoveCapture:h}),document.addEventListener("wheel",l,hr),document.addEventListener("touchmove",l,hr),document.addEventListener("touchstart",u,hr),function(){pr=pr.filter(function(p){return p!==o}),document.removeEventListener("wheel",l,hr),document.removeEventListener("touchmove",l,hr),document.removeEventListener("touchstart",u,hr)}},[]);var f=e.removeScrollBar,m=e.inert;return y.createElement(y.Fragment,null,m?y.createElement(o,{styles:DN(i)}):null,f?y.createElement(AN,{noRelative:e.noRelative,gapMode:e.gapMode}):null)}function _N(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}const jN=dN(vp,MN);var pl=y.forwardRef(function(e,t){return y.createElement($o,Kt({},e,{ref:t,sideCar:jN}))});pl.classNames=$o.classNames;var FN=[" ","Enter","ArrowUp","ArrowDown"],HN=[" ","Enter"],tr="Select",[Vo,Wo,UN]=sO(tr),[rr]=Si(tr,[UN,zo]),Ko=zo(),[BN,In]=rr(tr),[zN,$N]=rr(tr),VN="SelectProvider";function Ap(e){const{__scopeSelect:t,children:n,open:r,defaultOpen:i,onOpenChange:o,value:a,defaultValue:s,onValueChange:l,dir:c,name:u,autoComplete:d,disabled:h,required:f,form:m,internal_do_not_use_render:p}=e,b=Ko(t),[v,x]=y.useState(null),[w,E]=y.useState(null),[T,S]=y.useState(!1),k=cO(c),[O,_]=ms({prop:r,defaultProp:i??!1,onChange:o,caller:tr}),[R,D]=ms({prop:a,defaultProp:s,onChange:l,caller:tr}),L=y.useRef(null),z=v?!!m||!!v.closest("form"):!0,[H,V]=y.useState(new Set),Q=vr(),Y=Array.from(H).map(ie=>ie.props.value).join(";"),W=y.useCallback(ie=>{V(Z=>new Set(Z).add(ie))},[]),F=y.useCallback(ie=>{V(Z=>{const C=new Set(Z);return C.delete(ie),C})},[]),A={required:f,trigger:v,onTriggerChange:x,valueNode:w,onValueNodeChange:E,valueNodeHasChildren:T,onValueNodeHasChildrenChange:S,contentId:Q,value:R,onValueChange:D,open:O,onOpenChange:_,dir:k,triggerPointerDownPosRef:L,disabled:h,name:u,autoComplete:d,form:m,nativeOptions:H,nativeSelectKey:Y,isFormControl:z};return g.jsx(BD,{...b,children:g.jsx(BN,{scope:t,...A,children:g.jsx(Vo.Provider,{scope:t,children:g.jsx(zN,{scope:t,onNativeOptionAdd:W,onNativeOptionRemove:F,children:oM(p)?p(A):n})})})})}Ap.displayName=VN;var Cp=e=>{const{__scopeSelect:t,children:n,...r}=e;return g.jsx(Ap,{__scopeSelect:t,...r,internal_do_not_use_render:({isFormControl:i})=>g.jsxs(g.Fragment,{children:[n,i?g.jsx(Kp,{__scopeSelect:t}):null]})})};Cp.displayName=tr;var Ep="SelectTrigger",ml=y.forwardRef((e,t)=>{const{__scopeSelect:n,disabled:r=!1,...i}=e,o=Ko(n),a=In(Ep,n),s=a.disabled||r,l=$e(t,a.onTriggerChange),c=Wo(n),u=y.useRef("touch"),[d,h,f]=qp(p=>{const b=c().filter(w=>!w.disabled),v=b.find(w=>w.value===a.value),x=Gp(b,p,v);x!==void 0&&a.onValueChange(x.value)}),m=p=>{s||(a.onOpenChange(!0),f()),p&&(a.triggerPointerDownPosRef.current={x:Math.round(p.pageX),y:Math.round(p.pageY)})};return g.jsx(up,{asChild:!0,...o,children:g.jsx(Me.button,{type:"button",role:"combobox","aria-controls":a.open?a.contentId:void 0,"aria-expanded":a.open,"aria-required":a.required,"aria-autocomplete":"none",dir:a.dir,"data-state":a.open?"open":"closed",disabled:s,"data-disabled":s?"":void 0,"data-placeholder":qo(a.value)?"":void 0,...i,ref:l,onClick:Oe(i.onClick,p=>{p.currentTarget.focus(),u.current!=="mouse"&&m(p)}),onPointerDown:Oe(i.onPointerDown,p=>{u.current=p.pointerType;const b=p.target;b.hasPointerCapture(p.pointerId)&&b.releasePointerCapture(p.pointerId),p.button===0&&p.ctrlKey===!1&&p.pointerType==="mouse"&&(m(p),p.preventDefault())}),onKeyDown:Oe(i.onKeyDown,p=>{const b=d.current!=="";!(p.ctrlKey||p.altKey||p.metaKey)&&p.key.length===1&&h(p.key),!(b&&p.key===" ")&&FN.includes(p.key)&&(m(),p.preventDefault())})})})});ml.displayName=Ep;var Rp="SelectValue",Pp=y.forwardRef((e,t)=>{const{__scopeSelect:n,className:r,style:i,children:o,placeholder:a="",...s}=e,l=In(Rp,n),{onValueNodeHasChildrenChange:c}=l,u=o!==void 0,d=$e(t,l.onValueNodeChange);it(()=>{c(u)},[c,u]);const h=qo(l.value);return g.jsx(Me.span,{...s,asChild:h?!1:s.asChild,ref:d,style:{pointerEvents:"none"},children:g.jsx(y.Fragment,{children:h?a:o},h?"placeholder":"value")})});Pp.displayName=Rp;var WN="SelectIcon",Tp=y.forwardRef((e,t)=>{const{__scopeSelect:n,children:r,...i}=e;return g.jsx(Me.span,{"aria-hidden":!0,...i,ref:t,children:r||"▼"})});Tp.displayName=WN;var Ip="SelectPortal",[KN,qN]=rr(Ip,{forceMount:void 0}),Lp=e=>{const{__scopeSelect:t,forceMount:n,...r}=e;return g.jsx(KN,{scope:e.__scopeSelect,forceMount:n,children:g.jsx(hl,{asChild:!0,...r})})};Lp.displayName=Ip;var Cn="SelectContent",gl=y.forwardRef((e,t)=>{const n=qN(Cn,e.__scopeSelect),{forceMount:r=n.forceMount,...i}=e,o=In(Cn,e.__scopeSelect),[a,s]=y.useState();return it(()=>{s(new DocumentFragment)},[]),g.jsx(Fr,{present:r||o.open,children:({present:l})=>l?g.jsx(Np,{...i,ref:t}):g.jsx(Op,{...i,fragment:a})})});gl.displayName=Cn;var Op=y.forwardRef((e,t)=>{const{__scopeSelect:n,children:r,fragment:i}=e;return i?Tr.createPortal(g.jsx(Dp,{scope:n,children:g.jsx(Vo.Slot,{scope:n,children:g.jsx("div",{ref:t,children:r})})}),i):null});Op.displayName="SelectContentFragment";var Ot=10,[Dp,Ln]=rr(Cn),GN="SelectContentImpl",QN=Sr("SelectContent.RemoveScroll"),Np=y.forwardRef((e,t)=>{const{__scopeSelect:n}=e,{position:r="item-aligned",onCloseAutoFocus:i,onEscapeKeyDown:o,onPointerDownOutside:a,side:s,sideOffset:l,align:c,alignOffset:u,arrowPadding:d,collisionBoundary:h,collisionPadding:f,sticky:m,hideWhenDetached:p,avoidCollisions:b,...v}=e,x=In(Cn,n),[w,E]=y.useState(null),[T,S]=y.useState(null),k=$e(t,E),[O,_]=y.useState(null),[R,D]=y.useState(null),L=Wo(n),[z,H]=y.useState(!1),V=y.useRef(!1);y.useEffect(()=>{if(w)return gp(w)},[w]),zh();const Q=y.useCallback(q=>{const[me,...Te]=L().map(he=>he.ref.current),[xe]=Te.slice(-1),Se=document.activeElement;for(const he of q)if(he===Se||(he?.scrollIntoView({block:"nearest"}),he===me&&T&&(T.scrollTop=0),he===xe&&T&&(T.scrollTop=T.scrollHeight),he?.focus(),document.activeElement!==Se))return},[L,T]),Y=y.useCallback(()=>Q([O,w]),[Q,O,w]);y.useEffect(()=>{z&&Y()},[z,Y]);const{onOpenChange:W,triggerPointerDownPosRef:F}=x;y.useEffect(()=>{if(w){let q={x:0,y:0};const me=xe=>{q={x:Math.abs(Math.round(xe.pageX)-(F.current?.x??0)),y:Math.abs(Math.round(xe.pageY)-(F.current?.y??0))}},Te=xe=>{q.x<=10&&q.y<=10?xe.preventDefault():xe.composedPath().includes(w)||W(!1),document.removeEventListener("pointermove",me),F.current=null};return F.current!==null&&(document.addEventListener("pointermove",me),document.addEventListener("pointerup",Te,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",me),document.removeEventListener("pointerup",Te,{capture:!0})}}},[w,W,F]),y.useEffect(()=>{const q=()=>W(!1);return window.addEventListener("blur",q),window.addEventListener("resize",q),()=>{window.removeEventListener("blur",q),window.removeEventListener("resize",q)}},[W]);const[A,ie]=qp(q=>{const me=L().filter(Se=>!Se.disabled),Te=me.find(Se=>Se.ref.current===document.activeElement),xe=Gp(me,q,Te);xe&&setTimeout(()=>xe.ref.current?.focus())}),Z=y.useCallback((q,me,Te)=>{const xe=!V.current&&!Te;(x.value!==void 0&&x.value===me||xe)&&(_(q),xe&&(V.current=!0))},[x.value]),C=y.useCallback(()=>w?.focus(),[w]),ae=y.useCallback((q,me,Te)=>{const xe=!V.current&&!Te;(x.value!==void 0&&x.value===me||xe)&&D(q)},[x.value]),pe=r==="popper"?ys:Mp,ve=pe===ys?{side:s,sideOffset:l,align:c,alignOffset:u,arrowPadding:d,collisionBoundary:h,collisionPadding:f,sticky:m,hideWhenDetached:p,avoidCollisions:b}:{};return g.jsx(Dp,{scope:n,content:w,viewport:T,onViewportChange:S,itemRefCallback:Z,selectedItem:O,onItemLeave:C,itemTextRefCallback:ae,focusSelectedItem:Y,selectedItemText:R,position:r,isPositioned:z,searchRef:A,children:g.jsx(pl,{as:QN,allowPinchZoom:!0,children:g.jsx(rl,{asChild:!0,trapped:x.open,onMountAutoFocus:q=>{q.preventDefault()},onUnmountAutoFocus:Oe(i,q=>{x.trigger?.focus({preventScroll:!0}),q.preventDefault()}),children:g.jsx(jo,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:o,onPointerDownOutside:a,onFocusOutside:q=>q.preventDefault(),onDismiss:()=>x.onOpenChange(!1),children:g.jsx(pe,{role:"listbox",id:x.contentId,"data-state":x.open?"open":"closed",dir:x.dir,onContextMenu:q=>q.preventDefault(),...v,...ve,onPlaced:()=>H(!0),ref:k,style:{display:"flex",flexDirection:"column",outline:"none",...v.style},onKeyDown:Oe(v.onKeyDown,q=>{const me=q.ctrlKey||q.altKey||q.metaKey;if(q.key==="Tab"&&q.preventDefault(),!me&&q.key.length===1&&ie(q.key),["ArrowUp","ArrowDown","Home","End"].includes(q.key)){let xe=L().filter(Se=>!Se.disabled).map(Se=>Se.ref.current);if(["ArrowUp","End"].includes(q.key)&&(xe=xe.slice().reverse()),["ArrowUp","ArrowDown"].includes(q.key)){const Se=q.target,he=xe.indexOf(Se);xe=xe.slice(he+1)}setTimeout(()=>Q(xe)),q.preventDefault()}})})})})})})});Np.displayName=GN;var YN="SelectItemAlignedPosition",Mp=y.forwardRef((e,t)=>{const{__scopeSelect:n,onPlaced:r,...i}=e,o=In(Cn,n),a=Ln(Cn,n),[s,l]=y.useState(null),[c,u]=y.useState(null),d=$e(t,u),h=Wo(n),f=y.useRef(!1),m=y.useRef(!0),{viewport:p,selectedItem:b,selectedItemText:v,focusSelectedItem:x}=a,w=y.useCallback(()=>{if(o.trigger&&o.valueNode&&s&&c&&p&&b&&v){const k=o.trigger.getBoundingClientRect(),O=c.getBoundingClientRect(),_=o.valueNode.getBoundingClientRect(),R=v.getBoundingClientRect();if(o.dir!=="rtl"){const Se=R.left-O.left,he=_.left-Se,Ge=k.left-he,Ze=k.width+Ge,Ft=Math.max(Ze,O.width),at=window.innerWidth-Ot,Ht=Wu(he,[Ot,Math.max(Ot,at-Ft)]);s.style.minWidth=Ze+"px",s.style.left=Ht+"px"}else{const Se=O.right-R.right,he=window.innerWidth-_.right-Se,Ge=window.innerWidth-k.right-he,Ze=k.width+Ge,Ft=Math.max(Ze,O.width),at=window.innerWidth-Ot,Ht=Wu(he,[Ot,Math.max(Ot,at-Ft)]);s.style.minWidth=Ze+"px",s.style.right=Ht+"px"}const D=h(),L=window.innerHeight-Ot*2,z=p.scrollHeight,H=window.getComputedStyle(c),V=parseInt(H.borderTopWidth,10),Q=parseInt(H.paddingTop,10),Y=parseInt(H.borderBottomWidth,10),W=parseInt(H.paddingBottom,10),F=V+Q+z+W+Y,A=Math.min(b.offsetHeight*5,F),ie=window.getComputedStyle(p),Z=parseInt(ie.paddingTop,10),C=parseInt(ie.paddingBottom,10),ae=k.top+k.height/2-Ot,pe=L-ae,ve=b.offsetHeight/2,q=b.offsetTop+ve,me=V+Q+q,Te=F-me;if(me<=ae){const Se=D.length>0&&b===D[D.length-1].ref.current;s.style.bottom="0px";const he=c.clientHeight-p.offsetTop-p.offsetHeight,Ge=Math.max(pe,ve+(Se?C:0)+he+Y),Ze=me+Ge;s.style.height=Ze+"px"}else{const Se=D.length>0&&b===D[0].ref.current;s.style.top="0px";const Ge=Math.max(ae,V+p.offsetTop+(Se?Z:0)+ve)+Te;s.style.height=Ge+"px",p.scrollTop=me-ae+p.offsetTop}s.style.margin=`${Ot}px 0`,s.style.minHeight=A+"px",s.style.maxHeight=L+"px",r?.(),requestAnimationFrame(()=>f.current=!0)}},[h,o.trigger,o.valueNode,s,c,p,b,v,o.dir,r]);it(()=>w(),[w]);const[E,T]=y.useState();it(()=>{c&&T(window.getComputedStyle(c).zIndex)},[c]);const S=y.useCallback(k=>{k&&m.current===!0&&(w(),x?.(),m.current=!1)},[w,x]);return g.jsx(JN,{scope:n,contentWrapper:s,shouldExpandOnScrollRef:f,onScrollButtonChange:S,children:g.jsx("div",{ref:l,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:E},children:g.jsx(Me.div,{...i,ref:d,style:{boxSizing:"border-box",maxHeight:"100%",...i.style}})})})});Mp.displayName=YN;var XN="SelectPopperPosition",ys=y.forwardRef((e,t)=>{const{__scopeSelect:n,align:r="start",collisionPadding:i=Ot,...o}=e,a=Ko(n);return g.jsx(dp,{...a,...o,ref:t,align:r,collisionPadding:i,style:{boxSizing:"border-box",...o.style,"--radix-select-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-select-content-available-width":"var(--radix-popper-available-width)","--radix-select-content-available-height":"var(--radix-popper-available-height)","--radix-select-trigger-width":"var(--radix-popper-anchor-width)","--radix-select-trigger-height":"var(--radix-popper-anchor-height)"}})});ys.displayName=XN;var[JN,yl]=rr(Cn,{}),bs="SelectViewport",_p=y.forwardRef((e,t)=>{const{__scopeSelect:n,nonce:r,...i}=e,o=Ln(bs,n),a=yl(bs,n),s=$e(t,o.onViewportChange),l=y.useRef(0);return g.jsxs(g.Fragment,{children:[g.jsx("style",{dangerouslySetInnerHTML:{__html:"[data-radix-select-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-select-viewport]::-webkit-scrollbar{display:none}"},nonce:r}),g.jsx(Vo.Slot,{scope:n,children:g.jsx(Me.div,{"data-radix-select-viewport":"",role:"presentation",...i,ref:s,style:{position:"relative",flex:1,overflow:"hidden auto",...i.style},onScroll:Oe(i.onScroll,c=>{const u=c.currentTarget,{contentWrapper:d,shouldExpandOnScrollRef:h}=a;if(h?.current&&d){const f=Math.abs(l.current-u.scrollTop);if(f>0){const m=window.innerHeight-Ot*2,p=parseFloat(d.style.minHeight),b=parseFloat(d.style.height),v=Math.max(p,b);if(v<m){const x=v+f,w=Math.min(m,x),E=x-w;d.style.height=w+"px",d.style.bottom==="0px"&&(u.scrollTop=E>0?E:0,d.style.justifyContent="flex-end")}}}l.current=u.scrollTop})})})]})});_p.displayName=bs;var jp="SelectGroup",[ZN,eM]=rr(jp),tM=y.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,i=vr();return g.jsx(ZN,{scope:n,id:i,children:g.jsx(Me.div,{role:"group","aria-labelledby":i,...r,ref:t})})});tM.displayName=jp;var Fp="SelectLabel",bl=y.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,i=eM(Fp,n);return g.jsx(Me.div,{id:i.id,...r,ref:t})});bl.displayName=Fp;var wo="SelectItem",[nM,Hp]=rr(wo),vl=y.forwardRef((e,t)=>{const{__scopeSelect:n,value:r,disabled:i=!1,textValue:o,...a}=e,s=In(wo,n),l=Ln(wo,n),c=s.value===r,[u,d]=y.useState(o??""),[h,f]=y.useState(!1),m=kn(w=>l.itemRefCallback?.(w,r,i)),p=$e(t,m),b=vr(),v=y.useRef("touch"),x=()=>{i||(s.onValueChange(r),s.onOpenChange(!1))};return g.jsx(nM,{scope:n,value:r,disabled:i,textId:b,isSelected:c,onItemTextChange:y.useCallback(w=>{d(E=>E||(w?.textContent??"").trim())},[]),children:g.jsx(Vo.ItemSlot,{scope:n,value:r,disabled:i,textValue:u,children:g.jsx(Me.div,{role:"option","aria-labelledby":b,"data-highlighted":h?"":void 0,"aria-selected":c&&h,"data-state":c?"checked":"unchecked","aria-disabled":i||void 0,"data-disabled":i?"":void 0,tabIndex:i?void 0:-1,...a,ref:p,onFocus:Oe(a.onFocus,()=>f(!0)),onBlur:Oe(a.onBlur,()=>f(!1)),onClick:Oe(a.onClick,()=>{v.current!=="mouse"&&x()}),onPointerUp:Oe(a.onPointerUp,()=>{v.current==="mouse"&&x()}),onPointerDown:Oe(a.onPointerDown,w=>{v.current=w.pointerType}),onPointerMove:Oe(a.onPointerMove,w=>{v.current=w.pointerType,i?l.onItemLeave?.():v.current==="mouse"&&w.currentTarget.focus({preventScroll:!0})}),onPointerLeave:Oe(a.onPointerLeave,w=>{w.currentTarget===document.activeElement&&l.onItemLeave?.()}),onKeyDown:Oe(a.onKeyDown,w=>{l.searchRef?.current!==""&&w.key===" "||(HN.includes(w.key)&&x(),w.key===" "&&w.preventDefault())})})})})});vl.displayName=wo;var ti="SelectItemText",Up=y.forwardRef((e,t)=>{const{__scopeSelect:n,className:r,style:i,...o}=e,a=In(ti,n),s=Ln(ti,n),l=Hp(ti,n),c=$N(ti,n),[u,d]=y.useState(null),h=kn(x=>s.itemTextRefCallback?.(x,l.value,l.disabled)),f=$e(t,d,l.onItemTextChange,h),m=u?.textContent,p=y.useMemo(()=>g.jsx("option",{value:l.value,disabled:l.disabled,children:m},l.value),[l.disabled,l.value,m]),{onNativeOptionAdd:b,onNativeOptionRemove:v}=c;return it(()=>(b(p),()=>v(p)),[b,v,p]),g.jsxs(g.Fragment,{children:[g.jsx(Me.span,{id:l.textId,...o,ref:f}),l.isSelected&&a.valueNode&&!a.valueNodeHasChildren&&!qo(a.value)?Tr.createPortal(o.children,a.valueNode):null]})});Up.displayName=ti;var Bp="SelectItemIndicator",zp=y.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e;return Hp(Bp,n).isSelected?g.jsx(Me.span,{"aria-hidden":!0,...r,ref:t}):null});zp.displayName=Bp;var vs="SelectScrollUpButton",xl=y.forwardRef((e,t)=>{const n=Ln(vs,e.__scopeSelect),r=yl(vs,e.__scopeSelect),[i,o]=y.useState(!1),a=$e(t,r.onScrollButtonChange);return it(()=>{if(n.viewport&&n.isPositioned){let s=function(){const c=l.scrollTop>0;o(c)};const l=n.viewport;return s(),l.addEventListener("scroll",s),()=>l.removeEventListener("scroll",s)}},[n.viewport,n.isPositioned]),i?g.jsx($p,{...e,ref:a,onAutoScroll:()=>{const{viewport:s,selectedItem:l}=n;s&&l&&(s.scrollTop=s.scrollTop-l.offsetHeight)}}):null});xl.displayName=vs;var xs="SelectScrollDownButton",wl=y.forwardRef((e,t)=>{const n=Ln(xs,e.__scopeSelect),r=yl(xs,e.__scopeSelect),[i,o]=y.useState(!1),a=$e(t,r.onScrollButtonChange);return it(()=>{if(n.viewport&&n.isPositioned){let s=function(){const c=l.scrollHeight-l.clientHeight,u=Math.ceil(l.scrollTop)<c;o(u)};const l=n.viewport;return s(),l.addEventListener("scroll",s),()=>l.removeEventListener("scroll",s)}},[n.viewport,n.isPositioned]),i?g.jsx($p,{...e,ref:a,onAutoScroll:()=>{const{viewport:s,selectedItem:l}=n;s&&l&&(s.scrollTop=s.scrollTop+l.offsetHeight)}}):null});wl.displayName=xs;var $p=y.forwardRef((e,t)=>{const{__scopeSelect:n,onAutoScroll:r,...i}=e,o=Ln("SelectScrollButton",n),a=y.useRef(null),s=Wo(n),l=y.useCallback(()=>{a.current!==null&&(window.clearInterval(a.current),a.current=null)},[]);return y.useEffect(()=>()=>l(),[l]),it(()=>{s().find(u=>u.ref.current===document.activeElement)?.ref.current?.scrollIntoView({block:"nearest"})},[s]),g.jsx(Me.div,{"aria-hidden":!0,...i,ref:t,style:{flexShrink:0,...i.style},onPointerDown:Oe(i.onPointerDown,()=>{a.current===null&&(a.current=window.setInterval(r,50))}),onPointerMove:Oe(i.onPointerMove,()=>{o.onItemLeave?.(),a.current===null&&(a.current=window.setInterval(r,50))}),onPointerLeave:Oe(i.onPointerLeave,()=>{l()})})}),rM="SelectSeparator",kl=y.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e;return g.jsx(Me.div,{"aria-hidden":!0,...r,ref:t})});kl.displayName=rM;var Vp="SelectArrow",iM=y.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,i=Ko(n);return Ln(Vp,n).position==="popper"?g.jsx(fp,{...i,...r,ref:t}):null});iM.displayName=Vp;var Wp="SelectBubbleInput",Kp=y.forwardRef(({__scopeSelect:e,...t},n)=>{const r=In(Wp,e),{value:i,onValueChange:o,required:a,disabled:s,name:l,autoComplete:c,form:u}=r,{nativeOptions:d,nativeSelectKey:h}=r,f=y.useRef(null),m=$e(n,f),p=i??"",b=YD(p),v=Array.from(d).some(x=>(x.props.value??"")==="");return y.useEffect(()=>{const x=f.current;if(!x)return;const w=window.HTMLSelectElement.prototype,T=Object.getOwnPropertyDescriptor(w,"value").set;if(b!==p&&T){const S=new Event("change",{bubbles:!0});T.call(x,p),x.dispatchEvent(S)}},[b,p]),g.jsxs(Me.select,{"aria-hidden":!0,required:a,tabIndex:-1,name:l,autoComplete:c,disabled:s,form:u,onChange:x=>o(x.target.value),...t,style:{...hp,...t.style},ref:m,defaultValue:p,children:[qo(i)&&!v?g.jsx("option",{value:""}):null,Array.from(d)]},h)});Kp.displayName=Wp;function oM(e){return typeof e=="function"}function qo(e){return e===""||e===void 0}function qp(e){const t=kn(e),n=y.useRef(""),r=y.useRef(0),i=y.useCallback(a=>{const s=n.current+a;t(s),function l(c){n.current=c,window.clearTimeout(r.current),c!==""&&(r.current=window.setTimeout(()=>l(""),1e3))}(s)},[t]),o=y.useCallback(()=>{n.current="",window.clearTimeout(r.current)},[]);return y.useEffect(()=>()=>window.clearTimeout(r.current),[]),[n,i,o]}function Gp(e,t,n){const i=t.length>1&&Array.from(t).every(c=>c===t[0])?t[0]:t,o=n?e.indexOf(n):-1;let a=aM(e,Math.max(o,0));i.length===1&&(a=a.filter(c=>c!==n));const l=a.find(c=>c.textValue.toLowerCase().startsWith(i.toLowerCase()));return l!==n?l:void 0}function aM(e,t){return e.map((n,r)=>e[(t+r)%e.length])}const ko=Cp,So=Pp,yi=y.forwardRef(({className:e,children:t,...n},r)=>g.jsxs(ml,{ref:r,className:be("flex h-8 w-full items-center justify-between gap-2","rounded-md border border-border bg-surface px-3 py-1 text-sm","placeholder:text-text-muted","focus:outline-none focus:ring-2 focus:ring-accent focus:ring-offset-1 focus:ring-offset-bg","disabled:cursor-not-allowed disabled:opacity-55","[&>span]:line-clamp-1",e),...n,children:[t,g.jsx(Tp,{asChild:!0,children:g.jsx(Qd,{className:"h-4 w-4 opacity-60"})})]}));yi.displayName=ml.displayName;const Qp=y.forwardRef(({className:e,...t},n)=>g.jsx(xl,{ref:n,className:be("flex cursor-default items-center justify-center py-1",e),...t,children:g.jsx(Wy,{className:"h-4 w-4"})}));Qp.displayName=xl.displayName;const Yp=y.forwardRef(({className:e,...t},n)=>g.jsx(wl,{ref:n,className:be("flex cursor-default items-center justify-center py-1",e),...t,children:g.jsx(Qd,{className:"h-4 w-4"})}));Yp.displayName=wl.displayName;const bi=y.forwardRef(({className:e,children:t,position:n="popper",...r},i)=>g.jsx(Lp,{children:g.jsxs(gl,{ref:i,position:n,className:be("relative z-50 max-h-96 min-w-[8rem] overflow-hidden","rounded-md border border-border bg-surface text-text shadow-md","data-[state=open]:animate-in data-[state=closed]:animate-out","data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0","data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95",n==="popper"&&["data-[side=bottom]:translate-y-1","data-[side=top]:-translate-y-1","data-[side=left]:-translate-x-1","data-[side=right]:translate-x-1"],e),...r,children:[g.jsx(Qp,{}),g.jsx(_p,{className:be("p-1",n==="popper"&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]"),children:t}),g.jsx(Yp,{})]})}));bi.displayName=gl.displayName;const sM=y.forwardRef(({className:e,...t},n)=>g.jsx(bl,{ref:n,className:be("px-2 py-1.5 text-xs font-semibold uppercase tracking-wide text-text-muted",e),...t}));sM.displayName=bl.displayName;const bn=y.forwardRef(({className:e,children:t,...n},r)=>g.jsxs(vl,{ref:r,className:be("relative flex w-full cursor-default select-none items-center rounded py-1.5 pl-8 pr-2 text-sm outline-none","focus:bg-surface-hover focus:text-text","data-[disabled]:pointer-events-none data-[disabled]:opacity-50",e),...n,children:[g.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:g.jsx(zp,{children:g.jsx(Vy,{className:"h-4 w-4"})})}),g.jsx(Up,{children:t})]}));bn.displayName=vl.displayName;const lM=y.forwardRef(({className:e,...t},n)=>g.jsx(kl,{ref:n,className:be("-mx-1 my-1 h-px bg-border",e),...t}));lM.displayName=kl.displayName;function cM({agents:e,value:t,onChange:n}){const{t:r}=ot();function i(o){if(!o||o===t)return;const a=ai(o);window.confirm(r("chat.switchAgentConfirm",{agent:a}))&&n(o)}return g.jsxs(ko,{value:t||void 0,onValueChange:i,children:[g.jsx(yi,{className:"h-7 w-28 sm:w-36 text-xs",children:g.jsx(So,{placeholder:ai(e[0]??"—")})}),g.jsx(bi,{children:e.map(o=>g.jsx(bn,{value:o,children:ai(o)},o))})]})}function uM(e){const t=String(e||"");if(!t)return!1;const n=t.toLowerCase();return!(n.includes("native")||n.includes("agim"))&&!t.includes("/settings/llm")?!1:n.includes("not configured")||n.includes("not available")||n.includes("no llm backend")||n.includes("llmroles.native-chat")||t.includes("/settings/llm")||t.includes("未配置")||t.includes("大模型")}const Go={all:["llm"],list:["llm","list"]};function dM(){return mf({queryKey:Go.list,queryFn:()=>$.get("/api/llm")})}function fM(){const e=Rn();return Pn({mutationFn:t=>$.post("/api/llm/backends",{body:t}),onSuccess:()=>e.invalidateQueries({queryKey:Go.all})})}function d_(){const e=Rn();return Pn({mutationFn:t=>$.delete(`/api/llm/backends/${encodeURIComponent(t)}`),onSuccess:()=>e.invalidateQueries({queryKey:Go.all})})}function f_(){const e=Rn();return Pn({mutationFn:t=>$.put("/api/llm/roles",{body:t}),onSuccess:()=>e.invalidateQueries({queryKey:Go.all})})}function h_(){return Pn({mutationFn:e=>$.post(`/api/llm/backends/${encodeURIComponent(e)}/ping`)})}const Qo={all:["mcp"],list:["mcp","list"]};function p_(){return mf({queryKey:Qo.list,queryFn:()=>$.get("/api/mcp")})}function m_(){const e=Rn();return Pn({mutationFn:t=>$.post("/api/mcp/servers",{body:t}),onSuccess:()=>e.invalidateQueries({queryKey:Qo.all})})}function g_(){const e=Rn();return Pn({mutationFn:t=>$.delete(`/api/mcp/servers/${encodeURIComponent(t)}`),onSuccess:()=>e.invalidateQueries({queryKey:Qo.all})})}function y_(){const e=Rn();return Pn({mutationFn:t=>$.post(`/api/mcp/servers/${encodeURIComponent(t)}/health`),onSuccess:()=>e.invalidateQueries({queryKey:Qo.all})})}var Yo="Dialog",[Xp]=Si(Yo),[hM,jt]=Xp(Yo),Jp=e=>{const{__scopeDialog:t,children:n,open:r,defaultOpen:i,onOpenChange:o,modal:a=!0}=e,s=y.useRef(null),l=y.useRef(null),[c,u]=ms({prop:r,defaultProp:i??!1,onChange:o,caller:Yo});return g.jsx(hM,{scope:t,triggerRef:s,contentRef:l,contentId:vr(),titleId:vr(),descriptionId:vr(),open:c,onOpenChange:u,onOpenToggle:y.useCallback(()=>u(d=>!d),[u]),modal:a,children:n})};Jp.displayName=Yo;var Zp="DialogTrigger",pM=y.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,i=jt(Zp,n),o=$e(t,i.triggerRef);return g.jsx(Me.button,{type:"button","aria-haspopup":"dialog","aria-expanded":i.open,"aria-controls":i.open?i.contentId:void 0,"data-state":Pl(i.open),...r,ref:o,onClick:Oe(e.onClick,i.onOpenToggle)})});pM.displayName=Zp;var Sl="DialogPortal",[mM,em]=Xp(Sl,{forceMount:void 0}),tm=e=>{const{__scopeDialog:t,forceMount:n,children:r,container:i}=e,o=jt(Sl,t);return g.jsx(mM,{scope:t,forceMount:n,children:y.Children.map(r,a=>g.jsx(Fr,{present:n||o.open,children:g.jsx(hl,{asChild:!0,container:i,children:a})}))})};tm.displayName=Sl;var Ao="DialogOverlay",Al=y.forwardRef((e,t)=>{const n=em(Ao,e.__scopeDialog),{forceMount:r=n.forceMount,...i}=e,o=jt(Ao,e.__scopeDialog);return o.modal?g.jsx(Fr,{present:r||o.open,children:g.jsx(yM,{...i,ref:t})}):null});Al.displayName=Ao;var gM=Sr("DialogOverlay.RemoveScroll"),yM=y.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,i=jt(Ao,n),o=gO(),a=$e(t,o);return g.jsx(pl,{as:gM,allowPinchZoom:!0,shards:[i.contentRef],children:g.jsx(Me.div,{"data-state":Pl(i.open),...r,ref:a,style:{pointerEvents:"auto",...r.style}})})}),Rr="DialogContent",Cl=y.forwardRef((e,t)=>{const n=em(Rr,e.__scopeDialog),{forceMount:r=n.forceMount,...i}=e,o=jt(Rr,e.__scopeDialog);return g.jsx(Fr,{present:r||o.open,children:o.modal?g.jsx(bM,{...i,ref:t}):g.jsx(vM,{...i,ref:t})})});Cl.displayName=Rr;var bM=y.forwardRef((e,t)=>{const n=jt(Rr,e.__scopeDialog),r=y.useRef(null),i=$e(t,n.contentRef,r);return y.useEffect(()=>{const o=r.current;if(o)return gp(o)},[]),g.jsx(nm,{...e,ref:i,trapFocus:n.open,disableOutsidePointerEvents:n.open,onCloseAutoFocus:Oe(e.onCloseAutoFocus,o=>{o.preventDefault(),n.triggerRef.current?.focus()}),onPointerDownOutside:Oe(e.onPointerDownOutside,o=>{const a=o.detail.originalEvent,s=a.button===0&&a.ctrlKey===!0;(a.button===2||s)&&o.preventDefault()}),onFocusOutside:Oe(e.onFocusOutside,o=>o.preventDefault())})}),vM=y.forwardRef((e,t)=>{const n=jt(Rr,e.__scopeDialog),r=y.useRef(!1),i=y.useRef(!1);return g.jsx(nm,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:o=>{e.onCloseAutoFocus?.(o),o.defaultPrevented||(r.current||n.triggerRef.current?.focus(),o.preventDefault()),r.current=!1,i.current=!1},onInteractOutside:o=>{e.onInteractOutside?.(o),o.defaultPrevented||(r.current=!0,o.detail.originalEvent.type==="pointerdown"&&(i.current=!0));const a=o.target;n.triggerRef.current?.contains(a)&&o.preventDefault(),o.detail.originalEvent.type==="focusin"&&i.current&&o.preventDefault()}})}),nm=y.forwardRef((e,t)=>{const{__scopeDialog:n,trapFocus:r,onOpenAutoFocus:i,onCloseAutoFocus:o,...a}=e,s=jt(Rr,n);return zh(),g.jsx(g.Fragment,{children:g.jsx(rl,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:i,onUnmountAutoFocus:o,children:g.jsx(jo,{role:"dialog",id:s.contentId,"aria-describedby":s.descriptionId,"aria-labelledby":s.titleId,"data-state":Pl(s.open),...a,ref:t,deferPointerDownOutside:!0,onDismiss:()=>s.onOpenChange(!1)})})})}),rm="DialogTitle",El=y.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,i=jt(rm,n);return g.jsx(Me.h2,{id:i.titleId,...r,ref:t})});El.displayName=rm;var im="DialogDescription",Rl=y.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,i=jt(im,n);return g.jsx(Me.p,{id:i.descriptionId,...r,ref:t})});Rl.displayName=im;var om="DialogClose",am=y.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,i=jt(om,n);return g.jsx(Me.button,{type:"button",...r,ref:t,onClick:Oe(e.onClick,()=>i.onOpenChange(!1))})});am.displayName=om;function Pl(e){return e?"open":"closed"}const xM=Jp,wM=tm,sm=y.forwardRef(({className:e,...t},n)=>g.jsx(Al,{ref:n,className:be("fixed inset-0 z-50 bg-black/50 backdrop-blur-sm","data-[state=open]:animate-in data-[state=closed]:animate-out","data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",e),...t}));sm.displayName=Al.displayName;const lm=y.forwardRef(({className:e,children:t,...n},r)=>g.jsxs(wM,{children:[g.jsx(sm,{}),g.jsxs(Cl,{ref:r,className:be("fixed left-[50%] top-[50%] z-50 grid w-full max-w-[calc(100vw-2rem)] sm:max-w-lg","translate-x-[-50%] translate-y-[-50%] gap-4","border border-border bg-surface p-4 shadow-lg","rounded-lg","max-h-[85dvh] overflow-y-auto pb-[calc(env(safe-area-inset-bottom)+1.5rem)]","duration-200","data-[state=open]:animate-in data-[state=closed]:animate-out","data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0","data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95","data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%]","data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%]",e),...n,children:[t,g.jsx(am,{className:be("absolute right-4 top-4 rounded-md p-1","text-text-dim hover:bg-surface-hover hover:text-text","focus:outline-none focus:ring-2 focus:ring-accent","tap-target","disabled:pointer-events-none"),"aria-label":Ue.t("actions.close",{ns:"common",defaultValue:"Close"}),children:g.jsx(ab,{className:"h-4 w-4"})})]})]}));lm.displayName=Cl.displayName;const cm=({className:e,...t})=>g.jsx("div",{className:be("flex flex-col gap-1.5 text-left",e),...t});cm.displayName="DialogHeader";const um=({className:e,...t})=>g.jsx("div",{className:be("flex flex-col-reverse gap-2 sm:flex-row sm:justify-end",e),...t});um.displayName="DialogFooter";const dm=y.forwardRef(({className:e,...t},n)=>g.jsx(El,{ref:n,className:be("text-lg font-semibold leading-snug",e),...t}));dm.displayName=El.displayName;const fm=y.forwardRef(({className:e,...t},n)=>g.jsx(Rl,{ref:n,className:be("text-sm text-text-dim",e),...t}));fm.displayName=Rl.displayName;const Ji=[{key:"deepseek",provider:"openai-compat",baseUrl:"https://api.deepseek.com/v1",model:"deepseek-chat",baseName:"deepseek-agim"},{key:"moonshot",provider:"openai-compat",baseUrl:"https://api.moonshot.cn/v1",model:"moonshot-v1-8k",baseName:"moonshot-agim"},{key:"zhipu",provider:"openai-compat",baseUrl:"https://open.bigmodel.cn/api/paas/v4",model:"glm-4-air",baseName:"zhipu-agim"},{key:"openai",provider:"openai-compat",baseUrl:"https://api.openai.com/v1",model:"gpt-4o-mini",baseName:"openai-agim"},{key:"anthropic",provider:"anthropic",baseUrl:"https://api.anthropic.com",model:"claude-3-5-sonnet-20241022",baseName:"anthropic-agim"},{key:"custom",provider:"openai-compat",baseUrl:"",model:"",baseName:"agim-api"}],bd=Ji[0];function vd(e,t){const n=new Set(t.map(r=>r.toLowerCase()));if(!n.has(e.toLowerCase()))return e;for(let r=2;r<200;r+=1){const i=`${e}-${r}`;if(!n.has(i.toLowerCase()))return i}return`${e}-${Date.now()}`}function kM({open:e,reason:t,onOpenChange:n,onConfigured:r}){const{t:i}=ot(["common","settings"]),o=fM(),a=dM(),[s,l]=y.useState("deepseek"),c=y.useMemo(()=>Ji.find(T=>T.key===s)??bd,[s]),u=y.useMemo(()=>(a.data?.backends??[]).map(T=>T.name),[a.data]),[d,h]=y.useState(()=>vd("deepseek-agim",[])),[f,m]=y.useState(c.baseUrl),[p,b]=y.useState(c.model),[v,x]=y.useState("");function w(T){const S=Ji.find(k=>k.key===T)??bd;l(T),m(S.baseUrl),b(S.model),h(vd(S.baseName,u))}async function E(T){if(T.preventDefault(),!d.trim()){et.error(i("llm.nameRequired",{ns:"settings"}));return}if(!f.trim()){et.error(i("llm.baseUrlRequired",{ns:"settings"}));return}if(!/^https?:\/\//i.test(f.trim())){et.error(i("llm.baseUrlRequired",{ns:"settings"}));return}if(!p.trim()){et.error(i("llm.modelRequired",{ns:"settings"}));return}if(!v.trim()){et.error(i("chat.nativeSetupApiKeyRequired"));return}try{await o.mutateAsync({name:d.trim(),provider:c.provider,baseUrl:f.trim(),model:p.trim(),apiKey:v.trim()}),et.success(i("chat.nativeSetupSaved")),x(""),n(!1),r?.()}catch(S){et.error(S?.message??String(S))}}return g.jsx(xM,{open:e,onOpenChange:n,children:g.jsxs(lm,{className:"sm:max-w-2xl",children:[g.jsxs(cm,{children:[g.jsx(dm,{children:i("chat.nativeSetupDialogTitle")}),g.jsx(fm,{children:i("chat.nativeSetupDialogDesc")})]}),g.jsxs("form",{className:"space-y-4",onSubmit:T=>void E(T),children:[t&&g.jsxs("div",{className:"rounded-md border border-warning/50 bg-warning-bg/40 p-3 text-xs text-warning",children:[g.jsx("div",{className:"mb-1 font-medium",children:i("chat.nativeSetupDialogReason")}),g.jsx("div",{className:"break-words",children:t})]}),g.jsxs("div",{className:"grid grid-cols-1 gap-3 sm:grid-cols-2",children:[g.jsxs("div",{children:[g.jsx($n,{className:"text-xs font-medium",children:i("llm.preset",{ns:"settings"})}),g.jsxs(ko,{value:s,onValueChange:T=>w(T),children:[g.jsx(yi,{children:g.jsx(So,{})}),g.jsx(bi,{children:Ji.map(T=>g.jsx(bn,{value:T.key,children:i(`llm.presets.${T.key}`,{ns:"settings"})},T.key))})]})]}),g.jsxs("div",{children:[g.jsx($n,{className:"text-xs font-medium",children:i("llm.name",{ns:"settings"})}),g.jsx(gr,{value:d,onChange:T=>h(T.target.value),placeholder:i("llm.namePlaceholder",{ns:"settings"}),className:"font-mono text-xs"})]}),g.jsxs("div",{className:"sm:col-span-2",children:[g.jsx($n,{className:"text-xs font-medium",children:i("llm.baseUrl",{ns:"settings"})}),g.jsx(gr,{value:f,onChange:T=>m(T.target.value),placeholder:i("llm.baseUrlPlaceholder",{ns:"settings"}),className:"font-mono text-xs"})]}),g.jsxs("div",{children:[g.jsx($n,{className:"text-xs font-medium",children:i("llm.model",{ns:"settings"})}),g.jsx(gr,{value:p,onChange:T=>b(T.target.value),placeholder:i("llm.modelPlaceholder",{ns:"settings"}),className:"font-mono text-xs"})]}),g.jsxs("div",{children:[g.jsx($n,{className:"text-xs font-medium",children:i("llm.apiKey",{ns:"settings"})}),g.jsx(gr,{type:"password",value:v,onChange:T=>x(T.target.value),placeholder:i("llm.apiKeyPlaceholder",{ns:"settings"}),className:"font-mono text-xs",autoComplete:"off"})]})]}),g.jsx("p",{className:"text-xs text-text-dim",children:i("chat.nativeSetupDialogRoleOptional")}),g.jsxs(um,{children:[g.jsx(qe,{type:"button",variant:"ghost",onClick:()=>window.location.assign("/settings/llm"),children:i("chat.nativeSetupDialogAdvanced")}),g.jsx(qe,{type:"button",variant:"outline",onClick:()=>n(!1),children:i("chat.nativeSetupDialogCancel")}),g.jsx(qe,{type:"submit",disabled:o.isPending,children:i("chat.nativeSetupDialogSave")})]})]})]})})}const ws="agim-theme",hm="agim-lang";function SM(){try{const e=localStorage.getItem(ws);if(e==="light"||e==="dark")return e}catch{}return"system"}function AM(){try{const t=localStorage.getItem(hm);if(t==="en"||t==="zh")return t}catch{}return(navigator.language||"en").toLowerCase().startsWith("zh")?"zh":"en"}function xd(e){try{e==="system"?localStorage.removeItem(ws):localStorage.setItem(ws,e)}catch{}}function CM(e){try{localStorage.setItem(hm,e)}catch{}}const yr=$d((e,t)=>({theme:SM(),lang:AM(),setTheme:n=>{xd(n),e({theme:n})},cycleTheme:()=>{const n=t().theme,r=n==="system"?"light":n==="light"?"dark":"system";xd(r),e({theme:r})},setLang:n=>{CM(n),e({lang:n})}}));function wd(e){e==="system"?document.documentElement.removeAttribute("data-theme"):document.documentElement.setAttribute("data-theme",e)}function EM(){const e=yr(t=>t.theme);y.useEffect(()=>{if(wd(e),e!=="system")return;const t=window.matchMedia("(prefers-color-scheme: dark)"),n=()=>wd(e);return t.addEventListener("change",n),()=>t.removeEventListener("change",n)},[e])}function RM(){const{t:e}=ot(),t=yr(o=>o.theme),n=yr(o=>o.lang),r=yr(o=>o.setTheme),i=yr(o=>o.setLang);return g.jsxs(g.Fragment,{children:[g.jsxs(ko,{value:n,onValueChange:o=>i(o),children:[g.jsx(yi,{className:"h-7 w-16 sm:w-20 text-xs","aria-label":e("lang.label"),children:g.jsx(So,{})}),g.jsxs(bi,{children:[g.jsx(bn,{value:"en",children:e("lang.en")}),g.jsx(bn,{value:"zh",children:e("lang.zh")})]})]}),g.jsxs(ko,{value:t,onValueChange:o=>r(o),children:[g.jsx(yi,{className:"h-7 w-16 text-xs sm:w-28","aria-label":e("theme.label"),children:g.jsx(So,{})}),g.jsxs(bi,{children:[g.jsx(bn,{value:"system",children:g.jsxs("span",{className:"inline-flex items-center gap-2",children:[g.jsx(Yy,{className:"h-4 w-4"})," ",e("theme.system")]})}),g.jsx(bn,{value:"light",children:g.jsxs("span",{className:"inline-flex items-center gap-2",children:[g.jsx(ib,{className:"h-4 w-4"})," ",e("theme.light")]})}),g.jsx(bn,{value:"dark",children:g.jsxs("span",{className:"inline-flex items-center gap-2",children:[g.jsx(eb,{className:"h-4 w-4"})," ",e("theme.dark")]})})]})]})]})}function PM(e){const[t,n]=y.useState(()=>typeof window>"u"||!window.matchMedia?!1:window.matchMedia(e).matches);return y.useEffect(()=>{if(typeof window>"u"||!window.matchMedia)return;const r=window.matchMedia(e),i=o=>n(o.matches);return n(r.matches),r.addEventListener("change",i),()=>r.removeEventListener("change",i)},[e]),t}function TM(){return PM("(min-width: 640px)")}const IM=[{to:"/dashboard",i18nKey:"nav.dashboard",mounted:!0},{to:"/",i18nKey:"nav.chat",mounted:!0},{to:"/tasks",i18nKey:"nav.tasks",mounted:!0},{to:"/approvals",i18nKey:"nav.approvals",mounted:!0},{to:"/reminders",i18nKey:"nav.reminders",mounted:!0},{to:"/memos",i18nKey:"nav.memos",mounted:!0},{to:"/memory",i18nKey:"nav.memory",mounted:!0},{to:"/workspace",i18nKey:"nav.workspace",mounted:!0},{to:"/observability",i18nKey:"nav.observability",mounted:!0},{to:"/settings",i18nKey:"nav.settings",mounted:!0}];function pm({children:e}){const{t}=ot(),n=TM(),r=g.jsx("nav",{className:be("flex flex-1 min-w-0 items-center gap-1","overflow-x-auto scrollbar-thin","[&::-webkit-scrollbar]:h-1 [&::-webkit-scrollbar-thumb]:bg-border"),"aria-label":t("appName"),children:IM.filter(i=>i.mounted).map(i=>g.jsx(Zl,{to:i.to,end:i.to==="/",className:({isActive:o})=>be("shrink-0 rounded-md px-2.5 py-1.5 text-sm no-underline","transition-colors tap-target",o?"bg-accent-bg text-accent font-medium":"text-text-dim hover:bg-surface-hover hover:text-text"),children:t(i.i18nKey)},i.to))});return g.jsxs("header",{className:be("sticky top-0 z-20","flex flex-col sm:flex-row sm:items-center sm:gap-3","border-b border-border bg-surface","pt-safe","shadow-sm"),children:[g.jsxs("div",{className:be("flex items-center gap-2 sm:gap-3","overflow-x-hidden","px-3 sm:px-4 py-2 sm:py-2","sm:flex-1 sm:min-w-0"),children:[g.jsxs(Zl,{to:"/dashboard",className:"flex shrink-0 items-center gap-1 text-md font-semibold no-underline",children:[g.jsx("span",{"aria-hidden":"true",children:"🤖"}),g.jsx("span",{className:"hidden sm:inline",children:t("appName")})]}),n&&g.jsx("div",{className:"flex flex-1 min-w-0",children:r}),e&&g.jsx("div",{className:"flex items-center gap-2",children:e}),g.jsx("div",{className:"flex shrink-0 items-center gap-2",children:g.jsx(RM,{})})]}),!n&&g.jsx("div",{className:"border-t border-border px-3 py-1",children:r})]})}const LM={open:"bg-success",connecting:"bg-warning animate-pulse",closed:"bg-text-muted",error:"bg-danger"};function OM(){const{t:e}=ot(),{state:t,send:n,switchAgent:r,approvalClick:i,choiceSubmit:o,newConversation:a,clearError:s}=JC(),[l,c]=y.useState(""),[u,d]=y.useState(!1),[h,f]=y.useState(""),[m]=zd(),p=y.useRef(null),b=y.useRef(null),v=e(`chat.status.${t.status}`,{defaultValue:t.status}),x=m.get("welcome")==="1"||m.get("onboarding")==="1",w=y.useMemo(()=>[e("chat.quickPrompt.plan"),e("chat.quickPrompt.risks"),e("chat.quickPrompt.summary")],[e]);y.useEffect(()=>{if(!p.current)return;const S=p.current;!(S.scrollHeight-S.scrollTop-S.clientHeight<200)&&t.currentReplyId==null||requestAnimationFrame(()=>{S.scrollTop=S.scrollHeight})},[t.messages,t.currentReplyId]),y.useEffect(()=>{t.error&&(uM(t.error)?(f(t.error),d(!0)):et.error(t.error),s())},[t.error,s]);function E(S){S?.preventDefault();const k=l.trim();if(k){if(t.status!=="open"){et.error(e("chat.notConnected",{defaultValue:"Not connected. Reconnecting…"}));return}n(k),c(""),requestAnimationFrame(()=>b.current?.focus())}}function T(S){S.nativeEvent.isComposing||S.keyCode===229||S.key==="Enter"&&!S.shiftKey&&(S.preventDefault(),E())}return g.jsxs("div",{className:"flex h-dvh flex-col bg-bg",children:[g.jsxs(pm,{children:[g.jsx("span",{className:be("inline-block h-2 w-2 rounded-full",LM[t.status]),title:v}),g.jsx("span",{className:"hidden text-xs text-text-dim sm:inline",children:v}),g.jsxs(qe,{variant:"ghost",size:"sm",onClick:()=>{a(),et.success(e("chat.newConvToast",{defaultValue:"Started a new conversation"})),requestAnimationFrame(()=>b.current?.focus())},disabled:t.status!=="open",title:e("chat.newConvHint",{defaultValue:"Clear messages and start a fresh session"}),"aria-label":e("chat.newConv",{defaultValue:"New conversation"}),children:[g.jsx(Jy,{className:"h-4 w-4"}),g.jsx("span",{className:"hidden text-xs sm:inline",children:e("chat.newConv",{defaultValue:"New"})})]}),g.jsx(cM,{agents:t.agents,value:t.agent,onChange:r})]}),g.jsx(kM,{open:u,reason:h,onOpenChange:d,onConfigured:()=>r("agim")}),g.jsx("div",{ref:p,className:"flex-1 overflow-y-auto",children:g.jsxs("div",{className:"mx-auto flex max-w-3xl flex-col gap-2 px-3 py-3 sm:px-4",children:[(t.messages.length===0||x)&&t.status==="open"&&g.jsx(DM,{agent:t.agent,agents:t.agents,prompts:w,onPickPrompt:S=>{c(S),requestAnimationFrame(()=>b.current?.focus())}}),t.messages.length===0&&t.status!=="open"&&g.jsxs("div",{className:"grid place-items-center py-16 text-center",children:[g.jsx(Ky,{className:"h-10 w-10 text-text-muted"}),g.jsx("p",{className:"mt-3 text-sm text-text-dim",children:t.status==="connecting"?e("chat.connecting",{defaultValue:"Connecting to agim…"}):e("chat.disconnected",{defaultValue:"Disconnected. Reconnecting automatically; you can keep typing."})})]}),t.messages.filter(S=>!S.approval).map(S=>g.jsx(GL,{msg:S,onApprove:(k,O,_)=>i(k,O,_)},S.id))]})}),g.jsx(ZL,{approvals:t.pendingApprovals,onApprove:(S,k,O)=>i(S,k,O)}),g.jsx(rO,{asks:t.pendingAsks,onSubmit:(S,k)=>o(S,k)}),g.jsxs("form",{onSubmit:E,className:"sticky bottom-0 border-t border-border bg-surface px-4 py-2 pb-safe sm:px-6",children:[g.jsxs("div",{className:"mx-auto flex max-w-3xl items-end gap-2",children:[g.jsx("textarea",{ref:b,value:l,onChange:S=>c(S.target.value),onKeyDown:T,placeholder:e("chat.inputPlaceholder",{defaultValue:"Message… (Enter sends, Shift+Enter newlines)"}),rows:1,className:be("flex-1 resize-none rounded-md border border-border bg-bg","px-3 py-1.5 text-sm leading-5","focus:outline-none focus:ring-2 focus:ring-accent focus:ring-offset-1 focus:ring-offset-bg","max-h-32 min-h-8")}),g.jsx(qe,{type:"submit",disabled:!l.trim()||t.status!=="open","aria-label":e("chat.send",{defaultValue:"Send"}),className:"h-8 w-8 p-0",children:g.jsx(Ua,{className:"h-4 w-4"})})]}),t.currentReplyId&&g.jsx("div",{className:"mx-auto mt-2 flex max-w-3xl items-center gap-2",children:g.jsx(rt,{variant:"info",children:e("chat.streaming",{defaultValue:"… streaming"})})})]})]})}function DM({agent:e,agents:t,prompts:n,onPickPrompt:r}){const{t:i}=ot(),o=e?ai(e):i("chat.onboarding.agentPending",{defaultValue:"Loading agent…"}),a=t.length;return g.jsx("section",{className:"mx-auto my-8 w-full max-w-2xl rounded-md border border-border bg-surface px-4 py-4 text-left shadow-sm sm:my-12 sm:px-5",children:g.jsxs("div",{className:"flex flex-col gap-4 sm:flex-row sm:items-start",children:[g.jsx("div",{className:"flex h-12 w-12 shrink-0 items-center justify-center rounded-full bg-surface-2 text-accent",children:g.jsx(Zy,{className:"h-6 w-6"})}),g.jsxs("div",{className:"min-w-0 flex-1",children:[g.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[g.jsx("h2",{className:"text-base font-semibold text-text",children:i("chat.onboarding.title",{defaultValue:"Get one chat working first"})}),g.jsx(rt,{variant:"success",children:i("chat.onboarding.readyBadge",{defaultValue:"Web ready"})})]}),g.jsx("p",{className:"mt-1 text-sm text-text-dim",children:i("chat.onboarding.body",{defaultValue:"Current agent: {{agent}}",agent:o})}),g.jsxs("div",{className:"mt-4 grid gap-2 text-sm sm:grid-cols-2",children:[g.jsx(Wi,{icon:g.jsx(qy,{}),label:i("chat.onboarding.stepWeb",{defaultValue:"Web console connected"}),tone:"success"}),g.jsx(Wi,{icon:g.jsx($y,{}),label:i("chat.onboarding.stepAgent",{defaultValue:"Agent selected: {{agent}}",agent:o}),meta:a>1?i("chat.onboarding.agentCount",{defaultValue:"{{count}} available",count:a}):void 0}),g.jsx(Wi,{icon:g.jsx(Ua,{}),label:i("chat.onboarding.stepMessage",{defaultValue:"Send the first message"})}),g.jsx(Wi,{icon:g.jsx(sc,{}),label:i("chat.onboarding.stepMessenger",{defaultValue:"Connect IM after chat works"})})]}),g.jsxs("div",{className:"mt-4 space-y-2",children:[g.jsx("div",{className:"flex flex-wrap items-center gap-2",children:n.map(s=>g.jsxs(qe,{type:"button",variant:"secondary",size:"sm",className:"max-w-full",onClick:()=>r(s),children:[g.jsx(Ua,{className:"h-4 w-4"}),g.jsx("span",{className:"min-w-0 truncate",children:s})]},s))}),g.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[g.jsx(qe,{asChild:!0,variant:"ghost",size:"sm",children:g.jsxs(ci,{to:"/settings/llm",children:[g.jsx(nb,{className:"h-4 w-4"}),g.jsx("span",{children:i("chat.onboarding.agentSettings",{defaultValue:"Agent settings"})})]})}),g.jsx(qe,{asChild:!0,variant:"ghost",size:"sm",children:g.jsxs(ci,{to:"/settings/messengers",children:[g.jsx(sc,{className:"h-4 w-4"}),g.jsx("span",{children:i("chat.onboarding.messengerSettings",{defaultValue:"Connect IM"})})]})})]})]})]})]})})}function Wi({icon:e,label:t,meta:n,tone:r="muted"}){return g.jsxs("div",{className:"flex min-w-0 items-center gap-2",children:[g.jsx("span",{className:be("flex h-7 w-7 shrink-0 items-center justify-center rounded-full bg-surface-2",r==="success"?"text-success":"text-text-dim","[&_svg]:h-4 [&_svg]:w-4"),"aria-hidden":"true",children:e}),g.jsxs("span",{className:"min-w-0",children:[g.jsx("span",{className:"block truncate text-sm text-text",children:t}),n&&g.jsx("span",{className:"block truncate text-xs text-text-muted",children:n})]})]})}function NM(){const{t:e}=ot(),t=cn();return g.jsxs("div",{className:"flex min-h-dvh flex-col bg-bg",children:[g.jsx(pm,{}),g.jsx("main",{className:"grid flex-1 place-items-center px-4 py-8 pb-safe",children:g.jsxs("div",{className:"flex max-w-md flex-col items-center gap-3 text-center",children:[g.jsx("div",{className:"flex h-12 w-12 items-center justify-center rounded-full bg-surface-2 text-text-dim",children:g.jsx(Gy,{className:"h-6 w-6"})}),g.jsx("div",{className:"text-6xl font-bold tracking-tight text-text-muted",children:"404"}),g.jsx("h1",{className:"text-xl font-semibold",children:e("notFound.title",{defaultValue:"Nothing here."})}),g.jsx("p",{className:"text-sm text-text-dim",children:e("notFound.description",{defaultValue:"The page you're looking for doesn't exist."})}),g.jsx("code",{className:"rounded bg-surface-2 px-2 py-0.5 text-xs text-text-muted",children:t.pathname}),g.jsx(qe,{asChild:!0,className:"mt-2",children:g.jsx(ci,{to:"/",children:e("actions.back")})})]})})]})}function Vt(e){return async()=>{const n=(await e()).default;return{element:g.jsx(Vd,{children:g.jsx(n,{})})}}}function ke(e){return async()=>{const n=(await e()).default;return{element:g.jsx(n,{})}}}const MM=ry([{path:"/login",element:g.jsx(vx,{})},{path:"/",element:g.jsx(Vd,{children:g.jsx(OM,{})})},{path:"/dashboard",lazy:Vt(()=>se(()=>import("./dashboard-CG3WiG7h.js"),__vite__mapDeps([2,3,4,5,6,7,8,9,10,1])))},{path:"/tasks",lazy:Vt(()=>se(()=>import("./layout-DsZ8eR4i.js"),__vite__mapDeps([11,1]))),children:[{index:!0,lazy:ke(()=>se(()=>import("./overview-COop5K2Y.js"),__vite__mapDeps([12,13,14,15,16,17,7,8,9,1])))},{path:"jobs",lazy:ke(()=>se(()=>import("./jobs-Biy5lYd4.js"),__vite__mapDeps([18,1,19,20,21,22,23,24,25,26,27,28,15,29,10,8,30,31])))},{path:"subtasks",lazy:ke(()=>se(()=>import("./subtasks-BnEjSGUR.js"),__vite__mapDeps([32,1,19,20,21,22,23,24,29,10,8])))},{path:"bgjobs",lazy:ke(()=>se(()=>import("./bgjobs-CcRiffyJ.js"),__vite__mapDeps([33,1,19,20,21,22,23,24,10,8,34])))},{path:"schedules",lazy:ke(()=>se(()=>import("./schedules-DAyhVI8-.js"),__vite__mapDeps([35,1,19,20,21,22,23,17,10,8])))},{path:"outbox",lazy:ke(()=>se(()=>import("./outbox-CEE0rwN3.js"),__vite__mapDeps([36,1,19,20,21,22,23,24,28,16,10,8])))},{path:"a2a",lazy:ke(()=>se(()=>import("./a2a-CTsDMefo.js"),__vite__mapDeps([37,1,19,20,21,22,23,24,13,29,10,8])))},{path:"heartbeat",lazy:ke(()=>se(()=>import("./heartbeat-ClO5gJrj.js"),__vite__mapDeps([38,1,20,14,39,10,8,40])))},{path:"goals",lazy:ke(()=>se(()=>import("./goals-C8ZQfbhj.js"),__vite__mapDeps([41,1,20,14,10,8,30])))},{path:"asks",lazy:ke(()=>se(()=>import("./asks-DGuBsrJ7.js"),__vite__mapDeps([42,20,1,14,10,8,30])))},{path:"plans",lazy:ke(()=>se(()=>import("./plans-Bo5LlLeH.js"),__vite__mapDeps([43,1,20,14,7,10,8,27,44,30])))}]},{path:"/approvals",lazy:Vt(()=>se(()=>import("./approvals-DOWlWI7Z.js"),__vite__mapDeps([45,1,21,29,10,8])))},{path:"/reminders",lazy:Vt(()=>se(()=>import("./reminders-DBEE0zXG.js"),__vite__mapDeps([46,1,19,20,21,22,23,24,28,44,10,8,47])))},{path:"/memos",lazy:Vt(()=>se(()=>import("./memos-DAt4k3DO.js"),__vite__mapDeps([48,1,19,20,21,22,23,28,49,27,50,8,51,52])))},{path:"/memory",lazy:Vt(()=>se(()=>import("./layout-Bm-2s2fp.js"),__vite__mapDeps([53,54,1]))),children:[{index:!0,lazy:ke(()=>se(()=>import("./overview-DeH5ud6d.js"),__vite__mapDeps([55,54,56,5,57,58,59,51,8,9,1])))},{path:"facts",lazy:ke(()=>se(()=>import("./facts-xT_24pH8.js"),__vite__mapDeps([60,1,19,20,21,22,23,25,26,27,28,54,50,57,10,8,51])))},{path:"persona",lazy:ke(()=>se(()=>import("./persona-CElXQZ4p.js"),__vite__mapDeps([61,1,21,28,54,57,10,8,40,62,30,50])))},{path:"distill",lazy:ke(()=>se(()=>import("./distill-CPurVW3v.js"),__vite__mapDeps([63,1,3,10,64,54,8,40])))},{path:"vector",lazy:ke(()=>se(()=>import("./vector-CL8ezpSR.js"),__vite__mapDeps([65,1,3,56,54,10,64,66,28,21,30,8,40,67,50,62])))},{path:"skills",element:g.jsx(gn,{to:"/settings/agim-skills",replace:!0})}]},{path:"/skills",children:[{index:!0,element:g.jsx(gn,{to:"/settings/agim-skills",replace:!0})},{path:"installed",element:g.jsx(gn,{to:"/settings/agim-skills/installed",replace:!0})},{path:"hot",element:g.jsx(gn,{to:"/settings/agim-skills/hot",replace:!0})}]},{path:"/workspace",lazy:Vt(()=>se(()=>import("./workspace-BA1_hso3.js"),__vite__mapDeps([68,1,21,4,3,10,8,69,59])))},{path:"/observability",lazy:Vt(()=>se(()=>import("./layout-sxvovjEH.js"),__vite__mapDeps([70,1]))),children:[{index:!0,element:g.jsx(gn,{to:"health",replace:!0})},{path:"health",lazy:ke(()=>se(()=>import("./health-A2StNEfn.js"),__vite__mapDeps([71,1,21,20,72,10,8,73])))},{path:"topn",lazy:ke(()=>se(()=>import("./topn-D1B-gS1M.js"),__vite__mapDeps([74,21,20,1,72,10,8])))},{path:"audit",lazy:ke(()=>se(()=>import("./audit-BRXsplJ2.js"),__vite__mapDeps([75,1,19,20,21,22,23,72,10,8,73])))}]},{path:"/settings",lazy:Vt(()=>se(()=>import("./layout-BTKafRVZ.js"),__vite__mapDeps([76,1]))),children:[{index:!0,element:g.jsx(gn,{to:"start",replace:!0})},{path:"start",lazy:ke(()=>se(()=>import("./start-D-abhl3q.js"),__vite__mapDeps([77,3,4,8,6,9,10,1])))},{path:"messengers",lazy:ke(()=>se(()=>import("./messengers-GYVTFlAj.js"),__vite__mapDeps([78,1,3,10,8,64,79,9,40])))},{path:"email",lazy:ke(()=>se(()=>import("./email-YlI4MWLp.js"),__vite__mapDeps([80,1,3,10,30,8,66,64])))},{path:"viewer",lazy:ke(()=>se(()=>import("./viewer-CD0iEfPU.js"),__vite__mapDeps([81,1,3,66,10,8,59,82,64,52])))},{path:"agents",lazy:ke(()=>se(()=>import("./agents-Ds1zyxBj.js"),__vite__mapDeps([83,1,21,4,3,10,8,64,84,51,85,50])))},{path:"policy",lazy:ke(()=>se(()=>import("./policy-BrgOuDt_.js"),__vite__mapDeps([86,3,10,8,1])))},{path:"security",lazy:ke(()=>se(()=>import("./security-CbP4QgVp.js"),__vite__mapDeps([87,1,49,27,3,10,8,88,85])))},{path:"service",lazy:ke(()=>se(()=>import("./service-gWZa3sup.js"),__vite__mapDeps([89,1,28,3,10,8,40,84,64,34,59,90])))},{path:"admins",lazy:ke(()=>se(()=>import("./admins-ByMAuquy.js"),__vite__mapDeps([91,1,28,21,20,3,10,8,50])))},{path:"workspaces",lazy:ke(()=>se(()=>import("./workspaces-DyGLJUgB.js"),__vite__mapDeps([92,1,28,21,20,49,27,4,3,10,8,31,50,64,85])))},{path:"llm",lazy:ke(()=>se(()=>import("./llm-JjZDbBvJ.js"),__vite__mapDeps([93,1,20,3,10,8,64,84,88,47,39,9,27,50,85])))},{path:"mcp",lazy:ke(()=>se(()=>import("./mcp-vKajK1F8.js"),__vite__mapDeps([94,1,20,10,8,73,50,85])))},{path:"native-agent",element:g.jsx(gn,{to:"/settings/llm",replace:!0})},{path:"search",lazy:ke(()=>se(()=>import("./search-55mtgHrB.js"),__vite__mapDeps([95,1,3,10,8,64,22,23,30])))},{path:"mobile",lazy:ke(()=>se(()=>import("./mobile-VUyTo40E.js"),__vite__mapDeps([96,1,10,8,79,66,90,88])))},{path:"agim-skills",lazy:ke(()=>se(()=>import("./layout-BLm6NJ3V.js"),__vite__mapDeps([97,1]))),children:[{index:!0,lazy:ke(()=>se(()=>import("./overview-BSOZ5gTD.js"),__vite__mapDeps([98,99,100,69,8,9,1])))},{path:"installed",lazy:ke(()=>se(()=>import("./installed-DL6r3ktm.js"),__vite__mapDeps([101,1,99,69,10,8,51,27,50,64])))},{path:"hot",lazy:ke(()=>se(()=>import("./hot-bfTA-V_z.js"),__vite__mapDeps([102,1,21,100,82,10,8,51,67,90])))},{path:"injection",lazy:ke(()=>se(()=>import("./injection-omvCR6-p.js"),__vite__mapDeps([103,1,99,10,8,90,64,50])))}]}]},{path:"/m/chat",lazy:Vt(()=>se(()=>import("./chat-rLJMdJBk.js"),__vite__mapDeps([104,1,26,23,10,58,73])))},{path:"*",element:g.jsx(NM,{})}]);function _M(){return g.jsx(Xb,{children:g.jsx(dy,{router:MM})})}const jM=new Av({defaultOptions:{queries:{staleTime:3e4,gcTime:5*6e4,retry:1,retryDelay:e=>Math.min(1e3*2**e,8e3),refetchOnWindowFocus:!1,refetchOnReconnect:!0},mutations:{retry:0}}});var[Xo]=Si("Tooltip",[zo]),Tl=zo(),mm="TooltipProvider",FM=700,kd="tooltip.open",[HM,gm]=Xo(mm),ym=e=>{const{__scopeTooltip:t,delayDuration:n=FM,skipDelayDuration:r=300,disableHoverableContent:i=!1,children:o}=e,a=y.useRef(!0),s=y.useRef(!1),l=y.useRef(0);return y.useEffect(()=>{const c=l.current;return()=>window.clearTimeout(c)},[]),g.jsx(HM,{scope:t,isOpenDelayedRef:a,delayDuration:n,onOpen:y.useCallback(()=>{r<=0||(window.clearTimeout(l.current),a.current=!1)},[r]),onClose:y.useCallback(()=>{r<=0||(window.clearTimeout(l.current),l.current=window.setTimeout(()=>a.current=!0,r))},[r]),isPointerInTransitRef:s,onPointerInTransitChange:y.useCallback(c=>{s.current=c},[]),disableHoverableContent:i,children:o})};ym.displayName=mm;var bm="Tooltip",[b_,Jo]=Xo(bm),ks="TooltipTrigger",UM=y.forwardRef((e,t)=>{const{__scopeTooltip:n,...r}=e,i=Jo(ks,n),o=gm(ks,n),a=Tl(n),s=y.useRef(null),l=$e(t,s,i.onTriggerChange),c=y.useRef(!1),u=y.useRef(!1),d=y.useCallback(()=>c.current=!1,[]);return y.useEffect(()=>()=>document.removeEventListener("pointerup",d),[d]),g.jsx(up,{asChild:!0,...a,children:g.jsx(Me.button,{"aria-describedby":i.open?i.contentId:void 0,"data-state":i.stateAttribute,...r,ref:l,onPointerMove:Oe(e.onPointerMove,h=>{h.pointerType!=="touch"&&!u.current&&!o.isPointerInTransitRef.current&&(i.onTriggerEnter(),u.current=!0)}),onPointerLeave:Oe(e.onPointerLeave,()=>{i.onTriggerLeave(),u.current=!1}),onPointerDown:Oe(e.onPointerDown,()=>{i.open&&i.onClose(),c.current=!0,document.addEventListener("pointerup",d,{once:!0})}),onFocus:Oe(e.onFocus,()=>{c.current||i.onOpen()}),onBlur:Oe(e.onBlur,i.onClose),onClick:Oe(e.onClick,i.onClose)})})});UM.displayName=ks;var BM="TooltipPortal",[v_,zM]=Xo(BM,{forceMount:void 0}),Pr="TooltipContent",vm=y.forwardRef((e,t)=>{const n=zM(Pr,e.__scopeTooltip),{forceMount:r=n.forceMount,side:i="top",...o}=e,a=Jo(Pr,e.__scopeTooltip);return g.jsx(Fr,{present:r||a.open,children:a.disableHoverableContent?g.jsx(xm,{side:i,...o,ref:t}):g.jsx($M,{side:i,...o,ref:t})})}),$M=y.forwardRef((e,t)=>{const n=Jo(Pr,e.__scopeTooltip),r=gm(Pr,e.__scopeTooltip),i=y.useRef(null),o=$e(t,i),[a,s]=y.useState(null),{trigger:l,onClose:c}=n,u=i.current,{onPointerInTransitChange:d}=r,h=y.useCallback(()=>{s(null),d(!1)},[d]),f=y.useCallback((m,p)=>{const b=m.currentTarget,v={x:m.clientX,y:m.clientY},x=GM(v,b.getBoundingClientRect()),w=QM(v,x),E=YM(p.getBoundingClientRect()),T=JM([...w,...E]);s(T),d(!0)},[d]);return y.useEffect(()=>()=>h(),[h]),y.useEffect(()=>{if(l&&u){const m=b=>f(b,u),p=b=>f(b,l);return l.addEventListener("pointerleave",m),u.addEventListener("pointerleave",p),()=>{l.removeEventListener("pointerleave",m),u.removeEventListener("pointerleave",p)}}},[l,u,f,h]),y.useEffect(()=>{if(a){const m=p=>{const b=p.target,v={x:p.clientX,y:p.clientY},x=l?.contains(b)||u?.contains(b),w=!XM(v,a);x?h():w&&(h(),c())};return document.addEventListener("pointermove",m),()=>document.removeEventListener("pointermove",m)}},[l,u,a,c,h]),g.jsx(xm,{...e,ref:o})}),[VM,WM]=Xo(bm,{isInside:!1}),KM=cb("TooltipContent"),xm=y.forwardRef((e,t)=>{const{__scopeTooltip:n,children:r,"aria-label":i,onEscapeKeyDown:o,onPointerDownOutside:a,...s}=e,l=Jo(Pr,n),c=Tl(n),{onClose:u}=l;return y.useEffect(()=>(document.addEventListener(kd,u),()=>document.removeEventListener(kd,u)),[u]),y.useEffect(()=>{if(l.trigger){const d=h=>{h.target instanceof Node&&h.target.contains(l.trigger)&&u()};return window.addEventListener("scroll",d,{capture:!0}),()=>window.removeEventListener("scroll",d,{capture:!0})}},[l.trigger,u]),g.jsx(jo,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:o,onPointerDownOutside:a,onFocusOutside:d=>d.preventDefault(),onDismiss:u,children:g.jsxs(dp,{"data-state":l.stateAttribute,...c,...s,ref:t,style:{...s.style,"--radix-tooltip-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-tooltip-content-available-width":"var(--radix-popper-available-width)","--radix-tooltip-content-available-height":"var(--radix-popper-available-height)","--radix-tooltip-trigger-width":"var(--radix-popper-anchor-width)","--radix-tooltip-trigger-height":"var(--radix-popper-anchor-height)"},children:[g.jsx(KM,{children:r}),g.jsx(VM,{scope:n,isInside:!0,children:g.jsx(JD,{id:l.contentId,role:"tooltip",children:i||r})})]})})});vm.displayName=Pr;var wm="TooltipArrow",qM=y.forwardRef((e,t)=>{const{__scopeTooltip:n,...r}=e,i=Tl(n);return WM(wm,n).isInside?null:g.jsx(fp,{...i,...r,ref:t})});qM.displayName=wm;function GM(e,t){const n=Math.abs(t.top-e.y),r=Math.abs(t.bottom-e.y),i=Math.abs(t.right-e.x),o=Math.abs(t.left-e.x);switch(Math.min(n,r,i,o)){case o:return"left";case i:return"right";case n:return"top";case r:return"bottom";default:throw new Error("unreachable")}}function QM(e,t,n=5){const r=[];switch(t){case"top":r.push({x:e.x-n,y:e.y+n},{x:e.x+n,y:e.y+n});break;case"bottom":r.push({x:e.x-n,y:e.y-n},{x:e.x+n,y:e.y-n});break;case"left":r.push({x:e.x+n,y:e.y-n},{x:e.x+n,y:e.y+n});break;case"right":r.push({x:e.x-n,y:e.y-n},{x:e.x-n,y:e.y+n});break}return r}function YM(e){const{top:t,right:n,bottom:r,left:i}=e;return[{x:i,y:t},{x:n,y:t},{x:n,y:r},{x:i,y:r}]}function XM(e,t){const{x:n,y:r}=e;let i=!1;for(let o=0,a=t.length-1;o<t.length;a=o++){const s=t[o],l=t[a],c=s.x,u=s.y,d=l.x,h=l.y;u>r!=h>r&&n<(d-c)*(r-u)/(h-u)+c&&(i=!i)}return i}function JM(e){const t=e.slice();return t.sort((n,r)=>n.x<r.x?-1:n.x>r.x?1:n.y<r.y?-1:n.y>r.y?1:0),ZM(t)}function ZM(e){if(e.length<=1)return e.slice();const t=[];for(let r=0;r<e.length;r++){const i=e[r];for(;t.length>=2;){const o=t[t.length-1],a=t[t.length-2];if((o.x-a.x)*(i.y-a.y)>=(o.y-a.y)*(i.x-a.x))t.pop();else break}t.push(i)}t.pop();const n=[];for(let r=e.length-1;r>=0;r--){const i=e[r];for(;n.length>=2;){const o=n[n.length-1],a=n[n.length-2];if((o.x-a.x)*(i.y-a.y)>=(o.y-a.y)*(i.x-a.x))n.pop();else break}n.push(i)}return n.pop(),t.length===1&&n.length===1&&t[0].x===n[0].x&&t[0].y===n[0].y?t:t.concat(n)}var e_=ym,km=vm;const t_=e_,n_=y.forwardRef(({className:e,sideOffset:t=4,...n},r)=>g.jsx(km,{ref:r,sideOffset:t,className:be("z-50 overflow-hidden rounded-md","bg-text text-bg px-2 py-1 text-xs font-medium shadow-md","data-[state=delayed-open]:animate-in data-[state=closed]:animate-out","data-[state=closed]:fade-out-0 data-[state=delayed-open]:fade-in-0","data-[state=closed]:zoom-out-95 data-[state=delayed-open]:zoom-in-95",e),...n}));n_.displayName=km.displayName;function r_(e){return g.jsx(cx,{position:"top-center",richColors:!0,closeButton:!0,toastOptions:{classNames:{toast:"border border-border bg-surface text-text shadow-md",title:"font-medium",description:"text-text-dim text-sm",actionButton:"bg-accent text-accent-fg rounded-md",cancelButton:"bg-surface-2 text-text rounded-md",error:"bg-danger-bg text-danger border-danger",success:"bg-success-bg text-success border-success",warning:"bg-warning-bg text-warning border-warning",info:"bg-info-bg text-info border-info"}},...e})}function i_({children:e}){const t=yr(r=>r.lang),{i18n:n}=ot();return y.useEffect(()=>{n.language!==t&&qC(t)},[t,n]),g.jsx(g.Fragment,{children:e})}function o_({children:e}){return EM(),g.jsx(g.Fragment,{children:e})}function a_({children:e}){return y.useEffect(()=>Sy(),[]),g.jsx(g.Fragment,{children:e})}function s_({children:e}){return g.jsx(Cv,{client:jM,children:g.jsx(i_,{children:g.jsx(o_,{children:g.jsx(a_,{children:g.jsxs(t_,{children:[e,g.jsx(r_,{})]})})})})})}const Sm=document.getElementById("root");if(!Sm)throw new Error("agim: #root not found in index.html");La.createRoot(Sm).render(g.jsx(K.StrictMode,{children:g.jsx(s_,{children:g.jsx(_M,{})})}));export{$e as $,Vy as A,$y as B,qy as C,xM as D,lm as E,cm as F,dm as G,fm as H,gr as I,um as J,f_ as K,ci as L,Zy as M,Zl as N,c_ as O,sc as P,Qa as Q,tb as R,nb as S,pm as T,Wy as U,Si as V,sO as W,ab as X,vr as Y,Me as Z,Oe as _,dM as a,cO as a0,ms as a1,kn as a2,BD as a3,up as a4,zo as a5,Fr as a6,hl as a7,gp as a8,mx as a9,zh as aa,pl as ab,rl as ac,jo as ad,dp as ae,Sr as af,fp as ag,Ua as ah,fM as ai,h_ as aj,bd as ak,Ji as al,vd as am,d_ as an,p_ as ao,g_ as ap,y_ as aq,m_ as ar,JC as as,uM as at,kM as au,GL as av,ZL as aw,cM as ax,ai as b,rb as c,rt as d,qe as e,be as f,Ky as g,Qe as h,zd as i,g as j,ko as k,yi as l,So as m,bi as n,bn as o,et as p,hx as q,mf as r,fx as s,Rn as t,ot as u,Pn as v,$n as w,Qd as x,$ as y,ob as z};
244
+ //# sourceMappingURL=index-DCfdN5R7.js.map