agim-cli 1.2.144 → 1.2.147

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 (266) hide show
  1. package/CHANGELOG.md +101 -0
  2. package/dist/cli-ui/setup-llm.d.ts.map +1 -1
  3. package/dist/cli-ui/setup-llm.js +3 -1
  4. package/dist/cli-ui/setup-llm.js.map +1 -1
  5. package/dist/core/circuit-breaker.d.ts +28 -0
  6. package/dist/core/circuit-breaker.d.ts.map +1 -1
  7. package/dist/core/circuit-breaker.js +45 -0
  8. package/dist/core/circuit-breaker.js.map +1 -1
  9. package/dist/core/intent.d.ts.map +1 -1
  10. package/dist/core/intent.js +3 -1
  11. package/dist/core/intent.js.map +1 -1
  12. package/dist/core/llm/agent-loop.d.ts +9 -1
  13. package/dist/core/llm/agent-loop.d.ts.map +1 -1
  14. package/dist/core/llm/agent-loop.js +80 -1
  15. package/dist/core/llm/agent-loop.js.map +1 -1
  16. package/dist/core/llm/anthropic-provider.d.ts.map +1 -1
  17. package/dist/core/llm/anthropic-provider.js +18 -4
  18. package/dist/core/llm/anthropic-provider.js.map +1 -1
  19. package/dist/core/llm/hallucination-detector.d.ts +33 -0
  20. package/dist/core/llm/hallucination-detector.d.ts.map +1 -0
  21. package/dist/core/llm/hallucination-detector.js +103 -0
  22. package/dist/core/llm/hallucination-detector.js.map +1 -0
  23. package/dist/core/llm/imhub-dispatcher.d.ts.map +1 -1
  24. package/dist/core/llm/imhub-dispatcher.js +7 -0
  25. package/dist/core/llm/imhub-dispatcher.js.map +1 -1
  26. package/dist/core/llm/provider-base.d.ts +9 -0
  27. package/dist/core/llm/provider-base.d.ts.map +1 -1
  28. package/dist/core/llm/provider-base.js.map +1 -1
  29. package/dist/core/memory-distill.d.ts.map +1 -1
  30. package/dist/core/memory-distill.js +18 -3
  31. package/dist/core/memory-distill.js.map +1 -1
  32. package/dist/core/memory.d.ts +14 -0
  33. package/dist/core/memory.d.ts.map +1 -1
  34. package/dist/core/memory.js +39 -0
  35. package/dist/core/memory.js.map +1 -1
  36. package/dist/core/message-sink.d.ts +6 -0
  37. package/dist/core/message-sink.d.ts.map +1 -1
  38. package/dist/core/message-sink.js +18 -3
  39. package/dist/core/message-sink.js.map +1 -1
  40. package/dist/core/outbox.d.ts +30 -2
  41. package/dist/core/outbox.d.ts.map +1 -1
  42. package/dist/core/outbox.js +102 -10
  43. package/dist/core/outbox.js.map +1 -1
  44. package/dist/core/reminders.d.ts.map +1 -1
  45. package/dist/core/reminders.js +11 -1
  46. package/dist/core/reminders.js.map +1 -1
  47. package/dist/core/router.d.ts.map +1 -1
  48. package/dist/core/router.js +16 -4
  49. package/dist/core/router.js.map +1 -1
  50. package/dist/core/schedule.d.ts +18 -0
  51. package/dist/core/schedule.d.ts.map +1 -1
  52. package/dist/core/schedule.js +80 -17
  53. package/dist/core/schedule.js.map +1 -1
  54. package/dist/core/sensitive-paths.d.ts.map +1 -1
  55. package/dist/core/sensitive-paths.js +53 -9
  56. package/dist/core/sensitive-paths.js.map +1 -1
  57. package/dist/core/types.d.ts +6 -0
  58. package/dist/core/types.d.ts.map +1 -1
  59. package/dist/plugins/agents/native/index.d.ts +47 -8
  60. package/dist/plugins/agents/native/index.d.ts.map +1 -1
  61. package/dist/plugins/agents/native/index.js +253 -102
  62. package/dist/plugins/agents/native/index.js.map +1 -1
  63. package/dist/plugins/agents/native/tool-registry.d.ts +33 -0
  64. package/dist/plugins/agents/native/tool-registry.d.ts.map +1 -0
  65. package/dist/plugins/agents/native/tool-registry.js +82 -0
  66. package/dist/plugins/agents/native/tool-registry.js.map +1 -0
  67. package/dist/plugins/messengers/dingtalk/dingtalk-client.d.ts.map +1 -1
  68. package/dist/plugins/messengers/dingtalk/dingtalk-client.js +11 -11
  69. package/dist/plugins/messengers/dingtalk/dingtalk-client.js.map +1 -1
  70. package/dist/plugins/messengers/feishu/feishu-adapter.d.ts.map +1 -1
  71. package/dist/plugins/messengers/feishu/feishu-adapter.js +9 -5
  72. package/dist/plugins/messengers/feishu/feishu-adapter.js.map +1 -1
  73. package/dist/plugins/messengers/wechat/ilink-adapter.d.ts.map +1 -1
  74. package/dist/plugins/messengers/wechat/ilink-adapter.js +11 -1
  75. package/dist/plugins/messengers/wechat/ilink-adapter.js.map +1 -1
  76. package/dist/web/public/assets/{a2a-DczMMkbl.js → a2a-Cll3P4QN.js} +2 -2
  77. package/dist/web/public/assets/{a2a-DczMMkbl.js.map → a2a-Cll3P4QN.js.map} +1 -1
  78. package/dist/web/public/assets/{activity-cbLHkzca.js → activity-B7T7YFlD.js} +2 -2
  79. package/dist/web/public/assets/{activity-cbLHkzca.js.map → activity-B7T7YFlD.js.map} +1 -1
  80. package/dist/web/public/assets/{admins-C-YsGMj7.js → admins-CN7P018S.js} +2 -2
  81. package/dist/web/public/assets/{admins-C-YsGMj7.js.map → admins-CN7P018S.js.map} +1 -1
  82. package/dist/web/public/assets/{agents-BWfov_1-.js → agents-Bqgq7GBF.js} +2 -2
  83. package/dist/web/public/assets/{agents-BWfov_1-.js.map → agents-Bqgq7GBF.js.map} +1 -1
  84. package/dist/web/public/assets/{approvals-HSssmXKS.js → approvals-C8IUJQ_A.js} +2 -2
  85. package/dist/web/public/assets/{approvals-HSssmXKS.js.map → approvals-C8IUJQ_A.js.map} +1 -1
  86. package/dist/web/public/assets/{arrow-down-BXvC8Al2.js → arrow-down-SLWKqtDc.js} +2 -2
  87. package/dist/web/public/assets/{arrow-down-BXvC8Al2.js.map → arrow-down-SLWKqtDc.js.map} +1 -1
  88. package/dist/web/public/assets/{arrow-up-63xELY5Q.js → arrow-up-BOADc9ce.js} +2 -2
  89. package/dist/web/public/assets/{arrow-up-63xELY5Q.js.map → arrow-up-BOADc9ce.js.map} +1 -1
  90. package/dist/web/public/assets/{asks-COLEFOvK.js → asks-C-j-DypC.js} +2 -2
  91. package/dist/web/public/assets/{asks-COLEFOvK.js.map → asks-C-j-DypC.js.map} +1 -1
  92. package/dist/web/public/assets/{audit-D4ZEiZub.js → audit-DQb-RuXh.js} +2 -2
  93. package/dist/web/public/assets/{audit-D4ZEiZub.js.map → audit-DQb-RuXh.js.map} +1 -1
  94. package/dist/web/public/assets/{bell-Cg2Bvv06.js → bell-CV88-ul6.js} +2 -2
  95. package/dist/web/public/assets/{bell-Cg2Bvv06.js.map → bell-CV88-ul6.js.map} +1 -1
  96. package/dist/web/public/assets/{bgjobs-CEjCzwtd.js → bgjobs-CDrK0d-W.js} +2 -2
  97. package/dist/web/public/assets/{bgjobs-CEjCzwtd.js.map → bgjobs-CDrK0d-W.js.map} +1 -1
  98. package/dist/web/public/assets/{brain-euvl6F6C.js → brain-B7HtSOQU.js} +2 -2
  99. package/dist/web/public/assets/{brain-euvl6F6C.js.map → brain-B7HtSOQU.js.map} +1 -1
  100. package/dist/web/public/assets/{briefcase-DPWLbCnA.js → briefcase-mdzuIa__.js} +2 -2
  101. package/dist/web/public/assets/{briefcase-DPWLbCnA.js.map → briefcase-mdzuIa__.js.map} +1 -1
  102. package/dist/web/public/assets/{browser-ponyfill-BUutOaRz.js → browser-ponyfill-DBWdeCTC.js} +2 -2
  103. package/dist/web/public/assets/{browser-ponyfill-BUutOaRz.js.map → browser-ponyfill-DBWdeCTC.js.map} +1 -1
  104. package/dist/web/public/assets/{chat-Dz9kfaxH.js → chat-CSjtY2rN.js} +3 -3
  105. package/dist/web/public/assets/{chat-Dz9kfaxH.js.map → chat-CSjtY2rN.js.map} +1 -1
  106. package/dist/web/public/assets/{chevron-left-BeIh5thq.js → chevron-left-uSfPn636.js} +2 -2
  107. package/dist/web/public/assets/{chevron-left-BeIh5thq.js.map → chevron-left-uSfPn636.js.map} +1 -1
  108. package/dist/web/public/assets/{chevron-right-uP_l9MMb.js → chevron-right-CtelqacW.js} +2 -2
  109. package/dist/web/public/assets/{chevron-right-uP_l9MMb.js.map → chevron-right-CtelqacW.js.map} +1 -1
  110. package/dist/web/public/assets/{circle-check-CewnjFgv.js → circle-check-8dbL-u7O.js} +2 -2
  111. package/dist/web/public/assets/{circle-check-CewnjFgv.js.map → circle-check-8dbL-u7O.js.map} +1 -1
  112. package/dist/web/public/assets/{circle-check-big-C2RTc48c.js → circle-check-big-D8-svk9a.js} +2 -2
  113. package/dist/web/public/assets/{circle-check-big-C2RTc48c.js.map → circle-check-big-D8-svk9a.js.map} +1 -1
  114. package/dist/web/public/assets/{circle-x-Ccg1HyV-.js → circle-x-rUxzIz5P.js} +2 -2
  115. package/dist/web/public/assets/{circle-x-Ccg1HyV-.js.map → circle-x-rUxzIz5P.js.map} +1 -1
  116. package/dist/web/public/assets/{clock-qxbYSynv.js → clock-CG5dlBGB.js} +2 -2
  117. package/dist/web/public/assets/{clock-qxbYSynv.js.map → clock-CG5dlBGB.js.map} +1 -1
  118. package/dist/web/public/assets/{confirm-dialog-DmJq4Td9.js → confirm-dialog-DlUsSur3.js} +2 -2
  119. package/dist/web/public/assets/{confirm-dialog-DmJq4Td9.js.map → confirm-dialog-DlUsSur3.js.map} +1 -1
  120. package/dist/web/public/assets/{copy-DxSHRdbc.js → copy-DnC76wFT.js} +2 -2
  121. package/dist/web/public/assets/{copy-DxSHRdbc.js.map → copy-DnC76wFT.js.map} +1 -1
  122. package/dist/web/public/assets/{data-table-S7rIjwdO.js → data-table-DswkWUfG.js} +2 -2
  123. package/dist/web/public/assets/{data-table-S7rIjwdO.js.map → data-table-DswkWUfG.js.map} +1 -1
  124. package/dist/web/public/assets/dialog-Ceo4YuXy.js +6 -0
  125. package/dist/web/public/assets/dialog-Ceo4YuXy.js.map +1 -0
  126. package/dist/web/public/assets/{download-OhsGtnO-.js → download-DF-46tS4.js} +2 -2
  127. package/dist/web/public/assets/{download-OhsGtnO-.js.map → download-DF-46tS4.js.map} +1 -1
  128. package/dist/web/public/assets/{email-C1-HxWLF.js → email-CZee26-_.js} +3 -3
  129. package/dist/web/public/assets/{email-C1-HxWLF.js.map → email-CZee26-_.js.map} +1 -1
  130. package/dist/web/public/assets/{empty-state-C-qjOHyu.js → empty-state-D9Hi0Atm.js} +2 -2
  131. package/dist/web/public/assets/{empty-state-C-qjOHyu.js.map → empty-state-D9Hi0Atm.js.map} +1 -1
  132. package/dist/web/public/assets/{external-link-DRVp9-lb.js → external-link-D64iZa9P.js} +2 -2
  133. package/dist/web/public/assets/{external-link-DRVp9-lb.js.map → external-link-D64iZa9P.js.map} +1 -1
  134. package/dist/web/public/assets/{eye-CFhg5BTa.js → eye-sY6WZb7D.js} +2 -2
  135. package/dist/web/public/assets/{eye-CFhg5BTa.js.map → eye-sY6WZb7D.js.map} +1 -1
  136. package/dist/web/public/assets/{facts-CGaLWhzi.js → facts-B7bGGwvi.js} +2 -2
  137. package/dist/web/public/assets/{facts-CGaLWhzi.js.map → facts-B7bGGwvi.js.map} +1 -1
  138. package/dist/web/public/assets/{goals-C-dJANmn.js → goals-BfQbsvZv.js} +2 -2
  139. package/dist/web/public/assets/{goals-C-dJANmn.js.map → goals-BfQbsvZv.js.map} +1 -1
  140. package/dist/web/public/assets/{health-CWcti5h3.js → health-Ba_mY0Ts.js} +2 -2
  141. package/dist/web/public/assets/{health-CWcti5h3.js.map → health-Ba_mY0Ts.js.map} +1 -1
  142. package/dist/web/public/assets/{heart-pulse-DmGhKR2W.js → heart-pulse-BjikOVwU.js} +2 -2
  143. package/dist/web/public/assets/{heart-pulse-DmGhKR2W.js.map → heart-pulse-BjikOVwU.js.map} +1 -1
  144. package/dist/web/public/assets/{heartbeat-kLoGBNCo.js → heartbeat-BM8LlPes.js} +2 -2
  145. package/dist/web/public/assets/{heartbeat-kLoGBNCo.js.map → heartbeat-BM8LlPes.js.map} +1 -1
  146. package/dist/web/public/assets/{hot-BITDoax1.js → hot-BtuLL6n8.js} +2 -2
  147. package/dist/web/public/assets/{hot-BITDoax1.js.map → hot-BtuLL6n8.js.map} +1 -1
  148. package/dist/web/public/assets/index-DEWFfW_Z.js +199 -0
  149. package/dist/web/public/assets/index-DEWFfW_Z.js.map +1 -0
  150. package/dist/web/public/assets/{installed-Co9WrtQ7.js → installed-Xr8p31ij.js} +2 -2
  151. package/dist/web/public/assets/{installed-Co9WrtQ7.js.map → installed-Xr8p31ij.js.map} +1 -1
  152. package/dist/web/public/assets/{jobs-hdHhBEvi.js → jobs-Ddy81Udm.js} +2 -2
  153. package/dist/web/public/assets/{jobs-hdHhBEvi.js.map → jobs-Ddy81Udm.js.map} +1 -1
  154. package/dist/web/public/assets/{layout-CQtbOBag.js → layout-BL74fT-L.js} +2 -2
  155. package/dist/web/public/assets/{layout-CQtbOBag.js.map → layout-BL74fT-L.js.map} +1 -1
  156. package/dist/web/public/assets/{layout-bDMXIKIR.js → layout-Bn2qUxcK.js} +2 -2
  157. package/dist/web/public/assets/{layout-bDMXIKIR.js.map → layout-Bn2qUxcK.js.map} +1 -1
  158. package/dist/web/public/assets/{layout-BMXC1Uh1.js → layout-Bp4SAA8_.js} +2 -2
  159. package/dist/web/public/assets/{layout-BMXC1Uh1.js.map → layout-Bp4SAA8_.js.map} +1 -1
  160. package/dist/web/public/assets/{layout-CysVsySh.js → layout-CZ9pGnW8.js} +2 -2
  161. package/dist/web/public/assets/{layout-CysVsySh.js.map → layout-CZ9pGnW8.js.map} +1 -1
  162. package/dist/web/public/assets/{layout-CyBGneZ9.js → layout-pasFRkKV.js} +2 -2
  163. package/dist/web/public/assets/{layout-CyBGneZ9.js.map → layout-pasFRkKV.js.map} +1 -1
  164. package/dist/web/public/assets/llm-yp7b5xxL.js +7 -0
  165. package/dist/web/public/assets/llm-yp7b5xxL.js.map +1 -0
  166. package/dist/web/public/assets/{loader-circle-9VUMGitw.js → loader-circle-Bbw4pEyE.js} +2 -2
  167. package/dist/web/public/assets/{loader-circle-9VUMGitw.js.map → loader-circle-Bbw4pEyE.js.map} +1 -1
  168. package/dist/web/public/assets/{map-pin-BXYvvHry.js → map-pin-DIXHUQgM.js} +2 -2
  169. package/dist/web/public/assets/{map-pin-BXYvvHry.js.map → map-pin-DIXHUQgM.js.map} +1 -1
  170. package/dist/web/public/assets/{mcp-BgLdlwSn.js → mcp-DyaljIM_.js} +2 -2
  171. package/dist/web/public/assets/{mcp-BgLdlwSn.js.map → mcp-DyaljIM_.js.map} +1 -1
  172. package/dist/web/public/assets/memos-Dkoc157i.js +12 -0
  173. package/dist/web/public/assets/memos-Dkoc157i.js.map +1 -0
  174. package/dist/web/public/assets/{messengers-7Phqea62.js → messengers-CcyGDeUI.js} +2 -2
  175. package/dist/web/public/assets/{messengers-7Phqea62.js.map → messengers-CcyGDeUI.js.map} +1 -1
  176. package/dist/web/public/assets/{mobile-CV5b6D2W.js → mobile-DqzIv4Xb.js} +2 -2
  177. package/dist/web/public/assets/{mobile-CV5b6D2W.js.map → mobile-DqzIv4Xb.js.map} +1 -1
  178. package/dist/web/public/assets/{native-agent-QvIa6LjE.js → native-agent-BQ7WaRGK.js} +2 -2
  179. package/dist/web/public/assets/{native-agent-QvIa6LjE.js.map → native-agent-BQ7WaRGK.js.map} +1 -1
  180. package/dist/web/public/assets/{network-BXhEjGhE.js → network-B_yUFAqC.js} +2 -2
  181. package/dist/web/public/assets/{network-BXhEjGhE.js.map → network-B_yUFAqC.js.map} +1 -1
  182. package/dist/web/public/assets/{outbox-DHQL7TQb.js → outbox-l8aVOZqO.js} +2 -2
  183. package/dist/web/public/assets/{outbox-DHQL7TQb.js.map → outbox-l8aVOZqO.js.map} +1 -1
  184. package/dist/web/public/assets/{pagination-VKuPb1Ot.js → pagination-BAKRGKa9.js} +2 -2
  185. package/dist/web/public/assets/{pagination-VKuPb1Ot.js.map → pagination-BAKRGKa9.js.map} +1 -1
  186. package/dist/web/public/assets/{persona-CWug2GLR.js → persona-D3VL9Rg1.js} +2 -2
  187. package/dist/web/public/assets/{persona-CWug2GLR.js.map → persona-D3VL9Rg1.js.map} +1 -1
  188. package/dist/web/public/assets/{plans-CZoEs5SY.js → plans-BBB5e9my.js} +2 -2
  189. package/dist/web/public/assets/{plans-CZoEs5SY.js.map → plans-BBB5e9my.js.map} +1 -1
  190. package/dist/web/public/assets/{play-CfSn5Vdl.js → play-7-Wd369f.js} +2 -2
  191. package/dist/web/public/assets/{play-CfSn5Vdl.js.map → play-7-Wd369f.js.map} +1 -1
  192. package/dist/web/public/assets/{plus-Z8l4CiqJ.js → plus-B0sfZy-j.js} +2 -2
  193. package/dist/web/public/assets/{plus-Z8l4CiqJ.js.map → plus-B0sfZy-j.js.map} +1 -1
  194. package/dist/web/public/assets/{policy-CutDSEPW.js → policy-BM1WRXH0.js} +2 -2
  195. package/dist/web/public/assets/{policy-CutDSEPW.js.map → policy-BM1WRXH0.js.map} +1 -1
  196. package/dist/web/public/assets/{qr-code-DgU5aiM6.js → qr-code-DcKs5fi3.js} +2 -2
  197. package/dist/web/public/assets/{qr-code-DgU5aiM6.js.map → qr-code-DcKs5fi3.js.map} +1 -1
  198. package/dist/web/public/assets/{react-Cb2sDjhD.js → react-DlP5eolq.js} +2 -2
  199. package/dist/web/public/assets/{react-Cb2sDjhD.js.map → react-DlP5eolq.js.map} +1 -1
  200. package/dist/web/public/assets/{refresh-ccw-D2CWiyU_.js → refresh-ccw-uNKeBeRl.js} +2 -2
  201. package/dist/web/public/assets/{refresh-ccw-D2CWiyU_.js.map → refresh-ccw-uNKeBeRl.js.map} +1 -1
  202. package/dist/web/public/assets/{reminders-Cb6Izedg.js → reminders-DHM8K0_O.js} +2 -2
  203. package/dist/web/public/assets/{reminders-Cb6Izedg.js.map → reminders-DHM8K0_O.js.map} +1 -1
  204. package/dist/web/public/assets/{save-DB0BDYTs.js → save-qwJa5_SA.js} +2 -2
  205. package/dist/web/public/assets/{save-DB0BDYTs.js.map → save-qwJa5_SA.js.map} +1 -1
  206. package/dist/web/public/assets/{schedules-8mSjE14D.js → schedules-Bcd0wbT4.js} +2 -2
  207. package/dist/web/public/assets/{schedules-8mSjE14D.js.map → schedules-Bcd0wbT4.js.map} +1 -1
  208. package/dist/web/public/assets/{search-Con69NhG.js → search-BUlzNWrj.js} +2 -2
  209. package/dist/web/public/assets/{search-Con69NhG.js.map → search-BUlzNWrj.js.map} +1 -1
  210. package/dist/web/public/assets/{search-B4fHilZ0.js → search-i1tP2maJ.js} +2 -2
  211. package/dist/web/public/assets/{search-B4fHilZ0.js.map → search-i1tP2maJ.js.map} +1 -1
  212. package/dist/web/public/assets/{security-BTe3zUg8.js → security-DgJyTT4g.js} +2 -2
  213. package/dist/web/public/assets/{security-BTe3zUg8.js.map → security-DgJyTT4g.js.map} +1 -1
  214. package/dist/web/public/assets/{service-C7SqcwfL.js → service-A0Hzear0.js} +2 -2
  215. package/dist/web/public/assets/{service-C7SqcwfL.js.map → service-A0Hzear0.js.map} +1 -1
  216. package/dist/web/public/assets/{shield-alert-CKFVsGgI.js → shield-alert-DrnN6fz_.js} +2 -2
  217. package/dist/web/public/assets/{shield-alert-CKFVsGgI.js.map → shield-alert-DrnN6fz_.js.map} +1 -1
  218. package/dist/web/public/assets/{status-badge-BSkpyN4D.js → status-badge-Ryzf96Pl.js} +2 -2
  219. package/dist/web/public/assets/{status-badge-BSkpyN4D.js.map → status-badge-Ryzf96Pl.js.map} +1 -1
  220. package/dist/web/public/assets/{subtasks-Bel-I1Sk.js → subtasks-Bzh3o3EF.js} +2 -2
  221. package/dist/web/public/assets/{subtasks-Bel-I1Sk.js.map → subtasks-Bzh3o3EF.js.map} +1 -1
  222. package/dist/web/public/assets/{table-CPn1MRcy.js → table-BbAOSyc8.js} +2 -2
  223. package/dist/web/public/assets/{table-CPn1MRcy.js.map → table-BbAOSyc8.js.map} +1 -1
  224. package/dist/web/public/assets/{topn-Ba3RjcK1.js → topn-DkhYw-Gp.js} +2 -2
  225. package/dist/web/public/assets/{topn-Ba3RjcK1.js.map → topn-DkhYw-Gp.js.map} +1 -1
  226. package/dist/web/public/assets/{trash-2-Dfov8aHD.js → trash-2-CA0cLpnU.js} +2 -2
  227. package/dist/web/public/assets/{trash-2-Dfov8aHD.js.map → trash-2-CA0cLpnU.js.map} +1 -1
  228. package/dist/web/public/assets/{use-background-tasks-BQrEeUwY.js → use-background-tasks-B64YjlA8.js} +2 -2
  229. package/dist/web/public/assets/{use-background-tasks-BQrEeUwY.js.map → use-background-tasks-B64YjlA8.js.map} +1 -1
  230. package/dist/web/public/assets/{use-event-stream-DgGpGKop.js → use-event-stream-I1lMFEfh.js} +2 -2
  231. package/dist/web/public/assets/{use-event-stream-DgGpGKop.js.map → use-event-stream-I1lMFEfh.js.map} +1 -1
  232. package/dist/web/public/assets/{use-llm-admin-DYekqogG.js → use-llm-admin-DY2axI4D.js} +2 -2
  233. package/dist/web/public/assets/{use-llm-admin-DYekqogG.js.map → use-llm-admin-DY2axI4D.js.map} +1 -1
  234. package/dist/web/public/assets/{use-memory-DbJ4pP2Z.js → use-memory-BYEjVWbU.js} +2 -2
  235. package/dist/web/public/assets/{use-memory-DbJ4pP2Z.js.map → use-memory-BYEjVWbU.js.map} +1 -1
  236. package/dist/web/public/assets/{use-observability-C2M6WZ9W.js → use-observability-Coj02yDo.js} +2 -2
  237. package/dist/web/public/assets/{use-observability-C2M6WZ9W.js.map → use-observability-Coj02yDo.js.map} +1 -1
  238. package/dist/web/public/assets/{use-settings-DMdaoWsB.js → use-settings-i1MhlkyC.js} +2 -2
  239. package/dist/web/public/assets/{use-settings-DMdaoWsB.js.map → use-settings-i1MhlkyC.js.map} +1 -1
  240. package/dist/web/public/assets/{use-workspace-BHG7h3jQ.js → use-workspace-DgEM35PY.js} +2 -2
  241. package/dist/web/public/assets/{use-workspace-BHG7h3jQ.js.map → use-workspace-DgEM35PY.js.map} +1 -1
  242. package/dist/web/public/assets/{useQuery-PdiC7-sY.js → useQuery-CY2iazjN.js} +2 -2
  243. package/dist/web/public/assets/{useQuery-PdiC7-sY.js.map → useQuery-CY2iazjN.js.map} +1 -1
  244. package/dist/web/public/assets/{vector-DnZM3OXU.js → vector-Ic76u2hY.js} +2 -2
  245. package/dist/web/public/assets/{vector-DnZM3OXU.js.map → vector-Ic76u2hY.js.map} +1 -1
  246. package/dist/web/public/assets/{viewer-Dz6k0YKp.js → viewer-BXbUN1Rl.js} +2 -2
  247. package/dist/web/public/assets/{viewer-Dz6k0YKp.js.map → viewer-BXbUN1Rl.js.map} +1 -1
  248. package/dist/web/public/assets/{workspace-BnXrWS3j.js → workspace-CUg0JPn6.js} +3 -3
  249. package/dist/web/public/assets/{workspace-BnXrWS3j.js.map → workspace-CUg0JPn6.js.map} +1 -1
  250. package/dist/web/public/assets/{workspaces-CSS_UBEi.js → workspaces-C-wb5FQj.js} +2 -2
  251. package/dist/web/public/assets/{workspaces-CSS_UBEi.js.map → workspaces-C-wb5FQj.js.map} +1 -1
  252. package/dist/web/public/assets/{x-DG-JKVw_.js → x-D1iSuoqg.js} +2 -2
  253. package/dist/web/public/assets/{x-DG-JKVw_.js.map → x-D1iSuoqg.js.map} +1 -1
  254. package/dist/web/public/index.html +2 -2
  255. package/dist/web/server.d.ts.map +1 -1
  256. package/dist/web/server.js +6 -0
  257. package/dist/web/server.js.map +1 -1
  258. package/package.json +1 -1
  259. package/dist/web/public/assets/dialog-bAIDaO-6.js +0 -6
  260. package/dist/web/public/assets/dialog-bAIDaO-6.js.map +0 -1
  261. package/dist/web/public/assets/index-O0BQoyzo.js +0 -199
  262. package/dist/web/public/assets/index-O0BQoyzo.js.map +0 -1
  263. package/dist/web/public/assets/llm-CPIRNQU2.js +0 -7
  264. package/dist/web/public/assets/llm-CPIRNQU2.js.map +0 -1
  265. package/dist/web/public/assets/memos-CfneX9DH.js +0 -12
  266. package/dist/web/public/assets/memos-CfneX9DH.js.map +0 -1
@@ -0,0 +1,199 @@
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/layout-Bp4SAA8_.js","assets/react-DlP5eolq.js","assets/jobs-Ddy81Udm.js","assets/data-table-DswkWUfG.js","assets/table-BbAOSyc8.js","assets/empty-state-D9Hi0Atm.js","assets/arrow-up-BOADc9ce.js","assets/arrow-down-SLWKqtDc.js","assets/status-badge-Ryzf96Pl.js","assets/pagination-BAKRGKa9.js","assets/chevron-left-uSfPn636.js","assets/chevron-right-CtelqacW.js","assets/confirm-dialog-DlUsSur3.js","assets/dialog-Ceo4YuXy.js","assets/x-D1iSuoqg.js","assets/useQuery-CY2iazjN.js","assets/use-event-stream-I1lMFEfh.js","assets/loader-circle-Bbw4pEyE.js","assets/refresh-ccw-uNKeBeRl.js","assets/circle-x-rUxzIz5P.js","assets/briefcase-mdzuIa__.js","assets/subtasks-Bzh3o3EF.js","assets/bgjobs-CDrK0d-W.js","assets/schedules-Bcd0wbT4.js","assets/outbox-l8aVOZqO.js","assets/a2a-Cll3P4QN.js","assets/heartbeat-BM8LlPes.js","assets/use-background-tasks-B64YjlA8.js","assets/heart-pulse-BjikOVwU.js","assets/play-7-Wd369f.js","assets/goals-BfQbsvZv.js","assets/circle-check-8dbL-u7O.js","assets/asks-C-j-DypC.js","assets/plans-BBB5e9my.js","assets/clock-CG5dlBGB.js","assets/approvals-C8IUJQ_A.js","assets/reminders-DHM8K0_O.js","assets/bell-CV88-ul6.js","assets/memos-Dkoc157i.js","assets/trash-2-CA0cLpnU.js","assets/search-i1tP2maJ.js","assets/map-pin-DIXHUQgM.js","assets/layout-BL74fT-L.js","assets/use-memory-BYEjVWbU.js","assets/facts-B7bGGwvi.js","assets/brain-B7HtSOQU.js","assets/persona-D3VL9Rg1.js","assets/circle-check-big-D8-svk9a.js","assets/vector-Ic76u2hY.js","assets/use-settings-i1MhlkyC.js","assets/save-qwJa5_SA.js","assets/eye-sY6WZb7D.js","assets/download-DF-46tS4.js","assets/workspace-CUg0JPn6.js","assets/use-workspace-DgEM35PY.js","assets/layout-CZ9pGnW8.js","assets/health-Ba_mY0Ts.js","assets/use-observability-Coj02yDo.js","assets/activity-B7T7YFlD.js","assets/topn-DkhYw-Gp.js","assets/audit-DQb-RuXh.js","assets/layout-Bn2qUxcK.js","assets/messengers-CcyGDeUI.js","assets/qr-code-DcKs5fi3.js","assets/email-CZee26-_.js","assets/viewer-BXbUN1Rl.js","assets/external-link-D64iZa9P.js","assets/agents-Bqgq7GBF.js","assets/network-B_yUFAqC.js","assets/plus-B0sfZy-j.js","assets/policy-BM1WRXH0.js","assets/security-DgJyTT4g.js","assets/shield-alert-DrnN6fz_.js","assets/service-A0Hzear0.js","assets/admins-CN7P018S.js","assets/workspaces-C-wb5FQj.js","assets/llm-yp7b5xxL.js","assets/use-llm-admin-DY2axI4D.js","assets/mcp-DyaljIM_.js","assets/native-agent-BQ7WaRGK.js","assets/search-BUlzNWrj.js","assets/mobile-DqzIv4Xb.js","assets/copy-DnC76wFT.js","assets/layout-pasFRkKV.js","assets/installed-Xr8p31ij.js","assets/hot-BtuLL6n8.js","assets/chat-CSjtY2rN.js","assets/browser-ponyfill-DBWdeCTC.js"])))=>i.map(i=>d[i]);
2
+ import{r as g,a as vr,R as no,b as bp,c as V,v as xp,d as _i,g as _u}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 Nu={exports:{}},ro={};/**
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 wp=g,kp=Symbol.for("react.element"),Sp=Symbol.for("react.fragment"),Ep=Object.prototype.hasOwnProperty,Cp=wp.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,Ap={key:!0,ref:!0,__self:!0,__source:!0};function Du(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)Ep.call(t,r)&&!Ap.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:kp,type:e,key:o,ref:a,props:i,_owner:Cp.current}}ro.Fragment=Sp;ro.jsx=Du;ro.jsxs=Du;Nu.exports=ro;var v=Nu.exports,oa={},Ys=vr;oa.createRoot=Ys.createRoot,oa.hydrateRoot=Ys.hydrateRoot;const Tp="modulepreload",Rp=function(e){return"/"+e},Qs={},he=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=Rp(l),l in Qs)return;Qs[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":Tp,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 He(){return He=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},He.apply(null,arguments)}var Ge;(function(e){e.Pop="POP",e.Push="PUSH",e.Replace="REPLACE"})(Ge||(Ge={}));const Xs="popstate";function Pp(e){e===void 0&&(e={});function t(r,i){let{pathname:o,search:a,hash:s}=r.location;return Wr("",{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:Un(i)}return Lp(t,n,null,e)}function xe(e,t){if(e===!1||e===null||typeof e>"u")throw new Error(t)}function Bn(e,t){if(!e){typeof console<"u"&&console.warn(t);try{throw new Error(t)}catch{}}}function Ip(){return Math.random().toString(36).substr(2,8)}function Js(e,t){return{usr:e.state,key:e.key,idx:t}}function Wr(e,t,n,r){return n===void 0&&(n=null),He({pathname:typeof e=="string"?e:e.pathname,search:"",hash:""},typeof t=="string"?wn(t):t,{state:n,key:t&&t.key||r||Ip()})}function Un(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 wn(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 Lp(e,t,n,r){r===void 0&&(r={});let{window:i=document.defaultView,v5Compat:o=!1}=r,a=i.history,s=Ge.Pop,l=null,c=u();c==null&&(c=0,a.replaceState(He({},a.state,{idx:c}),""));function u(){return(a.state||{idx:null}).idx}function d(){s=Ge.Pop;let y=u(),b=y==null?null:y-c;c=y,l&&l({action:s,location:p.location,delta:b})}function h(y,b){s=Ge.Push;let x=Wr(p.location,y,b);c=u()+1;let w=Js(x,c),T=p.createHref(x);try{a.pushState(w,"",T)}catch(I){if(I instanceof DOMException&&I.name==="DataCloneError")throw I;i.location.assign(T)}o&&l&&l({action:s,location:p.location,delta:1})}function f(y,b){s=Ge.Replace;let x=Wr(p.location,y,b);c=u();let w=Js(x,c),T=p.createHref(x);a.replaceState(w,"",T),o&&l&&l({action:s,location:p.location,delta:0})}function m(y){let b=i.location.origin!=="null"?i.location.origin:i.location.href,x=typeof y=="string"?y:Un(y);return x=x.replace(/ $/,"%20"),xe(b,"No window.location.(origin|href) available to create URL for href: "+x),new URL(x,b)}let p={get action(){return s},get location(){return e(i,a)},listen(y){if(l)throw new Error("A history only accepts one active listener");return i.addEventListener(Xs,d),l=y,()=>{i.removeEventListener(Xs,d),l=null}},createHref(y){return t(i,y)},createURL:m,encodeLocation(y){let b=m(y);return{pathname:b.pathname,search:b.search,hash:b.hash}},push:h,replace:f,go(y){return a.go(y)}};return p}var _e;(function(e){e.data="data",e.deferred="deferred",e.redirect="redirect",e.error="error"})(_e||(_e={}));const Op=new Set(["lazy","caseSensitive","path","id","index","children"]);function _p(e){return e.index===!0}function Ni(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(xe(i.index!==!0||!i.children,"Cannot specify children on an index route"),xe(!r[s],'Found a route id collision on id "'+s+`". Route id's must be globally unique within Data Router usages`),_p(i)){let l=He({},i,t(i),{id:s});return r[s]=l,l}else{let l=He({},i,t(i),{id:s,children:void 0});return r[s]=l,i.children&&(l.children=Ni(i.children,t,a,r)),l}})}function _n(e,t,n){return n===void 0&&(n="/"),Ti(e,t,n,!1)}function Ti(e,t,n,r){let i=typeof t=="string"?wn(t):t,o=nn(i.pathname||"/",n);if(o==null)return null;let a=Mu(e);Dp(a);let s=null,l=Wp(o);for(let c=0;s==null&&c<a.length;++c)s=Vp(a[c],l,r);return s}function Np(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 Mu(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("/")&&(xe(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=tn([r,l.relativePath]),u=n.concat(l);o.children&&o.children.length>0&&(xe(o.index!==!0,"Index routes must not have child routes. Please remove "+('all child routes from route path "'+c+'".')),Mu(o.children,t,u,c)),!(o.path==null&&!o.index)&&t.push({path:c,score:zp(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 ju(o.path))i(o,a,l)}),t}function ju(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=ju(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 Dp(e){e.sort((t,n)=>t.score!==n.score?n.score-t.score:$p(t.routesMeta.map(r=>r.childrenIndex),n.routesMeta.map(r=>r.childrenIndex)))}const Mp=/^:[\w-]+$/,jp=3,Fp=2,Hp=1,Bp=10,Up=-2,Zs=e=>e==="*";function zp(e,t){let n=e.split("/"),r=n.length;return n.some(Zs)&&(r+=Up),t&&(r+=Fp),n.filter(i=>!Zs(i)).reduce((i,o)=>i+(Mp.test(o)?jp:o===""?Hp:Bp),r)}function $p(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 Vp(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=Di({path:l.relativePath,caseSensitive:l.caseSensitive,end:c},u),h=l.route;if(!d&&c&&n&&!r[r.length-1].route.index&&(d=Di({path:l.relativePath,caseSensitive:l.caseSensitive,end:!1},u)),!d)return null;Object.assign(i,d.params),a.push({params:i,pathname:tn([o,d.pathname]),pathnameBase:Qp(tn([o,d.pathnameBase])),route:h}),d.pathnameBase!=="/"&&(o=tn([o,d.pathnameBase]))}return a}function Di(e,t){typeof e=="string"&&(e={path:e,caseSensitive:!1,end:!0});let[n,r]=Kp(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 Kp(e,t,n){t===void 0&&(t=!1),n===void 0&&(n=!0),Bn(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 Wp(e){try{return e.split("/").map(t=>decodeURIComponent(t).replace(/\//g,"%2F")).join("/")}catch(t){return Bn(!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 nn(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 qp=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,Gp=e=>qp.test(e);function Yp(e,t){t===void 0&&(t="/");let{pathname:n,search:r="",hash:i=""}=typeof e=="string"?wn(e):e,o;if(n)if(Gp(n))o=n;else{if(n.includes("//")){let a=n;n=Ya(n),Bn(!1,"Pathnames cannot have embedded double slashes - normalizing "+(a+" -> "+n))}n.startsWith("/")?o=el(n.substring(1),"/"):o=el(n,t)}else o=t;return{pathname:o,search:Xp(r),hash:Jp(i)}}function el(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 Po(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 Fu(e){return e.filter((t,n)=>n===0||t.route.path&&t.route.path.length>0)}function io(e,t){let n=Fu(e);return t?n.map((r,i)=>i===n.length-1?r.pathname:r.pathnameBase):n.map(r=>r.pathnameBase)}function oo(e,t,n,r){r===void 0&&(r=!1);let i;typeof e=="string"?i=wn(e):(i=He({},e),xe(!i.pathname||!i.pathname.includes("?"),Po("?","pathname","search",i)),xe(!i.pathname||!i.pathname.includes("#"),Po("#","pathname","hash",i)),xe(!i.search||!i.search.includes("#"),Po("#","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=Yp(i,s),c=a&&a!=="/"&&a.endsWith("/"),u=(o||a===".")&&n.endsWith("/");return!l.pathname.endsWith("/")&&(c||u)&&(l.pathname+="/"),l}const Ya=e=>e.replace(/\/\/+/g,"/"),tn=e=>Ya(e.join("/")),Qp=e=>e.replace(/\/+$/,"").replace(/^\/*/,"/"),Xp=e=>!e||e==="?"?"":e.startsWith("?")?e:"?"+e,Jp=e=>!e||e==="#"?"":e.startsWith("#")?e:"#"+e;class Mi{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 qr(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.internal=="boolean"&&"data"in e}const Hu=["post","put","patch","delete"],Zp=new Set(Hu),em=["get",...Hu],tm=new Set(em),nm=new Set([301,302,303,307,308]),rm=new Set([307,308]),Io={state:"idle",location:void 0,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0},im={state:"idle",data:void 0,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0},Ir={state:"unblocked",proceed:void 0,reset:void 0,location:void 0},Qa=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,om=e=>({hasErrorBoundary:!!e.hasErrorBoundary}),Bu="remix-router-transitions";function am(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;xe(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 A=e.detectErrorBoundary;i=P=>({hasErrorBoundary:A(P)})}else i=om;let o={},a=Ni(e.routes,i,void 0,o),s,l=e.basename||"/",c=e.dataStrategy||um,u=e.patchRoutesOnNavigation,d=He({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,y=null,b=e.hydrationData!=null,x=_n(a,e.history.location,l),w=!1,T=null;if(x==null&&!u){let A=dt(404,{pathname:e.history.location.pathname}),{matches:P,route:O}=dl(a);x=P,T={[O.id]:A}}x&&!e.hydrationData&&Oe(x,a,e.history.location.pathname).active&&(x=null);let I;if(x)if(x.some(A=>A.route.lazy))I=!1;else if(!x.some(A=>A.route.loader))I=!0;else if(d.v7_partialHydration){let A=e.hydrationData?e.hydrationData.loaderData:null,P=e.hydrationData?e.hydrationData.errors:null;if(P){let O=x.findIndex(M=>P[M.route.id]!==void 0);I=x.slice(0,O+1).every(M=>!sa(M.route,A,P))}else I=x.every(O=>!sa(O.route,A,P))}else I=e.hydrationData!=null;else if(I=!1,x=[],d.v7_partialHydration){let A=Oe(null,a,e.history.location.pathname);A.active&&A.matches&&(w=!0,x=A.matches)}let C,k={historyAction:e.history.action,location:e.history.location,matches:x,initialized:I,navigation:Io,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||T,fetchers:new Map,blockers:new Map},D=Ge.Pop,F=!1,R,N=!1,L=new Map,K=null,H=!1,z=!1,Y=[],Q=new Set,$=new Map,j=0,S=-1,ie=new Map,Z=new Set,E=new Map,ae=new Map,me=new Set,ve=new Map,W=new Map,fe;function Re(){if(h=e.history.listen(A=>{let{action:P,location:O,delta:M}=A;if(fe){fe(),fe=void 0;return}Bn(W.size===0||M!=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 q=Cr({currentLocation:k.location,nextLocation:O,historyAction:P});if(q&&M!=null){let re=new Promise(le=>{fe=le});e.history.go(M*-1),Rn(q,{state:"blocked",location:O,proceed(){Rn(q,{state:"proceeding",proceed:void 0,reset:void 0,location:O}),re.then(()=>e.history.go(M))},reset(){let le=new Map(k.blockers);le.set(q,Ir),pe({blockers:le})}});return}return Ze(P,O)}),n){Em(t,L);let A=()=>Cm(t,L);t.addEventListener("pagehide",A),K=()=>t.removeEventListener("pagehide",A)}return k.initialized||Ze(Ge.Pop,k.location,{initialHydration:!0}),C}function be(){h&&h(),K&&K(),f.clear(),R&&R.abort(),k.fetchers.forEach((A,P)=>Xe(P)),k.blockers.forEach((A,P)=>ct(P))}function we(A){return f.add(A),()=>f.delete(A)}function pe(A,P){P===void 0&&(P={}),k=He({},k,A);let O=[],M=[];d.v7_fetcherPersist&&k.fetchers.forEach((q,re)=>{q.state==="idle"&&(me.has(re)?M.push(re):O.push(re))}),me.forEach(q=>{!k.fetchers.has(q)&&!$.has(q)&&M.push(q)}),[...f].forEach(q=>q(k,{deletedFetchers:M,viewTransitionOpts:P.viewTransitionOpts,flushSync:P.flushSync===!0})),d.v7_fetcherPersist?(O.forEach(q=>k.fetchers.delete(q)),M.forEach(q=>Xe(q))):M.forEach(q=>me.delete(q))}function Ke(A,P,O){var M,q;let{flushSync:re}=O===void 0?{}:O,le=k.actionData!=null&&k.navigation.formMethod!=null&&Lt(k.navigation.formMethod)&&k.navigation.state==="loading"&&((M=A.state)==null?void 0:M._isRedirect)!==!0,J;P.actionData?Object.keys(P.actionData).length>0?J=P.actionData:J=null:le?J=k.actionData:J=null;let ee=P.loaderData?cl(k.loaderData,P.loaderData,P.matches||[],P.errors):k.loaderData,X=k.blockers;X.size>0&&(X=new Map(X),X.forEach((Ee,et)=>X.set(et,Ir)));let te=F===!0||k.navigation.formMethod!=null&&Lt(k.navigation.formMethod)&&((q=A.state)==null?void 0:q._isRedirect)!==!0;s&&(a=s,s=void 0),H||D===Ge.Pop||(D===Ge.Push?e.history.push(A,A.state):D===Ge.Replace&&e.history.replace(A,A.state));let ge;if(D===Ge.Pop){let Ee=L.get(k.location.pathname);Ee&&Ee.has(A.pathname)?ge={currentLocation:k.location,nextLocation:A}:L.has(A.pathname)&&(ge={currentLocation:A,nextLocation:k.location})}else if(N){let Ee=L.get(k.location.pathname);Ee?Ee.add(A.pathname):(Ee=new Set([A.pathname]),L.set(k.location.pathname,Ee)),ge={currentLocation:k.location,nextLocation:A}}pe(He({},P,{actionData:J,loaderData:ee,historyAction:D,location:A,initialized:!0,navigation:Io,revalidation:"idle",restoreScrollPosition:Pe(A,P.matches||k.matches),preventScrollReset:te,blockers:X}),{viewTransitionOpts:ge,flushSync:re===!0}),D=Ge.Pop,F=!1,N=!1,H=!1,z=!1,Y=[]}async function Qe(A,P){if(typeof A=="number"){e.history.go(A);return}let O=aa(k.location,k.matches,l,d.v7_prependBasename,A,d.v7_relativeSplatPath,P?.fromRouteId,P?.relative),{path:M,submission:q,error:re}=tl(d.v7_normalizeFormMethod,!1,O,P),le=k.location,J=Wr(k.location,M,P&&P.state);J=He({},J,e.history.encodeLocation(J));let ee=P&&P.replace!=null?P.replace:void 0,X=Ge.Push;ee===!0?X=Ge.Replace:ee===!1||q!=null&&Lt(q.formMethod)&&q.formAction===k.location.pathname+k.location.search&&(X=Ge.Replace);let te=P&&"preventScrollReset"in P?P.preventScrollReset===!0:void 0,ge=(P&&P.flushSync)===!0,Ee=Cr({currentLocation:le,nextLocation:J,historyAction:X});if(Ee){Rn(Ee,{state:"blocked",location:J,proceed(){Rn(Ee,{state:"proceeding",proceed:void 0,reset:void 0,location:J}),Qe(A,P)},reset(){let et=new Map(k.blockers);et.set(Ee,Ir),pe({blockers:et})}});return}return await Ze(X,J,{submission:q,pendingError:re,preventScrollReset:te,replace:P&&P.replace,enableViewTransition:P&&P.viewTransition,flushSync:ge})}function Mt(){if(U(),pe({revalidation:"loading"}),k.navigation.state!=="submitting"){if(k.navigation.state==="idle"){Ze(k.historyAction,k.location,{startUninterruptedRevalidation:!0});return}Ze(D||k.historyAction,k.navigation.location,{overrideNavigation:k.navigation,enableViewTransition:N===!0})}}async function Ze(A,P,O){R&&R.abort(),R=null,D=A,H=(O&&O.startUninterruptedRevalidation)===!0,ce(k.location,k.matches),F=(O&&O.preventScrollReset)===!0,N=(O&&O.enableViewTransition)===!0;let M=s||a,q=O&&O.overrideNavigation,re=O!=null&&O.initialHydration&&k.matches&&k.matches.length>0&&!w?k.matches:_n(M,P,l),le=(O&&O.flushSync)===!0;if(re&&k.initialized&&!z&&gm(k.location,P)&&!(O&&O.submission&&Lt(O.submission.formMethod))){Ke(P,{matches:re},{flushSync:le});return}let J=Oe(re,M,P.pathname);if(J.active&&J.matches&&(re=J.matches),!re){let{error:Me,notFoundMatches:Ie,route:$e}=Ar(P.pathname);Ke(P,{matches:Ie,loaderData:{},errors:{[$e.id]:Me}},{flushSync:le});return}R=new AbortController;let ee=er(e.history,P,R.signal,O&&O.submission),X;if(O&&O.pendingError)X=[Nn(re).route.id,{type:_e.error,error:O.pendingError}];else if(O&&O.submission&&Lt(O.submission.formMethod)){let Me=await jt(ee,P,O.submission,re,J.active,{replace:O.replace,flushSync:le});if(Me.shortCircuited)return;if(Me.pendingActionResult){let[Ie,$e]=Me.pendingActionResult;if(yt($e)&&qr($e.error)&&$e.error.status===404){R=null,Ke(P,{matches:Me.matches,loaderData:{},errors:{[Ie]:$e.error}});return}}re=Me.matches||re,X=Me.pendingActionResult,q=Lo(P,O.submission),le=!1,J.active=!1,ee=er(e.history,ee.url,ee.signal)}let{shortCircuited:te,matches:ge,loaderData:Ee,errors:et}=await Cn(ee,P,re,J.active,q,O&&O.submission,O&&O.fetcherSubmission,O&&O.replace,O&&O.initialHydration===!0,le,X);te||(R=null,Ke(P,He({matches:ge||re},ul(X),{loaderData:Ee,errors:et})))}async function jt(A,P,O,M,q,re){re===void 0&&(re={}),U();let le=km(P,O);if(pe({navigation:le},{flushSync:re.flushSync===!0}),q){let X=await rt(M,P.pathname,A.signal);if(X.type==="aborted")return{shortCircuited:!0};if(X.type==="error"){let te=Nn(X.partialMatches).route.id;return{matches:X.partialMatches,pendingActionResult:[te,{type:_e.error,error:X.error}]}}else if(X.matches)M=X.matches;else{let{notFoundMatches:te,error:ge,route:Ee}=Ar(P.pathname);return{matches:te,pendingActionResult:[Ee.id,{type:_e.error,error:ge}]}}}let J,ee=Br(M,P);if(!ee.route.action&&!ee.route.lazy)J={type:_e.error,error:dt(405,{method:A.method,pathname:P.pathname,routeId:ee.route.id})};else if(J=(await Xt("action",k,A,[ee],M,null))[ee.route.id],A.signal.aborted)return{shortCircuited:!0};if(jn(J)){let X;return re&&re.replace!=null?X=re.replace:X=al(J.response.headers.get("Location"),new URL(A.url),l,e.history)===k.location.pathname+k.location.search,await Tt(A,J,!0,{submission:O,replace:X}),{shortCircuited:!0}}if(gn(J))throw dt(400,{type:"defer-action"});if(yt(J)){let X=Nn(M,ee.route.id);return(re&&re.replace)!==!0&&(D=Ge.Push),{matches:M,pendingActionResult:[X.route.id,J]}}return{matches:M,pendingActionResult:[ee.route.id,J]}}async function Cn(A,P,O,M,q,re,le,J,ee,X,te){let ge=q||Lo(P,re),Ee=re||le||hl(ge),et=!H&&(!d.v7_partialHydration||!ee);if(M){if(et){let Ve=An(te);pe(He({navigation:ge},Ve!==void 0?{actionData:Ve}:{}),{flushSync:X})}let Te=await rt(O,P.pathname,A.signal);if(Te.type==="aborted")return{shortCircuited:!0};if(Te.type==="error"){let Ve=Nn(Te.partialMatches).route.id;return{matches:Te.partialMatches,loaderData:{},errors:{[Ve]:Te.error}}}else if(Te.matches)O=Te.matches;else{let{error:Ve,notFoundMatches:Jn,route:Pr}=Ar(P.pathname);return{matches:Jn,loaderData:{},errors:{[Pr.id]:Ve}}}}let Me=s||a,[Ie,$e]=rl(e.history,k,O,Ee,P,d.v7_partialHydration&&ee===!0,d.v7_skipActionErrorRevalidation,z,Y,Q,me,E,Z,Me,l,te);if(Pn(Te=>!(O&&O.some(Ve=>Ve.route.id===Te))||Ie&&Ie.some(Ve=>Ve.route.id===Te)),S=++j,Ie.length===0&&$e.length===0){let Te=Rt();return Ke(P,He({matches:O,loaderData:{},errors:te&&yt(te[1])?{[te[0]]:te[1].error}:null},ul(te),Te?{fetchers:new Map(k.fetchers)}:{}),{flushSync:X}),{shortCircuited:!0}}if(et){let Te={};if(!M){Te.navigation=ge;let Ve=An(te);Ve!==void 0&&(Te.actionData=Ve)}$e.length>0&&(Te.fetchers=Tn($e)),pe(Te,{flushSync:X})}$e.forEach(Te=>{ze(Te.key),Te.controller&&$.set(Te.key,Te.controller)});let Xn=()=>$e.forEach(Te=>ze(Te.key));R&&R.signal.addEventListener("abort",Xn);let{loaderResults:Tr,fetcherResults:Jt}=await _(k,O,Ie,$e,A);if(A.signal.aborted)return{shortCircuited:!0};R&&R.signal.removeEventListener("abort",Xn),$e.forEach(Te=>$.delete(Te.key));let Ut=ui(Tr);if(Ut)return await Tt(A,Ut.result,!0,{replace:J}),{shortCircuited:!0};if(Ut=ui(Jt),Ut)return Z.add(Ut.key),await Tt(A,Ut.result,!0,{replace:J}),{shortCircuited:!0};let{loaderData:Ro,errors:Rr}=ll(k,O,Tr,te,$e,Jt,ve);ve.forEach((Te,Ve)=>{Te.subscribe(Jn=>{(Jn||Te.done)&&ve.delete(Ve)})}),d.v7_partialHydration&&ee&&k.errors&&(Rr=He({},k.errors,Rr));let In=Rt(),li=Be(S),ci=In||li||$e.length>0;return He({matches:O,loaderData:Ro,errors:Rr},ci?{fetchers:new Map(k.fetchers)}:{})}function An(A){if(A&&!yt(A[1]))return{[A[0]]:A[1].data};if(k.actionData)return Object.keys(k.actionData).length===0?null:k.actionData}function Tn(A){return A.forEach(P=>{let O=k.fetchers.get(P.key),M=Lr(void 0,O?O.data:void 0);k.fetchers.set(P.key,M)}),new Map(k.fetchers)}function Qt(A,P,O,M){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.");ze(A);let q=(M&&M.flushSync)===!0,re=s||a,le=aa(k.location,k.matches,l,d.v7_prependBasename,O,d.v7_relativeSplatPath,P,M?.relative),J=_n(re,le,l),ee=Oe(J,re,le);if(ee.active&&ee.matches&&(J=ee.matches),!J){se(A,P,dt(404,{pathname:le}),{flushSync:q});return}let{path:X,submission:te,error:ge}=tl(d.v7_normalizeFormMethod,!0,le,M);if(ge){se(A,P,ge,{flushSync:q});return}let Ee=Br(J,X),et=(M&&M.preventScrollReset)===!0;if(te&&Lt(te.formMethod)){Qn(A,P,X,Ee,J,ee.active,q,et,te);return}E.set(A,{routeId:P,path:X}),At(A,P,X,Ee,J,ee.active,q,et,te)}async function Qn(A,P,O,M,q,re,le,J,ee){U(),E.delete(A);function X(We){if(!We.route.action&&!We.route.lazy){let Zn=dt(405,{method:ee.formMethod,pathname:O,routeId:P});return se(A,P,Zn,{flushSync:le}),!0}return!1}if(!re&&X(M))return;let te=k.fetchers.get(A);ne(A,Sm(ee,te),{flushSync:le});let ge=new AbortController,Ee=er(e.history,O,ge.signal,ee);if(re){let We=await rt(q,new URL(Ee.url).pathname,Ee.signal,A);if(We.type==="aborted")return;if(We.type==="error"){se(A,P,We.error,{flushSync:le});return}else if(We.matches){if(q=We.matches,M=Br(q,O),X(M))return}else{se(A,P,dt(404,{pathname:O}),{flushSync:le});return}}$.set(A,ge);let et=j,Ie=(await Xt("action",k,Ee,[M],q,A))[M.route.id];if(Ee.signal.aborted){$.get(A)===ge&&$.delete(A);return}if(d.v7_fetcherPersist&&me.has(A)){if(jn(Ie)||yt(Ie)){ne(A,pn(void 0));return}}else{if(jn(Ie))if($.delete(A),S>et){ne(A,pn(void 0));return}else return Z.add(A),ne(A,Lr(ee)),Tt(Ee,Ie,!1,{fetcherSubmission:ee,preventScrollReset:J});if(yt(Ie)){se(A,P,Ie.error);return}}if(gn(Ie))throw dt(400,{type:"defer-action"});let $e=k.navigation.location||k.location,Xn=er(e.history,$e,ge.signal),Tr=s||a,Jt=k.navigation.state!=="idle"?_n(Tr,k.navigation.location,l):k.matches;xe(Jt,"Didn't find any matches after fetcher action");let Ut=++j;ie.set(A,Ut);let Ro=Lr(ee,Ie.data);k.fetchers.set(A,Ro);let[Rr,In]=rl(e.history,k,Jt,ee,$e,!1,d.v7_skipActionErrorRevalidation,z,Y,Q,me,E,Z,Tr,l,[M.route.id,Ie]);In.filter(We=>We.key!==A).forEach(We=>{let Zn=We.key,Gs=k.fetchers.get(Zn),vp=Lr(void 0,Gs?Gs.data:void 0);k.fetchers.set(Zn,vp),ze(Zn),We.controller&&$.set(Zn,We.controller)}),pe({fetchers:new Map(k.fetchers)});let li=()=>In.forEach(We=>ze(We.key));ge.signal.addEventListener("abort",li);let{loaderResults:ci,fetcherResults:Te}=await _(k,Jt,Rr,In,Xn);if(ge.signal.aborted)return;ge.signal.removeEventListener("abort",li),ie.delete(A),$.delete(A),In.forEach(We=>$.delete(We.key));let Ve=ui(ci);if(Ve)return Tt(Xn,Ve.result,!1,{preventScrollReset:J});if(Ve=ui(Te),Ve)return Z.add(Ve.key),Tt(Xn,Ve.result,!1,{preventScrollReset:J});let{loaderData:Jn,errors:Pr}=ll(k,Jt,ci,void 0,In,Te,ve);if(k.fetchers.has(A)){let We=pn(Ie.data);k.fetchers.set(A,We)}Be(Ut),k.navigation.state==="loading"&&Ut>S?(xe(D,"Expected pending action"),R&&R.abort(),Ke(k.navigation.location,{matches:Jt,loaderData:Jn,errors:Pr,fetchers:new Map(k.fetchers)})):(pe({errors:Pr,loaderData:cl(k.loaderData,Jn,Jt,Pr),fetchers:new Map(k.fetchers)}),z=!1)}async function At(A,P,O,M,q,re,le,J,ee){let X=k.fetchers.get(A);ne(A,Lr(ee,X?X.data:void 0),{flushSync:le});let te=new AbortController,ge=er(e.history,O,te.signal);if(re){let Ie=await rt(q,new URL(ge.url).pathname,ge.signal,A);if(Ie.type==="aborted")return;if(Ie.type==="error"){se(A,P,Ie.error,{flushSync:le});return}else if(Ie.matches)q=Ie.matches,M=Br(q,O);else{se(A,P,dt(404,{pathname:O}),{flushSync:le});return}}$.set(A,te);let Ee=j,Me=(await Xt("loader",k,ge,[M],q,A))[M.route.id];if(gn(Me)&&(Me=await Xa(Me,ge.signal,!0)||Me),$.get(A)===te&&$.delete(A),!ge.signal.aborted){if(me.has(A)){ne(A,pn(void 0));return}if(jn(Me))if(S>Ee){ne(A,pn(void 0));return}else{Z.add(A),await Tt(ge,Me,!1,{preventScrollReset:J});return}if(yt(Me)){se(A,P,Me.error);return}xe(!gn(Me),"Unhandled fetcher deferred data"),ne(A,pn(Me.data))}}async function Tt(A,P,O,M){let{submission:q,fetcherSubmission:re,preventScrollReset:le,replace:J}=M===void 0?{}:M;P.response.headers.has("X-Remix-Revalidate")&&(z=!0);let ee=P.response.headers.get("Location");xe(ee,"Expected a Location header on the redirect Response"),ee=al(ee,new URL(A.url),l,e.history);let X=Wr(k.location,ee,{_isRedirect:!0});if(n){let Ie=!1;if(P.response.headers.has("X-Remix-Reload-Document"))Ie=!0;else if(Qa.test(ee)){const $e=e.history.createURL(ee);Ie=$e.origin!==t.location.origin||nn($e.pathname,l)==null}if(Ie){J?t.location.replace(ee):t.location.assign(ee);return}}R=null;let te=J===!0||P.response.headers.has("X-Remix-Replace")?Ge.Replace:Ge.Push,{formMethod:ge,formAction:Ee,formEncType:et}=k.navigation;!q&&!re&&ge&&Ee&&et&&(q=hl(k.navigation));let Me=q||re;if(rm.has(P.response.status)&&Me&&Lt(Me.formMethod))await Ze(te,X,{submission:He({},Me,{formAction:ee}),preventScrollReset:le||F,enableViewTransition:O?N:void 0});else{let Ie=Lo(X,q);await Ze(te,X,{overrideNavigation:Ie,fetcherSubmission:re,preventScrollReset:le||F,enableViewTransition:O?N:void 0})}}async function Xt(A,P,O,M,q,re){let le,J={};try{le=await dm(c,A,P,O,M,q,re,o,i)}catch(ee){return M.forEach(X=>{J[X.route.id]={type:_e.error,error:ee}}),J}for(let[ee,X]of Object.entries(le))if(ym(X)){let te=X.result;J[ee]={type:_e.redirect,response:pm(te,O,ee,q,l,d.v7_relativeSplatPath)}}else J[ee]=await hm(X);return J}async function _(A,P,O,M,q){let re=A.matches,le=Xt("loader",A,q,O,P,null),J=Promise.all(M.map(async te=>{if(te.matches&&te.match&&te.controller){let Ee=(await Xt("loader",A,er(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:_e.error,error:dt(404,{pathname:te.path})}})})),ee=await le,X=(await J).reduce((te,ge)=>Object.assign(te,ge),{});return await Promise.all([xm(P,ee,q.signal,re,A.loaderData),wm(P,X,M)]),{loaderResults:ee,fetcherResults:X}}function U(){z=!0,Y.push(...Pn()),E.forEach((A,P)=>{$.has(P)&&Q.add(P),ze(P)})}function ne(A,P,O){O===void 0&&(O={}),k.fetchers.set(A,P),pe({fetchers:new Map(k.fetchers)},{flushSync:(O&&O.flushSync)===!0})}function se(A,P,O,M){M===void 0&&(M={});let q=Nn(k.matches,P);Xe(A),pe({errors:{[q.route.id]:O},fetchers:new Map(k.fetchers)},{flushSync:(M&&M.flushSync)===!0})}function Se(A){return ae.set(A,(ae.get(A)||0)+1),me.has(A)&&me.delete(A),k.fetchers.get(A)||im}function Xe(A){let P=k.fetchers.get(A);$.has(A)&&!(P&&P.state==="loading"&&ie.has(A))&&ze(A),E.delete(A),ie.delete(A),Z.delete(A),d.v7_fetcherPersist&&me.delete(A),Q.delete(A),k.fetchers.delete(A)}function St(A){let P=(ae.get(A)||0)-1;P<=0?(ae.delete(A),me.add(A),d.v7_fetcherPersist||Xe(A)):ae.set(A,P),pe({fetchers:new Map(k.fetchers)})}function ze(A){let P=$.get(A);P&&(P.abort(),$.delete(A))}function at(A){for(let P of A){let O=Se(P),M=pn(O.data);k.fetchers.set(P,M)}}function Rt(){let A=[],P=!1;for(let O of Z){let M=k.fetchers.get(O);xe(M,"Expected fetcher: "+O),M.state==="loading"&&(Z.delete(O),A.push(O),P=!0)}return at(A),P}function Be(A){let P=[];for(let[O,M]of ie)if(M<A){let q=k.fetchers.get(O);xe(q,"Expected fetcher: "+O),q.state==="loading"&&(ze(O),ie.delete(O),P.push(O))}return at(P),P.length>0}function Ft(A,P){let O=k.blockers.get(A)||Ir;return W.get(A)!==P&&W.set(A,P),O}function ct(A){k.blockers.delete(A),W.delete(A)}function Rn(A,P){let O=k.blockers.get(A)||Ir;xe(O.state==="unblocked"&&P.state==="blocked"||O.state==="blocked"&&P.state==="blocked"||O.state==="blocked"&&P.state==="proceeding"||O.state==="blocked"&&P.state==="unblocked"||O.state==="proceeding"&&P.state==="unblocked","Invalid blocker state transition: "+O.state+" -> "+P.state);let M=new Map(k.blockers);M.set(A,P),pe({blockers:M})}function Cr(A){let{currentLocation:P,nextLocation:O,historyAction:M}=A;if(W.size===0)return;W.size>1&&Bn(!1,"A router only supports one blocker at a time");let q=Array.from(W.entries()),[re,le]=q[q.length-1],J=k.blockers.get(re);if(!(J&&J.state==="proceeding")&&le({currentLocation:P,nextLocation:O,historyAction:M}))return re}function Ar(A){let P=dt(404,{pathname:A}),O=s||a,{matches:M,route:q}=dl(O);return Pn(),{notFoundMatches:M,route:q,error:P}}function Pn(A){let P=[];return ve.forEach((O,M)=>{(!A||A(M))&&(O.cancel(),P.push(M),ve.delete(M))}),P}function Ht(A,P,O){if(m=A,y=P,p=O||null,!b&&k.navigation===Io){b=!0;let M=Pe(k.location,k.matches);M!=null&&pe({restoreScrollPosition:M})}return()=>{m=null,y=null,p=null}}function si(A,P){return p&&p(A,P.map(M=>Np(M,k.loaderData)))||A.key}function ce(A,P){if(m&&y){let O=si(A,P);m[O]=y()}}function Pe(A,P){if(m){let O=si(A,P),M=m[O];if(typeof M=="number")return M}return null}function Oe(A,P,O){if(u)if(A){if(Object.keys(A[0].params).length>0)return{active:!0,matches:Ti(P,O,l,!0)}}else return{active:!0,matches:Ti(P,O,l,!0)||[]};return{active:!1,matches:null}}async function rt(A,P,O,M){if(!u)return{type:"success",matches:A};let q=A;for(;;){let re=s==null,le=s||a,J=o;try{await u({signal:O,path:P,matches:q,fetcherKey:M,patch:(te,ge)=>{O.aborted||ol(te,ge,le,J,i)}})}catch(te){return{type:"error",error:te,partialMatches:q}}finally{re&&!O.aborted&&(a=[...a])}if(O.aborted)return{type:"aborted"};let ee=_n(le,P,l);if(ee)return{type:"success",matches:ee};let X=Ti(le,P,l,!0);if(!X||q.length===X.length&&q.every((te,ge)=>te.route.id===X[ge].route.id))return{type:"success",matches:null};q=X}}function mt(A){o={},s=Ni(A,i,void 0,o)}function Bt(A,P){let O=s==null;ol(A,P,s||a,o,i),O&&(a=[...a],pe({}))}return C={get basename(){return l},get future(){return d},get state(){return k},get routes(){return a},get window(){return t},initialize:Re,subscribe:we,enableScrollRestoration:Ht,navigate:Qe,fetch:Qt,revalidate:Mt,createHref:A=>e.history.createHref(A),encodeLocation:A=>e.history.encodeLocation(A),getFetcher:Se,deleteFetcher:St,dispose:be,getBlocker:Ft,deleteBlocker:ct,patchRoutes:Bt,_internalFetchControllers:$,_internalActiveDeferreds:ve,_internalSetRoutes:mt},C}function sm(e){return e!=null&&("formData"in e&&e.formData!=null||"body"in e&&e.body!==void 0)}function aa(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=oo(i||".",io(l,o),nn(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=Ja(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:tn([n,u.pathname])),Un(u)}function tl(e,t,n,r){if(!r||!sm(r))return{path:n};if(r.formMethod&&!bm(r.formMethod))return{path:n,error:dt(405,{method:r.formMethod})};let i=()=>({path:n,error:dt(400,{type:"invalid-body"})}),o=r.formMethod||"get",a=e?o.toUpperCase():o.toLowerCase(),s=$u(n);if(r.body!==void 0){if(r.formEncType==="text/plain"){if(!Lt(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,y]=m;return""+f+p+"="+y+`
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(!Lt(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()}}}xe(typeof FormData=="function","FormData is not available in this environment");let l,c;if(r.formData)l=la(r.formData),c=r.formData;else if(r.body instanceof FormData)l=la(r.body),c=r.body;else if(r.body instanceof URLSearchParams)l=r.body,c=sl(l);else if(r.body==null)l=new URLSearchParams,c=new FormData;else try{l=new URLSearchParams(r.body),c=sl(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(Lt(u.formMethod))return{path:n,submission:u};let d=wn(n);return t&&d.search&&Ja(d.search)&&l.append("index",""),d.search="?"+l,{path:Un(d),submission:u}}function nl(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 rl(e,t,n,r,i,o,a,s,l,c,u,d,h,f,m,p){let y=p?yt(p[1])?p[1].error:p[1].data:void 0,b=e.createURL(t.location),x=e.createURL(i),w=n;o&&t.errors?w=nl(n,Object.keys(t.errors)[0],!0):p&&yt(p[1])&&(w=nl(n,p[0]));let T=p?p[1].statusCode:void 0,I=a&&T&&T>=400,C=w.filter((D,F)=>{let{route:R}=D;if(R.lazy)return!0;if(R.loader==null)return!1;if(o)return sa(R,t.loaderData,t.errors);if(lm(t.loaderData,t.matches[F],D)||l.some(K=>K===D.route.id))return!0;let N=t.matches[F],L=D;return il(D,He({currentUrl:b,currentParams:N.params,nextUrl:x,nextParams:L.params},r,{actionResult:y,actionStatus:T,defaultShouldRevalidate:I?!1:s||b.pathname+b.search===x.pathname+x.search||b.search!==x.search||Uu(N,L)}))}),k=[];return d.forEach((D,F)=>{if(o||!n.some(H=>H.route.id===D.routeId)||u.has(F))return;let R=_n(f,D.path,m);if(!R){k.push({key:F,routeId:D.routeId,path:D.path,matches:null,match:null,controller:null});return}let N=t.fetchers.get(F),L=Br(R,D.path),K=!1;h.has(F)?K=!1:c.has(F)?(c.delete(F),K=!0):N&&N.state!=="idle"&&N.data===void 0?K=s:K=il(L,He({currentUrl:b,currentParams:t.matches[t.matches.length-1].params,nextUrl:x,nextParams:n[n.length-1].params},r,{actionResult:y,actionStatus:T,defaultShouldRevalidate:I?!1:s})),K&&k.push({key:F,routeId:D.routeId,path:D.path,matches:R,match:L,controller:new AbortController})}),[C,k]}function sa(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 lm(e,t,n){let r=!t||n.route.id!==t.route.id,i=e[n.route.id]===void 0;return r||i}function Uu(e,t){let n=e.route.path;return e.pathname!==t.pathname||n!=null&&n.endsWith("*")&&e.params["*"]!==t.params["*"]}function il(e,t){if(e.route.shouldRevalidate){let n=e.route.shouldRevalidate(t);if(typeof n=="boolean")return n}return t.defaultShouldRevalidate}function ol(e,t,n,r,i){var o;let a;if(e){let c=r[e];xe(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=>zu(c,u))),l=Ni(s,i,[e||"_","patch",String(((o=a)==null?void 0:o.length)||"0")],r);a.push(...l)}function zu(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=>zu(n,o))}):!1}async function cm(e,t,n){if(!e.lazy)return;let r=await e.lazy();if(!e.lazy)return;let i=n[e.id];xe(i,"No route found in manifest");let o={};for(let a in r){let l=i[a]!==void 0&&a!=="hasErrorBoundary";Bn(!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&&!Op.has(a)&&(o[a]=r[a])}Object.assign(i,o),Object.assign(i,He({},t(i),{lazy:void 0}))}async function um(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 dm(e,t,n,r,i,o,a,s,l,c){let u=o.map(f=>f.route.lazy?cm(f.route,l,s):void 0),d=o.map((f,m)=>{let p=u[m],y=i.some(x=>x.route.id===f.route.id);return He({},f,{shouldLoad:y,resolve:async x=>(x&&r.method==="GET"&&(f.route.lazy||f.route.loader)&&(y=!0),y?fm(t,r,f,p,x,c):Promise.resolve({type:_e.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 fm(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 dt(405,{method:t.method,pathname:d,routeId:n.route.id})}else return{type:_e.data,result:void 0};else if(c)a=await l(c);else{let u=new URL(t.url),d=u.pathname+u.search;throw dt(404,{pathname:d})}xe(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:_e.error,result:c}}finally{s&&t.signal.removeEventListener("abort",s)}return a}async function hm(e){let{result:t,type:n}=e;if(Vu(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:_e.error,error:h}}return n===_e.error?{type:_e.error,error:new Mi(t.status,t.statusText,d),statusCode:t.status,headers:t.headers}:{type:_e.data,data:d,statusCode:t.status,headers:t.headers}}if(n===_e.error){if(fl(t)){var r,i;if(t.data instanceof Error){var o,a;return{type:_e.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:_e.error,error:new Mi(((r=t.init)==null?void 0:r.status)||500,void 0,t.data),statusCode:qr(t)?t.status:void 0,headers:(i=t.init)!=null&&i.headers?new Headers(t.init.headers):void 0}}return{type:_e.error,error:t,statusCode:qr(t)?t.status:void 0}}if(vm(t)){var s,l;return{type:_e.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(fl(t)){var c,u;return{type:_e.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:_e.data,data:t}}function pm(e,t,n,r,i,o){let a=e.headers.get("Location");if(xe(a,"Redirects returned/thrown from loaders/actions must have a Location header"),!Qa.test(a)){let s=r.slice(0,r.findIndex(l=>l.route.id===n)+1);a=aa(new URL(t.url),s,i,!0,a,o),e.headers.set("Location",a)}return e}function al(e,t,n,r){let i=["about:","blob:","chrome:","chrome-untrusted:","content:","data:","devtools:","file:","filesystem:","javascript:"];if(Qa.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=nn(a.pathname,n)!=null;if(a.origin===t.origin&&s)return Ya(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 er(e,t,n,r){let i=e.createURL($u(t)).toString(),o={signal:n};if(r&&Lt(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=la(r.formData):o.body=r.formData}return new Request(i,o)}function la(e){let t=new URLSearchParams;for(let[n,r]of e.entries())t.append(n,typeof r=="string"?r:r.name);return t}function sl(e){let t=new FormData;for(let[n,r]of e.entries())t.append(n,r);return t}function mm(e,t,n,r,i){let o={},a=null,s,l=!1,c={},u=n&&yt(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(xe(!jn(f),"Cannot handle redirect results in processLoaderData"),yt(f)){let m=f.error;u!==void 0&&(m=u,u=void 0),a=a||{};{let p=Nn(e,h);a[p.route.id]==null&&(a[p.route.id]=m)}o[h]=void 0,l||(l=!0,s=qr(f.error)?f.error.status:500),f.headers&&(c[h]=f.headers)}else gn(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 ll(e,t,n,r,i,o,a){let{loaderData:s,errors:l}=mm(t,n,r,a);return i.forEach(c=>{let{key:u,match:d,controller:h}=c,f=o[u];if(xe(f,"Did not find corresponding fetcher result"),!(h&&h.signal.aborted))if(yt(f)){let m=Nn(e.matches,d?.route.id);l&&l[m.route.id]||(l=He({},l,{[m.route.id]:f.error})),e.fetchers.delete(u)}else if(jn(f))xe(!1,"Unhandled fetcher revalidation redirect");else if(gn(f))xe(!1,"Unhandled fetcher deferred data");else{let m=pn(f.data);e.fetchers.set(u,m)}}),{loaderData:s,errors:l}}function cl(e,t,n,r){let i=He({},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 ul(e){return e?yt(e[1])?{actionData:{}}:{actionData:{[e[0]]:e[1].data}}:{}}function Nn(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 dl(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 dt(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 Mi(e||500,s,new Error(l),!0)}function ui(e){let t=Object.entries(e);for(let n=t.length-1;n>=0;n--){let[r,i]=t[n];if(jn(i))return{key:r,result:i}}}function $u(e){let t=typeof e=="string"?wn(e):e;return Un(He({},t,{hash:""}))}function gm(e,t){return e.pathname!==t.pathname||e.search!==t.search?!1:e.hash===""?t.hash!=="":e.hash===t.hash?!0:t.hash!==""}function ym(e){return Vu(e.result)&&nm.has(e.result.status)}function gn(e){return e.type===_e.deferred}function yt(e){return e.type===_e.error}function jn(e){return(e&&e.type)===_e.redirect}function fl(e){return typeof e=="object"&&e!=null&&"type"in e&&"data"in e&&"init"in e&&e.type==="DataWithResponseInit"}function vm(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 Vu(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.headers=="object"&&typeof e.body<"u"}function bm(e){return tm.has(e.toLowerCase())}function Lt(e){return Zp.has(e.toLowerCase())}async function xm(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&&!Uu(u,c)&&(i&&i[c.route.id])!==void 0;gn(l)&&d&&await Xa(l,n,!1).then(h=>{h&&(t[s]=h)})}}async function wm(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)&&gn(s)&&(xe(a,"Expected an AbortController for revalidating fetcher deferred result"),await Xa(s,a.signal,!0).then(c=>{c&&(t[i]=c)}))}}async function Xa(e,t,n){if(n===void 0&&(n=!1),!await e.deferredData.resolveData(t)){if(n)try{return{type:_e.data,data:e.deferredData.unwrappedData}}catch(i){return{type:_e.error,error:i}}return{type:_e.data,data:e.deferredData.data}}}function Ja(e){return new URLSearchParams(e).getAll("index").some(t=>t==="")}function Br(e,t){let n=typeof t=="string"?wn(t).search:t.search;if(e[e.length-1].route.index&&Ja(n||""))return e[e.length-1];let r=Fu(e);return r[r.length-1]}function hl(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 Lo(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 km(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 Lr(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 Sm(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 pn(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 Em(e,t){try{let n=e.sessionStorage.getItem(Bu);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 Cm(e,t){if(t.size>0){let n={};for(let[r,i]of t)n[r]=[...i];try{e.sessionStorage.setItem(Bu,JSON.stringify(n))}catch(r){Bn(!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 ji(){return ji=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},ji.apply(null,arguments)}const ti=g.createContext(null),Za=g.createContext(null),an=g.createContext(null),es=g.createContext(null),sn=g.createContext({outlet:null,matches:[],isDataRoute:!1}),Ku=g.createContext(null);function Am(e,t){let{relative:n}=t===void 0?{}:t;br()||xe(!1);let{basename:r,navigator:i}=g.useContext(an),{hash:o,pathname:a,search:s}=so(e,{relative:n}),l=a;return r!=="/"&&(l=a==="/"?r:tn([r,a])),i.createHref({pathname:l,search:s,hash:o})}function br(){return g.useContext(es)!=null}function ln(){return br()||xe(!1),g.useContext(es).location}function Wu(e){g.useContext(an).static||g.useLayoutEffect(e)}function ao(){let{isDataRoute:e}=g.useContext(sn);return e?Bm():Tm()}function Tm(){br()||xe(!1);let e=g.useContext(ti),{basename:t,future:n,navigator:r}=g.useContext(an),{matches:i}=g.useContext(sn),{pathname:o}=ln(),a=JSON.stringify(io(i,n.v7_relativeSplatPath)),s=g.useRef(!1);return Wu(()=>{s.current=!0}),g.useCallback(function(c,u){if(u===void 0&&(u={}),!s.current)return;if(typeof c=="number"){r.go(c);return}let d=oo(c,JSON.parse(a),o,u.relative==="path");e==null&&t!=="/"&&(d.pathname=d.pathname==="/"?t:tn([t,d.pathname])),(u.replace?r.replace:r.push)(d,u.state,u)},[t,r,a,o,e])}const Rm=g.createContext(null);function Pm(e){let t=g.useContext(sn).outlet;return t&&g.createElement(Rm.Provider,{value:e},t)}function so(e,t){let{relative:n}=t===void 0?{}:t,{future:r}=g.useContext(an),{matches:i}=g.useContext(sn),{pathname:o}=ln(),a=JSON.stringify(io(i,r.v7_relativeSplatPath));return g.useMemo(()=>oo(e,JSON.parse(a),o,n==="path"),[e,a,o,n])}function Im(e,t,n,r){br()||xe(!1);let{navigator:i}=g.useContext(an),{matches:o}=g.useContext(sn),a=o[o.length-1],s=a?a.params:{};a&&a.pathname;let l=a?a.pathnameBase:"/";a&&a.route;let c=ln(),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=_n(e,{pathname:h});return Dm(f&&f.map(p=>Object.assign({},p,{params:Object.assign({},s,p.params),pathname:tn([l,i.encodeLocation?i.encodeLocation(p.pathname).pathname:p.pathname]),pathnameBase:p.pathnameBase==="/"?l:tn([l,i.encodeLocation?i.encodeLocation(p.pathnameBase).pathname:p.pathnameBase])})),o,n,r)}function Lm(){let e=Hm(),t=qr(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 g.createElement(g.Fragment,null,g.createElement("h2",null,"Unexpected Application Error!"),g.createElement("h3",{style:{fontStyle:"italic"}},t),n?g.createElement("pre",{style:i},n):null,null)}const Om=g.createElement(Lm,null);class _m extends g.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?g.createElement(sn.Provider,{value:this.props.routeContext},g.createElement(Ku.Provider,{value:this.state.error,children:this.props.component})):this.props.children}}function Nm(e){let{routeContext:t,match:n,children:r}=e,i=g.useContext(ti);return i&&i.static&&i.staticContext&&(n.route.errorElement||n.route.ErrorBoundary)&&(i.staticContext._deepestRenderedBoundaryId=n.route.id),g.createElement(sn.Provider,{value:t},r)}function Dm(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||xe(!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,y=null;n&&(f=s&&d.route.id?s[d.route.id]:void 0,p=d.route.errorElement||Om,l&&(c<0&&h===0?(Um("route-fallback"),m=!0,y=null):c===h&&(m=!0,y=d.route.hydrateFallbackElement||null)));let b=t.concat(a.slice(0,h+1)),x=()=>{let w;return f?w=p:m?w=y:d.route.Component?w=g.createElement(d.route.Component,null):d.route.element?w=d.route.element:w=u,g.createElement(Nm,{match:d,routeContext:{outlet:u,matches:b,isDataRoute:n!=null},children:w})};return n&&(d.route.ErrorBoundary||d.route.errorElement||h===0)?g.createElement(_m,{location:n.location,revalidation:n.revalidation,component:p,error:f,children:x(),routeContext:{outlet:null,matches:b,isDataRoute:!0}}):x()},null)}var qu=function(e){return e.UseBlocker="useBlocker",e.UseRevalidator="useRevalidator",e.UseNavigateStable="useNavigate",e}(qu||{}),Gu=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}(Gu||{});function Mm(e){let t=g.useContext(ti);return t||xe(!1),t}function jm(e){let t=g.useContext(Za);return t||xe(!1),t}function Fm(e){let t=g.useContext(sn);return t||xe(!1),t}function Yu(e){let t=Fm(),n=t.matches[t.matches.length-1];return n.route.id||xe(!1),n.route.id}function Hm(){var e;let t=g.useContext(Ku),n=jm(),r=Yu();return t!==void 0?t:(e=n.errors)==null?void 0:e[r]}function Bm(){let{router:e}=Mm(qu.UseNavigateStable),t=Yu(Gu.UseNavigateStable),n=g.useRef(!1);return Wu(()=>{n.current=!0}),g.useCallback(function(i,o){o===void 0&&(o={}),n.current&&(typeof i=="number"?e.navigate(i):e.navigate(i,ji({fromRouteId:t},o)))},[e,t])}const pl={};function Um(e,t,n){pl[e]||(pl[e]=!0)}function zm(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 zt(e){let{to:t,replace:n,state:r,relative:i}=e;br()||xe(!1);let{future:o,static:a}=g.useContext(an),{matches:s}=g.useContext(sn),{pathname:l}=ln(),c=ao(),u=oo(t,io(s,o.v7_relativeSplatPath),l,i==="path"),d=JSON.stringify(u);return g.useEffect(()=>c(JSON.parse(d),{replace:n,state:r,relative:i}),[c,d,i,n,r]),null}function sN(e){return Pm(e.context)}function $m(e){let{basename:t="/",children:n=null,location:r,navigationType:i=Ge.Pop,navigator:o,static:a=!1,future:s}=e;br()&&xe(!1);let l=t.replace(/^\/*/,"/"),c=g.useMemo(()=>({basename:l,navigator:o,static:a,future:ji({v7_relativeSplatPath:!1},s)}),[l,s,o,a]);typeof r=="string"&&(r=wn(r));let{pathname:u="/",search:d="",hash:h="",state:f=null,key:m="default"}=r,p=g.useMemo(()=>{let y=nn(u,l);return y==null?null:{location:{pathname:y,search:d,hash:h,state:f,key:m},navigationType:i}},[l,u,d,h,f,m,i]);return p==null?null:g.createElement(an.Provider,{value:c},g.createElement(es.Provider,{children:n,value:p}))}new Promise(()=>{});function Vm(e){let t={hasErrorBoundary:e.ErrorBoundary!=null||e.errorElement!=null};return e.Component&&Object.assign(t,{element:g.createElement(e.Component),Component:void 0}),e.HydrateFallback&&Object.assign(t,{hydrateFallbackElement:g.createElement(e.HydrateFallback),HydrateFallback:void 0}),e.ErrorBoundary&&Object.assign(t,{errorElement:g.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 hr(){return hr=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},hr.apply(null,arguments)}function Qu(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 Km(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}function Wm(e,t){return e.button===0&&(!t||t==="_self")&&!Km(e)}function ca(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 qm(e,t){let n=ca(e);return t&&t.forEach((r,i)=>{n.has(i)||t.getAll(i).forEach(o=>{n.append(i,o)})}),n}const Gm=["onClick","relative","reloadDocument","replace","state","target","to","preventScrollReset","viewTransition"],Ym=["aria-current","caseSensitive","className","end","style","to","viewTransition","children"],Qm="6";try{window.__reactRouterVersion=Qm}catch{}function Xm(e,t){return am({basename:void 0,future:hr({},void 0,{v7_prependBasename:!0}),history:Pp({window:void 0}),hydrationData:Jm(),routes:e,mapRouteProperties:Vm,dataStrategy:void 0,patchRoutesOnNavigation:void 0,window:void 0}).initialize()}function Jm(){var e;let t=(e=window)==null?void 0:e.__staticRouterHydrationData;return t&&t.errors&&(t=hr({},t,{errors:Zm(t.errors)})),t}function Zm(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 Mi(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 Xu=g.createContext({isTransitioning:!1}),eg=g.createContext(new Map),tg="startTransition",ml=no[tg],ng="flushSync",gl=bp[ng];function rg(e){ml?ml(e):e()}function Or(e){gl?gl(e):e()}class ig{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 og(e){let{fallbackElement:t,router:n,future:r}=e,[i,o]=g.useState(n.state),[a,s]=g.useState(),[l,c]=g.useState({isTransitioning:!1}),[u,d]=g.useState(),[h,f]=g.useState(),[m,p]=g.useState(),y=g.useRef(new Map),{v7_startTransition:b}=r||{},x=g.useCallback(D=>{b?rg(D):D()},[b]),w=g.useCallback((D,F)=>{let{deletedFetchers:R,flushSync:N,viewTransitionOpts:L}=F;D.fetchers.forEach((H,z)=>{H.data!==void 0&&y.current.set(z,H.data)}),R.forEach(H=>y.current.delete(H));let K=n.window==null||n.window.document==null||typeof n.window.document.startViewTransition!="function";if(!L||K){N?Or(()=>o(D)):x(()=>o(D));return}if(N){Or(()=>{h&&(u&&u.resolve(),h.skipTransition()),c({isTransitioning:!0,flushSync:!0,currentLocation:L.currentLocation,nextLocation:L.nextLocation})});let H=n.window.document.startViewTransition(()=>{Or(()=>o(D))});H.finished.finally(()=>{Or(()=>{d(void 0),f(void 0),s(void 0),c({isTransitioning:!1})})}),Or(()=>f(H));return}h?(u&&u.resolve(),h.skipTransition(),p({state:D,currentLocation:L.currentLocation,nextLocation:L.nextLocation})):(s(D),c({isTransitioning:!0,flushSync:!1,currentLocation:L.currentLocation,nextLocation:L.nextLocation}))},[n.window,h,u,y,x]);g.useLayoutEffect(()=>n.subscribe(w),[n,w]),g.useEffect(()=>{l.isTransitioning&&!l.flushSync&&d(new ig)},[l]),g.useEffect(()=>{if(u&&a&&n.window){let D=a,F=u.promise,R=n.window.document.startViewTransition(async()=>{x(()=>o(D)),await F});R.finished.finally(()=>{d(void 0),f(void 0),s(void 0),c({isTransitioning:!1})}),f(R)}},[x,a,u,n.window]),g.useEffect(()=>{u&&a&&i.location.key===a.location.key&&u.resolve()},[u,h,i.location,a]),g.useEffect(()=>{!l.isTransitioning&&m&&(s(m.state),c({isTransitioning:!0,flushSync:!1,currentLocation:m.currentLocation,nextLocation:m.nextLocation}),p(void 0))},[l.isTransitioning,m]),g.useEffect(()=>{},[]);let T=g.useMemo(()=>({createHref:n.createHref,encodeLocation:n.encodeLocation,go:D=>n.navigate(D),push:(D,F,R)=>n.navigate(D,{state:F,preventScrollReset:R?.preventScrollReset}),replace:(D,F,R)=>n.navigate(D,{replace:!0,state:F,preventScrollReset:R?.preventScrollReset})}),[n]),I=n.basename||"/",C=g.useMemo(()=>({router:n,navigator:T,static:!1,basename:I}),[n,T,I]),k=g.useMemo(()=>({v7_relativeSplatPath:n.future.v7_relativeSplatPath}),[n.future.v7_relativeSplatPath]);return g.useEffect(()=>zm(r,n.future),[r,n.future]),g.createElement(g.Fragment,null,g.createElement(ti.Provider,{value:C},g.createElement(Za.Provider,{value:i},g.createElement(eg.Provider,{value:y.current},g.createElement(Xu.Provider,{value:l},g.createElement($m,{basename:I,location:i.location,navigationType:i.historyAction,navigator:T,future:k},i.initialized||n.future.v7_partialHydration?g.createElement(ag,{routes:n.routes,future:n.future,state:i}):t))))),null)}const ag=g.memo(sg);function sg(e){let{routes:t,future:n,state:r}=e;return Im(t,void 0,r,n)}const lg=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",cg=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,ts=g.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=Qu(t,Gm),{basename:f}=g.useContext(an),m,p=!1;if(typeof c=="string"&&cg.test(c)&&(m=c,lg))try{let w=new URL(window.location.href),T=c.startsWith("//")?new URL(w.protocol+c):new URL(c),I=nn(T.pathname,f);T.origin===w.origin&&I!=null?c=I+T.search+T.hash:p=!0}catch{}let y=Am(c,{relative:i}),b=dg(c,{replace:a,state:s,target:l,preventScrollReset:u,relative:i,viewTransition:d});function x(w){r&&r(w),w.defaultPrevented||b(w)}return g.createElement("a",hr({},h,{href:m||y,onClick:p||o?r:x,ref:n,target:l}))}),yl=g.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=Qu(t,Ym),h=so(l,{relative:d.relative}),f=ln(),m=g.useContext(Za),{navigator:p,basename:y}=g.useContext(an),b=m!=null&&hg(h)&&c===!0,x=p.encodeLocation?p.encodeLocation(h).pathname:h.pathname,w=f.pathname,T=m&&m.navigation&&m.navigation.location?m.navigation.location.pathname:null;i||(w=w.toLowerCase(),T=T?T.toLowerCase():null,x=x.toLowerCase()),T&&y&&(T=nn(T,y)||T);const I=x!=="/"&&x.endsWith("/")?x.length-1:x.length;let C=w===x||!a&&w.startsWith(x)&&w.charAt(I)==="/",k=T!=null&&(T===x||!a&&T.startsWith(x)&&T.charAt(x.length)==="/"),D={isActive:C,isPending:k,isTransitioning:b},F=C?r:void 0,R;typeof o=="function"?R=o(D):R=[o,C?"active":null,k?"pending":null,b?"transitioning":null].filter(Boolean).join(" ");let N=typeof s=="function"?s(D):s;return g.createElement(ts,hr({},d,{"aria-current":F,className:R,ref:n,style:N,to:l,viewTransition:c}),typeof u=="function"?u(D):u)});var ua;(function(e){e.UseScrollRestoration="useScrollRestoration",e.UseSubmit="useSubmit",e.UseSubmitFetcher="useSubmitFetcher",e.UseFetcher="useFetcher",e.useViewTransitionState="useViewTransitionState"})(ua||(ua={}));var vl;(function(e){e.UseFetcher="useFetcher",e.UseFetchers="useFetchers",e.UseScrollRestoration="useScrollRestoration"})(vl||(vl={}));function ug(e){let t=g.useContext(ti);return t||xe(!1),t}function dg(e,t){let{target:n,replace:r,state:i,preventScrollReset:o,relative:a,viewTransition:s}=t===void 0?{}:t,l=ao(),c=ln(),u=so(e,{relative:a});return g.useCallback(d=>{if(Wm(d,n)){d.preventDefault();let h=r!==void 0?r:Un(c)===Un(u);l(e,{replace:h,state:i,preventScrollReset:o,relative:a,viewTransition:s})}},[c,l,u,r,i,n,e,o,a,s])}function fg(e){let t=g.useRef(ca(e)),n=g.useRef(!1),r=ln(),i=g.useMemo(()=>qm(r.search,n.current?null:t.current),[r.search]),o=ao(),a=g.useCallback((s,l)=>{const c=ca(typeof s=="function"?s(i):s);n.current=!0,o("?"+c,l)},[o,i]);return[i,a]}function hg(e,t){t===void 0&&(t={});let n=g.useContext(Xu);n==null&&xe(!1);let{basename:r}=ug(ua.useViewTransitionState),i=so(e,{relative:t.relative});if(!n.isTransitioning)return!1;let o=nn(n.currentLocation.pathname,r)||n.currentLocation.pathname,a=nn(n.nextLocation.pathname,r)||n.nextLocation.pathname;return Di(i.pathname,a)!=null||Di(i.pathname,o)!=null}const bl=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},pg=e=>e?bl(e):bl,mg=e=>e;function gg(e,t=mg){const n=V.useSyncExternalStore(e.subscribe,V.useCallback(()=>t(e.getState()),[e,t]),V.useCallback(()=>t(e.getInitialState()),[e,t]));return V.useDebugValue(n),n}const xl=e=>{const t=pg(e),n=r=>gg(t,r);return Object.assign(n,t),n},Ju=e=>e?xl(e):xl,Fi="agim_token";function yg(){try{return localStorage.getItem(Fi)}catch{return null}}function wl(e){try{e?localStorage.setItem(Fi,e):localStorage.removeItem(Fi)}catch{}}const kl=yg(),ns=Ju(e=>({token:kl,signedIn:!!kl,setToken:t=>{wl(t),e({token:t,signedIn:!!t})},clear:()=>{wl(null),e({token:null,signedIn:!1})}}));function vg(){function e(t){if(t.key!==Fi)return;const n=t.newValue;ns.setState({token:n,signedIn:!!n})}return window.addEventListener("storage",e),()=>window.removeEventListener("storage",e)}function Zu({children:e}){const t=ns(r=>r.signedIn),n=ln();if(!t){const r=encodeURIComponent(n.pathname+n.search);return v.jsx(zt,{to:`/login?next=${r}`,replace:!0})}return v.jsx(v.Fragment,{children:e})}const bg=(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);Fn(i[0])&&(i[0]=`react-i18next:: ${i[0]}`),e?.services?.logger?.warn?e.services.logger.warn(...i):console?.warn&&console.warn(...i)},Sl={},da=(e,t,n,r)=>{Fn(n)&&Sl[n]||(Fn(n)&&(Sl[n]=new Date),bg(e,t,n,r))},ed=(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,ed(e,n))},El=(e,t,n,r)=>{if(Fn(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,ed(e,r))},xg=(e,t,n={})=>!t.languages||!t.languages.length?(da(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}}),Fn=e=>typeof e=="string",wg=e=>typeof e=="object"&&e!==null,kg=/&(?:amp|#38|lt|#60|gt|#62|apos|#39|quot|#34|nbsp|#160|copy|#169|reg|#174|hellip|#8230|#x2F|#47);/g,Sg={"&amp;":"&","&#38;":"&","&lt;":"<","&#60;":"<","&gt;":">","&#62;":">","&apos;":"'","&#39;":"'","&quot;":'"',"&#34;":'"',"&nbsp;":" ","&#160;":" ","&copy;":"©","&#169;":"©","&reg;":"®","&#174;":"®","&hellip;":"…","&#8230;":"…","&#x2F;":"/","&#47;":"/"},Eg=e=>Sg[e],Cg=e=>e.replace(kg,Eg);let ha={bindI18n:"languageChanged",bindI18nStore:"",transEmptyNodeValue:"",transSupportBasicHtmlNodes:!0,transWrapTextNodes:"",transKeepBasicHtmlNodesFor:["br","strong","i","p"],useSuspense:!0,unescape:Cg};const Ag=(e={})=>{ha={...ha,...e}},Tg=()=>ha;let td;const Rg=e=>{td=e},Pg=()=>td,Ig={type:"3rdParty",init(e){Ag(e.options.react),Rg(e)}},Lg=g.createContext();class Og{constructor(){this.usedNamespaces={}}addUsedNamespaces(t){t.forEach(n=>{this.usedNamespaces[n]||(this.usedNamespaces[n]=!0)})}getUsedNamespaces(){return Object.keys(this.usedNamespaces)}}const _g=(e,t)=>{const n=g.useRef();return g.useEffect(()=>{n.current=e},[e,t]),n.current},nd=(e,t,n,r)=>e.getFixedT(t,n,r),Ng=(e,t,n,r)=>g.useCallback(nd(e,t,n,r),[e,t,n,r]),kt=(e,t={})=>{const{i18n:n}=t,{i18n:r,defaultNS:i}=g.useContext(Lg)||{},o=n||r||Pg();if(o&&!o.reportNamespaces&&(o.reportNamespaces=new Og),!o){da(o,"NO_I18NEXT_INSTANCE","useTranslation: You will need to pass in an i18next instance by using initReactI18next");const T=(C,k)=>Fn(k)?k:wg(k)&&Fn(k.defaultValue)?k.defaultValue:Array.isArray(C)?C[C.length-1]:C,I=[T,{},!1];return I.t=T,I.i18n={},I.ready=!1,I}o.options.react?.wait&&da(o,"DEPRECATED_OPTION","useTranslation: It seems you are still using the old wait option, you may migrate to the new useSuspense behaviour.");const a={...Tg(),...o.options.react,...t},{useSuspense:s,keyPrefix:l}=a;let c=e||i||o.options?.defaultNS;c=Fn(c)?[c]:c||["translation"],o.reportNamespaces.addUsedNamespaces?.(c);const u=(o.isInitialized||o.initializedStoreOnce)&&c.every(T=>xg(T,o,a)),d=Ng(o,t.lng||null,a.nsMode==="fallback"?c:c[0],l),h=()=>d,f=()=>nd(o,t.lng||null,a.nsMode==="fallback"?c:c[0],l),[m,p]=g.useState(h);let y=c.join();t.lng&&(y=`${t.lng}${y}`);const b=_g(y),x=g.useRef(!0);g.useEffect(()=>{const{bindI18n:T,bindI18nStore:I}=a;x.current=!0,!u&&!s&&(t.lng?El(o,t.lng,c,()=>{x.current&&p(f)}):fa(o,c,()=>{x.current&&p(f)})),u&&b&&b!==y&&x.current&&p(f);const C=()=>{x.current&&p(f)};return T&&o?.on(T,C),I&&o?.store.on(I,C),()=>{x.current=!1,o&&T&&T?.split(" ").forEach(k=>o.off(k,C)),I&&o&&I.split(" ").forEach(k=>o.store.off(k,C))}},[o,y]),g.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(T=>{t.lng?El(o,t.lng,c,()=>T()):fa(o,c,()=>T())})};/**
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 Dg=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),rd=(...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 Mg={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 jg=g.forwardRef(({color:e="currentColor",size:t=24,strokeWidth:n=2,absoluteStrokeWidth:r,className:i="",children:o,iconNode:a,...s},l)=>g.createElement("svg",{ref:l,...Mg,width:t,height:t,stroke:e,strokeWidth:r?Number(n)*24/Number(t):n,className:rd("lucide",i),...s},[...a.map(([c,u])=>g.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 ht=(e,t)=>{const n=g.forwardRef(({className:r,...i},o)=>g.createElement(jg,{ref:o,iconNode:t,className:rd(`lucide-${Dg(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 Fg=ht("Check",[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]]);/**
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 id=ht("ChevronDown",[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]]);/**
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 Hg=ht("ChevronUp",[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]]);/**
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 Bg=ht("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"}]]);/**
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 Ug=ht("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"}]]);/**
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 zg=ht("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"}]]);/**
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 $g=ht("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"}]]);/**
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 Vg=ht("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"}]]);/**
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 Kg=ht("Moon",[["path",{d:"M12 3a6 6 0 0 0 9 9 9 9 0 1 1-9-9Z",key:"a7tn18"}]]);/**
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 Wg=ht("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"}]]);/**
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 qg=ht("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"}]]);/**
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 Gg=ht("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"}]]);/**
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 Yg=ht("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"}]]);/**
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 Qg=ht("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"}]]);function Cl(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function Xg(...e){return t=>{let n=!1;const r=e.map(i=>{const o=Cl(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():Cl(e[i],null)}}}}function Ye(...e){return g.useCallback(Xg(...e),e)}function Gr(e){const t=g.forwardRef((n,r)=>{let{children:i,...o}=n,a=null,s=!1;const l=[];Al(i)&&typeof di=="function"&&(i=di(i._payload)),g.Children.forEach(i,h=>{if(ry(h)){s=!0;const f=h;let m="child"in f.props?f.props.child:f.props.children;Al(m)&&typeof di=="function"&&(m=di(m._payload)),a=ey(f,m),l.push(a?.props?.children)}else l.push(h)}),a?a=g.cloneElement(a,void 0,l):!s&&g.Children.count(i)===1&&g.isValidElement(i)&&(a=i);const c=a?ny(a):void 0,u=Ye(r,c);if(!a){if(i||i===0)throw new Error(s?sy(e):ay(e));return i}const d=ty(o,a.props??{});return a.type!==g.Fragment&&(d.ref=r?u:c),g.cloneElement(a,d)});return t.displayName=`${e}.Slot`,t}var Jg=Gr("Slot"),od=Symbol.for("radix.slottable");function Zg(e){const t=n=>"child"in n?n.children(n.child):n.children;return t.displayName=`${e}.Slottable`,t.__radixId=od,t}var ey=(e,t)=>{if("child"in e.props){const n=e.props.child;return g.isValidElement(n)?g.cloneElement(n,void 0,e.props.children(n.props.children)):null}return g.isValidElement(t)?t:null};function ty(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 ny(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 ry(e){return g.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===od}var iy=Symbol.for("react.lazy");function Al(e){return e!=null&&typeof e=="object"&&"$$typeof"in e&&e.$$typeof===iy&&"_payload"in e&&oy(e._payload)}function oy(e){return typeof e=="object"&&e!==null&&"then"in e}var ay=e=>`${e} failed to slot onto its children. Expected a single React element child or \`Slottable\`.`,sy=e=>`${e} failed to slot onto its \`Slottable\`. Expected \`Slottable\` to receive a single React element child.`,di=no[" use ".trim().toString()];function ad(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=ad(e[t]))&&(r&&(r+=" "),r+=n)}else for(n in e)e[n]&&(r&&(r+=" "),r+=n);return r}function sd(){for(var e,t,n=0,r="",i=arguments.length;n<i;n++)(e=arguments[n])&&(t=ad(e))&&(r&&(r+=" "),r+=t);return r}const Tl=e=>typeof e=="boolean"?`${e}`:e===0?"0":e,Rl=sd,rs=(e,t)=>n=>{var r;if(t?.variants==null)return Rl(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=Tl(u)||Tl(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,y]=m;return Array.isArray(y)?y.includes({...o,...s}[p]):{...o,...s}[p]===y})?[...c,d,h]:c},[]);return Rl(e,a,l,n?.class,n?.className)},is="-",ly=e=>{const t=uy(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:r}=e;return{getClassGroupId:a=>{const s=a.split(is);return s[0]===""&&s.length!==1&&s.shift(),ld(s,t)||cy(a)},getConflictingClassGroupIds:(a,s)=>{const l=n[a]||[];return s&&r[a]?[...l,...r[a]]:l}}},ld=(e,t)=>{if(e.length===0)return t.classGroupId;const n=e[0],r=t.nextPart.get(n),i=r?ld(e.slice(1),r):void 0;if(i)return i;if(t.validators.length===0)return;const o=e.join(is);return t.validators.find(({validator:a})=>a(o))?.classGroupId},Pl=/^\[(.+)\]$/,cy=e=>{if(Pl.test(e)){const t=Pl.exec(e)[1],n=t?.substring(0,t.indexOf(":"));if(n)return"arbitrary.."+n}},uy=e=>{const{theme:t,prefix:n}=e,r={nextPart:new Map,validators:[]};return fy(Object.entries(e.classGroups),n).forEach(([o,a])=>{pa(a,r,o,t)}),r},pa=(e,t,n,r)=>{e.forEach(i=>{if(typeof i=="string"){const o=i===""?t:Il(t,i);o.classGroupId=n;return}if(typeof i=="function"){if(dy(i)){pa(i(r),t,n,r);return}t.validators.push({validator:i,classGroupId:n});return}Object.entries(i).forEach(([o,a])=>{pa(a,Il(t,o),n,r)})})},Il=(e,t)=>{let n=e;return t.split(is).forEach(r=>{n.nextPart.has(r)||n.nextPart.set(r,{nextPart:new Map,validators:[]}),n=n.nextPart.get(r)}),n},dy=e=>e.isThemeGetter,fy=(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,hy=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)}}},cd="!",py=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 y=0;y<s.length;y++){let b=s[y];if(c===0){if(b===i&&(r||s.slice(y,y+o)===t)){l.push(s.slice(u,y)),u=y+o;continue}if(b==="/"){d=y;continue}}b==="["?c++:b==="]"&&c--}const h=l.length===0?s:s.substring(u),f=h.startsWith(cd),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},my=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},gy=e=>({cache:hy(e.cacheSize),parseClassName:py(e),...ly(e)}),yy=/\s+/,vy=(e,t)=>{const{parseClassName:n,getClassGroupId:r,getConflictingClassGroupIds:i}=t,o=[],a=e.trim().split(yy);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 y=my(u).join(":"),b=d?y+cd:y,x=b+p;if(o.includes(x))continue;o.push(x);const w=i(p,m);for(let T=0;T<w.length;++T){const I=w[T];o.push(b+I)}s=c+(s.length>0?" "+s:s)}return s};function by(){let e=0,t,n,r="";for(;e<arguments.length;)(t=arguments[e++])&&(n=ud(t))&&(r&&(r+=" "),r+=n);return r}const ud=e=>{if(typeof e=="string")return e;let t,n="";for(let r=0;r<e.length;r++)e[r]&&(t=ud(e[r]))&&(n&&(n+=" "),n+=t);return n};function xy(e,...t){let n,r,i,o=a;function a(l){const c=t.reduce((u,d)=>d(u),e());return n=gy(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=vy(l,n);return i(l,u),u}return function(){return o(by.apply(null,arguments))}}const Fe=e=>{const t=n=>n[e]||[];return t.isThemeGetter=!0,t},dd=/^\[(?:([a-z-]+):)?(.+)\]$/i,wy=/^\d+\/\d+$/,ky=new Set(["px","full","screen"]),Sy=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,Ey=/\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$/,Cy=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,Ay=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,Ty=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,Zt=e=>ur(e)||ky.has(e)||wy.test(e),dn=e=>xr(e,"length",Dy),ur=e=>!!e&&!Number.isNaN(Number(e)),Oo=e=>xr(e,"number",ur),_r=e=>!!e&&Number.isInteger(Number(e)),Ry=e=>e.endsWith("%")&&ur(e.slice(0,-1)),ye=e=>dd.test(e),fn=e=>Sy.test(e),Py=new Set(["length","size","percentage"]),Iy=e=>xr(e,Py,fd),Ly=e=>xr(e,"position",fd),Oy=new Set(["image","url"]),_y=e=>xr(e,Oy,jy),Ny=e=>xr(e,"",My),Nr=()=>!0,xr=(e,t,n)=>{const r=dd.exec(e);return r?r[1]?typeof t=="string"?r[1]===t:t.has(r[1]):n(r[2]):!1},Dy=e=>Ey.test(e)&&!Cy.test(e),fd=()=>!1,My=e=>Ay.test(e),jy=e=>Ty.test(e),Fy=()=>{const e=Fe("colors"),t=Fe("spacing"),n=Fe("blur"),r=Fe("brightness"),i=Fe("borderColor"),o=Fe("borderRadius"),a=Fe("borderSpacing"),s=Fe("borderWidth"),l=Fe("contrast"),c=Fe("grayscale"),u=Fe("hueRotate"),d=Fe("invert"),h=Fe("gap"),f=Fe("gradientColorStops"),m=Fe("gradientColorStopPositions"),p=Fe("inset"),y=Fe("margin"),b=Fe("opacity"),x=Fe("padding"),w=Fe("saturate"),T=Fe("scale"),I=Fe("sepia"),C=Fe("skew"),k=Fe("space"),D=Fe("translate"),F=()=>["auto","contain","none"],R=()=>["auto","hidden","clip","visible","scroll"],N=()=>["auto",ye,t],L=()=>[ye,t],K=()=>["",Zt,dn],H=()=>["auto",ur,ye],z=()=>["bottom","center","left","left-bottom","left-top","right","right-bottom","right-top","top"],Y=()=>["solid","dashed","dotted","double","none"],Q=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],$=()=>["start","end","center","between","around","evenly","stretch"],j=()=>["","0",ye],S=()=>["auto","avoid","all","avoid-page","page","left","right","column"],ie=()=>[ur,ye];return{cacheSize:500,separator:":",theme:{colors:[Nr],spacing:[Zt,dn],blur:["none","",fn,ye],brightness:ie(),borderColor:[e],borderRadius:["none","","full",fn,ye],borderSpacing:L(),borderWidth:K(),contrast:ie(),grayscale:j(),hueRotate:ie(),invert:j(),gap:L(),gradientColorStops:[e],gradientColorStopPositions:[Ry,dn],inset:N(),margin:N(),opacity:ie(),padding:L(),saturate:ie(),scale:ie(),sepia:j(),skew:ie(),space:L(),translate:L()},classGroups:{aspect:[{aspect:["auto","square","video",ye]}],container:["container"],columns:[{columns:[fn]}],"break-after":[{"break-after":S()}],"break-before":[{"break-before":S()}],"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:[...z(),ye]}],overflow:[{overflow:R()}],"overflow-x":[{"overflow-x":R()}],"overflow-y":[{"overflow-y":R()}],overscroll:[{overscroll:F()}],"overscroll-x":[{"overscroll-x":F()}],"overscroll-y":[{"overscroll-y":F()}],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",_r,ye]}],basis:[{basis:N()}],"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:j()}],shrink:[{shrink:j()}],order:[{order:["first","last","none",_r,ye]}],"grid-cols":[{"grid-cols":[Nr]}],"col-start-end":[{col:["auto",{span:["full",_r,ye]},ye]}],"col-start":[{"col-start":H()}],"col-end":[{"col-end":H()}],"grid-rows":[{"grid-rows":[Nr]}],"row-start-end":[{row:["auto",{span:[_r,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",...$()]}],"justify-items":[{"justify-items":["start","end","center","stretch"]}],"justify-self":[{"justify-self":["auto","start","end","center","stretch"]}],"align-content":[{content:["normal",...$(),"baseline"]}],"align-items":[{items:["start","end","center","baseline","stretch"]}],"align-self":[{self:["auto","start","end","center","stretch","baseline"]}],"place-content":[{"place-content":[...$(),"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:[y]}],mx:[{mx:[y]}],my:[{my:[y]}],ms:[{ms:[y]}],me:[{me:[y]}],mt:[{mt:[y]}],mr:[{mr:[y]}],mb:[{mb:[y]}],ml:[{ml:[y]}],"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:[fn]},fn]}],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",fn,dn]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:["thin","extralight","light","normal","medium","semibold","bold","extrabold","black",Oo]}],"font-family":[{font:[Nr]}],"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",ur,Oo]}],leading:[{leading:["none","tight","snug","normal","relaxed","loose",Zt,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":[b]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"text-color":[{text:[e]}],"text-opacity":[{"text-opacity":[b]}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...Y(),"wavy"]}],"text-decoration-thickness":[{decoration:["auto","from-font",Zt,dn]}],"underline-offset":[{"underline-offset":["auto",Zt,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":[b]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:[...z(),Ly]}],"bg-repeat":[{bg:["no-repeat",{repeat:["","x","y","round","space"]}]}],"bg-size":[{bg:["auto","cover","contain",Iy]}],"bg-image":[{bg:["none",{"gradient-to":["t","tr","r","br","b","bl","l","tl"]},_y]}],"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":[b]}],"border-style":[{border:[...Y(),"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":[b]}],"divide-style":[{divide:Y()}],"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:["",...Y()]}],"outline-offset":[{"outline-offset":[Zt,ye]}],"outline-w":[{outline:[Zt,dn]}],"outline-color":[{outline:[e]}],"ring-w":[{ring:K()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:[e]}],"ring-opacity":[{"ring-opacity":[b]}],"ring-offset-w":[{"ring-offset":[Zt,dn]}],"ring-offset-color":[{"ring-offset":[e]}],shadow:[{shadow:["","inner","none",fn,Ny]}],"shadow-color":[{shadow:[Nr]}],opacity:[{opacity:[b]}],"mix-blend":[{"mix-blend":[...Q(),"plus-lighter","plus-darker"]}],"bg-blend":[{"bg-blend":Q()}],filter:[{filter:["","none"]}],blur:[{blur:[n]}],brightness:[{brightness:[r]}],contrast:[{contrast:[l]}],"drop-shadow":[{"drop-shadow":["","none",fn,ye]}],grayscale:[{grayscale:[c]}],"hue-rotate":[{"hue-rotate":[u]}],invert:[{invert:[d]}],saturate:[{saturate:[w]}],sepia:[{sepia:[I]}],"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":[b]}],"backdrop-saturate":[{"backdrop-saturate":[w]}],"backdrop-sepia":[{"backdrop-sepia":[I]}],"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:[T]}],"scale-x":[{"scale-x":[T]}],"scale-y":[{"scale-y":[T]}],rotate:[{rotate:[_r,ye]}],"translate-x":[{"translate-x":[D]}],"translate-y":[{"translate-y":[D]}],"skew-x":[{"skew-x":[C]}],"skew-y":[{"skew-y":[C]}],"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:[Zt,dn,Oo]}],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"]}}},Hy=xy(Fy);function Le(...e){return Hy(sd(e))}const By=rs(["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"}}),bt=g.forwardRef(({className:e,variant:t,size:n,asChild:r=!1,...i},o)=>{const a=r?Jg:"button";return v.jsx(a,{className:Le(By({variant:t,size:n,className:e})),ref:o,...i})});bt.displayName="Button";class Uy extends g.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?v.jsx(zy,{error:this.state.error,info:this.state.info,onReset:this.handleReset}):this.props.children}}function zy({error:e,info:t,onReset:n}){const{t:r}=kt("common"),i=typeof import.meta<"u"&&!1;return v.jsx("div",{className:"grid min-h-dvh place-items-center bg-bg px-4 py-8",children:v.jsxs("div",{className:"flex flex-col items-center gap-4 text-center max-w-xl",children:[v.jsx("div",{className:"flex h-12 w-12 items-center justify-center rounded-full bg-danger-bg text-danger",children:v.jsx(Qg,{className:"h-6 w-6"})}),v.jsx("h1",{className:"text-xl font-semibold",children:r("errorBoundary.title",{defaultValue:"Something went wrong."})}),v.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."})}),v.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&&v.jsxs("details",{className:"w-full max-w-lg text-left text-xs",children:[v.jsx("summary",{className:"cursor-pointer text-text-dim",children:"component stack (dev)"}),v.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})]}),v.jsxs("div",{className:"mt-2 flex flex-wrap items-center justify-center gap-2",children:[v.jsxs(bt,{type:"button",variant:"default",onClick:()=>{n(),typeof window<"u"&&window.location.reload()},children:[v.jsx(Wg,{className:"h-4 w-4"}),r("errorBoundary.reload",{defaultValue:"Reload"})]}),v.jsx(bt,{type:"button",variant:"secondary",asChild:!0,children:v.jsxs(ts,{to:"/",onClick:n,children:[v.jsx(zg,{className:"h-4 w-4"}),r("errorBoundary.home",{defaultValue:"Home"})]})})]})]})})}var ni=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(){}},$y=class extends ni{#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"}},hd=new $y,Vy={setTimeout:(e,t)=>setTimeout(e,t),clearTimeout:e=>clearTimeout(e),setInterval:(e,t)=>setInterval(e,t),clearInterval:e=>clearInterval(e)},Ky=class{#e=Vy;#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)}},ma=new Ky;function Wy(e){setTimeout(e,0)}var qy=typeof window>"u"||"Deno"in globalThis;function Et(){}function Gy(e,t){return typeof e=="function"?e(t):e}function Yy(e){return typeof e=="number"&&e>=0&&e!==1/0}function Qy(e,t){return Math.max(e+(t||0)-Date.now(),0)}function ga(e,t){return typeof e=="function"?e(t):e}function Xy(e,t){return typeof e=="function"?e(t):e}function Ll(e,t){const{type:n="all",exact:r,fetchStatus:i,predicate:o,queryKey:a,stale:s}=e;if(a){if(r){if(t.queryHash!==os(a,t.options))return!1}else if(!Yr(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 Ol(e,t){const{exact:n,status:r,predicate:i,mutationKey:o}=e;if(o){if(!t.options.mutationKey)return!1;if(n){if(zn(t.options.mutationKey)!==zn(o))return!1}else if(!Yr(t.options.mutationKey,o))return!1}return!(r&&t.state.status!==r||i&&!i(t))}function os(e,t){return(t?.queryKeyHashFn||zn)(e)}function zn(e){return JSON.stringify(e,(t,n)=>ya(n)?Object.keys(n).sort().reduce((r,i)=>(r[i]=n[i],r),{}):n)}function Yr(e,t){return e===t?!0:typeof e!=typeof t?!1:e&&t&&typeof e=="object"&&typeof t=="object"?Object.keys(t).every(n=>Yr(e[n],t[n])):!1}var Jy=Object.prototype.hasOwnProperty;function pd(e,t,n=0){if(e===t)return e;if(n>500)return t;const r=_l(e)&&_l(t);if(!r&&!(ya(e)&&ya(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:Jy.call(e,d))&&c++;continue}if(h===null||f===null||typeof h!="object"||typeof f!="object"){l[d]=f;continue}const m=pd(h,f,n+1);l[d]=m,m===h&&c++}return o===s&&c===o?e:l}function Zy(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 _l(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function ya(e){if(!Nl(e))return!1;const t=e.constructor;if(t===void 0)return!0;const n=t.prototype;return!(!Nl(n)||!n.hasOwnProperty("isPrototypeOf")||Object.getPrototypeOf(e)!==Object.prototype)}function Nl(e){return Object.prototype.toString.call(e)==="[object Object]"}function ev(e){return new Promise(t=>{ma.setTimeout(t,e)})}function tv(e,t,n){return typeof n.structuralSharing=="function"?n.structuralSharing(e,t):n.structuralSharing!==!1?pd(e,t):t}function nv(e,t,n=0){const r=[...e,t];return n&&r.length>n?r.slice(1):r}function rv(e,t,n=0){const r=[t,...e];return n&&r.length>n?r.slice(0,-1):r}var as=Symbol();function md(e,t){return!e.queryFn&&t?.initialPromise?()=>t.initialPromise:!e.queryFn||e.queryFn===as?()=>Promise.reject(new Error(`Missing queryFn: '${e.queryHash}'`)):e.queryFn}function iv(e,t){return typeof e=="function"?e(...t):!!e}function ov(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 gd=(()=>{let e=()=>qy;return{isServer(){return e()},setIsServer(t){e=t}}})();function av(){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 sv=Wy;function lv(){let e=[],t=0,n=s=>{s()},r=s=>{s()},i=sv;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=lv(),cv=class extends ni{#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}},Hi=new cv;function uv(e){return Math.min(1e3*2**e,3e4)}function yd(e){return(e??"online")==="online"?Hi.isOnline():!0}var va=class extends Error{constructor(e){super("CancelledError"),this.revert=e?.revert,this.silent=e?.silent}};function vd(e){let t=!1,n=0,r;const i=av(),o=()=>i.status!=="pending",a=p=>{if(!o()){const y=new va(p);h(y),e.onCancel?.(y)}},s=()=>{t=!0},l=()=>{t=!1},c=()=>hd.isFocused()&&(e.networkMode==="always"||Hi.isOnline())&&e.canRun(),u=()=>yd(e.networkMode)&&e.canRun(),d=p=>{o()||(r?.(),i.resolve(p))},h=p=>{o()||(r?.(),i.reject(p))},f=()=>new Promise(p=>{r=y=>{(o()||c())&&p(y)},e.onPause?.()}).then(()=>{r=void 0,o()||e.onContinue?.()}),m=()=>{if(o())return;let p;const y=n===0?e.initialPromise:void 0;try{p=y??e.fn()}catch(b){p=Promise.reject(b)}Promise.resolve(p).then(d).catch(b=>{if(o())return;const x=e.retry??(gd.isServer()?0:3),w=e.retryDelay??uv,T=typeof w=="function"?w(n,b):w,I=x===!0||typeof x=="number"&&n<x||typeof x=="function"&&x(n,b);if(t||!I){h(b);return}n++,e.onFail?.(n,b),ev(T).then(()=>c()?void 0:f()).then(()=>{t?h(b):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 bd=class{#e;destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),Yy(this.gcTime)&&(this.#e=ma.setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(gd.isServer()?1/0:5*60*1e3))}clearGcTimeout(){this.#e!==void 0&&(ma.clearTimeout(this.#e),this.#e=void 0)}};function dv(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=>{ov(m,()=>t.signal,()=>u=!0)},h=md(t.options,t.fetchOptions),f=async(m,p,y)=>{if(u)return Promise.reject(t.signal.reason);if(p==null&&m.pages.length)return Promise.resolve(m);const x=(()=>{const C={client:t.client,queryKey:t.queryKey,pageParam:p,direction:y?"backward":"forward",meta:t.options.meta};return d(C),C})(),w=await h(x),{maxPages:T}=t.options,I=y?rv:nv;return{pages:I(m.pages,w,T),pageParams:I(m.pageParams,p,T)}};if(i&&o.length){const m=i==="backward",p=m?fv:Dl,y={pages:o,pageParams:a},b=p(r,y);s=await f(y,b,m)}else{const m=e??o.length;do{const p=l===0?a[0]??r.initialPageParam:Dl(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 Dl(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 fv(e,{pages:t,pageParams:n}){return t.length>0?e.getPreviousPageParam?.(t[0],t,n[0],n):void 0}var hv=class extends bd{#e;#t;#n;#r;#o;#i;#l;#a;constructor(e){super(),this.#a=!1,this.#l=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=jl(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.#l,...e},e?._type&&(this.#e=e._type),this.updateGcTime(this.options.gcTime),this.state&&this.state.data===void 0){const t=jl(this.options);t.data!==void 0&&(this.setState(Ml(t.data,t.dataUpdatedAt)),this.#t=t)}}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&this.#r.remove(this)}setData(e,t){const n=tv(this.state.data,e,this.options);return this.#s({data:n,type:"success",dataUpdatedAt:t?.updatedAt,manual:t?.manual}),n}setState(e){this.#s({type:"setState",state:e})}cancel(e){const t=this.#i?.promise;return this.#i?.cancel(e),t?t.then(Et).catch(Et):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=>Xy(e.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===as||!this.isFetched()}isFetched(){return this.state.dataUpdateCount+this.state.errorUpdateCount>0}isStatic(){return this.getObserversCount()>0?this.observers.some(e=>ga(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:!Qy(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.#c()?this.#i.cancel({revert:!0}):this.#i.cancelRetry()),this.scheduleGc()),this.#r.notify({type:"observerRemoved",query:this,observer:e}))}getObserversCount(){return this.observers.length}#c(){return this.state.fetchStatus==="paused"&&this.state.status==="pending"}invalidate(){this.state.isInvalidated||this.#s({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=md(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"?dv(this.options.pages):this.options.behavior)?.onFetch(a,this),this.#n=this.state,(this.state.fetchStatus==="idle"||this.state.fetchMeta!==a.fetchOptions?.meta)&&this.#s({type:"fetch",meta:a.fetchOptions?.meta}),this.#i=vd({initialPromise:t?.initialPromise,fn:a.fetchFn,onCancel:l=>{l instanceof va&&l.revert&&this.setState({...this.#n,fetchStatus:"idle"}),n.abort()},onFail:(l,c)=>{this.#s({type:"failed",failureCount:l,error:c})},onPause:()=>{this.#s({type:"pause"})},onContinue:()=>{this.#s({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 va){if(l.silent)return this.#i.promise;if(l.revert){if(this.state.data===void 0)throw l;return this.state.data}}throw this.#s({type:"error",error:l}),this.#r.config.onError?.(l,this),this.#r.config.onSettled?.(this.state.data,l,this),l}finally{this.scheduleGc()}}#s(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,...pv(n.data,this.options),fetchMeta:e.meta??null};case"success":const r={...n,...Ml(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 pv(e,t){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:yd(t.networkMode)?"fetching":"paused",...e===void 0&&{error:null,status:"pending"}}}function Ml(e,t){return{data:e,dataUpdatedAt:t??Date.now(),error:null,isInvalidated:!1,status:"success"}}function jl(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 mv=class extends bd{#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||xd(),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=vd({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 xd(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var gv=class extends ni{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 mv({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=fi(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=fi(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=fi(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=fi(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=>Ol(t,n))}findAll(e={}){return this.getAll().filter(t=>Ol(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(Et))))}};function fi(e){return e.options.scope?.id}var yv=class extends ni{#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),Zy(this.options,n)||this.#e.getMutationCache().notify({type:"observerOptionsUpdated",mutation:this.#n,observer:this}),n?.mutationKey&&this.options.mutationKey&&zn(n.mutationKey)!==zn(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??xd();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)})})}},vv=class extends ni{constructor(e={}){super(),this.config=e,this.#e=new Map}#e;build(e,t,n){const r=t.queryKey,i=t.queryHash??os(r,t);let o=this.get(i);return o||(o=new hv({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=>Ll(t,n))}findAll(e={}){const t=this.getAll();return Object.keys(e).length>0?t.filter(n=>Ll(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()})})}},bv=class{#e;#t;#n;#r;#o;#i;#l;#a;constructor(e={}){this.#e=e.queryCache||new vv,this.#t=e.mutationCache||new gv,this.#n=e.defaultOptions||{},this.#r=new Map,this.#o=new Map,this.#i=0}mount(){this.#i++,this.#i===1&&(this.#l=hd.subscribe(async e=>{e&&(await this.resumePausedMutations(),this.#e.onFocus())}),this.#a=Hi.subscribe(async e=>{e&&(await this.resumePausedMutations(),this.#e.onOnline())}))}unmount(){this.#i--,this.#i===0&&(this.#l?.(),this.#l=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(ga(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=Gy(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(Et).catch(Et)}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(Et)),i.state.fetchStatus==="paused"?Promise.resolve():o}));return Promise.all(r).then(Et)}fetchQuery(e){const t=this.defaultQueryOptions(e);t.retry===void 0&&(t.retry=!1);const n=this.#e.build(this,t);return n.isStaleByTime(ga(t.staleTime,n))?n.fetch(t):Promise.resolve(n.state.data)}prefetchQuery(e){return this.fetchQuery(e).then(Et).catch(Et)}fetchInfiniteQuery(e){return e._type="infinite",this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(Et).catch(Et)}ensureInfiniteQueryData(e){return e._type="infinite",this.ensureQueryData(e)}resumePausedMutations(){return Hi.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(zn(e),{queryKey:e,defaultOptions:t})}getQueryDefaults(e){const t=[...this.#r.values()],n={};return t.forEach(r=>{Yr(e,r.queryKey)&&Object.assign(n,r.defaultOptions)}),n}setMutationDefaults(e,t){this.#o.set(zn(e),{mutationKey:e,defaultOptions:t})}getMutationDefaults(e){const t=[...this.#o.values()],n={};return t.forEach(r=>{Yr(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=os(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===as&&(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()}},wd=g.createContext(void 0),xv=e=>{const t=g.useContext(wd);if(!t)throw new Error("No QueryClient set, use QueryClientProvider to set one");return t},wv=({client:e,children:t})=>(g.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),v.jsx(wd.Provider,{value:e,children:t}));function kv(e,t){const n=xv(),[r]=g.useState(()=>new yv(n,e));g.useEffect(()=>{r.setOptions(e)},[r,e]);const i=g.useSyncExternalStore(g.useCallback(a=>r.subscribe(tt.batchCalls(a)),[r]),()=>r.getCurrentResult(),()=>r.getCurrentResult()),o=g.useCallback((a,s)=>{r.mutate(a,s).catch(Et)},[r]);if(i.error&&iv(r.options.throwOnError,[i.error]))throw i.error;return{...i,mutate:o,mutateAsync:i.mutate}}var Sv=e=>{switch(e){case"success":return Av;case"info":return Rv;case"warning":return Tv;case"error":return Pv;default:return null}},Ev=Array(12).fill(0),Cv=({visible:e,className:t})=>V.createElement("div",{className:["sonner-loading-wrapper",t].filter(Boolean).join(" "),"data-visible":e},V.createElement("div",{className:"sonner-spinner"},Ev.map((n,r)=>V.createElement("div",{className:"sonner-loading-bar",key:`spinner-bar-${r}`})))),Av=V.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},V.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"})),Tv=V.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",height:"20",width:"20"},V.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"})),Rv=V.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},V.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"})),Pv=V.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},V.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"})),Iv=V.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"},V.createElement("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),V.createElement("line",{x1:"6",y1:"6",x2:"18",y2:"18"})),Lv=()=>{let[e,t]=V.useState(document.hidden);return V.useEffect(()=>{let n=()=>{t(document.hidden)};return document.addEventListener("visibilitychange",n),()=>window.removeEventListener("visibilitychange",n)},[]),e},ba=1,Ov=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:ba++,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],V.isValidElement(l))i=!1,this.create({id:n,type:"default",message:l});else if(Nv(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||ba++;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}},ft=new Ov,_v=(e,t)=>{let n=t?.id||ba++;return ft.addToast({title:e,...t,id:n}),n},Nv=e=>e&&typeof e=="object"&&"ok"in e&&typeof e.ok=="boolean"&&"status"in e&&typeof e.status=="number",Dv=_v,Mv=()=>ft.toasts,jv=()=>ft.getActiveToasts(),Ot=Object.assign(Dv,{success:ft.success,info:ft.info,warning:ft.warning,error:ft.error,custom:ft.custom,message:ft.message,promise:ft.promise,dismiss:ft.dismiss,loading:ft.loading},{getHistory:Mv,getToasts:jv});function Fv(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))}Fv(`: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%)}
129
+ `);function hi(e){return e.label!==void 0}var Hv=3,Bv="32px",Uv="16px",Fl=4e3,zv=356,$v=14,Vv=20,Kv=200;function Pt(...e){return e.filter(Boolean).join(" ")}function Wv(e){let[t,n]=e.split("-"),r=[];return t&&r.push(t),n&&r.push(n),r}var qv=e=>{var t,n,r,i,o,a,s,l,c,u,d;let{invert:h,toast:f,unstyled:m,interacting:p,setHeights:y,visibleToasts:b,heights:x,index:w,toasts:T,expanded:I,removeToast:C,defaultRichColors:k,closeButton:D,style:F,cancelButtonStyle:R,actionButtonStyle:N,className:L="",descriptionClassName:K="",duration:H,position:z,gap:Y,loadingIcon:Q,expandByDefault:$,classNames:j,icons:S,closeButtonAriaLabel:ie="Close toast",pauseWhenPageIsHidden:Z}=e,[E,ae]=V.useState(null),[me,ve]=V.useState(null),[W,fe]=V.useState(!1),[Re,be]=V.useState(!1),[we,pe]=V.useState(!1),[Ke,Qe]=V.useState(!1),[Mt,Ze]=V.useState(!1),[jt,Cn]=V.useState(0),[An,Tn]=V.useState(0),Qt=V.useRef(f.duration||H||Fl),Qn=V.useRef(null),At=V.useRef(null),Tt=w===0,Xt=w+1<=b,_=f.type,U=f.dismissible!==!1,ne=f.className||"",se=f.descriptionClassName||"",Se=V.useMemo(()=>x.findIndex(ce=>ce.toastId===f.id)||0,[x,f.id]),Xe=V.useMemo(()=>{var ce;return(ce=f.closeButton)!=null?ce:D},[f.closeButton,D]),St=V.useMemo(()=>f.duration||H||Fl,[f.duration,H]),ze=V.useRef(0),at=V.useRef(0),Rt=V.useRef(0),Be=V.useRef(null),[Ft,ct]=z.split("-"),Rn=V.useMemo(()=>x.reduce((ce,Pe,Oe)=>Oe>=Se?ce:ce+Pe.height,0),[x,Se]),Cr=Lv(),Ar=f.invert||h,Pn=_==="loading";at.current=V.useMemo(()=>Se*Y+Rn,[Se,Rn]),V.useEffect(()=>{Qt.current=St},[St]),V.useEffect(()=>{fe(!0)},[]),V.useEffect(()=>{let ce=At.current;if(ce){let Pe=ce.getBoundingClientRect().height;return Tn(Pe),y(Oe=>[{toastId:f.id,height:Pe,position:f.position},...Oe]),()=>y(Oe=>Oe.filter(rt=>rt.toastId!==f.id))}},[y,f.id]),V.useLayoutEffect(()=>{if(!W)return;let ce=At.current,Pe=ce.style.height;ce.style.height="auto";let Oe=ce.getBoundingClientRect().height;ce.style.height=Pe,Tn(Oe),y(rt=>rt.find(mt=>mt.toastId===f.id)?rt.map(mt=>mt.toastId===f.id?{...mt,height:Oe}:mt):[{toastId:f.id,height:Oe,position:f.position},...rt])},[W,f.title,f.description,y,f.id]);let Ht=V.useCallback(()=>{be(!0),Cn(at.current),y(ce=>ce.filter(Pe=>Pe.toastId!==f.id)),setTimeout(()=>{C(f)},Kv)},[f,C,y,at]);V.useEffect(()=>{if(f.promise&&_==="loading"||f.duration===1/0||f.type==="loading")return;let ce;return I||p||Z&&Cr?(()=>{if(Rt.current<ze.current){let Pe=new Date().getTime()-ze.current;Qt.current=Qt.current-Pe}Rt.current=new Date().getTime()})():Qt.current!==1/0&&(ze.current=new Date().getTime(),ce=setTimeout(()=>{var Pe;(Pe=f.onAutoClose)==null||Pe.call(f,f),Ht()},Qt.current)),()=>clearTimeout(ce)},[I,p,f,_,Z,Cr,Ht]),V.useEffect(()=>{f.delete&&Ht()},[Ht,f.delete]);function si(){var ce,Pe,Oe;return S!=null&&S.loading?V.createElement("div",{className:Pt(j?.loader,(ce=f?.classNames)==null?void 0:ce.loader,"sonner-loader"),"data-visible":_==="loading"},S.loading):Q?V.createElement("div",{className:Pt(j?.loader,(Pe=f?.classNames)==null?void 0:Pe.loader,"sonner-loader"),"data-visible":_==="loading"},Q):V.createElement(Cv,{className:Pt(j?.loader,(Oe=f?.classNames)==null?void 0:Oe.loader),visible:_==="loading"})}return V.createElement("li",{tabIndex:0,ref:At,className:Pt(L,ne,j?.toast,(t=f?.classNames)==null?void 0:t.toast,j?.default,j?.[_],(n=f?.classNames)==null?void 0:n[_]),"data-sonner-toast":"","data-rich-colors":(r=f.richColors)!=null?r:k,"data-styled":!(f.jsx||f.unstyled||m),"data-mounted":W,"data-promise":!!f.promise,"data-swiped":Mt,"data-removed":Re,"data-visible":Xt,"data-y-position":Ft,"data-x-position":ct,"data-index":w,"data-front":Tt,"data-swiping":we,"data-dismissible":U,"data-type":_,"data-invert":Ar,"data-swipe-out":Ke,"data-swipe-direction":me,"data-expanded":!!(I||$&&W),style:{"--index":w,"--toasts-before":w,"--z-index":T.length-w,"--offset":`${Re?jt:at.current}px`,"--initial-height":$?"auto":`${An}px`,...F,...f.style},onDragEnd:()=>{pe(!1),ae(null),Be.current=null},onPointerDown:ce=>{Pn||!U||(Qn.current=new Date,Cn(at.current),ce.target.setPointerCapture(ce.pointerId),ce.target.tagName!=="BUTTON"&&(pe(!0),Be.current={x:ce.clientX,y:ce.clientY}))},onPointerUp:()=>{var ce,Pe,Oe,rt;if(Ke||!U)return;Be.current=null;let mt=Number(((ce=At.current)==null?void 0:ce.style.getPropertyValue("--swipe-amount-x").replace("px",""))||0),Bt=Number(((Pe=At.current)==null?void 0:Pe.style.getPropertyValue("--swipe-amount-y").replace("px",""))||0),A=new Date().getTime()-((Oe=Qn.current)==null?void 0:Oe.getTime()),P=E==="x"?mt:Bt,O=Math.abs(P)/A;if(Math.abs(P)>=Vv||O>.11){Cn(at.current),(rt=f.onDismiss)==null||rt.call(f,f),ve(E==="x"?mt>0?"right":"left":Bt>0?"down":"up"),Ht(),Qe(!0),Ze(!1);return}pe(!1),ae(null)},onPointerMove:ce=>{var Pe,Oe,rt,mt;if(!Be.current||!U||((Pe=window.getSelection())==null?void 0:Pe.toString().length)>0)return;let Bt=ce.clientY-Be.current.y,A=ce.clientX-Be.current.x,P=(Oe=e.swipeDirections)!=null?Oe:Wv(z);!E&&(Math.abs(A)>1||Math.abs(Bt)>1)&&ae(Math.abs(A)>Math.abs(Bt)?"x":"y");let O={x:0,y:0};E==="y"?(P.includes("top")||P.includes("bottom"))&&(P.includes("top")&&Bt<0||P.includes("bottom")&&Bt>0)&&(O.y=Bt):E==="x"&&(P.includes("left")||P.includes("right"))&&(P.includes("left")&&A<0||P.includes("right")&&A>0)&&(O.x=A),(Math.abs(O.x)>0||Math.abs(O.y)>0)&&Ze(!0),(rt=At.current)==null||rt.style.setProperty("--swipe-amount-x",`${O.x}px`),(mt=At.current)==null||mt.style.setProperty("--swipe-amount-y",`${O.y}px`)}},Xe&&!f.jsx?V.createElement("button",{"aria-label":ie,"data-disabled":Pn,"data-close-button":!0,onClick:Pn||!U?()=>{}:()=>{var ce;Ht(),(ce=f.onDismiss)==null||ce.call(f,f)},className:Pt(j?.closeButton,(i=f?.classNames)==null?void 0:i.closeButton)},(o=S?.close)!=null?o:Iv):null,f.jsx||g.isValidElement(f.title)?f.jsx?f.jsx:typeof f.title=="function"?f.title():f.title:V.createElement(V.Fragment,null,_||f.icon||f.promise?V.createElement("div",{"data-icon":"",className:Pt(j?.icon,(a=f?.classNames)==null?void 0:a.icon)},f.promise||f.type==="loading"&&!f.icon?f.icon||si():null,f.type!=="loading"?f.icon||S?.[_]||Sv(_):null):null,V.createElement("div",{"data-content":"",className:Pt(j?.content,(s=f?.classNames)==null?void 0:s.content)},V.createElement("div",{"data-title":"",className:Pt(j?.title,(l=f?.classNames)==null?void 0:l.title)},typeof f.title=="function"?f.title():f.title),f.description?V.createElement("div",{"data-description":"",className:Pt(K,se,j?.description,(c=f?.classNames)==null?void 0:c.description)},typeof f.description=="function"?f.description():f.description):null),g.isValidElement(f.cancel)?f.cancel:f.cancel&&hi(f.cancel)?V.createElement("button",{"data-button":!0,"data-cancel":!0,style:f.cancelButtonStyle||R,onClick:ce=>{var Pe,Oe;hi(f.cancel)&&U&&((Oe=(Pe=f.cancel).onClick)==null||Oe.call(Pe,ce),Ht())},className:Pt(j?.cancelButton,(u=f?.classNames)==null?void 0:u.cancelButton)},f.cancel.label):null,g.isValidElement(f.action)?f.action:f.action&&hi(f.action)?V.createElement("button",{"data-button":!0,"data-action":!0,style:f.actionButtonStyle||N,onClick:ce=>{var Pe,Oe;hi(f.action)&&((Oe=(Pe=f.action).onClick)==null||Oe.call(Pe,ce),!ce.defaultPrevented&&Ht())},className:Pt(j?.actionButton,(d=f?.classNames)==null?void 0:d.actionButton)},f.action.label):null))};function Hl(){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 Gv(e,t){let n={};return[e,t].forEach((r,i)=>{let o=i===1,a=o?"--mobile-offset":"--offset",s=o?Uv:Bv;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 Yv=g.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=Hv,toastOptions:p,dir:y=Hl(),gap:b=$v,loadingIcon:x,icons:w,containerAriaLabel:T="Notifications",pauseWhenPageIsHidden:I}=e,[C,k]=V.useState([]),D=V.useMemo(()=>Array.from(new Set([r].concat(C.filter(Z=>Z.position).map(Z=>Z.position)))),[C,r]),[F,R]=V.useState([]),[N,L]=V.useState(!1),[K,H]=V.useState(!1),[z,Y]=V.useState(u!=="system"?u:typeof window<"u"&&window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"),Q=V.useRef(null),$=i.join("+").replace(/Key/g,"").replace(/Digit/g,""),j=V.useRef(null),S=V.useRef(!1),ie=V.useCallback(Z=>{k(E=>{var ae;return(ae=E.find(me=>me.id===Z.id))!=null&&ae.delete||ft.dismiss(Z.id),E.filter(({id:me})=>me!==Z.id)})},[]);return V.useEffect(()=>ft.subscribe(Z=>{if(Z.dismiss){k(E=>E.map(ae=>ae.id===Z.id?{...ae,delete:!0}:ae));return}setTimeout(()=>{xp.flushSync(()=>{k(E=>{let ae=E.findIndex(me=>me.id===Z.id);return ae!==-1?[...E.slice(0,ae),{...E[ae],...Z},...E.slice(ae+1)]:[Z,...E]})})})}),[]),V.useEffect(()=>{if(u!=="system"){Y(u);return}if(u==="system"&&(window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?Y("dark"):Y("light")),typeof window>"u")return;let Z=window.matchMedia("(prefers-color-scheme: dark)");try{Z.addEventListener("change",({matches:E})=>{Y(E?"dark":"light")})}catch{Z.addListener(({matches:ae})=>{try{Y(ae?"dark":"light")}catch(me){console.error(me)}})}},[u]),V.useEffect(()=>{C.length<=1&&L(!1)},[C]),V.useEffect(()=>{let Z=E=>{var ae,me;i.every(ve=>E[ve]||E.code===ve)&&(L(!0),(ae=Q.current)==null||ae.focus()),E.code==="Escape"&&(document.activeElement===Q.current||(me=Q.current)!=null&&me.contains(document.activeElement))&&L(!1)};return document.addEventListener("keydown",Z),()=>document.removeEventListener("keydown",Z)},[i]),V.useEffect(()=>{if(Q.current)return()=>{j.current&&(j.current.focus({preventScroll:!0}),j.current=null,S.current=!1)}},[Q.current]),V.createElement("section",{ref:t,"aria-label":`${T} ${$}`,tabIndex:-1,"aria-live":"polite","aria-relevant":"additions text","aria-atomic":"false",suppressHydrationWarning:!0},D.map((Z,E)=>{var ae;let[me,ve]=Z.split("-");return C.length?V.createElement("ol",{key:Z,dir:y==="auto"?Hl():y,tabIndex:-1,ref:Q,className:s,"data-sonner-toaster":!0,"data-theme":z,"data-y-position":me,"data-lifted":N&&C.length>1&&!o,"data-x-position":ve,style:{"--front-toast-height":`${((ae=F[0])==null?void 0:ae.height)||0}px`,"--width":`${zv}px`,"--gap":`${b}px`,...f,...Gv(l,c)},onBlur:W=>{S.current&&!W.currentTarget.contains(W.relatedTarget)&&(S.current=!1,j.current&&(j.current.focus({preventScroll:!0}),j.current=null))},onFocus:W=>{W.target instanceof HTMLElement&&W.target.dataset.dismissible==="false"||S.current||(S.current=!0,j.current=W.relatedTarget)},onMouseEnter:()=>L(!0),onMouseMove:()=>L(!0),onMouseLeave:()=>{K||L(!1)},onDragEnd:()=>L(!1),onPointerDown:W=>{W.target instanceof HTMLElement&&W.target.dataset.dismissible==="false"||H(!0)},onPointerUp:()=>H(!1)},C.filter(W=>!W.position&&E===0||W.position===Z).map((W,fe)=>{var Re,be;return V.createElement(qv,{key:W.id,icons:w,index:fe,toast:W,defaultRichColors:d,duration:(Re=p?.duration)!=null?Re:h,className:p?.className,descriptionClassName:p?.descriptionClassName,invert:n,visibleToasts:m,closeButton:(be=p?.closeButton)!=null?be:a,interacting:K,position:Z,style:p?.style,unstyled:p?.unstyled,classNames:p?.classNames,cancelButtonStyle:p?.cancelButtonStyle,actionButtonStyle:p?.actionButtonStyle,removeToast:ie,toasts:C.filter(we=>we.position==W.position),heights:F.filter(we=>we.position==W.position),setHeights:R,expandByDefault:o,gap:b,loadingIcon:x,expanded:N,pauseWhenPageIsHidden:I,swipeDirections:e.swipeDirections})})):null}))});const kd="agim_token";function Qv(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 Xv(){try{return localStorage.getItem(kd)}catch{return null}}async function Dr(e,t,n={}){const r=t+Qv(n.query),i={...n.headers??{}},o=Xv();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 xa({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 f=await s.json();f.error&&(d=f.error),f.code&&(u=f.code,h=!0)}catch{}if(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")),s.status===401&&!t.startsWith("/api/auth/")){try{localStorage.removeItem(kd)}catch{}const f=encodeURIComponent(location.pathname+location.search);location.pathname.startsWith("/login")||(location.href=`/login?next=${f}`)}throw new xa({code:u,message:d,status:s.status})}return c?await s.json():await s.text()}class xa extends Error{code;status;constructor(t){super(t.message),this.name="ApiClientError",this.code=t.code,this.status=t.status}}const G={get:(e,t)=>Dr("GET",e,t),post:(e,t)=>Dr("POST",e,t),put:(e,t)=>Dr("PUT",e,t),patch:(e,t)=>Dr("PATCH",e,t),delete:(e,t)=>Dr("DELETE",e,t)},Jv={getA2ARecent:e=>G.get("/api/a2a/recent",{query:e}),getA2AStats:()=>G.get("/api/a2a/stats"),removeAdminAllowlist:e=>G.delete("/api/admin-allowlist",{body:e}),listAdminAllowlist:()=>G.get("/api/admin-allowlist"),addAdminAllowlist:e=>G.post("/api/admin-allowlist",{body:e}),getAgentHealth:e=>G.get("/api/agent-health",e),discoverAcpAgents:e=>G.post("/api/agents/acp/discover",{body:e}),testAcpAgent:e=>G.post("/api/agents/acp/test",{body:e}),testEmail:()=>G.post("/api/messengers/email/test"),getSearchProviders:()=>G.get("/api/search/providers"),testSearchProvider:e=>G.post("/api/search/test",{body:e}),generateMobileQR:e=>G.post("/api/mobile/qr",{body:e??{}}),getAgentsStatus:()=>G.get("/api/agents/status"),listApprovals:()=>G.get("/api/approvals"),resolveApproval:(e,t)=>G.post(`/api/approvals/${encodeURIComponent(e)}/resolve`,{body:t}),getAudit:e=>G.get("/api/audit",{query:e}),login:e=>G.post("/api/auth/login",{body:e}),logout:e=>G.post("/api/auth/logout",e),listBgJobs:e=>G.get("/api/bgjobs",{query:e}),getConfig:()=>G.get("/api/config"),updateConfig:e=>G.put("/api/config",{body:e}),listWorkspacesFull:()=>G.get("/api/workspaces",{query:{full:!0}}),upsertWorkspace:e=>G.post("/api/workspaces",{body:e}),startWechatQr:()=>G.post("/api/messengers/wechat/qr-start"),getWechatQrStatus:e=>G.get("/api/messengers/wechat/qr-status",{query:e}),getEnv:e=>G.get("/api/env",{query:e}),updateEnv:e=>G.put("/api/env",{body:e}),getHealth:e=>G.get("/api/health",e),getHealthSummary:e=>G.get("/api/health/summary",{query:e}),getHealthTopN:e=>G.get("/api/health/topn",{query:e}),invoke:e=>G.post("/api/invoke",e),listJobs:e=>G.get("/api/jobs",{query:e}),createJob:e=>G.post("/api/jobs",{body:e}),batchCancelJobs:e=>G.post("/api/jobs/batch-cancel",{body:e}),batchRunJobs:e=>G.post("/api/jobs/batch-run",{body:e}),submitLoc:e=>G.post("/api/loc",e),getLocInfo:e=>G.get("/api/loc/info",e),consolidateMemory:()=>G.post("/api/memory/consolidate"),getMemoryConsolidateStatus:()=>G.get("/api/memory/consolidate/status"),exportMemory:e=>G.get("/api/memory/export",e),deleteMemoryFacts:(e,t)=>G.delete("/api/memory/facts",{query:e,body:t}),deleteMemoryFactById:(e,t)=>G.delete(`/api/memory/facts/${e}`,{query:t}),listMemoryFacts:e=>G.get("/api/memory/facts",{query:e}),deleteMemoryPersona:e=>G.delete("/api/memory/persona",{query:e}),getMemoryPersona:e=>G.get("/api/memory/persona",{query:e}),updateMemoryPersona:(e,t)=>G.put("/api/memory/persona",{query:e,body:t}),listMemoryUsers:()=>G.get("/api/memory/users"),backfillMemoryVector:(e,t)=>G.post("/api/memory/vector/backfill",{query:e,body:t}),clearMemoryVector:e=>G.post("/api/memory/vector/clear",{query:e}),downloadMemoryVector:()=>G.post("/api/memory/vector/download"),getMemoryVectorStatus:e=>G.get("/api/memory/vector/status",{query:e}),testMemoryVector:()=>G.post("/api/memory/vector/test"),listMemos:e=>G.get("/api/memos",{query:e}),deleteMemo:e=>G.delete(`/api/memos/${e}`),getMetrics:e=>G.get("/api/metrics",e),notify:e=>G.post("/api/notify",e),listOutbox:e=>G.get("/api/outbox",{query:e}),getOutboxStats:()=>G.get("/api/outbox/stats"),retryOutbox:e=>G.post(`/api/outbox/${e}/retry`),listReminders:e=>G.get("/api/reminders",{query:e}),cancelReminder:e=>G.post(`/api/reminders/${e}/cancel`),snoozeReminder:(e,t)=>G.post(`/api/reminders/${e}/snooze`,{body:t}),listSchedules:e=>G.get("/api/schedules",{query:e}),restartService:()=>G.post("/api/service/restart"),startService:()=>G.post("/api/service/start"),getServiceStatus:()=>G.get("/api/service/status"),stopService:()=>G.post("/api/service/stop"),listSkills:()=>G.get("/api/skills"),getSkillDetail:e=>G.get(`/api/skills/${encodeURIComponent(e)}`),getSkillsRemoteHot:()=>G.get("/api/skills/remote/hot"),listSubtasks:e=>G.get("/api/subtasks",{query:e}),listViewerPastes:e=>G.get("/api/viewer",e),getViewerTunnel:()=>G.get("/api/viewer/tunnel"),getWorkspaceFiles:e=>G.get("/api/workspace-files",{query:e}),writeWorkspaceFile:(e,t)=>G.put("/api/workspace-files",{query:e,body:t})};function Zv(e,t){if(e instanceof xa){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 Sd=g.forwardRef(({className:e,...t},n)=>v.jsx("div",{ref:n,className:Le("rounded-lg border border-border bg-surface text-text shadow-sm",e),...t}));Sd.displayName="Card";const Ed=g.forwardRef(({className:e,...t},n)=>v.jsx("div",{ref:n,className:Le("flex flex-col space-y-1 p-3 sm:p-4",e),...t}));Ed.displayName="CardHeader";const Cd=g.forwardRef(({className:e,...t},n)=>v.jsx("div",{ref:n,className:Le("text-md font-semibold leading-tight",e),...t}));Cd.displayName="CardTitle";const Ad=g.forwardRef(({className:e,...t},n)=>v.jsx("div",{ref:n,className:Le("text-sm text-text-dim",e),...t}));Ad.displayName="CardDescription";const Td=g.forwardRef(({className:e,...t},n)=>v.jsx("div",{ref:n,className:Le("p-3 pt-0 sm:p-4 sm:pt-0",e),...t}));Td.displayName="CardContent";const Rd=g.forwardRef(({className:e,...t},n)=>v.jsx("div",{ref:n,className:Le("flex items-center p-5 pt-0 sm:p-6 sm:pt-0 gap-2",e),...t}));Rd.displayName="CardFooter";const Pd=g.forwardRef(({className:e,type:t,...n},r)=>v.jsx("input",{type:t,className:Le("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}));Pd.displayName="Input";var eb=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],Ue=eb.reduce((e,t)=>{const n=Gr(`Primitive.${t}`),r=g.forwardRef((i,o)=>{const{asChild:a,...s}=i,l=a?n:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),v.jsx(l,{...s,ref:o})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{});function tb(e,t){e&&vr.flushSync(()=>e.dispatchEvent(t))}var nb="Label",Id=g.forwardRef((e,t)=>v.jsx(Ue.label,{...e,ref:t,onMouseDown:n=>{n.target.closest("button, input, select, textarea")||(e.onMouseDown?.(n),!n.defaultPrevented&&n.detail>1&&n.preventDefault())}}));Id.displayName=nb;var Ld=Id;const rb=rs("text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70"),Od=g.forwardRef(({className:e,...t},n)=>v.jsx(Ld,{ref:n,className:Le(rb(),e),...t}));Od.displayName=Ld.displayName;function ib(e){if(!e)return"/";try{const t=decodeURIComponent(e);if(t.startsWith("/")&&!t.startsWith("//"))return t}catch{}return"/"}function ob(){const{t:e}=kt(),t=ao(),[n]=fg(),r=ns(c=>c.setToken),[i,o]=g.useState(""),a=ib(n.get("next")),s=kv({mutationFn:c=>Jv.login({token:c}),onSuccess:()=>{r(i.trim()),Ot.success(e("states.saved")),t(a,{replace:!0})},onError:c=>{const{message:u}=Zv(c,e);Ot.error(u)}});function l(c){c.preventDefault();const u=i.trim();u&&s.mutate(u)}return v.jsx("div",{className:"grid min-h-dvh place-items-center bg-bg px-4 py-8 pt-safe",children:v.jsxs(Sd,{className:"w-full max-w-md",children:[v.jsxs(Ed,{children:[v.jsxs(Cd,{className:"text-xl",children:[v.jsx("span",{className:"mr-2",children:"🤖"}),e("appName")]}),v.jsx(Ad,{children:e("login.intro",{defaultValue:"Paste your access token from ~/.agim/tokens.json or `agim token list`."})})]}),v.jsx(Td,{children:v.jsxs("form",{onSubmit:l,className:"flex flex-col gap-4",children:[v.jsxs("div",{className:"flex flex-col gap-2",children:[v.jsx(Od,{htmlFor:"token",children:e("login.tokenLabel",{defaultValue:"Access token"})}),v.jsx(Pd,{id:"token",type:"password",value:i,onChange:c=>o(c.target.value),placeholder:"agim_••••••••",autoComplete:"off",autoFocus:!0,required:!0})]}),v.jsx(bt,{type:"submit",size:"lg",disabled:s.isPending||i.trim().length===0,children:s.isPending?e("states.loading"):e("login.submit",{defaultValue:"Sign in"})})]})}),v.jsx(Rd,{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 IMHUB_TRUST_LOOPBACK=off."})})]})})}const Bl=[1e3,2e3,5e3,1e4,3e4];function ab(e){return`${location.protocol==="https:"?"wss:":"ws:"}//${location.host}${e}`}let Mr=null;function sb(){if(Mr)return Mr;let e=null,t="connecting",n=0,r=null,i=!1;const o=new Set;function a(y){t=y;for(const b of o)b.type==="status"&&b.fn(y)}function s(y){for(const b of o)b.type==="message"&&b.fn(y)}function l(){r!=null&&(clearTimeout(r),r=null)}function c(){if(i)return;l();const y=Bl[Math.min(n,Bl.length-1)]??3e4;n+=1,r=setTimeout(()=>u(),y)}function u(){l(),a("connecting");try{e=new WebSocket(ab("/ws"))}catch(y){a("error"),console.warn("[ws] construct failed",y),c();return}e.addEventListener("open",()=>{n=0,a("open")}),e.addEventListener("message",y=>{let b;try{b=JSON.parse(y.data)}catch{console.warn("[ws] bad json",y.data?.slice?.(0,200));return}s(b)}),e.addEventListener("close",()=>{a("closed"),i||c()}),e.addEventListener("error",()=>{a("error")})}function d(y){if(!e||e.readyState!==WebSocket.OPEN)return!1;try{return e.send(JSON.stringify(y)),!0}catch{return!1}}function h(y){return o.add(y),y.type==="status"&&y.fn(t),()=>{o.delete(y)}}function f(){i=!0,l();try{e?.close()}catch{}e=null,Mr=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(),Mr={send:d,subscribe:h,status:()=>t,close:()=>{document.removeEventListener("visibilitychange",m),window.removeEventListener("online",p),f()}},Mr}const lb=1200,cb={messages:[],pendingApprovals:[],agents:[],agent:"",status:"connecting",currentReplyId:null,error:null};function ub(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"RESET_CONVERSATION":return{...e,messages:[],pendingApprovals:[],currentReplyId:null,error:null};case"CLEAR_ERROR":return{...e,error:null}}}function db(e){switch(e.decision){case"allowed":Ot.success("已批准");return;case"allowed-pinned":Ot.success("已批准 · 后续同类自动放行");return;case"denied":Ot.error("已拒绝");return;case"denied-revoked":Ot.error("已拒绝 · 撤销自动放行规则");return;case"expired":Ot.warning("已过期");return}}let Ul=0;function zl(e){return Ul+=1,`${e}-${Date.now()}-${Ul}`}function fb(){const[e,t]=g.useReducer(ub,cb),n=g.useRef(sb()),r=g.useRef(new Map),i=g.useRef(!1),o=g.useRef(null);g.useEffect(()=>{o.current=e.currentReplyId},[e.currentReplyId]),g.useEffect(()=>{const f=n.current,m=f.subscribe({type:"status",fn:T=>t({kind:"WS_STATUS",status:T})}),p=f.subscribe({type:"message",fn:T=>a(T)});function y(){try{const I=localStorage.getItem("agim-web-thread-id");if(I&&/^web-[A-Za-z0-9_-]{4,64}$/.test(I))return I}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 b=y();function x(){f.send({type:"get-history",threadId:b}),f.send({type:"get-agents"})}let w=()=>{};return f.status()==="open"?x():w=f.subscribe({type:"status",fn:T=>{T==="open"&&(x(),w())}}),()=>{m(),p(),w()}},[]);function a(f){switch(f.type){case"init":t({kind:"INIT",agents:f.agents,defaultAgent:f.defaultAgent});return;case"history":t({kind:"HISTORY",agent:f.agent,messages:f.messages.map((m,p)=>({id:`hist-${p}`,role:m.role,content:m.content,agent:m.agent,timestamp:m.timestamp?Date.parse(m.timestamp):Date.now()-p*1e3}))});return;case"agents":t({kind:"AGENTS",agents:f.agents});return;case"agent-switched":t({kind:"AGENT_SWITCHED",agent:f.agent});return;case"chunk":s(f.text);return;case"done":l(),t({kind:"DONE",replyId:o.current??"",finalText:f.text});return;case"error":l(),t({kind:"ERROR",message:f.message});return;case"approval-card":t({kind:"APPROVAL_CARD",messageId:f.messageId,prompt:f.prompt});return;case"approval-card-edit":t({kind:"APPROVAL_EDIT",messageId:f.messageId,outcome:f.outcome}),db(f.outcome),window.setTimeout(()=>{t({kind:"APPROVAL_DISMISS",messageId:f.messageId})},lb);return;case"approval-text":Ot.info(f.text);return;case"metrics":return;default:return}}function s(f){const m=o.current;if(!m)return;const p=r.current.get(m)??"";r.current.set(m,p+f),!i.current&&(i.current=!0,requestAnimationFrame(()=>{i.current=!1,l()}))}function l(){for(const[f,m]of r.current.entries())m&&t({kind:"CHUNK",replyId:f,text:m});r.current.clear()}function c(f){const m=f.trim();if(!m)return;const p=n.current,y=zl("u"),b=zl("a");t({kind:"SEND_USER",message:{id:y,role:"user",content:m,timestamp:Date.now()},placeholder:{id:b,role:"assistant",content:"",agent:e.agent,timestamp:Date.now()}}),p.send({type:"message",text:m,agent:e.agent})||t({kind:"ERROR",message:"Not connected. Reconnecting…"})}function u(f){n.current.send({type:"switch-agent",agent:f})}function d(f,m,p){const y=n.current.send({type:"approval-action",data:`apv:${m}:${p}`,messageId:f});return y||t({kind:"ERROR",message:"Not connected. Reconnecting — try clicking again in a moment."}),y}function h(){t({kind:"RESET_CONVERSATION"}),n.current.send({type:"new-conversation"})}return{state:e,send:c,switchAgent:u,approvalClick:d,newConversation:h,clearError:()=>t({kind:"CLEAR_ERROR"})}}const hb=rs(["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 st({className:e,variant:t,...n}){return v.jsx("span",{className:Le(hb({variant:t}),e),...n})}function pb(e,t){const n={};return(e[e.length-1]===""?[...e,""]:e).join((n.padRight?" ":"")+","+(n.padLeft===!1?"":" ")).trim()}const mb=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,gb=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,yb={};function $l(e,t){return(yb.jsx?gb:mb).test(e)}const vb=/[ \t\n\f\r]/g;function bb(e){return typeof e=="object"?e.type==="text"?Vl(e.value):!1:Vl(e)}function Vl(e){return e.replace(vb,"")===""}class ri{constructor(t,n,r){this.normal=n,this.property=t,r&&(this.space=r)}}ri.prototype.normal={};ri.prototype.property={};ri.prototype.space=void 0;function _d(e,t){const n={},r={};for(const i of e)Object.assign(n,i.property),Object.assign(r,i.normal);return new ri(n,r,t)}function wa(e){return e.toLowerCase()}class pt{constructor(t,n){this.attribute=n,this.property=t}}pt.prototype.attribute="";pt.prototype.booleanish=!1;pt.prototype.boolean=!1;pt.prototype.commaOrSpaceSeparated=!1;pt.prototype.commaSeparated=!1;pt.prototype.defined=!1;pt.prototype.mustUseProperty=!1;pt.prototype.number=!1;pt.prototype.overloadedBoolean=!1;pt.prototype.property="";pt.prototype.spaceSeparated=!1;pt.prototype.space=void 0;let xb=0;const ue=Gn(),qe=Gn(),ka=Gn(),B=Gn(),Ne=Gn(),Hn=Gn(),gt=Gn();function Gn(){return 2**++xb}const Sa=Object.freeze(Object.defineProperty({__proto__:null,boolean:ue,booleanish:qe,commaOrSpaceSeparated:gt,commaSeparated:Hn,number:B,overloadedBoolean:ka,spaceSeparated:Ne},Symbol.toStringTag,{value:"Module"})),_o=Object.keys(Sa);class ss extends pt{constructor(t,n,r,i){let o=-1;if(super(t,n),Kl(this,"space",i),typeof r=="number")for(;++o<_o.length;){const a=_o[o];Kl(this,_o[o],(r&Sa[a])===Sa[a])}}}ss.prototype.defined=!0;function Kl(e,t,n){n&&(e[t]=n)}function wr(e){const t={},n={};for(const[r,i]of Object.entries(e.properties)){const o=new ss(r,e.transform(e.attributes||{},r),i,e.space);e.mustUseProperty&&e.mustUseProperty.includes(r)&&(o.mustUseProperty=!0),t[r]=o,n[wa(r)]=r,n[wa(o.attribute)]=r}return new ri(t,n,e.space)}const Nd=wr({properties:{ariaActiveDescendant:null,ariaAtomic:qe,ariaAutoComplete:null,ariaBusy:qe,ariaChecked:qe,ariaColCount:B,ariaColIndex:B,ariaColSpan:B,ariaControls:Ne,ariaCurrent:null,ariaDescribedBy:Ne,ariaDetails:null,ariaDisabled:qe,ariaDropEffect:Ne,ariaErrorMessage:null,ariaExpanded:qe,ariaFlowTo:Ne,ariaGrabbed:qe,ariaHasPopup:null,ariaHidden:qe,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:Ne,ariaLevel:B,ariaLive:null,ariaModal:qe,ariaMultiLine:qe,ariaMultiSelectable:qe,ariaOrientation:null,ariaOwns:Ne,ariaPlaceholder:null,ariaPosInSet:B,ariaPressed:qe,ariaReadOnly:qe,ariaRelevant:null,ariaRequired:qe,ariaRoleDescription:Ne,ariaRowCount:B,ariaRowIndex:B,ariaRowSpan:B,ariaSelected:qe,ariaSetSize:B,ariaSort:null,ariaValueMax:B,ariaValueMin:B,ariaValueNow:B,ariaValueText:null,role:null},transform(e,t){return t==="role"?t:"aria-"+t.slice(4).toLowerCase()}});function Dd(e,t){return t in e?e[t]:t}function Md(e,t){return Dd(e,t.toLowerCase())}const wb=wr({attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:Hn,acceptCharset:Ne,accessKey:Ne,action:null,allow:null,allowFullScreen:ue,allowPaymentRequest:ue,allowUserMedia:ue,alpha:ue,alt:null,as:null,async:ue,autoCapitalize:null,autoComplete:Ne,autoFocus:ue,autoPlay:ue,blocking:Ne,capture:null,charSet:null,checked:ue,cite:null,className:Ne,closedBy:null,colorSpace:null,cols:B,colSpan:B,command:null,commandFor:null,content:null,contentEditable:qe,controls:ue,controlsList:Ne,coords:B|Hn,crossOrigin:null,data:null,dateTime:null,decoding:null,default:ue,defer:ue,dir:null,dirName:null,disabled:ue,download:ka,draggable:qe,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:ue,formTarget:null,headers:Ne,height:B,hidden:ka,high:B,href:null,hrefLang:null,htmlFor:Ne,httpEquiv:Ne,id:null,imageSizes:null,imageSrcSet:null,inert:ue,inputMode:null,integrity:null,is:null,isMap:ue,itemId:null,itemProp:Ne,itemRef:Ne,itemScope:ue,itemType:Ne,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:ue,low:B,manifest:null,max:null,maxLength:B,media:null,method:null,min:null,minLength:B,multiple:ue,muted:ue,name:null,nonce:null,noModule:ue,noValidate:ue,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:ue,optimum:B,pattern:null,ping:Ne,placeholder:null,playsInline:ue,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:ue,referrerPolicy:null,rel:Ne,required:ue,reversed:ue,rows:B,rowSpan:B,sandbox:Ne,scope:null,scoped:ue,seamless:ue,selected:ue,shadowRootClonable:ue,shadowRootCustomElementRegistry:ue,shadowRootDelegatesFocus:ue,shadowRootMode:null,shadowRootSerializable:ue,shape:null,size:B,sizes:null,slot:null,span:B,spellCheck:qe,src:null,srcDoc:null,srcLang:null,srcSet:null,start:B,step:null,style:null,tabIndex:B,target:null,title:null,translate:null,type:null,typeMustMatch:ue,useMap:null,value:qe,width:B,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:Ne,axis:null,background:null,bgColor:null,border:B,borderColor:null,bottomMargin:B,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:ue,declare:ue,event:null,face:null,frame:null,frameBorder:null,hSpace:B,leftMargin:B,link:null,longDesc:null,lowSrc:null,marginHeight:B,marginWidth:B,noResize:ue,noHref:ue,noShade:ue,noWrap:ue,object:null,profile:null,prompt:null,rev:null,rightMargin:B,rules:null,scheme:null,scrolling:qe,standby:null,summary:null,text:null,topMargin:B,valueType:null,version:null,vAlign:null,vLink:null,vSpace:B,allowTransparency:null,autoCorrect:null,autoSave:null,credentialless:ue,disablePictureInPicture:ue,disableRemotePlayback:ue,exportParts:Hn,part:Ne,prefix:null,property:null,results:B,security:null,unselectable:null},space:"html",transform:Md}),kb=wr({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:gt,accentHeight:B,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:B,amplitude:B,arabicForm:null,ascent:B,attributeName:null,attributeType:null,azimuth:B,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:B,by:null,calcMode:null,capHeight:B,className:Ne,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:B,diffuseConstant:B,direction:null,display:null,dur:null,divisor:B,dominantBaseline:null,download:ue,dx:null,dy:null,edgeMode:null,editable:null,elevation:B,enableBackground:null,end:null,event:null,exponent:B,externalResourcesRequired:null,fill:null,fillOpacity:B,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:Hn,g2:Hn,glyphName:Hn,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:B,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:B,horizOriginX:B,horizOriginY:B,id:null,ideographic:B,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:B,k:B,k1:B,k2:B,k3:B,k4:B,kernelMatrix:gt,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:B,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:B,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:B,overlineThickness:B,paintOrder:null,panose1:null,path:null,pathLength:B,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:Ne,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:B,pointsAtY:B,pointsAtZ:B,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:gt,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:gt,rev:gt,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:gt,requiredFeatures:gt,requiredFonts:gt,requiredFormats:gt,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:B,specularExponent:B,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:B,strikethroughThickness:B,string:null,stroke:null,strokeDashArray:gt,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:B,strokeOpacity:B,strokeWidth:null,style:null,surfaceScale:B,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:gt,tabIndex:B,tableValues:null,target:null,targetX:B,targetY:B,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:gt,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:B,underlineThickness:B,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:B,values:null,vAlphabetic:B,vMathematical:B,vectorEffect:null,vHanging:B,vIdeographic:B,version:null,vertAdvY:B,vertOriginX:B,vertOriginY:B,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:B,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:"svg",transform:Dd}),jd=wr({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()}}),Fd=wr({attributes:{xmlnsxlink:"xmlns:xlink"},properties:{xmlnsXLink:null,xmlns:null},space:"xmlns",transform:Md}),Hd=wr({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:"xml",transform(e,t){return"xml:"+t.slice(3).toLowerCase()}}),Sb={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"},Eb=/[A-Z]/g,Wl=/-[a-z]/g,Cb=/^data[-\w.:]+$/i;function Ab(e,t){const n=wa(t);let r=t,i=pt;if(n in e.normal)return e.property[e.normal[n]];if(n.length>4&&n.slice(0,4)==="data"&&Cb.test(t)){if(t.charAt(4)==="-"){const o=t.slice(5).replace(Wl,Rb);r="data"+o.charAt(0).toUpperCase()+o.slice(1)}else{const o=t.slice(4);if(!Wl.test(o)){let a=o.replace(Eb,Tb);a.charAt(0)!=="-"&&(a="-"+a),t="data"+a}}i=ss}return new i(r,t)}function Tb(e){return"-"+e.toLowerCase()}function Rb(e){return e.charAt(1).toUpperCase()}const Pb=_d([Nd,wb,jd,Fd,Hd],"html"),ls=_d([Nd,kb,jd,Fd,Hd],"svg");function Ib(e){return e.join(" ").trim()}var cs={},ql=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,Lb=/\n/g,Ob=/^\s*/,_b=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,Nb=/^:\s*/,Db=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,Mb=/^[;\s]*/,jb=/^\s+|\s+$/g,Fb=`
130
+ `,Gl="/",Yl="*",Dn="",Hb="comment",Bb="declaration";function Ub(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(Lb);p&&(n+=p.length);var y=m.lastIndexOf(Fb);r=~y?m.length-y: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 y=p[0];return i(y),e=e.slice(y.length),p}}function c(){l(Ob)}function u(m){var p;for(m=m||[];p=d();)p!==!1&&m.push(p);return m}function d(){var m=o();if(!(Gl!=e.charAt(0)||Yl!=e.charAt(1))){for(var p=2;Dn!=e.charAt(p)&&(Yl!=e.charAt(p)||Gl!=e.charAt(p+1));)++p;if(p+=2,Dn===e.charAt(p-1))return s("End of comment missing");var y=e.slice(2,p-2);return r+=2,i(y),e=e.slice(p),r+=2,m({type:Hb,comment:y})}}function h(){var m=o(),p=l(_b);if(p){if(d(),!l(Nb))return s("property missing ':'");var y=l(Db),b=m({type:Bb,property:Ql(p[0].replace(ql,Dn)),value:y?Ql(y[0].replace(ql,Dn)):Dn});return l(Mb),b}}function f(){var m=[];u(m);for(var p;p=h();)p!==!1&&(m.push(p),u(m));return m}return c(),f()}function Ql(e){return e?e.replace(jb,Dn):Dn}var zb=Ub,$b=_i&&_i.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(cs,"__esModule",{value:!0});cs.default=Kb;const Vb=$b(zb);function Kb(e,t){let n=null;if(!e||typeof e!="string")return n;const r=(0,Vb.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 Wb=/^--[a-zA-Z0-9_-]+$/,qb=/-([a-z])/g,Gb=/^[^-]+$/,Yb=/^-(webkit|moz|ms|o|khtml)-/,Qb=/^-(ms)-/,Xb=function(e){return!e||Gb.test(e)||Wb.test(e)},Jb=function(e,t){return t.toUpperCase()},Xl=function(e,t){return"".concat(t,"-")},Zb=function(e,t){return t===void 0&&(t={}),Xb(e)?e:(e=e.toLowerCase(),t.reactCompat?e=e.replace(Qb,Xl):e=e.replace(Yb,Xl),e.replace(qb,Jb))};lo.camelCase=Zb;var ex=_i&&_i.__importDefault||function(e){return e&&e.__esModule?e:{default:e}},tx=ex(cs),nx=lo;function Ea(e,t){var n={};return!e||typeof e!="string"||(0,tx.default)(e,function(r,i){r&&i&&(n[(0,nx.camelCase)(r,t)]=i)}),n}Ea.default=Ea;var rx=Ea;const ix=_u(rx),Bd=Ud("end"),us=Ud("start");function Ud(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 ox(e){const t=us(e),n=Bd(e);if(t&&n)return{start:t,end:n}}function zr(e){return!e||typeof e!="object"?"":"position"in e||"type"in e?Jl(e.position):"start"in e||"end"in e?Jl(e):"line"in e||"column"in e?Ca(e):""}function Ca(e){return Zl(e&&e.line)+":"+Zl(e&&e.column)}function Jl(e){return Ca(e&&e.start)+"-"+Ca(e&&e.end)}function Zl(e){return e&&typeof e=="number"?e:1}class ot 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=zr(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}}ot.prototype.file="";ot.prototype.name="";ot.prototype.reason="";ot.prototype.message="";ot.prototype.stack="";ot.prototype.column=void 0;ot.prototype.line=void 0;ot.prototype.ancestors=void 0;ot.prototype.cause=void 0;ot.prototype.fatal=void 0;ot.prototype.place=void 0;ot.prototype.ruleId=void 0;ot.prototype.source=void 0;const ds={}.hasOwnProperty,ax=new Map,sx=/[A-Z]/g,lx=new Set(["table","tbody","thead","tfoot","tr"]),cx=new Set(["td","th"]),zd="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function ux(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=vx(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=yx(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"?ls:Pb,stylePropertyNameCase:t.stylePropertyNameCase||"dom",tableCellAlignToStyle:t.tableCellAlignToStyle!==!1},o=$d(i,e,void 0);return o&&typeof o!="string"?o:i.create(e,i.Fragment,{children:o||void 0},void 0)}function $d(e,t,n){if(t.type==="element")return dx(e,t,n);if(t.type==="mdxFlowExpression"||t.type==="mdxTextExpression")return fx(e,t);if(t.type==="mdxJsxFlowElement"||t.type==="mdxJsxTextElement")return px(e,t,n);if(t.type==="mdxjsEsm")return hx(e,t);if(t.type==="root")return mx(e,t,n);if(t.type==="text")return gx(e,t)}function dx(e,t,n){const r=e.schema;let i=r;t.tagName.toLowerCase()==="svg"&&r.space==="html"&&(i=ls,e.schema=i),e.ancestors.push(t);const o=Kd(e,t.tagName,!1),a=bx(e,t);let s=hs(e,t);return lx.has(t.tagName)&&(s=s.filter(function(l){return typeof l=="string"?!bb(l):!0})),Vd(e,a,o,t),fs(a,s),e.ancestors.pop(),e.schema=r,e.create(t,o,a,n)}function fx(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)}Qr(e,t.position)}function hx(e,t){if(t.data&&t.data.estree&&e.evaluater)return e.evaluater.evaluateProgram(t.data.estree);Qr(e,t.position)}function px(e,t,n){const r=e.schema;let i=r;t.name==="svg"&&r.space==="html"&&(i=ls,e.schema=i),e.ancestors.push(t);const o=t.name===null?e.Fragment:Kd(e,t.name,!0),a=xx(e,t),s=hs(e,t);return Vd(e,a,o,t),fs(a,s),e.ancestors.pop(),e.schema=r,e.create(t,o,a,n)}function mx(e,t,n){const r={};return fs(r,hs(e,t)),e.create(t,e.Fragment,r,n)}function gx(e,t){return t.value}function Vd(e,t,n,r){typeof n!="string"&&n!==e.Fragment&&e.passNode&&(t.node=r)}function fs(e,t){if(t.length>0){const n=t.length>1?t:t[0];n&&(e.children=n)}}function yx(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 vx(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 bx(e,t){const n={};let r,i;for(i in t.properties)if(i!=="children"&&ds.call(t.properties,i)){const o=wx(e,i,t.properties[i]);if(o){const[a,s]=o;e.tableCellAlignToStyle&&a==="align"&&typeof s=="string"&&cx.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 xx(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 Qr(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 Qr(e,t.position);else o=r.value===null?!0:r.value;n[i]=o}return n}function hs(e,t){const n=[];let r=-1;const i=e.passKeys?new Map:ax;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=$d(e,o,a);s!==void 0&&n.push(s)}return n}function wx(e,t,n){const r=Ab(e.schema,t);if(!(n==null||typeof n=="number"&&Number.isNaN(n))){if(Array.isArray(n)&&(n=r.commaSeparated?pb(n):Ib(n)),r.property==="style"){let i=typeof n=="object"?n:kx(e,String(n));return e.stylePropertyNameCase==="css"&&(i=Sx(i)),["style",i]}return[e.elementAttributeNameCase==="react"&&r.space?Sb[r.property]||r.property:r.attribute,n]}}function kx(e,t){try{return ix(t,{reactCompat:!0})}catch(n){if(e.ignoreInvalidStyle)return{};const r=n,i=new ot("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=zd+"#cannot-parse-style-attribute",i}}function Kd(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=$l(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=$l(t)&&!/^[a-z]/.test(t)?{type:"Identifier",name:t}:{type:"Literal",value:t};if(r.type==="Literal"){const i=r.value;return ds.call(e.components,i)?e.components[i]:i}if(e.evaluater)return e.evaluater.evaluateExpression(r);Qr(e)}function Qr(e,t){const n=new ot("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=zd+"#cannot-handle-mdx-estrees-without-createevaluater",n}function Sx(e){const t={};let n;for(n in e)ds.call(e,n)&&(t[Ex(n)]=e[n]);return t}function Ex(e){let t=e.replace(sx,Cx);return t.slice(0,3)==="ms-"&&(t="-"+t),t}function Cx(e){return"-"+e.toLowerCase()}const No={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"]},Ax={};function ps(e,t){const n=Ax,r=typeof n.includeImageAlt=="boolean"?n.includeImageAlt:!0,i=typeof n.includeHtml=="boolean"?n.includeHtml:!0;return Wd(e,r,i)}function Wd(e,t,n){if(Tx(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 ec(e.children,t,n)}return Array.isArray(e)?ec(e,t,n):""}function ec(e,t,n){const r=[];let i=-1;for(;++i<e.length;)r[i]=Wd(e[i],t,n);return r.join("")}function Tx(e){return!!(e&&typeof e=="object")}const tc=document.createElement("i");function ms(e){const t="&"+e+";";tc.innerHTML=t;const n=tc.textContent;return n.charCodeAt(n.length-1)===59&&e!=="semi"||n===t?!1:n}function xt(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 Ct(e,t){return e.length>0?(xt(e,e.length,0,t),e):t}const nc={}.hasOwnProperty;function qd(e){const t={};let n=-1;for(;++n<e.length;)Rx(t,e[n]);return t}function Rx(e,t){let n;for(n in t){const i=(nc.call(e,n)?e[n]:void 0)||(e[n]={}),o=t[n];let a;if(o)for(a in o){nc.call(i,a)||(i[a]=[]);const s=o[a];Px(i[a],Array.isArray(s)?s:s?[s]:[])}}}function Px(e,t){let n=-1;const r=[];for(;++n<t.length;)(t[n].add==="after"?e:r).push(t[n]);xt(e,0,0,r)}function Gd(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 _t(e){return e.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}const lt=kn(/[A-Za-z]/),it=kn(/[\dA-Za-z]/),Ix=kn(/[#-'*+\--9=?A-Z^-~]/);function Bi(e){return e!==null&&(e<32||e===127)}const Aa=kn(/\d/),Lx=kn(/[\dA-Fa-f]/),Ox=kn(/[!-/:-@[-`{-~]/);function oe(e){return e!==null&&e<-2}function De(e){return e!==null&&(e<0||e===32)}function ke(e){return e===-2||e===-1||e===32}const co=kn(/\p{P}|\p{S}/u),$n=kn(/\s/);function kn(e){return t;function t(n){return n!==null&&n>-1&&e.test(String.fromCharCode(n))}}function kr(e){const t=[];let n=-1,r=0,i=0;for(;++n<e.length;){const o=e.charCodeAt(n);let a="";if(o===37&&it(e.charCodeAt(n+1))&&it(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 Ce(e,t,n,r){const i=r?r-1:Number.POSITIVE_INFINITY;let o=0;return a;function a(l){return ke(l)?(e.enter(n),s(l)):t(l)}function s(l){return ke(l)&&o++<i?(e.consume(l),s):(e.exit(n),t(l))}}const _x={tokenize:Nx};function Nx(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"),Ce(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 Dx={tokenize:Mx},rc={tokenize:jx};function Mx(e){const t=this,n=[];let r=0,i,o,a;return s;function s(w){if(r<n.length){const T=n[r];return t.containerState=T[1],e.attempt(T[0].continuation,l,c)(w)}return c(w)}function l(w){if(r++,t.containerState._closeFlow){t.containerState._closeFlow=void 0,i&&x();const T=t.events.length;let I=T,C;for(;I--;)if(t.events[I][0]==="exit"&&t.events[I][1].type==="chunkFlow"){C=t.events[I][1].end;break}b(r);let k=T;for(;k<t.events.length;)t.events[k][1].end={...C},k++;return xt(t.events,I+1,0,t.events.slice(T)),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(rc,u,d)(w)}function u(w){return i&&x(),b(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(rc,f,m)(w)}function f(w){return r++,n.push([t.currentConstruct,t.containerState]),h(w)}function m(w){if(w===null){i&&x(),b(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){y(e.exit("chunkFlow"),!0),b(0),e.consume(w);return}return oe(w)?(e.consume(w),y(e.exit("chunkFlow")),r=0,t.interrupt=void 0,s):(e.consume(w),p)}function y(w,T){const I=t.sliceStream(w);if(T&&I.push(null),w.previous=o,o&&(o.next=w),o=w,i.defineSkip(w.start),i.write(I),t.parser.lazy[w.start.line]){let C=i.events.length;for(;C--;)if(i.events[C][1].start.offset<a&&(!i.events[C][1].end||i.events[C][1].end.offset>a))return;const k=t.events.length;let D=k,F,R;for(;D--;)if(t.events[D][0]==="exit"&&t.events[D][1].type==="chunkFlow"){if(F){R=t.events[D][1].end;break}F=!0}for(b(r),C=k;C<t.events.length;)t.events[C][1].end={...R},C++;xt(t.events,D+1,0,t.events.slice(k)),t.events.length=C}}function b(w){let T=n.length;for(;T-- >w;){const I=n[T];t.containerState=I[1],I[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 jx(e,t,n){return Ce(e,e.attempt(this.parser.constructs.document,t,n),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}function pr(e){if(e===null||De(e)||$n(e))return 1;if(co(e))return 2}function uo(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 Ta={name:"attention",resolveAll:Fx,tokenize:Hx};function Fx(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};ic(d,-l),ic(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=Ct(c,[["enter",e[r][1],t],["exit",e[r][1],t]])),c=Ct(c,[["enter",i,t],["enter",a,t],["exit",a,t],["enter",o,t]]),c=Ct(c,uo(t.parser.constructs.insideSpan.null,e.slice(r+1,n),t)),c=Ct(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=Ct(c,[["enter",e[n][1],t],["exit",e[n][1],t]])):u=0,xt(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 Hx(e,t){const n=this.parser.constructs.attentionMarkers.null,r=this.previous,i=pr(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=pr(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 ic(e,t){e.column+=t,e.offset+=t,e._bufferIndex+=t}const Bx={name:"autolink",tokenize:Ux};function Ux(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 lt(f)?(e.consume(f),a):f===64?n(f):c(f)}function a(f){return f===43||f===45||f===46||it(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||it(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||Bi(f)?n(f):(e.consume(f),l)}function c(f){return f===64?(e.consume(f),u):Ix(f)?(e.consume(f),c):n(f)}function u(f){return it(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||it(f))&&r++<63){const m=f===45?h:d;return e.consume(f),m}return n(f)}}const ii={partial:!0,tokenize:zx};function zx(e,t,n){return r;function r(o){return ke(o)?Ce(e,i,"linePrefix")(o):i(o)}function i(o){return o===null||oe(o)?t(o):n(o)}}const Yd={continuation:{tokenize:Vx},exit:Kx,name:"blockQuote",tokenize:$x};function $x(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 ke(a)?(e.enter("blockQuotePrefixWhitespace"),e.consume(a),e.exit("blockQuotePrefixWhitespace"),e.exit("blockQuotePrefix"),t):(e.exit("blockQuotePrefix"),t(a))}}function Vx(e,t,n){const r=this;return i;function i(a){return ke(a)?Ce(e,o,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(a):o(a)}function o(a){return e.attempt(Yd,t,n)(a)}}function Kx(e){e.exit("blockQuote")}const Qd={name:"characterEscape",tokenize:Wx};function Wx(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 Ox(o)?(e.enter("characterEscapeValue"),e.consume(o),e.exit("characterEscapeValue"),e.exit("characterEscape"),t):n(o)}}const Xd={name:"characterReference",tokenize:qx};function qx(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=it,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=Lx,u):(e.enter("characterReferenceValue"),o=7,a=Aa,u(d))}function u(d){if(d===59&&i){const h=e.exit("characterReferenceValue");return a===it&&!ms(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 oc={partial:!0,tokenize:Yx},ac={concrete:!0,name:"codeFenced",tokenize:Gx};function Gx(e,t,n){const r=this,i={partial:!0,tokenize:I};let o=0,a=0,s;return l;function l(C){return c(C)}function c(C){const k=r.events[r.events.length-1];return o=k&&k[1].type==="linePrefix"?k[2].sliceSerialize(k[1],!0).length:0,s=C,e.enter("codeFenced"),e.enter("codeFencedFence"),e.enter("codeFencedFenceSequence"),u(C)}function u(C){return C===s?(a++,e.consume(C),u):a<3?n(C):(e.exit("codeFencedFenceSequence"),ke(C)?Ce(e,d,"whitespace")(C):d(C))}function d(C){return C===null||oe(C)?(e.exit("codeFencedFence"),r.interrupt?t(C):e.check(oc,p,T)(C)):(e.enter("codeFencedFenceInfo"),e.enter("chunkString",{contentType:"string"}),h(C))}function h(C){return C===null||oe(C)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),d(C)):ke(C)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),Ce(e,f,"whitespace")(C)):C===96&&C===s?n(C):(e.consume(C),h)}function f(C){return C===null||oe(C)?d(C):(e.enter("codeFencedFenceMeta"),e.enter("chunkString",{contentType:"string"}),m(C))}function m(C){return C===null||oe(C)?(e.exit("chunkString"),e.exit("codeFencedFenceMeta"),d(C)):C===96&&C===s?n(C):(e.consume(C),m)}function p(C){return e.attempt(i,T,y)(C)}function y(C){return e.enter("lineEnding"),e.consume(C),e.exit("lineEnding"),b}function b(C){return o>0&&ke(C)?Ce(e,x,"linePrefix",o+1)(C):x(C)}function x(C){return C===null||oe(C)?e.check(oc,p,T)(C):(e.enter("codeFlowValue"),w(C))}function w(C){return C===null||oe(C)?(e.exit("codeFlowValue"),x(C)):(e.consume(C),w)}function T(C){return e.exit("codeFenced"),t(C)}function I(C,k,D){let F=0;return R;function R(z){return C.enter("lineEnding"),C.consume(z),C.exit("lineEnding"),N}function N(z){return C.enter("codeFencedFence"),ke(z)?Ce(C,L,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(z):L(z)}function L(z){return z===s?(C.enter("codeFencedFenceSequence"),K(z)):D(z)}function K(z){return z===s?(F++,C.consume(z),K):F>=a?(C.exit("codeFencedFenceSequence"),ke(z)?Ce(C,H,"whitespace")(z):H(z)):D(z)}function H(z){return z===null||oe(z)?(C.exit("codeFencedFence"),k(z)):D(z)}}}function Yx(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 Do={name:"codeIndented",tokenize:Xx},Qx={partial:!0,tokenize:Jx};function Xx(e,t,n){const r=this;return i;function i(c){return e.enter("codeIndented"),Ce(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(Qx,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 Jx(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):Ce(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 Zx={name:"codeText",previous:tw,resolve:ew,tokenize:nw};function ew(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 tw(e){return e!==96||this.events[this.events.length-1][1].type==="characterEscape"}function nw(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 rw{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 Jd(e){const t={};let n=-1,r,i,o,a,s,l,c;const u=new rw(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,iw(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 xt(e,0,Number.POSITIVE_INFINITY,u.slice(0)),!c}function iw(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 y=[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,y.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):y.pop(),h=y.length;h--;){const b=s.slice(y[h],y[h+1]),x=o.pop();l.push([x,x+b.length-1]),e.splice(x,2,b)}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 ow={resolve:sw,tokenize:lw},aw={partial:!0,tokenize:cw};function sw(e){return Jd(e),e}function lw(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(aw,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 cw(e,t,n){const r=this;return i;function i(a){return e.exit("chunkContent"),e.enter("lineEnding"),e.consume(a),e.exit("lineEnding"),Ce(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 Zd(e,t,n,r,i,o,a,s,l){const c=l||Number.POSITIVE_INFINITY;let u=0;return d;function d(b){return b===60?(e.enter(r),e.enter(i),e.enter(o),e.consume(b),e.exit(o),h):b===null||b===32||b===41||Bi(b)?n(b):(e.enter(r),e.enter(a),e.enter(s),e.enter("chunkString",{contentType:"string"}),p(b))}function h(b){return b===62?(e.enter(o),e.consume(b),e.exit(o),e.exit(i),e.exit(r),t):(e.enter(s),e.enter("chunkString",{contentType:"string"}),f(b))}function f(b){return b===62?(e.exit("chunkString"),e.exit(s),h(b)):b===null||b===60||oe(b)?n(b):(e.consume(b),b===92?m:f)}function m(b){return b===60||b===62||b===92?(e.consume(b),f):f(b)}function p(b){return!u&&(b===null||b===41||De(b))?(e.exit("chunkString"),e.exit(s),e.exit(a),e.exit(r),t(b)):u<c&&b===40?(e.consume(b),u++,p):b===41?(e.consume(b),u--,p):b===null||b===32||b===40||Bi(b)?n(b):(e.consume(b),b===92?y:p)}function y(b){return b===40||b===41||b===92?(e.consume(b),p):p(b)}}function ef(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=!ke(f)),f===92?h:d)}function h(f){return f===91||f===92||f===93?(e.consume(f),s++,d):d(f)}}function tf(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"),Ce(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 $r(e,t){let n;return r;function r(i){return oe(i)?(e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),n=!0,r):ke(i)?Ce(e,r,n?"linePrefix":"lineSuffix")(i):t(i)}}const uw={name:"definition",tokenize:fw},dw={partial:!0,tokenize:hw};function fw(e,t,n){const r=this;let i;return o;function o(f){return e.enter("definition"),a(f)}function a(f){return ef.call(r,e,s,n,"definitionLabel","definitionLabelMarker","definitionLabelString")(f)}function s(f){return i=_t(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 De(f)?$r(e,c)(f):c(f)}function c(f){return Zd(e,u,n,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(f)}function u(f){return e.attempt(dw,d,d)(f)}function d(f){return ke(f)?Ce(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 hw(e,t,n){return r;function r(s){return De(s)?$r(e,i)(s):n(s)}function i(s){return tf(e,o,n,"definitionTitle","definitionTitleMarker","definitionTitleString")(s)}function o(s){return ke(s)?Ce(e,a,"whitespace")(s):a(s)}function a(s){return s===null||oe(s)?t(s):n(s)}}const pw={name:"hardBreakEscape",tokenize:mw};function mw(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 gw={name:"headingAtx",resolve:yw,tokenize:vw};function yw(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"},xt(e,r,n-r+1,[["enter",i,t],["enter",o,t],["exit",o,t],["exit",i,t]])),e}function vw(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||De(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)):ke(u)?Ce(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||De(u)?(e.exit("atxHeadingText"),s(u)):(e.consume(u),c)}}const bw=["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"],sc=["pre","script","style","textarea"],xw={concrete:!0,name:"htmlFlow",resolveTo:Sw,tokenize:Ew},ww={partial:!0,tokenize:Aw},kw={partial:!0,tokenize:Cw};function Sw(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 Ew(e,t,n){const r=this;let i,o,a,s,l;return c;function c(E){return u(E)}function u(E){return e.enter("htmlFlow"),e.enter("htmlFlowData"),e.consume(E),d}function d(E){return E===33?(e.consume(E),h):E===47?(e.consume(E),o=!0,p):E===63?(e.consume(E),i=3,r.interrupt?t:S):lt(E)?(e.consume(E),a=String.fromCharCode(E),y):n(E)}function h(E){return E===45?(e.consume(E),i=2,f):E===91?(e.consume(E),i=5,s=0,m):lt(E)?(e.consume(E),i=4,r.interrupt?t:S):n(E)}function f(E){return E===45?(e.consume(E),r.interrupt?t:S):n(E)}function m(E){const ae="CDATA[";return E===ae.charCodeAt(s++)?(e.consume(E),s===ae.length?r.interrupt?t:L:m):n(E)}function p(E){return lt(E)?(e.consume(E),a=String.fromCharCode(E),y):n(E)}function y(E){if(E===null||E===47||E===62||De(E)){const ae=E===47,me=a.toLowerCase();return!ae&&!o&&sc.includes(me)?(i=1,r.interrupt?t(E):L(E)):bw.includes(a.toLowerCase())?(i=6,ae?(e.consume(E),b):r.interrupt?t(E):L(E)):(i=7,r.interrupt&&!r.parser.lazy[r.now().line]?n(E):o?x(E):w(E))}return E===45||it(E)?(e.consume(E),a+=String.fromCharCode(E),y):n(E)}function b(E){return E===62?(e.consume(E),r.interrupt?t:L):n(E)}function x(E){return ke(E)?(e.consume(E),x):R(E)}function w(E){return E===47?(e.consume(E),R):E===58||E===95||lt(E)?(e.consume(E),T):ke(E)?(e.consume(E),w):R(E)}function T(E){return E===45||E===46||E===58||E===95||it(E)?(e.consume(E),T):I(E)}function I(E){return E===61?(e.consume(E),C):ke(E)?(e.consume(E),I):w(E)}function C(E){return E===null||E===60||E===61||E===62||E===96?n(E):E===34||E===39?(e.consume(E),l=E,k):ke(E)?(e.consume(E),C):D(E)}function k(E){return E===l?(e.consume(E),l=null,F):E===null||oe(E)?n(E):(e.consume(E),k)}function D(E){return E===null||E===34||E===39||E===47||E===60||E===61||E===62||E===96||De(E)?I(E):(e.consume(E),D)}function F(E){return E===47||E===62||ke(E)?w(E):n(E)}function R(E){return E===62?(e.consume(E),N):n(E)}function N(E){return E===null||oe(E)?L(E):ke(E)?(e.consume(E),N):n(E)}function L(E){return E===45&&i===2?(e.consume(E),Y):E===60&&i===1?(e.consume(E),Q):E===62&&i===4?(e.consume(E),ie):E===63&&i===3?(e.consume(E),S):E===93&&i===5?(e.consume(E),j):oe(E)&&(i===6||i===7)?(e.exit("htmlFlowData"),e.check(ww,Z,K)(E)):E===null||oe(E)?(e.exit("htmlFlowData"),K(E)):(e.consume(E),L)}function K(E){return e.check(kw,H,Z)(E)}function H(E){return e.enter("lineEnding"),e.consume(E),e.exit("lineEnding"),z}function z(E){return E===null||oe(E)?K(E):(e.enter("htmlFlowData"),L(E))}function Y(E){return E===45?(e.consume(E),S):L(E)}function Q(E){return E===47?(e.consume(E),a="",$):L(E)}function $(E){if(E===62){const ae=a.toLowerCase();return sc.includes(ae)?(e.consume(E),ie):L(E)}return lt(E)&&a.length<8?(e.consume(E),a+=String.fromCharCode(E),$):L(E)}function j(E){return E===93?(e.consume(E),S):L(E)}function S(E){return E===62?(e.consume(E),ie):E===45&&i===2?(e.consume(E),S):L(E)}function ie(E){return E===null||oe(E)?(e.exit("htmlFlowData"),Z(E)):(e.consume(E),ie)}function Z(E){return e.exit("htmlFlow"),t(E)}}function Cw(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 Aw(e,t,n){return r;function r(i){return e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),e.attempt(ii,t,n)}}const Tw={name:"htmlText",tokenize:Rw};function Rw(e,t,n){const r=this;let i,o,a;return s;function s(S){return e.enter("htmlText"),e.enter("htmlTextData"),e.consume(S),l}function l(S){return S===33?(e.consume(S),c):S===47?(e.consume(S),I):S===63?(e.consume(S),w):lt(S)?(e.consume(S),D):n(S)}function c(S){return S===45?(e.consume(S),u):S===91?(e.consume(S),o=0,m):lt(S)?(e.consume(S),x):n(S)}function u(S){return S===45?(e.consume(S),f):n(S)}function d(S){return S===null?n(S):S===45?(e.consume(S),h):oe(S)?(a=d,Q(S)):(e.consume(S),d)}function h(S){return S===45?(e.consume(S),f):d(S)}function f(S){return S===62?Y(S):S===45?h(S):d(S)}function m(S){const ie="CDATA[";return S===ie.charCodeAt(o++)?(e.consume(S),o===ie.length?p:m):n(S)}function p(S){return S===null?n(S):S===93?(e.consume(S),y):oe(S)?(a=p,Q(S)):(e.consume(S),p)}function y(S){return S===93?(e.consume(S),b):p(S)}function b(S){return S===62?Y(S):S===93?(e.consume(S),b):p(S)}function x(S){return S===null||S===62?Y(S):oe(S)?(a=x,Q(S)):(e.consume(S),x)}function w(S){return S===null?n(S):S===63?(e.consume(S),T):oe(S)?(a=w,Q(S)):(e.consume(S),w)}function T(S){return S===62?Y(S):w(S)}function I(S){return lt(S)?(e.consume(S),C):n(S)}function C(S){return S===45||it(S)?(e.consume(S),C):k(S)}function k(S){return oe(S)?(a=k,Q(S)):ke(S)?(e.consume(S),k):Y(S)}function D(S){return S===45||it(S)?(e.consume(S),D):S===47||S===62||De(S)?F(S):n(S)}function F(S){return S===47?(e.consume(S),Y):S===58||S===95||lt(S)?(e.consume(S),R):oe(S)?(a=F,Q(S)):ke(S)?(e.consume(S),F):Y(S)}function R(S){return S===45||S===46||S===58||S===95||it(S)?(e.consume(S),R):N(S)}function N(S){return S===61?(e.consume(S),L):oe(S)?(a=N,Q(S)):ke(S)?(e.consume(S),N):F(S)}function L(S){return S===null||S===60||S===61||S===62||S===96?n(S):S===34||S===39?(e.consume(S),i=S,K):oe(S)?(a=L,Q(S)):ke(S)?(e.consume(S),L):(e.consume(S),H)}function K(S){return S===i?(e.consume(S),i=void 0,z):S===null?n(S):oe(S)?(a=K,Q(S)):(e.consume(S),K)}function H(S){return S===null||S===34||S===39||S===60||S===61||S===96?n(S):S===47||S===62||De(S)?F(S):(e.consume(S),H)}function z(S){return S===47||S===62||De(S)?F(S):n(S)}function Y(S){return S===62?(e.consume(S),e.exit("htmlTextData"),e.exit("htmlText"),t):n(S)}function Q(S){return e.exit("htmlTextData"),e.enter("lineEnding"),e.consume(S),e.exit("lineEnding"),$}function $(S){return ke(S)?Ce(e,j,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(S):j(S)}function j(S){return e.enter("htmlTextData"),a(S)}}const gs={name:"labelEnd",resolveAll:Ow,resolveTo:_w,tokenize:Nw},Pw={tokenize:Dw},Iw={tokenize:Mw},Lw={tokenize:jw};function Ow(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&&xt(e,0,e.length,n),e}function _w(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=Ct(s,e.slice(o+1,o+r+3)),s=Ct(s,[["enter",u,t]]),s=Ct(s,uo(t.parser.constructs.insideSpan.null,e.slice(o+r+4,a-3),t)),s=Ct(s,[["exit",u,t],e[a-2],e[a-1],["exit",c,t]]),s=Ct(s,e.slice(a+1)),s=Ct(s,[["exit",l,t]]),xt(e,o,e.length,s),e}function Nw(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(_t(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(Pw,u,a?u:d)(h):h===91?e.attempt(Iw,u,a?c:d)(h):a?u(h):d(h)}function c(h){return e.attempt(Lw,u,d)(h)}function u(h){return t(h)}function d(h){return o._balanced=!0,n(h)}}function Dw(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 De(d)?$r(e,o)(d):o(d)}function o(d){return d===41?u(d):Zd(e,a,s,"resourceDestination","resourceDestinationLiteral","resourceDestinationLiteralMarker","resourceDestinationRaw","resourceDestinationString",32)(d)}function a(d){return De(d)?$r(e,l)(d):u(d)}function s(d){return n(d)}function l(d){return d===34||d===39||d===40?tf(e,c,n,"resourceTitle","resourceTitleMarker","resourceTitleString")(d):u(d)}function c(d){return De(d)?$r(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 Mw(e,t,n){const r=this;return i;function i(s){return ef.call(r,e,o,a,"reference","referenceMarker","referenceString")(s)}function o(s){return r.parser.defined.includes(_t(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)))?t(s):n(s)}function a(s){return n(s)}}function jw(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 Fw={name:"labelStartImage",resolveAll:gs.resolveAll,tokenize:Hw};function Hw(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 Bw={name:"labelStartLink",resolveAll:gs.resolveAll,tokenize:Uw};function Uw(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 Mo={name:"lineEnding",tokenize:zw};function zw(e,t){return n;function n(r){return e.enter("lineEnding"),e.consume(r),e.exit("lineEnding"),Ce(e,t,"linePrefix")}}const Ri={name:"thematicBreak",tokenize:$w};function $w(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"),ke(c)?Ce(e,s,"whitespace")(c):s(c))}}const ut={continuation:{tokenize:qw},exit:Yw,name:"list",tokenize:Ww},Vw={partial:!0,tokenize:Qw},Kw={partial:!0,tokenize:Gw};function Ww(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:Aa(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(Ri,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 Aa(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(ii,r.interrupt?n:u,e.attempt(Vw,h,d))}function u(f){return r.containerState.initialBlankLine=!0,o++,h(f)}function d(f){return ke(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 qw(e,t,n){const r=this;return r.containerState._closeFlow=void 0,e.check(ii,i,o);function i(s){return r.containerState.furtherBlankLines=r.containerState.furtherBlankLines||r.containerState.initialBlankLine,Ce(e,t,"listItemIndent",r.containerState.size+1)(s)}function o(s){return r.containerState.furtherBlankLines||!ke(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(Kw,t,a)(s))}function a(s){return r.containerState._closeFlow=!0,r.interrupt=void 0,Ce(e,e.attempt(ut,t,n),"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(s)}}function Gw(e,t,n){const r=this;return Ce(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 Yw(e){e.exit(this.containerState.type)}function Qw(e,t,n){const r=this;return Ce(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!ke(o)&&a&&a[1].type==="listItemPrefixWhitespace"?t(o):n(o)}}const lc={name:"setextUnderline",resolveTo:Xw,tokenize:Jw};function Xw(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 Jw(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"),ke(c)?Ce(e,l,"lineSuffix")(c):l(c))}function l(c){return c===null||oe(c)?(e.exit("setextHeadingLine"),t(c)):n(c)}}const Zw={tokenize:e0};function e0(e){const t=this,n=e.attempt(ii,r,e.attempt(this.parser.constructs.flowInitial,i,Ce(e,e.attempt(this.parser.constructs.flow,i,e.attempt(ow,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 t0={resolveAll:rf()},n0=nf("string"),r0=nf("text");function nf(e){return{resolveAll:rf(e==="text"?i0: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 rf(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 i0(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 o0={42:ut,43:ut,45:ut,48:ut,49:ut,50:ut,51:ut,52:ut,53:ut,54:ut,55:ut,56:ut,57:ut,62:Yd},a0={91:uw},s0={[-2]:Do,[-1]:Do,32:Do},l0={35:gw,42:Ri,45:[lc,Ri],60:xw,61:lc,95:Ri,96:ac,126:ac},c0={38:Xd,92:Qd},u0={[-5]:Mo,[-4]:Mo,[-3]:Mo,33:Fw,38:Xd,42:Ta,60:[Bx,Tw],91:Bw,92:[pw,Qd],93:gs,95:Ta,96:Zx},d0={null:[Ta,t0]},f0={null:[42,95]},h0={null:[]},p0=Object.freeze(Object.defineProperty({__proto__:null,attentionMarkers:f0,contentInitial:a0,disable:h0,document:o0,flow:l0,flowInitial:s0,insideSpan:d0,string:c0,text:u0},Symbol.toStringTag,{value:"Module"}));function m0(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(I),check:k(C),consume:x,enter:w,exit:T,interrupt:k(C,{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(N){return a=Ct(a,N),y(),a[a.length-1]!==null?[]:(D(t,0),c.events=uo(o,c.events,c),c.events)}function h(N,L){return y0(f(N),L)}function f(N){return g0(a,N)}function m(){const{_bufferIndex:N,_index:L,line:K,column:H,offset:z}=r;return{_bufferIndex:N,_index:L,line:K,column:H,offset:z}}function p(N){i[N.line]=N.column,R()}function y(){let N;for(;r._index<a.length;){const L=a[r._index];if(typeof L=="string")for(N=r._index,r._bufferIndex<0&&(r._bufferIndex=0);r._index===N&&r._bufferIndex<L.length;)b(L.charCodeAt(r._bufferIndex));else b(L)}}function b(N){u=u(N)}function x(N){oe(N)?(r.line++,r.column=1,r.offset+=N===-3?2:1,R()):N!==-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=N}function w(N,L){const K=L||{};return K.type=N,K.start=m(),c.events.push(["enter",K,c]),s.push(K),K}function T(N){const L=s.pop();return L.end=m(),c.events.push(["exit",L,c]),L}function I(N,L){D(N,L.from)}function C(N,L){L.restore()}function k(N,L){return K;function K(H,z,Y){let Q,$,j,S;return Array.isArray(H)?Z(H):"tokenize"in H?Z([H]):ie(H);function ie(ve){return W;function W(fe){const Re=fe!==null&&ve[fe],be=fe!==null&&ve.null,we=[...Array.isArray(Re)?Re:Re?[Re]:[],...Array.isArray(be)?be:be?[be]:[]];return Z(we)(fe)}}function Z(ve){return Q=ve,$=0,ve.length===0?Y:E(ve[$])}function E(ve){return W;function W(fe){return S=F(),j=ve,ve.partial||(c.currentConstruct=ve),ve.name&&c.parser.constructs.disable.null.includes(ve.name)?me():ve.tokenize.call(L?Object.assign(Object.create(c),L):c,l,ae,me)(fe)}}function ae(ve){return N(j,S),z}function me(ve){return S.restore(),++$<Q.length?E(Q[$]):Y}}}function D(N,L){N.resolveAll&&!o.includes(N)&&o.push(N),N.resolve&&xt(c.events,L,c.events.length-L,N.resolve(c.events.slice(L),c)),N.resolveTo&&(c.events=N.resolveTo(c.events,c))}function F(){const N=m(),L=c.previous,K=c.currentConstruct,H=c.events.length,z=Array.from(s);return{from:H,restore:Y};function Y(){r=N,c.previous=L,c.currentConstruct=K,c.events.length=H,s=z,R()}}function R(){r.line in i&&r.column<2&&(r.column=i[r.line],r.offset+=i[r.line]-1)}}function g0(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 y0(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=`
131
+ `;break}case-3:{a=`\r
132
+ `;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 v0(e){const r={constructs:qd([p0,...(e||{}).extensions||[]]),content:i(_x),defined:[],document:i(Dx),flow:i(Zw),lazy:{},string:i(n0),text:i(r0)};return r;function i(o){return a;function a(s){return m0(r,o,s)}}}function b0(e){for(;!Jd(e););return e}const cc=/[\0\t\n\r]/g;function x0(){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(cc.lastIndex=d,c=cc.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 w0=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function k0(e){return e.replace(w0,S0)}function S0(e,t,n){if(t)return t;if(n.charCodeAt(0)===35){const i=n.charCodeAt(1),o=i===120||i===88;return Gd(n.slice(o?2:1),o?16:10)}return ms(n)||e}const of={}.hasOwnProperty;function E0(e,t,n){return t&&typeof t=="object"&&(n=t,t=void 0),C0(n)(b0(v0(n).document().write(x0()(e,t,!0))))}function C0(e){const t={transforms:[],canContainEols:["emphasis","fragment","heading","paragraph","strong"],enter:{autolink:o(An),autolinkProtocol:F,autolinkEmail:F,atxHeading:o(Mt),blockQuote:o(be),characterEscape:F,characterReference:F,codeFenced:o(we),codeFencedFenceInfo:a,codeFencedFenceMeta:a,codeIndented:o(we,a),codeText:o(pe,a),codeTextData:F,data:F,codeFlowValue:F,definition:o(Ke),definitionDestinationString:a,definitionLabelString:a,definitionTitleString:a,emphasis:o(Qe),hardBreakEscape:o(Ze),hardBreakTrailing:o(Ze),htmlFlow:o(jt,a),htmlFlowData:F,htmlText:o(jt,a),htmlTextData:F,image:o(Cn),label:a,link:o(An),listItem:o(Qt),listItemValue:h,listOrdered:o(Tn,d),listUnordered:o(Tn),paragraph:o(Qn),reference:E,referenceString:a,resourceDestinationString:a,resourceTitleString:a,setextHeading:o(Mt),strong:o(At),thematicBreak:o(Xt)},exit:{atxHeading:l(),atxHeadingSequence:I,autolink:l(),autolinkEmail:Re,autolinkProtocol:fe,blockQuote:l(),characterEscapeValue:R,characterReferenceMarkerHexadecimal:me,characterReferenceMarkerNumeric:me,characterReferenceValue:ve,characterReference:W,codeFenced:l(y),codeFencedFence:p,codeFencedFenceInfo:f,codeFencedFenceMeta:m,codeFlowValue:R,codeIndented:l(b),codeText:l(z),codeTextData:R,data:R,definition:l(),definitionDestinationString:T,definitionLabelString:x,definitionTitleString:w,emphasis:l(),hardBreakEscape:l(L),hardBreakTrailing:l(L),htmlFlow:l(K),htmlFlowData:R,htmlText:l(H),htmlTextData:R,image:l(Q),label:j,labelText:$,lineEnding:N,link:l(Y),listItem:l(),listOrdered:l(),listUnordered:l(),paragraph:l(),referenceString:ae,resourceDestinationString:S,resourceTitleString:ie,resource:Z,setextHeading:l(D),setextHeadingLineSequence:k,setextHeadingText:C,strong:l(),thematicBreak:l()}};af(t,(e||{}).mdastExtensions||[]);const n={};return r;function r(_){let U={type:"root",children:[]};const ne={stack:[U],tokenStack:[],config:t,enter:s,exit:c,buffer:a,resume:u,data:n},se=[];let Se=-1;for(;++Se<_.length;)if(_[Se][1].type==="listOrdered"||_[Se][1].type==="listUnordered")if(_[Se][0]==="enter")se.push(Se);else{const Xe=se.pop();Se=i(_,Xe,Se)}for(Se=-1;++Se<_.length;){const Xe=t[_[Se][0]];of.call(Xe,_[Se][1].type)&&Xe[_[Se][1].type].call(Object.assign({sliceSerialize:_[Se][2].sliceSerialize},ne),_[Se][1])}if(ne.tokenStack.length>0){const Xe=ne.tokenStack[ne.tokenStack.length-1];(Xe[1]||uc).call(ne,void 0,Xe[0])}for(U.position={start:hn(_.length>0?_[0][1].start:{line:1,column:1,offset:0}),end:hn(_.length>0?_[_.length-2][1].end:{line:1,column:1,offset:0})},Se=-1;++Se<t.transforms.length;)U=t.transforms[Se](U)||U;return U}function i(_,U,ne){let se=U-1,Se=-1,Xe=!1,St,ze,at,Rt;for(;++se<=ne;){const Be=_[se];switch(Be[1].type){case"listUnordered":case"listOrdered":case"blockQuote":{Be[0]==="enter"?Se++:Se--,Rt=void 0;break}case"lineEndingBlank":{Be[0]==="enter"&&(St&&!Rt&&!Se&&!at&&(at=se),Rt=void 0);break}case"linePrefix":case"listItemValue":case"listItemMarker":case"listItemPrefix":case"listItemPrefixWhitespace":break;default:Rt=void 0}if(!Se&&Be[0]==="enter"&&Be[1].type==="listItemPrefix"||Se===-1&&Be[0]==="exit"&&(Be[1].type==="listUnordered"||Be[1].type==="listOrdered")){if(St){let Ft=se;for(ze=void 0;Ft--;){const ct=_[Ft];if(ct[1].type==="lineEnding"||ct[1].type==="lineEndingBlank"){if(ct[0]==="exit")continue;ze&&(_[ze][1].type="lineEndingBlank",Xe=!0),ct[1].type="lineEnding",ze=Ft}else if(!(ct[1].type==="linePrefix"||ct[1].type==="blockQuotePrefix"||ct[1].type==="blockQuotePrefixWhitespace"||ct[1].type==="blockQuoteMarker"||ct[1].type==="listItemIndent"))break}at&&(!ze||at<ze)&&(St._spread=!0),St.end=Object.assign({},ze?_[ze][1].start:Be[1].end),_.splice(ze||se,0,["exit",St,Be[2]]),se++,ne++}if(Be[1].type==="listItemPrefix"){const Ft={type:"listItem",_spread:!1,start:Object.assign({},Be[1].start),end:void 0};St=Ft,_.splice(se,0,["enter",Ft,Be[2]]),se++,ne++,at=void 0,Rt=!0}}}return _[U][1]._spread=Xe,ne}function o(_,U){return ne;function ne(se){s.call(this,_(se),se),U&&U.call(this,se)}}function a(){this.stack.push({type:"fragment",children:[]})}function s(_,U,ne){this.stack[this.stack.length-1].children.push(_),this.stack.push(_),this.tokenStack.push([U,ne||void 0]),_.position={start:hn(U.start),end:void 0}}function l(_){return U;function U(ne){_&&_.call(this,ne),c.call(this,ne)}}function c(_,U){const ne=this.stack.pop(),se=this.tokenStack.pop();if(se)se[0].type!==_.type&&(U?U.call(this,_,se[0]):(se[1]||uc).call(this,_,se[0]));else throw new Error("Cannot close `"+_.type+"` ("+zr({start:_.start,end:_.end})+"): it’s not open");ne.position.end=hn(_.end)}function u(){return ps(this.stack.pop())}function d(){this.data.expectingFirstListItemValue=!0}function h(_){if(this.data.expectingFirstListItemValue){const U=this.stack[this.stack.length-2];U.start=Number.parseInt(this.sliceSerialize(_),10),this.data.expectingFirstListItemValue=void 0}}function f(){const _=this.resume(),U=this.stack[this.stack.length-1];U.lang=_}function m(){const _=this.resume(),U=this.stack[this.stack.length-1];U.meta=_}function p(){this.data.flowCodeInside||(this.buffer(),this.data.flowCodeInside=!0)}function y(){const _=this.resume(),U=this.stack[this.stack.length-1];U.value=_.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,""),this.data.flowCodeInside=void 0}function b(){const _=this.resume(),U=this.stack[this.stack.length-1];U.value=_.replace(/(\r?\n|\r)$/g,"")}function x(_){const U=this.resume(),ne=this.stack[this.stack.length-1];ne.label=U,ne.identifier=_t(this.sliceSerialize(_)).toLowerCase()}function w(){const _=this.resume(),U=this.stack[this.stack.length-1];U.title=_}function T(){const _=this.resume(),U=this.stack[this.stack.length-1];U.url=_}function I(_){const U=this.stack[this.stack.length-1];if(!U.depth){const ne=this.sliceSerialize(_).length;U.depth=ne}}function C(){this.data.setextHeadingSlurpLineEnding=!0}function k(_){const U=this.stack[this.stack.length-1];U.depth=this.sliceSerialize(_).codePointAt(0)===61?1:2}function D(){this.data.setextHeadingSlurpLineEnding=void 0}function F(_){const ne=this.stack[this.stack.length-1].children;let se=ne[ne.length-1];(!se||se.type!=="text")&&(se=Tt(),se.position={start:hn(_.start),end:void 0},ne.push(se)),this.stack.push(se)}function R(_){const U=this.stack.pop();U.value+=this.sliceSerialize(_),U.position.end=hn(_.end)}function N(_){const U=this.stack[this.stack.length-1];if(this.data.atHardBreak){const ne=U.children[U.children.length-1];ne.position.end=hn(_.end),this.data.atHardBreak=void 0;return}!this.data.setextHeadingSlurpLineEnding&&t.canContainEols.includes(U.type)&&(F.call(this,_),R.call(this,_))}function L(){this.data.atHardBreak=!0}function K(){const _=this.resume(),U=this.stack[this.stack.length-1];U.value=_}function H(){const _=this.resume(),U=this.stack[this.stack.length-1];U.value=_}function z(){const _=this.resume(),U=this.stack[this.stack.length-1];U.value=_}function Y(){const _=this.stack[this.stack.length-1];if(this.data.inReference){const U=this.data.referenceType||"shortcut";_.type+="Reference",_.referenceType=U,delete _.url,delete _.title}else delete _.identifier,delete _.label;this.data.referenceType=void 0}function Q(){const _=this.stack[this.stack.length-1];if(this.data.inReference){const U=this.data.referenceType||"shortcut";_.type+="Reference",_.referenceType=U,delete _.url,delete _.title}else delete _.identifier,delete _.label;this.data.referenceType=void 0}function $(_){const U=this.sliceSerialize(_),ne=this.stack[this.stack.length-2];ne.label=k0(U),ne.identifier=_t(U).toLowerCase()}function j(){const _=this.stack[this.stack.length-1],U=this.resume(),ne=this.stack[this.stack.length-1];if(this.data.inReference=!0,ne.type==="link"){const se=_.children;ne.children=se}else ne.alt=U}function S(){const _=this.resume(),U=this.stack[this.stack.length-1];U.url=_}function ie(){const _=this.resume(),U=this.stack[this.stack.length-1];U.title=_}function Z(){this.data.inReference=void 0}function E(){this.data.referenceType="collapsed"}function ae(_){const U=this.resume(),ne=this.stack[this.stack.length-1];ne.label=U,ne.identifier=_t(this.sliceSerialize(_)).toLowerCase(),this.data.referenceType="full"}function me(_){this.data.characterReferenceType=_.type}function ve(_){const U=this.sliceSerialize(_),ne=this.data.characterReferenceType;let se;ne?(se=Gd(U,ne==="characterReferenceMarkerNumeric"?10:16),this.data.characterReferenceType=void 0):se=ms(U);const Se=this.stack[this.stack.length-1];Se.value+=se}function W(_){const U=this.stack.pop();U.position.end=hn(_.end)}function fe(_){R.call(this,_);const U=this.stack[this.stack.length-1];U.url=this.sliceSerialize(_)}function Re(_){R.call(this,_);const U=this.stack[this.stack.length-1];U.url="mailto:"+this.sliceSerialize(_)}function be(){return{type:"blockquote",children:[]}}function we(){return{type:"code",lang:null,meta:null,value:""}}function pe(){return{type:"inlineCode",value:""}}function Ke(){return{type:"definition",identifier:"",label:null,title:null,url:""}}function Qe(){return{type:"emphasis",children:[]}}function Mt(){return{type:"heading",depth:0,children:[]}}function Ze(){return{type:"break"}}function jt(){return{type:"html",value:""}}function Cn(){return{type:"image",title:null,url:"",alt:null}}function An(){return{type:"link",title:null,url:"",children:[]}}function Tn(_){return{type:"list",ordered:_.type==="listOrdered",start:null,spread:_._spread,children:[]}}function Qt(_){return{type:"listItem",spread:_._spread,checked:null,children:[]}}function Qn(){return{type:"paragraph",children:[]}}function At(){return{type:"strong",children:[]}}function Tt(){return{type:"text",value:""}}function Xt(){return{type:"thematicBreak"}}}function hn(e){return{line:e.line,column:e.column,offset:e.offset}}function af(e,t){let n=-1;for(;++n<t.length;){const r=t[n];Array.isArray(r)?af(e,r):A0(e,r)}}function A0(e,t){let n;for(n in t)if(of.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 uc(e,t){throw e?new Error("Cannot close `"+e.type+"` ("+zr({start:e.start,end:e.end})+"): a different token (`"+t.type+"`, "+zr({start:t.start,end:t.end})+") is open"):new Error("Cannot close document, a token (`"+t.type+"`, "+zr({start:t.start,end:t.end})+") is still open")}function T0(e){const t=this;t.parser=n;function n(r){return E0(r,{...t.data("settings"),...e,extensions:t.data("micromarkExtensions")||[],mdastExtensions:t.data("fromMarkdownExtensions")||[]})}}function R0(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 P0(e,t){const n={type:"element",tagName:"br",properties:{},children:[]};return e.patch(t,n),[e.applyData(t,n),{type:"text",value:`
133
+ `}]}function I0(e,t){const n=t.value?t.value+`
134
+ `:"",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 L0(e,t){const n={type:"element",tagName:"del",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function O0(e,t){const n={type:"element",tagName:"em",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function _0(e,t){const n=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",r=String(t.identifier).toUpperCase(),i=kr(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 N0(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 D0(e,t){if(e.options.allowDangerousHtml){const n={type:"raw",value:t.value};return e.patch(t,n),e.applyData(t,n)}}function sf(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 M0(e,t){const n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return sf(e,t);const i={src:kr(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 j0(e,t){const n={src:kr(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 F0(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 H0(e,t){const n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return sf(e,t);const i={href:kr(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 B0(e,t){const n={href:kr(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 U0(e,t,n){const r=e.all(t),i=n?z0(n):lf(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:`
135
+ `}),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:`
136
+ `});const c={type:"element",tagName:"li",properties:o,children:a};return e.patch(t,c),e.applyData(t,c)}function z0(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=lf(n[r])}return t}function lf(e){const t=e.spread;return t??e.children.length>1}function $0(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 V0(e,t){const n={type:"element",tagName:"p",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function K0(e,t){const n={type:"root",children:e.wrap(e.all(t))};return e.patch(t,n),e.applyData(t,n)}function W0(e,t){const n={type:"element",tagName:"strong",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function q0(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=Bd(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 G0(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 Y0(e,t){const n={type:"element",tagName:"td",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}const dc=9,fc=32;function Q0(e){const t=String(e),n=/\r?\n|\r/g;let r=n.exec(t),i=0;const o=[];for(;r;)o.push(hc(t.slice(i,r.index),i>0,!0),r[0]),i=r.index+r[0].length,r=n.exec(t);return o.push(hc(t.slice(i),i>0,!1)),o.join("")}function hc(e,t,n){let r=0,i=e.length;if(t){let o=e.codePointAt(r);for(;o===dc||o===fc;)r++,o=e.codePointAt(r)}if(n){let o=e.codePointAt(i-1);for(;o===dc||o===fc;)i--,o=e.codePointAt(i-1)}return i>r?e.slice(r,i):""}function X0(e,t){const n={type:"text",value:Q0(String(t.value))};return e.patch(t,n),e.applyData(t,n)}function J0(e,t){const n={type:"element",tagName:"hr",properties:{},children:[]};return e.patch(t,n),e.applyData(t,n)}const Z0={blockquote:R0,break:P0,code:I0,delete:L0,emphasis:O0,footnoteReference:_0,heading:N0,html:D0,imageReference:M0,image:j0,inlineCode:F0,linkReference:H0,link:B0,listItem:U0,list:$0,paragraph:V0,root:K0,strong:W0,table:q0,tableCell:Y0,tableRow:G0,text:X0,thematicBreak:J0,toml:pi,yaml:pi,definition:pi,footnoteDefinition:pi};function pi(){}const cf=-1,fo=0,Vr=1,Ui=2,ys=3,vs=4,bs=5,xs=6,uf=7,df=8,ek=typeof self=="object"?self:globalThis,pc=(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 ek[e](t)},tk=(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 fo:case cf:return n(a,i);case Vr:{const s=n([],i);for(const l of a)s.push(r(l));return s}case Ui:{const s=n({},i);for(const[l,c]of a)s[r(l)]=r(c);return s}case ys:return n(new Date(a),i);case vs:{const{source:s,flags:l}=a;return n(new RegExp(s,l),i)}case bs:{const s=n(new Map,i);for(const[l,c]of a)s.set(r(l),r(c));return s}case xs:{const s=n(new Set,i);for(const l of a)s.add(r(l));return s}case uf:{const{name:s,message:l}=a;return n(pc(s,l),i)}case df: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(pc(o,a),i)};return r},mc=e=>tk(new Map,e)(0),tr="",{toString:nk}={},{keys:rk}=Object,Fr=e=>{const t=typeof e;if(t!=="object"||!e)return[fo,t];const n=nk.call(e).slice(8,-1);switch(n){case"Array":return[Vr,tr];case"Object":return[Ui,tr];case"Date":return[ys,tr];case"RegExp":return[vs,tr];case"Map":return[bs,tr];case"Set":return[xs,tr];case"DataView":return[Vr,n]}return n.includes("Array")?[Vr,n]:n.includes("Error")?[uf,n]:[Ui,n]},mi=([e,t])=>e===fo&&(t==="function"||t==="symbol"),ik=(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]=Fr(a);switch(s){case fo:{let u=a;switch(l){case"bigint":s=df,u=a.toString();break;case"function":case"symbol":if(e)throw new TypeError("unable to serialize "+l);u=null;break;case"undefined":return i([cf],a)}return i([s,u],a)}case Vr:{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 Ui:{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 rk(a))(e||!mi(Fr(a[h])))&&u.push([o(h),o(a[h])]);return d}case ys:return i([s,a.toISOString()],a);case vs:{const{source:u,flags:d}=a;return i([s,{source:u,flags:d}],a)}case bs:{const u=[],d=i([s,u],a);for(const[h,f]of a)(e||!(mi(Fr(h))||mi(Fr(f))))&&u.push([o(h),o(f)]);return d}case xs:{const u=[],d=i([s,u],a);for(const h of a)(e||!mi(Fr(h)))&&u.push(o(h));return d}}const{message:c}=a;return i([s,{name:l,message:c}],a)};return o},gc=(e,{json:t,lossy:n}={})=>{const r=[];return ik(!(t||n),!!t,new Map,r)(e),r},zi=typeof structuredClone=="function"?(e,t)=>t&&("json"in t||"lossy"in t)?mc(gc(e,t)):structuredClone(e):(e,t)=>mc(gc(e,t));function ok(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 ak(e,t){return"Back to reference "+(e+1)+(t>1?"-"+t:"")}function sk(e){const t=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",n=e.options.footnoteBackContent||ok,r=e.options.footnoteBackLabel||ak,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=kr(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 y=u[u.length-1];if(y&&y.type==="element"&&y.tagName==="p"){const x=y.children[y.children.length-1];x&&x.type==="text"?x.value+=" ":y.children.push({type:"text",value:" "}),y.children.push(...m)}else u.push(...m);const b={type:"element",tagName:"li",properties:{id:t+"fn-"+h},children:e.wrap(u,!0)};e.patch(c,b),s.push(b)}if(s.length!==0)return{type:"element",tagName:"section",properties:{dataFootnotes:!0,className:["footnotes"]},children:[{type:"element",tagName:o,properties:{...zi(a),id:"footnote-label"},children:[{type:"text",value:i}]},{type:"text",value:`
137
+ `},{type:"element",tagName:"ol",properties:{},children:e.wrap(s,!0)},{type:"text",value:`
138
+ `}]}}const ho=function(e){if(e==null)return dk;if(typeof e=="function")return po(e);if(typeof e=="object")return Array.isArray(e)?lk(e):ck(e);if(typeof e=="string")return uk(e);throw new Error("Expected function, string, or object as test")};function lk(e){const t=[];let n=-1;for(;++n<e.length;)t[n]=ho(e[n]);return po(r);function r(...i){let o=-1;for(;++o<t.length;)if(t[o].apply(this,i))return!0;return!1}}function ck(e){const t=e;return po(n);function n(r){const i=r;let o;for(o in e)if(i[o]!==t[o])return!1;return!0}}function uk(e){return po(t);function t(n){return n&&n.type===e}}function po(e){return t;function t(n,r,i){return!!(fk(n)&&e.call(this,n,typeof r=="number"?r:void 0,i||void 0))}}function dk(){return!0}function fk(e){return e!==null&&typeof e=="object"&&"type"in e}const ff=[],hk=!0,Ra=!1,pk="skip";function hf(e,t,n,r){let i;typeof t=="function"&&typeof n!="function"?(r=n,n=t):i=t;const o=ho(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=ff,m,p,y;if((!t||o(l,c,u[u.length-1]||void 0))&&(f=mk(n(l,u)),f[0]===Ra))return f;if("children"in l&&l.children){const b=l;if(b.children&&f[0]!==pk)for(p=(r?b.children.length:-1)+a,y=u.concat(b);p>-1&&p<b.children.length;){const x=b.children[p];if(m=s(x,p,y)(),m[0]===Ra)return m;p=typeof m[1]=="number"?m[1]:p+a}}return f}}}function mk(e){return Array.isArray(e)?e:typeof e=="number"?[hk,e]:e==null?ff:[e]}function ws(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),hf(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 Pa={}.hasOwnProperty,gk={};function yk(e,t){const n=t||gk,r=new Map,i=new Map,o=new Map,a={...Z0,...n.handlers},s={all:c,applyData:bk,definitionById:r,footnoteById:i,footnoteCounts:o,footnoteOrder:[],handlers:a,one:l,options:n,patch:vk,wrap:wk};return ws(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(Pa.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,...y}=u,b=zi(y);return b.children=s.all(u),b}return zi(u)}return(s.options.unknownHandler||xk)(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=yc(m.value)),!Array.isArray(m)&&m.type==="element")){const p=m.children[0];p&&p.type==="text"&&(p.value=yc(p.value))}Array.isArray(m)?d.push(...m):d.push(m)}}}return d}}function vk(e,t){e.position&&(t.position=ox(e))}function bk(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,zi(o)),"children"in n&&n.children&&i!==null&&i!==void 0&&(n.children=i)}return n}function xk(e,t){const n=t.data||{},r="value"in t&&!(Pa.call(n,"hProperties")||Pa.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 wk(e,t){const n=[];let r=-1;for(t&&n.push({type:"text",value:`
139
+ `});++r<e.length;)r&&n.push({type:"text",value:`
140
+ `}),n.push(e[r]);return t&&e.length>0&&n.push({type:"text",value:`
141
+ `}),n}function yc(e){let t=0,n=e.charCodeAt(t);for(;n===9||n===32;)t++,n=e.charCodeAt(t);return e.slice(t)}function vc(e,t){const n=yk(e,t),r=n.one(e,void 0),i=sk(n),o=Array.isArray(r)?{type:"root",children:r}:r||{type:"root",children:[]};return i&&o.children.push({type:"text",value:`
142
+ `},i),o}function kk(e,t){return e&&"run"in e?async function(n,r){const i=vc(n,{file:r,...t});await e.run(i,r)}:function(n,r){return vc(n,{file:r,...e||t})}}function bc(e){if(e)throw e}var Pi=Object.prototype.hasOwnProperty,pf=Object.prototype.toString,xc=Object.defineProperty,wc=Object.getOwnPropertyDescriptor,kc=function(t){return typeof Array.isArray=="function"?Array.isArray(t):pf.call(t)==="[object Array]"},Sc=function(t){if(!t||pf.call(t)!=="[object Object]")return!1;var n=Pi.call(t,"constructor"),r=t.constructor&&t.constructor.prototype&&Pi.call(t.constructor.prototype,"isPrototypeOf");if(t.constructor&&!n&&!r)return!1;var i;for(i in t);return typeof i>"u"||Pi.call(t,i)},Ec=function(t,n){xc&&n.name==="__proto__"?xc(t,n.name,{enumerable:!0,configurable:!0,value:n.newValue,writable:!0}):t[n.name]=n.newValue},Cc=function(t,n){if(n==="__proto__")if(Pi.call(t,n)){if(wc)return wc(t,n).value}else return;return t[n]},Sk=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=Cc(s,n),i=Cc(t,n),s!==i&&(u&&i&&(Sc(i)||(o=kc(i)))?(o?(o=!1,a=r&&kc(r)?r:[]):a=r&&Sc(r)?r:{},Ec(s,{name:n,newValue:e(u,a,i)})):typeof i<"u"&&Ec(s,{name:n,newValue:i}));return s};const jo=_u(Sk);function Ia(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 Ek(){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?Ck(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 Ck(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 $t={basename:Ak,dirname:Tk,extname:Rk,join:Pk,sep:"/"};function Ak(e,t){if(t!==void 0&&typeof t!="string")throw new TypeError('"ext" argument must be a string');oi(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 Tk(e){if(oi(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 Rk(e){oi(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 Pk(...e){let t=-1,n;for(;++t<e.length;)oi(e[t]),e[t]&&(n=n===void 0?e[t]:n+"/"+e[t]);return n===void 0?".":Ik(n)}function Ik(e){oi(e);const t=e.codePointAt(0)===47;let n=Lk(e,!t);return n.length===0&&!t&&(n="."),n.length>0&&e.codePointAt(e.length-1)===47&&(n+="/"),t?"/"+n:n}function Lk(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 oi(e){if(typeof e!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(e))}const Ok={cwd:_k};function _k(){return"/"}function La(e){return!!(e!==null&&typeof e=="object"&&"href"in e&&e.href&&"protocol"in e&&e.protocol&&e.auth===void 0)}function Nk(e){if(typeof e=="string")e=new URL(e);else if(!La(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 Dk(e)}function Dk(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 Fo=["history","path","basename","stem","extname","dirname"];class mf{constructor(t){let n;t?La(t)?n={path:t}:typeof t=="string"||Mk(t)?n={value:t}:n=t:n={},this.cwd="cwd"in n?"":Ok.cwd(),this.data={},this.history=[],this.messages=[],this.value,this.map,this.result,this.stored;let r=-1;for(;++r<Fo.length;){const o=Fo[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)Fo.includes(i)||(this[i]=n[i])}get basename(){return typeof this.path=="string"?$t.basename(this.path):void 0}set basename(t){Bo(t,"basename"),Ho(t,"basename"),this.path=$t.join(this.dirname||"",t)}get dirname(){return typeof this.path=="string"?$t.dirname(this.path):void 0}set dirname(t){Ac(this.basename,"dirname"),this.path=$t.join(t||"",this.basename)}get extname(){return typeof this.path=="string"?$t.extname(this.path):void 0}set extname(t){if(Ho(t,"extname"),Ac(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=$t.join(this.dirname,this.stem+(t||""))}get path(){return this.history[this.history.length-1]}set path(t){La(t)&&(t=Nk(t)),Bo(t,"path"),this.path!==t&&this.history.push(t)}get stem(){return typeof this.path=="string"?$t.basename(this.path,this.extname):void 0}set stem(t){Bo(t,"stem"),Ho(t,"stem"),this.path=$t.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 ot(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 Ho(e,t){if(e&&e.includes($t.sep))throw new Error("`"+t+"` cannot be a path: did not expect `"+$t.sep+"`")}function Bo(e,t){if(!e)throw new Error("`"+t+"` cannot be empty")}function Ac(e,t){if(!e)throw new Error("Setting `"+t+"` requires `path` to be set too")}function Mk(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const jk=function(e){const r=this.constructor.prototype,i=r[e],o=function(){return i.apply(o,arguments)};return Object.setPrototypeOf(o,r),o},Fk={}.hasOwnProperty;class ks extends jk{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=Ek()}copy(){const t=new ks;let n=-1;for(;++n<this.attachers.length;){const r=this.attachers[n];t.use(...r)}return t.data(jo(!0,{},this.namespace)),t}data(t,n){return typeof t=="string"?arguments.length===2?($o("data",this.frozen),this.namespace[t]=n,this):Fk.call(this.namespace,t)&&this.namespace[t]||void 0:t?($o("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=gi(t),r=this.parser||this.Parser;return Uo("parse",r),r(String(n),n)}process(t,n){const r=this;return this.freeze(),Uo("process",this.parser||this.Parser),zo("process",this.compiler||this.Compiler),n?i(void 0,n):new Promise(i);function i(o,a){const s=gi(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);Uk(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(),Uo("processSync",this.parser||this.Parser),zo("processSync",this.compiler||this.Compiler),this.process(t,i),Rc("processSync","process",n),r;function i(o,a){n=!0,bc(o),r=a}}run(t,n,r){Tc(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=gi(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),Rc("runSync","run",r),i;function o(a,s){bc(a),i=s,r=!0}}stringify(t,n){this.freeze();const r=gi(n),i=this.compiler||this.Compiler;return zo("stringify",i),Tc(t),i(t,r)}use(t,...n){const r=this.attachers,i=this.namespace;if($o("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=jo(!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];Ia(p)&&Ia(f)&&(f=jo(!0,p,f)),r[h]=[c,f,...m]}}}}const Hk=new ks().freeze();function Uo(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `parser`")}function zo(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `compiler`")}function $o(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 Tc(e){if(!Ia(e)||typeof e.type!="string")throw new TypeError("Expected node, got `"+e+"`")}function Rc(e,t,n){if(!n)throw new Error("`"+e+"` finished async. Use `"+t+"` instead")}function gi(e){return Bk(e)?e:new mf(e)}function Bk(e){return!!(e&&typeof e=="object"&&"message"in e&&"messages"in e)}function Uk(e){return typeof e=="string"||zk(e)}function zk(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const $k="https://github.com/remarkjs/react-markdown/blob/main/changelog.md",Pc=[],Ic={allowDangerousHtml:!0},Vk=/^(https?|ircs?|mailto|xmpp)$/i,Kk=[{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 Wk(e){const t=qk(e),n=Gk(e);return Yk(t.runSync(t.parse(n),n),e)}function qk(e){const t=e.rehypePlugins||Pc,n=e.remarkPlugins||Pc,r=e.remarkRehypeOptions?{...e.remarkRehypeOptions,...Ic}:Ic;return Hk().use(T0).use(n).use(kk,r).use(t)}function Gk(e){const t=e.children||"",n=new mf;return typeof t=="string"&&(n.value=t),n}function Yk(e,t){const n=t.allowedElements,r=t.allowElement,i=t.components,o=t.disallowedElements,a=t.skipHtml,s=t.unwrapDisallowed,l=t.urlTransform||Qk;for(const u of Kk)Object.hasOwn(t,u.from)&&(""+u.from+(u.to?"use `"+u.to+"` instead":"remove it")+$k+u.id,void 0);return ws(e,c),ux(e,{Fragment:v.Fragment,components:i,ignoreInvalidStyle:!0,jsx:v.jsx,jsxs:v.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 No)if(Object.hasOwn(No,f)&&Object.hasOwn(u.properties,f)){const m=u.properties[f],p=No[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 Qk(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||Vk.test(e.slice(0,t))?e:""}function Lc(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 Xk(e){if(typeof e!="string")throw new TypeError("Expected a string");return e.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d")}function Jk(e,t,n){const i=ho((n||{}).ignore||[]),o=Zk(t);let a=-1;for(;++a<o.length;)hf(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 y=d.children.indexOf(c);let b=!1,x=[];h.lastIndex=0;let w=h.exec(c.value);for(;w;){const T=w.index,I={index:w.index,input:w.input,stack:[...u,c]};let C=f(...w,I);if(typeof C=="string"&&(C=C.length>0?{type:"text",value:C}:void 0),C===!1?h.lastIndex=T+1:(m!==T&&x.push({type:"text",value:c.value.slice(m,T)}),Array.isArray(C)?x.push(...C):C&&x.push(C),m=T+w[0].length,b=!0),!h.global)break;w=h.exec(c.value)}return b?(m<c.value.length&&x.push({type:"text",value:c.value.slice(m)}),d.children.splice(y,1,...x)):x=[c],y+x.length}}function Zk(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([eS(i[0]),tS(i[1])])}return t}function eS(e){return typeof e=="string"?new RegExp(Xk(e),"g"):e}function tS(e){return typeof e=="function"?e:function(){return e}}const Vo="phrasing",Ko=["autolink","link","image","label"];function nS(){return{transforms:[cS],enter:{literalAutolink:iS,literalAutolinkEmail:Wo,literalAutolinkHttp:Wo,literalAutolinkWww:Wo},exit:{literalAutolink:lS,literalAutolinkEmail:sS,literalAutolinkHttp:oS,literalAutolinkWww:aS}}}function rS(){return{unsafe:[{character:"@",before:"[+\\-.\\w]",after:"[\\-.\\w]",inConstruct:Vo,notInConstruct:Ko},{character:".",before:"[Ww]",after:"[\\-.\\w]",inConstruct:Vo,notInConstruct:Ko},{character:":",before:"[ps]",after:"\\/",inConstruct:Vo,notInConstruct:Ko}]}}function iS(e){this.enter({type:"link",title:null,url:"",children:[]},e)}function Wo(e){this.config.enter.autolinkProtocol.call(this,e)}function oS(e){this.config.exit.autolinkProtocol.call(this,e)}function aS(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 sS(e){this.config.exit.autolinkEmail.call(this,e)}function lS(e){this.exit(e)}function cS(e){Jk(e,[[/(https?:\/\/|www(?=\.))([-.\w]+)([^ \t\r\n]*)/gi,uS],[/(?<=^|\s|\p{P}|\p{S})([-.\w+]+)@([-\w]+(?:\.[-\w]+)+)/gu,dS]],{ignore:["link","linkReference"]})}function uS(e,t,n,r,i){let o="";if(!gf(i)||(/^w/i.test(t)&&(n=t+n,t="",o="http://"),!fS(n)))return!1;const a=hS(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 dS(e,t,n,r){return!gf(r,!0)||/[-\d_]$/.test(n)?!1:{type:"link",title:null,url:"mailto:"+t+"@"+n,children:[{type:"text",value:t+"@"+n}]}}function fS(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 hS(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=Lc(e,"(");let o=Lc(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 gf(e,t){const n=e.input.charCodeAt(e.index-1);return(e.index===0||$n(n)||co(n))&&(!t||n!==47)}yf.peek=kS;function pS(){this.buffer()}function mS(e){this.enter({type:"footnoteReference",identifier:"",label:""},e)}function gS(){this.buffer()}function yS(e){this.enter({type:"footnoteDefinition",identifier:"",label:"",children:[]},e)}function vS(e){const t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=_t(this.sliceSerialize(e)).toLowerCase(),n.label=t}function bS(e){this.exit(e)}function xS(e){const t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=_t(this.sliceSerialize(e)).toLowerCase(),n.label=t}function wS(e){this.exit(e)}function kS(){return"["}function yf(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 SS(){return{enter:{gfmFootnoteCallString:pS,gfmFootnoteCall:mS,gfmFootnoteDefinitionLabelString:gS,gfmFootnoteDefinition:yS},exit:{gfmFootnoteCallString:vS,gfmFootnoteCall:bS,gfmFootnoteDefinitionLabelString:xS,gfmFootnoteDefinition:wS}}}function ES(e){let t=!1;return e&&e.firstLineBlank&&(t=!0),{handlers:{footnoteDefinition:n,footnoteReference:yf},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?`
143
+ `:" ")+o.indentLines(o.containerFlow(r,s.current()),t?vf:CS))),c(),l}}function CS(e,t,n){return t===0?e:vf(e,t,n)}function vf(e,t,n){return(n?"":" ")+e}const AS=["autolink","destinationLiteral","destinationRaw","reference","titleQuote","titleApostrophe"];bf.peek=LS;function TS(){return{canContainEols:["delete"],enter:{strikethrough:PS},exit:{strikethrough:IS}}}function RS(){return{unsafe:[{character:"~",inConstruct:"phrasing",notInConstruct:AS}],handlers:{delete:bf}}}function PS(e){this.enter({type:"delete",children:[]},e)}function IS(e){this.exit(e)}function bf(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 LS(){return"~"}function OS(e){return e.length}function _S(e,t){const n=t||{},r=(n.align||[]).concat(),i=n.stringLength||OS,o=[],a=[],s=[],l=[];let c=0,u=-1;for(;++u<e.length;){const p=[],y=[];let b=-1;for(e[u].length>c&&(c=e[u].length);++b<e[u].length;){const x=NS(e[u][b]);if(n.alignDelimiters!==!1){const w=i(x);y[b]=w,(l[b]===void 0||w>l[b])&&(l[b]=w)}p.push(x)}a[u]=p,s[u]=y}let d=-1;if(typeof r=="object"&&"length"in r)for(;++d<c;)o[d]=Oc(r[d]);else{const p=Oc(r);for(;++d<c;)o[d]=p}d=-1;const h=[],f=[];for(;++d<c;){const p=o[d];let y="",b="";p===99?(y=":",b=":"):p===108?y=":":p===114&&(b=":");let x=n.alignDelimiters===!1?1:Math.max(1,l[d]-y.length-b.length);const w=y+"-".repeat(x)+b;n.alignDelimiters!==!1&&(x=y.length+x+b.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],y=s[u];d=-1;const b=[];for(;++d<c;){const x=p[d]||"";let w="",T="";if(n.alignDelimiters!==!1){const I=l[d]-(y[d]||0),C=o[d];C===114?w=" ".repeat(I):C===99?I%2?(w=" ".repeat(I/2+.5),T=" ".repeat(I/2-.5)):(w=" ".repeat(I/2),T=w):T=" ".repeat(I)}n.delimiterStart!==!1&&!d&&b.push("|"),n.padding!==!1&&!(n.alignDelimiters===!1&&x==="")&&(n.delimiterStart!==!1||d)&&b.push(" "),n.alignDelimiters!==!1&&b.push(w),b.push(x),n.alignDelimiters!==!1&&b.push(T),n.padding!==!1&&b.push(" "),(n.delimiterEnd!==!1||d!==c-1)&&b.push("|")}m.push(n.delimiterEnd===!1?b.join("").replace(/ +$/,""):b.join(""))}return m.join(`
144
+ `)}function NS(e){return e==null?"":String(e)}function Oc(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 DS(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()),MS);return i(),a}function MS(e,t,n){return">"+(n?"":" ")+e}function jS(e,t){return _c(e,t.inConstruct,!0)&&!_c(e,t.notInConstruct,!1)}function _c(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 Nc(e,t,n,r){let i=-1;for(;++i<n.unsafe.length;)if(n.unsafe[i].character===`
145
+ `&&jS(n.stack,n.unsafe[i]))return/[ \t]/.test(r.before)?"":" ";return`\\
146
+ `}function FS(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 HS(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 BS(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 US(e,t,n,r){const i=BS(n),o=e.value||"",a=i==="`"?"GraveAccent":"Tilde";if(HS(e,n)){const d=n.enter("codeIndented"),h=n.indentLines(o,zS);return d(),h}const s=n.createTracker(r),l=i.repeat(Math.max(FS(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:`
147
+ `,encode:["`"],...s.current()})),d()}return u+=s.move(`
148
+ `),o&&(u+=s.move(o+`
149
+ `)),u+=s.move(l),c(),u}function zS(e,t,n){return(n?"":" ")+e}function Ss(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 $S(e,t,n,r){const i=Ss(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?" ":`
150
+ `,...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 VS(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 Xr(e){return"&#x"+e.toString(16).toUpperCase()+";"}function $i(e,t,n){const r=pr(e),i=pr(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}}xf.peek=KS;function xf(e,t,n,r){const i=VS(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=$i(r.before.charCodeAt(r.before.length-1),c,i);u.inside&&(l=Xr(c)+l.slice(1));const d=l.charCodeAt(l.length-1),h=$i(r.after.charCodeAt(0),d,i);h.inside&&(l=l.slice(0,-1)+Xr(d));const f=a.move(i);return o(),n.attentionEncodeSurroundingInfo={after:h.outside,before:u.outside},s+l+f}function KS(e,t,n){return n.options.emphasis||"*"}function WS(e,t){let n=!1;return ws(e,function(r){if("value"in r&&/\r?\n|\r/.test(r.value)||r.type==="break")return n=!0,Ra}),!!((!e.depth||e.depth<3)&&ps(e)&&(t.options.setext||n))}function qS(e,t,n,r){const i=Math.max(Math.min(6,e.depth||1),1),o=n.createTracker(r);if(WS(e,n)){const u=n.enter("headingSetext"),d=n.enter("phrasing"),h=n.containerPhrasing(e,{...o.current(),before:`
151
+ `,after:`
152
+ `});return d(),u(),h+`
153
+ `+(i===1?"=":"-").repeat(h.length-(Math.max(h.lastIndexOf("\r"),h.lastIndexOf(`
154
+ `))+1))}const a="#".repeat(i),s=n.enter("headingAtx"),l=n.enter("phrasing");o.move(a+" ");let c=n.containerPhrasing(e,{before:"# ",after:`
155
+ `,...o.current()});return/^[\t ]/.test(c)&&(c=Xr(c.charCodeAt(0))+c.slice(1)),c=c?a+" "+c:a,n.options.closeAtx&&(c+=" "+a),l(),s(),c}wf.peek=GS;function wf(e){return e.value||""}function GS(){return"<"}kf.peek=YS;function kf(e,t,n,r){const i=Ss(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 YS(){return"!"}Sf.peek=QS;function Sf(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 QS(){return"!"}Ef.peek=XS;function Ef(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 XS(){return"`"}function Cf(e,t){const n=ps(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))}Af.peek=JS;function Af(e,t,n,r){const i=Ss(n),o=i==='"'?"Quote":"Apostrophe",a=n.createTracker(r);let s,l;if(Cf(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 JS(e,t,n){return Cf(e,n)?"<":"["}Tf.peek=ZS;function Tf(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 ZS(){return"["}function Es(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 e1(e){const t=Es(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 t1(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 Rf(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 n1(e,t,n,r){const i=n.enter("list"),o=n.bulletCurrent;let a=e.ordered?t1(n):Es(n);const s=e.ordered?a==="."?")":".":e1(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),Rf(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 r1(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 i1(e,t,n,r){const i=r1(n);let o=n.bulletCurrent||Es(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 o1(e,t,n,r){const i=n.enter("paragraph"),o=n.enter("phrasing"),a=n.containerPhrasing(e,r);return o(),i(),a}const a1=ho(["break","delete","emphasis","footnote","footnoteReference","image","imageReference","inlineCode","inlineMath","link","linkReference","mdxJsxTextElement","mdxTextExpression","strong","text","textDirective"]);function s1(e,t,n,r){return(e.children.some(function(a){return a1(a)})?n.containerPhrasing:n.containerFlow).call(n,e,r)}function l1(e){const t=e.options.strong||"*";if(t!=="*"&&t!=="_")throw new Error("Cannot serialize strong with `"+t+"` for `options.strong`, expected `*`, or `_`");return t}Pf.peek=c1;function Pf(e,t,n,r){const i=l1(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=$i(r.before.charCodeAt(r.before.length-1),c,i);u.inside&&(l=Xr(c)+l.slice(1));const d=l.charCodeAt(l.length-1),h=$i(r.after.charCodeAt(0),d,i);h.inside&&(l=l.slice(0,-1)+Xr(d));const f=a.move(i+i);return o(),n.attentionEncodeSurroundingInfo={after:h.outside,before:u.outside},s+l+f}function c1(e,t,n){return n.options.strong||"*"}function u1(e,t,n,r){return n.safe(e.value,r)}function d1(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 f1(e,t,n){const r=(Rf(n)+(n.options.ruleSpaces?" ":"")).repeat(d1(n));return n.options.ruleSpaces?r.slice(0,-1):r}const If={blockquote:DS,break:Nc,code:US,definition:$S,emphasis:xf,hardBreak:Nc,heading:qS,html:wf,image:kf,imageReference:Sf,inlineCode:Ef,link:Af,linkReference:Tf,list:n1,listItem:i1,paragraph:o1,root:s1,strong:Pf,text:u1,thematicBreak:f1};function h1(){return{enter:{table:p1,tableData:Dc,tableHeader:Dc,tableRow:g1},exit:{codeText:y1,table:m1,tableData:qo,tableHeader:qo,tableRow:qo}}}function p1(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 m1(e){this.exit(e),this.data.inTable=void 0}function g1(e){this.enter({type:"tableRow",children:[]},e)}function qo(e){this.exit(e)}function Dc(e){this.enter({type:"tableCell",children:[]},e)}function y1(e){let t=this.resume();this.data.inTable&&(t=t.replace(/\\([\\|])/g,v1));const n=this.stack[this.stack.length-1];n.type,n.value=t,this.exit(e)}function v1(e,t){return t==="|"?t:e}function b1(e){const t=e||{},n=t.tableCellPadding,r=t.tablePipeAlign,i=t.stringLength,o=n?" ":"|";return{unsafe:[{character:"\r",inConstruct:"tableCell"},{character:`
156
+ `,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,y){return c(u(f,p,y),f.align)}function s(f,m,p,y){const b=d(f,p,y),x=c([b]);return x.slice(0,x.indexOf(`
157
+ `))}function l(f,m,p,y){const b=p.enter("tableCell"),x=p.enter("phrasing"),w=p.containerPhrasing(f,{...y,before:o,after:o});return x(),b(),w}function c(f,m){return _S(f,{align:m,alignDelimiters:r,padding:n,stringLength:i})}function u(f,m,p){const y=f.children;let b=-1;const x=[],w=m.enter("table");for(;++b<y.length;)x[b]=d(y[b],m,p);return w(),x}function d(f,m,p){const y=f.children;let b=-1;const x=[],w=m.enter("tableRow");for(;++b<y.length;)x[b]=l(y[b],f,m,p);return w(),x}function h(f,m,p){let y=If.inlineCode(f,m,p);return p.stack.includes("tableCell")&&(y=y.replace(/\|/g,"\\$&")),y}}function x1(){return{exit:{taskListCheckValueChecked:Mc,taskListCheckValueUnchecked:Mc,paragraph:k1}}}function w1(){return{unsafe:[{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{listItem:S1}}}function Mc(e){const t=this.stack[this.stack.length-2];t.type,t.checked=e.type==="taskListCheckValueChecked"}function k1(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 S1(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=If.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 E1(){return[nS(),SS(),TS(),h1(),x1()]}function C1(e){return{extensions:[rS(),ES(e),RS(),b1(e),w1()]}}const A1={tokenize:O1,partial:!0},Lf={tokenize:_1,partial:!0},Of={tokenize:N1,partial:!0},_f={tokenize:D1,partial:!0},T1={tokenize:M1,partial:!0},Nf={name:"wwwAutolink",tokenize:I1,previous:Mf},Df={name:"protocolAutolink",tokenize:L1,previous:jf},cn={name:"emailAutolink",tokenize:P1,previous:Ff},Gt={};function R1(){return{text:Gt}}let Ln=48;for(;Ln<123;)Gt[Ln]=cn,Ln++,Ln===58?Ln=65:Ln===91&&(Ln=97);Gt[43]=cn;Gt[45]=cn;Gt[46]=cn;Gt[95]=cn;Gt[72]=[cn,Df];Gt[104]=[cn,Df];Gt[87]=[cn,Nf];Gt[119]=[cn,Nf];function P1(e,t,n){const r=this;let i,o;return a;function a(d){return!Oa(d)||!Ff.call(r,r.previous)||Cs(r.events)?n(d):(e.enter("literalAutolink"),e.enter("literalAutolinkEmail"),s(d))}function s(d){return Oa(d)?(e.consume(d),s):d===64?(e.consume(d),l):n(d)}function l(d){return d===46?e.check(T1,u,c)(d):d===45||d===95||it(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&&lt(r.previous)?(e.exit("literalAutolinkEmail"),e.exit("literalAutolink"),t(d)):n(d)}}function I1(e,t,n){const r=this;return i;function i(a){return a!==87&&a!==119||!Mf.call(r,r.previous)||Cs(r.events)?n(a):(e.enter("literalAutolink"),e.enter("literalAutolinkWww"),e.check(A1,e.attempt(Lf,e.attempt(Of,o),n),n)(a))}function o(a){return e.exit("literalAutolinkWww"),e.exit("literalAutolink"),t(a)}}function L1(e,t,n){const r=this;let i="",o=!1;return a;function a(d){return(d===72||d===104)&&jf.call(r,r.previous)&&!Cs(r.events)?(e.enter("literalAutolink"),e.enter("literalAutolinkHttp"),i+=String.fromCodePoint(d),e.consume(d),s):n(d)}function s(d){if(lt(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||Bi(d)||De(d)||$n(d)||co(d)?n(d):e.attempt(Lf,e.attempt(Of,u),n)(d)}function u(d){return e.exit("literalAutolinkHttp"),e.exit("literalAutolink"),t(d)}}function O1(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 _1(e,t,n){let r,i,o;return a;function a(c){return c===46||c===95?e.check(_f,l,s)(c):c===null||De(c)||$n(c)||c!==45&&co(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 N1(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(_f,t,o)(a):a===null||De(a)||$n(a)?t(a):(e.consume(a),i)}function o(a){return a===41&&r++,e.consume(a),i}}function D1(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||De(s)||$n(s)?t(s):n(s)}function i(s){return s===null||s===40||s===91||De(s)||$n(s)?t(s):r(s)}function o(s){return lt(s)?a(s):n(s)}function a(s){return s===59?(e.consume(s),r):lt(s)?(e.consume(s),a):n(s)}}function M1(e,t,n){return r;function r(o){return e.consume(o),i}function i(o){return it(o)?n(o):t(o)}}function Mf(e){return e===null||e===40||e===42||e===95||e===91||e===93||e===126||De(e)}function jf(e){return!lt(e)}function Ff(e){return!(e===47||Oa(e))}function Oa(e){return e===43||e===45||e===46||e===95||it(e)}function Cs(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 j1={tokenize:K1,partial:!0};function F1(){return{document:{91:{name:"gfmFootnoteDefinition",tokenize:z1,continuation:{tokenize:$1},exit:V1}},text:{91:{name:"gfmFootnoteCall",tokenize:U1},93:{name:"gfmPotentialFootnoteCall",add:"after",tokenize:H1,resolveTo:B1}}}}function H1(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=_t(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 B1(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 U1(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||De(d))return n(d);if(d===93){e.exit("chunkString");const h=e.exit("gfmFootnoteCallString");return i.includes(_t(r.sliceSerialize(h)))?(e.enter("gfmFootnoteCallLabelMarker"),e.consume(d),e.exit("gfmFootnoteCallLabelMarker"),e.exit("gfmFootnoteCall"),t):n(d)}return De(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 z1(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||De(m))return n(m);if(m===93){e.exit("chunkString");const p=e.exit("gfmFootnoteDefinitionLabelString");return o=_t(r.sliceSerialize(p)),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(m),e.exit("gfmFootnoteDefinitionLabelMarker"),e.exit("gfmFootnoteDefinitionLabel"),h}return De(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),Ce(e,f,"gfmFootnoteDefinitionWhitespace")):n(m)}function f(m){return t(m)}}function $1(e,t,n){return e.check(ii,t,e.attempt(j1,t,n))}function V1(e){e.exit("gfmFootnoteDefinition")}function K1(e,t,n){const r=this;return Ce(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 W1(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&&xt(h,h.length,0,uo(f,a.slice(c+1,l),s)),xt(h,h.length,0,[["exit",d,s],["enter",a[l][1],s],["exit",a[l][1],s],["exit",u,s]]),xt(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=pr(c);if(m===126)return d>1?l(m):(a.consume(m),d++,f);if(d<2&&!n)return l(m);const y=a.exit("strikethroughSequenceTemporary"),b=pr(m);return y._open=!b||b===2&&!!p,y._close=!p||p===2&&!!b,s(m)}}}class q1{constructor(){this.map=[]}add(t,n,r){G1(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 G1(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 Y1(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 Q1(){return{flow:{null:{name:"table",tokenize:X1,resolveAll:J1}}}}function X1(e,t,n){const r=this;let i=0,o=0,a;return s;function s(R){let N=r.events.length-1;for(;N>-1;){const H=r.events[N][1].type;if(H==="lineEnding"||H==="linePrefix")N--;else break}const L=N>-1?r.events[N][1].type:null,K=L==="tableHead"||L==="tableRow"?C:l;return K===C&&r.parser.lazy[r.now().line]?n(R):K(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):ke(R)?Ce(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||De(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,ke(R)?Ce(e,m,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(R):m(R))}function m(R){return R===45||R===58?y(R):R===124?(a=!0,e.enter("tableCellDivider"),e.consume(R),e.exit("tableCellDivider"),p):I(R)}function p(R){return ke(R)?Ce(e,y,"whitespace")(R):y(R)}function y(R){return R===58?(o+=1,a=!0,e.enter("tableDelimiterMarker"),e.consume(R),e.exit("tableDelimiterMarker"),b):R===45?(o+=1,b(R)):R===null||oe(R)?T(R):I(R)}function b(R){return R===45?(e.enter("tableDelimiterFiller"),x(R)):I(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 ke(R)?Ce(e,T,"whitespace")(R):T(R)}function T(R){return R===124?m(R):R===null||oe(R)?!a||i!==o?I(R):(e.exit("tableDelimiterRow"),e.exit("tableHead"),t(R)):I(R)}function I(R){return n(R)}function C(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)):ke(R)?Ce(e,k,"whitespace")(R):(e.enter("data"),D(R))}function D(R){return R===null||R===124||De(R)?(e.exit("data"),k(R)):(e.consume(R),R===92?F:D)}function F(R){return R===92||R===124?(e.consume(R),D):D(R)}}function J1(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 q1;for(;++n<e.length;){const f=e[n],m=f[1];f[0]==="enter"?m.type==="tableHead"?(s=!1,l!==0&&(jc(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=yi(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=yi(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=yi(h,t,o,i,n,d)):a[1]!==0&&(d=yi(h,t,a,i,n,d)),i=0):i&&(m.type==="data"||m.type==="tableDelimiterMarker"||m.type==="tableDelimiterFiller")&&(a[3]=n)}for(l!==0&&jc(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=Y1(t.events,n))}return e}function yi(e,t,n,r,i,o){const a=r===1?"tableHeader":r===2?"tableDelimiter":"tableData",s="tableContent";n[0]!==0&&(o.end=Object.assign({},lr(t.events,n[0])),e.add(n[0],0,[["exit",o,t]]));const l=lr(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=lr(t.events,n[2]),u=lr(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({},lr(t.events,i)),e.add(i,0,[["exit",o,t]]),o=void 0),o}function jc(e,t,n,r,i){const o=[],a=lr(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 lr(e,t){const n=e[t],r=n[0]==="enter"?"start":"end";return n[1][r]}const Z1={name:"tasklistCheck",tokenize:tE};function eE(){return{text:{91:Z1}}}function tE(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 De(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):ke(l)?e.check({tokenize:nE},t,n)(l):n(l)}}function nE(e,t,n){return Ce(e,r,"whitespace");function r(i){return i===null?n(i):t(i)}}function rE(e){return qd([R1(),F1(),W1(e),Q1(),eE()])}const iE={};function oE(e){const t=this,n=e||iE,r=t.data(),i=r.micromarkExtensions||(r.micromarkExtensions=[]),o=r.fromMarkdownExtensions||(r.fromMarkdownExtensions=[]),a=r.toMarkdownExtensions||(r.toMarkdownExtensions=[]);i.push(rE(n)),o.push(E1()),a.push(C1(n))}const aE={h1:({children:e,...t})=>v.jsx("h2",{className:"mt-2 mb-1 text-base font-semibold",...t,children:e}),h2:({children:e,...t})=>v.jsx("h3",{className:"mt-2 mb-1 text-sm font-semibold",...t,children:e}),h3:({children:e,...t})=>v.jsx("h4",{className:"mt-1.5 mb-1 text-sm font-semibold",...t,children:e}),h4:({children:e,...t})=>v.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})=>v.jsx("h6",{className:"mt-1.5 mb-0.5 text-xs font-semibold text-text-muted",...t,children:e}),h6:({children:e,...t})=>v.jsx("h6",{className:"mt-1.5 mb-0.5 text-xs font-medium text-text-muted",...t,children:e}),p:({children:e,...t})=>v.jsx("p",{className:"my-1 leading-relaxed",...t,children:e}),strong:({children:e,...t})=>v.jsx("strong",{className:"font-semibold text-text",...t,children:e}),em:({children:e,...t})=>v.jsx("em",{className:"italic",...t,children:e}),a:({children:e,...t})=>v.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})=>v.jsx("ul",{className:"my-1 ml-5 list-disc space-y-0.5",...t,children:e}),ol:({children:e,...t})=>v.jsx("ol",{className:"my-1 ml-5 list-decimal space-y-0.5",...t,children:e}),li:({children:e,...t})=>v.jsx("li",{className:"leading-relaxed",...t,children:e}),blockquote:({children:e,...t})=>v.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?v.jsx("code",{className:"rounded bg-surface-2 px-1 py-0.5 font-mono text-[0.85em]",...r,children:n}):v.jsx("code",{className:Le("font-mono text-xs",t),...r,children:n}),pre:({children:e,...t})=>v.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})=>v.jsx("div",{className:"my-2 overflow-x-auto",children:v.jsx("table",{className:"w-full border-collapse text-xs",...t,children:e})}),thead:({children:e,...t})=>v.jsx("thead",{className:"border-b border-border bg-surface-2/50",...t,children:e}),tbody:({children:e,...t})=>v.jsx("tbody",{...t,children:e}),tr:({children:e,...t})=>v.jsx("tr",{className:"border-b border-border/40 last:border-b-0",...t,children:e}),th:({children:e,...t})=>v.jsx("th",{className:"px-2 py-1 text-left font-semibold",...t,children:e}),td:({children:e,...t})=>v.jsx("td",{className:"px-2 py-1 align-top",...t,children:e}),hr:e=>v.jsx("hr",{className:"my-2 border-border",...e})};function sE({content:e,className:t}){return v.jsx("div",{className:Le("text-sm leading-relaxed [&>*:first-child]:mt-0 [&>*:last-child]:mb-0",t),children:v.jsx(Wk,{remarkPlugins:[oE],components:aE,children:e})})}function lE({msg:e,onApprove:t}){if(e.approval)return v.jsx(cE,{approval:e.approval,onApprove:t});const n=e.role==="user";return v.jsx("div",{className:Le("flex",n?"justify-end":"justify-start"),children:v.jsxs("div",{className:Le("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&&v.jsx("div",{className:"mb-1 text-xs font-medium text-text-muted",children:e.agent}),!n&&e.content?v.jsx(sE,{content:e.content,className:"break-words"}):v.jsx("div",{className:"whitespace-pre-wrap break-words text-sm leading-relaxed",children:e.content||e.role==="assistant"&&v.jsx("span",{className:"inline-block animate-pulse text-text-dim",children:"…"})})]})})}function cE({approval:e,onApprove:t}){const{t:n}=kt(),{messageId:r,prompt:i,text:o,outcome:a}=e,s=i?.mode==="auto-allow",[l,c]=g.useState(null);g.useEffect(()=>{a&&c(null)},[a]);function u(d){if(l||!i||!t)return;c(d),t(r,i.reqId,d)===!1&&c(null)}return v.jsxs("div",{className:Le("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:[v.jsxs("div",{className:"mb-2 flex flex-wrap items-center gap-2",children:[v.jsx(st,{variant:"warning",children:n("chat.approvalTitle",{defaultValue:"🔐 Tool approval"})}),s&&!a&&v.jsx(st,{variant:"outline",className:"text-[10px] uppercase",children:n("chat.approvalAutoBadge",{defaultValue:"auto-allow"})})]}),s&&!a&&i&&v.jsx(uE,{graceSeconds:i.graceSeconds??0}),i?v.jsxs("div",{className:"mt-1 flex flex-col gap-2 text-sm",children:[v.jsx(Fc,{label:n("chat.approvalToolLabel",{defaultValue:"Tool"}),children:v.jsx("code",{className:"rounded bg-surface-2 px-1.5 py-0.5 font-mono text-xs",children:i.toolName})}),v.jsx(Fc,{label:n("chat.approvalInputLabel",{defaultValue:"Input"}),children:v.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?v.jsx("pre",{className:"whitespace-pre-wrap break-words text-sm text-text",children:o}):null,a?v.jsx(dE,{outcome:a}):i?v.jsxs(v.Fragment,{children:[v.jsxs("div",{className:"mt-3 flex flex-wrap gap-2",children:[!s&&v.jsxs(v.Fragment,{children:[v.jsx(bt,{size:"sm",disabled:l!==null,onClick:()=>u("y"),children:n("chat.approvalAllow",{defaultValue:"Allow"})}),v.jsx(bt,{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"})})]}),v.jsx(bt,{size:"sm",variant:"destructive",disabled:l!==null,onClick:()=>u("n"),children:n("chat.approvalDeny",{defaultValue:"Deny"})})]}),l!==null&&v.jsx("p",{className:"mt-2 text-xs text-text-dim",children:n("chat.approvalSubmitting",{defaultValue:"已发送,等待结果…"})})]}):null]})}function Fc({label:e,children:t}){return v.jsxs("div",{className:"flex flex-col gap-0.5",children:[v.jsx("span",{className:"text-xs font-medium text-text-muted",children:e}),t]})}function uE({graceSeconds:e}){const{t}=kt(),[n,r]=g.useState(Math.max(0,e));return g.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:v.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 dE({outcome:e}){const{t}=kt(),n=e.byUserDisplay?` · ${e.byUserDisplay}`:"";switch(e.decision){case"allowed":return v.jsx("div",{className:"mt-3",children:v.jsxs(st,{variant:"success",children:[t("chat.outcome.allowed",{defaultValue:"✅ Allowed"}),n]})});case"allowed-pinned":return v.jsx("div",{className:"mt-3",children:v.jsxs(st,{variant:"success",children:[t("chat.outcome.allowedPinned",{defaultValue:"✅ Allowed + auto-allow further"}),n]})});case"denied":return v.jsx("div",{className:"mt-3",children:v.jsxs(st,{variant:"danger",children:[t("chat.outcome.denied",{defaultValue:"❌ Denied"}),n]})});case"denied-revoked":return v.jsx("div",{className:"mt-3",children:v.jsxs(st,{variant:"danger",children:[t("chat.outcome.deniedRevoked",{defaultValue:"❌ Denied (auto-allow revoked)"}),n]})});case"expired":return v.jsx("div",{className:"mt-3",children:v.jsxs(st,{variant:"outline",children:[t("chat.outcome.expired",{defaultValue:"⏱ Timed out"}),n]})})}}function fE({approvals:e,onApprove:t}){return e.length===0?null:v.jsx("div",{className:"border-t border-warning/40 bg-warning-bg/40",children:v.jsx("div",{className:"mx-auto max-h-60 w-full max-w-3xl overflow-y-auto px-3 py-2 sm:px-4",children:v.jsx("div",{className:"flex flex-col gap-2",children:e.map(n=>v.jsx(hE,{entry:n,onApprove:t},n.messageId))})})})}function hE({entry:e,onApprove:t}){const{t:n}=kt(),{messageId:r,prompt:i,outcome:o}=e,a=i.mode==="auto-allow",[s,l]=g.useState(null);g.useEffect(()=>{o&&l(null)},[o]);function c(u){if(s||!t)return;l(u),t(r,i.reqId,u)===!1&&l(null)}return v.jsxs("div",{className:Le("rounded-lg border bg-surface p-3 shadow-sm transition-opacity",o?"border-success/60 opacity-80":"border-warning"),children:[v.jsxs("div",{className:"mb-1.5 flex flex-wrap items-center gap-2",children:[v.jsxs(st,{variant:"warning",className:"gap-1",children:[v.jsx(Gg,{className:"h-3 w-3"}),n("chat.approvalTitle",{defaultValue:"工具授权"})]}),a&&!o&&v.jsx(st,{variant:"outline",className:"text-[10px] uppercase",children:n("chat.approvalAutoBadge",{defaultValue:"auto-allow"})}),a&&!o&&i.graceSeconds!=null&&v.jsx(pE,{graceSeconds:i.graceSeconds}),v.jsx("code",{className:"ml-auto rounded bg-surface-2 px-1.5 py-0.5 font-mono text-xs",children:i.toolName})]}),v.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?v.jsx(mE,{outcome:o}):v.jsxs(v.Fragment,{children:[v.jsxs("div",{className:"flex flex-wrap gap-2",children:[!a&&v.jsxs(v.Fragment,{children:[v.jsx(bt,{size:"sm",disabled:s!==null,onClick:()=>c("y"),children:n("chat.approvalAllow",{defaultValue:"批准"})}),v.jsx(bt,{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",{defaultValue:"本类自动放行"})})]}),v.jsx(bt,{size:"sm",variant:"destructive",disabled:s!==null,onClick:()=>c("n"),children:n("chat.approvalDeny",{defaultValue:"拒绝"})})]}),s!==null&&v.jsx("p",{className:"mt-1.5 text-xs text-text-dim",children:n("chat.approvalSubmitting",{defaultValue:"已发送,等待结果…"})})]})]})}function pE({graceSeconds:e}){const{t}=kt(),[n,r]=g.useState(Math.max(0,e));return g.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:v.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 mE({outcome:e}){const{t}=kt(),n=e.byUserDisplay?` · ${e.byUserDisplay}`:"";switch(e.decision){case"allowed":return v.jsxs(st,{variant:"success",children:[t("chat.outcome.allowed",{defaultValue:"✅ Allowed"}),n]});case"allowed-pinned":return v.jsxs(st,{variant:"success",children:[t("chat.outcome.allowedPinned",{defaultValue:"✅ Allowed + auto-allow further"}),n]});case"denied":return v.jsxs(st,{variant:"danger",children:[t("chat.outcome.denied",{defaultValue:"❌ Denied"}),n]});case"denied-revoked":return v.jsxs(st,{variant:"danger",children:[t("chat.outcome.deniedRevoked",{defaultValue:"❌ Denied (auto-allow revoked)"}),n]});case"expired":return v.jsxs(st,{variant:"outline",children:[t("chat.outcome.expired",{defaultValue:"⏱ Timed out"}),n]})}}function Hc(e,[t,n]){return Math.min(n,Math.max(t,e))}function je(e,t,{checkForDefaultPrevented:n=!0}={}){return function(i){if(e?.(i),n===!1||!i.defaultPrevented)return t?.(i)}}function cN(e,t){const n=g.createContext(t);n.displayName=e+"Context";const r=o=>{const{children:a,...s}=o,l=g.useMemo(()=>s,Object.values(s));return v.jsx(n.Provider,{value:l,children:a})};r.displayName=e+"Provider";function i(o){const a=g.useContext(n);if(a)return a;if(t!==void 0)return t;throw new Error(`\`${o}\` must be used within \`${e}\``)}return[r,i]}function mo(e,t=[]){let n=[];function r(o,a){const s=g.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,y=g.useMemo(()=>m,Object.values(m));return v.jsx(p.Provider,{value:y,children:f})};c.displayName=o+"Provider";function u(d,h){const f=h?.[e]?.[l]||s,m=g.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=>g.createContext(a));return function(s){const l=s?.[e]||o;return g.useMemo(()=>({[`__scope${e}`]:{...s,[e]:l}}),[s,l])}};return i.scopeName=e,[r,gE(i,...t)]}function gE(...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 g.useMemo(()=>({[`__scope${t.scopeName}`]:a}),[a])}};return n.scopeName=t.scopeName,n}function yE(e){const t=e+"CollectionProvider",[n,r]=mo(t),[i,o]=n(t,{collectionRef:{current:null},itemMap:new Map}),a=p=>{const{scope:y,children:b}=p,x=g.useRef(null),w=g.useRef(new Map).current;return v.jsx(i,{scope:y,itemMap:w,collectionRef:x,children:b})};a.displayName=t;const s=e+"CollectionSlot",l=Gr(s),c=g.forwardRef((p,y)=>{const{scope:b,children:x}=p,w=o(s,b),T=Ye(y,w.collectionRef);return v.jsx(l,{ref:T,children:x})});c.displayName=s;const u=e+"CollectionItemSlot",d="data-radix-collection-item",h=Gr(u),f=g.forwardRef((p,y)=>{const{scope:b,children:x,...w}=p,T=g.useRef(null),I=Ye(y,T),C=o(u,b);return g.useEffect(()=>(C.itemMap.set(T,{ref:T,...w}),()=>void C.itemMap.delete(T))),v.jsx(h,{[d]:"",ref:I,children:x})});f.displayName=u;function m(p){const y=o(e+"CollectionConsumer",p);return g.useCallback(()=>{const x=y.collectionRef.current;if(!x)return[];const w=Array.from(x.querySelectorAll(`[${d}]`));return Array.from(y.itemMap.values()).sort((C,k)=>w.indexOf(C.ref.current)-w.indexOf(k.ref.current))},[y.collectionRef,y.itemMap])}return[{Provider:a,Slot:c,ItemSlot:f},m,r]}var vE=g.createContext(void 0);function bE(e){const t=g.useContext(vE);return e||t||"ltr"}function Vn(e){const t=g.useRef(e);return g.useEffect(()=>{t.current=e}),g.useMemo(()=>(...n)=>t.current?.(...n),[])}function xE(e,t=globalThis?.document){const n=Vn(e);g.useEffect(()=>{const r=i=>{i.key==="Escape"&&n(i)};return t.addEventListener("keydown",r,{capture:!0}),()=>t.removeEventListener("keydown",r,{capture:!0})},[n,t])}var wE="DismissableLayer",_a="dismissableLayer.update",kE="dismissableLayer.pointerDownOutside",SE="dismissableLayer.focusOutside",Bc,Hf=g.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),As=g.forwardRef((e,t)=>{const{disableOutsidePointerEvents:n=!1,onEscapeKeyDown:r,onPointerDownOutside:i,onFocusOutside:o,onInteractOutside:a,onDismiss:s,...l}=e,c=g.useContext(Hf),[u,d]=g.useState(null),h=u?.ownerDocument??globalThis?.document,[,f]=g.useState({}),m=Ye(t,k=>d(k)),p=Array.from(c.layers),[y]=[...c.layersWithOutsidePointerEventsDisabled].slice(-1),b=p.indexOf(y),x=u?p.indexOf(u):-1,w=c.layersWithOutsidePointerEventsDisabled.size>0,T=x>=b,I=AE(k=>{const D=k.target,F=[...c.branches].some(R=>R.contains(D));!T||F||(i?.(k),a?.(k),k.defaultPrevented||s?.())},h),C=TE(k=>{const D=k.target;[...c.branches].some(R=>R.contains(D))||(o?.(k),a?.(k),k.defaultPrevented||s?.())},h);return xE(k=>{x===c.layers.size-1&&(r?.(k),!k.defaultPrevented&&s&&(k.preventDefault(),s()))},h),g.useEffect(()=>{if(u)return n&&(c.layersWithOutsidePointerEventsDisabled.size===0&&(Bc=h.body.style.pointerEvents,h.body.style.pointerEvents="none"),c.layersWithOutsidePointerEventsDisabled.add(u)),c.layers.add(u),Uc(),()=>{n&&(c.layersWithOutsidePointerEventsDisabled.delete(u),c.layersWithOutsidePointerEventsDisabled.size===0&&(h.body.style.pointerEvents=Bc))}},[u,h,n,c]),g.useEffect(()=>()=>{u&&(c.layers.delete(u),c.layersWithOutsidePointerEventsDisabled.delete(u),Uc())},[u,c]),g.useEffect(()=>{const k=()=>f({});return document.addEventListener(_a,k),()=>document.removeEventListener(_a,k)},[]),v.jsx(Ue.div,{...l,ref:m,style:{pointerEvents:w?T?"auto":"none":void 0,...e.style},onFocusCapture:je(e.onFocusCapture,C.onFocusCapture),onBlurCapture:je(e.onBlurCapture,C.onBlurCapture),onPointerDownCapture:je(e.onPointerDownCapture,I.onPointerDownCapture)})});As.displayName=wE;var EE="DismissableLayerBranch",CE=g.forwardRef((e,t)=>{const n=g.useContext(Hf),r=g.useRef(null),i=Ye(t,r);return g.useEffect(()=>{const o=r.current;if(o)return n.branches.add(o),()=>{n.branches.delete(o)}},[n.branches]),v.jsx(Ue.div,{...e,ref:i})});CE.displayName=EE;function AE(e,t=globalThis?.document){const n=Vn(e),r=g.useRef(!1),i=g.useRef(()=>{});return g.useEffect(()=>{const o=s=>{if(s.target&&!r.current){let l=function(){Bf(kE,n,c,{discrete:!0})};const c={originalEvent:s};s.pointerType==="touch"?(t.removeEventListener("click",i.current),i.current=l,t.addEventListener("click",i.current,{once:!0})):l()}else t.removeEventListener("click",i.current);r.current=!1},a=window.setTimeout(()=>{t.addEventListener("pointerdown",o)},0);return()=>{window.clearTimeout(a),t.removeEventListener("pointerdown",o),t.removeEventListener("click",i.current)}},[t,n]),{onPointerDownCapture:()=>r.current=!0}}function TE(e,t=globalThis?.document){const n=Vn(e),r=g.useRef(!1);return g.useEffect(()=>{const i=o=>{o.target&&!r.current&&Bf(SE,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 Uc(){const e=new CustomEvent(_a);document.dispatchEvent(e)}function Bf(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?tb(i,o):i.dispatchEvent(o)}var vi=0,nr=null;function RE(){g.useEffect(()=>{nr||(nr={start:zc(),end:zc()});const{start:e,end:t}=nr;return document.body.firstElementChild!==e&&document.body.insertAdjacentElement("afterbegin",e),document.body.lastElementChild!==t&&document.body.insertAdjacentElement("beforeend",t),vi++,()=>{vi===1&&(nr?.start.remove(),nr?.end.remove(),nr=null),vi=Math.max(0,vi-1)}},[])}function zc(){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 Go="focusScope.autoFocusOnMount",Yo="focusScope.autoFocusOnUnmount",$c={bubbles:!1,cancelable:!0},PE="FocusScope",Uf=g.forwardRef((e,t)=>{const{loop:n=!1,trapped:r=!1,onMountAutoFocus:i,onUnmountAutoFocus:o,...a}=e,[s,l]=g.useState(null),c=Vn(i),u=Vn(o),d=g.useRef(null),h=Ye(t,p=>l(p)),f=g.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;g.useEffect(()=>{if(r){let p=function(w){if(f.paused||!s)return;const T=w.target;s.contains(T)?d.current=T:mn(d.current,{select:!0})},y=function(w){if(f.paused||!s)return;const T=w.relatedTarget;T!==null&&(s.contains(T)||mn(d.current,{select:!0}))},b=function(w){if(document.activeElement===document.body)for(const I of w)I.removedNodes.length>0&&mn(s)};document.addEventListener("focusin",p),document.addEventListener("focusout",y);const x=new MutationObserver(b);return s&&x.observe(s,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",p),document.removeEventListener("focusout",y),x.disconnect()}}},[r,s,f.paused]),g.useEffect(()=>{if(s){Kc.add(f);const p=document.activeElement;if(!s.contains(p)){const b=new CustomEvent(Go,$c);s.addEventListener(Go,c),s.dispatchEvent(b),b.defaultPrevented||(IE(DE(zf(s)),{select:!0}),document.activeElement===p&&mn(s))}return()=>{s.removeEventListener(Go,c),setTimeout(()=>{const b=new CustomEvent(Yo,$c);s.addEventListener(Yo,u),s.dispatchEvent(b),b.defaultPrevented||mn(p??document.body,{select:!0}),s.removeEventListener(Yo,u),Kc.remove(f)},0)}}},[s,c,u,f]);const m=g.useCallback(p=>{if(!n&&!r||f.paused)return;const y=p.key==="Tab"&&!p.altKey&&!p.ctrlKey&&!p.metaKey,b=document.activeElement;if(y&&b){const x=p.currentTarget,[w,T]=LE(x);w&&T?!p.shiftKey&&b===T?(p.preventDefault(),n&&mn(w,{select:!0})):p.shiftKey&&b===w&&(p.preventDefault(),n&&mn(T,{select:!0})):b===x&&p.preventDefault()}},[n,r,f.paused]);return v.jsx(Ue.div,{tabIndex:-1,...a,ref:h,onKeyDown:m})});Uf.displayName=PE;function IE(e,{select:t=!1}={}){const n=document.activeElement;for(const r of e)if(mn(r,{select:t}),document.activeElement!==n)return}function LE(e){const t=zf(e),n=Vc(t,e),r=Vc(t.reverse(),e);return[n,r]}function zf(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 Vc(e,t){for(const n of e)if(!OE(n,{upTo:t}))return n}function OE(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 _E(e){return e instanceof HTMLInputElement&&"select"in e}function mn(e,{select:t=!1}={}){if(e&&e.focus){const n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&_E(e)&&t&&e.select()}}var Kc=NE();function NE(){let e=[];return{add(t){const n=e[0];t!==n&&n?.pause(),e=Wc(e,t),e.unshift(t)},remove(t){e=Wc(e,t),e[0]?.resume()}}}function Wc(e,t){const n=[...e],r=n.indexOf(t);return r!==-1&&n.splice(r,1),n}function DE(e){return e.filter(t=>t.tagName!=="A")}var nt=globalThis?.document?g.useLayoutEffect:()=>{},ME=no[" useId ".trim().toString()]||(()=>{}),jE=0;function Ts(e){const[t,n]=g.useState(ME());return nt(()=>{n(r=>r??String(jE++))},[e]),t?`radix-${t}`:""}const FE=["top","right","bottom","left"],yn=Math.min,vt=Math.max,Vi=Math.round,bi=Math.floor,qt=e=>({x:e,y:e}),HE={left:"right",right:"left",bottom:"top",top:"bottom"};function Na(e,t,n){return vt(e,yn(t,n))}function rn(e,t){return typeof e=="function"?e(t):e}function on(e){return e.split("-")[0]}function Sr(e){return e.split("-")[1]}function Rs(e){return e==="x"?"y":"x"}function Ps(e){return e==="y"?"height":"width"}function Kt(e){const t=e[0];return t==="t"||t==="b"?"y":"x"}function Is(e){return Rs(Kt(e))}function BE(e,t,n){n===void 0&&(n=!1);const r=Sr(e),i=Is(e),o=Ps(i);let a=i==="x"?r===(n?"end":"start")?"right":"left":r==="start"?"bottom":"top";return t.reference[o]>t.floating[o]&&(a=Ki(a)),[a,Ki(a)]}function UE(e){const t=Ki(e);return[Da(e),t,Da(t)]}function Da(e){return e.includes("start")?e.replace("start","end"):e.replace("end","start")}const qc=["left","right"],Gc=["right","left"],zE=["top","bottom"],$E=["bottom","top"];function VE(e,t,n){switch(e){case"top":case"bottom":return n?t?Gc:qc:t?qc:Gc;case"left":case"right":return t?zE:$E;default:return[]}}function KE(e,t,n,r){const i=Sr(e);let o=VE(on(e),n==="start",r);return i&&(o=o.map(a=>a+"-"+i),t&&(o=o.concat(o.map(Da)))),o}function Ki(e){const t=on(e);return HE[t]+e.slice(t.length)}function WE(e){return{top:0,right:0,bottom:0,left:0,...e}}function $f(e){return typeof e!="number"?WE(e):{top:e,right:e,bottom:e,left:e}}function Wi(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 Yc(e,t,n){let{reference:r,floating:i}=e;const o=Kt(t),a=Is(t),s=Ps(a),l=on(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(Sr(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 qE(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}=rn(t,e),m=$f(f),y=s[h?d==="floating"?"reference":"floating":d],b=Wi(await o.getClippingRect({element:(n=await(o.isElement==null?void 0:o.isElement(y)))==null||n?y:y.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)),T=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},I=Wi(o.convertOffsetParentRelativeRectToViewportRelativeRect?await o.convertOffsetParentRelativeRectToViewportRelativeRect({elements:s,rect:x,offsetParent:w,strategy:l}):x);return{top:(b.top-I.top+m.top)/T.y,bottom:(I.bottom-b.bottom+m.bottom)/T.y,left:(b.left-I.left+m.left)/T.x,right:(I.right-b.right+m.right)/T.x}}const GE=50,YE=async(e,t,n)=>{const{placement:r="bottom",strategy:i="absolute",middleware:o=[],platform:a}=n,s=a.detectOverflow?a:{...a,detectOverflow:qE},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}=Yc(c,r,l),h=r,f=0;const m={};for(let p=0;p<o.length;p++){const y=o[p];if(!y)continue;const{name:b,fn:x}=y,{x:w,y:T,data:I,reset:C}=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=T??d,m[b]={...m[b],...I},C&&f<GE&&(f++,typeof C=="object"&&(C.placement&&(h=C.placement),C.rects&&(c=C.rects===!0?await a.getElementRects({reference:e,floating:t,strategy:i}):C.rects),{x:u,y:d}=Yc(c,h,l)),p=-1)}return{x:u,y:d,placement:h,strategy:i,middlewareData:m}},QE=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}=rn(e,t)||{};if(c==null)return{};const d=$f(u),h={x:n,y:r},f=Is(i),m=Ps(f),p=await a.getDimensions(c),y=f==="y",b=y?"top":"left",x=y?"bottom":"right",w=y?"clientHeight":"clientWidth",T=o.reference[m]+o.reference[f]-h[f]-o.floating[m],I=h[f]-o.reference[f],C=await(a.getOffsetParent==null?void 0:a.getOffsetParent(c));let k=C?C[w]:0;(!k||!await(a.isElement==null?void 0:a.isElement(C)))&&(k=s.floating[w]||o.floating[m]);const D=T/2-I/2,F=k/2-p[m]/2-1,R=yn(d[b],F),N=yn(d[x],F),L=R,K=k-p[m]-N,H=k/2-p[m]/2+D,z=Na(L,H,K),Y=!l.arrow&&Sr(i)!=null&&H!==z&&o.reference[m]/2-(H<L?R:N)-p[m]/2<0,Q=Y?H<L?H-L:H-K:0;return{[f]:h[f]+Q,data:{[f]:z,centerOffset:H-z-Q,...Y&&{alignmentOffset:Q}},reset:Y}}}),XE=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,...y}=rn(e,t);if((n=o.arrow)!=null&&n.alignmentOffset)return{};const b=on(i),x=Kt(s),w=on(s)===s,T=await(l.isRTL==null?void 0:l.isRTL(c.floating)),I=h||(w||!p?[Ki(s)]:UE(s)),C=m!=="none";!h&&C&&I.push(...KE(s,p,m,T));const k=[s,...I],D=await l.detectOverflow(t,y),F=[];let R=((r=o.flip)==null?void 0:r.overflows)||[];if(u&&F.push(D[b]),d){const H=BE(i,a,T);F.push(D[H[0]],D[H[1]])}if(R=[...R,{placement:i,overflows:F}],!F.every(H=>H<=0)){var N,L;const H=(((N=o.flip)==null?void 0:N.index)||0)+1,z=k[H];if(z&&(!(d==="alignment"?x!==Kt(z):!1)||R.every($=>Kt($.placement)===x?$.overflows[0]>0:!0)))return{data:{index:H,overflows:R},reset:{placement:z}};let Y=(L=R.filter(Q=>Q.overflows[0]<=0).sort((Q,$)=>Q.overflows[1]-$.overflows[1])[0])==null?void 0:L.placement;if(!Y)switch(f){case"bestFit":{var K;const Q=(K=R.filter($=>{if(C){const j=Kt($.placement);return j===x||j==="y"}return!0}).map($=>[$.placement,$.overflows.filter(j=>j>0).reduce((j,S)=>j+S,0)]).sort(($,j)=>$[1]-j[1])[0])==null?void 0:K[0];Q&&(Y=Q);break}case"initialPlacement":Y=s;break}if(i!==Y)return{reset:{placement:Y}}}return{}}}};function Qc(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function Xc(e){return FE.some(t=>e[t]>=0)}const JE=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(t){const{rects:n,platform:r}=t,{strategy:i="referenceHidden",...o}=rn(e,t);switch(i){case"referenceHidden":{const a=await r.detectOverflow(t,{...o,elementContext:"reference"}),s=Qc(a,n.reference);return{data:{referenceHiddenOffsets:s,referenceHidden:Xc(s)}}}case"escaped":{const a=await r.detectOverflow(t,{...o,altBoundary:!0}),s=Qc(a,n.floating);return{data:{escapedOffsets:s,escaped:Xc(s)}}}default:return{}}}}},Vf=new Set(["left","top"]);async function ZE(e,t){const{placement:n,platform:r,elements:i}=e,o=await(r.isRTL==null?void 0:r.isRTL(i.floating)),a=on(n),s=Sr(n),l=Kt(n)==="y",c=Vf.has(a)?-1:1,u=o&&l?-1:1,d=rn(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 eC=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 ZE(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}}}}},tC=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:b=>{let{x,y:w}=b;return{x,y:w}}},...c}=rn(e,t),u={x:n,y:r},d=await o.detectOverflow(t,c),h=Kt(on(i)),f=Rs(h);let m=u[f],p=u[h];if(a){const b=f==="y"?"top":"left",x=f==="y"?"bottom":"right",w=m+d[b],T=m-d[x];m=Na(w,m,T)}if(s){const b=h==="y"?"top":"left",x=h==="y"?"bottom":"right",w=p+d[b],T=p-d[x];p=Na(w,p,T)}const y=l.fn({...t,[f]:m,[h]:p});return{...y,data:{x:y.x-n,y:y.y-r,enabled:{[f]:a,[h]:s}}}}}},nC=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}=rn(e,t),u={x:n,y:r},d=Kt(i),h=Rs(d);let f=u[h],m=u[d];const p=rn(s,t),y=typeof p=="number"?{mainAxis:p,crossAxis:0}:{mainAxis:0,crossAxis:0,...p};if(l){const w=h==="y"?"height":"width",T=o.reference[h]-o.floating[w]+y.mainAxis,I=o.reference[h]+o.reference[w]-y.mainAxis;f<T?f=T:f>I&&(f=I)}if(c){var b,x;const w=h==="y"?"width":"height",T=Vf.has(on(i)),I=o.reference[d]-o.floating[w]+(T&&((b=a.offset)==null?void 0:b[d])||0)+(T?0:y.crossAxis),C=o.reference[d]+o.reference[w]+(T?0:((x=a.offset)==null?void 0:x[d])||0)-(T?y.crossAxis:0);m<I?m=I:m>C&&(m=C)}return{[h]:f,[d]:m}}}},rC=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}=rn(e,t),u=await a.detectOverflow(t,c),d=on(i),h=Sr(i),f=Kt(i)==="y",{width:m,height:p}=o.floating;let y,b;d==="top"||d==="bottom"?(y=d,b=h===(await(a.isRTL==null?void 0:a.isRTL(s.floating))?"start":"end")?"left":"right"):(b=d,y=h==="end"?"top":"bottom");const x=p-u.top-u.bottom,w=m-u.left-u.right,T=yn(p-u[y],x),I=yn(m-u[b],w),C=!t.middlewareData.shift;let k=T,D=I;if((n=t.middlewareData.shift)!=null&&n.enabled.x&&(D=w),(r=t.middlewareData.shift)!=null&&r.enabled.y&&(k=x),C&&!h){const R=vt(u.left,0),N=vt(u.right,0),L=vt(u.top,0),K=vt(u.bottom,0);f?D=m-2*(R!==0||N!==0?R+N:vt(u.left,u.right)):k=p-2*(L!==0||K!==0?L+K:vt(u.top,u.bottom))}await l({...t,availableWidth:D,availableHeight:k});const F=await a.getDimensions(s.floating);return m!==F.width||p!==F.height?{reset:{rects:!0}}:{}}}};function go(){return typeof window<"u"}function Er(e){return Kf(e)?(e.nodeName||"").toLowerCase():"#document"}function wt(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function Yt(e){var t;return(t=(Kf(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function Kf(e){return go()?e instanceof Node||e instanceof wt(e).Node:!1}function Nt(e){return go()?e instanceof Element||e instanceof wt(e).Element:!1}function un(e){return go()?e instanceof HTMLElement||e instanceof wt(e).HTMLElement:!1}function Jc(e){return!go()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof wt(e).ShadowRoot}function ai(e){const{overflow:t,overflowX:n,overflowY:r,display:i}=Dt(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&i!=="inline"&&i!=="contents"}function iC(e){return/^(table|td|th)$/.test(Er(e))}function yo(e){try{if(e.matches(":popover-open"))return!0}catch{}try{return e.matches(":modal")}catch{return!1}}const oC=/transform|translate|scale|rotate|perspective|filter/,aC=/paint|layout|strict|content/,On=e=>!!e&&e!=="none";let Qo;function Ls(e){const t=Nt(e)?Dt(e):e;return On(t.transform)||On(t.translate)||On(t.scale)||On(t.rotate)||On(t.perspective)||!Os()&&(On(t.backdropFilter)||On(t.filter))||oC.test(t.willChange||"")||aC.test(t.contain||"")}function sC(e){let t=vn(e);for(;un(t)&&!mr(t);){if(Ls(t))return t;if(yo(t))return null;t=vn(t)}return null}function Os(){return Qo==null&&(Qo=typeof CSS<"u"&&CSS.supports&&CSS.supports("-webkit-backdrop-filter","none")),Qo}function mr(e){return/^(html|body|#document)$/.test(Er(e))}function Dt(e){return wt(e).getComputedStyle(e)}function vo(e){return Nt(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function vn(e){if(Er(e)==="html")return e;const t=e.assignedSlot||e.parentNode||Jc(e)&&e.host||Yt(e);return Jc(t)?t.host:t}function Wf(e){const t=vn(e);return mr(t)?e.ownerDocument?e.ownerDocument.body:e.body:un(t)&&ai(t)?t:Wf(t)}function Jr(e,t,n){var r;t===void 0&&(t=[]),n===void 0&&(n=!0);const i=Wf(e),o=i===((r=e.ownerDocument)==null?void 0:r.body),a=wt(i);if(o){const s=Ma(a);return t.concat(a,a.visualViewport||[],ai(i)?i:[],s&&n?Jr(s):[])}else return t.concat(i,Jr(i,[],n))}function Ma(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function qf(e){const t=Dt(e);let n=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const i=un(e),o=i?e.offsetWidth:n,a=i?e.offsetHeight:r,s=Vi(n)!==o||Vi(r)!==a;return s&&(n=o,r=a),{width:n,height:r,$:s}}function _s(e){return Nt(e)?e:e.contextElement}function dr(e){const t=_s(e);if(!un(t))return qt(1);const n=t.getBoundingClientRect(),{width:r,height:i,$:o}=qf(t);let a=(o?Vi(n.width):n.width)/r,s=(o?Vi(n.height):n.height)/i;return(!a||!Number.isFinite(a))&&(a=1),(!s||!Number.isFinite(s))&&(s=1),{x:a,y:s}}const lC=qt(0);function Gf(e){const t=wt(e);return!Os()||!t.visualViewport?lC:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function cC(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==wt(e)?!1:t}function Kn(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);const i=e.getBoundingClientRect(),o=_s(e);let a=qt(1);t&&(r?Nt(r)&&(a=dr(r)):a=dr(e));const s=cC(o,n,r)?Gf(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=wt(o),f=r&&Nt(r)?wt(r):r;let m=h,p=Ma(m);for(;p&&r&&f!==m;){const y=dr(p),b=p.getBoundingClientRect(),x=Dt(p),w=b.left+(p.clientLeft+parseFloat(x.paddingLeft))*y.x,T=b.top+(p.clientTop+parseFloat(x.paddingTop))*y.y;l*=y.x,c*=y.y,u*=y.x,d*=y.y,l+=w,c+=T,m=wt(p),p=Ma(m)}}return Wi({width:u,height:d,x:l,y:c})}function bo(e,t){const n=vo(e).scrollLeft;return t?t.left+n:Kn(Yt(e)).left+n}function Yf(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 uC(e){let{elements:t,rect:n,offsetParent:r,strategy:i}=e;const o=i==="fixed",a=Yt(r),s=t?yo(t.floating):!1;if(r===a||s&&o)return n;let l={scrollLeft:0,scrollTop:0},c=qt(1);const u=qt(0),d=un(r);if((d||!d&&!o)&&((Er(r)!=="body"||ai(a))&&(l=vo(r)),d)){const f=Kn(r);c=dr(r),u.x=f.x+r.clientLeft,u.y=f.y+r.clientTop}const h=a&&!d&&!o?Yf(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 dC(e){return Array.from(e.getClientRects())}function fC(e){const t=Yt(e),n=vo(e),r=e.ownerDocument.body,i=vt(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),o=vt(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight);let a=-n.scrollLeft+bo(e);const s=-n.scrollTop;return Dt(r).direction==="rtl"&&(a+=vt(t.clientWidth,r.clientWidth)-i),{width:i,height:o,x:a,y:s}}const Zc=25;function hC(e,t){const n=wt(e),r=Yt(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=Os();(!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<=Zc&&(o-=m)}else c<=Zc&&(o+=c);return{width:o,height:a,x:s,y:l}}function pC(e,t){const n=Kn(e,!0,t==="fixed"),r=n.top+e.clientTop,i=n.left+e.clientLeft,o=un(e)?dr(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 eu(e,t,n){let r;if(t==="viewport")r=hC(e,n);else if(t==="document")r=fC(Yt(e));else if(Nt(t))r=pC(t,n);else{const i=Gf(e);r={x:t.x-i.x,y:t.y-i.y,width:t.width,height:t.height}}return Wi(r)}function Qf(e,t){const n=vn(e);return n===t||!Nt(n)||mr(n)?!1:Dt(n).position==="fixed"||Qf(n,t)}function mC(e,t){const n=t.get(e);if(n)return n;let r=Jr(e,[],!1).filter(s=>Nt(s)&&Er(s)!=="body"),i=null;const o=Dt(e).position==="fixed";let a=o?vn(e):e;for(;Nt(a)&&!mr(a);){const s=Dt(a),l=Ls(a);!l&&s.position==="fixed"&&(i=null),(o?!l&&!i:!l&&s.position==="static"&&!!i&&(i.position==="absolute"||i.position==="fixed")||ai(a)&&!l&&Qf(e,a))?r=r.filter(u=>u!==a):i=s,a=vn(a)}return t.set(e,r),r}function gC(e){let{element:t,boundary:n,rootBoundary:r,strategy:i}=e;const a=[...n==="clippingAncestors"?yo(t)?[]:mC(t,this._c):[].concat(n),r],s=eu(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=eu(t,a[h],i);l=vt(f.top,l),c=yn(f.right,c),u=yn(f.bottom,u),d=vt(f.left,d)}return{width:c-d,height:u-l,x:d,y:l}}function yC(e){const{width:t,height:n}=qf(e);return{width:t,height:n}}function vC(e,t,n){const r=un(t),i=Yt(t),o=n==="fixed",a=Kn(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((Er(t)!=="body"||ai(i))&&(s=vo(t)),r){const f=Kn(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?Yf(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 Xo(e){return Dt(e).position==="static"}function tu(e,t){if(!un(e)||Dt(e).position==="fixed")return null;if(t)return t(e);let n=e.offsetParent;return Yt(e)===n&&(n=n.ownerDocument.body),n}function Xf(e,t){const n=wt(e);if(yo(e))return n;if(!un(e)){let i=vn(e);for(;i&&!mr(i);){if(Nt(i)&&!Xo(i))return i;i=vn(i)}return n}let r=tu(e,t);for(;r&&iC(r)&&Xo(r);)r=tu(r,t);return r&&mr(r)&&Xo(r)&&!Ls(r)?n:r||sC(e)||n}const bC=async function(e){const t=this.getOffsetParent||Xf,n=this.getDimensions,r=await n(e.floating);return{reference:vC(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function xC(e){return Dt(e).direction==="rtl"}const wC={convertOffsetParentRelativeRectToViewportRelativeRect:uC,getDocumentElement:Yt,getClippingRect:gC,getOffsetParent:Xf,getElementRects:bC,getClientRects:dC,getDimensions:yC,getScale:dr,isElement:Nt,isRTL:xC};function Jf(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function kC(e,t){let n=null,r;const i=Yt(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=bi(d),p=bi(i.clientWidth-(u+h)),y=bi(i.clientHeight-(d+f)),b=bi(u),w={rootMargin:-m+"px "+-p+"px "+-y+"px "+-b+"px",threshold:vt(0,yn(1,l))||1};let T=!0;function I(C){const k=C[0].intersectionRatio;if(k!==l){if(!T)return a();k?a(!1,k):r=setTimeout(()=>{a(!1,1e-7)},1e3)}k===1&&!Jf(c,e.getBoundingClientRect())&&a(),T=!1}try{n=new IntersectionObserver(I,{...w,root:i.ownerDocument})}catch{n=new IntersectionObserver(I,w)}n.observe(e)}return a(!0),o}function SC(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=_s(e),u=i||o?[...c?Jr(c):[],...t?Jr(t):[]]:[];u.forEach(b=>{i&&b.addEventListener("scroll",n,{passive:!0}),o&&b.addEventListener("resize",n)});const d=c&&s?kC(c,n):null;let h=-1,f=null;a&&(f=new ResizeObserver(b=>{let[x]=b;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?Kn(e):null;l&&y();function y(){const b=Kn(e);p&&!Jf(p,b)&&n(),p=b,m=requestAnimationFrame(y)}return n(),()=>{var b;u.forEach(x=>{i&&x.removeEventListener("scroll",n),o&&x.removeEventListener("resize",n)}),d?.(),(b=f)==null||b.disconnect(),f=null,l&&cancelAnimationFrame(m)}}const EC=eC,CC=tC,AC=XE,TC=rC,RC=JE,nu=QE,PC=nC,IC=(e,t,n)=>{const r=new Map,i={platform:wC,...n},o={...i.platform,_c:r};return YE(e,t,{...i,platform:o})};var LC=typeof document<"u",OC=function(){},Ii=LC?g.useLayoutEffect:OC;function qi(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(!qi(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)&&!qi(e[o],t[o]))return!1}return!0}return e!==e&&t!==t}function Zf(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function ru(e,t){const n=Zf(e);return Math.round(t*n)/n}function Jo(e){const t=g.useRef(e);return Ii(()=>{t.current=e}),t}function _C(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]=g.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[h,f]=g.useState(r);qi(h,r)||f(r);const[m,p]=g.useState(null),[y,b]=g.useState(null),x=g.useCallback($=>{$!==C.current&&(C.current=$,p($))},[]),w=g.useCallback($=>{$!==k.current&&(k.current=$,b($))},[]),T=o||m,I=a||y,C=g.useRef(null),k=g.useRef(null),D=g.useRef(u),F=l!=null,R=Jo(l),N=Jo(i),L=Jo(c),K=g.useCallback(()=>{if(!C.current||!k.current)return;const $={placement:t,strategy:n,middleware:h};N.current&&($.platform=N.current),IC(C.current,k.current,$).then(j=>{const S={...j,isPositioned:L.current!==!1};H.current&&!qi(D.current,S)&&(D.current=S,vr.flushSync(()=>{d(S)}))})},[h,t,n,N,L]);Ii(()=>{c===!1&&D.current.isPositioned&&(D.current.isPositioned=!1,d($=>({...$,isPositioned:!1})))},[c]);const H=g.useRef(!1);Ii(()=>(H.current=!0,()=>{H.current=!1}),[]),Ii(()=>{if(T&&(C.current=T),I&&(k.current=I),T&&I){if(R.current)return R.current(T,I,K);K()}},[T,I,K,R,F]);const z=g.useMemo(()=>({reference:C,floating:k,setReference:x,setFloating:w}),[x,w]),Y=g.useMemo(()=>({reference:T,floating:I}),[T,I]),Q=g.useMemo(()=>{const $={position:n,left:0,top:0};if(!Y.floating)return $;const j=ru(Y.floating,u.x),S=ru(Y.floating,u.y);return s?{...$,transform:"translate("+j+"px, "+S+"px)",...Zf(Y.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:j,top:S}},[n,s,Y.floating,u.x,u.y]);return g.useMemo(()=>({...u,update:K,refs:z,elements:Y,floatingStyles:Q}),[u,K,z,Y,Q])}const NC=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?nu({element:r.current,padding:i}).fn(n):{}:r?nu({element:r,padding:i}).fn(n):{}}}},DC=(e,t)=>{const n=EC(e);return{name:n.name,fn:n.fn,options:[e,t]}},MC=(e,t)=>{const n=CC(e);return{name:n.name,fn:n.fn,options:[e,t]}},jC=(e,t)=>({fn:PC(e).fn,options:[e,t]}),FC=(e,t)=>{const n=AC(e);return{name:n.name,fn:n.fn,options:[e,t]}},HC=(e,t)=>{const n=TC(e);return{name:n.name,fn:n.fn,options:[e,t]}},BC=(e,t)=>{const n=RC(e);return{name:n.name,fn:n.fn,options:[e,t]}},UC=(e,t)=>{const n=NC(e);return{name:n.name,fn:n.fn,options:[e,t]}};var zC="Arrow",eh=g.forwardRef((e,t)=>{const{children:n,width:r=10,height:i=5,...o}=e;return v.jsx(Ue.svg,{...o,ref:t,width:r,height:i,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:e.asChild?n:v.jsx("polygon",{points:"0,0 30,0 15,10"})})});eh.displayName=zC;var $C=eh;function VC(e){const[t,n]=g.useState(void 0);return nt(()=>{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 Ns="Popper",[th,xo]=mo(Ns),[KC,nh]=th(Ns),rh=e=>{const{__scopePopper:t,children:n}=e,[r,i]=g.useState(null),[o,a]=g.useState(void 0);return v.jsx(KC,{scope:t,anchor:r,onAnchorChange:i,placementState:o,setPlacementState:a,children:n})};rh.displayName=Ns;var ih="PopperAnchor",oh=g.forwardRef((e,t)=>{const{__scopePopper:n,virtualRef:r,...i}=e,o=nh(ih,n),a=g.useRef(null),s=o.onAnchorChange,l=g.useCallback(m=>{a.current=m,m&&s(m)},[s]),c=Ye(t,l),u=g.useRef(null);g.useEffect(()=>{if(!r)return;const m=u.current;u.current=r.current,m!==u.current&&s(u.current)});const d=o.placementState&&Ms(o.placementState),h=d?.[0],f=d?.[1];return r?null:v.jsx(Ue.div,{"data-radix-popper-side":h,"data-radix-popper-align":f,...i,ref:c})});oh.displayName=ih;var Ds="PopperContent",[WC,qC]=th(Ds),ah=g.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,y=nh(Ds,n),[b,x]=g.useState(null),w=Ye(t,fe=>x(fe)),[T,I]=g.useState(null),C=VC(T),k=C?.width??0,D=C?.height??0,F=r+(o!=="center"?"-"+o:""),R=typeof u=="number"?u:{top:0,right:0,bottom:0,left:0,...u},N=c?Array.isArray(c)?c:[c]:void 0,L=N!==void 0&&N.length>0,K={padding:R,boundary:N?.filter(YC),altBoundary:L},{refs:H,floatingStyles:z,placement:Y,isPositioned:Q,middlewareData:$}=_C({strategy:"fixed",placement:F,whileElementsMounted:(...fe)=>SC(...fe,{animationFrame:f==="always"}),elements:{reference:y.anchor},middleware:[DC({mainAxis:i+D,alignmentAxis:a}),l&&MC({mainAxis:!0,crossAxis:!1,limiter:d==="partial"?jC():void 0,...K}),l&&FC({...K}),HC({...K,apply:({elements:fe,rects:Re,availableWidth:be,availableHeight:we})=>{const{width:pe,height:Ke}=Re.reference,Qe=fe.floating.style;Qe.setProperty("--radix-popper-available-width",`${be}px`),Qe.setProperty("--radix-popper-available-height",`${we}px`),Qe.setProperty("--radix-popper-anchor-width",`${pe}px`),Qe.setProperty("--radix-popper-anchor-height",`${Ke}px`)}}),T&&UC({element:T,padding:s}),QC({arrowWidth:k,arrowHeight:D}),h&&BC({strategy:"referenceHidden",...K})]}),j=y.setPlacementState;nt(()=>(j(Y),()=>{j(void 0)}),[Y,j]);const[S,ie]=Ms(Y),Z=Vn(m);nt(()=>{Q&&Z?.()},[Q,Z]);const E=$.arrow?.x,ae=$.arrow?.y,me=$.arrow?.centerOffset!==0,[ve,W]=g.useState();return nt(()=>{b&&W(window.getComputedStyle(b).zIndex)},[b]),v.jsx("div",{ref:H.setFloating,"data-radix-popper-content-wrapper":"",style:{...z,transform:Q?z.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:ve,"--radix-popper-transform-origin":[$.transformOrigin?.x,$.transformOrigin?.y].join(" "),...$.hide?.referenceHidden&&{visibility:"hidden",pointerEvents:"none"}},dir:e.dir,children:v.jsx(WC,{scope:n,placedSide:S,placedAlign:ie,onArrowChange:I,arrowX:E,arrowY:ae,shouldHideArrow:me,children:v.jsx(Ue.div,{"data-side":S,"data-align":ie,...p,ref:w,style:{...p.style,animation:Q?void 0:"none"}})})})});ah.displayName=Ds;var sh="PopperArrow",GC={top:"bottom",right:"left",bottom:"top",left:"right"},lh=g.forwardRef(function(t,n){const{__scopePopper:r,...i}=t,o=qC(sh,r),a=GC[o.placedSide];return v.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:v.jsx($C,{...i,ref:n,style:{...i.style,display:"block"}})})});lh.displayName=sh;function YC(e){return e!==null}var QC=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]=Ms(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 Ms(e){const[t,n="center"]=e.split("-");return[t,n]}var XC=rh,ch=oh,uh=ah,dh=lh,JC="Portal",fh=g.forwardRef((e,t)=>{const{container:n,...r}=e,[i,o]=g.useState(!1);nt(()=>o(!0),[]);const a=n||i&&globalThis?.document?.body;return a?vr.createPortal(v.jsx(Ue.div,{...r,ref:t}),a):null});fh.displayName=JC;function ZC(e,t){return g.useReducer((n,r)=>t[n][r]??n,e)}var js=e=>{const{present:t,children:n}=e,r=eA(t),i=typeof n=="function"?n({present:r.isPresent}):g.Children.only(n),o=tA(r.ref,nA(i));return typeof n=="function"||r.isPresent?g.cloneElement(i,{ref:o}):null};js.displayName="Presence";function eA(e){const[t,n]=g.useState(),r=g.useRef(null),i=g.useRef(e),o=g.useRef("none"),a=e?"mounted":"unmounted",[s,l]=ZC(a,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return g.useEffect(()=>{const c=xi(r.current);o.current=s==="mounted"?c:"none"},[s]),nt(()=>{const c=r.current,u=i.current;if(u!==e){const h=o.current,f=xi(c);e?l("MOUNT"):f==="none"||c?.display==="none"?l("UNMOUNT"):l(u&&h!==f?"ANIMATION_OUT":"UNMOUNT"),i.current=e}},[e,l]),nt(()=>{if(t){let c;const u=t.ownerDocument.defaultView??window,d=f=>{const p=xi(r.current).includes(CSS.escape(f.animationName));if(f.target===t&&p&&(l("ANIMATION_END"),!i.current)){const y=t.style.animationFillMode;t.style.animationFillMode="forwards",c=u.setTimeout(()=>{t.style.animationFillMode==="forwards"&&(t.style.animationFillMode=y)})}},h=f=>{f.target===t&&(o.current=xi(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:g.useCallback(c=>{r.current=c?getComputedStyle(c):null,n(c)},[])}}function iu(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function tA(...e){const t=g.useRef(e);return t.current=e,g.useCallback(n=>{const r=t.current;let i=!1;const o=r.map(a=>{const s=iu(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():iu(r[a],null)}}},[])}function xi(e){return e?.animationName||"none"}function nA(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 rA=no[" useInsertionEffect ".trim().toString()]||nt;function ou({prop:e,defaultProp:t,onChange:n=()=>{},caller:r}){const[i,o,a]=iA({defaultProp:t,onChange:n}),s=e!==void 0,l=s?e:i;{const u=g.useRef(e!==void 0);g.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=g.useCallback(u=>{if(s){const d=oA(u)?u(e):u;d!==e&&a.current?.(d)}else o(u)},[s,e,o,a]);return[l,c]}function iA({defaultProp:e,onChange:t}){const[n,r]=g.useState(e),i=g.useRef(n),o=g.useRef(t);return rA(()=>{o.current=t},[t]),g.useEffect(()=>{i.current!==n&&(o.current?.(n),i.current=n)},[n,i]),[n,r,o]}function oA(e){return typeof e=="function"}function aA(e){const t=g.useRef({value:e,previous:e});return g.useMemo(()=>(t.current.value!==e&&(t.current.previous=t.current.value,t.current.value=e),t.current.previous),[e])}var hh=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"}),sA="VisuallyHidden",ph=g.forwardRef((e,t)=>v.jsx(Ue.span,{...e,ref:t,style:{...hh,...e.style}}));ph.displayName=sA;var lA=ph,cA=function(e){if(typeof document>"u")return null;var t=Array.isArray(e)?e[0]:e;return t.ownerDocument.body},rr=new WeakMap,wi=new WeakMap,ki={},Zo=0,mh=function(e){return e&&(e.host||mh(e.parentNode))},uA=function(e,t){return t.map(function(n){if(e.contains(n))return n;var r=mh(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})},dA=function(e,t,n,r){var i=uA(t,Array.isArray(e)?e:[e]);ki[n]||(ki[n]=new WeakMap);var o=ki[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=(rr.get(h)||0)+1,y=(o.get(h)||0)+1;rr.set(h,p),o.set(h,y),a.push(h),p===1&&m&&wi.set(h,!0),y===1&&h.setAttribute(n,"true"),m||h.setAttribute(r,"true")}catch(b){console.error("aria-hidden: cannot operate on ",h,b)}})};return u(t),s.clear(),Zo++,function(){a.forEach(function(d){var h=rr.get(d)-1,f=o.get(d)-1;rr.set(d,h),o.set(d,f),h||(wi.has(d)||d.removeAttribute(r),wi.delete(d)),f||d.removeAttribute(n)}),Zo--,Zo||(rr=new WeakMap,rr=new WeakMap,wi=new WeakMap,ki={})}},fA=function(e,t,n){n===void 0&&(n="data-aria-hidden");var r=Array.from(Array.isArray(e)?e:[e]),i=cA(e);return i?(r.push.apply(r,Array.from(i.querySelectorAll("[aria-live], script"))),dA(r,i,n,"aria-hidden")):function(){return null}},Vt=function(){return Vt=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},Vt.apply(this,arguments)};function gh(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 hA(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 Li="right-scroll-bar-position",Oi="width-before-scroll-bar",pA="with-scroll-bars-hidden",mA="--removed-body-scroll-bar-size";function ea(e,t){return typeof e=="function"?e(t):e&&(e.current=t),e}function gA(e,t){var n=g.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 yA=typeof window<"u"?g.useLayoutEffect:g.useEffect,au=new WeakMap;function vA(e,t){var n=gA(null,function(r){return e.forEach(function(i){return ea(i,r)})});return yA(function(){var r=au.get(n);if(r){var i=new Set(r),o=new Set(e),a=n.current;i.forEach(function(s){o.has(s)||ea(s,null)}),o.forEach(function(s){i.has(s)||ea(s,a)})}au.set(n,e)},[e]),n}function bA(e){return e}function xA(e,t){t===void 0&&(t=bA);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 wA(e){e===void 0&&(e={});var t=xA(null);return t.options=Vt({async:!0,ssr:!1},e),t}var yh=function(e){var t=e.sideCar,n=gh(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 g.createElement(r,Vt({},n))};yh.isSideCarExport=!0;function kA(e,t){return e.useMedium(t),yh}var vh=wA(),ta=function(){},wo=g.forwardRef(function(e,t){var n=g.useRef(null),r=g.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,y=e.allowPinchZoom,b=e.as,x=b===void 0?"div":b,w=e.gapMode,T=gh(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noRelative","noIsolation","inert","allowPinchZoom","as","gapMode"]),I=h,C=vA([n,t]),k=Vt(Vt({},T),i);return g.createElement(g.Fragment,null,u&&g.createElement(I,{sideCar:vh,removeScrollBar:c,shards:d,noRelative:f,noIsolation:m,inert:p,setCallbacks:o,allowPinchZoom:!!y,lockRef:n,gapMode:w}),a?g.cloneElement(g.Children.only(s),Vt(Vt({},k),{ref:C})):g.createElement(x,Vt({},k,{className:l,ref:C}),s))});wo.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};wo.classNames={fullWidth:Oi,zeroRight:Li};var SA=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function EA(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var t=SA();return t&&e.setAttribute("nonce",t),e}function CA(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function AA(e){var t=document.head||document.getElementsByTagName("head")[0];t.appendChild(e)}var TA=function(){var e=0,t=null;return{add:function(n){e==0&&(t=EA())&&(CA(t,n),AA(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},RA=function(){var e=TA();return function(t,n){g.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&n])}},bh=function(){var e=RA(),t=function(n){var r=n.styles,i=n.dynamic;return e(r,i),null};return t},PA={left:0,top:0,right:0,gap:0},na=function(e){return parseInt(e||"",10)||0},IA=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[na(n),na(r),na(i)]},LA=function(e){if(e===void 0&&(e="margin"),typeof window>"u")return PA;var t=IA(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])}},OA=bh(),fr="data-scroll-locked",_A=function(e,t,n,r){var i=e.left,o=e.top,a=e.right,s=e.gap;return n===void 0&&(n="margin"),`
158
+ .`.concat(pA,` {
159
+ overflow: hidden `).concat(r,`;
160
+ padding-right: `).concat(s,"px ").concat(r,`;
161
+ }
162
+ body[`).concat(fr,`] {
163
+ overflow: hidden `).concat(r,`;
164
+ overscroll-behavior: contain;
165
+ `).concat([t&&"position: relative ".concat(r,";"),n==="margin"&&`
166
+ padding-left: `.concat(i,`px;
167
+ padding-top: `).concat(o,`px;
168
+ padding-right: `).concat(a,`px;
169
+ margin-left:0;
170
+ margin-top:0;
171
+ margin-right: `).concat(s,"px ").concat(r,`;
172
+ `),n==="padding"&&"padding-right: ".concat(s,"px ").concat(r,";")].filter(Boolean).join(""),`
173
+ }
174
+
175
+ .`).concat(Li,` {
176
+ right: `).concat(s,"px ").concat(r,`;
177
+ }
178
+
179
+ .`).concat(Oi,` {
180
+ margin-right: `).concat(s,"px ").concat(r,`;
181
+ }
182
+
183
+ .`).concat(Li," .").concat(Li,` {
184
+ right: 0 `).concat(r,`;
185
+ }
186
+
187
+ .`).concat(Oi," .").concat(Oi,` {
188
+ margin-right: 0 `).concat(r,`;
189
+ }
190
+
191
+ body[`).concat(fr,`] {
192
+ `).concat(mA,": ").concat(s,`px;
193
+ }
194
+ `)},su=function(){var e=parseInt(document.body.getAttribute(fr)||"0",10);return isFinite(e)?e:0},NA=function(){g.useEffect(function(){return document.body.setAttribute(fr,(su()+1).toString()),function(){var e=su()-1;e<=0?document.body.removeAttribute(fr):document.body.setAttribute(fr,e.toString())}},[])},DA=function(e){var t=e.noRelative,n=e.noImportant,r=e.gapMode,i=r===void 0?"margin":r;NA();var o=g.useMemo(function(){return LA(i)},[i]);return g.createElement(OA,{styles:_A(o,!t,i,n?"":"!important")})},ja=!1;if(typeof window<"u")try{var Si=Object.defineProperty({},"passive",{get:function(){return ja=!0,!0}});window.addEventListener("test",Si,Si),window.removeEventListener("test",Si,Si)}catch{ja=!1}var ir=ja?{passive:!1}:!1,MA=function(e){return e.tagName==="TEXTAREA"},xh=function(e,t){if(!(e instanceof Element))return!1;var n=window.getComputedStyle(e);return n[t]!=="hidden"&&!(n.overflowY===n.overflowX&&!MA(e)&&n[t]==="visible")},jA=function(e){return xh(e,"overflowY")},FA=function(e){return xh(e,"overflowX")},lu=function(e,t){var n=t.ownerDocument,r=t;do{typeof ShadowRoot<"u"&&r instanceof ShadowRoot&&(r=r.host);var i=wh(e,r);if(i){var o=kh(e,r),a=o[1],s=o[2];if(a>s)return!0}r=r.parentNode}while(r&&r!==n.body);return!1},HA=function(e){var t=e.scrollTop,n=e.scrollHeight,r=e.clientHeight;return[t,n,r]},BA=function(e){var t=e.scrollLeft,n=e.scrollWidth,r=e.clientWidth;return[t,n,r]},wh=function(e,t){return e==="v"?jA(t):FA(t)},kh=function(e,t){return e==="v"?HA(t):BA(t)},UA=function(e,t){return e==="h"&&t==="rtl"?-1:1},zA=function(e,t,n,r,i){var o=UA(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=kh(e,s),m=f[0],p=f[1],y=f[2],b=p-y-o*m;(m||b)&&wh(e,s)&&(d+=b,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},Ei=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},cu=function(e){return[e.deltaX,e.deltaY]},uu=function(e){return e&&"current"in e?e.current:e},$A=function(e,t){return e[0]===t[0]&&e[1]===t[1]},VA=function(e){return`
195
+ .block-interactivity-`.concat(e,` {pointer-events: none;}
196
+ .allow-interactivity-`).concat(e,` {pointer-events: all;}
197
+ `)},KA=0,or=[];function WA(e){var t=g.useRef([]),n=g.useRef([0,0]),r=g.useRef(),i=g.useState(KA++)[0],o=g.useState(bh)[0],a=g.useRef(e);g.useEffect(function(){a.current=e},[e]),g.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(i));var p=hA([e.lockRef.current],(e.shards||[]).map(uu),!0).filter(Boolean);return p.forEach(function(y){return y.classList.add("allow-interactivity-".concat(i))}),function(){document.body.classList.remove("block-interactivity-".concat(i)),p.forEach(function(y){return y.classList.remove("allow-interactivity-".concat(i))})}}},[e.inert,e.lockRef.current,e.shards]);var s=g.useCallback(function(p,y){if("touches"in p&&p.touches.length===2||p.type==="wheel"&&p.ctrlKey)return!a.current.allowPinchZoom;var b=Ei(p),x=n.current,w="deltaX"in p?p.deltaX:x[0]-b[0],T="deltaY"in p?p.deltaY:x[1]-b[1],I,C=p.target,k=Math.abs(w)>Math.abs(T)?"h":"v";if("touches"in p&&k==="h"&&C.type==="range")return!1;var D=window.getSelection(),F=D&&D.anchorNode,R=F?F===C||F.contains(C):!1;if(R)return!1;var N=lu(k,C);if(!N)return!0;if(N?I=k:(I=k==="v"?"h":"v",N=lu(k,C)),!N)return!1;if(!r.current&&"changedTouches"in p&&(w||T)&&(r.current=I),!I)return!0;var L=r.current||I;return zA(L,y,p,L==="h"?w:T)},[]),l=g.useCallback(function(p){var y=p;if(!(!or.length||or[or.length-1]!==o)){var b="deltaY"in y?cu(y):Ei(y),x=t.current.filter(function(I){return I.name===y.type&&(I.target===y.target||y.target===I.shadowParent)&&$A(I.delta,b)})[0];if(x&&x.should){y.cancelable&&y.preventDefault();return}if(!x){var w=(a.current.shards||[]).map(uu).filter(Boolean).filter(function(I){return I.contains(y.target)}),T=w.length>0?s(y,w[0]):!a.current.noIsolation;T&&y.cancelable&&y.preventDefault()}}},[]),c=g.useCallback(function(p,y,b,x){var w={name:p,delta:y,target:b,should:x,shadowParent:qA(b)};t.current.push(w),setTimeout(function(){t.current=t.current.filter(function(T){return T!==w})},1)},[]),u=g.useCallback(function(p){n.current=Ei(p),r.current=void 0},[]),d=g.useCallback(function(p){c(p.type,cu(p),p.target,s(p,e.lockRef.current))},[]),h=g.useCallback(function(p){c(p.type,Ei(p),p.target,s(p,e.lockRef.current))},[]);g.useEffect(function(){return or.push(o),e.setCallbacks({onScrollCapture:d,onWheelCapture:d,onTouchMoveCapture:h}),document.addEventListener("wheel",l,ir),document.addEventListener("touchmove",l,ir),document.addEventListener("touchstart",u,ir),function(){or=or.filter(function(p){return p!==o}),document.removeEventListener("wheel",l,ir),document.removeEventListener("touchmove",l,ir),document.removeEventListener("touchstart",u,ir)}},[]);var f=e.removeScrollBar,m=e.inert;return g.createElement(g.Fragment,null,m?g.createElement(o,{styles:VA(i)}):null,f?g.createElement(DA,{noRelative:e.noRelative,gapMode:e.gapMode}):null)}function qA(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}const GA=kA(vh,WA);var Sh=g.forwardRef(function(e,t){return g.createElement(wo,Vt({},e,{ref:t,sideCar:GA}))});Sh.classNames=wo.classNames;var YA=[" ","Enter","ArrowUp","ArrowDown"],QA=[" ","Enter"],Wn="Select",[ko,So,XA]=yE(Wn),[Yn]=mo(Wn,[XA,xo]),Eo=xo(),[JA,Sn]=Yn(Wn),[ZA,eT]=Yn(Wn),tT="SelectProvider";function Eh(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,y=Eo(t),[b,x]=g.useState(null),[w,T]=g.useState(null),[I,C]=g.useState(!1),k=bE(c),[D,F]=ou({prop:r,defaultProp:i??!1,onChange:o,caller:Wn}),[R,N]=ou({prop:a,defaultProp:s,onChange:l,caller:Wn}),L=g.useRef(null),K=b?!!m||!!b.closest("form"):!0,[H,z]=g.useState(new Set),Y=Ts(),Q=Array.from(H).map(ie=>ie.props.value).join(";"),$=g.useCallback(ie=>{z(Z=>new Set(Z).add(ie))},[]),j=g.useCallback(ie=>{z(Z=>{const E=new Set(Z);return E.delete(ie),E})},[]),S={required:f,trigger:b,onTriggerChange:x,valueNode:w,onValueNodeChange:T,valueNodeHasChildren:I,onValueNodeHasChildrenChange:C,contentId:Y,value:R,onValueChange:N,open:D,onOpenChange:F,dir:k,triggerPointerDownPosRef:L,disabled:h,name:u,autoComplete:d,form:m,nativeOptions:H,nativeSelectKey:Q,isFormControl:K};return v.jsx(XC,{...y,children:v.jsx(JA,{scope:t,...S,children:v.jsx(ko.Provider,{scope:t,children:v.jsx(ZA,{scope:t,onNativeOptionAdd:$,onNativeOptionRemove:j,children:gT(p)?p(S):n})})})})}Eh.displayName=tT;var Ch=e=>{const{__scopeSelect:t,children:n,...r}=e;return v.jsx(Eh,{__scopeSelect:t,...r,internal_do_not_use_render:({isFormControl:i})=>v.jsxs(v.Fragment,{children:[n,i?v.jsx(Wh,{__scopeSelect:t}):null]})})};Ch.displayName=Wn;var Ah="SelectTrigger",Fs=g.forwardRef((e,t)=>{const{__scopeSelect:n,disabled:r=!1,...i}=e,o=Eo(n),a=Sn(Ah,n),s=a.disabled||r,l=Ye(t,a.onTriggerChange),c=So(n),u=g.useRef("touch"),[d,h,f]=qh(p=>{const y=c().filter(w=>!w.disabled),b=y.find(w=>w.value===a.value),x=Gh(y,p,b);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 v.jsx(ch,{asChild:!0,...o,children:v.jsx(Ue.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":Ws(a.value)?"":void 0,...i,ref:l,onClick:je(i.onClick,p=>{p.currentTarget.focus(),u.current!=="mouse"&&m(p)}),onPointerDown:je(i.onPointerDown,p=>{u.current=p.pointerType;const y=p.target;y.hasPointerCapture(p.pointerId)&&y.releasePointerCapture(p.pointerId),p.button===0&&p.ctrlKey===!1&&p.pointerType==="mouse"&&(m(p),p.preventDefault())}),onKeyDown:je(i.onKeyDown,p=>{const y=d.current!=="";!(p.ctrlKey||p.altKey||p.metaKey)&&p.key.length===1&&h(p.key),!(y&&p.key===" ")&&YA.includes(p.key)&&(m(),p.preventDefault())})})})});Fs.displayName=Ah;var Th="SelectValue",Rh=g.forwardRef((e,t)=>{const{__scopeSelect:n,className:r,style:i,children:o,placeholder:a="",...s}=e,l=Sn(Th,n),{onValueNodeHasChildrenChange:c}=l,u=o!==void 0,d=Ye(t,l.onValueNodeChange);nt(()=>{c(u)},[c,u]);const h=Ws(l.value);return v.jsx(Ue.span,{...s,asChild:h?!1:s.asChild,ref:d,style:{pointerEvents:"none"},children:v.jsx(g.Fragment,{children:h?a:o},h?"placeholder":"value")})});Rh.displayName=Th;var nT="SelectIcon",Ph=g.forwardRef((e,t)=>{const{__scopeSelect:n,children:r,...i}=e;return v.jsx(Ue.span,{"aria-hidden":!0,...i,ref:t,children:r||"▼"})});Ph.displayName=nT;var Ih="SelectPortal",[rT,iT]=Yn(Ih,{forceMount:void 0}),Lh=e=>{const{__scopeSelect:t,forceMount:n,...r}=e;return v.jsx(rT,{scope:e.__scopeSelect,forceMount:n,children:v.jsx(fh,{asChild:!0,...r})})};Lh.displayName=Ih;var bn="SelectContent",Hs=g.forwardRef((e,t)=>{const n=iT(bn,e.__scopeSelect),{forceMount:r=n.forceMount,...i}=e,o=Sn(bn,e.__scopeSelect),[a,s]=g.useState();return nt(()=>{s(new DocumentFragment)},[]),v.jsx(js,{present:r||o.open,children:({present:l})=>l?v.jsx(Nh,{...i,ref:t}):v.jsx(Oh,{...i,fragment:a})})});Hs.displayName=bn;var Oh=g.forwardRef((e,t)=>{const{__scopeSelect:n,children:r,fragment:i}=e;return i?vr.createPortal(v.jsx(_h,{scope:n,children:v.jsx(ko.Slot,{scope:n,children:v.jsx("div",{ref:t,children:r})})}),i):null});Oh.displayName="SelectContentFragment";var It=10,[_h,En]=Yn(bn),oT="SelectContentImpl",aT=Gr("SelectContent.RemoveScroll"),Nh=g.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:y,...b}=e,x=Sn(bn,n),[w,T]=g.useState(null),[I,C]=g.useState(null),k=Ye(t,W=>T(W)),[D,F]=g.useState(null),[R,N]=g.useState(null),L=So(n),[K,H]=g.useState(!1),z=g.useRef(!1);g.useEffect(()=>{if(w)return fA(w)},[w]),RE();const Y=g.useCallback(W=>{const[fe,...Re]=L().map(pe=>pe.ref.current),[be]=Re.slice(-1),we=document.activeElement;for(const pe of W)if(pe===we||(pe?.scrollIntoView({block:"nearest"}),pe===fe&&I&&(I.scrollTop=0),pe===be&&I&&(I.scrollTop=I.scrollHeight),pe?.focus(),document.activeElement!==we))return},[L,I]),Q=g.useCallback(()=>Y([D,w]),[Y,D,w]);g.useEffect(()=>{K&&Q()},[K,Q]);const{onOpenChange:$,triggerPointerDownPosRef:j}=x;g.useEffect(()=>{if(w){let W={x:0,y:0};const fe=be=>{W={x:Math.abs(Math.round(be.pageX)-(j.current?.x??0)),y:Math.abs(Math.round(be.pageY)-(j.current?.y??0))}},Re=be=>{W.x<=10&&W.y<=10?be.preventDefault():be.composedPath().includes(w)||$(!1),document.removeEventListener("pointermove",fe),j.current=null};return j.current!==null&&(document.addEventListener("pointermove",fe),document.addEventListener("pointerup",Re,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",fe),document.removeEventListener("pointerup",Re,{capture:!0})}}},[w,$,j]),g.useEffect(()=>{const W=()=>$(!1);return window.addEventListener("blur",W),window.addEventListener("resize",W),()=>{window.removeEventListener("blur",W),window.removeEventListener("resize",W)}},[$]);const[S,ie]=qh(W=>{const fe=L().filter(we=>!we.disabled),Re=fe.find(we=>we.ref.current===document.activeElement),be=Gh(fe,W,Re);be&&setTimeout(()=>be.ref.current.focus())}),Z=g.useCallback((W,fe,Re)=>{const be=!z.current&&!Re;(x.value!==void 0&&x.value===fe||be)&&(F(W),be&&(z.current=!0))},[x.value]),E=g.useCallback(()=>w?.focus(),[w]),ae=g.useCallback((W,fe,Re)=>{const be=!z.current&&!Re;(x.value!==void 0&&x.value===fe||be)&&N(W)},[x.value]),me=r==="popper"?Fa:Dh,ve=me===Fa?{side:s,sideOffset:l,align:c,alignOffset:u,arrowPadding:d,collisionBoundary:h,collisionPadding:f,sticky:m,hideWhenDetached:p,avoidCollisions:y}:{};return v.jsx(_h,{scope:n,content:w,viewport:I,onViewportChange:C,itemRefCallback:Z,selectedItem:D,onItemLeave:E,itemTextRefCallback:ae,focusSelectedItem:Q,selectedItemText:R,position:r,isPositioned:K,searchRef:S,children:v.jsx(Sh,{as:aT,allowPinchZoom:!0,children:v.jsx(Uf,{asChild:!0,trapped:x.open,onMountAutoFocus:W=>{W.preventDefault()},onUnmountAutoFocus:je(i,W=>{x.trigger?.focus({preventScroll:!0}),W.preventDefault()}),children:v.jsx(As,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:o,onPointerDownOutside:a,onFocusOutside:W=>W.preventDefault(),onDismiss:()=>x.onOpenChange(!1),children:v.jsx(me,{role:"listbox",id:x.contentId,"data-state":x.open?"open":"closed",dir:x.dir,onContextMenu:W=>W.preventDefault(),...b,...ve,onPlaced:()=>H(!0),ref:k,style:{display:"flex",flexDirection:"column",outline:"none",...b.style},onKeyDown:je(b.onKeyDown,W=>{const fe=W.ctrlKey||W.altKey||W.metaKey;if(W.key==="Tab"&&W.preventDefault(),!fe&&W.key.length===1&&ie(W.key),["ArrowUp","ArrowDown","Home","End"].includes(W.key)){let be=L().filter(we=>!we.disabled).map(we=>we.ref.current);if(["ArrowUp","End"].includes(W.key)&&(be=be.slice().reverse()),["ArrowUp","ArrowDown"].includes(W.key)){const we=W.target,pe=be.indexOf(we);be=be.slice(pe+1)}setTimeout(()=>Y(be)),W.preventDefault()}})})})})})})});Nh.displayName=oT;var sT="SelectItemAlignedPosition",Dh=g.forwardRef((e,t)=>{const{__scopeSelect:n,onPlaced:r,...i}=e,o=Sn(bn,n),a=En(bn,n),[s,l]=g.useState(null),[c,u]=g.useState(null),d=Ye(t,k=>u(k)),h=So(n),f=g.useRef(!1),m=g.useRef(!0),{viewport:p,selectedItem:y,selectedItemText:b,focusSelectedItem:x}=a,w=g.useCallback(()=>{if(o.trigger&&o.valueNode&&s&&c&&p&&y&&b){const k=o.trigger.getBoundingClientRect(),D=c.getBoundingClientRect(),F=o.valueNode.getBoundingClientRect(),R=b.getBoundingClientRect();if(o.dir!=="rtl"){const we=R.left-D.left,pe=F.left-we,Ke=k.left-pe,Qe=k.width+Ke,Mt=Math.max(Qe,D.width),Ze=window.innerWidth-It,jt=Hc(pe,[It,Math.max(It,Ze-Mt)]);s.style.minWidth=Qe+"px",s.style.left=jt+"px"}else{const we=D.right-R.right,pe=window.innerWidth-F.right-we,Ke=window.innerWidth-k.right-pe,Qe=k.width+Ke,Mt=Math.max(Qe,D.width),Ze=window.innerWidth-It,jt=Hc(pe,[It,Math.max(It,Ze-Mt)]);s.style.minWidth=Qe+"px",s.style.right=jt+"px"}const N=h(),L=window.innerHeight-It*2,K=p.scrollHeight,H=window.getComputedStyle(c),z=parseInt(H.borderTopWidth,10),Y=parseInt(H.paddingTop,10),Q=parseInt(H.borderBottomWidth,10),$=parseInt(H.paddingBottom,10),j=z+Y+K+$+Q,S=Math.min(y.offsetHeight*5,j),ie=window.getComputedStyle(p),Z=parseInt(ie.paddingTop,10),E=parseInt(ie.paddingBottom,10),ae=k.top+k.height/2-It,me=L-ae,ve=y.offsetHeight/2,W=y.offsetTop+ve,fe=z+Y+W,Re=j-fe;if(fe<=ae){const we=N.length>0&&y===N[N.length-1].ref.current;s.style.bottom="0px";const pe=c.clientHeight-p.offsetTop-p.offsetHeight,Ke=Math.max(me,ve+(we?E:0)+pe+Q),Qe=fe+Ke;s.style.height=Qe+"px"}else{const we=N.length>0&&y===N[0].ref.current;s.style.top="0px";const Ke=Math.max(ae,z+p.offsetTop+(we?Z:0)+ve)+Re;s.style.height=Ke+"px",p.scrollTop=fe-ae+p.offsetTop}s.style.margin=`${It}px 0`,s.style.minHeight=S+"px",s.style.maxHeight=L+"px",r?.(),requestAnimationFrame(()=>f.current=!0)}},[h,o.trigger,o.valueNode,s,c,p,y,b,o.dir,r]);nt(()=>w(),[w]);const[T,I]=g.useState();nt(()=>{c&&I(window.getComputedStyle(c).zIndex)},[c]);const C=g.useCallback(k=>{k&&m.current===!0&&(w(),x?.(),m.current=!1)},[w,x]);return v.jsx(cT,{scope:n,contentWrapper:s,shouldExpandOnScrollRef:f,onScrollButtonChange:C,children:v.jsx("div",{ref:l,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:T},children:v.jsx(Ue.div,{...i,ref:d,style:{boxSizing:"border-box",maxHeight:"100%",...i.style}})})})});Dh.displayName=sT;var lT="SelectPopperPosition",Fa=g.forwardRef((e,t)=>{const{__scopeSelect:n,align:r="start",collisionPadding:i=It,...o}=e,a=Eo(n);return v.jsx(uh,{...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)"}})});Fa.displayName=lT;var[cT,Bs]=Yn(bn,{}),Ha="SelectViewport",Mh=g.forwardRef((e,t)=>{const{__scopeSelect:n,nonce:r,...i}=e,o=En(Ha,n),a=Bs(Ha,n),s=Ye(t,o.onViewportChange),l=g.useRef(0);return v.jsxs(v.Fragment,{children:[v.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}),v.jsx(ko.Slot,{scope:n,children:v.jsx(Ue.div,{"data-radix-select-viewport":"",role:"presentation",...i,ref:s,style:{position:"relative",flex:1,overflow:"hidden auto",...i.style},onScroll:je(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-It*2,p=parseFloat(d.style.minHeight),y=parseFloat(d.style.height),b=Math.max(p,y);if(b<m){const x=b+f,w=Math.min(m,x),T=x-w;d.style.height=w+"px",d.style.bottom==="0px"&&(u.scrollTop=T>0?T:0,d.style.justifyContent="flex-end")}}}l.current=u.scrollTop})})})]})});Mh.displayName=Ha;var jh="SelectGroup",[uT,dT]=Yn(jh),fT=g.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,i=Ts();return v.jsx(uT,{scope:n,id:i,children:v.jsx(Ue.div,{role:"group","aria-labelledby":i,...r,ref:t})})});fT.displayName=jh;var Fh="SelectLabel",Us=g.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,i=dT(Fh,n);return v.jsx(Ue.div,{id:i.id,...r,ref:t})});Us.displayName=Fh;var Gi="SelectItem",[hT,Hh]=Yn(Gi),zs=g.forwardRef((e,t)=>{const{__scopeSelect:n,value:r,disabled:i=!1,textValue:o,...a}=e,s=Sn(Gi,n),l=En(Gi,n),c=s.value===r,[u,d]=g.useState(o??""),[h,f]=g.useState(!1),m=Ye(t,x=>l.itemRefCallback?.(x,r,i)),p=Ts(),y=g.useRef("touch"),b=()=>{i||(s.onValueChange(r),s.onOpenChange(!1))};if(r==="")throw new Error("A <Select.Item /> must have a value prop that is not an empty string. This is because the Select value can be set to an empty string to clear the selection and show the placeholder.");return v.jsx(hT,{scope:n,value:r,disabled:i,textId:p,isSelected:c,onItemTextChange:g.useCallback(x=>{d(w=>w||(x?.textContent??"").trim())},[]),children:v.jsx(ko.ItemSlot,{scope:n,value:r,disabled:i,textValue:u,children:v.jsx(Ue.div,{role:"option","aria-labelledby":p,"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:m,onFocus:je(a.onFocus,()=>f(!0)),onBlur:je(a.onBlur,()=>f(!1)),onClick:je(a.onClick,()=>{y.current!=="mouse"&&b()}),onPointerUp:je(a.onPointerUp,()=>{y.current==="mouse"&&b()}),onPointerDown:je(a.onPointerDown,x=>{y.current=x.pointerType}),onPointerMove:je(a.onPointerMove,x=>{y.current=x.pointerType,i?l.onItemLeave?.():y.current==="mouse"&&x.currentTarget.focus({preventScroll:!0})}),onPointerLeave:je(a.onPointerLeave,x=>{x.currentTarget===document.activeElement&&l.onItemLeave?.()}),onKeyDown:je(a.onKeyDown,x=>{l.searchRef?.current!==""&&x.key===" "||(QA.includes(x.key)&&b(),x.key===" "&&x.preventDefault())})})})})});zs.displayName=Gi;var Ur="SelectItemText",Bh=g.forwardRef((e,t)=>{const{__scopeSelect:n,className:r,style:i,...o}=e,a=Sn(Ur,n),s=En(Ur,n),l=Hh(Ur,n),c=eT(Ur,n),[u,d]=g.useState(null),h=Ye(t,b=>d(b),l.onItemTextChange,b=>s.itemTextRefCallback?.(b,l.value,l.disabled)),f=u?.textContent,m=g.useMemo(()=>v.jsx("option",{value:l.value,disabled:l.disabled,children:f},l.value),[l.disabled,l.value,f]),{onNativeOptionAdd:p,onNativeOptionRemove:y}=c;return nt(()=>(p(m),()=>y(m)),[p,y,m]),v.jsxs(v.Fragment,{children:[v.jsx(Ue.span,{id:l.textId,...o,ref:h}),l.isSelected&&a.valueNode&&!a.valueNodeHasChildren?vr.createPortal(o.children,a.valueNode):null]})});Bh.displayName=Ur;var Uh="SelectItemIndicator",zh=g.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e;return Hh(Uh,n).isSelected?v.jsx(Ue.span,{"aria-hidden":!0,...r,ref:t}):null});zh.displayName=Uh;var Ba="SelectScrollUpButton",$s=g.forwardRef((e,t)=>{const n=En(Ba,e.__scopeSelect),r=Bs(Ba,e.__scopeSelect),[i,o]=g.useState(!1),a=Ye(t,r.onScrollButtonChange);return nt(()=>{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?v.jsx($h,{...e,ref:a,onAutoScroll:()=>{const{viewport:s,selectedItem:l}=n;s&&l&&(s.scrollTop=s.scrollTop-l.offsetHeight)}}):null});$s.displayName=Ba;var Ua="SelectScrollDownButton",Vs=g.forwardRef((e,t)=>{const n=En(Ua,e.__scopeSelect),r=Bs(Ua,e.__scopeSelect),[i,o]=g.useState(!1),a=Ye(t,r.onScrollButtonChange);return nt(()=>{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?v.jsx($h,{...e,ref:a,onAutoScroll:()=>{const{viewport:s,selectedItem:l}=n;s&&l&&(s.scrollTop=s.scrollTop+l.offsetHeight)}}):null});Vs.displayName=Ua;var $h=g.forwardRef((e,t)=>{const{__scopeSelect:n,onAutoScroll:r,...i}=e,o=En("SelectScrollButton",n),a=g.useRef(null),s=So(n),l=g.useCallback(()=>{a.current!==null&&(window.clearInterval(a.current),a.current=null)},[]);return g.useEffect(()=>()=>l(),[l]),nt(()=>{s().find(u=>u.ref.current===document.activeElement)?.ref.current?.scrollIntoView({block:"nearest"})},[s]),v.jsx(Ue.div,{"aria-hidden":!0,...i,ref:t,style:{flexShrink:0,...i.style},onPointerDown:je(i.onPointerDown,()=>{a.current===null&&(a.current=window.setInterval(r,50))}),onPointerMove:je(i.onPointerMove,()=>{o.onItemLeave?.(),a.current===null&&(a.current=window.setInterval(r,50))}),onPointerLeave:je(i.onPointerLeave,()=>{l()})})}),pT="SelectSeparator",Ks=g.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e;return v.jsx(Ue.div,{"aria-hidden":!0,...r,ref:t})});Ks.displayName=pT;var Vh="SelectArrow",mT=g.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,i=Eo(n);return En(Vh,n).position==="popper"?v.jsx(dh,{...i,...r,ref:t}):null});mT.displayName=Vh;var Kh="SelectBubbleInput",Wh=g.forwardRef(({__scopeSelect:e,...t},n)=>{const r=Sn(Kh,e),{value:i,onValueChange:o,required:a,disabled:s,name:l,autoComplete:c,form:u}=r,{nativeOptions:d,nativeSelectKey:h}=r,f=g.useRef(null),m=Ye(n,f),p=i??"",y=aA(p);return g.useEffect(()=>{const b=f.current;if(!b)return;const x=window.HTMLSelectElement.prototype,T=Object.getOwnPropertyDescriptor(x,"value").set;if(y!==p&&T){const I=new Event("change",{bubbles:!0});T.call(b,p),b.dispatchEvent(I)}},[y,p]),v.jsxs(Ue.select,{"aria-hidden":!0,required:a,tabIndex:-1,name:l,autoComplete:c,disabled:s,form:u,onChange:b=>o(b.target.value),...t,style:{...hh,...t.style},ref:m,defaultValue:p,children:[Ws(i)?v.jsx("option",{value:""}):null,Array.from(d)]},h)});Wh.displayName=Kh;function gT(e){return typeof e=="function"}function Ws(e){return e===""||e===void 0}function qh(e){const t=Vn(e),n=g.useRef(""),r=g.useRef(0),i=g.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=g.useCallback(()=>{n.current="",window.clearTimeout(r.current)},[]);return g.useEffect(()=>()=>window.clearTimeout(r.current),[]),[n,i,o]}function Gh(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=yT(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 yT(e,t){return e.map((n,r)=>e[(t+r)%e.length])}const za=Ch,$a=Rh,Yi=g.forwardRef(({className:e,children:t,...n},r)=>v.jsxs(Fs,{ref:r,className:Le("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,v.jsx(Ph,{asChild:!0,children:v.jsx(id,{className:"h-4 w-4 opacity-60"})})]}));Yi.displayName=Fs.displayName;const Yh=g.forwardRef(({className:e,...t},n)=>v.jsx($s,{ref:n,className:Le("flex cursor-default items-center justify-center py-1",e),...t,children:v.jsx(Hg,{className:"h-4 w-4"})}));Yh.displayName=$s.displayName;const Qh=g.forwardRef(({className:e,...t},n)=>v.jsx(Vs,{ref:n,className:Le("flex cursor-default items-center justify-center py-1",e),...t,children:v.jsx(id,{className:"h-4 w-4"})}));Qh.displayName=Vs.displayName;const Qi=g.forwardRef(({className:e,children:t,position:n="popper",...r},i)=>v.jsx(Lh,{children:v.jsxs(Hs,{ref:i,position:n,className:Le("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:[v.jsx(Yh,{}),v.jsx(Mh,{className:Le("p-1",n==="popper"&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]"),children:t}),v.jsx(Qh,{})]})}));Qi.displayName=Hs.displayName;const vT=g.forwardRef(({className:e,...t},n)=>v.jsx(Us,{ref:n,className:Le("px-2 py-1.5 text-xs font-semibold uppercase tracking-wide text-text-muted",e),...t}));vT.displayName=Us.displayName;const Mn=g.forwardRef(({className:e,children:t,...n},r)=>v.jsxs(zs,{ref:r,className:Le("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:[v.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:v.jsx(zh,{children:v.jsx(Fg,{className:"h-4 w-4"})})}),v.jsx(Bh,{children:t})]}));Mn.displayName=zs.displayName;const bT=g.forwardRef(({className:e,...t},n)=>v.jsx(Ks,{ref:n,className:Le("-mx-1 my-1 h-px bg-border",e),...t}));bT.displayName=Ks.displayName;function xT({agents:e,value:t,onChange:n}){return v.jsxs(za,{value:t||void 0,onValueChange:n,children:[v.jsx(Yi,{className:"h-7 w-28 sm:w-36 text-xs",children:v.jsx($a,{placeholder:e[0]??"—"})}),v.jsx(Qi,{children:e.map(r=>v.jsx(Mn,{value:r,children:r},r))})]})}const Va="agim-theme",Xh="im-hub-lang";function wT(){try{const e=localStorage.getItem(Va);if(e==="light"||e==="dark")return e}catch{}return"system"}function kT(){try{const t=localStorage.getItem(Xh);if(t==="en"||t==="zh")return t}catch{}return(navigator.language||"en").toLowerCase().startsWith("zh")?"zh":"en"}function du(e){try{e==="system"?localStorage.removeItem(Va):localStorage.setItem(Va,e)}catch{}}function ST(e){try{localStorage.setItem(Xh,e)}catch{}}const cr=Ju((e,t)=>({theme:wT(),lang:kT(),setTheme:n=>{du(n),e({theme:n})},cycleTheme:()=>{const n=t().theme,r=n==="system"?"light":n==="light"?"dark":"system";du(r),e({theme:r})},setLang:n=>{ST(n),e({lang:n})}}));function fu(e){e==="system"?document.documentElement.removeAttribute("data-theme"):document.documentElement.setAttribute("data-theme",e)}function ET(){const e=cr(t=>t.theme);g.useEffect(()=>{if(fu(e),e!=="system")return;const t=window.matchMedia("(prefers-color-scheme: dark)"),n=()=>fu(e);return t.addEventListener("change",n),()=>t.removeEventListener("change",n)},[e])}function CT(){const{t:e}=kt(),t=cr(o=>o.theme),n=cr(o=>o.lang),r=cr(o=>o.setTheme),i=cr(o=>o.setLang);return v.jsxs(v.Fragment,{children:[v.jsxs(za,{value:n,onValueChange:o=>i(o),children:[v.jsx(Yi,{className:"h-7 w-16 sm:w-20 text-xs","aria-label":e("lang.label"),children:v.jsx($a,{})}),v.jsxs(Qi,{children:[v.jsx(Mn,{value:"en",children:e("lang.en")}),v.jsx(Mn,{value:"zh",children:e("lang.zh")})]})]}),v.jsxs(za,{value:t,onValueChange:o=>r(o),children:[v.jsx(Yi,{className:"h-7 w-16 text-xs sm:w-28","aria-label":e("theme.label"),children:v.jsx($a,{})}),v.jsxs(Qi,{children:[v.jsx(Mn,{value:"system",children:v.jsxs("span",{className:"inline-flex items-center gap-2",children:[v.jsx($g,{className:"h-4 w-4"})," ",e("theme.system")]})}),v.jsx(Mn,{value:"light",children:v.jsxs("span",{className:"inline-flex items-center gap-2",children:[v.jsx(Yg,{className:"h-4 w-4"})," ",e("theme.light")]})}),v.jsx(Mn,{value:"dark",children:v.jsxs("span",{className:"inline-flex items-center gap-2",children:[v.jsx(Kg,{className:"h-4 w-4"})," ",e("theme.dark")]})})]})]})]})}function AT(e){const[t,n]=g.useState(()=>typeof window>"u"||!window.matchMedia?!1:window.matchMedia(e).matches);return g.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 TT(){return AT("(min-width: 640px)")}const RT=[{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 Jh({children:e}){const{t}=kt(),n=TT(),r=v.jsx("nav",{className:Le("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:RT.filter(i=>i.mounted).map(i=>v.jsx(yl,{to:i.to,end:i.to==="/",className:({isActive:o})=>Le("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 v.jsxs("header",{className:Le("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:[v.jsxs("div",{className:Le("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:[v.jsxs(yl,{to:"/",className:"flex shrink-0 items-center gap-1 text-md font-semibold no-underline",end:!0,children:[v.jsx("span",{"aria-hidden":"true",children:"🤖"}),v.jsx("span",{className:"hidden sm:inline",children:t("appName")})]}),n&&v.jsx("div",{className:"flex flex-1 min-w-0",children:r}),e&&v.jsx("div",{className:"flex items-center gap-2",children:e}),v.jsx("div",{className:"flex shrink-0 items-center gap-2",children:v.jsx(CT,{})})]}),!n&&v.jsx("div",{className:"border-t border-border px-3 py-1",children:r})]})}const PT={open:"bg-success",connecting:"bg-warning animate-pulse",closed:"bg-text-muted",error:"bg-danger"};function IT(){const{t:e}=kt(),{state:t,send:n,switchAgent:r,approvalClick:i,newConversation:o,clearError:a}=fb(),[s,l]=g.useState(""),c=g.useRef(null),u=g.useRef(null);g.useEffect(()=>{if(!c.current)return;const f=c.current;!(f.scrollHeight-f.scrollTop-f.clientHeight<200)&&t.currentReplyId==null||requestAnimationFrame(()=>{f.scrollTop=f.scrollHeight})},[t.messages,t.currentReplyId]),g.useEffect(()=>{t.error&&(Ot.error(t.error),a())},[t.error,a]);function d(f){f?.preventDefault();const m=s.trim();if(m){if(t.status!=="open"){Ot.error(e("chat.notConnected",{defaultValue:"Not connected. Reconnecting…"}));return}n(m),l(""),requestAnimationFrame(()=>u.current?.focus())}}function h(f){f.nativeEvent.isComposing||f.keyCode===229||f.key==="Enter"&&!f.shiftKey&&(f.preventDefault(),d())}return v.jsxs("div",{className:"flex h-dvh flex-col bg-bg",children:[v.jsxs(Jh,{children:[v.jsx("span",{className:Le("inline-block h-2 w-2 rounded-full",PT[t.status]),title:t.status}),v.jsx("span",{className:"hidden text-xs text-text-dim sm:inline",children:t.status}),v.jsxs(bt,{variant:"ghost",size:"sm",onClick:()=>{o(),Ot.success(e("chat.newConvToast",{defaultValue:"Started a new conversation"})),requestAnimationFrame(()=>u.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:[v.jsx(Vg,{className:"h-4 w-4"}),v.jsx("span",{className:"hidden text-xs sm:inline",children:e("chat.newConv",{defaultValue:"New"})})]}),v.jsx(xT,{agents:t.agents,value:t.agent,onChange:r})]}),v.jsx("div",{ref:c,className:"flex-1 overflow-y-auto",children:v.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&&t.status==="open"&&v.jsxs("div",{className:"flex flex-col items-center gap-2 py-16 text-center",children:[v.jsx("div",{className:"flex h-12 w-12 items-center justify-center rounded-full bg-surface-2 text-2xl",children:"💬"}),v.jsx("h2",{className:"text-base font-semibold",children:e("chat.welcomeTitle",{defaultValue:"Start a conversation"})}),v.jsx("p",{className:"max-w-md text-sm text-text-dim",children:e("chat.welcomeBody",{defaultValue:"Type a message to ask the active agent. Use the agent dropdown to switch."})})]}),t.messages.length===0&&t.status!=="open"&&v.jsxs("div",{className:"grid place-items-center py-16 text-center",children:[v.jsx(Bg,{className:"h-10 w-10 text-text-muted"}),v.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(f=>!f.approval).map(f=>v.jsx(lE,{msg:f,onApprove:(m,p,y)=>i(m,p,y)},f.id))]})}),v.jsx(fE,{approvals:t.pendingApprovals,onApprove:(f,m,p)=>i(f,m,p)}),v.jsxs("form",{onSubmit:d,className:"sticky bottom-0 border-t border-border bg-surface px-4 py-2 pb-safe sm:px-6",children:[v.jsxs("div",{className:"mx-auto flex max-w-3xl items-end gap-2",children:[v.jsx("textarea",{ref:u,value:s,onChange:f=>l(f.target.value),onKeyDown:h,placeholder:e("chat.inputPlaceholder",{defaultValue:"Message… (Enter sends, Shift+Enter newlines)"}),rows:1,className:Le("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")}),v.jsx(bt,{type:"submit",disabled:!s.trim()||t.status!=="open","aria-label":e("chat.send",{defaultValue:"Send"}),className:"h-8 w-8 p-0",children:v.jsx(qg,{className:"h-4 w-4"})})]}),t.currentReplyId&&v.jsx("div",{className:"mx-auto mt-2 flex max-w-3xl items-center gap-2",children:v.jsx(st,{variant:"info",children:e("chat.streaming",{defaultValue:"… streaming"})})})]})]})}function LT(){const{t:e}=kt(),t=ln();return v.jsxs("div",{className:"flex min-h-dvh flex-col bg-bg",children:[v.jsx(Jh,{}),v.jsx("main",{className:"grid flex-1 place-items-center px-4 py-8 pb-safe",children:v.jsxs("div",{className:"flex max-w-md flex-col items-center gap-3 text-center",children:[v.jsx("div",{className:"flex h-12 w-12 items-center justify-center rounded-full bg-surface-2 text-text-dim",children:v.jsx(Ug,{className:"h-6 w-6"})}),v.jsx("div",{className:"text-6xl font-bold tracking-tight text-text-muted",children:"404"}),v.jsx("h1",{className:"text-xl font-semibold",children:e("notFound.title",{defaultValue:"Nothing here."})}),v.jsx("p",{className:"text-sm text-text-dim",children:e("notFound.description",{defaultValue:"The page you're looking for doesn't exist."})}),v.jsx("code",{className:"rounded bg-surface-2 px-2 py-0.5 text-xs text-text-muted",children:t.pathname}),v.jsx(bt,{asChild:!0,className:"mt-2",children:v.jsx(ts,{to:"/",children:e("actions.back")})})]})})]})}function en(e){return async()=>{const n=(await e()).default;return{element:v.jsx(Zu,{children:v.jsx(n,{})})}}}function Ae(e){return async()=>{const n=(await e()).default;return{element:v.jsx(n,{})}}}const OT=Xm([{path:"/login",element:v.jsx(ob,{})},{path:"/",element:v.jsx(Zu,{children:v.jsx(IT,{})})},{path:"/tasks",lazy:en(()=>he(()=>import("./layout-Bp4SAA8_.js"),__vite__mapDeps([0,1]))),children:[{index:!0,element:v.jsx(zt,{to:"jobs",replace:!0})},{path:"jobs",lazy:Ae(()=>he(()=>import("./jobs-Ddy81Udm.js"),__vite__mapDeps([2,1,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20])))},{path:"subtasks",lazy:Ae(()=>he(()=>import("./subtasks-Bzh3o3EF.js"),__vite__mapDeps([21,1,3,4,5,6,7,8,15,16,17,18])))},{path:"bgjobs",lazy:Ae(()=>he(()=>import("./bgjobs-CDrK0d-W.js"),__vite__mapDeps([22,1,3,4,5,6,7,8,15,17,18])))},{path:"schedules",lazy:Ae(()=>he(()=>import("./schedules-Bcd0wbT4.js"),__vite__mapDeps([23,1,3,4,5,6,7,15,17,18])))},{path:"outbox",lazy:Ae(()=>he(()=>import("./outbox-l8aVOZqO.js"),__vite__mapDeps([24,1,3,4,5,6,7,8,12,13,14,15,17,18])))},{path:"a2a",lazy:Ae(()=>he(()=>import("./a2a-Cll3P4QN.js"),__vite__mapDeps([25,1,3,4,5,6,7,8,15,16,17,18])))},{path:"heartbeat",lazy:Ae(()=>he(()=>import("./heartbeat-BM8LlPes.js"),__vite__mapDeps([26,1,4,27,15,28,17,18,29])))},{path:"goals",lazy:Ae(()=>he(()=>import("./goals-BfQbsvZv.js"),__vite__mapDeps([30,1,4,27,15,17,18,31,19])))},{path:"asks",lazy:Ae(()=>he(()=>import("./asks-C-j-DypC.js"),__vite__mapDeps([32,4,1,27,15,17,18,19])))},{path:"plans",lazy:Ae(()=>he(()=>import("./plans-BBB5e9my.js"),__vite__mapDeps([33,1,4,27,15,17,18,11,34,19,31])))}]},{path:"/approvals",lazy:en(()=>he(()=>import("./approvals-C8IUJQ_A.js"),__vite__mapDeps([35,1,14,5,15,16,17,18])))},{path:"/reminders",lazy:en(()=>he(()=>import("./reminders-DHM8K0_O.js"),__vite__mapDeps([36,1,3,4,5,6,7,8,12,13,14,15,34,17,18,37])))},{path:"/memos",lazy:en(()=>he(()=>import("./memos-Dkoc157i.js"),__vite__mapDeps([38,1,3,4,5,6,7,12,13,14,11,15,39,18,40,41])))},{path:"/memory",lazy:en(()=>he(()=>import("./layout-BL74fT-L.js"),__vite__mapDeps([42,43,15,1]))),children:[{index:!0,element:v.jsx(zt,{to:"facts",replace:!0})},{path:"facts",lazy:Ae(()=>he(()=>import("./facts-B7bGGwvi.js"),__vite__mapDeps([44,1,3,4,5,6,7,9,10,11,12,13,14,43,15,39,45,17,18,40])))},{path:"persona",lazy:Ae(()=>he(()=>import("./persona-D3VL9Rg1.js"),__vite__mapDeps([46,1,5,12,13,14,43,15,45,17,18,29,47,19,39])))},{path:"vector",lazy:Ae(()=>he(()=>import("./vector-Ic76u2hY.js"),__vite__mapDeps([48,1,49,15,43,17,50,51,12,13,14,5,19,18,29,52,39,47])))},{path:"skills",element:v.jsx(zt,{to:"/settings/agim-skills/installed",replace:!0})}]},{path:"/skills",children:[{index:!0,element:v.jsx(zt,{to:"/settings/agim-skills/installed",replace:!0})},{path:"installed",element:v.jsx(zt,{to:"/settings/agim-skills/installed",replace:!0})},{path:"hot",element:v.jsx(zt,{to:"/settings/agim-skills/hot",replace:!0})}]},{path:"/workspace",lazy:en(()=>he(()=>import("./workspace-CUg0JPn6.js"),__vite__mapDeps([53,1,5,54,15,17,18])))},{path:"/observability",lazy:en(()=>he(()=>import("./layout-CZ9pGnW8.js"),__vite__mapDeps([55,1]))),children:[{index:!0,element:v.jsx(zt,{to:"health",replace:!0})},{path:"health",lazy:Ae(()=>he(()=>import("./health-Ba_mY0Ts.js"),__vite__mapDeps([56,1,5,4,57,15,17,18,58])))},{path:"topn",lazy:Ae(()=>he(()=>import("./topn-DkhYw-Gp.js"),__vite__mapDeps([59,5,4,1,57,15,17,18])))},{path:"audit",lazy:Ae(()=>he(()=>import("./audit-DQb-RuXh.js"),__vite__mapDeps([60,1,3,4,5,6,7,57,15,17,18,58])))}]},{path:"/settings",lazy:en(()=>he(()=>import("./layout-Bn2qUxcK.js"),__vite__mapDeps([61,1]))),children:[{index:!0,element:v.jsx(zt,{to:"messengers",replace:!0})},{path:"messengers",lazy:Ae(()=>he(()=>import("./messengers-CcyGDeUI.js"),__vite__mapDeps([62,1,13,14,49,15,17,18,50,63])))},{path:"email",lazy:Ae(()=>he(()=>import("./email-CZee26-_.js"),__vite__mapDeps([64,1,49,15,17,19,31,18,51,14,50])))},{path:"viewer",lazy:Ae(()=>he(()=>import("./viewer-BXbUN1Rl.js"),__vite__mapDeps([65,1,49,15,51,17,18,31,66,14,50,41])))},{path:"agents",lazy:Ae(()=>he(()=>import("./agents-Bqgq7GBF.js"),__vite__mapDeps([67,1,5,54,15,49,17,18,14,50,68,40,69,39])))},{path:"policy",lazy:Ae(()=>he(()=>import("./policy-BM1WRXH0.js"),__vite__mapDeps([70,49,15,1,17,18])))},{path:"security",lazy:Ae(()=>he(()=>import("./security-DgJyTT4g.js"),__vite__mapDeps([71,1,49,15,17,18,72,31])))},{path:"service",lazy:Ae(()=>he(()=>import("./service-A0Hzear0.js"),__vite__mapDeps([73,1,12,13,14,49,15,17,18,29,68,50])))},{path:"admins",lazy:Ae(()=>he(()=>import("./admins-CN7P018S.js"),__vite__mapDeps([74,1,12,13,14,5,4,49,15,17,18,39])))},{path:"workspaces",lazy:Ae(()=>he(()=>import("./workspaces-C-wb5FQj.js"),__vite__mapDeps([75,1,5,4,49,15,17,18,20,50])))},{path:"llm",lazy:Ae(()=>he(()=>import("./llm-yp7b5xxL.js"),__vite__mapDeps([76,1,4,77,15,17,18,39,69])))},{path:"mcp",lazy:Ae(()=>he(()=>import("./mcp-DyaljIM_.js"),__vite__mapDeps([78,1,4,77,15,17,18,58,39,69])))},{path:"native-agent",lazy:Ae(()=>he(()=>import("./native-agent-BQ7WaRGK.js"),__vite__mapDeps([79,1,49,15,17,18,14,50,68,72,37,28])))},{path:"search",lazy:Ae(()=>he(()=>import("./search-BUlzNWrj.js"),__vite__mapDeps([80,1,49,15,17,18,14,50,6,7,31,19])))},{path:"mobile",lazy:Ae(()=>he(()=>import("./mobile-DqzIv4Xb.js"),__vite__mapDeps([81,1,17,18,63,51,82,72])))},{path:"agim-skills",lazy:Ae(()=>he(()=>import("./layout-pasFRkKV.js"),__vite__mapDeps([83,1]))),children:[{index:!0,element:v.jsx(zt,{to:"installed",replace:!0})},{path:"installed",lazy:Ae(()=>he(()=>import("./installed-Xr8p31ij.js"),__vite__mapDeps([84,1,15,17,18,39,50])))},{path:"hot",lazy:Ae(()=>he(()=>import("./hot-BtuLL6n8.js"),__vite__mapDeps([85,1,5,13,14,15,66,17,18,40,52,82])))}]}]},{path:"/m/chat",lazy:en(()=>he(()=>import("./chat-CSjtY2rN.js"),__vite__mapDeps([86,1,10,7])))},{path:"*",element:v.jsx(LT,{})}]);function _T(){return v.jsx(Uy,{children:v.jsx(og,{router:OT})})}const NT=new bv({defaultOptions:{queries:{staleTime:3e4,gcTime:5*6e4,retry:1,retryDelay:e=>Math.min(1e3*2**e,8e3),refetchOnWindowFocus:!1,refetchOnReconnect:!0},mutations:{retry:0}}}),de=e=>typeof e=="string",Hr=()=>{let e,t;const n=new Promise((r,i)=>{e=r,t=i});return n.resolve=e,n.reject=t,n},hu=e=>e==null?"":""+e,DT=(e,t,n)=>{e.forEach(r=>{t[r]&&(n[r]=t[r])})},MT=/###/g,pu=e=>e&&e.indexOf("###")>-1?e.replace(MT,"."):e,mu=e=>!e||de(e),Kr=(e,t,n)=>{const r=de(t)?t.split("."):t;let i=0;for(;i<r.length-1;){if(mu(e))return{};const o=pu(r[i]);!e[o]&&n&&(e[o]=new n),Object.prototype.hasOwnProperty.call(e,o)?e=e[o]:e={},++i}return mu(e)?{}:{obj:e,k:pu(r[i])}},gu=(e,t,n)=>{const{obj:r,k:i}=Kr(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=Kr(e,a,Object);for(;s.obj===void 0&&a.length;)o=`${a[a.length-1]}.${o}`,a=a.slice(0,a.length-1),s=Kr(e,a,Object),s?.obj&&typeof s.obj[`${s.k}.${o}`]<"u"&&(s.obj=void 0);s.obj[`${s.k}.${o}`]=n},jT=(e,t,n,r)=>{const{obj:i,k:o}=Kr(e,t,Object);i[o]=i[o]||[],i[o].push(n)},Xi=(e,t)=>{const{obj:n,k:r}=Kr(e,t);if(n&&Object.prototype.hasOwnProperty.call(n,r))return n[r]},FT=(e,t,n)=>{const r=Xi(e,n);return r!==void 0?r:Xi(t,n)},Zh=(e,t,n)=>{for(const r in t)r!=="__proto__"&&r!=="constructor"&&(r in e?de(e[r])||e[r]instanceof String||de(t[r])||t[r]instanceof String?n&&(e[r]=t[r]):Zh(e[r],t[r],n):e[r]=t[r]);return e},ar=e=>e.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&");var HT={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;","/":"&#x2F;"};const BT=e=>de(e)?e.replace(/[&<>"'\/]/g,t=>HT[t]):e;class UT{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 zT=[" ",",","?","!",";"],$T=new UT(20),VT=(e,t,n)=>{t=t||"",n=n||"";const r=zT.filter(a=>t.indexOf(a)<0&&n.indexOf(a)<0);if(r.length===0)return!0;const i=$T.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},Ka=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},Ji=e=>e?.replace("_","-"),KT={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 Zi{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||KT,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:(de(t[0])&&(t[0]=`${r}${this.prefix} ${t[0]}`),this.logger[n](t))}create(t){return new Zi(this.logger,{prefix:`${this.prefix}:${t}:`,...this.options})}clone(t){return t=t||this.options,t.prefix=t.prefix||this.prefix,new Zi(this.logger,t)}}var Wt=new Zi;class Co{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 yu extends Co{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):de(r)&&o?s.push(...r.split(o)):s.push(r)));const l=Xi(this.data,s);return!l&&!n&&!r&&t.indexOf(".")>-1&&(t=s[0],n=s[1],r=s.slice(2).join(".")),l||!a||!de(r)?l:Ka(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),gu(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)(de(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=Xi(this.data,s)||{};a.skipCopy||(r=JSON.parse(JSON.stringify(r))),i?Zh(l,r,o):l={...l,...r},gu(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 ep={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 vu={},bu=e=>!de(e)&&typeof e!="boolean"&&typeof e!="number";class eo extends Co{constructor(t){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};super(),DT(["resourceStore","languageUtils","pluralResolver","interpolator","backendConnector","i18nFormat","utils"],t,this),this.options=n,this.options.keySeparator===void 0&&(this.options.keySeparator="."),this.logger=Wt.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&&!VT(t,r,i);if(a&&!s){const l=t.match(this.interpolator.nestingRegexp);if(l&&l.length>0)return{key:t,namespaces:de(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:de(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 N=n.nsSeparator||this.options.nsSeparator;return i?{res:`${l}${N}${a}`,usedKey:a,exactUsedKey:a,usedLng:c,usedNS:l,usedParams:this.getUsedParamsDetails(n)}:`${l}${N}${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]"],y=n.joinArrays!==void 0?n.joinArrays:this.options.joinArrays,b=!this.i18nFormat||this.i18nFormat.handleAsObject,x=n.count!==void 0&&!de(n.count),w=eo.hasDefaultValue(n),T=x?this.pluralResolver.getSuffix(c,n.count,n):"",I=n.ordinal&&x?this.pluralResolver.getSuffix(c,n.count,{ordinal:!1}):"",C=x&&!n.ordinal&&n.count===0,k=C&&n[`defaultValue${this.options.pluralSeparator}zero`]||n[`defaultValue${T}`]||n[`defaultValue${I}`]||n.defaultValue;let D=h;b&&!h&&w&&(D=k);const F=bu(D),R=Object.prototype.toString.apply(D);if(b&&D&&F&&p.indexOf(R)<0&&!(de(y)&&Array.isArray(D))){if(!n.returnObjects&&!this.options.returnObjects){this.options.returnedObjectHandler||this.logger.warn("accessing an object - but returnObjects options is not enabled!");const N=this.options.returnedObjectHandler?this.options.returnedObjectHandler(f,D,{...n,ns:s}):`key '${a} (${this.language})' returned an object instead of string.`;return i?(d.res=N,d.usedParams=this.getUsedParamsDetails(n),d):N}if(o){const N=Array.isArray(D),L=N?[]:{},K=N?m:f;for(const H in D)if(Object.prototype.hasOwnProperty.call(D,H)){const z=`${K}${o}${H}`;w&&!h?L[H]=this.translate(z,{...n,defaultValue:bu(k)?k[H]:void 0,joinArrays:!1,ns:s}):L[H]=this.translate(z,{...n,joinArrays:!1,ns:s}),L[H]===z&&(L[H]=D[H])}h=L}}else if(b&&de(y)&&Array.isArray(h))h=h.join(y),h&&(h=this.extendTranslation(h,t,n,r));else{let N=!1,L=!1;!this.isValidLookup(h)&&w&&(N=!0,h=k),this.isValidLookup(h)||(L=!0,h=a);const H=(n.missingKeyNoValueFallbackToKey||this.options.missingKeyNoValueFallbackToKey)&&L?void 0:h,z=w&&k!==h&&this.options.updateMissing;if(L||N||z){if(this.logger.log(z?"updateKey":"missingKey",c,l,a,z?k:h),o){const j=this.resolve(a,{...n,keySeparator:!1});j&&j.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 Y=[];const Q=this.languageUtils.getFallbackCodes(this.options.fallbackLng,n.lng||this.language);if(this.options.saveMissingTo==="fallback"&&Q&&Q[0])for(let j=0;j<Q.length;j++)Y.push(Q[j]);else this.options.saveMissingTo==="all"?Y=this.languageUtils.toResolveHierarchy(n.lng||this.language):Y.push(n.lng||this.language);const $=(j,S,ie)=>{const Z=w&&ie!==h?ie:H;this.options.missingKeyHandler?this.options.missingKeyHandler(j,l,S,Z,z,n):this.backendConnector?.saveMissing&&this.backendConnector.saveMissing(j,l,S,Z,z,n),this.emit("missingKey",j,l,S,h)};this.options.saveMissing&&(this.options.saveMissingPlurals&&x?Y.forEach(j=>{const S=this.pluralResolver.getSuffixes(j,n);C&&n[`defaultValue${this.options.pluralSeparator}zero`]&&S.indexOf(`${this.options.pluralSeparator}zero`)<0&&S.push(`${this.options.pluralSeparator}zero`),S.forEach(ie=>{$([j],a+ie,n[`defaultValue${ie}`]||k)})}):$(Y,a,k))}h=this.extendTranslation(h,t,n,d,r),L&&h===a&&this.options.appendNamespaceToMissingKey&&(h=`${l}:${a}`),(L||N)&&this.options.parseMissingKeyHandler&&(h=this.options.parseMissingKeyHandler(this.options.appendNamespaceToMissingKey?`${l}:${a}`:a,N?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=de(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&&!de(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=de(s)?[s]:s;return t!=null&&l?.length&&r.applyPostProcessor!==!1&&(t=ep.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 de(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&&!de(n.count),f=h&&!n.ordinal&&n.count===0,m=n.context!==void 0&&(de(n.context)||typeof n.context=="number")&&n.context!=="",p=n.lngs?n.lngs:this.languageUtils.toResolveHierarchy(n.lng||this.language,n.fallbackLng);d.forEach(y=>{this.isValidLookup(r)||(s=y,!vu[`${p[0]}-${y}`]&&this.utils?.hasLoadedNamespace&&!this.utils?.hasLoadedNamespace(s)&&(vu[`${p[0]}-${y}`]=!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(b=>{if(this.isValidLookup(r))return;a=b;const x=[u];if(this.i18nFormat?.addLookupKeys)this.i18nFormat.addLookupKeys(x,u,b,y,n);else{let T;h&&(T=this.pluralResolver.getSuffix(b,n.count,n));const I=`${this.options.pluralSeparator}zero`,C=`${this.options.pluralSeparator}ordinal${this.options.pluralSeparator}`;if(h&&(x.push(u+T),n.ordinal&&T.indexOf(C)===0&&x.push(u+T.replace(C,this.options.pluralSeparator)),f&&x.push(u+I)),m){const k=`${u}${this.options.contextSeparator}${n.context}`;x.push(k),h&&(x.push(k+T),n.ordinal&&T.indexOf(C)===0&&x.push(k+T.replace(C,this.options.pluralSeparator)),f&&x.push(k+I))}}let w;for(;w=x.pop();)this.isValidLookup(r)||(o=w,r=this.getResource(b,y,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&&!de(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 xu{constructor(t){this.options=t,this.supportedLngs=this.options.supportedLngs||!1,this.logger=Wt.create("languageUtils")}getScriptPartFromCode(t){if(t=Ji(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=Ji(t),!t||t.indexOf("-")<0)return t;const n=t.split("-");return this.formatLanguageCode(n[0])}formatLanguageCode(t){if(de(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)),de(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 de(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))):de(t)&&o(this.formatLanguageCode(t)),r.forEach(a=>{i.indexOf(a)<0&&o(this.formatLanguageCode(a))}),i}}const wu={zero:0,one:1,two:2,few:3,many:4,other:5},ku={select:e=>e===1?"one":"other",resolvedOptions:()=>({pluralCategories:["one","other"]})};class WT{constructor(t){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};this.languageUtils=t,this.options=n,this.logger=Wt.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=Ji(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!"),ku;if(!t.match(/-|_/))return ku;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)=>wu[i]-wu[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 Su=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=FT(e,t,n);return!o&&i&&de(n)&&(o=Ka(e,n,r),o===void 0&&(o=Ka(t,n,r))),o},ra=e=>e.replace(/\$/g,"$$$$");class qT{constructor(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};this.logger=Wt.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:y,maxReplaces:b,alwaysFormat:x}=t.interpolation;this.escape=n!==void 0?n:BT,this.escapeValue=r!==void 0?r:!0,this.useRawValueToEscape=i!==void 0?i:!1,this.prefix=o?ar(o):a||"{{",this.suffix=s?ar(s):l||"}}",this.formatSeparator=c||",",this.unescapePrefix=u?"":d||"-",this.unescapeSuffix=this.unescapePrefix?"":u||"",this.nestingPrefix=h?ar(h):f||ar("$t("),this.nestingSuffix=m?ar(m):p||ar(")"),this.nestingOptionsSeparator=y||",",this.maxReplaces=b||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 b=Su(n,l,f,this.options.keySeparator,this.options.ignoreJSONStructure);return this.alwaysFormat?this.format(b,void 0,r,{...i,...n,interpolationkey:f}):b}const m=f.split(this.formatSeparator),p=m.shift().trim(),y=m.join(this.formatSeparator).trim();return this.format(Su(n,l,p,this.options.keySeparator,this.options.ignoreJSONStructure),y,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=>ra(f)},{regex:this.regexp,safeValue:f=>this.escapeValue?ra(this.escape(f)):ra(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 y=u(t,o,i);a=de(y)?y:""}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!de(a)&&!this.useRawValueToEscape&&(a=hu(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&&!de(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&&!de(o))return o;de(o)||(o=hu(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 GT=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}},sr=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(Ji(r),i),t[a]=s),s(n)}};class YT{constructor(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};this.logger=Wt.create("formatter"),this.options=t,this.formats={number:sr((n,r)=>{const i=new Intl.NumberFormat(n,{...r});return o=>i.format(o)}),currency:sr((n,r)=>{const i=new Intl.NumberFormat(n,{...r,style:"currency"});return o=>i.format(o)}),datetime:sr((n,r)=>{const i=new Intl.DateTimeFormat(n,{...r});return o=>i.format(o)}),relativetime:sr((n,r)=>{const i=new Intl.RelativeTimeFormat(n,{...r});return o=>i.format(o,r.range||"day")}),list:sr((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()]=sr(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}=GT(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 QT=(e,t)=>{e.pending[t]!==void 0&&(delete e.pending[t],e.pendingCount--)};class XT extends Co{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=Wt.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=>{jT(l.loaded,[o],a),QT(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();de(t)&&(t=this.languageUtils.toResolveHierarchy(t)),de(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 Eu=()=>({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]),de(e[1])&&(t.defaultValue=e[1]),de(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}}),Cu=e=>(de(e.ns)&&(e.ns=[e.ns]),de(e.fallbackLng)&&(e.fallbackLng=[e.fallbackLng]),de(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),Ci=()=>{},JT=e=>{Object.getOwnPropertyNames(Object.getPrototypeOf(e)).forEach(n=>{typeof e[n]=="function"&&(e[n]=e[n].bind(e))})};class Zr extends Co{constructor(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},n=arguments.length>1?arguments[1]:void 0;if(super(),this.options=Cu(t),this.services={},this.logger=Wt,this.modules={external:[]},JT(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&&(de(n.ns)?n.defaultNS=n.ns:n.ns.indexOf("translation")<0&&(n.defaultNS=n.ns[0]));const i=Eu();this.options={...i,...this.options,...Cu(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?Wt.init(o(this.modules.logger),this.options):Wt.init(null,this.options);let u;this.modules.formatter?u=this.modules.formatter:u=YT;const d=new xu(this.options);this.store=new yu(this.options.resources,this.options);const h=this.services;h.logger=Wt,h.resourceStore=this.store,h.languageUtils=d,h.pluralResolver=new WT(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 qT(this.options),h.utils={hasLoadedNamespace:this.hasLoadedNamespace.bind(this)},h.backendConnector=new XT(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),y=1;y<m;y++)p[y-1]=arguments[y];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 eo(this.services,this.options),this.translator.on("*",function(f){for(var m=arguments.length,p=new Array(m>1?m-1:0),y=1;y<m;y++)p[y-1]=arguments[y];t.emit(f,...p)}),this.modules.external.forEach(f=>{f.init&&f.init(this)})}if(this.format=this.options.interpolation.format,r||(r=Ci),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=Hr(),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]:Ci;const i=de(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=Hr();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=Ci),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"&&ep.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=Hr();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=de(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 de(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=Hr();return this.options.ns?(de(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=Hr();de(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 xu(Eu());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 Zr(t,n)}cloneInstance(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:Ci;const r=t.forkResourceStore;r&&delete t.forkResourceStore;const i={...this.options,...t,isClone:!0},o=new Zr(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 yu(s,i),o.services.resourceStore=o.store}return o.translator=new eo(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 Je=Zr.createInstance();Je.createInstance=Zr.createInstance;Je.createInstance;Je.dir;Je.init;Je.loadResources;Je.reloadResources;Je.use;Je.changeLanguage;Je.getFixedT;Je.t;Je.exists;Je.setDefaultNamespace;Je.hasLoadedNamespace;Je.loadNamespaces;Je.loadLanguages;function ZT(e,t){var n=typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=eR(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.
198
+ 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 eR(e,t){if(e){if(typeof e=="string")return Au(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)?Au(e,t):void 0}}function Au(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 Wa(e){"@babel/helpers - typeof";return Wa=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},Wa(e)}var tp=["__proto__","constructor","prototype"];function np(e){return!(typeof e!="string"||e.length===0||e.length>128||tp.indexOf(e)>-1||e.indexOf("..")>-1||e.indexOf("\\")>-1||/[?#%\s@]/.test(e)||/[\x00-\x1F\x7F]/.test(e))}function rp(e){return!(!np(e)||e.indexOf("/")>-1)}function tR(e){return np(e)}var nR={lng:rp,ns:tR};function Ai(e){return typeof e!="string"?e:e.replace(/[\r\n\x00-\x1F\x7F]/g," ")}function rR(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 ip(){return typeof XMLHttpRequest=="function"||(typeof XMLHttpRequest>"u"?"undefined":Wa(XMLHttpRequest))==="object"}function iR(e){return!!e&&typeof e.then=="function"}function oR(e){return iR(e)?e:Promise.resolve(e)}var aR=/\{\{(.+?)\}\}/g;function Tu(e,t){var n=!1,r=e.replace(aR,function(i,o){var a=o.trim();if(tp.indexOf(a)>-1)return i;var s=t[a];if(s==null)return i;var l=nR[a]||rp,c=String(s).split("+"),u=ZT(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 Ru(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 Pu(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?Ru(Object(n),!0).forEach(function(r){sR(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Ru(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function sR(e,t,n){return(t=lR(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function lR(e){var t=cR(e,"string");return qn(t)=="symbol"?t:t+""}function cR(e,t){if(qn(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(qn(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function qn(e){"@babel/helpers - typeof";return qn=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},qn(e)}var xn=typeof fetch=="function"?fetch:void 0;typeof global<"u"&&global.fetch?xn=global.fetch:typeof window<"u"&&window.fetch&&(xn=window.fetch);var ei;ip()&&(typeof global<"u"&&global.XMLHttpRequest?ei=global.XMLHttpRequest:typeof window<"u"&&window.XMLHttpRequest&&(ei=window.XMLHttpRequest));var to;typeof ActiveXObject=="function"&&(typeof global<"u"&&global.ActiveXObject?to=global.ActiveXObject:typeof window<"u"&&window.ActiveXObject&&(to=window.ActiveXObject));typeof xn!="function"&&(xn=void 0);if(!xn&&!ei&&!to)try{he(()=>import("./browser-ponyfill-DBWdeCTC.js").then(e=>e.b),__vite__mapDeps([87,1])).then(function(e){xn=e.default}).catch(function(){})}catch{}var op=["__proto__","constructor","prototype"],qa=function(t,n){if(n&&qn(n)==="object"){for(var r="",i=0,o=Object.keys(n);i<o.length;i++){var a=o[i];op.indexOf(a)>-1||(r+="&"+encodeURIComponent(a)+"="+encodeURIComponent(n[a]))}if(!r)return t;t=t+(t.indexOf("?")!==-1?"&":"?")+r.slice(1)}return t},Iu=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):xn(t,n).then(o).catch(r)},uR=function(t,n,r,i){t.queryStringParams&&(n=qa(n,t.queryStringParams));var o=Pu({},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=Pu({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{Iu(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]}),Iu(n,s,i,l),t._omitFetchOptions=!0}catch(u){i(u)}}},dR=function(t,n,r,i){r&&qn(r)==="object"&&(r=qa("",r).slice(1)),t.queryStringParams&&(n=qa(n,t.queryStringParams));try{var o=ei?new ei:new to("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];op.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)}},fR=function(t,n,r,i){if(typeof r=="function"&&(i=r,r=void 0),i=i||function(){},xn&&n.indexOf("file:")!==0)return uR(t,n,r,i);if(ip()||typeof ActiveXObject=="function")return dR(t,n,r,i);i(new Error("No fetch and no xhr implementation found!"))};function gr(e){"@babel/helpers - typeof";return gr=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},gr(e)}function Lu(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 ia(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?Lu(Object(n),!0).forEach(function(r){ap(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Lu(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function hR(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function pR(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,sp(r.key),r)}}function mR(e,t,n){return t&&pR(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function ap(e,t,n){return(t=sp(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function sp(e){var t=gR(e,"string");return gr(t)=="symbol"?t:t+""}function gR(e,t){if(gr(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(gr(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}var yR=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 ap({},r,i||"")},parseLoadPayload:function(n,r){},request:fR,reloadInterval:typeof window<"u"?!1:60*60*1e3,customHeaders:{},queryStringParams:{},crossDomain:!1,withCredentials:!1,overrideMimeType:!1,requestOptions:{mode:"cors",credentials:"same-origin",cache:"default"}}},lp=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]:{};hR(this,e),this.services=t,this.options=n,this.allOptions=r,this.type="backend",this.init(t,n,r)}return mR(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=ia(ia(ia({},yR()),this.options||{}),i),this.allOptions=o,this.services&&this.options.reloadInterval){var a=setInterval(function(){return r.reload()},this.options.reloadInterval);gr(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=oR(l),l.then(function(c){if(!c)return a(null,{});var u=Tu(c,{lng:n.join("+"),ns:i.join("+")});if(u==null){var d=n.map(Ai).join(", "),h=i.map(Ai).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=Ai(rR(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(b){return f.indexOf(b)>-1});if(m)return r("failed loading "+u+": "+Ai(d.message),!0)}if(d)return r(d,!1);var p,y;try{typeof h.data=="string"?p=a.options.parse(h.data,i,o):p=h.data}catch{y="failed parsing "+u+" to json"}if(y)return r(y,!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=Tu(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,y){c+=1,u.push(p),d.push(y),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)})})})}}}])}();lp.type="backend";const vR="Agim",bR={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"},xR={loading:"Loading…",empty:"No data",saving:"Saving…",saved:"Saved",error:"Something went wrong"},wR={label:"Theme",system:"System",light:"Light",dark:"Dark",cycleHint:"Click to cycle theme"},kR={label:"Language",en:"English",zh:"中文"},SR={chat:"Chat",tasks:"Tasks",approvals:"Approvals",reminders:"Reminders",memos:"Memos",memory:"Memory",skills:"Skills",workspace:"Workspace",observability:"Observability",settings:"Settings"},ER={deleteTitle:"Delete this item?",deleteDescription:"This cannot be undone.",destructiveAction:"Delete"},CR={label:"Pagination",perPage:"Per page",firstPage:"First page",lastPage:"Last page",pageOfTotal:"Page {{page}} of {{totalPages}}",range:"{{from}}–{{to}} of {{total}}"},AR={selectAll:"Select all rows",selectRow:"Select row"},TR={intro:"Paste your access token from ~/.agim/tokens.json or `agim token list`.",tokenLabel:"Access token",submit:"Sign in",hint:"Loopback (127.0.0.1) requests bypass this page; you only land here from another host or with IMHUB_TRUST_LOOPBACK=off."},RR={placeholder:"Signed in. The chat surface ships in PR-6; this route is intentionally blank for now.",healthCheck:"Backend reachable"},PR={title:"Nothing here.",description:"The page you're looking for doesn't exist."},IR={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"},LR={send:"Send",streaming:"… streaming",notConnected:"Not connected. Reconnecting…",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.",inputPlaceholder:"Message… (Enter sends, Shift+Enter newlines)",newConv:"New",newConvHint:"Clear messages and start a fresh session",newConvToast:"Started a new conversation",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",outcome:{allowed:"✅ Allowed",allowedPinned:"✅ Allowed + auto-allow further",denied:"❌ Denied",deniedRevoked:"❌ Denied (auto-allow revoked)",expired:"⏱ Timed out"}},OR={appName:vR,actions:bR,states:xR,theme:wR,lang:kR,nav:SR,confirm:ER,pagination:CR,table:AR,login:TR,home:RR,notFound:PR,errorBoundary:IR,chat:LR},_R="Agim",NR={refresh:"刷新",save:"保存",cancel:"取消",delete:"删除",edit:"编辑",submit:"提交",close:"关闭",back:"返回",next:"下一页",previous:"上一页",create:"新建",search:"搜索",retry:"重试",confirm:"确定"},DR={loading:"加载中…",empty:"暂无数据",saving:"保存中…",saved:"已保存",error:"出错了"},MR={label:"主题",system:"跟随系统",light:"浅色",dark:"深色",cycleHint:"点击切换主题"},jR={label:"语言",en:"English",zh:"中文"},FR={chat:"对话",tasks:"任务",approvals:"审批",reminders:"提醒",memos:"备忘",memory:"记忆",skills:"技能",workspace:"工作区",observability:"观测",settings:"设置"},HR={deleteTitle:"确认删除?",deleteDescription:"操作不可撤销。",destructiveAction:"删除"},BR={label:"分页",perPage:"每页",firstPage:"首页",lastPage:"末页",pageOfTotal:"第 {{page}} / {{totalPages}} 页",range:"{{from}}–{{to}} / 共 {{total}}"},UR={selectAll:"全选",selectRow:"选中此行"},zR={intro:"粘贴 ~/.agim/tokens.json 里的访问令牌(或运行 `agim token list` 查看)。",tokenLabel:"访问令牌",submit:"登录",hint:"loopback(127.0.0.1)的请求会跳过此页;只有跨机访问或设置了 IMHUB_TRUST_LOOPBACK=off 时才会看到此页。"},$R={placeholder:"已登录。聊天界面将在 PR-6 落地;当前页暂为占位。",healthCheck:"后端可达"},VR={title:"什么也没找到。",description:"你要找的页面不存在。"},KR={title:"出错了。",description:"页面渲染过程中遇到了未预期的错误。可以尝试刷新或返回主页;若问题反复出现,请复制下方错误信息反馈。",reload:"刷新",home:"返回主页"},WR={send:"发送",streaming:"… 接收中",notConnected:"未连接,正在重连…",connecting:"正在连接 agim…",disconnected:"已断开,自动重连中;可以继续输入。",welcomeTitle:"开始对话",welcomeBody:"输入消息向当前 Agent 提问。点上方下拉可切换 Agent。",inputPlaceholder:"输入消息……(Enter 发送,Shift+Enter 换行)",newConv:"新对话",newConvHint:"清空消息并开启新会话",newConvToast:"已开启新对话",approvalTitle:"🔐 工具授权",approvalAutoBadge:"自动放行",approvalAutoIn:"{{count}} 秒后自动放行 — 点「拒绝」可中止。",approvalAutoResolving:"正在自动放行…",approvalToolLabel:"工具",approvalInputLabel:"输入",approvalAllow:"批准",approvalAuto:"本类自动放行",approvalAutoTip:"批准并对本会话内同类调用自动放行",approvalDeny:"拒绝",outcome:{allowed:"✅ 已批准",allowedPinned:"✅ 已批准 · 后续同类自动放行",denied:"❌ 已拒绝",deniedRevoked:"❌ 已拒绝(撤销自动放行)",expired:"⏱ 已超时"}},qR={appName:_R,actions:NR,states:DR,theme:MR,lang:jR,nav:FR,confirm:HR,pagination:BR,table:UR,login:zR,home:$R,notFound:VR,errorBoundary:KR,chat:WR},GR="Couldn't reach the server. Check your connection and retry.",YR="Your session expired. Please sign in again.",QR="Sign-in required.",XR="Auth token missing from request.",JR="Auth subsystem isn't ready yet. Retry in a moment.",ZR="You don't have permission to do that.",eP="The requested resource wasn't found.",tP="That request is too big — try splitting it.",nP="The server rejected the request: {{detail}}",rP="Request body wasn't valid JSON.",iP="Configuration didn't validate. Check the form fields.",oP="Couldn't save configuration: {{detail}}",aP="Send an `updates` object to change env values.",sP="None of the keys you sent are editable.",lP="SMTP isn't configured. Save host / user / password first.",cP="SMTP verify failed: {{detail}}",uP="Provide a baseUrl to discover ACP agents.",dP="Provide an `endpoint` to test the agent.",fP="ACP discovery failed: {{detail}}",hP="ACP agent test failed: {{detail}}",pP="A user_key (platform:userId) is required.",mP="Something went wrong (code {{code}}).",gP="Bad request.",yP="Sign-in required.",vP="Forbidden.",bP="Not found.",xP="Conflict — refresh and try again.",wP="Request too large.",kP="Server error.",SP="Gateway error.",EP="Service unavailable.",CP="Gateway timeout.",AP={NETWORK:GR,AUTH_INVALID:YR,AUTH_REQUIRED:QR,AUTH_TOKEN_REQUIRED:XR,AUTH_NOT_READY:JR,FORBIDDEN:ZR,NOT_FOUND:eP,PAYLOAD_TOO_LARGE:tP,VALIDATION:nP,INVALID_JSON_BODY:rP,CONFIG_INVALID:iP,CONFIG_SAVE_FAILED:oP,ENV_UPDATES_REQUIRED:aP,ENV_NO_EDITABLE_KEYS:sP,EMAIL_NOT_CONFIGURED:lP,EMAIL_VERIFY_FAILED:cP,ACP_BASEURL_REQUIRED:uP,ACP_ENDPOINT_REQUIRED:dP,ACP_DISCOVER_FAILED:fP,ACP_TEST_FAILED:hP,MEMORY_USER_KEY_REQUIRED:pP,UNKNOWN:mP,HTTP_400:gP,HTTP_401:yP,HTTP_403:vP,HTTP_404:bP,HTTP_409:xP,HTTP_413:wP,HTTP_500:kP,HTTP_502:SP,HTTP_503:EP,HTTP_504:CP},TP="无法访问服务器,请检查网络后重试。",RP="登录状态已过期,请重新登录。",PP="请先登录。",IP="请求缺少 auth token。",LP="鉴权子系统尚未就绪,请稍后重试。",OP="没有执行该操作的权限。",_P="请求的资源不存在。",NP="请求体过大,请拆分后重试。",DP="服务端拒绝了请求:{{detail}}",MP="请求体不是合法的 JSON。",jP="配置校验失败,请检查表单字段。",FP="保存配置失败:{{detail}}",HP="请在请求体中提供 `updates` 对象以修改 env。",BP="请求里的 key 均不可编辑。",UP="SMTP 未配置,请先保存 host / user / password。",zP="SMTP 连接测试失败:{{detail}}",$P="需要 baseUrl 才能发现 ACP Agent。",VP="需要 `endpoint` 才能测试该 Agent。",KP="ACP 发现失败:{{detail}}",WP="ACP Agent 测试失败:{{detail}}",qP="需要 user_key(形如 `platform:userId`)。",GP="出错了 (code {{code}})。",YP="请求格式不正确。",QP="请先登录。",XP="没有权限。",JP="未找到。",ZP="状态冲突,请刷新后重试。",eI="请求体过大。",tI="服务端出错。",nI="网关错误。",rI="服务暂不可用。",iI="网关超时。",oI={NETWORK:TP,AUTH_INVALID:RP,AUTH_REQUIRED:PP,AUTH_TOKEN_REQUIRED:IP,AUTH_NOT_READY:LP,FORBIDDEN:OP,NOT_FOUND:_P,PAYLOAD_TOO_LARGE:NP,VALIDATION:DP,INVALID_JSON_BODY:MP,CONFIG_INVALID:jP,CONFIG_SAVE_FAILED:FP,ENV_UPDATES_REQUIRED:HP,ENV_NO_EDITABLE_KEYS:BP,EMAIL_NOT_CONFIGURED:UP,EMAIL_VERIFY_FAILED:zP,ACP_BASEURL_REQUIRED:$P,ACP_ENDPOINT_REQUIRED:VP,ACP_DISCOVER_FAILED:KP,ACP_TEST_FAILED:WP,MEMORY_USER_KEY_REQUIRED:qP,UNKNOWN:GP,HTTP_400:YP,HTTP_401:QP,HTTP_403:XP,HTTP_404:JP,HTTP_409:ZP,HTTP_413:eI,HTTP_500:tI,HTTP_502:nI,HTTP_503:rI,HTTP_504:iI},aI="Tasks",sI={jobs:"Jobs",subtasks:"Subtasks",bgjobs:"Background",schedules:"Schedules",outbox:"Outbox",a2a:"Agent ↔ Agent",heartbeat:"Heartbeat",goals:"Goals",asks:"Ask User",plans:"Plans"},lI={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"}},cI={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"}},uI={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 IMHUB_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:"—"},dI={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"},fI={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."}},hI={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"}},pI={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:"enabled binding",disabledToast:"disabled binding",justNow:"just now",minutesAgo:"{{count}}m ago",hoursAgo:"{{count}}h ago",daysAgo:"{{count}}d ago",intervalMin:"{{count}}m"},mI={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",body:"Body",recentProgress:"Recent progress (latest {{count}})",created:"created {{at}}",closed:"closed {{at}}",statusUpdated:"Goal {{status}}"},gI={title:"Pending ask_user",subtitle:"Live list of every mcp__imhub__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"},yI={pageTitle:aI,subnav:sI,jobs:lI,subtasks:cI,bgjobs:uI,schedules:dI,outbox:fI,a2a:hI,heartbeat:pI,goals:mI,asks:gI},vI="任务",bI={jobs:"作业",subtasks:"子任务",bgjobs:"后台脚本",schedules:"定时任务",outbox:"投递队列",a2a:"Agent 互调",heartbeat:"心跳",goals:"目标",asks:"待回答",plans:"Plan 审计"},xI={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:"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:"● 离线"}},wI={title:"子任务",subtitle:"由父 Agent 在对话内派发出的子任务列表。",empty:{title:"暂无子任务",description:"当 Agent 在聊天线程内向其他 Agent 委派工作时,子任务会出现在这里。"},filter:{agent:"父 Agent",agentAny:"全部 Agent"},col:{id:"ID",agent:"Agent",prompt:"Prompt",status:"状态",parent:"父级",platform:"平台",createdAt:"创建时间"},status:{pending:"等待中",running:"运行中",completed:"已完成",failed:"失败",cancelled:"已取消"}},kI={title:"后台脚本",subtitle:"Agent 封装(Claude Code / opencode / codex)通过 bgjob 启动的长任务进程。",empty:{title:"暂无后台脚本",description:"当 Agent 使用其 bgjob 封装时,记录会在这里出现。Root 路径默认取 ~/.claude/bgjobs/、~/.config/opencode/bgjobs/、~/.codex/bgjobs/(可通过 IMHUB_BGJOB_ROOTS 覆盖)。"},filter:{root:"Root",rootAny:"全部 Root"},col:{name:"名称",status:"状态",root:"Root",pid:"PID",startedAt:"开始时间",endedAt:"结束时间",exit:"退出码"},exitOk:"ok",stillRunning:"—"},SI={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:"关"},EI={title:"投递队列",subtitle:"面向 IM 平台的待投递消息队列。瞬态失败会自动重试;不可恢复的会停在 giving_up。",empty:{title:"投递队列为空",description:"消息成功投递后会被删除。如果这里非空,说明队列正在刷出消息,或某条消息卡住了。"},filter:{status:"状态",statusAny:"全部状态",thread:"Thread 标识"},stats:{pending:"待发送",giving_up:"放弃中",delivered:"已投递(累计)",lastDelivered:"最近投递"},col:{id:"ID",status:"状态",platform:"平台",preview:"内容",thread:"Thread",kind:"类型",attempts:"尝试次数",createdAt:"创建时间",lastError:"最后错误",jobId:"Job"},status:{pending:"待发送",delivered:"已投递",giving_up:"放弃中"},action:{retry:"重试",confirmRetry:"重新入队这条投递?",confirmRetryDesc:"状态会切回 pending,发送器会在下一轮 tick 再次尝试投递。"}},CI={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:"Prompt",createdAt:"创建时间"}},AI={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}} 分钟"},TI={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:"取消",body:"正文",recentProgress:"最近进度(最新 {{count}} 条)",created:"创建于 {{at}}",closed:"关闭于 {{at}}",statusUpdated:"目标已{{status}}"},RI={title:"待回答 ask_user",subtitle:"所有等待回复的 mcp__imhub__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}} 小时"},PI={pageTitle:vI,subnav:bI,jobs:xI,subtasks:wI,bgjobs:kI,schedules:SI,outbox:EI,a2a:CI,heartbeat:AI,goals:TI,asks:RI},II="Approvals",LI="Pending tool invocations the agent is asking permission for.",OI={connected:"● Live",connecting:"● Connecting",reconnecting:"● Reconnecting",closed:"● Offline"},_I={pending:"Pending",totalAllowed:"Total allowed",totalDenied:"Total denied",totalTimedOut:"Timed out",totalReadonly:"Read-only auto-allowed"},NI={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."},DI="Thread",MI="auto-allow",jI="Backend auto-allowed this read-only tool; the card is shown for visibility only.",FI="Allow",HI="Deny",BI={allowedShort:"Allowed",deniedShort:"Denied"},UI={pageTitle:II,subtitle:LI,live:OI,stats:_I,empty:NI,threadLabel:DI,autoAllowedTag:MI,autoAllowedTitle:jI,allow:FI,deny:HI,toast:BI},zI="审批",$I="Agent 等待批准的工具调用。",VI={connected:"● 实时",connecting:"● 连接中",reconnecting:"● 重连中",closed:"● 离线"},KI={pending:"待审批",totalAllowed:"累计放行",totalDenied:"累计拒绝",totalTimedOut:"超时",totalReadonly:"只读自动放行"},WI={title:"暂无待审批请求",description:"队列为空。当 Agent 调用尚未加入白名单的工具时,请求会在这里出现。"},qI="Thread",GI="自动放行",YI="后端已对该只读工具自动放行;此处仅供可见性展示。",QI="放行",XI="拒绝",JI={allowedShort:"已放行",deniedShort:"已拒绝"},ZI={pageTitle:zI,subtitle:$I,live:VI,stats:KI,empty:WI,threadLabel:qI,autoAllowedTag:GI,autoAllowedTitle:YI,allow:QI,deny:XI,toast:JI},eL="Reminders",tL="Queued reminders waiting to fire. Cancel or snooze pending ones; fired and cancelled rows are kept for audit.",nL={status:"Status",statusAny:"Any status"},rL={pending:"Pending",firing:"Firing",fired:"Fired",cancelled:"Cancelled",failed:"Failed"},iL={slash:"/remind",mcp:"MCP",api:"API"},oL={literal:"Literal",llm:"LLM"},aL={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."},sL={id:"ID",fireAt:"Fires",text:"Text",status:"Status",platform:"Platform",thread:"Thread",source:"Source",recurrence:"Recurrence",createdAt:"Created"},lL={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."},cL={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}}"},uL={cancelled:"Reminder cancelled"},dL={pageTitle:eL,subtitle:tL,filter:nL,status:rL,source:iL,promptMode:oL,empty:aL,col:sL,action:lL,snooze:cL,toast:uL},fL="提醒",hL="排队待触发的提醒。可对 pending 的提醒做取消 / 延后;已触发与已取消的记录保留以备审计。",pL={status:"状态",statusAny:"全部状态"},mL={pending:"等待中",firing:"触发中",fired:"已触发",cancelled:"已取消",failed:"失败"},gL={slash:"/remind",mcp:"MCP",api:"API"},yL={literal:"原文",llm:"LLM"},vL={title:"暂无提醒",description:"当 Agent 通过 /remind、MCP 或 API 创建提醒时,记录会出现在这里。可切换状态查看已触发或已取消的记录。"},bL={id:"ID",fireAt:"触发时间",text:"内容",status:"状态",platform:"平台",thread:"Thread",source:"来源",recurrence:"周期",createdAt:"创建时间"},xL={cancel:"取消",snooze:"延后",confirmCancel:"确认取消这条提醒?",confirmCancelDesc:"该提醒会被移出队列。周期提醒在未重新创建前不会再触发。"},wL={title:"延后提醒",description:"延后多久?",preset5m:"5 分钟",preset30m:"30 分钟",preset1h:"1 小时",preset1d:"1 天",submit:"确认延后",toastOk:"已延后 {{duration}}"},kL={cancelled:"已取消"},SL={pageTitle:fL,subtitle:hL,filter:pL,status:mL,source:gL,promptMode:yL,empty:vL,col:bL,action:xL,snooze:wL,toast:kL},EL="Memos",CL="Long-term notes the operator captured for the agent — searchable by content, person, or location.",AL={placeholder:"Search memos…",who:"Who",what:"What",hasLocation:"Has location",includeExpired:"Include expired"},TL={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."},RL={id:"ID",what:"What",who:"Who",when:"When",where:"Where",platform:"Platform",createdAt:"Created",expiresAt:"Expires"},PL={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."},IL={label:"Open map",baidu:"Baidu Maps",apple:"Apple Maps",google:"Google Maps",osm:"OpenStreetMap"},LL={deleted:"Memo deleted"},OL={pageTitle:EL,subtitle:CL,search:AL,empty:TL,col:RL,action:PL,openMap:IL,toast:LL},_L="备忘",NL="操作员为 Agent 记下的长期备忘 — 可按内容、人物、地点检索。",DL={placeholder:"搜索备忘…",who:"谁",what:"做什么",hasLocation:"含位置",includeExpired:"包含过期"},ML={title:"未匹配到备忘",description:"备忘通过聊天中的 `/memo` 命令或记忆子系统自动抽取生成。可清空筛选或放宽搜索条件再试。"},jL={id:"ID",what:"事项",who:"对象",when:"时间",where:"地点",platform:"平台",createdAt:"创建时间",expiresAt:"过期时间"},FL={delete:"删除",confirmDelete:"确认删除此备忘?",confirmDeleteDesc:"操作不可撤销。记忆子系统中由此备忘衍生的 embedding 在下一次 backfill 清理前仍会保留。"},HL={label:"在地图中打开",baidu:"百度地图",apple:"Apple 地图",google:"Google 地图",osm:"OpenStreetMap"},BL={deleted:"已删除"},UL={pageTitle:_L,subtitle:NL,search:DL,empty:ML,col:jL,action:FL,openMap:HL,toast:BL},zL="Memory",$L="Per-user facts the agent has accumulated. Long-term memory that survives session resets.",VL={label:"User",placeholder:"Pick a user",factsLabel:"{{count}} facts",personaTag:"persona"},KL={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."},WL={facts:"Facts",persona:"Persona",vector:"Vector",skills:"Skills"},qL={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"}},GL={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"}},YL={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 `IMHUB_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"}}},QL={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"}},XL={pageTitle:zL,subtitle:$L,userPicker:VL,noUserSelected:KL,tabs:WL,facts:qL,persona:GL,vector:YL,skills:QL},JL="记忆",ZL="Agent 为每个用户积累的事实库。跨会话保留的长期记忆。",eO={label:"用户",placeholder:"选择一个用户",factsLabel:"{{count}} 条事实",personaTag:"persona"},tO={title:"选择一个用户查看其记忆",description:"记忆按 user_key(platform:userId)分隔。上方下拉列出每位在库中有任何记忆数据的用户。"},nO={facts:"事实",persona:"Persona",vector:"向量",skills:"技能"},rO={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}} 条"}},iO={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"}},oO={title:"向量后端",subtitle:"Embedding 驱动事实库的混合检索。当前后端、模型与每位用户的覆盖情况都在这里。",config:{title:"后端配置",hint:"后端选择与 OpenAI / 本地模型的参数都通过环境变量配置。请在宿主机直接编辑 `~/.agim/env`(或 systemd unit 的 `Environment=`),下方列出的 `IMHUB_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:"失败"}}},aO={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:"可用于"}},sO={pageTitle:JL,subtitle:ZL,userPicker:eO,noUserSelected:tO,tabs:nO,facts:rO,persona:iO,vector:oO,skills:aO},lO="Skills",cO={installed:"Installed",hot:"Hot on skillhub.cn"},uO={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"}},dO={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:{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."}},fO={pageTitle:lO,subnav:cO,installed:uO,hot:dO},hO="技能",pO={installed:"已安装",hot:"skillhub.cn 热门"},mO={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:"可用于"}},gO={title:"skillhub.cn 热门",subtitle:"实时拉取 skillhub.cn 热门下载(服务端 5 分钟缓存)。点击任意条目查看安装命令。agim 不会自动跑安装——命令复制后由你贴去 shell 或 IM 触发。",openHub:"前往 skillhub.cn",loading:"正在加载…",empty:"暂无数据",cached:"缓存命中",stale:"上游不可达,使用旧数据",updatedAt:"更新于 {{at}}",col:{slug:"slug",name:"名称 / 描述",stars:"stars",installs:"installs"},detail:{version:"版本",category:"类别",stars:"stars",installs:"installs",downloads:"downloads",howInstall:"安装方式(任选一个;agim 不会自动跑)",copy:"复制",copied:"已复制",label:{cliInstall:"Host 上跑(推荐)",cliSearch:"先查再装",imAsk:"在 IM 里让 agent 装"},hint:"前两条要先在 host 上安装 skillhub CLI。详见 docs/skills.md 或 skillhub.cn。"}},yO={pageTitle:hO,subnav:pO,installed:mO,hot:gO},vO="Workspace",bO="Read and edit files in the per-agent working directories (`AGENT_CWD`).",xO={label:"Agent",placeholder:"Pick an agent",online:"online",offline:"offline"},wO={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."},kO={title:"Files",loading:"Loading…",empty:"(empty directory)",up:"Up",rootLabel:"(workspace root)",binary:"binary",symlinkEscape:"symlink → outside workspace, hidden",broken:"unreadable"},SO={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.",save:"Save",saving:"Saving…",savedMeta:"Saved · {{size}} bytes · {{at}}",dirtyHint:"Unsaved changes",loadFailed:"Failed to load file"},EO={saved:"Saved {{path}}"},CO={pageTitle:vO,subtitle:bO,agentPicker:xO,noAgent:wO,tree:kO,editor:SO,toast:EO},AO="工作区",TO="在每个 Agent 的工作目录(`AGENT_CWD`)下浏览与编辑文件。",RO={label:"Agent",placeholder:"选择一个 Agent",online:"在线",offline:"离线"},PO={title:"选择一个 Agent 来浏览其工作区",description:"每个已注册的 Agent 都有自己的 CWD。下拉列出注册表中所有已知的 Agent;名字旁的绿点表示该 Agent 当前可用。"},IO={title:"文件",loading:"加载中…",empty:"(目录为空)",up:"返回上级",rootLabel:"(工作区根目录)",binary:"二进制",symlinkEscape:"符号链接指向工作区外,已隐藏",broken:"不可读"},LO={noFile:"从左侧选择一个文件查看或编辑。",binary:"该文件是二进制(base64 编码)— 不支持编辑。",truncated:"文件超过 1 MiB;仅显示前 1 MiB。直接保存会用截断内容覆盖整个文件 — 请关闭而不要保存。",save:"保存",saving:"保存中…",savedMeta:"已保存 · {{size}} 字节 · {{at}}",dirtyHint:"有未保存的修改",loadFailed:"加载文件失败"},OO={saved:"已保存 {{path}}"},_O={pageTitle:AO,subtitle:TO,agentPicker:RO,noAgent:PO,tree:IO,editor:LO,toast:OO},NO="Observability",DO="Operational health: invocation totals, top-N leaderboards, and the audit timeline.",MO={health:"Health",topn:"Top-N",audit:"Audit"},jO={label:"Window",days_one:"{{count}} day",days_other:"{{count}} days"},FO={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."}},HO={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."}},BO={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."}},UO={pageTitle:NO,subtitle:DO,tabs:MO,window:jO,health:FO,topn:HO,audit:BO},zO="观测",$O="运行健康:调用总量、Top-N 排行与审计时间线。",VO={health:"健康",topn:"Top-N",audit:"审计"},KO={label:"时间窗口",days_one:"{{count}} 天",days_other:"{{count}} 天"},WO={title:"健康",totals:"总览",byDay:"每日明细",kpi:{calls:"调用",cost:"成本",errors:"错误",errorRate:"错误率",avgLatencyMs:"平均延迟",p95LatencyMs:"P95 延迟"},byDayCol:{date:"日期",calls:"调用",cost:"成本",errors:"错误",avgLatencyMs:"平均延迟"},empty:{title:"时间窗口内无数据",description:"所选时间范围内没有任何调用记录。可以放宽时间窗口或等待 Agent 被调用。"}},qO={title:"Top-N",filter:{dim:"分组维度",metric:"排序依据"},dim:{user:"用户",agent:"Agent",platform:"平台",intent:"意图"},metric:{cost:"成本",calls:"调用",errors:"错误",avg_latency:"平均延迟"},col:{rank:"#",key:"Key",calls:"调用",cost:"成本",errors:"错误",avgLatencyMs:"平均延迟"},empty:{title:"暂无数据",description:"当前筛选下没有调用记录。"}},GO={title:"审计",stats:{total:"累计",totalCost:"累计成本"},filter:{agent:"Agent",platform:"平台",user:"用户",intent:"意图"},col:{ts:"时间",trace:"Trace",agent:"Agent",platform:"平台",user:"用户",intent:"意图",duration:"耗时",cost:"成本",outcome:"结果"},outcome:{ok:"成功",fail:"失败"},empty:{title:"暂无调用",description:"当 Agent 被调用时,审计记录会出现在这里。可调整筛选或放宽时间窗口。"}},YO={pageTitle:zO,subtitle:$O,tabs:VO,window:KO,health:WO,topn:qO,audit:GO},QO="Settings",XO="Operational configuration: environment variables and service lifecycle.",JO={messengers:"Messengers",email:"Email (SMTP)",viewer:"Viewer & Maps",agents:"Agents",llm:"LLM Backends",mcp:"MCP Servers",nativeAgent:"Native Agent",search:"Web search",mobile:"Mobile",agimSkills:"agim Skills",policy:"Policy",security:"Security",workspaces:"Workspaces",admins:"Admins",env:"Env Vars",service:"Service"},ZO={title:"Agents",subtitle:"Built-in agent adapters. Enable the ones whose CLI is installed on this host; pick which one handles unrouted messages by default. `native` is an in-process agent and needs no install.",installHint:"Not installed. `npm install -g {{pkg}}` on the host.",nativeInstallHint:"No LLM backend configured. Set one (OpenAI / DeepSeek / Anthropic / …) on the Settings → Native Agent tab and you're done.",inProcessBadge:"built-in",inProcessHint:"in-process — runs inside agim, no external CLI to install",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:"Staged. Save to persist.",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."}}},e_={title:"Policy & toggles",subtitle:"Frequently-flipped switches that operate on env values under the hood. Each toggle persists immediately; the change applies on the next service restart unless the relevant module supports hot-reload (most do).",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:"IMHUB_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:"IMHUB_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:"IMHUB_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:"IMHUB_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:"IMHUB_A2A_NOTIFY_MODE",valEssential:"Essential",valVerbose:"Verbose",valOff:"Off"}},t_={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.",saveAll:"Save all",saving:"Saving…",savedToast:"Configuration saved",discardAll:"Discard changes",dirtyHint:"Unsaved changes",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."}},n_={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"}},r_={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:"v1.2.43+: when no mode is configured, agim defaults to remote mode against viewer.iclaw.host. Check this to disable that fallback (markdown stays inline if no other mode is set).",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"}}},i_={title:"Workspaces",subtitle:"Multi-tenant workspace registry. Each workspace has its own agent whitelist, rate-limit, and (optionally) member list. The `default` workspace catches every unrouted user.",empty:{title:"Only the default workspace",description:"Add a workspace below to partition a team / project / customer. Each one gets its own agent whitelist + rate-limit."},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",form:{title:"Add or edit a workspace",subtitleEdit:"Editing existing workspace — 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:"Comma-separated; empty = allow every registered agent.",members:"Member user IDs",membersHint:"Comma-separated `platform:userId`; empty = open workspace.",rateLimit:"Rate limit (optional)",rate:"Calls",intervalSec:"Per (seconds)",burst:"Burst",submit:"Save workspace",reset:"Clear form"},toast:{saved:"Workspace saved"}},o_={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"}}},a_={title:"Security",subtitle:"Tool sandbox, SSRF block, sender allowlist, runtime audit. Changes persist to the env file immediately. Most native tools read process.env per call (hot-reload); exec sandbox + sender allowlist need a service restart to apply.",diagnostics:{title:"Runtime diagnostics",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:"Comma-separated platform:userId pairs, e.g. telegram:8754479311,wechat-ilink:wxid_abc. Set to * to mark 'everyone explicitly allowed'. Empty = open access (preserves backward compatibility; startup logs OPEN_IM_ACCESS).",envKey:"IMHUB_ALLOWED_USERS",placeholder:"platform:userId,platform:userId"},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:"fs tools default 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__imhub__call_agent invocations per turn. Prevents native from spinning on infinite delegations. 0 = unlimited.",envKey:"IMHUB_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:"IMHUB_PLATFORM_BLACKLIST",placeholder:"telegram,discord",currentLabel:"Currently in force"},diagnosticsPlatformBlacklist:"Platform blacklist",savingToast:"Saved.",resetTitle:"Reset to default"},s_={title:"Admin allowlist",subtitle:"IM-side users who can run admin-tier commands (`/admin promote`, `/admin token`, etc.). The list lives in `IMHUB_ADMIN_USERS`; this editor only works when the agim web port is bound locally.",configured:"Allowlist configured",notConfigured:"Allowlist not configured — anyone with the CLI bootstrap token can self-promote.",bootstrapAvailable:"Bootstrap token file present",bootstrapPath:"Token path",empty:"No admins added yet.",col:{platform:"Platform",userId:"User ID"},add:{title:"Add admin",platform:"Platform",userId:"User ID",submit:"Add"},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"}},l_={title:"Native LLM Backends",subtitle:"These backends power the in-process native agent and internal introspection callers (memo extraction, intent classification, notification evaluator, heartbeat). Backend metadata lives in ~/.agim/config.json; API keys live in ~/.agim/llm-secrets.json (0600) or the AGIM_LLM_SECRET_<NAME> env var.",refresh:"Refresh",backendsTitle:"Backends ({{count}})",backendsEmpty:"No LLM backends configured yet. Add one below.",rolesTitle:"Role Bindings",addTitle:"Add Backend",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",removeConfirm:'Remove backend "{{name}}"? Role bindings + API key will be cleared.',removedToast:"Removed (also cleared {{count}} role binding(s)).",roleUpdated:"Updated role {{role}}",unset:"(unset)",unbound:"(unbound)",roleHint:{cheap:"Internal introspection: memo extraction, intent classification, fallback chain stage 1.",evaluator:"Notification evaluator + router-compare judge LLM.","native-chat":"The /na agent loop default. Used when /cc native is invoked."},preset:"Provider preset",name:"Name",namePlaceholder:"e.g. deepseek-cheap",baseUrl:"Base URL",baseUrlPlaceholder:"https://api.example.com/v1",model:"Model",modelPlaceholder:"model-id",apiKeyOptional:"API Key (optional)",apiKeyPlaceholder:"sk-...",addBackend:"Add Backend",invalidPreset:"invalid preset",nameRequired:"name required",baseUrlRequired:"baseUrl required",modelRequired:"model required",addedWithKey:'Added "{{name}}" with API key',addedNoKey:'Added "{{name}}" (set key separately)',presets:{deepseek:"DeepSeek",moonshot:"Moonshot Kimi",zhipu:"Zhipu GLM",openai:"OpenAI",anthropic:"Anthropic",custom:"Custom"}},c_={title:"External MCP Servers",subtitle:"Tools advertised by these servers are exposed to the in-process native agent (via mcp_<server>_<tool> naming). CLI agents have their own MCP configs and ignore this list. Header values may contain bearer tokens — 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"},u_={title:"Native Agent · Evaluator · Heartbeat",subtitle:"Behavior knobs for the in-process native agent and the two LLM-driven gates (notification evaluator, heartbeat). LLM backend + role wiring lives on /settings/llm; this page covers what the agent + gates actually do at runtime.",llmLink:"/settings/llm",refresh:"Refresh",unsaved:"unsaved changes",discard:"Discard",save:"Save",savedToast:"Saved.",agentCard:"Native Agent (in-process)",evaluatorCard:"Notification Evaluator",heartbeatCard:"Heartbeat Scheduler",on:"on",off:"off",roleOverride:"Role override",roleHint:"LLM role the native loop resolves. Default: native-chat (falls back to cheap). Match a key from /settings/llm role bindings.",approvalMode:"Approval mode",approvalHint:"How tool calls from the native loop are gated.",modeReadOnly:"read-only (safe default; built-ins only)",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 backend → 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 (v1.2.126)",runtimeDesc:"Hard caps for native-agent tool calls + retries. All keys hot-reload; no restart needed. Leave blank to use defaults.",toolResultCap:"Max tool-result chars",toolResultCapHint:"IMHUB_NATIVE_TOOL_RESULT_MAX_CHARS. Truncates + appends a note. Default 64000.",toolTimeoutMs:"Per-tool timeout (ms)",toolTimeoutHint:"IMHUB_NATIVE_TOOL_TIMEOUT_MS. Default 60000 (60 s).",blankRetryMax:"Blank-response retries",blankRetryHint:"IMHUB_NATIVE_BLANK_RETRY_MAX. Times to retry when the model returns empty text. Default 1.",lengthRecoveryMax:"Length-truncation continues",lengthRecoveryHint:"IMHUB_NATIVE_LENGTH_RECOVERY_MAX. Times to auto-continue on finishReason=length. Default 1.",a2aCard:"A2A sub-agent spawn (v1.2.127)",a2aDesc:"When the model calls `mcp__imhub__call_agent`, depth + timeout caps apply, and native→native fast-paths in-process. All hot-reload.",a2aMaxDepth:"Max recursion depth",a2aMaxDepthHint:"IMHUB_A2A_MAX_DEPTH. Hard cap on nested call_agent chains. Default 1.",a2aTimeoutMs:"Default timeout (ms)",a2aTimeoutMsHint:"IMHUB_A2A_TIMEOUT_DEFAULT_MS. Default 1800000 (30 min).",callAgentInProcess:"Native→native in-process",callAgentInProcessHint:"IMHUB_NATIVE_CALL_AGENT_IN_PROCESS. Off falls back to the CLI subprocess. Default on.",callAgentMaxPerTurn:"Calls per turn cap",callAgentMaxPerTurnHint:"IMHUB_NATIVE_CALL_AGENT_MAX_PER_TURN. 0 = unlimited. Default 2.",criticCard:"Early stop + critic (v1.2.127)",criticDesc:"Semantic stuck-loop kills 3-strike same-intent across tools. Critic is an opt-in goal-divergence detector.",semanticStuckLoop:"Semantic stuck-loop",semanticStuckLoopHint:"IMHUB_NATIVE_SEMANTIC_STUCK_LOOP. Default on; off disables the v1.2.122 cross-tool dedup.",criticEnabled:"Goal critic",criticEnabledHint:"IMHUB_NATIVE_CRITIC. Off by default; on enables off-track early-stop reviews.",criticRole:"Critic LLM role",criticRoleHint:"IMHUB_NATIVE_CRITIC_ROLE. Optional override (else uses main backend).",planModeDefault:"PlanMode default state",planModeDefaultHint:"IMHUB_NATIVE_PLAN_MODE. Default off; `/plan on` toggles per-thread regardless.",planIntentAuto:"Plan-intent auto-enter (v1.2.135)",planIntentAutoHint:"IMHUB_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:"IMHUB_PLAN_INTENT_PHRASES. Comma-separated. Empty = use built-in CN/EN defaults. Matching is case-insensitive substring.",compactCard:"Auto-compact (v1.2.127)",compactDesc:"Head + summary + tail (OpenHands Condenser). Triggers when total chars > threshold; KEEP_FIRST preserves original goal.",compactTriggerChars:"Trigger chars",compactTriggerCharsHint:"IMHUB_NATIVE_COMPACT_TRIGGER_CHARS. Set 0 to disable. Default 60000.",compactKeepTurns:"Keep last N pairs",compactKeepTurnsHint:"IMHUB_NATIVE_COMPACT_KEEP_TURNS. Tail size in user/assistant turns. Default 6.",compactKeepFirst:"Keep first N user msgs",compactKeepFirstHint:"IMHUB_NATIVE_COMPACT_KEEP_FIRST. Head preserves original user goal(s). Default 1.",compactSummaryChars:"Summary char cap",compactSummaryCharsHint:"IMHUB_NATIVE_COMPACT_SUMMARY_CHARS. Cap on the LLM-generated summary. Default 1500.",streamCard:"Streaming + iteration (v1.2.127)",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:"IMHUB_NATIVE_STREAM_PARTIAL. Default on; off uses legacy non-stream path.",maxIter:"Max iterations",maxIterHint:"IMHUB_NATIVE_AGENT_MAX_ITER. Clamped to [1,100]. Default 50 (v1.2.136; bumped from 20)."},d_={title:"Web search providers",subtitle:"Backend chain for the native_web_search tool. Falls through to the next provider on error. Clear a key to remove it; type to overwrite. All changes hot-reload.",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 IMHUB_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}}"},f_={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"},h_={title:"agim Skills",tab:{installed:"Installed",hot:"skillhub Hot"},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__imhub__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",pathLabel:"Workspace path:",binsLabel:"Required bins:",envLabel:"Required env:",none:"none"},p_={pageTitle:QO,subtitle:XO,tabs:JO,agents:ZO,policy:e_,messengers:t_,email:n_,viewerSettings:r_,workspaces:i_,service:o_,security:a_,admins:s_,llm:l_,mcp:c_,nativeAgent:u_,search:d_,mobile:f_,agimSkills:h_},m_="设置",g_="运维配置:环境变量与服务生命周期。",y_={messengers:"IM 平台",email:"邮件 (SMTP)",viewer:"Viewer & 地图",agents:"Agent",llm:"LLM 后端",mcp:"MCP 服务器",nativeAgent:"Native Agent",search:"Web 搜索",mobile:"手机端",agimSkills:"agim Skills",policy:"策略",security:"安全",workspaces:"工作区",admins:"管理员",env:"环境变量",service:"服务"},v_={title:"Agent",subtitle:"内置 Agent 适配器。启用宿主机已安装 CLI 的;并选择一个作为默认 Agent(用于路由无法判定的消息)。`native` 是内置 in-process 智能体,无需安装。",installHint:"未安装。在宿主机执行 `npm install -g {{pkg}}`。",nativeInstallHint:"未配置 LLM 后端。前往 设置 → Native Agent 选项卡,配置 OpenAI / DeepSeek / Anthropic 等任一即可使用。",inProcessBadge:"内置",inProcessHint:"in-process — 跑在 agim 进程内,无需安装外部 CLI",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。"}}},b_={title:"策略与开关",subtitle:"高频切换的开关,底层操作的是 env 值。每个开关变更后立即持久化;多数模块支持热加载,少数需要等下次服务重启。",savingToast:"已保存",safety:{title:"跳过权限确认(危险)",description:"打开后,Claude Code 适配器会向 CLI 传递 `--dangerously-skip-permissions`,跳过所有工具调用确认。生产环境强烈建议保持关闭;仅在隔离的可信工作区内启用。",envKey:"IMHUB_DANGEROUSLY_SKIP_PERMISSIONS",tagWarn:"生产部署建议保持关闭"},approval:{title:"审批超时默认行为",description:'当 pending 的工具调用无人响应而超时时审批 bus 的行为。`拒绝` 是安全默认值,会让 Bash / Edit / Write 等写入调用保持阻断;`放行` 是"用户离开"模式,让 Agent 继续运行。',envKey:"IMHUB_TIMEOUT_DEFAULT",valDeny:"超时拒绝",valAllow:"超时放行"},memory:{title:"长期记忆",description:"每用户记忆子系统(事实 + persona + 向量检索)的总开关。关闭后停止抽取新事实和 persona 整理;已有数据保留在磁盘。",envKey:"IMHUB_MEMORY_ENABLED"},viewer:{title:"长消息查看器",description:"打开后,超过阈值的 IM 回复会被上传到本地 paste 存储,IM 消息变成一个可点击的短链。关闭则消息会被 IM 平台截断。",envKey:"IMHUB_VIEWER_ENABLED"},a2aNotify:{title:"A2A 通知模式",description:"Agent 间互相调用时 bus 的提示详细程度。`essential`(默认)仅发关键事件;`verbose` 包含每次状态切换;`off` 完全静默跨 Agent 通知。",envKey:"IMHUB_A2A_NOTIFY_MODE",valEssential:"关键事件",valVerbose:"详细",valOff:"关闭"}},x_={title:"IM 平台",subtitle:"各 IM 平台的连接配置。打开开关、填写凭据、保存;下次服务重启即生效。",saveAll:"全部保存",saving:"保存中…",savedToast:"配置已保存",discardAll:"放弃改动",dirtyHint:"有未保存的改动",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:"open — 任何人都能对话",pairing:"pairing — 第一个私聊的人锁定为唯一对端",allowlist:"allowlist — 只允许名单中的 ID",disabled:"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 将在下次服务重启后启用。"}},w_={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:"无可保存的改动"}},k_={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:"v1.2.43+:未配置任何模式时,agim 默认走 remote 模式上传到 viewer.iclaw.host。勾选此项可关闭该回退(这时长内容会直接 inline)。",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 已清除"}}},S_={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:"编辑",form:{title:"新增或编辑工作区",subtitleEdit:"编辑已有工作区 — 改 ID 可克隆,保持原 ID 即 upsert。",id:"ID",idHint:"稳定标识符;只允许 [a-zA-Z0-9_-]+;`default` 为保留名。",name:"显示名",agents:"Agent 白名单",agentsHint:"逗号分隔;为空 = 允许所有已注册 Agent。",members:"成员用户 ID",membersHint:"逗号分隔,形如 `platform:userId`;为空 = 开放工作区。",rateLimit:"限流(可选)",rate:"调用数",intervalSec:"周期(秒)",burst:"突发上限",submit:"保存工作区",reset:"清空表单"},toast:{saved:"工作区已保存"}},E_={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 以绑定新端口"}}},C_={title:"安全",subtitle:"工具沙盒、SSRF 拦截、发送方门禁、运行时审计。改动立即写入 env 文件;多数 native 工具读 process.env,下次工具调用即生效;exec 沙盒和发送方门禁需要「重启服务」生效。",diagnostics:{title:"运行时诊断",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:"允许列表,逗号分隔 platform:userId 对,例如 telegram:8754479311,wechat-ilink:wxid_abc。设为 * 显式表示「所有人都允许」。空值 = 开放访问(保持向后兼容;启动日志 OPEN_IM_ACCESS)。",envKey:"IMHUB_ALLOWED_USERS",placeholder:"platform:userId,platform:userId"},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__imhub__call_agent 允许的最多次数。防止 native 死循环委托给 CLI agent。0 = 无限。",envKey:"IMHUB_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:"IMHUB_PLATFORM_BLACKLIST",placeholder:"telegram,discord",currentLabel:"当前生效"},diagnosticsPlatformBlacklist:"IM 平台黑名单",savingToast:"已保存。",resetTitle:"清空 (使用默认值)"},A_={title:"管理员名单",subtitle:"可执行管理员级命令的 IM 用户(`/admin promote`、`/admin token` 等)。名单保存在 `IMHUB_ADMIN_USERS` 环境变量;仅当 agim Web 端口本地绑定时才能在此编辑。",configured:"名单已配置",notConfigured:"尚未配置名单 — 任何持有 CLI bootstrap token 的人都可自我提权。",bootstrapAvailable:"Bootstrap token 文件存在",bootstrapPath:"文件路径",empty:"暂无管理员。",col:{platform:"平台",userId:"用户 ID"},add:{title:"添加管理员",platform:"平台",userId:"用户 ID",submit:"添加"},remove:{label:"移除",confirmTitle:"确认移除该管理员?",confirmDescription:"该用户将失去所有管理员命令访问权限。可再次添加恢复。"},toast:{added:"已添加",removed:"已移除"}},T_={title:"Native LLM 后端",subtitle:"这些后端为进程内 native agent 及内部 introspection 调用方(记忆提取、意图分类、通知评估器、心跳)提供能力。后端元数据保存在 ~/.agim/config.json;API Key 保存在 ~/.agim/llm-secrets.json(0600)或 AGIM_LLM_SECRET_<NAME> 环境变量。",refresh:"刷新",backendsTitle:"后端 ({{count}})",backendsEmpty:"尚未配置 LLM 后端。请在下方添加。",rolesTitle:"角色绑定",addTitle:"添加后端",col:{name:"名称",provider:"提供商",model:"模型",baseUrl:"Base URL",apiKey:"API Key",actions:"操作"},secretMissing:"缺失",ping:"探测",remove:"删除",pinging:"探测中…",setKeyFirst:"请先设置 API Key",pingHint:"发送一次小型 chat 探测",removeConfirm:'删除后端 "{{name}}"?角色绑定与 API Key 将被清除。',removedToast:"已删除(同时清除 {{count}} 个角色绑定)。",roleUpdated:"已更新角色 {{role}}",unset:"(未设置)",unbound:"(未绑定)",roleHint:{cheap:"内部 introspection:记忆提取、意图分类、回退链第一阶段。",evaluator:"通知评估器 + router-compare 裁判 LLM。","native-chat":"/na agent 循环默认角色;/cc native 调用时使用。"},preset:"提供商预设",name:"名称",namePlaceholder:"如 deepseek-cheap",baseUrl:"Base URL",baseUrlPlaceholder:"https://api.example.com/v1",model:"模型",modelPlaceholder:"model-id",apiKeyOptional:"API Key(可选)",apiKeyPlaceholder:"sk-...",addBackend:"添加后端",invalidPreset:"无效预设",nameRequired:"名称必填",baseUrlRequired:"baseUrl 必填",modelRequired:"model 必填",addedWithKey:'已添加 "{{name}}"(含 API Key)',addedNoKey:'已添加 "{{name}}"(请单独设置 Key)',presets:{deepseek:"DeepSeek",moonshot:"Moonshot Kimi",zhipu:"智谱 GLM",openai:"OpenAI",anthropic:"Anthropic",custom:"自定义"}},R_={title:"外部 MCP 服务器",subtitle:"这些服务器提供的工具会暴露给进程内 native 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:"添加服务器"},P_={title:"Native Agent · 评估器 · 心跳",subtitle:"进程内 native agent 及两个 LLM 驱动门控(通知评估器、心跳)的运行时行为。LLM 后端与角色绑定在 /settings/llm;本页配置 agent 与门控的实际行为。",llmLink:"/settings/llm",refresh:"刷新",unsaved:"有未保存改动",discard:"放弃",save:"保存",savedToast:"已保存。",agentCard:"Native Agent(进程内)",evaluatorCard:"通知评估器",heartbeatCard:"心跳调度器",on:"开",off:"关",roleOverride:"角色覆盖",roleHint:"native 循环解析的 LLM 角色。默认 native-chat(回退 cheap)。需与 /settings/llm 中的角色绑定一致。",approvalMode:"审批模式",approvalHint:"native 循环中工具调用的门控方式。",modeReadOnly:"read-only(安全默认;仅内置工具)",modeAllowList:"allow-list(仅 autoAllow 条目)",modeAllowAll:"allow-all(所有工具,无门控)",modeDenyAll:"deny-all(禁止工具)",autoAllow:"自动允许工具前缀",autoAllowHint:"逗号分隔。名称以任一前缀开头的工具绕过门控(如 native_,mcp_filesystem_)。",denyList:"拒绝列表工具前缀",denyListHint:"逗号分隔。无论模式如何始终拒绝(如 mcp_shell_)。",evalDesc:"过滤例行/空的 agent 主动推送消息的 LLM 门控。使用 evaluator 角色。失败开放:LLM 错误或缺少后端 → 仍投递消息。",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:"运行参数(v1.2.126)",runtimeDesc:"Native agent 工具调用与重试的硬上限。所有键热生效,无需重启服务。留空使用默认值。",toolResultCap:"单次工具返回最大字符",toolResultCapHint:"IMHUB_NATIVE_TOOL_RESULT_MAX_CHARS。超出截断+附说明。默认 64000。",toolTimeoutMs:"单次工具超时(毫秒)",toolTimeoutHint:"IMHUB_NATIVE_TOOL_TIMEOUT_MS。默认 60000(60 秒)。",blankRetryMax:"空响应重试上限",blankRetryHint:"IMHUB_NATIVE_BLANK_RETRY_MAX。模型连续返回空文本时的重试次数。默认 1。",lengthRecoveryMax:"长度截断续写上限",lengthRecoveryHint:"IMHUB_NATIVE_LENGTH_RECOVERY_MAX。finishReason=length 时自动续写次数。默认 1。",a2aCard:"A2A 子 Agent 派生(v1.2.127)",a2aDesc:"模型调用 `mcp__imhub__call_agent` 时的深度 / 超时 / 同进程 / 单轮上限。native→native 默认走同进程快路径。所有键热生效。",a2aMaxDepth:"递归深度上限",a2aMaxDepthHint:"IMHUB_A2A_MAX_DEPTH。call_agent 嵌套调用最大层数。默认 1。",a2aTimeoutMs:"默认超时(毫秒)",a2aTimeoutMsHint:"IMHUB_A2A_TIMEOUT_DEFAULT_MS。默认 1800000(30 分钟)。",callAgentInProcess:"native→native 同进程",callAgentInProcessHint:"IMHUB_NATIVE_CALL_AGENT_IN_PROCESS。关闭则回退到子进程 CLI。默认开。",callAgentMaxPerTurn:"单轮调用上限",callAgentMaxPerTurnHint:"IMHUB_NATIVE_CALL_AGENT_MAX_PER_TURN。0 = 不限。默认 2。",criticCard:"早停 + 复盘(v1.2.127)",criticDesc:"语义死循环检测识别「3 次同意图但工具不同」的情形并早停。Critic 是可选的目标偏离检测器。",semanticStuckLoop:"语义死循环检测",semanticStuckLoopHint:"IMHUB_NATIVE_SEMANTIC_STUCK_LOOP。默认开;关闭即关掉 v1.2.122 的跨工具去重。",criticEnabled:"Goal Critic 复盘",criticEnabledHint:"IMHUB_NATIVE_CRITIC。默认关;开启后启用目标偏离早停。",criticRole:"Critic LLM role",criticRoleHint:"IMHUB_NATIVE_CRITIC_ROLE。可选 override(留空走主后端)。",planModeDefault:"PlanMode 默认状态",planModeDefaultHint:"IMHUB_NATIVE_PLAN_MODE。默认关;`/plan on` 在单线程内可独立切换不受此影响。",planIntentAuto:"Plan 意图自动入场(v1.2.135)",planIntentAutoHint:"IMHUB_PLAN_INTENT_AUTO。开启后,含「先想想 / plan only / 不要直接做」等关键词的 prompt 会临时进入 plan 模式,仅本轮生效;从不自动退出——必须 /plan off 或模型调 native_exit_plan_mode。",planIntentPhrases:"意图关键词列表(可选覆盖)",planIntentPhrasesHint:"IMHUB_PLAN_INTENT_PHRASES。逗号分隔。留空则用内置中英文默认列表。匹配方式:大小写不敏感的子串。",compactCard:"Auto-compact 自动摘要(v1.2.127)",compactDesc:"Head + summary + tail(OpenHands Condenser)。总字符数超过阈值时触发;KEEP_FIRST 保留原始 user goal。",compactTriggerChars:"触发字符数",compactTriggerCharsHint:"IMHUB_NATIVE_COMPACT_TRIGGER_CHARS。设为 0 禁用。默认 60000。",compactKeepTurns:"保留最后 N 对",compactKeepTurnsHint:"IMHUB_NATIVE_COMPACT_KEEP_TURNS。tail 保留的 user/assistant 对数。默认 6。",compactKeepFirst:"保留前 N 条 user 消息",compactKeepFirstHint:"IMHUB_NATIVE_COMPACT_KEEP_FIRST。head 保留原始 user 目标。默认 1。",compactSummaryChars:"摘要字符上限",compactSummaryCharsHint:"IMHUB_NATIVE_COMPACT_SUMMARY_CHARS。LLM 生成摘要的字符上限。默认 1500。",streamCard:"流式 + 迭代(v1.2.127)",streamDesc:"流式回传可在 IM 30 分钟硬超时时保留部分文本。max-iter 是工具循环的最坏上限。",streamPartial:"流式增量回写",streamPartialHint:"IMHUB_NATIVE_STREAM_PARTIAL。默认开;关闭走旧的非流式路径。",maxIter:"迭代上限",maxIterHint:"IMHUB_NATIVE_AGENT_MAX_ITER。范围 [1,100]。默认 50(v1.2.136 起,原为 20)。"},I_={title:"Web 搜索 Provider",subtitle:"native_web_search 工具的后端链路。失败时按顺序回退到下一家。键留空 = 删除该值;填则覆盖。所有修改热生效。",refresh:"刷新",save:"保存",discard:"放弃",unsaved:"有未保存改动",savedToast:"已保存。下一次搜索即生效。",chainLabel:"当前生效链路:",chainEmpty:"无可用 provider",chainHint:"由 IMHUB_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}}"},L_={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:"手机端聊天登录二维码"},O_={title:"agim Skills",tab:{installed:"已安装",hot:"skillhub 热门"},reload:"从磁盘重新加载",subtitle:"由 src/core/skills/loader.ts 加载的 SKILL.md 文件。Tier-1 摘要(name + description)自动注入每个 agent 系统提示;完整正文通过 mcp__imhub__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:"名称必填",pathLabel:"工作区路径:",binsLabel:"依赖二进制:",envLabel:"依赖环境变量:",none:"无"},__={pageTitle:m_,subtitle:g_,tabs:y_,agents:v_,policy:b_,messengers:x_,email:w_,viewerSettings:k_,workspaces:S_,service:E_,security:C_,admins:A_,llm:T_,mcp:R_,nativeAgent:P_,search:I_,mobile:L_,agimSkills:O_};Je.use(lp).use(Ig).init({resources:{en:{common:OR,errors:AP,tasks:yI,approvals:UI,reminders:dL,memos:OL,memory:XL,skills:fO,workspace:CO,observability:UO,settings:p_},zh:{common:qR,errors:oI,tasks:PI,approvals:ZI,reminders:SL,memos:UL,memory:sO,skills:yO,workspace:_O,observability:YO,settings:__}},lng:N_(),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:[]}});function N_(){try{const e=localStorage.getItem("im-hub-lang");if(e==="en"||e==="zh")return e}catch{}return(navigator.language||"en").toLowerCase().startsWith("zh")?"zh":"en"}function D_(e){Je.language!==e&&Je.changeLanguage(e)}var[Ao]=mo("Tooltip",[xo]),qs=xo(),cp="TooltipProvider",M_=700,Ou="tooltip.open",[j_,up]=Ao(cp),dp=e=>{const{__scopeTooltip:t,delayDuration:n=M_,skipDelayDuration:r=300,disableHoverableContent:i=!1,children:o}=e,a=g.useRef(!0),s=g.useRef(!1),l=g.useRef(0);return g.useEffect(()=>{const c=l.current;return()=>window.clearTimeout(c)},[]),v.jsx(j_,{scope:t,isOpenDelayedRef:a,delayDuration:n,onOpen:g.useCallback(()=>{r<=0||(window.clearTimeout(l.current),a.current=!1)},[r]),onClose:g.useCallback(()=>{r<=0||(window.clearTimeout(l.current),l.current=window.setTimeout(()=>a.current=!0,r))},[r]),isPointerInTransitRef:s,onPointerInTransitChange:g.useCallback(c=>{s.current=c},[]),disableHoverableContent:i,children:o})};dp.displayName=cp;var fp="Tooltip",[uN,To]=Ao(fp),Ga="TooltipTrigger",F_=g.forwardRef((e,t)=>{const{__scopeTooltip:n,...r}=e,i=To(Ga,n),o=up(Ga,n),a=qs(n),s=g.useRef(null),l=Ye(t,s,i.onTriggerChange),c=g.useRef(!1),u=g.useRef(!1),d=g.useCallback(()=>c.current=!1,[]);return g.useEffect(()=>()=>document.removeEventListener("pointerup",d),[d]),v.jsx(ch,{asChild:!0,...a,children:v.jsx(Ue.button,{"aria-describedby":i.open?i.contentId:void 0,"data-state":i.stateAttribute,...r,ref:l,onPointerMove:je(e.onPointerMove,h=>{h.pointerType!=="touch"&&!u.current&&!o.isPointerInTransitRef.current&&(i.onTriggerEnter(),u.current=!0)}),onPointerLeave:je(e.onPointerLeave,()=>{i.onTriggerLeave(),u.current=!1}),onPointerDown:je(e.onPointerDown,()=>{i.open&&i.onClose(),c.current=!0,document.addEventListener("pointerup",d,{once:!0})}),onFocus:je(e.onFocus,()=>{c.current||i.onOpen()}),onBlur:je(e.onBlur,i.onClose),onClick:je(e.onClick,i.onClose)})})});F_.displayName=Ga;var H_="TooltipPortal",[dN,B_]=Ao(H_,{forceMount:void 0}),yr="TooltipContent",hp=g.forwardRef((e,t)=>{const n=B_(yr,e.__scopeTooltip),{forceMount:r=n.forceMount,side:i="top",...o}=e,a=To(yr,e.__scopeTooltip);return v.jsx(js,{present:r||a.open,children:a.disableHoverableContent?v.jsx(pp,{side:i,...o,ref:t}):v.jsx(U_,{side:i,...o,ref:t})})}),U_=g.forwardRef((e,t)=>{const n=To(yr,e.__scopeTooltip),r=up(yr,e.__scopeTooltip),i=g.useRef(null),o=Ye(t,i),[a,s]=g.useState(null),{trigger:l,onClose:c}=n,u=i.current,{onPointerInTransitChange:d}=r,h=g.useCallback(()=>{s(null),d(!1)},[d]),f=g.useCallback((m,p)=>{const y=m.currentTarget,b={x:m.clientX,y:m.clientY},x=W_(b,y.getBoundingClientRect()),w=q_(b,x),T=G_(p.getBoundingClientRect()),I=Q_([...w,...T]);s(I),d(!0)},[d]);return g.useEffect(()=>()=>h(),[h]),g.useEffect(()=>{if(l&&u){const m=y=>f(y,u),p=y=>f(y,l);return l.addEventListener("pointerleave",m),u.addEventListener("pointerleave",p),()=>{l.removeEventListener("pointerleave",m),u.removeEventListener("pointerleave",p)}}},[l,u,f,h]),g.useEffect(()=>{if(a){const m=p=>{const y=p.target,b={x:p.clientX,y:p.clientY},x=l?.contains(y)||u?.contains(y),w=!Y_(b,a);x?h():w&&(h(),c())};return document.addEventListener("pointermove",m),()=>document.removeEventListener("pointermove",m)}},[l,u,a,c,h]),v.jsx(pp,{...e,ref:o})}),[z_,$_]=Ao(fp,{isInside:!1}),V_=Zg("TooltipContent"),pp=g.forwardRef((e,t)=>{const{__scopeTooltip:n,children:r,"aria-label":i,onEscapeKeyDown:o,onPointerDownOutside:a,...s}=e,l=To(yr,n),c=qs(n),{onClose:u}=l;return g.useEffect(()=>(document.addEventListener(Ou,u),()=>document.removeEventListener(Ou,u)),[u]),g.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]),v.jsx(As,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:o,onPointerDownOutside:a,onFocusOutside:d=>d.preventDefault(),onDismiss:u,children:v.jsxs(uh,{"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:[v.jsx(V_,{children:r}),v.jsx(z_,{scope:n,isInside:!0,children:v.jsx(lA,{id:l.contentId,role:"tooltip",children:i||r})})]})})});hp.displayName=yr;var mp="TooltipArrow",K_=g.forwardRef((e,t)=>{const{__scopeTooltip:n,...r}=e,i=qs(n);return $_(mp,n).isInside?null:v.jsx(dh,{...i,...r,ref:t})});K_.displayName=mp;function W_(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 q_(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 G_(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 Y_(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 Q_(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),X_(t)}function X_(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 J_=dp,gp=hp;const Z_=J_,eN=g.forwardRef(({className:e,sideOffset:t=4,...n},r)=>v.jsx(gp,{ref:r,sideOffset:t,className:Le("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}));eN.displayName=gp.displayName;function tN(e){return v.jsx(Yv,{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 nN({children:e}){const t=cr(r=>r.lang),{i18n:n}=kt();return g.useEffect(()=>{n.language!==t&&D_(t)},[t,n]),v.jsx(v.Fragment,{children:e})}function rN({children:e}){return ET(),v.jsx(v.Fragment,{children:e})}function iN({children:e}){return g.useEffect(()=>vg(),[]),v.jsx(v.Fragment,{children:e})}function oN({children:e}){return v.jsx(wv,{client:NT,children:v.jsx(nN,{children:v.jsx(rN,{children:v.jsx(iN,{children:v.jsxs(Z_,{children:[e,v.jsx(tN,{})]})})})})})}const yp=document.getElementById("root");if(!yp)throw new Error("agim: #root not found in index.html");oa.createRoot(yp).render(v.jsx(V.StrictMode,{children:v.jsx(oN,{children:v.jsx(_T,{})})}));export{Hg as $,Vn as A,bt as B,id as C,XC as D,ch as E,xo as F,js as G,fh as H,Pd as I,fA as J,tb as K,Od as L,RE as M,yl as N,sN as O,Ue as P,Sh as Q,Wg as R,za as S,Jh as T,Uf as U,As as V,uh as W,Gr as X,dh as Y,Xg as Z,xa as _,xv as a,qg as a0,cN as a1,ni as a2,av as a3,Xy as a4,Zy as a5,ga as a6,Et as a7,gd as a8,Yy as a9,Qy as aa,ma as ab,hd as ac,pv as ad,tv as ae,tt as af,iv as ag,fb as ah,xT as ai,lE as aj,fE as ak,kv as b,Le as c,Jv as d,fg as e,Yi as f,$a as g,Qi as h,Mn as i,v as j,st as k,Ot as l,Zv as m,ht as n,G as o,Qg as p,Fg as q,Gg as r,mo as s,yE as t,kt as u,Ts as v,je as w,Ye as x,bE as y,ou as z};
199
+ //# sourceMappingURL=index-DEWFfW_Z.js.map